aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalle Valo <kvalo@codeaurora.org>2015-05-03 16:53:02 -0400
committerKalle Valo <kvalo@codeaurora.org>2015-05-03 16:53:02 -0400
commit0581276deb9c2578a17d9f4463e7b5172da99eb9 (patch)
treef0db48425cbec4f41242ebefd6f04b18e87f9cb9
parent414b7e3b9ce8b0577f613e656fdbc36b34b444dd (diff)
parente7afe89fd67d40a7f5fff8130c5f925d99a94b1f (diff)
Merge tag 'iwlwifi-for-kalle-2015-04-28' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes
* fix firmware API for -13.ucode * fix RSSI handling that avoid bad roaming decision * fix firmware debug * fix MFUART operation * fix ASSERT while restart the hardware (because of another ASSERT e.g)
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-fw-file.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.h41
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/d3.c2
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/fw-api-power.h34
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h44
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/fw-api.h13
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/fw.c54
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mac80211.c26
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mvm.h1
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/ops.c10
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/rx.c5
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/scan.c2
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/trans.c17
13 files changed, 135 insertions, 116 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-fw-file.h b/drivers/net/wireless/iwlwifi/iwl-fw-file.h
index bfdf3faa6c47..62db2e5e45eb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fw-file.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fw-file.h
@@ -244,6 +244,7 @@ enum iwl_ucode_tlv_flag {
244 * longer than the passive one, which is essential for fragmented scan. 244 * longer than the passive one, which is essential for fragmented scan.
245 * @IWL_UCODE_TLV_API_WIFI_MCC_UPDATE: ucode supports MCC updates with source. 245 * @IWL_UCODE_TLV_API_WIFI_MCC_UPDATE: ucode supports MCC updates with source.
246 * IWL_UCODE_TLV_API_HDC_PHASE_0: ucode supports finer configuration of LTR 246 * IWL_UCODE_TLV_API_HDC_PHASE_0: ucode supports finer configuration of LTR
247 * @IWL_UCODE_TLV_API_TX_POWER_DEV: new API for tx power.
247 * @IWL_UCODE_TLV_API_BASIC_DWELL: use only basic dwell time in scan command, 248 * @IWL_UCODE_TLV_API_BASIC_DWELL: use only basic dwell time in scan command,
248 * regardless of the band or the number of the probes. FW will calculate 249 * regardless of the band or the number of the probes. FW will calculate
249 * the actual dwell time. 250 * the actual dwell time.
@@ -260,6 +261,7 @@ enum iwl_ucode_tlv_api {
260 IWL_UCODE_TLV_API_FRAGMENTED_SCAN = BIT(8), 261 IWL_UCODE_TLV_API_FRAGMENTED_SCAN = BIT(8),
261 IWL_UCODE_TLV_API_WIFI_MCC_UPDATE = BIT(9), 262 IWL_UCODE_TLV_API_WIFI_MCC_UPDATE = BIT(9),
262 IWL_UCODE_TLV_API_HDC_PHASE_0 = BIT(10), 263 IWL_UCODE_TLV_API_HDC_PHASE_0 = BIT(10),
264 IWL_UCODE_TLV_API_TX_POWER_DEV = BIT(11),
263 IWL_UCODE_TLV_API_BASIC_DWELL = BIT(13), 265 IWL_UCODE_TLV_API_BASIC_DWELL = BIT(13),
264 IWL_UCODE_TLV_API_SCD_CFG = BIT(15), 266 IWL_UCODE_TLV_API_SCD_CFG = BIT(15),
265 IWL_UCODE_TLV_API_SINGLE_SCAN_EBS = BIT(16), 267 IWL_UCODE_TLV_API_SINGLE_SCAN_EBS = BIT(16),
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 6dfed1259260..56254a837214 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -6,7 +6,7 @@
6 * GPL LICENSE SUMMARY 6 * GPL LICENSE SUMMARY
7 * 7 *
8 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. 8 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as 12 * it under the terms of version 2 of the GNU General Public License as
@@ -32,7 +32,7 @@
32 * BSD LICENSE 32 * BSD LICENSE
33 * 33 *
34 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 34 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
35 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 35 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
36 * All rights reserved. 36 * All rights reserved.
37 * 37 *
38 * Redistribution and use in source and binary forms, with or without 38 * Redistribution and use in source and binary forms, with or without
@@ -421,8 +421,9 @@ struct iwl_trans_txq_scd_cfg {
421 * 421 *
422 * All the handlers MUST be implemented 422 * All the handlers MUST be implemented
423 * 423 *
424 * @start_hw: starts the HW- from that point on, the HW can send interrupts 424 * @start_hw: starts the HW. If low_power is true, the NIC needs to be taken
425 * May sleep 425 * out of a low power state. From that point on, the HW can send
426 * interrupts. May sleep.
426 * @op_mode_leave: Turn off the HW RF kill indication if on 427 * @op_mode_leave: Turn off the HW RF kill indication if on
427 * May sleep 428 * May sleep
428 * @start_fw: allocates and inits all the resources for the transport 429 * @start_fw: allocates and inits all the resources for the transport
@@ -432,10 +433,11 @@ struct iwl_trans_txq_scd_cfg {
432 * the SCD base address in SRAM, then provide it here, or 0 otherwise. 433 * the SCD base address in SRAM, then provide it here, or 0 otherwise.
433 * May sleep 434 * May sleep
434 * @stop_device: stops the whole device (embedded CPU put to reset) and stops 435 * @stop_device: stops the whole device (embedded CPU put to reset) and stops
435 * the HW. From that point on, the HW will be in low power but will still 436 * the HW. If low_power is true, the NIC will be put in low power state.
436 * issue interrupt if the HW RF kill is triggered. This callback must do 437 * From that point on, the HW will be stopped but will still issue an
437 * the right thing and not crash even if start_hw() was called but not 438 * interrupt if the HW RF kill switch is triggered.
438 * start_fw(). May sleep 439 * This callback must do the right thing and not crash even if %start_hw()
440 * was called but not &start_fw(). May sleep.
439 * @d3_suspend: put the device into the correct mode for WoWLAN during 441 * @d3_suspend: put the device into the correct mode for WoWLAN during
440 * suspend. This is optional, if not implemented WoWLAN will not be 442 * suspend. This is optional, if not implemented WoWLAN will not be
441 * supported. This callback may sleep. 443 * supported. This callback may sleep.
@@ -491,14 +493,14 @@ struct iwl_trans_txq_scd_cfg {
491 */ 493 */
492struct iwl_trans_ops { 494struct iwl_trans_ops {
493 495
494 int (*start_hw)(struct iwl_trans *iwl_trans); 496 int (*start_hw)(struct iwl_trans *iwl_trans, bool low_power);
495 void (*op_mode_leave)(struct iwl_trans *iwl_trans); 497 void (*op_mode_leave)(struct iwl_trans *iwl_trans);
496 int (*start_fw)(struct iwl_trans *trans, const struct fw_img *fw, 498 int (*start_fw)(struct iwl_trans *trans, const struct fw_img *fw,
497 bool run_in_rfkill); 499 bool run_in_rfkill);
498 int (*update_sf)(struct iwl_trans *trans, 500 int (*update_sf)(struct iwl_trans *trans,
499 struct iwl_sf_region *st_fwrd_space); 501 struct iwl_sf_region *st_fwrd_space);
500 void (*fw_alive)(struct iwl_trans *trans, u32 scd_addr); 502 void (*fw_alive)(struct iwl_trans *trans, u32 scd_addr);
501 void (*stop_device)(struct iwl_trans *trans); 503 void (*stop_device)(struct iwl_trans *trans, bool low_power);
502 504
503 void (*d3_suspend)(struct iwl_trans *trans, bool test); 505 void (*d3_suspend)(struct iwl_trans *trans, bool test);
504 int (*d3_resume)(struct iwl_trans *trans, enum iwl_d3_status *status, 506 int (*d3_resume)(struct iwl_trans *trans, enum iwl_d3_status *status,
@@ -652,11 +654,16 @@ static inline void iwl_trans_configure(struct iwl_trans *trans,
652 trans->ops->configure(trans, trans_cfg); 654 trans->ops->configure(trans, trans_cfg);
653} 655}
654 656
655static inline int iwl_trans_start_hw(struct iwl_trans *trans) 657static inline int _iwl_trans_start_hw(struct iwl_trans *trans, bool low_power)
656{ 658{
657 might_sleep(); 659 might_sleep();
658 660
659 return trans->ops->start_hw(trans); 661 return trans->ops->start_hw(trans, low_power);
662}
663
664static inline int iwl_trans_start_hw(struct iwl_trans *trans)
665{
666 return trans->ops->start_hw(trans, true);
660} 667}
661 668
662static inline void iwl_trans_op_mode_leave(struct iwl_trans *trans) 669static inline void iwl_trans_op_mode_leave(struct iwl_trans *trans)
@@ -703,15 +710,21 @@ static inline int iwl_trans_update_sf(struct iwl_trans *trans,
703 return 0; 710 return 0;
704} 711}
705 712
706static inline void iwl_trans_stop_device(struct iwl_trans *trans) 713static inline void _iwl_trans_stop_device(struct iwl_trans *trans,
714 bool low_power)
707{ 715{
708 might_sleep(); 716 might_sleep();
709 717
710 trans->ops->stop_device(trans); 718 trans->ops->stop_device(trans, low_power);
711 719
712 trans->state = IWL_TRANS_NO_FW; 720 trans->state = IWL_TRANS_NO_FW;
713} 721}
714 722
723static inline void iwl_trans_stop_device(struct iwl_trans *trans)
724{
725 _iwl_trans_stop_device(trans, true);
726}
727
715static inline void iwl_trans_d3_suspend(struct iwl_trans *trans, bool test) 728static inline void iwl_trans_d3_suspend(struct iwl_trans *trans, bool test)
716{ 729{
717 might_sleep(); 730 might_sleep();
diff --git a/drivers/net/wireless/iwlwifi/mvm/d3.c b/drivers/net/wireless/iwlwifi/mvm/d3.c
index a6c48c7b1e16..1b1b2bf26819 100644
--- a/drivers/net/wireless/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/iwlwifi/mvm/d3.c
@@ -1726,7 +1726,7 @@ iwl_mvm_netdetect_query_results(struct iwl_mvm *mvm,
1726 results->matched_profiles = le32_to_cpu(query->matched_profiles); 1726 results->matched_profiles = le32_to_cpu(query->matched_profiles);
1727 memcpy(results->matches, query->matches, sizeof(results->matches)); 1727 memcpy(results->matches, query->matches, sizeof(results->matches));
1728 1728
1729#ifdef CPTCFG_IWLWIFI_DEBUGFS 1729#ifdef CONFIG_IWLWIFI_DEBUGFS
1730 mvm->last_netdetect_scans = le32_to_cpu(query->n_scans_done); 1730 mvm->last_netdetect_scans = le32_to_cpu(query->n_scans_done);
1731#endif 1731#endif
1732 1732
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
index 4fc0938b3fb6..b1baa33cc19b 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
@@ -298,6 +298,40 @@ struct iwl_uapsd_misbehaving_ap_notif {
298} __packed; 298} __packed;
299 299
300/** 300/**
301 * struct iwl_reduce_tx_power_cmd - TX power reduction command
302 * REDUCE_TX_POWER_CMD = 0x9f
303 * @flags: (reserved for future implementation)
304 * @mac_context_id: id of the mac ctx for which we are reducing TX power.
305 * @pwr_restriction: TX power restriction in dBms.
306 */
307struct iwl_reduce_tx_power_cmd {
308 u8 flags;
309 u8 mac_context_id;
310 __le16 pwr_restriction;
311} __packed; /* TX_REDUCED_POWER_API_S_VER_1 */
312
313/**
314 * struct iwl_dev_tx_power_cmd - TX power reduction command
315 * REDUCE_TX_POWER_CMD = 0x9f
316 * @set_mode: 0 - MAC tx power, 1 - device tx power
317 * @mac_context_id: id of the mac ctx for which we are reducing TX power.
318 * @pwr_restriction: TX power restriction in 1/8 dBms.
319 * @dev_24: device TX power restriction in 1/8 dBms
320 * @dev_52_low: device TX power restriction upper band - low
321 * @dev_52_high: device TX power restriction upper band - high
322 */
323struct iwl_dev_tx_power_cmd {
324 __le32 set_mode;
325 __le32 mac_context_id;
326 __le16 pwr_restriction;
327 __le16 dev_24;
328 __le16 dev_52_low;
329 __le16 dev_52_high;
330} __packed; /* TX_REDUCED_POWER_API_S_VER_2 */
331
332#define IWL_DEV_MAX_TX_POWER 0x7FFF
333
334/**
301 * struct iwl_beacon_filter_cmd 335 * struct iwl_beacon_filter_cmd
302 * REPLY_BEACON_FILTERING_CMD = 0xd2 (command) 336 * REPLY_BEACON_FILTERING_CMD = 0xd2 (command)
303 * @id_and_color: MAC contex identifier 337 * @id_and_color: MAC contex identifier
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
index 4f81dcf57a73..d6cced47d561 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
@@ -122,46 +122,6 @@ enum iwl_scan_complete_status {
122 SCAN_COMP_STATUS_ERR_ALLOC_TE = 0x0C, 122 SCAN_COMP_STATUS_ERR_ALLOC_TE = 0x0C,
123}; 123};
124 124
125/**
126 * struct iwl_scan_results_notif - scan results for one channel
127 * ( SCAN_RESULTS_NOTIFICATION = 0x83 )
128 * @channel: which channel the results are from
129 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
130 * @probe_status: SCAN_PROBE_STATUS_*, indicates success of probe request
131 * @num_probe_not_sent: # of request that weren't sent due to not enough time
132 * @duration: duration spent in channel, in usecs
133 * @statistics: statistics gathered for this channel
134 */
135struct iwl_scan_results_notif {
136 u8 channel;
137 u8 band;
138 u8 probe_status;
139 u8 num_probe_not_sent;
140 __le32 duration;
141 __le32 statistics[SCAN_RESULTS_STATISTICS];
142} __packed; /* SCAN_RESULT_NTF_API_S_VER_2 */
143
144/**
145 * struct iwl_scan_complete_notif - notifies end of scanning (all channels)
146 * ( SCAN_COMPLETE_NOTIFICATION = 0x84 )
147 * @scanned_channels: number of channels scanned (and number of valid results)
148 * @status: one of SCAN_COMP_STATUS_*
149 * @bt_status: BT on/off status
150 * @last_channel: last channel that was scanned
151 * @tsf_low: TSF timer (lower half) in usecs
152 * @tsf_high: TSF timer (higher half) in usecs
153 * @results: array of scan results, only "scanned_channels" of them are valid
154 */
155struct iwl_scan_complete_notif {
156 u8 scanned_channels;
157 u8 status;
158 u8 bt_status;
159 u8 last_channel;
160 __le32 tsf_low;
161 __le32 tsf_high;
162 struct iwl_scan_results_notif results[];
163} __packed; /* SCAN_COMPLETE_NTF_API_S_VER_2 */
164
165/* scan offload */ 125/* scan offload */
166#define IWL_SCAN_MAX_BLACKLIST_LEN 64 126#define IWL_SCAN_MAX_BLACKLIST_LEN 64
167#define IWL_SCAN_SHORT_BLACKLIST_LEN 16 127#define IWL_SCAN_SHORT_BLACKLIST_LEN 16
@@ -554,7 +514,7 @@ struct iwl_scan_req_unified_lmac {
554} __packed; 514} __packed;
555 515
556/** 516/**
557 * struct iwl_lmac_scan_results_notif - scan results for one channel - 517 * struct iwl_scan_results_notif - scan results for one channel -
558 * SCAN_RESULT_NTF_API_S_VER_3 518 * SCAN_RESULT_NTF_API_S_VER_3
559 * @channel: which channel the results are from 519 * @channel: which channel the results are from
560 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz 520 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
@@ -562,7 +522,7 @@ struct iwl_scan_req_unified_lmac {
562 * @num_probe_not_sent: # of request that weren't sent due to not enough time 522 * @num_probe_not_sent: # of request that weren't sent due to not enough time
563 * @duration: duration spent in channel, in usecs 523 * @duration: duration spent in channel, in usecs
564 */ 524 */
565struct iwl_lmac_scan_results_notif { 525struct iwl_scan_results_notif {
566 u8 channel; 526 u8 channel;
567 u8 band; 527 u8 band;
568 u8 probe_status; 528 u8 probe_status;
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api.h b/drivers/net/wireless/iwlwifi/mvm/fw-api.h
index aab68cbae754..01b1da6ad359 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api.h
@@ -281,19 +281,6 @@ struct iwl_tx_ant_cfg_cmd {
281 __le32 valid; 281 __le32 valid;
282} __packed; 282} __packed;
283 283
284/**
285 * struct iwl_reduce_tx_power_cmd - TX power reduction command
286 * REDUCE_TX_POWER_CMD = 0x9f
287 * @flags: (reserved for future implementation)
288 * @mac_context_id: id of the mac ctx for which we are reducing TX power.
289 * @pwr_restriction: TX power restriction in dBms.
290 */
291struct iwl_reduce_tx_power_cmd {
292 u8 flags;
293 u8 mac_context_id;
294 __le16 pwr_restriction;
295} __packed; /* TX_REDUCED_POWER_API_S_VER_1 */
296
297/* 284/*
298 * Calibration control struct. 285 * Calibration control struct.
299 * Sent as part of the phy configuration command. 286 * Sent as part of the phy configuration command.
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw.c b/drivers/net/wireless/iwlwifi/mvm/fw.c
index bc5eac4960e1..df869633f4dd 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/iwlwifi/mvm/fw.c
@@ -6,7 +6,7 @@
6 * GPL LICENSE SUMMARY 6 * GPL LICENSE SUMMARY
7 * 7 *
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as 12 * it under the terms of version 2 of the GNU General Public License as
@@ -32,7 +32,7 @@
32 * BSD LICENSE 32 * BSD LICENSE
33 * 33 *
34 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 34 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
35 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 35 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
36 * All rights reserved. 36 * All rights reserved.
37 * 37 *
38 * Redistribution and use in source and binary forms, with or without 38 * Redistribution and use in source and binary forms, with or without
@@ -322,7 +322,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
322 322
323 lockdep_assert_held(&mvm->mutex); 323 lockdep_assert_held(&mvm->mutex);
324 324
325 if (WARN_ON_ONCE(mvm->init_ucode_complete || mvm->calibrating)) 325 if (WARN_ON_ONCE(mvm->calibrating))
326 return 0; 326 return 0;
327 327
328 iwl_init_notification_wait(&mvm->notif_wait, 328 iwl_init_notification_wait(&mvm->notif_wait,
@@ -396,8 +396,6 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
396 */ 396 */
397 ret = iwl_wait_notification(&mvm->notif_wait, &calib_wait, 397 ret = iwl_wait_notification(&mvm->notif_wait, &calib_wait,
398 MVM_UCODE_CALIB_TIMEOUT); 398 MVM_UCODE_CALIB_TIMEOUT);
399 if (!ret)
400 mvm->init_ucode_complete = true;
401 399
402 if (ret && iwl_mvm_is_radio_killed(mvm)) { 400 if (ret && iwl_mvm_is_radio_killed(mvm)) {
403 IWL_DEBUG_RF_KILL(mvm, "RFKILL while calibrating.\n"); 401 IWL_DEBUG_RF_KILL(mvm, "RFKILL while calibrating.\n");
@@ -494,15 +492,6 @@ int iwl_mvm_fw_dbg_collect_desc(struct iwl_mvm *mvm,
494 492
495 mvm->fw_dump_desc = desc; 493 mvm->fw_dump_desc = desc;
496 494
497 /* stop recording */
498 if (mvm->cfg->device_family == IWL_DEVICE_FAMILY_7000) {
499 iwl_set_bits_prph(mvm->trans, MON_BUFF_SAMPLE_CTL, 0x100);
500 } else {
501 iwl_write_prph(mvm->trans, DBGC_IN_SAMPLE, 0);
502 /* wait before we collect the data till the DBGC stop */
503 udelay(100);
504 }
505
506 queue_delayed_work(system_wq, &mvm->fw_dump_wk, delay); 495 queue_delayed_work(system_wq, &mvm->fw_dump_wk, delay);
507 496
508 return 0; 497 return 0;
@@ -658,25 +647,24 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
658 * module loading, load init ucode now 647 * module loading, load init ucode now
659 * (for example, if we were in RFKILL) 648 * (for example, if we were in RFKILL)
660 */ 649 */
661 if (!mvm->init_ucode_complete) { 650 ret = iwl_run_init_mvm_ucode(mvm, false);
662 ret = iwl_run_init_mvm_ucode(mvm, false); 651 if (ret && !iwlmvm_mod_params.init_dbg) {
663 if (ret && !iwlmvm_mod_params.init_dbg) { 652 IWL_ERR(mvm, "Failed to run INIT ucode: %d\n", ret);
664 IWL_ERR(mvm, "Failed to run INIT ucode: %d\n", ret); 653 /* this can't happen */
665 /* this can't happen */ 654 if (WARN_ON(ret > 0))
666 if (WARN_ON(ret > 0)) 655 ret = -ERFKILL;
667 ret = -ERFKILL; 656 goto error;
668 goto error; 657 }
669 } 658 if (!iwlmvm_mod_params.init_dbg) {
670 if (!iwlmvm_mod_params.init_dbg) { 659 /*
671 /* 660 * Stop and start the transport without entering low power
672 * should stop and start HW since that INIT 661 * mode. This will save the state of other components on the
673 * image just loaded 662 * device that are triggered by the INIT firwmare (MFUART).
674 */ 663 */
675 iwl_trans_stop_device(mvm->trans); 664 _iwl_trans_stop_device(mvm->trans, false);
676 ret = iwl_trans_start_hw(mvm->trans); 665 _iwl_trans_start_hw(mvm->trans, false);
677 if (ret) 666 if (ret)
678 return ret; 667 return ret;
679 }
680 } 668 }
681 669
682 if (iwlmvm_mod_params.init_dbg) 670 if (iwlmvm_mod_params.init_dbg)
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index 84555170b6f7..40265b9c66ae 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -1322,7 +1322,7 @@ static void iwl_mvm_restart_complete(struct iwl_mvm *mvm)
1322 1322
1323 clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); 1323 clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status);
1324 iwl_mvm_d0i3_enable_tx(mvm, NULL); 1324 iwl_mvm_d0i3_enable_tx(mvm, NULL);
1325 ret = iwl_mvm_update_quotas(mvm, false, NULL); 1325 ret = iwl_mvm_update_quotas(mvm, true, NULL);
1326 if (ret) 1326 if (ret)
1327 IWL_ERR(mvm, "Failed to update quotas after restart (%d)\n", 1327 IWL_ERR(mvm, "Failed to update quotas after restart (%d)\n",
1328 ret); 1328 ret);
@@ -1471,8 +1471,8 @@ static struct iwl_mvm_phy_ctxt *iwl_mvm_get_free_phy_ctxt(struct iwl_mvm *mvm)
1471 return NULL; 1471 return NULL;
1472} 1472}
1473 1473
1474static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 1474static int iwl_mvm_set_tx_power_old(struct iwl_mvm *mvm,
1475 s8 tx_power) 1475 struct ieee80211_vif *vif, s8 tx_power)
1476{ 1476{
1477 /* FW is in charge of regulatory enforcement */ 1477 /* FW is in charge of regulatory enforcement */
1478 struct iwl_reduce_tx_power_cmd reduce_txpwr_cmd = { 1478 struct iwl_reduce_tx_power_cmd reduce_txpwr_cmd = {
@@ -1485,6 +1485,26 @@ static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1485 &reduce_txpwr_cmd); 1485 &reduce_txpwr_cmd);
1486} 1486}
1487 1487
1488static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1489 s16 tx_power)
1490{
1491 struct iwl_dev_tx_power_cmd cmd = {
1492 .set_mode = 0,
1493 .mac_context_id =
1494 cpu_to_le32(iwl_mvm_vif_from_mac80211(vif)->id),
1495 .pwr_restriction = cpu_to_le16(8 * tx_power),
1496 };
1497
1498 if (!(mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_TX_POWER_DEV))
1499 return iwl_mvm_set_tx_power_old(mvm, vif, tx_power);
1500
1501 if (tx_power == IWL_DEFAULT_MAX_TX_POWER)
1502 cmd.pwr_restriction = cpu_to_le16(IWL_DEV_MAX_TX_POWER);
1503
1504 return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0,
1505 sizeof(cmd), &cmd);
1506}
1507
1488static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw, 1508static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
1489 struct ieee80211_vif *vif) 1509 struct ieee80211_vif *vif)
1490{ 1510{
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index d5522a161242..cf70f681d1ac 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -603,7 +603,6 @@ struct iwl_mvm {
603 603
604 enum iwl_ucode_type cur_ucode; 604 enum iwl_ucode_type cur_ucode;
605 bool ucode_loaded; 605 bool ucode_loaded;
606 bool init_ucode_complete;
607 bool calibrating; 606 bool calibrating;
608 u32 error_event_table; 607 u32 error_event_table;
609 u32 log_event_table; 608 u32 log_event_table;
diff --git a/drivers/net/wireless/iwlwifi/mvm/ops.c b/drivers/net/wireless/iwlwifi/mvm/ops.c
index a08b03d58d4b..1c66297d82c0 100644
--- a/drivers/net/wireless/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/iwlwifi/mvm/ops.c
@@ -865,6 +865,16 @@ static void iwl_mvm_fw_error_dump_wk(struct work_struct *work)
865 return; 865 return;
866 866
867 mutex_lock(&mvm->mutex); 867 mutex_lock(&mvm->mutex);
868
869 /* stop recording */
870 if (mvm->cfg->device_family == IWL_DEVICE_FAMILY_7000) {
871 iwl_set_bits_prph(mvm->trans, MON_BUFF_SAMPLE_CTL, 0x100);
872 } else {
873 iwl_write_prph(mvm->trans, DBGC_IN_SAMPLE, 0);
874 /* wait before we collect the data till the DBGC stop */
875 udelay(100);
876 }
877
868 iwl_mvm_fw_error_dump(mvm); 878 iwl_mvm_fw_error_dump(mvm);
869 879
870 /* start recording again if the firmware is not crashed */ 880 /* start recording again if the firmware is not crashed */
diff --git a/drivers/net/wireless/iwlwifi/mvm/rx.c b/drivers/net/wireless/iwlwifi/mvm/rx.c
index 78ec7db64ba5..d6314ddf57b5 100644
--- a/drivers/net/wireless/iwlwifi/mvm/rx.c
+++ b/drivers/net/wireless/iwlwifi/mvm/rx.c
@@ -478,6 +478,11 @@ static void iwl_mvm_stat_iterator(void *_data, u8 *mac,
478 if (vif->type != NL80211_IFTYPE_STATION) 478 if (vif->type != NL80211_IFTYPE_STATION)
479 return; 479 return;
480 480
481 if (sig == 0) {
482 IWL_DEBUG_RX(mvm, "RSSI is 0 - skip signal based decision\n");
483 return;
484 }
485
481 mvmvif->bf_data.ave_beacon_signal = sig; 486 mvmvif->bf_data.ave_beacon_signal = sig;
482 487
483 /* BT Coex */ 488 /* BT Coex */
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
index 74e1c86289dc..1075a213bd6a 100644
--- a/drivers/net/wireless/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
@@ -319,7 +319,7 @@ int iwl_mvm_rx_scan_offload_iter_complete_notif(struct iwl_mvm *mvm,
319 struct iwl_device_cmd *cmd) 319 struct iwl_device_cmd *cmd)
320{ 320{
321 struct iwl_rx_packet *pkt = rxb_addr(rxb); 321 struct iwl_rx_packet *pkt = rxb_addr(rxb);
322 struct iwl_scan_complete_notif *notif = (void *)pkt->data; 322 struct iwl_lmac_scan_complete_notif *notif = (void *)pkt->data;
323 323
324 IWL_DEBUG_SCAN(mvm, 324 IWL_DEBUG_SCAN(mvm,
325 "Scan offload iteration complete: status=0x%x scanned channels=%d\n", 325 "Scan offload iteration complete: status=0x%x scanned channels=%d\n",
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index 2de8fbfe4edf..47bbf573fdc8 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -5,8 +5,8 @@
5 * 5 *
6 * GPL LICENSE SUMMARY 6 * GPL LICENSE SUMMARY
7 * 7 *
8 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. 8 * Copyright(c) 2007 - 2015 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as 12 * it under the terms of version 2 of the GNU General Public License as
@@ -31,8 +31,8 @@
31 * 31 *
32 * BSD LICENSE 32 * BSD LICENSE
33 * 33 *
34 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 34 * Copyright(c) 2005 - 2015 Intel Corporation. All rights reserved.
35 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 35 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
36 * All rights reserved. 36 * All rights reserved.
37 * 37 *
38 * Redistribution and use in source and binary forms, with or without 38 * Redistribution and use in source and binary forms, with or without
@@ -104,7 +104,7 @@ static void iwl_pcie_free_fw_monitor(struct iwl_trans *trans)
104static void iwl_pcie_alloc_fw_monitor(struct iwl_trans *trans) 104static void iwl_pcie_alloc_fw_monitor(struct iwl_trans *trans)
105{ 105{
106 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); 106 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
107 struct page *page; 107 struct page *page = NULL;
108 dma_addr_t phys; 108 dma_addr_t phys;
109 u32 size; 109 u32 size;
110 u8 power; 110 u8 power;
@@ -131,6 +131,7 @@ static void iwl_pcie_alloc_fw_monitor(struct iwl_trans *trans)
131 DMA_FROM_DEVICE); 131 DMA_FROM_DEVICE);
132 if (dma_mapping_error(trans->dev, phys)) { 132 if (dma_mapping_error(trans->dev, phys)) {
133 __free_pages(page, order); 133 __free_pages(page, order);
134 page = NULL;
134 continue; 135 continue;
135 } 136 }
136 IWL_INFO(trans, 137 IWL_INFO(trans,
@@ -1020,7 +1021,7 @@ static void iwl_trans_pcie_fw_alive(struct iwl_trans *trans, u32 scd_addr)
1020 iwl_pcie_tx_start(trans, scd_addr); 1021 iwl_pcie_tx_start(trans, scd_addr);
1021} 1022}
1022 1023
1023static void iwl_trans_pcie_stop_device(struct iwl_trans *trans) 1024static void iwl_trans_pcie_stop_device(struct iwl_trans *trans, bool low_power)
1024{ 1025{
1025 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); 1026 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
1026 bool hw_rfkill, was_hw_rfkill; 1027 bool hw_rfkill, was_hw_rfkill;
@@ -1115,7 +1116,7 @@ static void iwl_trans_pcie_stop_device(struct iwl_trans *trans)
1115void iwl_trans_pcie_rf_kill(struct iwl_trans *trans, bool state) 1116void iwl_trans_pcie_rf_kill(struct iwl_trans *trans, bool state)
1116{ 1117{
1117 if (iwl_op_mode_hw_rf_kill(trans->op_mode, state)) 1118 if (iwl_op_mode_hw_rf_kill(trans->op_mode, state))
1118 iwl_trans_pcie_stop_device(trans); 1119 iwl_trans_pcie_stop_device(trans, true);
1119} 1120}
1120 1121
1121static void iwl_trans_pcie_d3_suspend(struct iwl_trans *trans, bool test) 1122static void iwl_trans_pcie_d3_suspend(struct iwl_trans *trans, bool test)
@@ -1200,7 +1201,7 @@ static int iwl_trans_pcie_d3_resume(struct iwl_trans *trans,
1200 return 0; 1201 return 0;
1201} 1202}
1202 1203
1203static int iwl_trans_pcie_start_hw(struct iwl_trans *trans) 1204static int iwl_trans_pcie_start_hw(struct iwl_trans *trans, bool low_power)
1204{ 1205{
1205 bool hw_rfkill; 1206 bool hw_rfkill;
1206 int err; 1207 int err;