diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
33 files changed, 522 insertions, 834 deletions
diff --git a/drivers/net/wireless/iwlwifi/Makefile b/drivers/net/wireless/iwlwifi/Makefile index 3652931753e0..bb6a737de61f 100644 --- a/drivers/net/wireless/iwlwifi/Makefile +++ b/drivers/net/wireless/iwlwifi/Makefile | |||
@@ -1,6 +1,6 @@ | |||
1 | # AGN | 1 | # AGN |
2 | obj-$(CONFIG_IWLAGN) += iwlagn.o | 2 | obj-$(CONFIG_IWLAGN) += iwlagn.o |
3 | iwlagn-objs := iwl-agn.o iwl-agn-rs.o iwl-agn-led.o | 3 | iwlagn-objs := iwl-agn.o iwl-agn-rs.o |
4 | iwlagn-objs += iwl-agn-ucode.o iwl-agn-tx.o | 4 | iwlagn-objs += iwl-agn-ucode.o iwl-agn-tx.o |
5 | iwlagn-objs += iwl-agn-lib.o iwl-agn-calib.o iwl-io.o | 5 | iwlagn-objs += iwl-agn-lib.o iwl-agn-calib.o iwl-io.o |
6 | iwlagn-objs += iwl-agn-tt.o iwl-agn-sta.o iwl-agn-eeprom.o | 6 | iwlagn-objs += iwl-agn-tt.o iwl-agn-sta.o iwl-agn-eeprom.o |
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c index 1b2799291834..baf80111efaf 100644 --- a/drivers/net/wireless/iwlwifi/iwl-1000.c +++ b/drivers/net/wireless/iwlwifi/iwl-1000.c | |||
@@ -45,7 +45,6 @@ | |||
45 | #include "iwl-agn.h" | 45 | #include "iwl-agn.h" |
46 | #include "iwl-helpers.h" | 46 | #include "iwl-helpers.h" |
47 | #include "iwl-agn-hw.h" | 47 | #include "iwl-agn-hw.h" |
48 | #include "iwl-agn-led.h" | ||
49 | #include "iwl-agn-debugfs.h" | 48 | #include "iwl-agn-debugfs.h" |
50 | 49 | ||
51 | /* Highest firmware API version supported */ | 50 | /* Highest firmware API version supported */ |
@@ -57,12 +56,10 @@ | |||
57 | #define IWL100_UCODE_API_MIN 5 | 56 | #define IWL100_UCODE_API_MIN 5 |
58 | 57 | ||
59 | #define IWL1000_FW_PRE "iwlwifi-1000-" | 58 | #define IWL1000_FW_PRE "iwlwifi-1000-" |
60 | #define _IWL1000_MODULE_FIRMWARE(api) IWL1000_FW_PRE #api ".ucode" | 59 | #define IWL1000_MODULE_FIRMWARE(api) IWL1000_FW_PRE #api ".ucode" |
61 | #define IWL1000_MODULE_FIRMWARE(api) _IWL1000_MODULE_FIRMWARE(api) | ||
62 | 60 | ||
63 | #define IWL100_FW_PRE "iwlwifi-100-" | 61 | #define IWL100_FW_PRE "iwlwifi-100-" |
64 | #define _IWL100_MODULE_FIRMWARE(api) IWL100_FW_PRE #api ".ucode" | 62 | #define IWL100_MODULE_FIRMWARE(api) IWL100_FW_PRE #api ".ucode" |
65 | #define IWL100_MODULE_FIRMWARE(api) _IWL100_MODULE_FIRMWARE(api) | ||
66 | 63 | ||
67 | 64 | ||
68 | /* | 65 | /* |
@@ -184,10 +181,6 @@ static struct iwl_lib_ops iwl1000_lib = { | |||
184 | .rx_handler_setup = iwlagn_rx_handler_setup, | 181 | .rx_handler_setup = iwlagn_rx_handler_setup, |
185 | .setup_deferred_work = iwlagn_setup_deferred_work, | 182 | .setup_deferred_work = iwlagn_setup_deferred_work, |
186 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, | 183 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, |
187 | .dump_nic_event_log = iwl_dump_nic_event_log, | ||
188 | .dump_nic_error_log = iwl_dump_nic_error_log, | ||
189 | .dump_csr = iwl_dump_csr, | ||
190 | .dump_fh = iwl_dump_fh, | ||
191 | .send_tx_power = iwlagn_send_tx_power, | 184 | .send_tx_power = iwlagn_send_tx_power, |
192 | .update_chain_flags = iwl_update_chain_flags, | 185 | .update_chain_flags = iwl_update_chain_flags, |
193 | .apm_ops = { | 186 | .apm_ops = { |
@@ -202,7 +195,7 @@ static struct iwl_lib_ops iwl1000_lib = { | |||
202 | EEPROM_REG_BAND_4_CHANNELS, | 195 | EEPROM_REG_BAND_4_CHANNELS, |
203 | EEPROM_REG_BAND_5_CHANNELS, | 196 | EEPROM_REG_BAND_5_CHANNELS, |
204 | EEPROM_REG_BAND_24_HT40_CHANNELS, | 197 | EEPROM_REG_BAND_24_HT40_CHANNELS, |
205 | EEPROM_REG_BAND_52_HT40_CHANNELS | 198 | EEPROM_REGULATORY_BAND_NO_HT40, |
206 | }, | 199 | }, |
207 | .acquire_semaphore = iwlcore_eeprom_acquire_semaphore, | 200 | .acquire_semaphore = iwlcore_eeprom_acquire_semaphore, |
208 | .release_semaphore = iwlcore_eeprom_release_semaphore, | 201 | .release_semaphore = iwlcore_eeprom_release_semaphore, |
@@ -221,19 +214,12 @@ static struct iwl_lib_ops iwl1000_lib = { | |||
221 | }, | 214 | }, |
222 | .txfifo_flush = iwlagn_txfifo_flush, | 215 | .txfifo_flush = iwlagn_txfifo_flush, |
223 | .dev_txfifo_flush = iwlagn_dev_txfifo_flush, | 216 | .dev_txfifo_flush = iwlagn_dev_txfifo_flush, |
224 | .tt_ops = { | ||
225 | .lower_power_detection = iwl_tt_is_low_power_state, | ||
226 | .tt_power_mode = iwl_tt_current_power_mode, | ||
227 | .ct_kill_check = iwl_check_for_ct_kill, | ||
228 | } | ||
229 | }; | 217 | }; |
230 | 218 | ||
231 | static const struct iwl_ops iwl1000_ops = { | 219 | static const struct iwl_ops iwl1000_ops = { |
232 | .lib = &iwl1000_lib, | 220 | .lib = &iwl1000_lib, |
233 | .hcmd = &iwlagn_hcmd, | 221 | .hcmd = &iwlagn_hcmd, |
234 | .utils = &iwlagn_hcmd_utils, | 222 | .utils = &iwlagn_hcmd_utils, |
235 | .led = &iwlagn_led_ops, | ||
236 | .ieee80211_ops = &iwlagn_hw_ops, | ||
237 | }; | 223 | }; |
238 | 224 | ||
239 | static struct iwl_base_params iwl1000_base_params = { | 225 | static struct iwl_base_params iwl1000_base_params = { |
@@ -241,7 +227,6 @@ static struct iwl_base_params iwl1000_base_params = { | |||
241 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, | 227 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, |
242 | .eeprom_size = OTP_LOW_IMAGE_SIZE, | 228 | .eeprom_size = OTP_LOW_IMAGE_SIZE, |
243 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, | 229 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
244 | .set_l0s = true, | ||
245 | .max_ll_items = OTP_MAX_LL_ITEMS_1000, | 230 | .max_ll_items = OTP_MAX_LL_ITEMS_1000, |
246 | .shadow_ram_support = false, | 231 | .shadow_ram_support = false, |
247 | .led_compensation = 51, | 232 | .led_compensation = 51, |
@@ -251,9 +236,6 @@ static struct iwl_base_params iwl1000_base_params = { | |||
251 | .chain_noise_scale = 1000, | 236 | .chain_noise_scale = 1000, |
252 | .wd_timeout = IWL_DEF_WD_TIMEOUT, | 237 | .wd_timeout = IWL_DEF_WD_TIMEOUT, |
253 | .max_event_log_size = 128, | 238 | .max_event_log_size = 128, |
254 | .ucode_tracing = true, | ||
255 | .sensitivity_calib_by_driver = true, | ||
256 | .chain_noise_calib_by_driver = true, | ||
257 | }; | 239 | }; |
258 | static struct iwl_ht_params iwl1000_ht_params = { | 240 | static struct iwl_ht_params iwl1000_ht_params = { |
259 | .ht_greenfield_support = true, | 241 | .ht_greenfield_support = true, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-2000.c b/drivers/net/wireless/iwlwifi/iwl-2000.c index f602af4b9408..e76e02c28928 100644 --- a/drivers/net/wireless/iwlwifi/iwl-2000.c +++ b/drivers/net/wireless/iwlwifi/iwl-2000.c | |||
@@ -46,7 +46,6 @@ | |||
46 | #include "iwl-helpers.h" | 46 | #include "iwl-helpers.h" |
47 | #include "iwl-agn-hw.h" | 47 | #include "iwl-agn-hw.h" |
48 | #include "iwl-6000-hw.h" | 48 | #include "iwl-6000-hw.h" |
49 | #include "iwl-agn-led.h" | ||
50 | #include "iwl-agn-debugfs.h" | 49 | #include "iwl-agn-debugfs.h" |
51 | 50 | ||
52 | /* Highest firmware API version supported */ | 51 | /* Highest firmware API version supported */ |
@@ -60,16 +59,13 @@ | |||
60 | #define IWL200_UCODE_API_MIN 5 | 59 | #define IWL200_UCODE_API_MIN 5 |
61 | 60 | ||
62 | #define IWL2030_FW_PRE "iwlwifi-2030-" | 61 | #define IWL2030_FW_PRE "iwlwifi-2030-" |
63 | #define _IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE #api ".ucode" | 62 | #define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE #api ".ucode" |
64 | #define IWL2030_MODULE_FIRMWARE(api) _IWL2030_MODULE_FIRMWARE(api) | ||
65 | 63 | ||
66 | #define IWL2000_FW_PRE "iwlwifi-2000-" | 64 | #define IWL2000_FW_PRE "iwlwifi-2000-" |
67 | #define _IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE #api ".ucode" | 65 | #define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE #api ".ucode" |
68 | #define IWL2000_MODULE_FIRMWARE(api) _IWL2000_MODULE_FIRMWARE(api) | ||
69 | 66 | ||
70 | #define IWL200_FW_PRE "iwlwifi-200-" | 67 | #define IWL200_FW_PRE "iwlwifi-200-" |
71 | #define _IWL200_MODULE_FIRMWARE(api) IWL200_FW_PRE #api ".ucode" | 68 | #define IWL200_MODULE_FIRMWARE(api) IWL200_FW_PRE #api ".ucode" |
72 | #define IWL200_MODULE_FIRMWARE(api) _IWL200_MODULE_FIRMWARE(api) | ||
73 | 69 | ||
74 | static void iwl2000_set_ct_threshold(struct iwl_priv *priv) | 70 | static void iwl2000_set_ct_threshold(struct iwl_priv *priv) |
75 | { | 71 | { |
@@ -101,6 +97,8 @@ static void iwl2000_nic_config(struct iwl_priv *priv) | |||
101 | iwl_set_bit(priv, CSR_GP_DRIVER_REG, | 97 | iwl_set_bit(priv, CSR_GP_DRIVER_REG, |
102 | CSR_GP_DRIVER_REG_BIT_RADIO_IQ_INVER); | 98 | CSR_GP_DRIVER_REG_BIT_RADIO_IQ_INVER); |
103 | 99 | ||
100 | if (priv->cfg->disable_otp_refresh) | ||
101 | iwl_write_prph(priv, APMG_ANALOG_SVR_REG, 0x80000010); | ||
104 | } | 102 | } |
105 | 103 | ||
106 | static struct iwl_sensitivity_ranges iwl2000_sensitivity = { | 104 | static struct iwl_sensitivity_ranges iwl2000_sensitivity = { |
@@ -265,10 +263,6 @@ static struct iwl_lib_ops iwl2000_lib = { | |||
265 | .setup_deferred_work = iwlagn_bt_setup_deferred_work, | 263 | .setup_deferred_work = iwlagn_bt_setup_deferred_work, |
266 | .cancel_deferred_work = iwlagn_bt_cancel_deferred_work, | 264 | .cancel_deferred_work = iwlagn_bt_cancel_deferred_work, |
267 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, | 265 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, |
268 | .dump_nic_event_log = iwl_dump_nic_event_log, | ||
269 | .dump_nic_error_log = iwl_dump_nic_error_log, | ||
270 | .dump_csr = iwl_dump_csr, | ||
271 | .dump_fh = iwl_dump_fh, | ||
272 | .send_tx_power = iwlagn_send_tx_power, | 266 | .send_tx_power = iwlagn_send_tx_power, |
273 | .update_chain_flags = iwl_update_chain_flags, | 267 | .update_chain_flags = iwl_update_chain_flags, |
274 | .set_channel_switch = iwl2030_hw_channel_switch, | 268 | .set_channel_switch = iwl2030_hw_channel_switch, |
@@ -284,7 +278,7 @@ static struct iwl_lib_ops iwl2000_lib = { | |||
284 | EEPROM_REG_BAND_4_CHANNELS, | 278 | EEPROM_REG_BAND_4_CHANNELS, |
285 | EEPROM_REG_BAND_5_CHANNELS, | 279 | EEPROM_REG_BAND_5_CHANNELS, |
286 | EEPROM_6000_REG_BAND_24_HT40_CHANNELS, | 280 | EEPROM_6000_REG_BAND_24_HT40_CHANNELS, |
287 | EEPROM_REG_BAND_52_HT40_CHANNELS | 281 | EEPROM_REGULATORY_BAND_NO_HT40, |
288 | }, | 282 | }, |
289 | .acquire_semaphore = iwlcore_eeprom_acquire_semaphore, | 283 | .acquire_semaphore = iwlcore_eeprom_acquire_semaphore, |
290 | .release_semaphore = iwlcore_eeprom_release_semaphore, | 284 | .release_semaphore = iwlcore_eeprom_release_semaphore, |
@@ -304,43 +298,30 @@ static struct iwl_lib_ops iwl2000_lib = { | |||
304 | }, | 298 | }, |
305 | .txfifo_flush = iwlagn_txfifo_flush, | 299 | .txfifo_flush = iwlagn_txfifo_flush, |
306 | .dev_txfifo_flush = iwlagn_dev_txfifo_flush, | 300 | .dev_txfifo_flush = iwlagn_dev_txfifo_flush, |
307 | .tt_ops = { | ||
308 | .lower_power_detection = iwl_tt_is_low_power_state, | ||
309 | .tt_power_mode = iwl_tt_current_power_mode, | ||
310 | .ct_kill_check = iwl_check_for_ct_kill, | ||
311 | } | ||
312 | }; | 301 | }; |
313 | 302 | ||
314 | static const struct iwl_ops iwl2000_ops = { | 303 | static const struct iwl_ops iwl2000_ops = { |
315 | .lib = &iwl2000_lib, | 304 | .lib = &iwl2000_lib, |
316 | .hcmd = &iwlagn_hcmd, | 305 | .hcmd = &iwlagn_hcmd, |
317 | .utils = &iwlagn_hcmd_utils, | 306 | .utils = &iwlagn_hcmd_utils, |
318 | .led = &iwlagn_led_ops, | ||
319 | .ieee80211_ops = &iwlagn_hw_ops, | ||
320 | }; | 307 | }; |
321 | 308 | ||
322 | static const struct iwl_ops iwl2030_ops = { | 309 | static const struct iwl_ops iwl2030_ops = { |
323 | .lib = &iwl2000_lib, | 310 | .lib = &iwl2000_lib, |
324 | .hcmd = &iwlagn_bt_hcmd, | 311 | .hcmd = &iwlagn_bt_hcmd, |
325 | .utils = &iwlagn_hcmd_utils, | 312 | .utils = &iwlagn_hcmd_utils, |
326 | .led = &iwlagn_led_ops, | ||
327 | .ieee80211_ops = &iwlagn_hw_ops, | ||
328 | }; | 313 | }; |
329 | 314 | ||
330 | static const struct iwl_ops iwl200_ops = { | 315 | static const struct iwl_ops iwl200_ops = { |
331 | .lib = &iwl2000_lib, | 316 | .lib = &iwl2000_lib, |
332 | .hcmd = &iwlagn_hcmd, | 317 | .hcmd = &iwlagn_hcmd, |
333 | .utils = &iwlagn_hcmd_utils, | 318 | .utils = &iwlagn_hcmd_utils, |
334 | .led = &iwlagn_led_ops, | ||
335 | .ieee80211_ops = &iwlagn_hw_ops, | ||
336 | }; | 319 | }; |
337 | 320 | ||
338 | static const struct iwl_ops iwl230_ops = { | 321 | static const struct iwl_ops iwl230_ops = { |
339 | .lib = &iwl2000_lib, | 322 | .lib = &iwl2000_lib, |
340 | .hcmd = &iwlagn_bt_hcmd, | 323 | .hcmd = &iwlagn_bt_hcmd, |
341 | .utils = &iwlagn_hcmd_utils, | 324 | .utils = &iwlagn_hcmd_utils, |
342 | .led = &iwlagn_led_ops, | ||
343 | .ieee80211_ops = &iwlagn_hw_ops, | ||
344 | }; | 325 | }; |
345 | 326 | ||
346 | static struct iwl_base_params iwl2000_base_params = { | 327 | static struct iwl_base_params iwl2000_base_params = { |
@@ -348,7 +329,6 @@ static struct iwl_base_params iwl2000_base_params = { | |||
348 | .num_of_queues = IWLAGN_NUM_QUEUES, | 329 | .num_of_queues = IWLAGN_NUM_QUEUES, |
349 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, | 330 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, |
350 | .pll_cfg_val = 0, | 331 | .pll_cfg_val = 0, |
351 | .set_l0s = true, | ||
352 | .max_ll_items = OTP_MAX_LL_ITEMS_2x00, | 332 | .max_ll_items = OTP_MAX_LL_ITEMS_2x00, |
353 | .shadow_ram_support = true, | 333 | .shadow_ram_support = true, |
354 | .led_compensation = 51, | 334 | .led_compensation = 51, |
@@ -359,9 +339,6 @@ static struct iwl_base_params iwl2000_base_params = { | |||
359 | .chain_noise_scale = 1000, | 339 | .chain_noise_scale = 1000, |
360 | .wd_timeout = IWL_DEF_WD_TIMEOUT, | 340 | .wd_timeout = IWL_DEF_WD_TIMEOUT, |
361 | .max_event_log_size = 512, | 341 | .max_event_log_size = 512, |
362 | .ucode_tracing = true, | ||
363 | .sensitivity_calib_by_driver = true, | ||
364 | .chain_noise_calib_by_driver = true, | ||
365 | .shadow_reg_enable = true, | 342 | .shadow_reg_enable = true, |
366 | }; | 343 | }; |
367 | 344 | ||
@@ -371,7 +348,6 @@ static struct iwl_base_params iwl2030_base_params = { | |||
371 | .num_of_queues = IWLAGN_NUM_QUEUES, | 348 | .num_of_queues = IWLAGN_NUM_QUEUES, |
372 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, | 349 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, |
373 | .pll_cfg_val = 0, | 350 | .pll_cfg_val = 0, |
374 | .set_l0s = true, | ||
375 | .max_ll_items = OTP_MAX_LL_ITEMS_2x00, | 351 | .max_ll_items = OTP_MAX_LL_ITEMS_2x00, |
376 | .shadow_ram_support = true, | 352 | .shadow_ram_support = true, |
377 | .led_compensation = 57, | 353 | .led_compensation = 57, |
@@ -382,9 +358,6 @@ static struct iwl_base_params iwl2030_base_params = { | |||
382 | .chain_noise_scale = 1000, | 358 | .chain_noise_scale = 1000, |
383 | .wd_timeout = IWL_LONG_WD_TIMEOUT, | 359 | .wd_timeout = IWL_LONG_WD_TIMEOUT, |
384 | .max_event_log_size = 512, | 360 | .max_event_log_size = 512, |
385 | .ucode_tracing = true, | ||
386 | .sensitivity_calib_by_driver = true, | ||
387 | .chain_noise_calib_by_driver = true, | ||
388 | .shadow_reg_enable = true, | 361 | .shadow_reg_enable = true, |
389 | }; | 362 | }; |
390 | 363 | ||
@@ -394,7 +367,6 @@ static struct iwl_ht_params iwl2000_ht_params = { | |||
394 | }; | 367 | }; |
395 | 368 | ||
396 | static struct iwl_bt_params iwl2030_bt_params = { | 369 | static struct iwl_bt_params iwl2030_bt_params = { |
397 | .bt_statistics = true, | ||
398 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 370 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
399 | .advanced_bt_coexist = true, | 371 | .advanced_bt_coexist = true, |
400 | .agg_time_limit = BT_AGG_THRESHOLD_DEF, | 372 | .agg_time_limit = BT_AGG_THRESHOLD_DEF, |
@@ -416,7 +388,8 @@ static struct iwl_bt_params iwl2030_bt_params = { | |||
416 | .need_dc_calib = true, \ | 388 | .need_dc_calib = true, \ |
417 | .need_temp_offset_calib = true, \ | 389 | .need_temp_offset_calib = true, \ |
418 | .led_mode = IWL_LED_RF_STATE, \ | 390 | .led_mode = IWL_LED_RF_STATE, \ |
419 | .iq_invert = true \ | 391 | .iq_invert = true, \ |
392 | .disable_otp_refresh = true \ | ||
420 | 393 | ||
421 | struct iwl_cfg iwl2000_2bgn_cfg = { | 394 | struct iwl_cfg iwl2000_2bgn_cfg = { |
422 | .name = "2000 Series 2x2 BGN", | 395 | .name = "2000 Series 2x2 BGN", |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 66f5fe8fe1ac..655afc19f68f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -45,7 +45,6 @@ | |||
45 | #include "iwl-sta.h" | 45 | #include "iwl-sta.h" |
46 | #include "iwl-helpers.h" | 46 | #include "iwl-helpers.h" |
47 | #include "iwl-agn.h" | 47 | #include "iwl-agn.h" |
48 | #include "iwl-agn-led.h" | ||
49 | #include "iwl-agn-hw.h" | 48 | #include "iwl-agn-hw.h" |
50 | #include "iwl-5000-hw.h" | 49 | #include "iwl-5000-hw.h" |
51 | #include "iwl-agn-debugfs.h" | 50 | #include "iwl-agn-debugfs.h" |
@@ -59,12 +58,10 @@ | |||
59 | #define IWL5150_UCODE_API_MIN 1 | 58 | #define IWL5150_UCODE_API_MIN 1 |
60 | 59 | ||
61 | #define IWL5000_FW_PRE "iwlwifi-5000-" | 60 | #define IWL5000_FW_PRE "iwlwifi-5000-" |
62 | #define _IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE #api ".ucode" | 61 | #define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE #api ".ucode" |
63 | #define IWL5000_MODULE_FIRMWARE(api) _IWL5000_MODULE_FIRMWARE(api) | ||
64 | 62 | ||
65 | #define IWL5150_FW_PRE "iwlwifi-5150-" | 63 | #define IWL5150_FW_PRE "iwlwifi-5150-" |
66 | #define _IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE #api ".ucode" | 64 | #define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE #api ".ucode" |
67 | #define IWL5150_MODULE_FIRMWARE(api) _IWL5150_MODULE_FIRMWARE(api) | ||
68 | 65 | ||
69 | /* NIC configuration for 5000 series */ | 66 | /* NIC configuration for 5000 series */ |
70 | static void iwl5000_nic_config(struct iwl_priv *priv) | 67 | static void iwl5000_nic_config(struct iwl_priv *priv) |
@@ -261,7 +258,7 @@ static void iwl5150_temperature(struct iwl_priv *priv) | |||
261 | u32 vt = 0; | 258 | u32 vt = 0; |
262 | s32 offset = iwl_temp_calib_to_offset(priv); | 259 | s32 offset = iwl_temp_calib_to_offset(priv); |
263 | 260 | ||
264 | vt = le32_to_cpu(priv->_agn.statistics.general.common.temperature); | 261 | vt = le32_to_cpu(priv->statistics.common.temperature); |
265 | vt = vt / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF + offset; | 262 | vt = vt / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF + offset; |
266 | /* now vt hold the temperature in Kelvin */ | 263 | /* now vt hold the temperature in Kelvin */ |
267 | priv->temperature = KELVIN_TO_CELSIUS(vt); | 264 | priv->temperature = KELVIN_TO_CELSIUS(vt); |
@@ -352,10 +349,6 @@ static struct iwl_lib_ops iwl5000_lib = { | |||
352 | .rx_handler_setup = iwlagn_rx_handler_setup, | 349 | .rx_handler_setup = iwlagn_rx_handler_setup, |
353 | .setup_deferred_work = iwlagn_setup_deferred_work, | 350 | .setup_deferred_work = iwlagn_setup_deferred_work, |
354 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, | 351 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, |
355 | .dump_nic_event_log = iwl_dump_nic_event_log, | ||
356 | .dump_nic_error_log = iwl_dump_nic_error_log, | ||
357 | .dump_csr = iwl_dump_csr, | ||
358 | .dump_fh = iwl_dump_fh, | ||
359 | .send_tx_power = iwlagn_send_tx_power, | 352 | .send_tx_power = iwlagn_send_tx_power, |
360 | .update_chain_flags = iwl_update_chain_flags, | 353 | .update_chain_flags = iwl_update_chain_flags, |
361 | .set_channel_switch = iwl5000_hw_channel_switch, | 354 | .set_channel_switch = iwl5000_hw_channel_switch, |
@@ -390,11 +383,6 @@ static struct iwl_lib_ops iwl5000_lib = { | |||
390 | }, | 383 | }, |
391 | .txfifo_flush = iwlagn_txfifo_flush, | 384 | .txfifo_flush = iwlagn_txfifo_flush, |
392 | .dev_txfifo_flush = iwlagn_dev_txfifo_flush, | 385 | .dev_txfifo_flush = iwlagn_dev_txfifo_flush, |
393 | .tt_ops = { | ||
394 | .lower_power_detection = iwl_tt_is_low_power_state, | ||
395 | .tt_power_mode = iwl_tt_current_power_mode, | ||
396 | .ct_kill_check = iwl_check_for_ct_kill, | ||
397 | } | ||
398 | }; | 386 | }; |
399 | 387 | ||
400 | static struct iwl_lib_ops iwl5150_lib = { | 388 | static struct iwl_lib_ops iwl5150_lib = { |
@@ -408,9 +396,6 @@ static struct iwl_lib_ops iwl5150_lib = { | |||
408 | .rx_handler_setup = iwlagn_rx_handler_setup, | 396 | .rx_handler_setup = iwlagn_rx_handler_setup, |
409 | .setup_deferred_work = iwlagn_setup_deferred_work, | 397 | .setup_deferred_work = iwlagn_setup_deferred_work, |
410 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, | 398 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, |
411 | .dump_nic_event_log = iwl_dump_nic_event_log, | ||
412 | .dump_nic_error_log = iwl_dump_nic_error_log, | ||
413 | .dump_csr = iwl_dump_csr, | ||
414 | .send_tx_power = iwlagn_send_tx_power, | 399 | .send_tx_power = iwlagn_send_tx_power, |
415 | .update_chain_flags = iwl_update_chain_flags, | 400 | .update_chain_flags = iwl_update_chain_flags, |
416 | .set_channel_switch = iwl5000_hw_channel_switch, | 401 | .set_channel_switch = iwl5000_hw_channel_switch, |
@@ -445,27 +430,18 @@ static struct iwl_lib_ops iwl5150_lib = { | |||
445 | }, | 430 | }, |
446 | .txfifo_flush = iwlagn_txfifo_flush, | 431 | .txfifo_flush = iwlagn_txfifo_flush, |
447 | .dev_txfifo_flush = iwlagn_dev_txfifo_flush, | 432 | .dev_txfifo_flush = iwlagn_dev_txfifo_flush, |
448 | .tt_ops = { | ||
449 | .lower_power_detection = iwl_tt_is_low_power_state, | ||
450 | .tt_power_mode = iwl_tt_current_power_mode, | ||
451 | .ct_kill_check = iwl_check_for_ct_kill, | ||
452 | } | ||
453 | }; | 433 | }; |
454 | 434 | ||
455 | static const struct iwl_ops iwl5000_ops = { | 435 | static const struct iwl_ops iwl5000_ops = { |
456 | .lib = &iwl5000_lib, | 436 | .lib = &iwl5000_lib, |
457 | .hcmd = &iwlagn_hcmd, | 437 | .hcmd = &iwlagn_hcmd, |
458 | .utils = &iwlagn_hcmd_utils, | 438 | .utils = &iwlagn_hcmd_utils, |
459 | .led = &iwlagn_led_ops, | ||
460 | .ieee80211_ops = &iwlagn_hw_ops, | ||
461 | }; | 439 | }; |
462 | 440 | ||
463 | static const struct iwl_ops iwl5150_ops = { | 441 | static const struct iwl_ops iwl5150_ops = { |
464 | .lib = &iwl5150_lib, | 442 | .lib = &iwl5150_lib, |
465 | .hcmd = &iwlagn_hcmd, | 443 | .hcmd = &iwlagn_hcmd, |
466 | .utils = &iwlagn_hcmd_utils, | 444 | .utils = &iwlagn_hcmd_utils, |
467 | .led = &iwlagn_led_ops, | ||
468 | .ieee80211_ops = &iwlagn_hw_ops, | ||
469 | }; | 445 | }; |
470 | 446 | ||
471 | static struct iwl_base_params iwl5000_base_params = { | 447 | static struct iwl_base_params iwl5000_base_params = { |
@@ -473,16 +449,12 @@ static struct iwl_base_params iwl5000_base_params = { | |||
473 | .num_of_queues = IWLAGN_NUM_QUEUES, | 449 | .num_of_queues = IWLAGN_NUM_QUEUES, |
474 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, | 450 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, |
475 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, | 451 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
476 | .set_l0s = true, | ||
477 | .led_compensation = 51, | 452 | .led_compensation = 51, |
478 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 453 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
479 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 454 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
480 | .chain_noise_scale = 1000, | 455 | .chain_noise_scale = 1000, |
481 | .wd_timeout = IWL_LONG_WD_TIMEOUT, | 456 | .wd_timeout = IWL_LONG_WD_TIMEOUT, |
482 | .max_event_log_size = 512, | 457 | .max_event_log_size = 512, |
483 | .ucode_tracing = true, | ||
484 | .sensitivity_calib_by_driver = true, | ||
485 | .chain_noise_calib_by_driver = true, | ||
486 | }; | 458 | }; |
487 | static struct iwl_ht_params iwl5000_ht_params = { | 459 | static struct iwl_ht_params iwl5000_ht_params = { |
488 | .ht_greenfield_support = true, | 460 | .ht_greenfield_support = true, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index 24d105b29aec..905eb57f7cab 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -46,7 +46,6 @@ | |||
46 | #include "iwl-helpers.h" | 46 | #include "iwl-helpers.h" |
47 | #include "iwl-agn-hw.h" | 47 | #include "iwl-agn-hw.h" |
48 | #include "iwl-6000-hw.h" | 48 | #include "iwl-6000-hw.h" |
49 | #include "iwl-agn-led.h" | ||
50 | #include "iwl-agn-debugfs.h" | 49 | #include "iwl-agn-debugfs.h" |
51 | 50 | ||
52 | /* Highest firmware API version supported */ | 51 | /* Highest firmware API version supported */ |
@@ -60,20 +59,16 @@ | |||
60 | #define IWL6000G2_UCODE_API_MIN 4 | 59 | #define IWL6000G2_UCODE_API_MIN 4 |
61 | 60 | ||
62 | #define IWL6000_FW_PRE "iwlwifi-6000-" | 61 | #define IWL6000_FW_PRE "iwlwifi-6000-" |
63 | #define _IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE #api ".ucode" | 62 | #define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE #api ".ucode" |
64 | #define IWL6000_MODULE_FIRMWARE(api) _IWL6000_MODULE_FIRMWARE(api) | ||
65 | 63 | ||
66 | #define IWL6050_FW_PRE "iwlwifi-6050-" | 64 | #define IWL6050_FW_PRE "iwlwifi-6050-" |
67 | #define _IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode" | 65 | #define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode" |
68 | #define IWL6050_MODULE_FIRMWARE(api) _IWL6050_MODULE_FIRMWARE(api) | ||
69 | 66 | ||
70 | #define IWL6005_FW_PRE "iwlwifi-6000g2a-" | 67 | #define IWL6005_FW_PRE "iwlwifi-6000g2a-" |
71 | #define _IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE #api ".ucode" | 68 | #define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE #api ".ucode" |
72 | #define IWL6005_MODULE_FIRMWARE(api) _IWL6005_MODULE_FIRMWARE(api) | ||
73 | 69 | ||
74 | #define IWL6030_FW_PRE "iwlwifi-6000g2b-" | 70 | #define IWL6030_FW_PRE "iwlwifi-6000g2b-" |
75 | #define _IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE #api ".ucode" | 71 | #define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE #api ".ucode" |
76 | #define IWL6030_MODULE_FIRMWARE(api) _IWL6030_MODULE_FIRMWARE(api) | ||
77 | 72 | ||
78 | static void iwl6000_set_ct_threshold(struct iwl_priv *priv) | 73 | static void iwl6000_set_ct_threshold(struct iwl_priv *priv) |
79 | { | 74 | { |
@@ -293,10 +288,6 @@ static struct iwl_lib_ops iwl6000_lib = { | |||
293 | .rx_handler_setup = iwlagn_rx_handler_setup, | 288 | .rx_handler_setup = iwlagn_rx_handler_setup, |
294 | .setup_deferred_work = iwlagn_setup_deferred_work, | 289 | .setup_deferred_work = iwlagn_setup_deferred_work, |
295 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, | 290 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, |
296 | .dump_nic_event_log = iwl_dump_nic_event_log, | ||
297 | .dump_nic_error_log = iwl_dump_nic_error_log, | ||
298 | .dump_csr = iwl_dump_csr, | ||
299 | .dump_fh = iwl_dump_fh, | ||
300 | .send_tx_power = iwlagn_send_tx_power, | 291 | .send_tx_power = iwlagn_send_tx_power, |
301 | .update_chain_flags = iwl_update_chain_flags, | 292 | .update_chain_flags = iwl_update_chain_flags, |
302 | .set_channel_switch = iwl6000_hw_channel_switch, | 293 | .set_channel_switch = iwl6000_hw_channel_switch, |
@@ -332,11 +323,6 @@ static struct iwl_lib_ops iwl6000_lib = { | |||
332 | }, | 323 | }, |
333 | .txfifo_flush = iwlagn_txfifo_flush, | 324 | .txfifo_flush = iwlagn_txfifo_flush, |
334 | .dev_txfifo_flush = iwlagn_dev_txfifo_flush, | 325 | .dev_txfifo_flush = iwlagn_dev_txfifo_flush, |
335 | .tt_ops = { | ||
336 | .lower_power_detection = iwl_tt_is_low_power_state, | ||
337 | .tt_power_mode = iwl_tt_current_power_mode, | ||
338 | .ct_kill_check = iwl_check_for_ct_kill, | ||
339 | } | ||
340 | }; | 326 | }; |
341 | 327 | ||
342 | static struct iwl_lib_ops iwl6030_lib = { | 328 | static struct iwl_lib_ops iwl6030_lib = { |
@@ -351,10 +337,6 @@ static struct iwl_lib_ops iwl6030_lib = { | |||
351 | .setup_deferred_work = iwlagn_bt_setup_deferred_work, | 337 | .setup_deferred_work = iwlagn_bt_setup_deferred_work, |
352 | .cancel_deferred_work = iwlagn_bt_cancel_deferred_work, | 338 | .cancel_deferred_work = iwlagn_bt_cancel_deferred_work, |
353 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, | 339 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, |
354 | .dump_nic_event_log = iwl_dump_nic_event_log, | ||
355 | .dump_nic_error_log = iwl_dump_nic_error_log, | ||
356 | .dump_csr = iwl_dump_csr, | ||
357 | .dump_fh = iwl_dump_fh, | ||
358 | .send_tx_power = iwlagn_send_tx_power, | 340 | .send_tx_power = iwlagn_send_tx_power, |
359 | .update_chain_flags = iwl_update_chain_flags, | 341 | .update_chain_flags = iwl_update_chain_flags, |
360 | .set_channel_switch = iwl6000_hw_channel_switch, | 342 | .set_channel_switch = iwl6000_hw_channel_switch, |
@@ -390,11 +372,6 @@ static struct iwl_lib_ops iwl6030_lib = { | |||
390 | }, | 372 | }, |
391 | .txfifo_flush = iwlagn_txfifo_flush, | 373 | .txfifo_flush = iwlagn_txfifo_flush, |
392 | .dev_txfifo_flush = iwlagn_dev_txfifo_flush, | 374 | .dev_txfifo_flush = iwlagn_dev_txfifo_flush, |
393 | .tt_ops = { | ||
394 | .lower_power_detection = iwl_tt_is_low_power_state, | ||
395 | .tt_power_mode = iwl_tt_current_power_mode, | ||
396 | .ct_kill_check = iwl_check_for_ct_kill, | ||
397 | } | ||
398 | }; | 375 | }; |
399 | 376 | ||
400 | static struct iwl_nic_ops iwl6050_nic_ops = { | 377 | static struct iwl_nic_ops iwl6050_nic_ops = { |
@@ -409,34 +386,26 @@ static const struct iwl_ops iwl6000_ops = { | |||
409 | .lib = &iwl6000_lib, | 386 | .lib = &iwl6000_lib, |
410 | .hcmd = &iwlagn_hcmd, | 387 | .hcmd = &iwlagn_hcmd, |
411 | .utils = &iwlagn_hcmd_utils, | 388 | .utils = &iwlagn_hcmd_utils, |
412 | .led = &iwlagn_led_ops, | ||
413 | .ieee80211_ops = &iwlagn_hw_ops, | ||
414 | }; | 389 | }; |
415 | 390 | ||
416 | static const struct iwl_ops iwl6050_ops = { | 391 | static const struct iwl_ops iwl6050_ops = { |
417 | .lib = &iwl6000_lib, | 392 | .lib = &iwl6000_lib, |
418 | .hcmd = &iwlagn_hcmd, | 393 | .hcmd = &iwlagn_hcmd, |
419 | .utils = &iwlagn_hcmd_utils, | 394 | .utils = &iwlagn_hcmd_utils, |
420 | .led = &iwlagn_led_ops, | ||
421 | .nic = &iwl6050_nic_ops, | 395 | .nic = &iwl6050_nic_ops, |
422 | .ieee80211_ops = &iwlagn_hw_ops, | ||
423 | }; | 396 | }; |
424 | 397 | ||
425 | static const struct iwl_ops iwl6150_ops = { | 398 | static const struct iwl_ops iwl6150_ops = { |
426 | .lib = &iwl6000_lib, | 399 | .lib = &iwl6000_lib, |
427 | .hcmd = &iwlagn_hcmd, | 400 | .hcmd = &iwlagn_hcmd, |
428 | .utils = &iwlagn_hcmd_utils, | 401 | .utils = &iwlagn_hcmd_utils, |
429 | .led = &iwlagn_led_ops, | ||
430 | .nic = &iwl6150_nic_ops, | 402 | .nic = &iwl6150_nic_ops, |
431 | .ieee80211_ops = &iwlagn_hw_ops, | ||
432 | }; | 403 | }; |
433 | 404 | ||
434 | static const struct iwl_ops iwl6030_ops = { | 405 | static const struct iwl_ops iwl6030_ops = { |
435 | .lib = &iwl6030_lib, | 406 | .lib = &iwl6030_lib, |
436 | .hcmd = &iwlagn_bt_hcmd, | 407 | .hcmd = &iwlagn_bt_hcmd, |
437 | .utils = &iwlagn_hcmd_utils, | 408 | .utils = &iwlagn_hcmd_utils, |
438 | .led = &iwlagn_led_ops, | ||
439 | .ieee80211_ops = &iwlagn_hw_ops, | ||
440 | }; | 409 | }; |
441 | 410 | ||
442 | static struct iwl_base_params iwl6000_base_params = { | 411 | static struct iwl_base_params iwl6000_base_params = { |
@@ -444,7 +413,6 @@ static struct iwl_base_params iwl6000_base_params = { | |||
444 | .num_of_queues = IWLAGN_NUM_QUEUES, | 413 | .num_of_queues = IWLAGN_NUM_QUEUES, |
445 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, | 414 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, |
446 | .pll_cfg_val = 0, | 415 | .pll_cfg_val = 0, |
447 | .set_l0s = true, | ||
448 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, | 416 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, |
449 | .shadow_ram_support = true, | 417 | .shadow_ram_support = true, |
450 | .led_compensation = 51, | 418 | .led_compensation = 51, |
@@ -455,9 +423,6 @@ static struct iwl_base_params iwl6000_base_params = { | |||
455 | .chain_noise_scale = 1000, | 423 | .chain_noise_scale = 1000, |
456 | .wd_timeout = IWL_DEF_WD_TIMEOUT, | 424 | .wd_timeout = IWL_DEF_WD_TIMEOUT, |
457 | .max_event_log_size = 512, | 425 | .max_event_log_size = 512, |
458 | .ucode_tracing = true, | ||
459 | .sensitivity_calib_by_driver = true, | ||
460 | .chain_noise_calib_by_driver = true, | ||
461 | .shadow_reg_enable = true, | 426 | .shadow_reg_enable = true, |
462 | }; | 427 | }; |
463 | 428 | ||
@@ -466,7 +431,6 @@ static struct iwl_base_params iwl6050_base_params = { | |||
466 | .num_of_queues = IWLAGN_NUM_QUEUES, | 431 | .num_of_queues = IWLAGN_NUM_QUEUES, |
467 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, | 432 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, |
468 | .pll_cfg_val = 0, | 433 | .pll_cfg_val = 0, |
469 | .set_l0s = true, | ||
470 | .max_ll_items = OTP_MAX_LL_ITEMS_6x50, | 434 | .max_ll_items = OTP_MAX_LL_ITEMS_6x50, |
471 | .shadow_ram_support = true, | 435 | .shadow_ram_support = true, |
472 | .led_compensation = 51, | 436 | .led_compensation = 51, |
@@ -477,9 +441,6 @@ static struct iwl_base_params iwl6050_base_params = { | |||
477 | .chain_noise_scale = 1500, | 441 | .chain_noise_scale = 1500, |
478 | .wd_timeout = IWL_DEF_WD_TIMEOUT, | 442 | .wd_timeout = IWL_DEF_WD_TIMEOUT, |
479 | .max_event_log_size = 1024, | 443 | .max_event_log_size = 1024, |
480 | .ucode_tracing = true, | ||
481 | .sensitivity_calib_by_driver = true, | ||
482 | .chain_noise_calib_by_driver = true, | ||
483 | .shadow_reg_enable = true, | 444 | .shadow_reg_enable = true, |
484 | }; | 445 | }; |
485 | static struct iwl_base_params iwl6000_g2_base_params = { | 446 | static struct iwl_base_params iwl6000_g2_base_params = { |
@@ -487,7 +448,6 @@ static struct iwl_base_params iwl6000_g2_base_params = { | |||
487 | .num_of_queues = IWLAGN_NUM_QUEUES, | 448 | .num_of_queues = IWLAGN_NUM_QUEUES, |
488 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, | 449 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, |
489 | .pll_cfg_val = 0, | 450 | .pll_cfg_val = 0, |
490 | .set_l0s = true, | ||
491 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, | 451 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, |
492 | .shadow_ram_support = true, | 452 | .shadow_ram_support = true, |
493 | .led_compensation = 57, | 453 | .led_compensation = 57, |
@@ -498,9 +458,6 @@ static struct iwl_base_params iwl6000_g2_base_params = { | |||
498 | .chain_noise_scale = 1000, | 458 | .chain_noise_scale = 1000, |
499 | .wd_timeout = IWL_LONG_WD_TIMEOUT, | 459 | .wd_timeout = IWL_LONG_WD_TIMEOUT, |
500 | .max_event_log_size = 512, | 460 | .max_event_log_size = 512, |
501 | .ucode_tracing = true, | ||
502 | .sensitivity_calib_by_driver = true, | ||
503 | .chain_noise_calib_by_driver = true, | ||
504 | .shadow_reg_enable = true, | 461 | .shadow_reg_enable = true, |
505 | }; | 462 | }; |
506 | 463 | ||
@@ -510,7 +467,6 @@ static struct iwl_ht_params iwl6000_ht_params = { | |||
510 | }; | 467 | }; |
511 | 468 | ||
512 | static struct iwl_bt_params iwl6000_bt_params = { | 469 | static struct iwl_bt_params iwl6000_bt_params = { |
513 | .bt_statistics = true, | ||
514 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 470 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
515 | .advanced_bt_coexist = true, | 471 | .advanced_bt_coexist = true, |
516 | .agg_time_limit = BT_AGG_THRESHOLD_DEF, | 472 | .agg_time_limit = BT_AGG_THRESHOLD_DEF, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c index 7b761de77b0a..0f6bb9b2e642 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c | |||
@@ -605,7 +605,7 @@ void iwl_init_sensitivity(struct iwl_priv *priv) | |||
605 | IWL_DEBUG_CALIB(priv, "<<return 0x%X\n", ret); | 605 | IWL_DEBUG_CALIB(priv, "<<return 0x%X\n", ret); |
606 | } | 606 | } |
607 | 607 | ||
608 | void iwl_sensitivity_calibration(struct iwl_priv *priv, void *resp) | 608 | void iwl_sensitivity_calibration(struct iwl_priv *priv) |
609 | { | 609 | { |
610 | u32 rx_enable_time; | 610 | u32 rx_enable_time; |
611 | u32 fa_cck; | 611 | u32 fa_cck; |
@@ -631,16 +631,9 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv, void *resp) | |||
631 | } | 631 | } |
632 | 632 | ||
633 | spin_lock_irqsave(&priv->lock, flags); | 633 | spin_lock_irqsave(&priv->lock, flags); |
634 | if (iwl_bt_statistics(priv)) { | 634 | rx_info = &priv->statistics.rx_non_phy; |
635 | rx_info = &(((struct iwl_bt_notif_statistics *)resp)-> | 635 | ofdm = &priv->statistics.rx_ofdm; |
636 | rx.general.common); | 636 | cck = &priv->statistics.rx_cck; |
637 | ofdm = &(((struct iwl_bt_notif_statistics *)resp)->rx.ofdm); | ||
638 | cck = &(((struct iwl_bt_notif_statistics *)resp)->rx.cck); | ||
639 | } else { | ||
640 | rx_info = &(((struct iwl_notif_statistics *)resp)->rx.general); | ||
641 | ofdm = &(((struct iwl_notif_statistics *)resp)->rx.ofdm); | ||
642 | cck = &(((struct iwl_notif_statistics *)resp)->rx.cck); | ||
643 | } | ||
644 | if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) { | 637 | if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) { |
645 | IWL_DEBUG_CALIB(priv, "<< invalid data.\n"); | 638 | IWL_DEBUG_CALIB(priv, "<< invalid data.\n"); |
646 | spin_unlock_irqrestore(&priv->lock, flags); | 639 | spin_unlock_irqrestore(&priv->lock, flags); |
@@ -851,7 +844,7 @@ static void iwl_find_disconn_antenna(struct iwl_priv *priv, u32* average_sig, | |||
851 | * 1) Which antennas are connected. | 844 | * 1) Which antennas are connected. |
852 | * 2) Differential rx gain settings to balance the 3 receivers. | 845 | * 2) Differential rx gain settings to balance the 3 receivers. |
853 | */ | 846 | */ |
854 | void iwl_chain_noise_calibration(struct iwl_priv *priv, void *stat_resp) | 847 | void iwl_chain_noise_calibration(struct iwl_priv *priv) |
855 | { | 848 | { |
856 | struct iwl_chain_noise_data *data = NULL; | 849 | struct iwl_chain_noise_data *data = NULL; |
857 | 850 | ||
@@ -896,13 +889,9 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv, void *stat_resp) | |||
896 | } | 889 | } |
897 | 890 | ||
898 | spin_lock_irqsave(&priv->lock, flags); | 891 | spin_lock_irqsave(&priv->lock, flags); |
899 | if (iwl_bt_statistics(priv)) { | 892 | |
900 | rx_info = &(((struct iwl_bt_notif_statistics *)stat_resp)-> | 893 | rx_info = &priv->statistics.rx_non_phy; |
901 | rx.general.common); | 894 | |
902 | } else { | ||
903 | rx_info = &(((struct iwl_notif_statistics *)stat_resp)-> | ||
904 | rx.general); | ||
905 | } | ||
906 | if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) { | 895 | if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) { |
907 | IWL_DEBUG_CALIB(priv, " << Interference data unavailable\n"); | 896 | IWL_DEBUG_CALIB(priv, " << Interference data unavailable\n"); |
908 | spin_unlock_irqrestore(&priv->lock, flags); | 897 | spin_unlock_irqrestore(&priv->lock, flags); |
@@ -911,19 +900,9 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv, void *stat_resp) | |||
911 | 900 | ||
912 | rxon_band24 = !!(ctx->staging.flags & RXON_FLG_BAND_24G_MSK); | 901 | rxon_band24 = !!(ctx->staging.flags & RXON_FLG_BAND_24G_MSK); |
913 | rxon_chnum = le16_to_cpu(ctx->staging.channel); | 902 | rxon_chnum = le16_to_cpu(ctx->staging.channel); |
914 | if (iwl_bt_statistics(priv)) { | 903 | stat_band24 = |
915 | stat_band24 = !!(((struct iwl_bt_notif_statistics *) | 904 | !!(priv->statistics.flag & STATISTICS_REPLY_FLG_BAND_24G_MSK); |
916 | stat_resp)->flag & | 905 | stat_chnum = le32_to_cpu(priv->statistics.flag) >> 16; |
917 | STATISTICS_REPLY_FLG_BAND_24G_MSK); | ||
918 | stat_chnum = le32_to_cpu(((struct iwl_bt_notif_statistics *) | ||
919 | stat_resp)->flag) >> 16; | ||
920 | } else { | ||
921 | stat_band24 = !!(((struct iwl_notif_statistics *) | ||
922 | stat_resp)->flag & | ||
923 | STATISTICS_REPLY_FLG_BAND_24G_MSK); | ||
924 | stat_chnum = le32_to_cpu(((struct iwl_notif_statistics *) | ||
925 | stat_resp)->flag) >> 16; | ||
926 | } | ||
927 | 906 | ||
928 | /* Make sure we accumulate data for just the associated channel | 907 | /* Make sure we accumulate data for just the associated channel |
929 | * (even if scanning). */ | 908 | * (even if scanning). */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-calib.h b/drivers/net/wireless/iwlwifi/iwl-agn-calib.h index ef4d5079a7ed..4ef4dd934254 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-calib.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn-calib.h | |||
@@ -66,8 +66,8 @@ | |||
66 | #include "iwl-core.h" | 66 | #include "iwl-core.h" |
67 | #include "iwl-commands.h" | 67 | #include "iwl-commands.h" |
68 | 68 | ||
69 | void iwl_chain_noise_calibration(struct iwl_priv *priv, void *stat_resp); | 69 | void iwl_chain_noise_calibration(struct iwl_priv *priv); |
70 | void iwl_sensitivity_calibration(struct iwl_priv *priv, void *resp); | 70 | void iwl_sensitivity_calibration(struct iwl_priv *priv); |
71 | 71 | ||
72 | void iwl_init_sensitivity(struct iwl_priv *priv); | 72 | void iwl_init_sensitivity(struct iwl_priv *priv); |
73 | void iwl_reset_run_time_calib(struct iwl_priv *priv); | 73 | void iwl_reset_run_time_calib(struct iwl_priv *priv); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c index d1834aa7edf0..71a5f31cd7cc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c | |||
@@ -39,10 +39,7 @@ static int iwl_statistics_flag(struct iwl_priv *priv, char *buf, int bufsz) | |||
39 | int p = 0; | 39 | int p = 0; |
40 | u32 flag; | 40 | u32 flag; |
41 | 41 | ||
42 | if (iwl_bt_statistics(priv)) | 42 | flag = le32_to_cpu(priv->statistics.flag); |
43 | flag = le32_to_cpu(priv->_agn.statistics_bt.flag); | ||
44 | else | ||
45 | flag = le32_to_cpu(priv->_agn.statistics.flag); | ||
46 | 43 | ||
47 | p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", flag); | 44 | p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", flag); |
48 | if (flag & UCODE_STATISTICS_CLEAR_MSK) | 45 | if (flag & UCODE_STATISTICS_CLEAR_MSK) |
@@ -88,43 +85,22 @@ ssize_t iwl_ucode_rx_stats_read(struct file *file, char __user *user_buf, | |||
88 | * the last statistics notification from uCode | 85 | * the last statistics notification from uCode |
89 | * might not reflect the current uCode activity | 86 | * might not reflect the current uCode activity |
90 | */ | 87 | */ |
91 | if (iwl_bt_statistics(priv)) { | 88 | ofdm = &priv->statistics.rx_ofdm; |
92 | ofdm = &priv->_agn.statistics_bt.rx.ofdm; | 89 | cck = &priv->statistics.rx_cck; |
93 | cck = &priv->_agn.statistics_bt.rx.cck; | 90 | general = &priv->statistics.rx_non_phy; |
94 | general = &priv->_agn.statistics_bt.rx.general.common; | 91 | ht = &priv->statistics.rx_ofdm_ht; |
95 | ht = &priv->_agn.statistics_bt.rx.ofdm_ht; | 92 | accum_ofdm = &priv->accum_stats.rx_ofdm; |
96 | accum_ofdm = &priv->_agn.accum_statistics_bt.rx.ofdm; | 93 | accum_cck = &priv->accum_stats.rx_cck; |
97 | accum_cck = &priv->_agn.accum_statistics_bt.rx.cck; | 94 | accum_general = &priv->accum_stats.rx_non_phy; |
98 | accum_general = | 95 | accum_ht = &priv->accum_stats.rx_ofdm_ht; |
99 | &priv->_agn.accum_statistics_bt.rx.general.common; | 96 | delta_ofdm = &priv->delta_stats.rx_ofdm; |
100 | accum_ht = &priv->_agn.accum_statistics_bt.rx.ofdm_ht; | 97 | delta_cck = &priv->delta_stats.rx_cck; |
101 | delta_ofdm = &priv->_agn.delta_statistics_bt.rx.ofdm; | 98 | delta_general = &priv->delta_stats.rx_non_phy; |
102 | delta_cck = &priv->_agn.delta_statistics_bt.rx.cck; | 99 | delta_ht = &priv->delta_stats.rx_ofdm_ht; |
103 | delta_general = | 100 | max_ofdm = &priv->max_delta_stats.rx_ofdm; |
104 | &priv->_agn.delta_statistics_bt.rx.general.common; | 101 | max_cck = &priv->max_delta_stats.rx_cck; |
105 | delta_ht = &priv->_agn.delta_statistics_bt.rx.ofdm_ht; | 102 | max_general = &priv->max_delta_stats.rx_non_phy; |
106 | max_ofdm = &priv->_agn.max_delta_bt.rx.ofdm; | 103 | max_ht = &priv->max_delta_stats.rx_ofdm_ht; |
107 | max_cck = &priv->_agn.max_delta_bt.rx.cck; | ||
108 | max_general = &priv->_agn.max_delta_bt.rx.general.common; | ||
109 | max_ht = &priv->_agn.max_delta_bt.rx.ofdm_ht; | ||
110 | } else { | ||
111 | ofdm = &priv->_agn.statistics.rx.ofdm; | ||
112 | cck = &priv->_agn.statistics.rx.cck; | ||
113 | general = &priv->_agn.statistics.rx.general; | ||
114 | ht = &priv->_agn.statistics.rx.ofdm_ht; | ||
115 | accum_ofdm = &priv->_agn.accum_statistics.rx.ofdm; | ||
116 | accum_cck = &priv->_agn.accum_statistics.rx.cck; | ||
117 | accum_general = &priv->_agn.accum_statistics.rx.general; | ||
118 | accum_ht = &priv->_agn.accum_statistics.rx.ofdm_ht; | ||
119 | delta_ofdm = &priv->_agn.delta_statistics.rx.ofdm; | ||
120 | delta_cck = &priv->_agn.delta_statistics.rx.cck; | ||
121 | delta_general = &priv->_agn.delta_statistics.rx.general; | ||
122 | delta_ht = &priv->_agn.delta_statistics.rx.ofdm_ht; | ||
123 | max_ofdm = &priv->_agn.max_delta.rx.ofdm; | ||
124 | max_cck = &priv->_agn.max_delta.rx.cck; | ||
125 | max_general = &priv->_agn.max_delta.rx.general; | ||
126 | max_ht = &priv->_agn.max_delta.rx.ofdm_ht; | ||
127 | } | ||
128 | 104 | ||
129 | pos += iwl_statistics_flag(priv, buf, bufsz); | 105 | pos += iwl_statistics_flag(priv, buf, bufsz); |
130 | pos += scnprintf(buf + pos, bufsz - pos, | 106 | pos += scnprintf(buf + pos, bufsz - pos, |
@@ -531,20 +507,13 @@ ssize_t iwl_ucode_tx_stats_read(struct file *file, | |||
531 | } | 507 | } |
532 | 508 | ||
533 | /* the statistic information display here is based on | 509 | /* the statistic information display here is based on |
534 | * the last statistics notification from uCode | 510 | * the last statistics notification from uCode |
535 | * might not reflect the current uCode activity | 511 | * might not reflect the current uCode activity |
536 | */ | 512 | */ |
537 | if (iwl_bt_statistics(priv)) { | 513 | tx = &priv->statistics.tx; |
538 | tx = &priv->_agn.statistics_bt.tx; | 514 | accum_tx = &priv->accum_stats.tx; |
539 | accum_tx = &priv->_agn.accum_statistics_bt.tx; | 515 | delta_tx = &priv->delta_stats.tx; |
540 | delta_tx = &priv->_agn.delta_statistics_bt.tx; | 516 | max_tx = &priv->max_delta_stats.tx; |
541 | max_tx = &priv->_agn.max_delta_bt.tx; | ||
542 | } else { | ||
543 | tx = &priv->_agn.statistics.tx; | ||
544 | accum_tx = &priv->_agn.accum_statistics.tx; | ||
545 | delta_tx = &priv->_agn.delta_statistics.tx; | ||
546 | max_tx = &priv->_agn.max_delta.tx; | ||
547 | } | ||
548 | 517 | ||
549 | pos += iwl_statistics_flag(priv, buf, bufsz); | 518 | pos += iwl_statistics_flag(priv, buf, bufsz); |
550 | pos += scnprintf(buf + pos, bufsz - pos, | 519 | pos += scnprintf(buf + pos, bufsz - pos, |
@@ -731,36 +700,21 @@ ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf, | |||
731 | } | 700 | } |
732 | 701 | ||
733 | /* the statistic information display here is based on | 702 | /* the statistic information display here is based on |
734 | * the last statistics notification from uCode | 703 | * the last statistics notification from uCode |
735 | * might not reflect the current uCode activity | 704 | * might not reflect the current uCode activity |
736 | */ | 705 | */ |
737 | if (iwl_bt_statistics(priv)) { | 706 | general = &priv->statistics.common; |
738 | general = &priv->_agn.statistics_bt.general.common; | 707 | dbg = &priv->statistics.common.dbg; |
739 | dbg = &priv->_agn.statistics_bt.general.common.dbg; | 708 | div = &priv->statistics.common.div; |
740 | div = &priv->_agn.statistics_bt.general.common.div; | 709 | accum_general = &priv->accum_stats.common; |
741 | accum_general = &priv->_agn.accum_statistics_bt.general.common; | 710 | accum_dbg = &priv->accum_stats.common.dbg; |
742 | accum_dbg = &priv->_agn.accum_statistics_bt.general.common.dbg; | 711 | accum_div = &priv->accum_stats.common.div; |
743 | accum_div = &priv->_agn.accum_statistics_bt.general.common.div; | 712 | delta_general = &priv->delta_stats.common; |
744 | delta_general = &priv->_agn.delta_statistics_bt.general.common; | 713 | max_general = &priv->max_delta_stats.common; |
745 | max_general = &priv->_agn.max_delta_bt.general.common; | 714 | delta_dbg = &priv->delta_stats.common.dbg; |
746 | delta_dbg = &priv->_agn.delta_statistics_bt.general.common.dbg; | 715 | max_dbg = &priv->max_delta_stats.common.dbg; |
747 | max_dbg = &priv->_agn.max_delta_bt.general.common.dbg; | 716 | delta_div = &priv->delta_stats.common.div; |
748 | delta_div = &priv->_agn.delta_statistics_bt.general.common.div; | 717 | max_div = &priv->max_delta_stats.common.div; |
749 | max_div = &priv->_agn.max_delta_bt.general.common.div; | ||
750 | } else { | ||
751 | general = &priv->_agn.statistics.general.common; | ||
752 | dbg = &priv->_agn.statistics.general.common.dbg; | ||
753 | div = &priv->_agn.statistics.general.common.div; | ||
754 | accum_general = &priv->_agn.accum_statistics.general.common; | ||
755 | accum_dbg = &priv->_agn.accum_statistics.general.common.dbg; | ||
756 | accum_div = &priv->_agn.accum_statistics.general.common.div; | ||
757 | delta_general = &priv->_agn.delta_statistics.general.common; | ||
758 | max_general = &priv->_agn.max_delta.general.common; | ||
759 | delta_dbg = &priv->_agn.delta_statistics.general.common.dbg; | ||
760 | max_dbg = &priv->_agn.max_delta.general.common.dbg; | ||
761 | delta_div = &priv->_agn.delta_statistics.general.common.div; | ||
762 | max_div = &priv->_agn.max_delta.general.common.div; | ||
763 | } | ||
764 | 718 | ||
765 | pos += iwl_statistics_flag(priv, buf, bufsz); | 719 | pos += iwl_statistics_flag(priv, buf, bufsz); |
766 | pos += scnprintf(buf + pos, bufsz - pos, | 720 | pos += scnprintf(buf + pos, bufsz - pos, |
@@ -876,8 +830,8 @@ ssize_t iwl_ucode_bt_stats_read(struct file *file, | |||
876 | * the last statistics notification from uCode | 830 | * the last statistics notification from uCode |
877 | * might not reflect the current uCode activity | 831 | * might not reflect the current uCode activity |
878 | */ | 832 | */ |
879 | bt = &priv->_agn.statistics_bt.general.activity; | 833 | bt = &priv->statistics.bt_activity; |
880 | accum_bt = &priv->_agn.accum_statistics_bt.general.activity; | 834 | accum_bt = &priv->accum_stats.bt_activity; |
881 | 835 | ||
882 | pos += iwl_statistics_flag(priv, buf, bufsz); | 836 | pos += iwl_statistics_flag(priv, buf, bufsz); |
883 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_BT:\n"); | 837 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_BT:\n"); |
@@ -918,10 +872,8 @@ ssize_t iwl_ucode_bt_stats_read(struct file *file, | |||
918 | 872 | ||
919 | pos += scnprintf(buf + pos, bufsz - pos, | 873 | pos += scnprintf(buf + pos, bufsz - pos, |
920 | "(rx)num_bt_kills:\t\t%u\t\t\t%u\n", | 874 | "(rx)num_bt_kills:\t\t%u\t\t\t%u\n", |
921 | le32_to_cpu(priv->_agn.statistics_bt.rx. | 875 | le32_to_cpu(priv->statistics.num_bt_kills), |
922 | general.num_bt_kills), | 876 | priv->statistics.accum_num_bt_kills); |
923 | priv->_agn.accum_statistics_bt.rx. | ||
924 | general.num_bt_kills); | ||
925 | 877 | ||
926 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 878 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
927 | kfree(buf); | 879 | kfree(buf); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-led.c b/drivers/net/wireless/iwlwifi/iwl-agn-led.c deleted file mode 100644 index 4bb877e600c7..000000000000 --- a/drivers/net/wireless/iwlwifi/iwl-agn-led.c +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * Copyright(c) 2003 - 2011 Intel Corporation. All rights reserved. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of version 2 of the GNU General Public License as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
17 | * | ||
18 | * The full GNU General Public License is included in this distribution in the | ||
19 | * file called LICENSE. | ||
20 | * | ||
21 | * Contact Information: | ||
22 | * Intel Linux Wireless <ilw@linux.intel.com> | ||
23 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
24 | * | ||
25 | *****************************************************************************/ | ||
26 | |||
27 | #include <linux/kernel.h> | ||
28 | #include <linux/module.h> | ||
29 | #include <linux/init.h> | ||
30 | #include <linux/pci.h> | ||
31 | #include <linux/dma-mapping.h> | ||
32 | #include <linux/delay.h> | ||
33 | #include <linux/skbuff.h> | ||
34 | #include <linux/netdevice.h> | ||
35 | #include <linux/wireless.h> | ||
36 | #include <net/mac80211.h> | ||
37 | #include <linux/etherdevice.h> | ||
38 | #include <asm/unaligned.h> | ||
39 | |||
40 | #include "iwl-commands.h" | ||
41 | #include "iwl-dev.h" | ||
42 | #include "iwl-core.h" | ||
43 | #include "iwl-io.h" | ||
44 | #include "iwl-agn-led.h" | ||
45 | |||
46 | /* Send led command */ | ||
47 | static int iwl_send_led_cmd(struct iwl_priv *priv, struct iwl_led_cmd *led_cmd) | ||
48 | { | ||
49 | struct iwl_host_cmd cmd = { | ||
50 | .id = REPLY_LEDS_CMD, | ||
51 | .len = sizeof(struct iwl_led_cmd), | ||
52 | .data = led_cmd, | ||
53 | .flags = CMD_ASYNC, | ||
54 | .callback = NULL, | ||
55 | }; | ||
56 | u32 reg; | ||
57 | |||
58 | reg = iwl_read32(priv, CSR_LED_REG); | ||
59 | if (reg != (reg & CSR_LED_BSM_CTRL_MSK)) | ||
60 | iwl_write32(priv, CSR_LED_REG, reg & CSR_LED_BSM_CTRL_MSK); | ||
61 | |||
62 | return iwl_send_cmd(priv, &cmd); | ||
63 | } | ||
64 | |||
65 | /* Set led register off */ | ||
66 | void iwlagn_led_enable(struct iwl_priv *priv) | ||
67 | { | ||
68 | iwl_write32(priv, CSR_LED_REG, CSR_LED_REG_TRUN_ON); | ||
69 | } | ||
70 | |||
71 | const struct iwl_led_ops iwlagn_led_ops = { | ||
72 | .cmd = iwl_send_led_cmd, | ||
73 | }; | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-led.h b/drivers/net/wireless/iwlwifi/iwl-agn-led.h deleted file mode 100644 index c0b7611b72c3..000000000000 --- a/drivers/net/wireless/iwlwifi/iwl-agn-led.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * Copyright(c) 2003 - 2011 Intel Corporation. All rights reserved. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of version 2 of the GNU General Public License as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
17 | * | ||
18 | * The full GNU General Public License is included in this distribution in the | ||
19 | * file called LICENSE. | ||
20 | * | ||
21 | * Contact Information: | ||
22 | * Intel Linux Wireless <ilw@linux.intel.com> | ||
23 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
24 | * | ||
25 | *****************************************************************************/ | ||
26 | |||
27 | #ifndef __iwl_agn_led_h__ | ||
28 | #define __iwl_agn_led_h__ | ||
29 | |||
30 | extern const struct iwl_led_ops iwlagn_led_ops; | ||
31 | void iwlagn_led_enable(struct iwl_priv *priv); | ||
32 | |||
33 | #endif /* __iwl_agn_led_h__ */ | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index 9e47be6a7393..e741128842bb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c | |||
@@ -172,6 +172,7 @@ static void iwlagn_count_agg_tx_err_status(struct iwl_priv *priv, u16 status) | |||
172 | 172 | ||
173 | static void iwlagn_set_tx_status(struct iwl_priv *priv, | 173 | static void iwlagn_set_tx_status(struct iwl_priv *priv, |
174 | struct ieee80211_tx_info *info, | 174 | struct ieee80211_tx_info *info, |
175 | struct iwl_rxon_context *ctx, | ||
175 | struct iwlagn_tx_resp *tx_resp, | 176 | struct iwlagn_tx_resp *tx_resp, |
176 | int txq_id, bool is_agg) | 177 | int txq_id, bool is_agg) |
177 | { | 178 | { |
@@ -186,6 +187,13 @@ static void iwlagn_set_tx_status(struct iwl_priv *priv, | |||
186 | if (!iwl_is_tx_success(status)) | 187 | if (!iwl_is_tx_success(status)) |
187 | iwlagn_count_tx_err_status(priv, status); | 188 | iwlagn_count_tx_err_status(priv, status); |
188 | 189 | ||
190 | if (status == TX_STATUS_FAIL_PASSIVE_NO_RX && | ||
191 | iwl_is_associated_ctx(ctx) && ctx->vif && | ||
192 | ctx->vif->type == NL80211_IFTYPE_STATION) { | ||
193 | ctx->last_tx_rejected = true; | ||
194 | iwl_stop_queue(priv, &priv->txq[txq_id]); | ||
195 | } | ||
196 | |||
189 | IWL_DEBUG_TX_REPLY(priv, "TXQ %d status %s (0x%08x) rate_n_flags " | 197 | IWL_DEBUG_TX_REPLY(priv, "TXQ %d status %s (0x%08x) rate_n_flags " |
190 | "0x%x retries %d\n", | 198 | "0x%x retries %d\n", |
191 | txq_id, | 199 | txq_id, |
@@ -242,15 +250,16 @@ static int iwlagn_tx_status_reply_tx(struct iwl_priv *priv, | |||
242 | 250 | ||
243 | /* # frames attempted by Tx command */ | 251 | /* # frames attempted by Tx command */ |
244 | if (agg->frame_count == 1) { | 252 | if (agg->frame_count == 1) { |
253 | struct iwl_tx_info *txb; | ||
254 | |||
245 | /* Only one frame was attempted; no block-ack will arrive */ | 255 | /* Only one frame was attempted; no block-ack will arrive */ |
246 | idx = start_idx; | 256 | idx = start_idx; |
247 | 257 | ||
248 | IWL_DEBUG_TX_REPLY(priv, "FrameCnt = %d, StartIdx=%d idx=%d\n", | 258 | IWL_DEBUG_TX_REPLY(priv, "FrameCnt = %d, StartIdx=%d idx=%d\n", |
249 | agg->frame_count, agg->start_idx, idx); | 259 | agg->frame_count, agg->start_idx, idx); |
250 | iwlagn_set_tx_status(priv, | 260 | txb = &priv->txq[txq_id].txb[idx]; |
251 | IEEE80211_SKB_CB( | 261 | iwlagn_set_tx_status(priv, IEEE80211_SKB_CB(txb->skb), |
252 | priv->txq[txq_id].txb[idx].skb), | 262 | txb->ctx, tx_resp, txq_id, true); |
253 | tx_resp, txq_id, true); | ||
254 | agg->wait_for_ba = 0; | 263 | agg->wait_for_ba = 0; |
255 | } else { | 264 | } else { |
256 | /* Two or more frames were attempted; expect block-ack */ | 265 | /* Two or more frames were attempted; expect block-ack */ |
@@ -391,7 +400,8 @@ static void iwlagn_rx_reply_tx(struct iwl_priv *priv, | |||
391 | struct iwl_tx_queue *txq = &priv->txq[txq_id]; | 400 | struct iwl_tx_queue *txq = &priv->txq[txq_id]; |
392 | struct ieee80211_tx_info *info; | 401 | struct ieee80211_tx_info *info; |
393 | struct iwlagn_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; | 402 | struct iwlagn_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; |
394 | u32 status = le16_to_cpu(tx_resp->status.status); | 403 | struct iwl_tx_info *txb; |
404 | u32 status = le16_to_cpu(tx_resp->status.status); | ||
395 | int tid; | 405 | int tid; |
396 | int sta_id; | 406 | int sta_id; |
397 | int freed; | 407 | int freed; |
@@ -406,7 +416,8 @@ static void iwlagn_rx_reply_tx(struct iwl_priv *priv, | |||
406 | } | 416 | } |
407 | 417 | ||
408 | txq->time_stamp = jiffies; | 418 | txq->time_stamp = jiffies; |
409 | info = IEEE80211_SKB_CB(txq->txb[txq->q.read_ptr].skb); | 419 | txb = &txq->txb[txq->q.read_ptr]; |
420 | info = IEEE80211_SKB_CB(txb->skb); | ||
410 | memset(&info->status, 0, sizeof(info->status)); | 421 | memset(&info->status, 0, sizeof(info->status)); |
411 | 422 | ||
412 | tid = (tx_resp->ra_tid & IWLAGN_TX_RES_TID_MSK) >> | 423 | tid = (tx_resp->ra_tid & IWLAGN_TX_RES_TID_MSK) >> |
@@ -450,12 +461,14 @@ static void iwlagn_rx_reply_tx(struct iwl_priv *priv, | |||
450 | iwl_wake_queue(priv, txq); | 461 | iwl_wake_queue(priv, txq); |
451 | } | 462 | } |
452 | } else { | 463 | } else { |
453 | iwlagn_set_tx_status(priv, info, tx_resp, txq_id, false); | 464 | iwlagn_set_tx_status(priv, info, txb->ctx, tx_resp, |
465 | txq_id, false); | ||
454 | freed = iwlagn_tx_queue_reclaim(priv, txq_id, index); | 466 | freed = iwlagn_tx_queue_reclaim(priv, txq_id, index); |
455 | iwl_free_tfds_in_queue(priv, sta_id, tid, freed); | 467 | iwl_free_tfds_in_queue(priv, sta_id, tid, freed); |
456 | 468 | ||
457 | if (priv->mac80211_registered && | 469 | if (priv->mac80211_registered && |
458 | (iwl_queue_space(&txq->q) > txq->q.low_mark)) | 470 | iwl_queue_space(&txq->q) > txq->q.low_mark && |
471 | status != TX_STATUS_FAIL_PASSIVE_NO_RX) | ||
459 | iwl_wake_queue(priv, txq); | 472 | iwl_wake_queue(priv, txq); |
460 | } | 473 | } |
461 | 474 | ||
@@ -482,8 +495,10 @@ void iwlagn_rx_handler_setup(struct iwl_priv *priv) | |||
482 | 495 | ||
483 | void iwlagn_setup_deferred_work(struct iwl_priv *priv) | 496 | void iwlagn_setup_deferred_work(struct iwl_priv *priv) |
484 | { | 497 | { |
485 | /* in agn, the tx power calibration is done in uCode */ | 498 | /* |
486 | priv->disable_tx_power_cal = 1; | 499 | * nothing need to be done here anymore |
500 | * still keep for future use if needed | ||
501 | */ | ||
487 | } | 502 | } |
488 | 503 | ||
489 | int iwlagn_hw_valid_rtc_data_addr(u32 addr) | 504 | int iwlagn_hw_valid_rtc_data_addr(u32 addr) |
@@ -534,9 +549,7 @@ int iwlagn_send_tx_power(struct iwl_priv *priv) | |||
534 | void iwlagn_temperature(struct iwl_priv *priv) | 549 | void iwlagn_temperature(struct iwl_priv *priv) |
535 | { | 550 | { |
536 | /* store temperature from correct statistics (in Celsius) */ | 551 | /* store temperature from correct statistics (in Celsius) */ |
537 | priv->temperature = le32_to_cpu((iwl_bt_statistics(priv)) ? | 552 | priv->temperature = le32_to_cpu(priv->statistics.common.temperature); |
538 | priv->_agn.statistics_bt.general.common.temperature : | ||
539 | priv->_agn.statistics.general.common.temperature); | ||
540 | iwl_tt_handler(priv); | 553 | iwl_tt_handler(priv); |
541 | } | 554 | } |
542 | 555 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.h b/drivers/net/wireless/iwlwifi/iwl-agn-rs.h index 69a29932babc..bdae82e7fa90 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.h | |||
@@ -83,7 +83,6 @@ enum { | |||
83 | 83 | ||
84 | enum { | 84 | enum { |
85 | IWL_FIRST_OFDM_RATE = IWL_RATE_6M_INDEX, | 85 | IWL_FIRST_OFDM_RATE = IWL_RATE_6M_INDEX, |
86 | IWL39_LAST_OFDM_RATE = IWL_RATE_54M_INDEX, | ||
87 | IWL_LAST_OFDM_RATE = IWL_RATE_60M_INDEX, | 86 | IWL_LAST_OFDM_RATE = IWL_RATE_60M_INDEX, |
88 | IWL_FIRST_CCK_RATE = IWL_RATE_1M_INDEX, | 87 | IWL_FIRST_CCK_RATE = IWL_RATE_1M_INDEX, |
89 | IWL_LAST_CCK_RATE = IWL_RATE_11M_INDEX, | 88 | IWL_LAST_CCK_RATE = IWL_RATE_11M_INDEX, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c index c335ee6883ee..56f46ee3bacd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "iwl-sta.h" | 29 | #include "iwl-sta.h" |
30 | #include "iwl-core.h" | 30 | #include "iwl-core.h" |
31 | #include "iwl-agn-calib.h" | 31 | #include "iwl-agn-calib.h" |
32 | #include "iwl-helpers.h" | ||
32 | 33 | ||
33 | static int iwlagn_disable_bss(struct iwl_priv *priv, | 34 | static int iwlagn_disable_bss(struct iwl_priv *priv, |
34 | struct iwl_rxon_context *ctx, | 35 | struct iwl_rxon_context *ctx, |
@@ -600,6 +601,18 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw, | |||
600 | priv->timestamp = bss_conf->timestamp; | 601 | priv->timestamp = bss_conf->timestamp; |
601 | ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK; | 602 | ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK; |
602 | } else { | 603 | } else { |
604 | /* | ||
605 | * If we disassociate while there are pending | ||
606 | * frames, just wake up the queues and let the | ||
607 | * frames "escape" ... This shouldn't really | ||
608 | * be happening to start with, but we should | ||
609 | * not get stuck in this case either since it | ||
610 | * can happen if userspace gets confused. | ||
611 | */ | ||
612 | if (ctx->last_tx_rejected) { | ||
613 | ctx->last_tx_rejected = false; | ||
614 | iwl_wake_any_queue(priv, ctx); | ||
615 | } | ||
603 | ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | 616 | ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; |
604 | } | 617 | } |
605 | } | 618 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c index 01a6d2fc795c..5c30f6b19a7f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c | |||
@@ -428,6 +428,7 @@ void iwlagn_send_bt_env(struct iwl_priv *priv, u8 action, u8 type) | |||
428 | int iwlagn_alive_notify(struct iwl_priv *priv) | 428 | int iwlagn_alive_notify(struct iwl_priv *priv) |
429 | { | 429 | { |
430 | const struct queue_to_fifo_ac *queue_to_fifo; | 430 | const struct queue_to_fifo_ac *queue_to_fifo; |
431 | struct iwl_rxon_context *ctx; | ||
431 | u32 a; | 432 | u32 a; |
432 | unsigned long flags; | 433 | unsigned long flags; |
433 | int i, chan; | 434 | int i, chan; |
@@ -501,6 +502,8 @@ int iwlagn_alive_notify(struct iwl_priv *priv) | |||
501 | memset(&priv->queue_stopped[0], 0, sizeof(priv->queue_stopped)); | 502 | memset(&priv->queue_stopped[0], 0, sizeof(priv->queue_stopped)); |
502 | for (i = 0; i < 4; i++) | 503 | for (i = 0; i < 4; i++) |
503 | atomic_set(&priv->queue_stop_count[i], 0); | 504 | atomic_set(&priv->queue_stop_count[i], 0); |
505 | for_each_context(priv, ctx) | ||
506 | ctx->last_tx_rejected = false; | ||
504 | 507 | ||
505 | /* reset to 0 to enable all the queue first */ | 508 | /* reset to 0 to enable all the queue first */ |
506 | priv->txq_ctx_active_msk = 0; | 509 | priv->txq_ctx_active_msk = 0; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 60bfde75ce87..cdeb09eee739 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -59,7 +59,6 @@ | |||
59 | #include "iwl-sta.h" | 59 | #include "iwl-sta.h" |
60 | #include "iwl-agn-calib.h" | 60 | #include "iwl-agn-calib.h" |
61 | #include "iwl-agn.h" | 61 | #include "iwl-agn.h" |
62 | #include "iwl-agn-led.h" | ||
63 | 62 | ||
64 | 63 | ||
65 | /****************************************************************************** | 64 | /****************************************************************************** |
@@ -254,6 +253,10 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv) | |||
254 | struct iwl_frame *frame; | 253 | struct iwl_frame *frame; |
255 | unsigned int frame_size; | 254 | unsigned int frame_size; |
256 | int rc; | 255 | int rc; |
256 | struct iwl_host_cmd cmd = { | ||
257 | .id = REPLY_TX_BEACON, | ||
258 | .flags = CMD_SIZE_HUGE, | ||
259 | }; | ||
257 | 260 | ||
258 | frame = iwl_get_free_frame(priv); | 261 | frame = iwl_get_free_frame(priv); |
259 | if (!frame) { | 262 | if (!frame) { |
@@ -269,8 +272,10 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv) | |||
269 | return -EINVAL; | 272 | return -EINVAL; |
270 | } | 273 | } |
271 | 274 | ||
272 | rc = iwl_send_cmd_pdu(priv, REPLY_TX_BEACON, frame_size, | 275 | cmd.len = frame_size; |
273 | &frame->u.cmd[0]); | 276 | cmd.data = &frame->u.cmd[0]; |
277 | |||
278 | rc = iwl_send_cmd_sync(priv, &cmd); | ||
274 | 279 | ||
275 | iwl_free_frame(priv, frame); | 280 | iwl_free_frame(priv, frame); |
276 | 281 | ||
@@ -395,7 +400,9 @@ int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, | |||
395 | return -EINVAL; | 400 | return -EINVAL; |
396 | } | 401 | } |
397 | 402 | ||
398 | BUG_ON(addr & ~DMA_BIT_MASK(36)); | 403 | if (WARN_ON(addr & ~DMA_BIT_MASK(36))) |
404 | return -EINVAL; | ||
405 | |||
399 | if (unlikely(addr & ~IWL_TX_DMA_MASK)) | 406 | if (unlikely(addr & ~IWL_TX_DMA_MASK)) |
400 | IWL_ERR(priv, "Unaligned address = %llx\n", | 407 | IWL_ERR(priv, "Unaligned address = %llx\n", |
401 | (unsigned long long)addr); | 408 | (unsigned long long)addr); |
@@ -719,7 +726,10 @@ static void iwl_rx_handle(struct iwl_priv *priv) | |||
719 | /* If an RXB doesn't have a Rx queue slot associated with it, | 726 | /* If an RXB doesn't have a Rx queue slot associated with it, |
720 | * then a bug has been introduced in the queue refilling | 727 | * then a bug has been introduced in the queue refilling |
721 | * routines -- catch it here */ | 728 | * routines -- catch it here */ |
722 | BUG_ON(rxb == NULL); | 729 | if (WARN_ON(rxb == NULL)) { |
730 | i = (i + 1) & RX_QUEUE_MASK; | ||
731 | continue; | ||
732 | } | ||
723 | 733 | ||
724 | rxq->queue[i] = NULL; | 734 | rxq->queue[i] = NULL; |
725 | 735 | ||
@@ -1481,7 +1491,7 @@ static int iwlagn_load_firmware(struct iwl_priv *priv, | |||
1481 | le32_to_cpup((__le32 *)tlv_data); | 1491 | le32_to_cpup((__le32 *)tlv_data); |
1482 | break; | 1492 | break; |
1483 | default: | 1493 | default: |
1484 | IWL_WARN(priv, "unknown TLV: %d\n", tlv_type); | 1494 | IWL_DEBUG_INFO(priv, "unknown TLV: %d\n", tlv_type); |
1485 | break; | 1495 | break; |
1486 | } | 1496 | } |
1487 | } | 1497 | } |
@@ -1705,10 +1715,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) | |||
1705 | else | 1715 | else |
1706 | priv->cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM; | 1716 | priv->cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM; |
1707 | 1717 | ||
1708 | if (ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BTSTATS || | ||
1709 | (priv->cfg->bt_params && priv->cfg->bt_params->bt_statistics)) | ||
1710 | priv->bt_statistics = true; | ||
1711 | |||
1712 | /* Copy images into buffers for card's bus-master reads ... */ | 1718 | /* Copy images into buffers for card's bus-master reads ... */ |
1713 | 1719 | ||
1714 | /* Runtime instructions (first block of data in file) */ | 1720 | /* Runtime instructions (first block of data in file) */ |
@@ -2626,17 +2632,8 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work) | |||
2626 | } | 2632 | } |
2627 | 2633 | ||
2628 | if (priv->start_calib) { | 2634 | if (priv->start_calib) { |
2629 | if (iwl_bt_statistics(priv)) { | 2635 | iwl_chain_noise_calibration(priv); |
2630 | iwl_chain_noise_calibration(priv, | 2636 | iwl_sensitivity_calibration(priv); |
2631 | (void *)&priv->_agn.statistics_bt); | ||
2632 | iwl_sensitivity_calibration(priv, | ||
2633 | (void *)&priv->_agn.statistics_bt); | ||
2634 | } else { | ||
2635 | iwl_chain_noise_calibration(priv, | ||
2636 | (void *)&priv->_agn.statistics); | ||
2637 | iwl_sensitivity_calibration(priv, | ||
2638 | (void *)&priv->_agn.statistics); | ||
2639 | } | ||
2640 | } | 2637 | } |
2641 | 2638 | ||
2642 | mutex_unlock(&priv->mutex); | 2639 | mutex_unlock(&priv->mutex); |
@@ -2828,9 +2825,8 @@ static int iwl_mac_setup_register(struct iwl_priv *priv, | |||
2828 | 2825 | ||
2829 | hw->max_tx_aggregation_subframes = LINK_QUAL_AGG_FRAME_LIMIT_DEF; | 2826 | hw->max_tx_aggregation_subframes = LINK_QUAL_AGG_FRAME_LIMIT_DEF; |
2830 | 2827 | ||
2831 | if (!priv->cfg->base_params->broken_powersave) | 2828 | hw->flags |= IEEE80211_HW_SUPPORTS_PS | |
2832 | hw->flags |= IEEE80211_HW_SUPPORTS_PS | | 2829 | IEEE80211_HW_SUPPORTS_DYNAMIC_PS; |
2833 | IEEE80211_HW_SUPPORTS_DYNAMIC_PS; | ||
2834 | 2830 | ||
2835 | if (priv->cfg->sku & IWL_SKU_N) | 2831 | if (priv->cfg->sku & IWL_SKU_N) |
2836 | hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS | | 2832 | hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS | |
@@ -3732,6 +3728,28 @@ static const u8 iwlagn_pan_ac_to_queue[] = { | |||
3732 | 7, 6, 5, 4, | 3728 | 7, 6, 5, 4, |
3733 | }; | 3729 | }; |
3734 | 3730 | ||
3731 | /* This function both allocates and initializes hw and priv. */ | ||
3732 | static struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg) | ||
3733 | { | ||
3734 | struct iwl_priv *priv; | ||
3735 | /* mac80211 allocates memory for this device instance, including | ||
3736 | * space for this driver's private structure */ | ||
3737 | struct ieee80211_hw *hw; | ||
3738 | |||
3739 | hw = ieee80211_alloc_hw(sizeof(struct iwl_priv), &iwlagn_hw_ops); | ||
3740 | if (hw == NULL) { | ||
3741 | pr_err("%s: Can not allocate network device\n", | ||
3742 | cfg->name); | ||
3743 | goto out; | ||
3744 | } | ||
3745 | |||
3746 | priv = hw->priv; | ||
3747 | priv->hw = hw; | ||
3748 | |||
3749 | out: | ||
3750 | return hw; | ||
3751 | } | ||
3752 | |||
3735 | static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | 3753 | static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
3736 | { | 3754 | { |
3737 | int err = 0, i; | 3755 | int err = 0, i; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h index 016b79e4421e..078a23e5d99d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h | |||
@@ -173,8 +173,6 @@ int iwlagn_hw_nic_init(struct iwl_priv *priv); | |||
173 | int iwlagn_wait_tx_queue_empty(struct iwl_priv *priv); | 173 | int iwlagn_wait_tx_queue_empty(struct iwl_priv *priv); |
174 | int iwlagn_txfifo_flush(struct iwl_priv *priv, u16 flush_control); | 174 | int iwlagn_txfifo_flush(struct iwl_priv *priv, u16 flush_control); |
175 | void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control); | 175 | void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control); |
176 | void iwl_dump_csr(struct iwl_priv *priv); | ||
177 | int iwl_dump_fh(struct iwl_priv *priv, char **buf, bool display); | ||
178 | 176 | ||
179 | /* rx */ | 177 | /* rx */ |
180 | void iwlagn_rx_queue_restock(struct iwl_priv *priv); | 178 | void iwlagn_rx_queue_restock(struct iwl_priv *priv); |
@@ -222,6 +220,7 @@ static inline u32 iwl_tx_status_to_mac80211(u32 status) | |||
222 | case TX_STATUS_DIRECT_DONE: | 220 | case TX_STATUS_DIRECT_DONE: |
223 | return IEEE80211_TX_STAT_ACK; | 221 | return IEEE80211_TX_STAT_ACK; |
224 | case TX_STATUS_FAIL_DEST_PS: | 222 | case TX_STATUS_FAIL_DEST_PS: |
223 | case TX_STATUS_FAIL_PASSIVE_NO_RX: | ||
225 | return IEEE80211_TX_STAT_TX_FILTERED; | 224 | return IEEE80211_TX_STAT_TX_FILTERED; |
226 | default: | 225 | default: |
227 | return 0; | 226 | return 0; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h index a1a5c1b23096..0edba8a6419b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-commands.h | |||
@@ -2535,53 +2535,6 @@ struct rate_histogram { | |||
2535 | 2535 | ||
2536 | /* statistics command response */ | 2536 | /* statistics command response */ |
2537 | 2537 | ||
2538 | struct iwl39_statistics_rx_phy { | ||
2539 | __le32 ina_cnt; | ||
2540 | __le32 fina_cnt; | ||
2541 | __le32 plcp_err; | ||
2542 | __le32 crc32_err; | ||
2543 | __le32 overrun_err; | ||
2544 | __le32 early_overrun_err; | ||
2545 | __le32 crc32_good; | ||
2546 | __le32 false_alarm_cnt; | ||
2547 | __le32 fina_sync_err_cnt; | ||
2548 | __le32 sfd_timeout; | ||
2549 | __le32 fina_timeout; | ||
2550 | __le32 unresponded_rts; | ||
2551 | __le32 rxe_frame_limit_overrun; | ||
2552 | __le32 sent_ack_cnt; | ||
2553 | __le32 sent_cts_cnt; | ||
2554 | } __packed; | ||
2555 | |||
2556 | struct iwl39_statistics_rx_non_phy { | ||
2557 | __le32 bogus_cts; /* CTS received when not expecting CTS */ | ||
2558 | __le32 bogus_ack; /* ACK received when not expecting ACK */ | ||
2559 | __le32 non_bssid_frames; /* number of frames with BSSID that | ||
2560 | * doesn't belong to the STA BSSID */ | ||
2561 | __le32 filtered_frames; /* count frames that were dumped in the | ||
2562 | * filtering process */ | ||
2563 | __le32 non_channel_beacons; /* beacons with our bss id but not on | ||
2564 | * our serving channel */ | ||
2565 | } __packed; | ||
2566 | |||
2567 | struct iwl39_statistics_rx { | ||
2568 | struct iwl39_statistics_rx_phy ofdm; | ||
2569 | struct iwl39_statistics_rx_phy cck; | ||
2570 | struct iwl39_statistics_rx_non_phy general; | ||
2571 | } __packed; | ||
2572 | |||
2573 | struct iwl39_statistics_tx { | ||
2574 | __le32 preamble_cnt; | ||
2575 | __le32 rx_detected_cnt; | ||
2576 | __le32 bt_prio_defer_cnt; | ||
2577 | __le32 bt_prio_kill_cnt; | ||
2578 | __le32 few_bytes_cnt; | ||
2579 | __le32 cts_timeout; | ||
2580 | __le32 ack_timeout; | ||
2581 | __le32 expected_ack_cnt; | ||
2582 | __le32 actual_ack_cnt; | ||
2583 | } __packed; | ||
2584 | |||
2585 | struct statistics_dbg { | 2538 | struct statistics_dbg { |
2586 | __le32 burst_check; | 2539 | __le32 burst_check; |
2587 | __le32 burst_count; | 2540 | __le32 burst_count; |
@@ -2589,23 +2542,6 @@ struct statistics_dbg { | |||
2589 | __le32 reserved[3]; | 2542 | __le32 reserved[3]; |
2590 | } __packed; | 2543 | } __packed; |
2591 | 2544 | ||
2592 | struct iwl39_statistics_div { | ||
2593 | __le32 tx_on_a; | ||
2594 | __le32 tx_on_b; | ||
2595 | __le32 exec_time; | ||
2596 | __le32 probe_time; | ||
2597 | } __packed; | ||
2598 | |||
2599 | struct iwl39_statistics_general { | ||
2600 | __le32 temperature; | ||
2601 | struct statistics_dbg dbg; | ||
2602 | __le32 sleep_time; | ||
2603 | __le32 slots_out; | ||
2604 | __le32 slots_idle; | ||
2605 | __le32 ttl_timestamp; | ||
2606 | struct iwl39_statistics_div div; | ||
2607 | } __packed; | ||
2608 | |||
2609 | struct statistics_rx_phy { | 2545 | struct statistics_rx_phy { |
2610 | __le32 ina_cnt; | 2546 | __le32 ina_cnt; |
2611 | __le32 fina_cnt; | 2547 | __le32 fina_cnt; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 45ec5cfe3fcf..885167f8168d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -67,30 +67,6 @@ u32 iwl_debug_level; | |||
67 | 67 | ||
68 | const u8 iwl_bcast_addr[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; | 68 | const u8 iwl_bcast_addr[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; |
69 | 69 | ||
70 | |||
71 | /* This function both allocates and initializes hw and priv. */ | ||
72 | struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg) | ||
73 | { | ||
74 | struct iwl_priv *priv; | ||
75 | /* mac80211 allocates memory for this device instance, including | ||
76 | * space for this driver's private structure */ | ||
77 | struct ieee80211_hw *hw; | ||
78 | |||
79 | hw = ieee80211_alloc_hw(sizeof(struct iwl_priv), | ||
80 | cfg->ops->ieee80211_ops); | ||
81 | if (hw == NULL) { | ||
82 | pr_err("%s: Can not allocate network device\n", | ||
83 | cfg->name); | ||
84 | goto out; | ||
85 | } | ||
86 | |||
87 | priv = hw->priv; | ||
88 | priv->hw = hw; | ||
89 | |||
90 | out: | ||
91 | return hw; | ||
92 | } | ||
93 | |||
94 | #define MAX_BIT_RATE_40_MHZ 150 /* Mbps */ | 70 | #define MAX_BIT_RATE_40_MHZ 150 /* Mbps */ |
95 | #define MAX_BIT_RATE_20_MHZ 72 /* Mbps */ | 71 | #define MAX_BIT_RATE_20_MHZ 72 /* Mbps */ |
96 | static void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv, | 72 | static void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv, |
@@ -965,12 +941,10 @@ void iwl_irq_handle_error(struct iwl_priv *priv) | |||
965 | IWL_ERR(priv, "Loaded firmware version: %s\n", | 941 | IWL_ERR(priv, "Loaded firmware version: %s\n", |
966 | priv->hw->wiphy->fw_version); | 942 | priv->hw->wiphy->fw_version); |
967 | 943 | ||
968 | priv->cfg->ops->lib->dump_nic_error_log(priv); | 944 | iwl_dump_nic_error_log(priv); |
969 | if (priv->cfg->ops->lib->dump_csr) | 945 | iwl_dump_csr(priv); |
970 | priv->cfg->ops->lib->dump_csr(priv); | 946 | iwl_dump_fh(priv, NULL, false); |
971 | if (priv->cfg->ops->lib->dump_fh) | 947 | iwl_dump_nic_event_log(priv, false, NULL, false); |
972 | priv->cfg->ops->lib->dump_fh(priv, NULL, false); | ||
973 | priv->cfg->ops->lib->dump_nic_event_log(priv, false, NULL, false); | ||
974 | #ifdef CONFIG_IWLWIFI_DEBUG | 948 | #ifdef CONFIG_IWLWIFI_DEBUG |
975 | if (iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) | 949 | if (iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) |
976 | iwl_print_rx_config_cmd(priv, | 950 | iwl_print_rx_config_cmd(priv, |
@@ -1051,7 +1025,6 @@ int iwl_apm_init(struct iwl_priv *priv) | |||
1051 | /* | 1025 | /* |
1052 | * Enable HAP INTA (interrupt from management bus) to | 1026 | * Enable HAP INTA (interrupt from management bus) to |
1053 | * wake device's PCI Express link L1a -> L0s | 1027 | * wake device's PCI Express link L1a -> L0s |
1054 | * NOTE: This is no-op for 3945 (non-existent bit) | ||
1055 | */ | 1028 | */ |
1056 | iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, | 1029 | iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, |
1057 | CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A); | 1030 | CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A); |
@@ -1064,20 +1037,18 @@ int iwl_apm_init(struct iwl_priv *priv) | |||
1064 | * If not (unlikely), enable L0S, so there is at least some | 1037 | * If not (unlikely), enable L0S, so there is at least some |
1065 | * power savings, even without L1. | 1038 | * power savings, even without L1. |
1066 | */ | 1039 | */ |
1067 | if (priv->cfg->base_params->set_l0s) { | 1040 | lctl = iwl_pcie_link_ctl(priv); |
1068 | lctl = iwl_pcie_link_ctl(priv); | 1041 | if ((lctl & PCI_CFG_LINK_CTRL_VAL_L1_EN) == |
1069 | if ((lctl & PCI_CFG_LINK_CTRL_VAL_L1_EN) == | 1042 | PCI_CFG_LINK_CTRL_VAL_L1_EN) { |
1070 | PCI_CFG_LINK_CTRL_VAL_L1_EN) { | 1043 | /* L1-ASPM enabled; disable(!) L0S */ |
1071 | /* L1-ASPM enabled; disable(!) L0S */ | 1044 | iwl_set_bit(priv, CSR_GIO_REG, |
1072 | iwl_set_bit(priv, CSR_GIO_REG, | 1045 | CSR_GIO_REG_VAL_L0S_ENABLED); |
1073 | CSR_GIO_REG_VAL_L0S_ENABLED); | 1046 | IWL_DEBUG_POWER(priv, "L1 Enabled; Disabling L0S\n"); |
1074 | IWL_DEBUG_POWER(priv, "L1 Enabled; Disabling L0S\n"); | 1047 | } else { |
1075 | } else { | 1048 | /* L1-ASPM disabled; enable(!) L0S */ |
1076 | /* L1-ASPM disabled; enable(!) L0S */ | 1049 | iwl_clear_bit(priv, CSR_GIO_REG, |
1077 | iwl_clear_bit(priv, CSR_GIO_REG, | 1050 | CSR_GIO_REG_VAL_L0S_ENABLED); |
1078 | CSR_GIO_REG_VAL_L0S_ENABLED); | 1051 | IWL_DEBUG_POWER(priv, "L1 Disabled; Enabling L0S\n"); |
1079 | IWL_DEBUG_POWER(priv, "L1 Disabled; Enabling L0S\n"); | ||
1080 | } | ||
1081 | } | 1052 | } |
1082 | 1053 | ||
1083 | /* Configure analog phase-lock-loop before activating to D0A */ | 1054 | /* Configure analog phase-lock-loop before activating to D0A */ |
@@ -1777,6 +1748,15 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1777 | 1748 | ||
1778 | mutex_lock(&priv->mutex); | 1749 | mutex_lock(&priv->mutex); |
1779 | 1750 | ||
1751 | if (!ctx->vif || !iwl_is_ready_rf(priv)) { | ||
1752 | /* | ||
1753 | * Huh? But wait ... this can maybe happen when | ||
1754 | * we're in the middle of a firmware restart! | ||
1755 | */ | ||
1756 | err = -EBUSY; | ||
1757 | goto out; | ||
1758 | } | ||
1759 | |||
1780 | interface_modes = ctx->interface_modes | ctx->exclusive_interface_modes; | 1760 | interface_modes = ctx->interface_modes | ctx->exclusive_interface_modes; |
1781 | 1761 | ||
1782 | if (!(interface_modes & BIT(newtype))) { | 1762 | if (!(interface_modes & BIT(newtype))) { |
@@ -1804,6 +1784,7 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1804 | /* success */ | 1784 | /* success */ |
1805 | iwl_teardown_interface(priv, vif, true); | 1785 | iwl_teardown_interface(priv, vif, true); |
1806 | vif->type = newtype; | 1786 | vif->type = newtype; |
1787 | vif->p2p = newp2p; | ||
1807 | err = iwl_setup_interface(priv, ctx); | 1788 | err = iwl_setup_interface(priv, ctx); |
1808 | WARN_ON(err); | 1789 | WARN_ON(err); |
1809 | /* | 1790 | /* |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 82939f851eb9..32a990ff09ae 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -139,12 +139,6 @@ struct iwl_temp_ops { | |||
139 | void (*temperature)(struct iwl_priv *priv); | 139 | void (*temperature)(struct iwl_priv *priv); |
140 | }; | 140 | }; |
141 | 141 | ||
142 | struct iwl_tt_ops { | ||
143 | bool (*lower_power_detection)(struct iwl_priv *priv); | ||
144 | u8 (*tt_power_mode)(struct iwl_priv *priv); | ||
145 | bool (*ct_kill_check)(struct iwl_priv *priv); | ||
146 | }; | ||
147 | |||
148 | struct iwl_lib_ops { | 142 | struct iwl_lib_ops { |
149 | /* set hw dependent parameters */ | 143 | /* set hw dependent parameters */ |
150 | int (*set_hw_params)(struct iwl_priv *priv); | 144 | int (*set_hw_params)(struct iwl_priv *priv); |
@@ -171,12 +165,6 @@ struct iwl_lib_ops { | |||
171 | void (*cancel_deferred_work)(struct iwl_priv *priv); | 165 | void (*cancel_deferred_work)(struct iwl_priv *priv); |
172 | /* check validity of rtc data address */ | 166 | /* check validity of rtc data address */ |
173 | int (*is_valid_rtc_data_addr)(u32 addr); | 167 | int (*is_valid_rtc_data_addr)(u32 addr); |
174 | |||
175 | int (*dump_nic_event_log)(struct iwl_priv *priv, | ||
176 | bool full_log, char **buf, bool display); | ||
177 | void (*dump_nic_error_log)(struct iwl_priv *priv); | ||
178 | void (*dump_csr)(struct iwl_priv *priv); | ||
179 | int (*dump_fh)(struct iwl_priv *priv, char **buf, bool display); | ||
180 | int (*set_channel_switch)(struct iwl_priv *priv, | 168 | int (*set_channel_switch)(struct iwl_priv *priv, |
181 | struct ieee80211_channel_switch *ch_switch); | 169 | struct ieee80211_channel_switch *ch_switch); |
182 | /* power management */ | 170 | /* power management */ |
@@ -196,13 +184,6 @@ struct iwl_lib_ops { | |||
196 | void (*dev_txfifo_flush)(struct iwl_priv *priv, u16 flush_control); | 184 | void (*dev_txfifo_flush)(struct iwl_priv *priv, u16 flush_control); |
197 | 185 | ||
198 | struct iwl_debugfs_ops debugfs_ops; | 186 | struct iwl_debugfs_ops debugfs_ops; |
199 | |||
200 | /* thermal throttling */ | ||
201 | struct iwl_tt_ops tt_ops; | ||
202 | }; | ||
203 | |||
204 | struct iwl_led_ops { | ||
205 | int (*cmd)(struct iwl_priv *priv, struct iwl_led_cmd *led_cmd); | ||
206 | }; | 187 | }; |
207 | 188 | ||
208 | /* NIC specific ops */ | 189 | /* NIC specific ops */ |
@@ -210,23 +191,11 @@ struct iwl_nic_ops { | |||
210 | void (*additional_nic_config)(struct iwl_priv *priv); | 191 | void (*additional_nic_config)(struct iwl_priv *priv); |
211 | }; | 192 | }; |
212 | 193 | ||
213 | struct iwl_legacy_ops { | ||
214 | void (*post_associate)(struct iwl_priv *priv); | ||
215 | void (*config_ap)(struct iwl_priv *priv); | ||
216 | /* station management */ | ||
217 | int (*update_bcast_stations)(struct iwl_priv *priv); | ||
218 | int (*manage_ibss_station)(struct iwl_priv *priv, | ||
219 | struct ieee80211_vif *vif, bool add); | ||
220 | }; | ||
221 | |||
222 | struct iwl_ops { | 194 | struct iwl_ops { |
223 | const struct iwl_lib_ops *lib; | 195 | const struct iwl_lib_ops *lib; |
224 | const struct iwl_hcmd_ops *hcmd; | 196 | const struct iwl_hcmd_ops *hcmd; |
225 | const struct iwl_hcmd_utils_ops *utils; | 197 | const struct iwl_hcmd_utils_ops *utils; |
226 | const struct iwl_led_ops *led; | ||
227 | const struct iwl_nic_ops *nic; | 198 | const struct iwl_nic_ops *nic; |
228 | const struct iwl_legacy_ops *legacy; | ||
229 | const struct ieee80211_ops *ieee80211_ops; | ||
230 | }; | 199 | }; |
231 | 200 | ||
232 | struct iwl_mod_params { | 201 | struct iwl_mod_params { |
@@ -256,13 +225,6 @@ struct iwl_mod_params { | |||
256 | * @wd_timeout: TX queues watchdog timeout | 225 | * @wd_timeout: TX queues watchdog timeout |
257 | * @temperature_kelvin: temperature report by uCode in kelvin | 226 | * @temperature_kelvin: temperature report by uCode in kelvin |
258 | * @max_event_log_size: size of event log buffer size for ucode event logging | 227 | * @max_event_log_size: size of event log buffer size for ucode event logging |
259 | * @tx_power_by_driver: tx power calibration performed by driver | ||
260 | * instead of uCode | ||
261 | * @ucode_tracing: support ucode continuous tracing | ||
262 | * @sensitivity_calib_by_driver: driver has the capability to perform | ||
263 | * sensitivity calibration operation | ||
264 | * @chain_noise_calib_by_driver: driver has the capability to perform | ||
265 | * chain noise calibration operation | ||
266 | * @shadow_reg_enable: HW shadhow register bit | 228 | * @shadow_reg_enable: HW shadhow register bit |
267 | */ | 229 | */ |
268 | struct iwl_base_params { | 230 | struct iwl_base_params { |
@@ -271,12 +233,10 @@ struct iwl_base_params { | |||
271 | int num_of_ampdu_queues;/* def: HW dependent */ | 233 | int num_of_ampdu_queues;/* def: HW dependent */ |
272 | /* for iwl_apm_init() */ | 234 | /* for iwl_apm_init() */ |
273 | u32 pll_cfg_val; | 235 | u32 pll_cfg_val; |
274 | bool set_l0s; | ||
275 | 236 | ||
276 | const u16 max_ll_items; | 237 | const u16 max_ll_items; |
277 | const bool shadow_ram_support; | 238 | const bool shadow_ram_support; |
278 | u16 led_compensation; | 239 | u16 led_compensation; |
279 | const bool broken_powersave; | ||
280 | int chain_noise_num_beacons; | 240 | int chain_noise_num_beacons; |
281 | bool adv_thermal_throttle; | 241 | bool adv_thermal_throttle; |
282 | bool support_ct_kill_exit; | 242 | bool support_ct_kill_exit; |
@@ -286,17 +246,12 @@ struct iwl_base_params { | |||
286 | unsigned int wd_timeout; | 246 | unsigned int wd_timeout; |
287 | bool temperature_kelvin; | 247 | bool temperature_kelvin; |
288 | u32 max_event_log_size; | 248 | u32 max_event_log_size; |
289 | const bool tx_power_by_driver; | ||
290 | const bool ucode_tracing; | ||
291 | const bool sensitivity_calib_by_driver; | ||
292 | const bool chain_noise_calib_by_driver; | ||
293 | const bool shadow_reg_enable; | 249 | const bool shadow_reg_enable; |
294 | }; | 250 | }; |
295 | /* | 251 | /* |
296 | * @advanced_bt_coexist: support advanced bt coexist | 252 | * @advanced_bt_coexist: support advanced bt coexist |
297 | * @bt_init_traffic_load: specify initial bt traffic load | 253 | * @bt_init_traffic_load: specify initial bt traffic load |
298 | * @bt_prio_boost: default bt priority boost value | 254 | * @bt_prio_boost: default bt priority boost value |
299 | * @bt_statistics: use BT version of statistics notification | ||
300 | * @agg_time_limit: maximum number of uSec in aggregation | 255 | * @agg_time_limit: maximum number of uSec in aggregation |
301 | * @ampdu_factor: Maximum A-MPDU length factor | 256 | * @ampdu_factor: Maximum A-MPDU length factor |
302 | * @ampdu_density: Minimum A-MPDU spacing | 257 | * @ampdu_density: Minimum A-MPDU spacing |
@@ -306,7 +261,6 @@ struct iwl_bt_params { | |||
306 | bool advanced_bt_coexist; | 261 | bool advanced_bt_coexist; |
307 | u8 bt_init_traffic_load; | 262 | u8 bt_init_traffic_load; |
308 | u8 bt_prio_boost; | 263 | u8 bt_prio_boost; |
309 | const bool bt_statistics; | ||
310 | u16 agg_time_limit; | 264 | u16 agg_time_limit; |
311 | u8 ampdu_factor; | 265 | u8 ampdu_factor; |
312 | u8 ampdu_density; | 266 | u8 ampdu_density; |
@@ -337,6 +291,7 @@ struct iwl_ht_params { | |||
337 | * @rx_with_siso_diversity: 1x1 device with rx antenna diversity | 291 | * @rx_with_siso_diversity: 1x1 device with rx antenna diversity |
338 | * @internal_wimax_coex: internal wifi/wimax combo device | 292 | * @internal_wimax_coex: internal wifi/wimax combo device |
339 | * @iq_invert: I/Q inversion | 293 | * @iq_invert: I/Q inversion |
294 | * @disable_otp_refresh: disable OTP refresh current limit | ||
340 | * | 295 | * |
341 | * We enable the driver to be backward compatible wrt API version. The | 296 | * We enable the driver to be backward compatible wrt API version. The |
342 | * driver specifies which APIs it supports (with @ucode_api_max being the | 297 | * driver specifies which APIs it supports (with @ucode_api_max being the |
@@ -387,13 +342,13 @@ struct iwl_cfg { | |||
387 | const bool rx_with_siso_diversity; | 342 | const bool rx_with_siso_diversity; |
388 | const bool internal_wimax_coex; | 343 | const bool internal_wimax_coex; |
389 | const bool iq_invert; | 344 | const bool iq_invert; |
345 | const bool disable_otp_refresh; | ||
390 | }; | 346 | }; |
391 | 347 | ||
392 | /*************************** | 348 | /*************************** |
393 | * L i b * | 349 | * L i b * |
394 | ***************************/ | 350 | ***************************/ |
395 | 351 | ||
396 | struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg); | ||
397 | int iwl_mac_conf_tx(struct ieee80211_hw *hw, u16 queue, | 352 | int iwl_mac_conf_tx(struct ieee80211_hw *hw, u16 queue, |
398 | const struct ieee80211_tx_queue_params *params); | 353 | const struct ieee80211_tx_queue_params *params); |
399 | int iwl_mac_tx_last_beacon(struct ieee80211_hw *hw); | 354 | int iwl_mac_tx_last_beacon(struct ieee80211_hw *hw); |
@@ -598,6 +553,8 @@ extern const struct dev_pm_ops iwl_pm_ops; | |||
598 | void iwl_dump_nic_error_log(struct iwl_priv *priv); | 553 | void iwl_dump_nic_error_log(struct iwl_priv *priv); |
599 | int iwl_dump_nic_event_log(struct iwl_priv *priv, | 554 | int iwl_dump_nic_event_log(struct iwl_priv *priv, |
600 | bool full_log, char **buf, bool display); | 555 | bool full_log, char **buf, bool display); |
556 | void iwl_dump_csr(struct iwl_priv *priv); | ||
557 | int iwl_dump_fh(struct iwl_priv *priv, char **buf, bool display); | ||
601 | #ifdef CONFIG_IWLWIFI_DEBUG | 558 | #ifdef CONFIG_IWLWIFI_DEBUG |
602 | void iwl_print_rx_config_cmd(struct iwl_priv *priv, | 559 | void iwl_print_rx_config_cmd(struct iwl_priv *priv, |
603 | struct iwl_rxon_context *ctx); | 560 | struct iwl_rxon_context *ctx); |
@@ -709,11 +666,6 @@ static inline bool iwl_advanced_bt_coexist(struct iwl_priv *priv) | |||
709 | priv->cfg->bt_params->advanced_bt_coexist; | 666 | priv->cfg->bt_params->advanced_bt_coexist; |
710 | } | 667 | } |
711 | 668 | ||
712 | static inline bool iwl_bt_statistics(struct iwl_priv *priv) | ||
713 | { | ||
714 | return priv->bt_statistics; | ||
715 | } | ||
716 | |||
717 | extern bool bt_coex_active; | 669 | extern bool bt_coex_active; |
718 | extern bool bt_siso_mode; | 670 | extern bool bt_siso_mode; |
719 | 671 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 92f6efd2c73f..c272204fccff 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -437,8 +437,7 @@ static ssize_t iwl_dbgfs_log_event_read(struct file *file, | |||
437 | int pos = 0; | 437 | int pos = 0; |
438 | ssize_t ret = -ENOMEM; | 438 | ssize_t ret = -ENOMEM; |
439 | 439 | ||
440 | ret = pos = priv->cfg->ops->lib->dump_nic_event_log( | 440 | ret = pos = iwl_dump_nic_event_log(priv, true, &buf, true); |
441 | priv, true, &buf, true); | ||
442 | if (buf) { | 441 | if (buf) { |
443 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 442 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
444 | kfree(buf); | 443 | kfree(buf); |
@@ -462,8 +461,7 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file, | |||
462 | if (sscanf(buf, "%d", &event_log_flag) != 1) | 461 | if (sscanf(buf, "%d", &event_log_flag) != 1) |
463 | return -EFAULT; | 462 | return -EFAULT; |
464 | if (event_log_flag == 1) | 463 | if (event_log_flag == 1) |
465 | priv->cfg->ops->lib->dump_nic_event_log(priv, true, | 464 | iwl_dump_nic_event_log(priv, true, NULL, false); |
466 | NULL, false); | ||
467 | 465 | ||
468 | return count; | 466 | return count; |
469 | } | 467 | } |
@@ -1268,8 +1266,7 @@ static ssize_t iwl_dbgfs_csr_write(struct file *file, | |||
1268 | if (sscanf(buf, "%d", &csr) != 1) | 1266 | if (sscanf(buf, "%d", &csr) != 1) |
1269 | return -EFAULT; | 1267 | return -EFAULT; |
1270 | 1268 | ||
1271 | if (priv->cfg->ops->lib->dump_csr) | 1269 | iwl_dump_csr(priv); |
1272 | priv->cfg->ops->lib->dump_csr(priv); | ||
1273 | 1270 | ||
1274 | return count; | 1271 | return count; |
1275 | } | 1272 | } |
@@ -1359,13 +1356,11 @@ static ssize_t iwl_dbgfs_fh_reg_read(struct file *file, | |||
1359 | int pos = 0; | 1356 | int pos = 0; |
1360 | ssize_t ret = -EFAULT; | 1357 | ssize_t ret = -EFAULT; |
1361 | 1358 | ||
1362 | if (priv->cfg->ops->lib->dump_fh) { | 1359 | ret = pos = iwl_dump_fh(priv, &buf, true); |
1363 | ret = pos = priv->cfg->ops->lib->dump_fh(priv, &buf, true); | 1360 | if (buf) { |
1364 | if (buf) { | 1361 | ret = simple_read_from_buffer(user_buf, |
1365 | ret = simple_read_from_buffer(user_buf, | 1362 | count, ppos, buf, pos); |
1366 | count, ppos, buf, pos); | 1363 | kfree(buf); |
1367 | kfree(buf); | ||
1368 | } | ||
1369 | } | 1364 | } |
1370 | 1365 | ||
1371 | return ret; | 1366 | return ret; |
@@ -1728,11 +1723,8 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
1728 | DEBUGFS_ADD_FILE(status, dir_data, S_IRUSR); | 1723 | DEBUGFS_ADD_FILE(status, dir_data, S_IRUSR); |
1729 | DEBUGFS_ADD_FILE(interrupt, dir_data, S_IWUSR | S_IRUSR); | 1724 | DEBUGFS_ADD_FILE(interrupt, dir_data, S_IWUSR | S_IRUSR); |
1730 | DEBUGFS_ADD_FILE(qos, dir_data, S_IRUSR); | 1725 | DEBUGFS_ADD_FILE(qos, dir_data, S_IRUSR); |
1731 | if (!priv->cfg->base_params->broken_powersave) { | 1726 | DEBUGFS_ADD_FILE(sleep_level_override, dir_data, S_IWUSR | S_IRUSR); |
1732 | DEBUGFS_ADD_FILE(sleep_level_override, dir_data, | 1727 | DEBUGFS_ADD_FILE(current_sleep_command, dir_data, S_IRUSR); |
1733 | S_IWUSR | S_IRUSR); | ||
1734 | DEBUGFS_ADD_FILE(current_sleep_command, dir_data, S_IRUSR); | ||
1735 | } | ||
1736 | DEBUGFS_ADD_FILE(thermal_throttling, dir_data, S_IRUSR); | 1728 | DEBUGFS_ADD_FILE(thermal_throttling, dir_data, S_IRUSR); |
1737 | DEBUGFS_ADD_FILE(disable_ht40, dir_data, S_IWUSR | S_IRUSR); | 1729 | DEBUGFS_ADD_FILE(disable_ht40, dir_data, S_IWUSR | S_IRUSR); |
1738 | DEBUGFS_ADD_FILE(rx_statistics, dir_debug, S_IRUSR); | 1730 | DEBUGFS_ADD_FILE(rx_statistics, dir_debug, S_IRUSR); |
@@ -1755,29 +1747,20 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
1755 | DEBUGFS_ADD_FILE(txfifo_flush, dir_debug, S_IWUSR); | 1747 | DEBUGFS_ADD_FILE(txfifo_flush, dir_debug, S_IWUSR); |
1756 | DEBUGFS_ADD_FILE(protection_mode, dir_debug, S_IWUSR | S_IRUSR); | 1748 | DEBUGFS_ADD_FILE(protection_mode, dir_debug, S_IWUSR | S_IRUSR); |
1757 | 1749 | ||
1758 | if (priv->cfg->base_params->sensitivity_calib_by_driver) | 1750 | DEBUGFS_ADD_FILE(sensitivity, dir_debug, S_IRUSR); |
1759 | DEBUGFS_ADD_FILE(sensitivity, dir_debug, S_IRUSR); | 1751 | DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR); |
1760 | if (priv->cfg->base_params->chain_noise_calib_by_driver) | 1752 | DEBUGFS_ADD_FILE(ucode_tracing, dir_debug, S_IWUSR | S_IRUSR); |
1761 | DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR); | 1753 | DEBUGFS_ADD_FILE(ucode_bt_stats, dir_debug, S_IRUSR); |
1762 | if (priv->cfg->base_params->ucode_tracing) | ||
1763 | DEBUGFS_ADD_FILE(ucode_tracing, dir_debug, S_IWUSR | S_IRUSR); | ||
1764 | if (iwl_bt_statistics(priv)) | ||
1765 | DEBUGFS_ADD_FILE(ucode_bt_stats, dir_debug, S_IRUSR); | ||
1766 | DEBUGFS_ADD_FILE(reply_tx_error, dir_debug, S_IRUSR); | 1754 | DEBUGFS_ADD_FILE(reply_tx_error, dir_debug, S_IRUSR); |
1767 | DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); | 1755 | DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); |
1768 | DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); | 1756 | DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); |
1769 | DEBUGFS_ADD_FILE(wd_timeout, dir_debug, S_IWUSR); | 1757 | DEBUGFS_ADD_FILE(wd_timeout, dir_debug, S_IWUSR); |
1770 | if (iwl_advanced_bt_coexist(priv)) | 1758 | if (iwl_advanced_bt_coexist(priv)) |
1771 | DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR); | 1759 | DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR); |
1772 | if (priv->cfg->base_params->sensitivity_calib_by_driver) | 1760 | DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf, |
1773 | DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf, | 1761 | &priv->disable_sens_cal); |
1774 | &priv->disable_sens_cal); | 1762 | DEBUGFS_ADD_BOOL(disable_chain_noise, dir_rf, |
1775 | if (priv->cfg->base_params->chain_noise_calib_by_driver) | 1763 | &priv->disable_chain_noise_cal); |
1776 | DEBUGFS_ADD_BOOL(disable_chain_noise, dir_rf, | ||
1777 | &priv->disable_chain_noise_cal); | ||
1778 | if (priv->cfg->base_params->tx_power_by_driver) | ||
1779 | DEBUGFS_ADD_BOOL(disable_tx_power, dir_rf, | ||
1780 | &priv->disable_tx_power_cal); | ||
1781 | return 0; | 1764 | return 0; |
1782 | 1765 | ||
1783 | err: | 1766 | err: |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 72133368c1f5..e84534c4d956 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -543,13 +543,12 @@ enum iwl_ucode_tlv_type { | |||
543 | * enum iwl_ucode_tlv_flag - ucode API flags | 543 | * enum iwl_ucode_tlv_flag - ucode API flags |
544 | * @IWL_UCODE_TLV_FLAGS_PAN: This is PAN capable microcode; this previously | 544 | * @IWL_UCODE_TLV_FLAGS_PAN: This is PAN capable microcode; this previously |
545 | * was a separate TLV but moved here to save space. | 545 | * was a separate TLV but moved here to save space. |
546 | * @IWL_UCODE_TLV_FLAGS_BTSTATS: This uCode image uses BT statistics, which | 546 | * @IWL_UCODE_TLV_FLAGS_RESERVED_1: reserved |
547 | * may be true even if the device doesn't have BT. | ||
548 | * @IWL_UCODE_TLV_FLAGS_MFP: This uCode image supports MFP (802.11w). | 547 | * @IWL_UCODE_TLV_FLAGS_MFP: This uCode image supports MFP (802.11w). |
549 | */ | 548 | */ |
550 | enum iwl_ucode_tlv_flag { | 549 | enum iwl_ucode_tlv_flag { |
551 | IWL_UCODE_TLV_FLAGS_PAN = BIT(0), | 550 | IWL_UCODE_TLV_FLAGS_PAN = BIT(0), |
552 | IWL_UCODE_TLV_FLAGS_BTSTATS = BIT(1), | 551 | IWL_UCODE_TLV_FLAGS_RESERVED_1 = BIT(1), |
553 | IWL_UCODE_TLV_FLAGS_MFP = BIT(2), | 552 | IWL_UCODE_TLV_FLAGS_MFP = BIT(2), |
554 | }; | 553 | }; |
555 | 554 | ||
@@ -1170,6 +1169,8 @@ struct iwl_rxon_context { | |||
1170 | bool enabled, is_40mhz; | 1169 | bool enabled, is_40mhz; |
1171 | u8 extension_chan_offset; | 1170 | u8 extension_chan_offset; |
1172 | } ht; | 1171 | } ht; |
1172 | |||
1173 | bool last_tx_rejected; | ||
1173 | }; | 1174 | }; |
1174 | 1175 | ||
1175 | enum iwl_scan_type { | 1176 | enum iwl_scan_type { |
@@ -1355,6 +1356,31 @@ struct iwl_priv { | |||
1355 | u64 timestamp; | 1356 | u64 timestamp; |
1356 | 1357 | ||
1357 | struct { | 1358 | struct { |
1359 | __le32 flag; | ||
1360 | struct statistics_general_common common; | ||
1361 | struct statistics_rx_non_phy rx_non_phy; | ||
1362 | struct statistics_rx_phy rx_ofdm; | ||
1363 | struct statistics_rx_ht_phy rx_ofdm_ht; | ||
1364 | struct statistics_rx_phy rx_cck; | ||
1365 | struct statistics_tx tx; | ||
1366 | #ifdef CONFIG_IWLWIFI_DEBUGFS | ||
1367 | struct statistics_bt_activity bt_activity; | ||
1368 | __le32 num_bt_kills, accum_num_bt_kills; | ||
1369 | #endif | ||
1370 | } statistics; | ||
1371 | #ifdef CONFIG_IWLWIFI_DEBUGFS | ||
1372 | struct { | ||
1373 | struct statistics_general_common common; | ||
1374 | struct statistics_rx_non_phy rx_non_phy; | ||
1375 | struct statistics_rx_phy rx_ofdm; | ||
1376 | struct statistics_rx_ht_phy rx_ofdm_ht; | ||
1377 | struct statistics_rx_phy rx_cck; | ||
1378 | struct statistics_tx tx; | ||
1379 | struct statistics_bt_activity bt_activity; | ||
1380 | } accum_stats, delta_stats, max_delta_stats; | ||
1381 | #endif | ||
1382 | |||
1383 | struct { | ||
1358 | /* INT ICT Table */ | 1384 | /* INT ICT Table */ |
1359 | __le32 *ict_tbl; | 1385 | __le32 *ict_tbl; |
1360 | void *ict_tbl_vir; | 1386 | void *ict_tbl_vir; |
@@ -1385,19 +1411,9 @@ struct iwl_priv { | |||
1385 | u8 phy_calib_chain_noise_reset_cmd; | 1411 | u8 phy_calib_chain_noise_reset_cmd; |
1386 | u8 phy_calib_chain_noise_gain_cmd; | 1412 | u8 phy_calib_chain_noise_gain_cmd; |
1387 | 1413 | ||
1388 | struct iwl_notif_statistics statistics; | ||
1389 | struct iwl_bt_notif_statistics statistics_bt; | ||
1390 | /* counts reply_tx error */ | 1414 | /* counts reply_tx error */ |
1391 | struct reply_tx_error_statistics reply_tx_stats; | 1415 | struct reply_tx_error_statistics reply_tx_stats; |
1392 | struct reply_agg_tx_error_statistics reply_agg_tx_stats; | 1416 | struct reply_agg_tx_error_statistics reply_agg_tx_stats; |
1393 | #ifdef CONFIG_IWLWIFI_DEBUGFS | ||
1394 | struct iwl_notif_statistics accum_statistics; | ||
1395 | struct iwl_notif_statistics delta_statistics; | ||
1396 | struct iwl_notif_statistics max_delta; | ||
1397 | struct iwl_bt_notif_statistics accum_statistics_bt; | ||
1398 | struct iwl_bt_notif_statistics delta_statistics_bt; | ||
1399 | struct iwl_bt_notif_statistics max_delta_bt; | ||
1400 | #endif | ||
1401 | /* notification wait support */ | 1417 | /* notification wait support */ |
1402 | struct list_head notif_waits; | 1418 | struct list_head notif_waits; |
1403 | spinlock_t notif_wait_lock; | 1419 | spinlock_t notif_wait_lock; |
@@ -1422,7 +1438,6 @@ struct iwl_priv { | |||
1422 | bool bt_ch_announce; | 1438 | bool bt_ch_announce; |
1423 | bool bt_full_concurrent; | 1439 | bool bt_full_concurrent; |
1424 | bool bt_ant_couple_ok; | 1440 | bool bt_ant_couple_ok; |
1425 | bool bt_statistics; | ||
1426 | __le32 kill_ack_mask; | 1441 | __le32 kill_ack_mask; |
1427 | __le32 kill_cts_mask; | 1442 | __le32 kill_cts_mask; |
1428 | __le16 bt_valid; | 1443 | __le16 bt_valid; |
@@ -1487,7 +1502,6 @@ struct iwl_priv { | |||
1487 | struct work_struct txpower_work; | 1502 | struct work_struct txpower_work; |
1488 | u32 disable_sens_cal; | 1503 | u32 disable_sens_cal; |
1489 | u32 disable_chain_noise_cal; | 1504 | u32 disable_chain_noise_cal; |
1490 | u32 disable_tx_power_cal; | ||
1491 | struct work_struct run_time_calib_work; | 1505 | struct work_struct run_time_calib_work; |
1492 | struct timer_list statistics_periodic; | 1506 | struct timer_list statistics_periodic; |
1493 | struct timer_list ucode_trace; | 1507 | struct timer_list ucode_trace; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c index 859b94a12297..402733638f50 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c | |||
@@ -215,12 +215,6 @@ static int iwlcore_get_nvm_type(struct iwl_priv *priv, u32 hw_rev) | |||
215 | return nvm_type; | 215 | return nvm_type; |
216 | } | 216 | } |
217 | 217 | ||
218 | const u8 *iwlcore_eeprom_query_addr(const struct iwl_priv *priv, size_t offset) | ||
219 | { | ||
220 | BUG_ON(offset >= priv->cfg->base_params->eeprom_size); | ||
221 | return &priv->eeprom[offset]; | ||
222 | } | ||
223 | |||
224 | static int iwl_init_otp_access(struct iwl_priv *priv) | 218 | static int iwl_init_otp_access(struct iwl_priv *priv) |
225 | { | 219 | { |
226 | int ret; | 220 | int ret; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.h b/drivers/net/wireless/iwlwifi/iwl-eeprom.h index 0e9d9703636a..9ce052573c6a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.h +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.h | |||
@@ -309,7 +309,6 @@ int iwl_eeprom_check_sku(struct iwl_priv *priv); | |||
309 | const u8 *iwl_eeprom_query_addr(const struct iwl_priv *priv, size_t offset); | 309 | const u8 *iwl_eeprom_query_addr(const struct iwl_priv *priv, size_t offset); |
310 | int iwlcore_eeprom_verify_signature(struct iwl_priv *priv); | 310 | int iwlcore_eeprom_verify_signature(struct iwl_priv *priv); |
311 | u16 iwl_eeprom_query16(const struct iwl_priv *priv, size_t offset); | 311 | u16 iwl_eeprom_query16(const struct iwl_priv *priv, size_t offset); |
312 | const u8 *iwlcore_eeprom_query_addr(const struct iwl_priv *priv, size_t offset); | ||
313 | int iwl_init_channel_map(struct iwl_priv *priv); | 312 | int iwl_init_channel_map(struct iwl_priv *priv); |
314 | void iwl_free_channel_map(struct iwl_priv *priv); | 313 | void iwl_free_channel_map(struct iwl_priv *priv); |
315 | const struct iwl_channel_info *iwl_get_channel_info( | 314 | const struct iwl_channel_info *iwl_get_channel_info( |
diff --git a/drivers/net/wireless/iwlwifi/iwl-fh.h b/drivers/net/wireless/iwlwifi/iwl-fh.h index e7a1bc6b76fd..6dfa806aefec 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fh.h +++ b/drivers/net/wireless/iwlwifi/iwl-fh.h | |||
@@ -77,14 +77,14 @@ | |||
77 | /** | 77 | /** |
78 | * Keep-Warm (KW) buffer base address. | 78 | * Keep-Warm (KW) buffer base address. |
79 | * | 79 | * |
80 | * Driver must allocate a 4KByte buffer that is used by 4965 for keeping the | 80 | * Driver must allocate a 4KByte buffer that is for keeping the |
81 | * host DRAM powered on (via dummy accesses to DRAM) to maintain low-latency | 81 | * host DRAM powered on (via dummy accesses to DRAM) to maintain low-latency |
82 | * DRAM access when 4965 is Txing or Rxing. The dummy accesses prevent host | 82 | * DRAM access when doing Txing or Rxing. The dummy accesses prevent host |
83 | * from going into a power-savings mode that would cause higher DRAM latency, | 83 | * from going into a power-savings mode that would cause higher DRAM latency, |
84 | * and possible data over/under-runs, before all Tx/Rx is complete. | 84 | * and possible data over/under-runs, before all Tx/Rx is complete. |
85 | * | 85 | * |
86 | * Driver loads FH_KW_MEM_ADDR_REG with the physical address (bits 35:4) | 86 | * Driver loads FH_KW_MEM_ADDR_REG with the physical address (bits 35:4) |
87 | * of the buffer, which must be 4K aligned. Once this is set up, the 4965 | 87 | * of the buffer, which must be 4K aligned. Once this is set up, the device |
88 | * automatically invokes keep-warm accesses when normal accesses might not | 88 | * automatically invokes keep-warm accesses when normal accesses might not |
89 | * be sufficient to maintain fast DRAM response. | 89 | * be sufficient to maintain fast DRAM response. |
90 | * | 90 | * |
@@ -97,7 +97,7 @@ | |||
97 | /** | 97 | /** |
98 | * TFD Circular Buffers Base (CBBC) addresses | 98 | * TFD Circular Buffers Base (CBBC) addresses |
99 | * | 99 | * |
100 | * 4965 has 16 base pointer registers, one for each of 16 host-DRAM-resident | 100 | * Device has 16 base pointer registers, one for each of 16 host-DRAM-resident |
101 | * circular buffers (CBs/queues) containing Transmit Frame Descriptors (TFDs) | 101 | * circular buffers (CBs/queues) containing Transmit Frame Descriptors (TFDs) |
102 | * (see struct iwl_tfd_frame). These 16 pointer registers are offset by 0x04 | 102 | * (see struct iwl_tfd_frame). These 16 pointer registers are offset by 0x04 |
103 | * bytes from one another. Each TFD circular buffer in DRAM must be 256-byte | 103 | * bytes from one another. Each TFD circular buffer in DRAM must be 256-byte |
@@ -116,16 +116,16 @@ | |||
116 | /** | 116 | /** |
117 | * Rx SRAM Control and Status Registers (RSCSR) | 117 | * Rx SRAM Control and Status Registers (RSCSR) |
118 | * | 118 | * |
119 | * These registers provide handshake between driver and 4965 for the Rx queue | 119 | * These registers provide handshake between driver and device for the Rx queue |
120 | * (this queue handles *all* command responses, notifications, Rx data, etc. | 120 | * (this queue handles *all* command responses, notifications, Rx data, etc. |
121 | * sent from 4965 uCode to host driver). Unlike Tx, there is only one Rx | 121 | * sent from uCode to host driver). Unlike Tx, there is only one Rx |
122 | * queue, and only one Rx DMA/FIFO channel. Also unlike Tx, which can | 122 | * queue, and only one Rx DMA/FIFO channel. Also unlike Tx, which can |
123 | * concatenate up to 20 DRAM buffers to form a Tx frame, each Receive Buffer | 123 | * concatenate up to 20 DRAM buffers to form a Tx frame, each Receive Buffer |
124 | * Descriptor (RBD) points to only one Rx Buffer (RB); there is a 1:1 | 124 | * Descriptor (RBD) points to only one Rx Buffer (RB); there is a 1:1 |
125 | * mapping between RBDs and RBs. | 125 | * mapping between RBDs and RBs. |
126 | * | 126 | * |
127 | * Driver must allocate host DRAM memory for the following, and set the | 127 | * Driver must allocate host DRAM memory for the following, and set the |
128 | * physical address of each into 4965 registers: | 128 | * physical address of each into device registers: |
129 | * | 129 | * |
130 | * 1) Receive Buffer Descriptor (RBD) circular buffer (CB), typically with 256 | 130 | * 1) Receive Buffer Descriptor (RBD) circular buffer (CB), typically with 256 |
131 | * entries (although any power of 2, up to 4096, is selectable by driver). | 131 | * entries (although any power of 2, up to 4096, is selectable by driver). |
@@ -140,20 +140,20 @@ | |||
140 | * Driver sets physical address [35:8] of base of RBD circular buffer | 140 | * Driver sets physical address [35:8] of base of RBD circular buffer |
141 | * into FH_RSCSR_CHNL0_RBDCB_BASE_REG [27:0]. | 141 | * into FH_RSCSR_CHNL0_RBDCB_BASE_REG [27:0]. |
142 | * | 142 | * |
143 | * 2) Rx status buffer, 8 bytes, in which 4965 indicates which Rx Buffers | 143 | * 2) Rx status buffer, 8 bytes, in which uCode indicates which Rx Buffers |
144 | * (RBs) have been filled, via a "write pointer", actually the index of | 144 | * (RBs) have been filled, via a "write pointer", actually the index of |
145 | * the RB's corresponding RBD within the circular buffer. Driver sets | 145 | * the RB's corresponding RBD within the circular buffer. Driver sets |
146 | * physical address [35:4] into FH_RSCSR_CHNL0_STTS_WPTR_REG [31:0]. | 146 | * physical address [35:4] into FH_RSCSR_CHNL0_STTS_WPTR_REG [31:0]. |
147 | * | 147 | * |
148 | * Bit fields in lower dword of Rx status buffer (upper dword not used | 148 | * Bit fields in lower dword of Rx status buffer (upper dword not used |
149 | * by driver; see struct iwl4965_shared, val0): | 149 | * by driver: |
150 | * 31-12: Not used by driver | 150 | * 31-12: Not used by driver |
151 | * 11- 0: Index of last filled Rx buffer descriptor | 151 | * 11- 0: Index of last filled Rx buffer descriptor |
152 | * (4965 writes, driver reads this value) | 152 | * (device writes, driver reads this value) |
153 | * | 153 | * |
154 | * As the driver prepares Receive Buffers (RBs) for 4965 to fill, driver must | 154 | * As the driver prepares Receive Buffers (RBs) for device to fill, driver must |
155 | * enter pointers to these RBs into contiguous RBD circular buffer entries, | 155 | * enter pointers to these RBs into contiguous RBD circular buffer entries, |
156 | * and update the 4965's "write" index register, | 156 | * and update the device's "write" index register, |
157 | * FH_RSCSR_CHNL0_RBDCB_WPTR_REG. | 157 | * FH_RSCSR_CHNL0_RBDCB_WPTR_REG. |
158 | * | 158 | * |
159 | * This "write" index corresponds to the *next* RBD that the driver will make | 159 | * This "write" index corresponds to the *next* RBD that the driver will make |
@@ -162,12 +162,12 @@ | |||
162 | * RBs), should be 8 after preparing the first 8 RBs (for example), and must | 162 | * RBs), should be 8 after preparing the first 8 RBs (for example), and must |
163 | * wrap back to 0 at the end of the circular buffer (but don't wrap before | 163 | * wrap back to 0 at the end of the circular buffer (but don't wrap before |
164 | * "read" index has advanced past 1! See below). | 164 | * "read" index has advanced past 1! See below). |
165 | * NOTE: 4965 EXPECTS THE WRITE INDEX TO BE INCREMENTED IN MULTIPLES OF 8. | 165 | * NOTE: DEVICE EXPECTS THE WRITE INDEX TO BE INCREMENTED IN MULTIPLES OF 8. |
166 | * | 166 | * |
167 | * As the 4965 fills RBs (referenced from contiguous RBDs within the circular | 167 | * As the device fills RBs (referenced from contiguous RBDs within the circular |
168 | * buffer), it updates the Rx status buffer in host DRAM, 2) described above, | 168 | * buffer), it updates the Rx status buffer in host DRAM, 2) described above, |
169 | * to tell the driver the index of the latest filled RBD. The driver must | 169 | * to tell the driver the index of the latest filled RBD. The driver must |
170 | * read this "read" index from DRAM after receiving an Rx interrupt from 4965. | 170 | * read this "read" index from DRAM after receiving an Rx interrupt from device |
171 | * | 171 | * |
172 | * The driver must also internally keep track of a third index, which is the | 172 | * The driver must also internally keep track of a third index, which is the |
173 | * next RBD to process. When receiving an Rx interrupt, driver should process | 173 | * next RBD to process. When receiving an Rx interrupt, driver should process |
@@ -176,7 +176,7 @@ | |||
176 | * driver may process the RB pointed to by RBD 0. Depending on volume of | 176 | * driver may process the RB pointed to by RBD 0. Depending on volume of |
177 | * traffic, there may be many RBs to process. | 177 | * traffic, there may be many RBs to process. |
178 | * | 178 | * |
179 | * If read index == write index, 4965 thinks there is no room to put new data. | 179 | * If read index == write index, device thinks there is no room to put new data. |
180 | * Due to this, the maximum number of filled RBs is 255, instead of 256. To | 180 | * Due to this, the maximum number of filled RBs is 255, instead of 256. To |
181 | * be safe, make sure that there is a gap of at least 2 RBDs between "write" | 181 | * be safe, make sure that there is a gap of at least 2 RBDs between "write" |
182 | * and "read" indexes; that is, make sure that there are no more than 254 | 182 | * and "read" indexes; that is, make sure that there are no more than 254 |
@@ -303,7 +303,7 @@ | |||
303 | /** | 303 | /** |
304 | * Transmit DMA Channel Control/Status Registers (TCSR) | 304 | * Transmit DMA Channel Control/Status Registers (TCSR) |
305 | * | 305 | * |
306 | * 4965 has one configuration register for each of 8 Tx DMA/FIFO channels | 306 | * Device has one configuration register for each of 8 Tx DMA/FIFO channels |
307 | * supported in hardware (don't confuse these with the 16 Tx queues in DRAM, | 307 | * supported in hardware (don't confuse these with the 16 Tx queues in DRAM, |
308 | * which feed the DMA/FIFO channels); config regs are separated by 0x20 bytes. | 308 | * which feed the DMA/FIFO channels); config regs are separated by 0x20 bytes. |
309 | * | 309 | * |
@@ -326,7 +326,6 @@ | |||
326 | #define FH_TCSR_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xE60) | 326 | #define FH_TCSR_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xE60) |
327 | 327 | ||
328 | /* Find Control/Status reg for given Tx DMA/FIFO channel */ | 328 | /* Find Control/Status reg for given Tx DMA/FIFO channel */ |
329 | #define FH49_TCSR_CHNL_NUM (7) | ||
330 | #define FH50_TCSR_CHNL_NUM (8) | 329 | #define FH50_TCSR_CHNL_NUM (8) |
331 | 330 | ||
332 | /* TCSR: tx_config register values */ | 331 | /* TCSR: tx_config register values */ |
@@ -424,7 +423,6 @@ | |||
424 | #define RX_LOW_WATERMARK 8 | 423 | #define RX_LOW_WATERMARK 8 |
425 | 424 | ||
426 | /* Size of one Rx buffer in host DRAM */ | 425 | /* Size of one Rx buffer in host DRAM */ |
427 | #define IWL_RX_BUF_SIZE_3K (3 * 1000) /* 3945 only */ | ||
428 | #define IWL_RX_BUF_SIZE_4K (4 * 1024) | 426 | #define IWL_RX_BUF_SIZE_4K (4 * 1024) |
429 | #define IWL_RX_BUF_SIZE_8K (8 * 1024) | 427 | #define IWL_RX_BUF_SIZE_8K (8 * 1024) |
430 | 428 | ||
@@ -443,7 +441,7 @@ struct iwl_rb_status { | |||
443 | __le16 closed_fr_num; | 441 | __le16 closed_fr_num; |
444 | __le16 finished_rb_num; | 442 | __le16 finished_rb_num; |
445 | __le16 finished_fr_nam; | 443 | __le16 finished_fr_nam; |
446 | __le32 __unused; /* 3945 only */ | 444 | __le32 __unused; |
447 | } __packed; | 445 | } __packed; |
448 | 446 | ||
449 | 447 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-hcmd.c index 9177b553fe57..8f0beb992ccf 100644 --- a/drivers/net/wireless/iwlwifi/iwl-hcmd.c +++ b/drivers/net/wireless/iwlwifi/iwl-hcmd.c | |||
@@ -143,10 +143,12 @@ static int iwl_send_cmd_async(struct iwl_priv *priv, struct iwl_host_cmd *cmd) | |||
143 | { | 143 | { |
144 | int ret; | 144 | int ret; |
145 | 145 | ||
146 | BUG_ON(!(cmd->flags & CMD_ASYNC)); | 146 | if (WARN_ON(!(cmd->flags & CMD_ASYNC))) |
147 | return -EINVAL; | ||
147 | 148 | ||
148 | /* An asynchronous command can not expect an SKB to be set. */ | 149 | /* An asynchronous command can not expect an SKB to be set. */ |
149 | BUG_ON(cmd->flags & CMD_WANT_SKB); | 150 | if (WARN_ON(cmd->flags & CMD_WANT_SKB)) |
151 | return -EINVAL; | ||
150 | 152 | ||
151 | /* Assign a generic callback if one is not provided */ | 153 | /* Assign a generic callback if one is not provided */ |
152 | if (!cmd->callback) | 154 | if (!cmd->callback) |
@@ -169,10 +171,12 @@ int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd) | |||
169 | int cmd_idx; | 171 | int cmd_idx; |
170 | int ret; | 172 | int ret; |
171 | 173 | ||
172 | lockdep_assert_held(&priv->mutex); | 174 | if (WARN_ON(cmd->flags & CMD_ASYNC)) |
175 | return -EINVAL; | ||
173 | 176 | ||
174 | /* A synchronous command can not have a callback set. */ | 177 | /* A synchronous command can not have a callback set. */ |
175 | BUG_ON((cmd->flags & CMD_ASYNC) || cmd->callback); | 178 | if (WARN_ON(cmd->callback)) |
179 | return -EINVAL; | ||
176 | 180 | ||
177 | IWL_DEBUG_INFO(priv, "Attempting to send sync command %s\n", | 181 | IWL_DEBUG_INFO(priv, "Attempting to send sync command %s\n", |
178 | get_cmd_string(cmd->id)); | 182 | get_cmd_string(cmd->id)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-helpers.h b/drivers/net/wireless/iwlwifi/iwl-helpers.h index 5da5761c74b1..9309ff2df4c2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-helpers.h +++ b/drivers/net/wireless/iwlwifi/iwl-helpers.h | |||
@@ -131,6 +131,19 @@ static inline void iwl_stop_queue(struct iwl_priv *priv, | |||
131 | ieee80211_stop_queue(priv->hw, ac); | 131 | ieee80211_stop_queue(priv->hw, ac); |
132 | } | 132 | } |
133 | 133 | ||
134 | static inline void iwl_wake_any_queue(struct iwl_priv *priv, | ||
135 | struct iwl_rxon_context *ctx) | ||
136 | { | ||
137 | u8 ac; | ||
138 | |||
139 | for (ac = 0; ac < AC_NUM; ac++) { | ||
140 | IWL_DEBUG_INFO(priv, "Queue Status: Q[%d] %s\n", | ||
141 | ac, (atomic_read(&priv->queue_stop_count[ac]) > 0) | ||
142 | ? "stopped" : "awake"); | ||
143 | iwl_wake_queue(priv, &priv->txq[ctx->ac_to_queue[ac]]); | ||
144 | } | ||
145 | } | ||
146 | |||
134 | #define ieee80211_stop_queue DO_NOT_USE_ieee80211_stop_queue | 147 | #define ieee80211_stop_queue DO_NOT_USE_ieee80211_stop_queue |
135 | #define ieee80211_wake_queue DO_NOT_USE_ieee80211_wake_queue | 148 | #define ieee80211_wake_queue DO_NOT_USE_ieee80211_wake_queue |
136 | 149 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-led.c b/drivers/net/wireless/iwlwifi/iwl-led.c index c2862d4e00e3..d798c2a152d3 100644 --- a/drivers/net/wireless/iwlwifi/iwl-led.c +++ b/drivers/net/wireless/iwlwifi/iwl-led.c | |||
@@ -61,10 +61,16 @@ static const struct ieee80211_tpt_blink iwl_blink[] = { | |||
61 | { .throughput = 300 * 1024 - 1, .blink_time = 50 }, | 61 | { .throughput = 300 * 1024 - 1, .blink_time = 50 }, |
62 | }; | 62 | }; |
63 | 63 | ||
64 | /* Set led register off */ | ||
65 | void iwlagn_led_enable(struct iwl_priv *priv) | ||
66 | { | ||
67 | iwl_write32(priv, CSR_LED_REG, CSR_LED_REG_TRUN_ON); | ||
68 | } | ||
69 | |||
64 | /* | 70 | /* |
65 | * Adjust led blink rate to compensate on a MAC Clock difference on every HW | 71 | * Adjust led blink rate to compensate on a MAC Clock difference on every HW |
66 | * Led blink rate analysis showed an average deviation of 0% on 3945, | 72 | * Led blink rate analysis showed an average deviation of 20% on 5000 series |
67 | * 5% on 4965 HW and 20% on 5000 series and up. | 73 | * and up. |
68 | * Need to compensate on the led on/off time per HW according to the deviation | 74 | * Need to compensate on the led on/off time per HW according to the deviation |
69 | * to achieve the desired led frequency | 75 | * to achieve the desired led frequency |
70 | * The calculation is: (100-averageDeviation)/100 * blinkTime | 76 | * The calculation is: (100-averageDeviation)/100 * blinkTime |
@@ -84,6 +90,24 @@ static inline u8 iwl_blink_compensation(struct iwl_priv *priv, | |||
84 | return (u8)((time * compensation) >> 6); | 90 | return (u8)((time * compensation) >> 6); |
85 | } | 91 | } |
86 | 92 | ||
93 | static int iwl_send_led_cmd(struct iwl_priv *priv, struct iwl_led_cmd *led_cmd) | ||
94 | { | ||
95 | struct iwl_host_cmd cmd = { | ||
96 | .id = REPLY_LEDS_CMD, | ||
97 | .len = sizeof(struct iwl_led_cmd), | ||
98 | .data = led_cmd, | ||
99 | .flags = CMD_ASYNC, | ||
100 | .callback = NULL, | ||
101 | }; | ||
102 | u32 reg; | ||
103 | |||
104 | reg = iwl_read32(priv, CSR_LED_REG); | ||
105 | if (reg != (reg & CSR_LED_BSM_CTRL_MSK)) | ||
106 | iwl_write32(priv, CSR_LED_REG, reg & CSR_LED_BSM_CTRL_MSK); | ||
107 | |||
108 | return iwl_send_cmd(priv, &cmd); | ||
109 | } | ||
110 | |||
87 | /* Set led pattern command */ | 111 | /* Set led pattern command */ |
88 | static int iwl_led_cmd(struct iwl_priv *priv, | 112 | static int iwl_led_cmd(struct iwl_priv *priv, |
89 | unsigned long on, | 113 | unsigned long on, |
@@ -108,7 +132,7 @@ static int iwl_led_cmd(struct iwl_priv *priv, | |||
108 | led_cmd.off = iwl_blink_compensation(priv, off, | 132 | led_cmd.off = iwl_blink_compensation(priv, off, |
109 | priv->cfg->base_params->led_compensation); | 133 | priv->cfg->base_params->led_compensation); |
110 | 134 | ||
111 | ret = priv->cfg->ops->led->cmd(priv, &led_cmd); | 135 | ret = iwl_send_led_cmd(priv, &led_cmd); |
112 | if (!ret) { | 136 | if (!ret) { |
113 | priv->blink_on = on; | 137 | priv->blink_on = on; |
114 | priv->blink_off = off; | 138 | priv->blink_off = off; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-led.h b/drivers/net/wireless/iwlwifi/iwl-led.h index 05b8e8f7dd4a..1c93dfef6933 100644 --- a/drivers/net/wireless/iwlwifi/iwl-led.h +++ b/drivers/net/wireless/iwlwifi/iwl-led.h | |||
@@ -50,6 +50,7 @@ enum iwl_led_mode { | |||
50 | IWL_LED_BLINK, | 50 | IWL_LED_BLINK, |
51 | }; | 51 | }; |
52 | 52 | ||
53 | void iwlagn_led_enable(struct iwl_priv *priv); | ||
53 | void iwl_leds_init(struct iwl_priv *priv); | 54 | void iwl_leds_init(struct iwl_priv *priv); |
54 | void iwl_leds_exit(struct iwl_priv *priv); | 55 | void iwl_leds_exit(struct iwl_priv *priv); |
55 | 56 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c index c43c8e66de73..595c930b28ae 100644 --- a/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/drivers/net/wireless/iwlwifi/iwl-power.c | |||
@@ -188,9 +188,10 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv, | |||
188 | table = range_0; | 188 | table = range_0; |
189 | } | 189 | } |
190 | 190 | ||
191 | BUG_ON(lvl < 0 || lvl >= IWL_POWER_NUM); | 191 | if (WARN_ON(lvl < 0 || lvl >= IWL_POWER_NUM)) |
192 | 192 | memset(cmd, 0, sizeof(*cmd)); | |
193 | *cmd = table[lvl].cmd; | 193 | else |
194 | *cmd = table[lvl].cmd; | ||
194 | 195 | ||
195 | if (period == 0) { | 196 | if (period == 0) { |
196 | skip = 0; | 197 | skip = 0; |
@@ -354,16 +355,12 @@ static void iwl_power_build_cmd(struct iwl_priv *priv, | |||
354 | 355 | ||
355 | dtimper = priv->hw->conf.ps_dtim_period ?: 1; | 356 | dtimper = priv->hw->conf.ps_dtim_period ?: 1; |
356 | 357 | ||
357 | if (priv->cfg->base_params->broken_powersave) | 358 | if (priv->hw->conf.flags & IEEE80211_CONF_IDLE) |
358 | iwl_power_sleep_cam_cmd(priv, cmd); | ||
359 | else if (priv->hw->conf.flags & IEEE80211_CONF_IDLE) | ||
360 | iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, 20); | 359 | iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, 20); |
361 | else if (priv->cfg->ops->lib->tt_ops.lower_power_detection && | 360 | else if (iwl_tt_is_low_power_state(priv)) { |
362 | priv->cfg->ops->lib->tt_ops.tt_power_mode && | ||
363 | priv->cfg->ops->lib->tt_ops.lower_power_detection(priv)) { | ||
364 | /* in thermal throttling low power state */ | 361 | /* in thermal throttling low power state */ |
365 | iwl_static_sleep_cmd(priv, cmd, | 362 | iwl_static_sleep_cmd(priv, cmd, |
366 | priv->cfg->ops->lib->tt_ops.tt_power_mode(priv), dtimper); | 363 | iwl_tt_current_power_mode(priv), dtimper); |
367 | } else if (!enabled) | 364 | } else if (!enabled) |
368 | iwl_power_sleep_cam_cmd(priv, cmd); | 365 | iwl_power_sleep_cam_cmd(priv, cmd); |
369 | else if (priv->power_data.debug_sleep_level_override >= 0) | 366 | else if (priv->power_data.debug_sleep_level_override >= 0) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-prph.h b/drivers/net/wireless/iwlwifi/iwl-prph.h index c960195df989..f00d188b2cfc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-prph.h +++ b/drivers/net/wireless/iwlwifi/iwl-prph.h | |||
@@ -107,17 +107,7 @@ | |||
107 | * device. A queue maps to only one (selectable by driver) Tx DMA channel, | 107 | * device. A queue maps to only one (selectable by driver) Tx DMA channel, |
108 | * but one DMA channel may take input from several queues. | 108 | * but one DMA channel may take input from several queues. |
109 | * | 109 | * |
110 | * Tx DMA FIFOs have dedicated purposes. For 4965, they are used as follows | 110 | * Tx DMA FIFOs have dedicated purposes. |
111 | * (cf. default_queue_to_tx_fifo in iwl-4965.c): | ||
112 | * | ||
113 | * 0 -- EDCA BK (background) frames, lowest priority | ||
114 | * 1 -- EDCA BE (best effort) frames, normal priority | ||
115 | * 2 -- EDCA VI (video) frames, higher priority | ||
116 | * 3 -- EDCA VO (voice) and management frames, highest priority | ||
117 | * 4 -- Commands (e.g. RXON, etc.) | ||
118 | * 5 -- unused (HCCA) | ||
119 | * 6 -- unused (HCCA) | ||
120 | * 7 -- not used by driver (device-internal only) | ||
121 | * | 111 | * |
122 | * For 5000 series and up, they are used differently | 112 | * For 5000 series and up, they are used differently |
123 | * (cf. iwl5000_default_queue_to_tx_fifo in iwl-5000.c): | 113 | * (cf. iwl5000_default_queue_to_tx_fifo in iwl-5000.c): |
@@ -151,7 +141,7 @@ | |||
151 | * Tx completion may end up being out-of-order). | 141 | * Tx completion may end up being out-of-order). |
152 | * | 142 | * |
153 | * The driver must maintain the queue's Byte Count table in host DRAM | 143 | * The driver must maintain the queue's Byte Count table in host DRAM |
154 | * (struct iwl4965_sched_queue_byte_cnt_tbl) for this mode. | 144 | * for this mode. |
155 | * This mode does not support fragmentation. | 145 | * This mode does not support fragmentation. |
156 | * | 146 | * |
157 | * 2) FIFO (a.k.a. non-Scheduler-ACK), in which each TFD is processed in order. | 147 | * 2) FIFO (a.k.a. non-Scheduler-ACK), in which each TFD is processed in order. |
@@ -164,7 +154,7 @@ | |||
164 | * | 154 | * |
165 | * Driver controls scheduler operation via 3 means: | 155 | * Driver controls scheduler operation via 3 means: |
166 | * 1) Scheduler registers | 156 | * 1) Scheduler registers |
167 | * 2) Shared scheduler data base in internal 4956 SRAM | 157 | * 2) Shared scheduler data base in internal SRAM |
168 | * 3) Shared data in host DRAM | 158 | * 3) Shared data in host DRAM |
169 | * | 159 | * |
170 | * Initialization: | 160 | * Initialization: |
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index c421f566982f..b49819ca2cd6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -390,21 +390,16 @@ static void iwl_rx_beacon_notif(struct iwl_priv *priv, | |||
390 | * the BA_TIMEOUT_MAX, reload firmware and bring system back to normal | 390 | * the BA_TIMEOUT_MAX, reload firmware and bring system back to normal |
391 | * operation state. | 391 | * operation state. |
392 | */ | 392 | */ |
393 | static bool iwl_good_ack_health(struct iwl_priv *priv, struct iwl_rx_packet *pkt) | 393 | static bool iwl_good_ack_health(struct iwl_priv *priv, |
394 | struct statistics_tx *cur) | ||
394 | { | 395 | { |
395 | int actual_delta, expected_delta, ba_timeout_delta; | 396 | int actual_delta, expected_delta, ba_timeout_delta; |
396 | struct statistics_tx *cur, *old; | 397 | struct statistics_tx *old; |
397 | 398 | ||
398 | if (priv->_agn.agg_tids_count) | 399 | if (priv->_agn.agg_tids_count) |
399 | return true; | 400 | return true; |
400 | 401 | ||
401 | if (iwl_bt_statistics(priv)) { | 402 | old = &priv->statistics.tx; |
402 | cur = &pkt->u.stats_bt.tx; | ||
403 | old = &priv->_agn.statistics_bt.tx; | ||
404 | } else { | ||
405 | cur = &pkt->u.stats.tx; | ||
406 | old = &priv->_agn.statistics.tx; | ||
407 | } | ||
408 | 403 | ||
409 | actual_delta = le32_to_cpu(cur->actual_ack_cnt) - | 404 | actual_delta = le32_to_cpu(cur->actual_ack_cnt) - |
410 | le32_to_cpu(old->actual_ack_cnt); | 405 | le32_to_cpu(old->actual_ack_cnt); |
@@ -430,10 +425,10 @@ static bool iwl_good_ack_health(struct iwl_priv *priv, struct iwl_rx_packet *pkt | |||
430 | * DEBUG is not, these will just compile out. | 425 | * DEBUG is not, these will just compile out. |
431 | */ | 426 | */ |
432 | IWL_DEBUG_RADIO(priv, "rx_detected_cnt delta %d\n", | 427 | IWL_DEBUG_RADIO(priv, "rx_detected_cnt delta %d\n", |
433 | priv->_agn.delta_statistics.tx.rx_detected_cnt); | 428 | priv->delta_stats.tx.rx_detected_cnt); |
434 | IWL_DEBUG_RADIO(priv, | 429 | IWL_DEBUG_RADIO(priv, |
435 | "ack_or_ba_timeout_collision delta %d\n", | 430 | "ack_or_ba_timeout_collision delta %d\n", |
436 | priv->_agn.delta_statistics.tx.ack_or_ba_timeout_collision); | 431 | priv->delta_stats.tx.ack_or_ba_timeout_collision); |
437 | #endif | 432 | #endif |
438 | 433 | ||
439 | if (ba_timeout_delta >= BA_TIMEOUT_MAX) | 434 | if (ba_timeout_delta >= BA_TIMEOUT_MAX) |
@@ -450,7 +445,9 @@ static bool iwl_good_ack_health(struct iwl_priv *priv, struct iwl_rx_packet *pkt | |||
450 | * to improve the throughput. | 445 | * to improve the throughput. |
451 | */ | 446 | */ |
452 | static bool iwl_good_plcp_health(struct iwl_priv *priv, | 447 | static bool iwl_good_plcp_health(struct iwl_priv *priv, |
453 | struct iwl_rx_packet *pkt, unsigned int msecs) | 448 | struct statistics_rx_phy *cur_ofdm, |
449 | struct statistics_rx_ht_phy *cur_ofdm_ht, | ||
450 | unsigned int msecs) | ||
454 | { | 451 | { |
455 | int delta; | 452 | int delta; |
456 | int threshold = priv->cfg->base_params->plcp_delta_threshold; | 453 | int threshold = priv->cfg->base_params->plcp_delta_threshold; |
@@ -460,29 +457,12 @@ static bool iwl_good_plcp_health(struct iwl_priv *priv, | |||
460 | return true; | 457 | return true; |
461 | } | 458 | } |
462 | 459 | ||
463 | if (iwl_bt_statistics(priv)) { | 460 | delta = le32_to_cpu(cur_ofdm->plcp_err) - |
464 | struct statistics_rx_bt *cur, *old; | 461 | le32_to_cpu(priv->statistics.rx_ofdm.plcp_err) + |
465 | 462 | le32_to_cpu(cur_ofdm_ht->plcp_err) - | |
466 | cur = &pkt->u.stats_bt.rx; | 463 | le32_to_cpu(priv->statistics.rx_ofdm_ht.plcp_err); |
467 | old = &priv->_agn.statistics_bt.rx; | ||
468 | |||
469 | delta = le32_to_cpu(cur->ofdm.plcp_err) - | ||
470 | le32_to_cpu(old->ofdm.plcp_err) + | ||
471 | le32_to_cpu(cur->ofdm_ht.plcp_err) - | ||
472 | le32_to_cpu(old->ofdm_ht.plcp_err); | ||
473 | } else { | ||
474 | struct statistics_rx *cur, *old; | ||
475 | |||
476 | cur = &pkt->u.stats.rx; | ||
477 | old = &priv->_agn.statistics.rx; | ||
478 | 464 | ||
479 | delta = le32_to_cpu(cur->ofdm.plcp_err) - | 465 | /* Can be negative if firmware reset statistics */ |
480 | le32_to_cpu(old->ofdm.plcp_err) + | ||
481 | le32_to_cpu(cur->ofdm_ht.plcp_err) - | ||
482 | le32_to_cpu(old->ofdm_ht.plcp_err); | ||
483 | } | ||
484 | |||
485 | /* Can be negative if firmware reseted statistics */ | ||
486 | if (delta <= 0) | 466 | if (delta <= 0) |
487 | return true; | 467 | return true; |
488 | 468 | ||
@@ -497,44 +477,36 @@ static bool iwl_good_plcp_health(struct iwl_priv *priv, | |||
497 | } | 477 | } |
498 | 478 | ||
499 | static void iwl_recover_from_statistics(struct iwl_priv *priv, | 479 | static void iwl_recover_from_statistics(struct iwl_priv *priv, |
500 | struct iwl_rx_packet *pkt) | 480 | struct statistics_rx_phy *cur_ofdm, |
481 | struct statistics_rx_ht_phy *cur_ofdm_ht, | ||
482 | struct statistics_tx *tx, | ||
483 | unsigned long stamp) | ||
501 | { | 484 | { |
502 | const struct iwl_mod_params *mod_params = priv->cfg->mod_params; | 485 | const struct iwl_mod_params *mod_params = priv->cfg->mod_params; |
503 | unsigned int msecs; | 486 | unsigned int msecs; |
504 | unsigned long stamp; | ||
505 | 487 | ||
506 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 488 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
507 | return; | 489 | return; |
508 | 490 | ||
509 | stamp = jiffies; | ||
510 | msecs = jiffies_to_msecs(stamp - priv->rx_statistics_jiffies); | 491 | msecs = jiffies_to_msecs(stamp - priv->rx_statistics_jiffies); |
511 | 492 | ||
512 | /* Only gather statistics and update time stamp when not associated */ | 493 | /* Only gather statistics and update time stamp when not associated */ |
513 | if (!iwl_is_any_associated(priv)) | 494 | if (!iwl_is_any_associated(priv)) |
514 | goto out; | 495 | return; |
515 | 496 | ||
516 | /* Do not check/recover when do not have enough statistics data */ | 497 | /* Do not check/recover when do not have enough statistics data */ |
517 | if (msecs < 99) | 498 | if (msecs < 99) |
518 | return; | 499 | return; |
519 | 500 | ||
520 | if (mod_params->ack_check && !iwl_good_ack_health(priv, pkt)) { | 501 | if (mod_params->ack_check && !iwl_good_ack_health(priv, tx)) { |
521 | IWL_ERR(priv, "low ack count detected, restart firmware\n"); | 502 | IWL_ERR(priv, "low ack count detected, restart firmware\n"); |
522 | if (!iwl_force_reset(priv, IWL_FW_RESET, false)) | 503 | if (!iwl_force_reset(priv, IWL_FW_RESET, false)) |
523 | return; | 504 | return; |
524 | } | 505 | } |
525 | 506 | ||
526 | if (mod_params->plcp_check && !iwl_good_plcp_health(priv, pkt, msecs)) | 507 | if (mod_params->plcp_check && |
508 | !iwl_good_plcp_health(priv, cur_ofdm, cur_ofdm_ht, msecs)) | ||
527 | iwl_force_reset(priv, IWL_RF_RESET, false); | 509 | iwl_force_reset(priv, IWL_RF_RESET, false); |
528 | |||
529 | out: | ||
530 | if (iwl_bt_statistics(priv)) | ||
531 | memcpy(&priv->_agn.statistics_bt, &pkt->u.stats_bt, | ||
532 | sizeof(priv->_agn.statistics_bt)); | ||
533 | else | ||
534 | memcpy(&priv->_agn.statistics, &pkt->u.stats, | ||
535 | sizeof(priv->_agn.statistics)); | ||
536 | |||
537 | priv->rx_statistics_jiffies = stamp; | ||
538 | } | 510 | } |
539 | 511 | ||
540 | /* Calculate noise level, based on measurements during network silence just | 512 | /* Calculate noise level, based on measurements during network silence just |
@@ -548,10 +520,8 @@ static void iwl_rx_calc_noise(struct iwl_priv *priv) | |||
548 | int bcn_silence_a, bcn_silence_b, bcn_silence_c; | 520 | int bcn_silence_a, bcn_silence_b, bcn_silence_c; |
549 | int last_rx_noise; | 521 | int last_rx_noise; |
550 | 522 | ||
551 | if (iwl_bt_statistics(priv)) | 523 | rx_info = &priv->statistics.rx_non_phy; |
552 | rx_info = &(priv->_agn.statistics_bt.rx.general.common); | 524 | |
553 | else | ||
554 | rx_info = &(priv->_agn.statistics.rx.general); | ||
555 | bcn_silence_a = | 525 | bcn_silence_a = |
556 | le32_to_cpu(rx_info->beacon_silence_rssi_a) & IN_BAND_FILTER; | 526 | le32_to_cpu(rx_info->beacon_silence_rssi_a) & IN_BAND_FILTER; |
557 | bcn_silence_b = | 527 | bcn_silence_b = |
@@ -583,105 +553,153 @@ static void iwl_rx_calc_noise(struct iwl_priv *priv) | |||
583 | last_rx_noise); | 553 | last_rx_noise); |
584 | } | 554 | } |
585 | 555 | ||
556 | #ifdef CONFIG_IWLWIFI_DEBUGFS | ||
586 | /* | 557 | /* |
587 | * based on the assumption of all statistics counter are in DWORD | 558 | * based on the assumption of all statistics counter are in DWORD |
588 | * FIXME: This function is for debugging, do not deal with | 559 | * FIXME: This function is for debugging, do not deal with |
589 | * the case of counters roll-over. | 560 | * the case of counters roll-over. |
590 | */ | 561 | */ |
591 | static void iwl_accumulative_statistics(struct iwl_priv *priv, | 562 | static void accum_stats(__le32 *prev, __le32 *cur, __le32 *delta, |
592 | __le32 *stats) | 563 | __le32 *max_delta, __le32 *accum, int size) |
593 | { | 564 | { |
594 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 565 | int i; |
595 | int i, size; | 566 | |
596 | __le32 *prev_stats; | 567 | for (i = 0; |
597 | u32 *accum_stats; | 568 | i < size / sizeof(__le32); |
598 | u32 *delta, *max_delta; | 569 | i++, prev++, cur++, delta++, max_delta++, accum++) { |
599 | struct statistics_general_common *general, *accum_general; | 570 | if (le32_to_cpu(*cur) > le32_to_cpu(*prev)) { |
600 | struct statistics_tx *tx, *accum_tx; | 571 | *delta = cpu_to_le32( |
601 | 572 | le32_to_cpu(*cur) - le32_to_cpu(*prev)); | |
602 | if (iwl_bt_statistics(priv)) { | 573 | le32_add_cpu(accum, le32_to_cpu(*delta)); |
603 | prev_stats = (__le32 *)&priv->_agn.statistics_bt; | 574 | if (le32_to_cpu(*delta) > le32_to_cpu(*max_delta)) |
604 | accum_stats = (u32 *)&priv->_agn.accum_statistics_bt; | ||
605 | size = sizeof(struct iwl_bt_notif_statistics); | ||
606 | general = &priv->_agn.statistics_bt.general.common; | ||
607 | accum_general = &priv->_agn.accum_statistics_bt.general.common; | ||
608 | tx = &priv->_agn.statistics_bt.tx; | ||
609 | accum_tx = &priv->_agn.accum_statistics_bt.tx; | ||
610 | delta = (u32 *)&priv->_agn.delta_statistics_bt; | ||
611 | max_delta = (u32 *)&priv->_agn.max_delta_bt; | ||
612 | } else { | ||
613 | prev_stats = (__le32 *)&priv->_agn.statistics; | ||
614 | accum_stats = (u32 *)&priv->_agn.accum_statistics; | ||
615 | size = sizeof(struct iwl_notif_statistics); | ||
616 | general = &priv->_agn.statistics.general.common; | ||
617 | accum_general = &priv->_agn.accum_statistics.general.common; | ||
618 | tx = &priv->_agn.statistics.tx; | ||
619 | accum_tx = &priv->_agn.accum_statistics.tx; | ||
620 | delta = (u32 *)&priv->_agn.delta_statistics; | ||
621 | max_delta = (u32 *)&priv->_agn.max_delta; | ||
622 | } | ||
623 | for (i = sizeof(__le32); i < size; | ||
624 | i += sizeof(__le32), stats++, prev_stats++, delta++, | ||
625 | max_delta++, accum_stats++) { | ||
626 | if (le32_to_cpu(*stats) > le32_to_cpu(*prev_stats)) { | ||
627 | *delta = (le32_to_cpu(*stats) - | ||
628 | le32_to_cpu(*prev_stats)); | ||
629 | *accum_stats += *delta; | ||
630 | if (*delta > *max_delta) | ||
631 | *max_delta = *delta; | 575 | *max_delta = *delta; |
632 | } | 576 | } |
633 | } | 577 | } |
578 | } | ||
634 | 579 | ||
635 | /* reset accumulative statistics for "no-counter" type statistics */ | 580 | static void |
636 | accum_general->temperature = general->temperature; | 581 | iwl_accumulative_statistics(struct iwl_priv *priv, |
637 | accum_general->temperature_m = general->temperature_m; | 582 | struct statistics_general_common *common, |
638 | accum_general->ttl_timestamp = general->ttl_timestamp; | 583 | struct statistics_rx_non_phy *rx_non_phy, |
639 | accum_tx->tx_power.ant_a = tx->tx_power.ant_a; | 584 | struct statistics_rx_phy *rx_ofdm, |
640 | accum_tx->tx_power.ant_b = tx->tx_power.ant_b; | 585 | struct statistics_rx_ht_phy *rx_ofdm_ht, |
641 | accum_tx->tx_power.ant_c = tx->tx_power.ant_c; | 586 | struct statistics_rx_phy *rx_cck, |
642 | #endif | 587 | struct statistics_tx *tx, |
588 | struct statistics_bt_activity *bt_activity) | ||
589 | { | ||
590 | #define ACCUM(_name) \ | ||
591 | accum_stats((__le32 *)&priv->statistics._name, \ | ||
592 | (__le32 *)_name, \ | ||
593 | (__le32 *)&priv->delta_stats._name, \ | ||
594 | (__le32 *)&priv->max_delta_stats._name, \ | ||
595 | (__le32 *)&priv->accum_stats._name, \ | ||
596 | sizeof(*_name)); | ||
597 | |||
598 | ACCUM(common); | ||
599 | ACCUM(rx_non_phy); | ||
600 | ACCUM(rx_ofdm); | ||
601 | ACCUM(rx_ofdm_ht); | ||
602 | ACCUM(rx_cck); | ||
603 | ACCUM(tx); | ||
604 | if (bt_activity) | ||
605 | ACCUM(bt_activity); | ||
606 | #undef ACCUM | ||
607 | } | ||
608 | #else | ||
609 | static inline void | ||
610 | iwl_accumulative_statistics(struct iwl_priv *priv, | ||
611 | struct statistics_general_common *common, | ||
612 | struct statistics_rx_non_phy *rx_non_phy, | ||
613 | struct statistics_rx_phy *rx_ofdm, | ||
614 | struct statistics_rx_ht_phy *rx_ofdm_ht, | ||
615 | struct statistics_rx_phy *rx_cck, | ||
616 | struct statistics_tx *tx, | ||
617 | struct statistics_bt_activity *bt_activity) | ||
618 | { | ||
643 | } | 619 | } |
620 | #endif | ||
644 | 621 | ||
645 | static void iwl_rx_statistics(struct iwl_priv *priv, | 622 | static void iwl_rx_statistics(struct iwl_priv *priv, |
646 | struct iwl_rx_mem_buffer *rxb) | 623 | struct iwl_rx_mem_buffer *rxb) |
647 | { | 624 | { |
625 | unsigned long stamp = jiffies; | ||
648 | const int reg_recalib_period = 60; | 626 | const int reg_recalib_period = 60; |
649 | int change; | 627 | int change; |
650 | struct iwl_rx_packet *pkt = rxb_addr(rxb); | 628 | struct iwl_rx_packet *pkt = rxb_addr(rxb); |
629 | u32 len = le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK; | ||
630 | __le32 *flag; | ||
631 | struct statistics_general_common *common; | ||
632 | struct statistics_rx_non_phy *rx_non_phy; | ||
633 | struct statistics_rx_phy *rx_ofdm; | ||
634 | struct statistics_rx_ht_phy *rx_ofdm_ht; | ||
635 | struct statistics_rx_phy *rx_cck; | ||
636 | struct statistics_tx *tx; | ||
637 | struct statistics_bt_activity *bt_activity; | ||
638 | |||
639 | len -= sizeof(struct iwl_cmd_header); /* skip header */ | ||
640 | |||
641 | IWL_DEBUG_RX(priv, "Statistics notification received (%d bytes).\n", | ||
642 | len); | ||
643 | |||
644 | if (len == sizeof(struct iwl_bt_notif_statistics)) { | ||
645 | struct iwl_bt_notif_statistics *stats; | ||
646 | stats = &pkt->u.stats_bt; | ||
647 | flag = &stats->flag; | ||
648 | common = &stats->general.common; | ||
649 | rx_non_phy = &stats->rx.general.common; | ||
650 | rx_ofdm = &stats->rx.ofdm; | ||
651 | rx_ofdm_ht = &stats->rx.ofdm_ht; | ||
652 | rx_cck = &stats->rx.cck; | ||
653 | tx = &stats->tx; | ||
654 | bt_activity = &stats->general.activity; | ||
651 | 655 | ||
652 | if (iwl_bt_statistics(priv)) { | 656 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
653 | IWL_DEBUG_RX(priv, | 657 | /* handle this exception directly */ |
654 | "Statistics notification received (%d vs %d).\n", | 658 | priv->statistics.num_bt_kills = stats->rx.general.num_bt_kills; |
655 | (int)sizeof(struct iwl_bt_notif_statistics), | 659 | le32_add_cpu(&priv->statistics.accum_num_bt_kills, |
656 | le32_to_cpu(pkt->len_n_flags) & | 660 | le32_to_cpu(stats->rx.general.num_bt_kills)); |
657 | FH_RSCSR_FRAME_SIZE_MSK); | 661 | #endif |
658 | 662 | } else if (len == sizeof(struct iwl_notif_statistics)) { | |
659 | change = ((priv->_agn.statistics_bt.general.common.temperature != | 663 | struct iwl_notif_statistics *stats; |
660 | pkt->u.stats_bt.general.common.temperature) || | 664 | stats = &pkt->u.stats; |
661 | ((priv->_agn.statistics_bt.flag & | 665 | flag = &stats->flag; |
662 | STATISTICS_REPLY_FLG_HT40_MODE_MSK) != | 666 | common = &stats->general.common; |
663 | (pkt->u.stats_bt.flag & | 667 | rx_non_phy = &stats->rx.general; |
664 | STATISTICS_REPLY_FLG_HT40_MODE_MSK))); | 668 | rx_ofdm = &stats->rx.ofdm; |
665 | 669 | rx_ofdm_ht = &stats->rx.ofdm_ht; | |
666 | iwl_accumulative_statistics(priv, (__le32 *)&pkt->u.stats_bt); | 670 | rx_cck = &stats->rx.cck; |
671 | tx = &stats->tx; | ||
672 | bt_activity = NULL; | ||
667 | } else { | 673 | } else { |
668 | IWL_DEBUG_RX(priv, | 674 | WARN_ONCE(1, "len %d doesn't match BT (%zu) or normal (%zu)\n", |
669 | "Statistics notification received (%d vs %d).\n", | 675 | len, sizeof(struct iwl_bt_notif_statistics), |
670 | (int)sizeof(struct iwl_notif_statistics), | 676 | sizeof(struct iwl_notif_statistics)); |
671 | le32_to_cpu(pkt->len_n_flags) & | 677 | return; |
672 | FH_RSCSR_FRAME_SIZE_MSK); | ||
673 | |||
674 | change = ((priv->_agn.statistics.general.common.temperature != | ||
675 | pkt->u.stats.general.common.temperature) || | ||
676 | ((priv->_agn.statistics.flag & | ||
677 | STATISTICS_REPLY_FLG_HT40_MODE_MSK) != | ||
678 | (pkt->u.stats.flag & | ||
679 | STATISTICS_REPLY_FLG_HT40_MODE_MSK))); | ||
680 | |||
681 | iwl_accumulative_statistics(priv, (__le32 *)&pkt->u.stats); | ||
682 | } | 678 | } |
683 | 679 | ||
684 | iwl_recover_from_statistics(priv, pkt); | 680 | change = common->temperature != priv->statistics.common.temperature || |
681 | (*flag & STATISTICS_REPLY_FLG_HT40_MODE_MSK) != | ||
682 | (priv->statistics.flag & STATISTICS_REPLY_FLG_HT40_MODE_MSK); | ||
683 | |||
684 | iwl_accumulative_statistics(priv, common, rx_non_phy, rx_ofdm, | ||
685 | rx_ofdm_ht, rx_cck, tx, bt_activity); | ||
686 | |||
687 | iwl_recover_from_statistics(priv, rx_ofdm, rx_ofdm_ht, tx, stamp); | ||
688 | |||
689 | priv->statistics.flag = *flag; | ||
690 | memcpy(&priv->statistics.common, common, sizeof(*common)); | ||
691 | memcpy(&priv->statistics.rx_non_phy, rx_non_phy, sizeof(*rx_non_phy)); | ||
692 | memcpy(&priv->statistics.rx_ofdm, rx_ofdm, sizeof(*rx_ofdm)); | ||
693 | memcpy(&priv->statistics.rx_ofdm_ht, rx_ofdm_ht, sizeof(*rx_ofdm_ht)); | ||
694 | memcpy(&priv->statistics.rx_cck, rx_cck, sizeof(*rx_cck)); | ||
695 | memcpy(&priv->statistics.tx, tx, sizeof(*tx)); | ||
696 | #ifdef CONFIG_IWLWIFI_DEBUGFS | ||
697 | if (bt_activity) | ||
698 | memcpy(&priv->statistics.bt_activity, bt_activity, | ||
699 | sizeof(*bt_activity)); | ||
700 | #endif | ||
701 | |||
702 | priv->rx_statistics_jiffies = stamp; | ||
685 | 703 | ||
686 | set_bit(STATUS_STATISTICS, &priv->status); | 704 | set_bit(STATUS_STATISTICS, &priv->status); |
687 | 705 | ||
@@ -708,18 +726,12 @@ static void iwl_rx_reply_statistics(struct iwl_priv *priv, | |||
708 | 726 | ||
709 | if (le32_to_cpu(pkt->u.stats.flag) & UCODE_STATISTICS_CLEAR_MSK) { | 727 | if (le32_to_cpu(pkt->u.stats.flag) & UCODE_STATISTICS_CLEAR_MSK) { |
710 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 728 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
711 | memset(&priv->_agn.accum_statistics, 0, | 729 | memset(&priv->accum_stats, 0, |
712 | sizeof(struct iwl_notif_statistics)); | 730 | sizeof(priv->accum_stats)); |
713 | memset(&priv->_agn.delta_statistics, 0, | 731 | memset(&priv->delta_stats, 0, |
714 | sizeof(struct iwl_notif_statistics)); | 732 | sizeof(priv->delta_stats)); |
715 | memset(&priv->_agn.max_delta, 0, | 733 | memset(&priv->max_delta_stats, 0, |
716 | sizeof(struct iwl_notif_statistics)); | 734 | sizeof(priv->max_delta_stats)); |
717 | memset(&priv->_agn.accum_statistics_bt, 0, | ||
718 | sizeof(struct iwl_bt_notif_statistics)); | ||
719 | memset(&priv->_agn.delta_statistics_bt, 0, | ||
720 | sizeof(struct iwl_bt_notif_statistics)); | ||
721 | memset(&priv->_agn.max_delta_bt, 0, | ||
722 | sizeof(struct iwl_bt_notif_statistics)); | ||
723 | #endif | 735 | #endif |
724 | IWL_DEBUG_RX(priv, "Statistics have been cleared\n"); | 736 | IWL_DEBUG_RX(priv, "Statistics have been cleared\n"); |
725 | } | 737 | } |
@@ -873,6 +885,7 @@ static void iwl_pass_packet_to_mac80211(struct iwl_priv *priv, | |||
873 | { | 885 | { |
874 | struct sk_buff *skb; | 886 | struct sk_buff *skb; |
875 | __le16 fc = hdr->frame_control; | 887 | __le16 fc = hdr->frame_control; |
888 | struct iwl_rxon_context *ctx; | ||
876 | 889 | ||
877 | /* We only process data packets if the interface is open */ | 890 | /* We only process data packets if the interface is open */ |
878 | if (unlikely(!priv->is_open)) { | 891 | if (unlikely(!priv->is_open)) { |
@@ -895,6 +908,26 @@ static void iwl_pass_packet_to_mac80211(struct iwl_priv *priv, | |||
895 | skb_add_rx_frag(skb, 0, rxb->page, (void *)hdr - rxb_addr(rxb), len); | 908 | skb_add_rx_frag(skb, 0, rxb->page, (void *)hdr - rxb_addr(rxb), len); |
896 | 909 | ||
897 | iwl_update_stats(priv, false, fc, len); | 910 | iwl_update_stats(priv, false, fc, len); |
911 | |||
912 | /* | ||
913 | * Wake any queues that were stopped due to a passive channel tx | ||
914 | * failure. This can happen because the regulatory enforcement in | ||
915 | * the device waits for a beacon before allowing transmission, | ||
916 | * sometimes even after already having transmitted frames for the | ||
917 | * association because the new RXON may reset the information. | ||
918 | */ | ||
919 | if (unlikely(ieee80211_is_beacon(fc))) { | ||
920 | for_each_context(priv, ctx) { | ||
921 | if (!ctx->last_tx_rejected) | ||
922 | continue; | ||
923 | if (compare_ether_addr(hdr->addr3, | ||
924 | ctx->active.bssid_addr)) | ||
925 | continue; | ||
926 | ctx->last_tx_rejected = false; | ||
927 | iwl_wake_any_queue(priv, ctx); | ||
928 | } | ||
929 | } | ||
930 | |||
898 | memcpy(IEEE80211_SKB_RXCB(skb), stats, sizeof(*stats)); | 931 | memcpy(IEEE80211_SKB_RXCB(skb), stats, sizeof(*stats)); |
899 | 932 | ||
900 | ieee80211_rx(priv->hw, skb); | 933 | ieee80211_rx(priv->hw, skb); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index c21515640077..3c8cebde16cc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -494,7 +494,8 @@ int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id, | |||
494 | 494 | ||
495 | priv->num_stations--; | 495 | priv->num_stations--; |
496 | 496 | ||
497 | BUG_ON(priv->num_stations < 0); | 497 | if (WARN_ON(priv->num_stations < 0)) |
498 | priv->num_stations = 0; | ||
498 | 499 | ||
499 | spin_unlock_irqrestore(&priv->sta_lock, flags); | 500 | spin_unlock_irqrestore(&priv->sta_lock, flags); |
500 | 501 | ||
@@ -679,7 +680,8 @@ void iwl_dealloc_bcast_stations(struct iwl_priv *priv) | |||
679 | 680 | ||
680 | priv->stations[i].used &= ~IWL_STA_UCODE_ACTIVE; | 681 | priv->stations[i].used &= ~IWL_STA_UCODE_ACTIVE; |
681 | priv->num_stations--; | 682 | priv->num_stations--; |
682 | BUG_ON(priv->num_stations < 0); | 683 | if (WARN_ON(priv->num_stations < 0)) |
684 | priv->num_stations = 0; | ||
683 | kfree(priv->stations[i].lq); | 685 | kfree(priv->stations[i].lq); |
684 | priv->stations[i].lq = NULL; | 686 | priv->stations[i].lq = NULL; |
685 | } | 687 | } |
@@ -775,7 +777,8 @@ int iwl_send_lq_cmd(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | |||
775 | spin_unlock_irqrestore(&priv->sta_lock, flags_spin); | 777 | spin_unlock_irqrestore(&priv->sta_lock, flags_spin); |
776 | 778 | ||
777 | iwl_dump_lq_cmd(priv, lq); | 779 | iwl_dump_lq_cmd(priv, lq); |
778 | BUG_ON(init && (cmd.flags & CMD_ASYNC)); | 780 | if (WARN_ON(init && (cmd.flags & CMD_ASYNC))) |
781 | return -EINVAL; | ||
779 | 782 | ||
780 | if (is_lq_table_valid(priv, ctx, lq)) | 783 | if (is_lq_table_valid(priv, ctx, lq)) |
781 | ret = iwl_send_cmd(priv, &cmd); | 784 | ret = iwl_send_cmd(priv, &cmd); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 565980fbb591..80c3565a66ae 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -232,7 +232,6 @@ void iwl_cmd_queue_free(struct iwl_priv *priv) | |||
232 | * reclaiming packets (on 'tx done IRQ), if free space become > high mark, | 232 | * reclaiming packets (on 'tx done IRQ), if free space become > high mark, |
233 | * Tx queue resumed. | 233 | * Tx queue resumed. |
234 | * | 234 | * |
235 | * See more detailed info in iwl-4965-hw.h. | ||
236 | ***************************************************/ | 235 | ***************************************************/ |
237 | 236 | ||
238 | int iwl_queue_space(const struct iwl_queue *q) | 237 | int iwl_queue_space(const struct iwl_queue *q) |
@@ -264,11 +263,13 @@ static int iwl_queue_init(struct iwl_priv *priv, struct iwl_queue *q, | |||
264 | 263 | ||
265 | /* count must be power-of-two size, otherwise iwl_queue_inc_wrap | 264 | /* count must be power-of-two size, otherwise iwl_queue_inc_wrap |
266 | * and iwl_queue_dec_wrap are broken. */ | 265 | * and iwl_queue_dec_wrap are broken. */ |
267 | BUG_ON(!is_power_of_2(count)); | 266 | if (WARN_ON(!is_power_of_2(count))) |
267 | return -EINVAL; | ||
268 | 268 | ||
269 | /* slots_num must be power-of-two size, otherwise | 269 | /* slots_num must be power-of-two size, otherwise |
270 | * get_cmd_index is broken. */ | 270 | * get_cmd_index is broken. */ |
271 | BUG_ON(!is_power_of_2(slots_num)); | 271 | if (WARN_ON(!is_power_of_2(slots_num))) |
272 | return -EINVAL; | ||
272 | 273 | ||
273 | q->low_mark = q->n_window / 4; | 274 | q->low_mark = q->n_window / 4; |
274 | if (q->low_mark < 4) | 275 | if (q->low_mark < 4) |
@@ -385,7 +386,9 @@ int iwl_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq, | |||
385 | BUILD_BUG_ON(TFD_QUEUE_SIZE_MAX & (TFD_QUEUE_SIZE_MAX - 1)); | 386 | BUILD_BUG_ON(TFD_QUEUE_SIZE_MAX & (TFD_QUEUE_SIZE_MAX - 1)); |
386 | 387 | ||
387 | /* Initialize queue's high/low-water marks, and head/tail indexes */ | 388 | /* Initialize queue's high/low-water marks, and head/tail indexes */ |
388 | iwl_queue_init(priv, &txq->q, TFD_QUEUE_SIZE_MAX, slots_num, txq_id); | 389 | ret = iwl_queue_init(priv, &txq->q, TFD_QUEUE_SIZE_MAX, slots_num, txq_id); |
390 | if (ret) | ||
391 | return ret; | ||
389 | 392 | ||
390 | /* Tell device where to find queue */ | 393 | /* Tell device where to find queue */ |
391 | priv->cfg->ops->lib->txq_init(priv, txq); | 394 | priv->cfg->ops->lib->txq_init(priv, txq); |
@@ -447,14 +450,19 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) | |||
447 | cmd->len = priv->cfg->ops->utils->get_hcmd_size(cmd->id, cmd->len); | 450 | cmd->len = priv->cfg->ops->utils->get_hcmd_size(cmd->id, cmd->len); |
448 | fix_size = (u16)(cmd->len + sizeof(out_cmd->hdr)); | 451 | fix_size = (u16)(cmd->len + sizeof(out_cmd->hdr)); |
449 | 452 | ||
450 | /* If any of the command structures end up being larger than | 453 | /* |
454 | * If any of the command structures end up being larger than | ||
451 | * the TFD_MAX_PAYLOAD_SIZE, and it sent as a 'small' command then | 455 | * the TFD_MAX_PAYLOAD_SIZE, and it sent as a 'small' command then |
452 | * we will need to increase the size of the TFD entries | 456 | * we will need to increase the size of the TFD entries |
453 | * Also, check to see if command buffer should not exceed the size | 457 | * Also, check to see if command buffer should not exceed the size |
454 | * of device_cmd and max_cmd_size. */ | 458 | * of device_cmd and max_cmd_size. |
455 | BUG_ON((fix_size > TFD_MAX_PAYLOAD_SIZE) && | 459 | */ |
456 | !(cmd->flags & CMD_SIZE_HUGE)); | 460 | if (WARN_ON((fix_size > TFD_MAX_PAYLOAD_SIZE) && |
457 | BUG_ON(fix_size > IWL_MAX_CMD_SIZE); | 461 | !(cmd->flags & CMD_SIZE_HUGE))) |
462 | return -EINVAL; | ||
463 | |||
464 | if (WARN_ON(fix_size > IWL_MAX_CMD_SIZE)) | ||
465 | return -EINVAL; | ||
458 | 466 | ||
459 | if (iwl_is_rfkill(priv) || iwl_is_ctkill(priv)) { | 467 | if (iwl_is_rfkill(priv) || iwl_is_ctkill(priv)) { |
460 | IWL_WARN(priv, "Not sending command - %s KILL\n", | 468 | IWL_WARN(priv, "Not sending command - %s KILL\n", |
@@ -462,16 +470,21 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) | |||
462 | return -EIO; | 470 | return -EIO; |
463 | } | 471 | } |
464 | 472 | ||
473 | /* | ||
474 | * As we only have a single huge buffer, check that the command | ||
475 | * is synchronous (otherwise buffers could end up being reused). | ||
476 | */ | ||
477 | |||
478 | if (WARN_ON((cmd->flags & CMD_ASYNC) && (cmd->flags & CMD_SIZE_HUGE))) | ||
479 | return -EINVAL; | ||
480 | |||
465 | spin_lock_irqsave(&priv->hcmd_lock, flags); | 481 | spin_lock_irqsave(&priv->hcmd_lock, flags); |
466 | 482 | ||
467 | if (iwl_queue_space(q) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) { | 483 | if (iwl_queue_space(q) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) { |
468 | spin_unlock_irqrestore(&priv->hcmd_lock, flags); | 484 | spin_unlock_irqrestore(&priv->hcmd_lock, flags); |
469 | 485 | ||
470 | IWL_ERR(priv, "No space in command queue\n"); | 486 | IWL_ERR(priv, "No space in command queue\n"); |
471 | if (priv->cfg->ops->lib->tt_ops.ct_kill_check) { | 487 | is_ct_kill = iwl_check_for_ct_kill(priv); |
472 | is_ct_kill = | ||
473 | priv->cfg->ops->lib->tt_ops.ct_kill_check(priv); | ||
474 | } | ||
475 | if (!is_ct_kill) { | 488 | if (!is_ct_kill) { |
476 | IWL_ERR(priv, "Restarting adapter due to queue full\n"); | 489 | IWL_ERR(priv, "Restarting adapter due to queue full\n"); |
477 | iwlagn_fw_error(priv, false); | 490 | iwlagn_fw_error(priv, false); |