diff options
author | John W. Linville <linville@tuxdriver.com> | 2010-04-12 15:20:53 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-04-12 15:20:53 -0400 |
commit | b1f90866fb3a329b1c4ebfff93ae9c110943e50a (patch) | |
tree | 9c765f6d21c8cad4906a2d1eb1b26f4f9842a3d6 /drivers/net | |
parent | 68dd5b7a45d1935fcd32b786e8d3d3f7bb4bbfe7 (diff) | |
parent | 470058e0ad82fcfaaffd57307d8bf8c094e8e9d7 (diff) |
Merge branch 'wireless-next-2.6' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-2.6
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-1000.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945-rs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-6000.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 32 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 39 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 59 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.h | 27 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-commands.h | 108 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 35 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-tx.c | 61 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 15 |
18 files changed, 274 insertions, 144 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c index b941b3e95697..9a0191a5ea35 100644 --- a/drivers/net/wireless/iwlwifi/iwl-1000.c +++ b/drivers/net/wireless/iwlwifi/iwl-1000.c | |||
@@ -253,6 +253,7 @@ struct iwl_cfg iwl1000_bgn_cfg = { | |||
253 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF, | 253 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF, |
254 | .chain_noise_scale = 1000, | 254 | .chain_noise_scale = 1000, |
255 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 255 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
256 | .max_event_log_size = 128, | ||
256 | }; | 257 | }; |
257 | 258 | ||
258 | struct iwl_cfg iwl1000_bg_cfg = { | 259 | struct iwl_cfg iwl1000_bg_cfg = { |
@@ -282,6 +283,7 @@ struct iwl_cfg iwl1000_bg_cfg = { | |||
282 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF, | 283 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF, |
283 | .chain_noise_scale = 1000, | 284 | .chain_noise_scale = 1000, |
284 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 285 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
286 | .max_event_log_size = 128, | ||
285 | }; | 287 | }; |
286 | 288 | ||
287 | MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX)); | 289 | MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c index 9e411dc0e5e1..80e9bbc7884a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c | |||
@@ -647,7 +647,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, | |||
647 | unsigned long flags; | 647 | unsigned long flags; |
648 | u16 rate_mask = sta ? sta->supp_rates[sband->band] : 0; | 648 | u16 rate_mask = sta ? sta->supp_rates[sband->band] : 0; |
649 | s8 max_rate_idx = -1; | 649 | s8 max_rate_idx = -1; |
650 | struct iwl_priv *priv = (struct iwl_priv *)priv_r; | 650 | struct iwl_priv *priv __maybe_unused = (struct iwl_priv *)priv_r; |
651 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 651 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
652 | 652 | ||
653 | IWL_DEBUG_RATE(priv, "enter\n"); | 653 | IWL_DEBUG_RATE(priv, "enter\n"); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index f88f75dfd96e..15de649888d8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -191,12 +191,12 @@ static int iwl3945_hwrate_to_plcp_idx(u8 plcp) | |||
191 | } | 191 | } |
192 | 192 | ||
193 | #ifdef CONFIG_IWLWIFI_DEBUG | 193 | #ifdef CONFIG_IWLWIFI_DEBUG |
194 | #define TX_STATUS_ENTRY(x) case TX_STATUS_FAIL_ ## x: return #x | 194 | #define TX_STATUS_ENTRY(x) case TX_3945_STATUS_FAIL_ ## x: return #x |
195 | 195 | ||
196 | static const char *iwl3945_get_tx_fail_reason(u32 status) | 196 | static const char *iwl3945_get_tx_fail_reason(u32 status) |
197 | { | 197 | { |
198 | switch (status & TX_STATUS_MSK) { | 198 | switch (status & TX_STATUS_MSK) { |
199 | case TX_STATUS_SUCCESS: | 199 | case TX_3945_STATUS_SUCCESS: |
200 | return "SUCCESS"; | 200 | return "SUCCESS"; |
201 | TX_STATUS_ENTRY(SHORT_LIMIT); | 201 | TX_STATUS_ENTRY(SHORT_LIMIT); |
202 | TX_STATUS_ENTRY(LONG_LIMIT); | 202 | TX_STATUS_ENTRY(LONG_LIMIT); |
@@ -597,8 +597,8 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv, | |||
597 | struct iwl3945_rx_frame_stats *rx_stats = IWL_RX_STATS(pkt); | 597 | struct iwl3945_rx_frame_stats *rx_stats = IWL_RX_STATS(pkt); |
598 | struct iwl3945_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt); | 598 | struct iwl3945_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt); |
599 | struct iwl3945_rx_frame_end *rx_end = IWL_RX_END(pkt); | 599 | struct iwl3945_rx_frame_end *rx_end = IWL_RX_END(pkt); |
600 | u16 rx_stats_sig_avg = le16_to_cpu(rx_stats->sig_avg); | 600 | u16 rx_stats_sig_avg __maybe_unused = le16_to_cpu(rx_stats->sig_avg); |
601 | u16 rx_stats_noise_diff = le16_to_cpu(rx_stats->noise_diff); | 601 | u16 rx_stats_noise_diff __maybe_unused = le16_to_cpu(rx_stats->noise_diff); |
602 | u8 network_packet; | 602 | u8 network_packet; |
603 | 603 | ||
604 | rx_status.flag = 0; | 604 | rx_status.flag = 0; |
@@ -2770,6 +2770,7 @@ static struct iwl_cfg iwl3945_bg_cfg = { | |||
2770 | .broken_powersave = true, | 2770 | .broken_powersave = true, |
2771 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 2771 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
2772 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 2772 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
2773 | .max_event_log_size = 512, | ||
2773 | }; | 2774 | }; |
2774 | 2775 | ||
2775 | static struct iwl_cfg iwl3945_abg_cfg = { | 2776 | static struct iwl_cfg iwl3945_abg_cfg = { |
@@ -2789,6 +2790,7 @@ static struct iwl_cfg iwl3945_abg_cfg = { | |||
2789 | .broken_powersave = true, | 2790 | .broken_powersave = true, |
2790 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 2791 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
2791 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 2792 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
2793 | .max_event_log_size = 512, | ||
2792 | }; | 2794 | }; |
2793 | 2795 | ||
2794 | DEFINE_PCI_DEVICE_TABLE(iwl3945_hw_card_ids) = { | 2796 | DEFINE_PCI_DEVICE_TABLE(iwl3945_hw_card_ids) = { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 8c889fdddf0e..2e3cda75f3ad 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -2054,8 +2054,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, | |||
2054 | if (qc && likely(sta_id != IWL_INVALID_STATION)) | 2054 | if (qc && likely(sta_id != IWL_INVALID_STATION)) |
2055 | iwlagn_txq_check_empty(priv, sta_id, tid, txq_id); | 2055 | iwlagn_txq_check_empty(priv, sta_id, tid, txq_id); |
2056 | 2056 | ||
2057 | if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK)) | 2057 | iwl_check_abort_status(priv, tx_resp->frame_count, status); |
2058 | IWL_ERR(priv, "TODO: Implement Tx ABORT REQUIRED!!!\n"); | ||
2059 | } | 2058 | } |
2060 | 2059 | ||
2061 | static int iwl4965_calc_rssi(struct iwl_priv *priv, | 2060 | static int iwl4965_calc_rssi(struct iwl_priv *priv, |
@@ -2255,6 +2254,7 @@ struct iwl_cfg iwl4965_agn_cfg = { | |||
2255 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 2254 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
2256 | .temperature_kelvin = true, | 2255 | .temperature_kelvin = true, |
2257 | .off_channel_workaround = true, | 2256 | .off_channel_workaround = true, |
2257 | .max_event_log_size = 512, | ||
2258 | }; | 2258 | }; |
2259 | 2259 | ||
2260 | /* Module firmware */ | 2260 | /* Module firmware */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index ecc302e4c205..e967cfcac224 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -423,6 +423,7 @@ struct iwl_cfg iwl5300_agn_cfg = { | |||
423 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 423 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
424 | .chain_noise_scale = 1000, | 424 | .chain_noise_scale = 1000, |
425 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 425 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
426 | .max_event_log_size = 512, | ||
426 | }; | 427 | }; |
427 | 428 | ||
428 | struct iwl_cfg iwl5100_bgn_cfg = { | 429 | struct iwl_cfg iwl5100_bgn_cfg = { |
@@ -450,6 +451,7 @@ struct iwl_cfg iwl5100_bgn_cfg = { | |||
450 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 451 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
451 | .chain_noise_scale = 1000, | 452 | .chain_noise_scale = 1000, |
452 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 453 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
454 | .max_event_log_size = 512, | ||
453 | }; | 455 | }; |
454 | 456 | ||
455 | struct iwl_cfg iwl5100_abg_cfg = { | 457 | struct iwl_cfg iwl5100_abg_cfg = { |
@@ -475,6 +477,7 @@ struct iwl_cfg iwl5100_abg_cfg = { | |||
475 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 477 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
476 | .chain_noise_scale = 1000, | 478 | .chain_noise_scale = 1000, |
477 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 479 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
480 | .max_event_log_size = 512, | ||
478 | }; | 481 | }; |
479 | 482 | ||
480 | struct iwl_cfg iwl5100_agn_cfg = { | 483 | struct iwl_cfg iwl5100_agn_cfg = { |
@@ -502,6 +505,7 @@ struct iwl_cfg iwl5100_agn_cfg = { | |||
502 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 505 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
503 | .chain_noise_scale = 1000, | 506 | .chain_noise_scale = 1000, |
504 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 507 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
508 | .max_event_log_size = 512, | ||
505 | }; | 509 | }; |
506 | 510 | ||
507 | struct iwl_cfg iwl5350_agn_cfg = { | 511 | struct iwl_cfg iwl5350_agn_cfg = { |
@@ -529,6 +533,7 @@ struct iwl_cfg iwl5350_agn_cfg = { | |||
529 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 533 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
530 | .chain_noise_scale = 1000, | 534 | .chain_noise_scale = 1000, |
531 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 535 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
536 | .max_event_log_size = 512, | ||
532 | }; | 537 | }; |
533 | 538 | ||
534 | struct iwl_cfg iwl5150_agn_cfg = { | 539 | struct iwl_cfg iwl5150_agn_cfg = { |
@@ -556,6 +561,7 @@ struct iwl_cfg iwl5150_agn_cfg = { | |||
556 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 561 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
557 | .chain_noise_scale = 1000, | 562 | .chain_noise_scale = 1000, |
558 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 563 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
564 | .max_event_log_size = 512, | ||
559 | }; | 565 | }; |
560 | 566 | ||
561 | struct iwl_cfg iwl5150_abg_cfg = { | 567 | struct iwl_cfg iwl5150_abg_cfg = { |
@@ -581,6 +587,7 @@ struct iwl_cfg iwl5150_abg_cfg = { | |||
581 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | 587 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
582 | .chain_noise_scale = 1000, | 588 | .chain_noise_scale = 1000, |
583 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 589 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
590 | .max_event_log_size = 512, | ||
584 | }; | 591 | }; |
585 | 592 | ||
586 | MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); | 593 | MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index 7473518e7e0a..dd03384432f4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -394,6 +394,7 @@ struct iwl_cfg iwl6000i_g2_2agn_cfg = { | |||
394 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 394 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
395 | .chain_noise_scale = 1000, | 395 | .chain_noise_scale = 1000, |
396 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 396 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
397 | .max_event_log_size = 1024, | ||
397 | }; | 398 | }; |
398 | 399 | ||
399 | struct iwl_cfg iwl6000i_2agn_cfg = { | 400 | struct iwl_cfg iwl6000i_2agn_cfg = { |
@@ -427,6 +428,7 @@ struct iwl_cfg iwl6000i_2agn_cfg = { | |||
427 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 428 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
428 | .chain_noise_scale = 1000, | 429 | .chain_noise_scale = 1000, |
429 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 430 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
431 | .max_event_log_size = 1024, | ||
430 | }; | 432 | }; |
431 | 433 | ||
432 | struct iwl_cfg iwl6000i_2abg_cfg = { | 434 | struct iwl_cfg iwl6000i_2abg_cfg = { |
@@ -459,6 +461,7 @@ struct iwl_cfg iwl6000i_2abg_cfg = { | |||
459 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 461 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
460 | .chain_noise_scale = 1000, | 462 | .chain_noise_scale = 1000, |
461 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 463 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
464 | .max_event_log_size = 1024, | ||
462 | }; | 465 | }; |
463 | 466 | ||
464 | struct iwl_cfg iwl6000i_2bg_cfg = { | 467 | struct iwl_cfg iwl6000i_2bg_cfg = { |
@@ -491,6 +494,7 @@ struct iwl_cfg iwl6000i_2bg_cfg = { | |||
491 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 494 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
492 | .chain_noise_scale = 1000, | 495 | .chain_noise_scale = 1000, |
493 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 496 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
497 | .max_event_log_size = 1024, | ||
494 | }; | 498 | }; |
495 | 499 | ||
496 | struct iwl_cfg iwl6050_2agn_cfg = { | 500 | struct iwl_cfg iwl6050_2agn_cfg = { |
@@ -524,6 +528,7 @@ struct iwl_cfg iwl6050_2agn_cfg = { | |||
524 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 528 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
525 | .chain_noise_scale = 1500, | 529 | .chain_noise_scale = 1500, |
526 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 530 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
531 | .max_event_log_size = 1024, | ||
527 | }; | 532 | }; |
528 | 533 | ||
529 | struct iwl_cfg iwl6050_2abg_cfg = { | 534 | struct iwl_cfg iwl6050_2abg_cfg = { |
@@ -556,6 +561,7 @@ struct iwl_cfg iwl6050_2abg_cfg = { | |||
556 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 561 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
557 | .chain_noise_scale = 1500, | 562 | .chain_noise_scale = 1500, |
558 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 563 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
564 | .max_event_log_size = 1024, | ||
559 | }; | 565 | }; |
560 | 566 | ||
561 | struct iwl_cfg iwl6000_3agn_cfg = { | 567 | struct iwl_cfg iwl6000_3agn_cfg = { |
@@ -589,6 +595,7 @@ struct iwl_cfg iwl6000_3agn_cfg = { | |||
589 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 595 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
590 | .chain_noise_scale = 1000, | 596 | .chain_noise_scale = 1000, |
591 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 597 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
598 | .max_event_log_size = 1024, | ||
592 | }; | 599 | }; |
593 | 600 | ||
594 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); | 601 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index 49e20f1acb7c..c465c8590833 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c | |||
@@ -161,6 +161,14 @@ static int iwlagn_tx_status_reply_tx(struct iwl_priv *priv, | |||
161 | return 0; | 161 | return 0; |
162 | } | 162 | } |
163 | 163 | ||
164 | void iwl_check_abort_status(struct iwl_priv *priv, | ||
165 | u8 frame_count, u32 status) | ||
166 | { | ||
167 | if (frame_count == 1 && status == TX_STATUS_FAIL_RFKILL_FLUSH) { | ||
168 | IWL_ERR(priv, "TODO: Implement Tx flush command!!!\n"); | ||
169 | } | ||
170 | } | ||
171 | |||
164 | static void iwlagn_rx_reply_tx(struct iwl_priv *priv, | 172 | static void iwlagn_rx_reply_tx(struct iwl_priv *priv, |
165 | struct iwl_rx_mem_buffer *rxb) | 173 | struct iwl_rx_mem_buffer *rxb) |
166 | { | 174 | { |
@@ -246,8 +254,7 @@ static void iwlagn_rx_reply_tx(struct iwl_priv *priv, | |||
246 | 254 | ||
247 | iwlagn_txq_check_empty(priv, sta_id, tid, txq_id); | 255 | iwlagn_txq_check_empty(priv, sta_id, tid, txq_id); |
248 | 256 | ||
249 | if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK)) | 257 | iwl_check_abort_status(priv, tx_resp->frame_count, status); |
250 | IWL_ERR(priv, "TODO: Implement Tx ABORT REQUIRED!!!\n"); | ||
251 | } | 258 | } |
252 | 259 | ||
253 | void iwlagn_rx_handler_setup(struct iwl_priv *priv) | 260 | void iwlagn_rx_handler_setup(struct iwl_priv *priv) |
@@ -505,10 +512,13 @@ int iwlagn_hw_nic_init(struct iwl_priv *priv) | |||
505 | 512 | ||
506 | spin_unlock_irqrestore(&priv->lock, flags); | 513 | spin_unlock_irqrestore(&priv->lock, flags); |
507 | 514 | ||
508 | /* Allocate and init all Tx and Command queues */ | 515 | /* Allocate or reset and init all Tx and Command queues */ |
509 | ret = iwlagn_txq_ctx_reset(priv); | 516 | if (!priv->txq) { |
510 | if (ret) | 517 | ret = iwlagn_txq_ctx_alloc(priv); |
511 | return ret; | 518 | if (ret) |
519 | return ret; | ||
520 | } else | ||
521 | iwlagn_txq_ctx_reset(priv); | ||
512 | 522 | ||
513 | set_bit(STATUS_INIT, &priv->status); | 523 | set_bit(STATUS_INIT, &priv->status); |
514 | 524 | ||
@@ -1001,11 +1011,11 @@ void iwlagn_rx_reply_rx(struct iwl_priv *priv, | |||
1001 | phy_res->cfg_phy_cnt + len); | 1011 | phy_res->cfg_phy_cnt + len); |
1002 | ampdu_status = le32_to_cpu(rx_pkt_status); | 1012 | ampdu_status = le32_to_cpu(rx_pkt_status); |
1003 | } else { | 1013 | } else { |
1004 | if (!priv->last_phy_res[0]) { | 1014 | if (!priv->_agn.last_phy_res_valid) { |
1005 | IWL_ERR(priv, "MPDU frame without cached PHY data\n"); | 1015 | IWL_ERR(priv, "MPDU frame without cached PHY data\n"); |
1006 | return; | 1016 | return; |
1007 | } | 1017 | } |
1008 | phy_res = (struct iwl_rx_phy_res *)&priv->last_phy_res[1]; | 1018 | phy_res = &priv->_agn.last_phy_res; |
1009 | amsdu = (struct iwl4965_rx_mpdu_res_start *)pkt->u.raw; | 1019 | amsdu = (struct iwl4965_rx_mpdu_res_start *)pkt->u.raw; |
1010 | header = (struct ieee80211_hdr *)(pkt->u.raw + sizeof(*amsdu)); | 1020 | header = (struct ieee80211_hdr *)(pkt->u.raw + sizeof(*amsdu)); |
1011 | len = le16_to_cpu(amsdu->byte_count); | 1021 | len = le16_to_cpu(amsdu->byte_count); |
@@ -1094,10 +1104,10 @@ void iwlagn_rx_reply_rx(struct iwl_priv *priv, | |||
1094 | /* Cache phy data (Rx signal strength, etc) for HT frame (REPLY_RX_PHY_CMD). | 1104 | /* Cache phy data (Rx signal strength, etc) for HT frame (REPLY_RX_PHY_CMD). |
1095 | * This will be used later in iwl_rx_reply_rx() for REPLY_RX_MPDU_CMD. */ | 1105 | * This will be used later in iwl_rx_reply_rx() for REPLY_RX_MPDU_CMD. */ |
1096 | void iwlagn_rx_reply_rx_phy(struct iwl_priv *priv, | 1106 | void iwlagn_rx_reply_rx_phy(struct iwl_priv *priv, |
1097 | struct iwl_rx_mem_buffer *rxb) | 1107 | struct iwl_rx_mem_buffer *rxb) |
1098 | { | 1108 | { |
1099 | struct iwl_rx_packet *pkt = rxb_addr(rxb); | 1109 | struct iwl_rx_packet *pkt = rxb_addr(rxb); |
1100 | priv->last_phy_res[0] = 1; | 1110 | priv->_agn.last_phy_res_valid = true; |
1101 | memcpy(&priv->last_phy_res[1], &(pkt->u.raw[0]), | 1111 | memcpy(&priv->_agn.last_phy_res, pkt->u.raw, |
1102 | sizeof(struct iwl_rx_phy_res)); | 1112 | sizeof(struct iwl_rx_phy_res)); |
1103 | } | 1113 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index 0c3c76803c5e..3c1cd417bbc5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -2409,7 +2409,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, void *priv_sta, | |||
2409 | 2409 | ||
2410 | struct sk_buff *skb = txrc->skb; | 2410 | struct sk_buff *skb = txrc->skb; |
2411 | struct ieee80211_supported_band *sband = txrc->sband; | 2411 | struct ieee80211_supported_band *sband = txrc->sband; |
2412 | struct iwl_priv *priv = (struct iwl_priv *)priv_r; | 2412 | struct iwl_priv *priv __maybe_unused = (struct iwl_priv *)priv_r; |
2413 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 2413 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
2414 | struct iwl_lq_sta *lq_sta = priv_sta; | 2414 | struct iwl_lq_sta *lq_sta = priv_sta; |
2415 | int rate_idx; | 2415 | int rate_idx; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c index a76e14351b5a..3077eac58880 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c | |||
@@ -809,8 +809,7 @@ void iwlagn_hw_txq_ctx_free(struct iwl_priv *priv) | |||
809 | 809 | ||
810 | /* Tx queues */ | 810 | /* Tx queues */ |
811 | if (priv->txq) { | 811 | if (priv->txq) { |
812 | for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; | 812 | for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++) |
813 | txq_id++) | ||
814 | if (txq_id == IWL_CMD_QUEUE_NUM) | 813 | if (txq_id == IWL_CMD_QUEUE_NUM) |
815 | iwl_cmd_queue_free(priv); | 814 | iwl_cmd_queue_free(priv); |
816 | else | 815 | else |
@@ -825,15 +824,15 @@ void iwlagn_hw_txq_ctx_free(struct iwl_priv *priv) | |||
825 | } | 824 | } |
826 | 825 | ||
827 | /** | 826 | /** |
828 | * iwlagn_txq_ctx_reset - Reset TX queue context | 827 | * iwlagn_txq_ctx_alloc - allocate TX queue context |
829 | * Destroys all DMA structures and initialize them again | 828 | * Allocate all Tx DMA structures and initialize them |
830 | * | 829 | * |
831 | * @param priv | 830 | * @param priv |
832 | * @return error code | 831 | * @return error code |
833 | */ | 832 | */ |
834 | int iwlagn_txq_ctx_reset(struct iwl_priv *priv) | 833 | int iwlagn_txq_ctx_alloc(struct iwl_priv *priv) |
835 | { | 834 | { |
836 | int ret = 0; | 835 | int ret; |
837 | int txq_id, slots_num; | 836 | int txq_id, slots_num; |
838 | unsigned long flags; | 837 | unsigned long flags; |
839 | 838 | ||
@@ -891,8 +890,31 @@ int iwlagn_txq_ctx_reset(struct iwl_priv *priv) | |||
891 | return ret; | 890 | return ret; |
892 | } | 891 | } |
893 | 892 | ||
893 | void iwlagn_txq_ctx_reset(struct iwl_priv *priv) | ||
894 | { | ||
895 | int txq_id, slots_num; | ||
896 | unsigned long flags; | ||
897 | |||
898 | spin_lock_irqsave(&priv->lock, flags); | ||
899 | |||
900 | /* Turn off all Tx DMA fifos */ | ||
901 | priv->cfg->ops->lib->txq_set_sched(priv, 0); | ||
902 | |||
903 | /* Tell NIC where to find the "keep warm" buffer */ | ||
904 | iwl_write_direct32(priv, FH_KW_MEM_ADDR_REG, priv->kw.dma >> 4); | ||
905 | |||
906 | spin_unlock_irqrestore(&priv->lock, flags); | ||
907 | |||
908 | /* Alloc and init all Tx queues, including the command queue (#4) */ | ||
909 | for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++) { | ||
910 | slots_num = txq_id == IWL_CMD_QUEUE_NUM ? | ||
911 | TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS; | ||
912 | iwl_tx_queue_reset(priv, &priv->txq[txq_id], slots_num, txq_id); | ||
913 | } | ||
914 | } | ||
915 | |||
894 | /** | 916 | /** |
895 | * iwlagn_txq_ctx_stop - Stop all Tx DMA channels, free Tx queue memory | 917 | * iwlagn_txq_ctx_stop - Stop all Tx DMA channels |
896 | */ | 918 | */ |
897 | void iwlagn_txq_ctx_stop(struct iwl_priv *priv) | 919 | void iwlagn_txq_ctx_stop(struct iwl_priv *priv) |
898 | { | 920 | { |
@@ -912,9 +934,6 @@ void iwlagn_txq_ctx_stop(struct iwl_priv *priv) | |||
912 | 1000); | 934 | 1000); |
913 | } | 935 | } |
914 | spin_unlock_irqrestore(&priv->lock, flags); | 936 | spin_unlock_irqrestore(&priv->lock, flags); |
915 | |||
916 | /* Deallocate memory for all Tx queues */ | ||
917 | iwlagn_hw_txq_ctx_free(priv); | ||
918 | } | 937 | } |
919 | 938 | ||
920 | /* | 939 | /* |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 4f0cb803f732..8a002c6f3a61 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -158,6 +158,11 @@ int iwl_commit_rxon(struct iwl_priv *priv) | |||
158 | } | 158 | } |
159 | iwl_clear_ucode_stations(priv, false); | 159 | iwl_clear_ucode_stations(priv, false); |
160 | iwl_restore_stations(priv); | 160 | iwl_restore_stations(priv); |
161 | ret = iwl_restore_default_wep_keys(priv); | ||
162 | if (ret) { | ||
163 | IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret); | ||
164 | return ret; | ||
165 | } | ||
161 | } | 166 | } |
162 | 167 | ||
163 | IWL_DEBUG_INFO(priv, "Sending RXON\n" | 168 | IWL_DEBUG_INFO(priv, "Sending RXON\n" |
@@ -185,6 +190,11 @@ int iwl_commit_rxon(struct iwl_priv *priv) | |||
185 | memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon)); | 190 | memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon)); |
186 | iwl_clear_ucode_stations(priv, false); | 191 | iwl_clear_ucode_stations(priv, false); |
187 | iwl_restore_stations(priv); | 192 | iwl_restore_stations(priv); |
193 | ret = iwl_restore_default_wep_keys(priv); | ||
194 | if (ret) { | ||
195 | IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret); | ||
196 | return ret; | ||
197 | } | ||
188 | } | 198 | } |
189 | 199 | ||
190 | priv->start_calib = 0; | 200 | priv->start_calib = 0; |
@@ -1833,6 +1843,7 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv) | |||
1833 | u32 data2, line; | 1843 | u32 data2, line; |
1834 | u32 desc, time, count, base, data1; | 1844 | u32 desc, time, count, base, data1; |
1835 | u32 blink1, blink2, ilink1, ilink2; | 1845 | u32 blink1, blink2, ilink1, ilink2; |
1846 | u32 pc, hcmd; | ||
1836 | 1847 | ||
1837 | if (priv->ucode_type == UCODE_INIT) | 1848 | if (priv->ucode_type == UCODE_INIT) |
1838 | base = le32_to_cpu(priv->card_alive_init.error_event_table_ptr); | 1849 | base = le32_to_cpu(priv->card_alive_init.error_event_table_ptr); |
@@ -1855,6 +1866,7 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv) | |||
1855 | } | 1866 | } |
1856 | 1867 | ||
1857 | desc = iwl_read_targ_mem(priv, base + 1 * sizeof(u32)); | 1868 | desc = iwl_read_targ_mem(priv, base + 1 * sizeof(u32)); |
1869 | pc = iwl_read_targ_mem(priv, base + 2 * sizeof(u32)); | ||
1858 | blink1 = iwl_read_targ_mem(priv, base + 3 * sizeof(u32)); | 1870 | blink1 = iwl_read_targ_mem(priv, base + 3 * sizeof(u32)); |
1859 | blink2 = iwl_read_targ_mem(priv, base + 4 * sizeof(u32)); | 1871 | blink2 = iwl_read_targ_mem(priv, base + 4 * sizeof(u32)); |
1860 | ilink1 = iwl_read_targ_mem(priv, base + 5 * sizeof(u32)); | 1872 | ilink1 = iwl_read_targ_mem(priv, base + 5 * sizeof(u32)); |
@@ -1863,6 +1875,7 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv) | |||
1863 | data2 = iwl_read_targ_mem(priv, base + 8 * sizeof(u32)); | 1875 | data2 = iwl_read_targ_mem(priv, base + 8 * sizeof(u32)); |
1864 | line = iwl_read_targ_mem(priv, base + 9 * sizeof(u32)); | 1876 | line = iwl_read_targ_mem(priv, base + 9 * sizeof(u32)); |
1865 | time = iwl_read_targ_mem(priv, base + 11 * sizeof(u32)); | 1877 | time = iwl_read_targ_mem(priv, base + 11 * sizeof(u32)); |
1878 | hcmd = iwl_read_targ_mem(priv, base + 22 * sizeof(u32)); | ||
1866 | 1879 | ||
1867 | trace_iwlwifi_dev_ucode_error(priv, desc, time, data1, data2, line, | 1880 | trace_iwlwifi_dev_ucode_error(priv, desc, time, data1, data2, line, |
1868 | blink1, blink2, ilink1, ilink2); | 1881 | blink1, blink2, ilink1, ilink2); |
@@ -1871,10 +1884,9 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv) | |||
1871 | "data1 data2 line\n"); | 1884 | "data1 data2 line\n"); |
1872 | IWL_ERR(priv, "%-28s (#%02d) %010u 0x%08X 0x%08X %u\n", | 1885 | IWL_ERR(priv, "%-28s (#%02d) %010u 0x%08X 0x%08X %u\n", |
1873 | desc_lookup(desc), desc, time, data1, data2, line); | 1886 | desc_lookup(desc), desc, time, data1, data2, line); |
1874 | IWL_ERR(priv, "blink1 blink2 ilink1 ilink2\n"); | 1887 | IWL_ERR(priv, "pc blink1 blink2 ilink1 ilink2 hcmd\n"); |
1875 | IWL_ERR(priv, "0x%05X 0x%05X 0x%05X 0x%05X\n", blink1, blink2, | 1888 | IWL_ERR(priv, "0x%05X 0x%05X 0x%05X 0x%05X 0x%05X 0x%05X\n", |
1876 | ilink1, ilink2); | 1889 | pc, blink1, blink2, ilink1, ilink2, hcmd); |
1877 | |||
1878 | } | 1890 | } |
1879 | 1891 | ||
1880 | #define EVENT_START_OFFSET (4 * sizeof(u32)) | 1892 | #define EVENT_START_OFFSET (4 * sizeof(u32)) |
@@ -1990,9 +2002,6 @@ static int iwl_print_last_event_logs(struct iwl_priv *priv, u32 capacity, | |||
1990 | return pos; | 2002 | return pos; |
1991 | } | 2003 | } |
1992 | 2004 | ||
1993 | /* For sanity check only. Actual size is determined by uCode, typ. 512 */ | ||
1994 | #define MAX_EVENT_LOG_SIZE (512) | ||
1995 | |||
1996 | #define DEFAULT_DUMP_EVENT_LOG_ENTRIES (20) | 2005 | #define DEFAULT_DUMP_EVENT_LOG_ENTRIES (20) |
1997 | 2006 | ||
1998 | int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log, | 2007 | int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log, |
@@ -2025,16 +2034,16 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log, | |||
2025 | num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32))); | 2034 | num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32))); |
2026 | next_entry = iwl_read_targ_mem(priv, base + (3 * sizeof(u32))); | 2035 | next_entry = iwl_read_targ_mem(priv, base + (3 * sizeof(u32))); |
2027 | 2036 | ||
2028 | if (capacity > MAX_EVENT_LOG_SIZE) { | 2037 | if (capacity > priv->cfg->max_event_log_size) { |
2029 | IWL_ERR(priv, "Log capacity %d is bogus, limit to %d entries\n", | 2038 | IWL_ERR(priv, "Log capacity %d is bogus, limit to %d entries\n", |
2030 | capacity, MAX_EVENT_LOG_SIZE); | 2039 | capacity, priv->cfg->max_event_log_size); |
2031 | capacity = MAX_EVENT_LOG_SIZE; | 2040 | capacity = priv->cfg->max_event_log_size; |
2032 | } | 2041 | } |
2033 | 2042 | ||
2034 | if (next_entry > MAX_EVENT_LOG_SIZE) { | 2043 | if (next_entry > priv->cfg->max_event_log_size) { |
2035 | IWL_ERR(priv, "Log write index %d is bogus, limit to %d\n", | 2044 | IWL_ERR(priv, "Log write index %d is bogus, limit to %d\n", |
2036 | next_entry, MAX_EVENT_LOG_SIZE); | 2045 | next_entry, priv->cfg->max_event_log_size); |
2037 | next_entry = MAX_EVENT_LOG_SIZE; | 2046 | next_entry = priv->cfg->max_event_log_size; |
2038 | } | 2047 | } |
2039 | 2048 | ||
2040 | size = num_wraps ? capacity : next_entry; | 2049 | size = num_wraps ? capacity : next_entry; |
@@ -2894,12 +2903,13 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
2894 | mutex_lock(&priv->mutex); | 2903 | mutex_lock(&priv->mutex); |
2895 | iwl_scan_cancel_timeout(priv, 100); | 2904 | iwl_scan_cancel_timeout(priv, 100); |
2896 | 2905 | ||
2897 | /* If we are getting WEP group key and we didn't receive any key mapping | 2906 | /* |
2907 | * If we are getting WEP group key and we didn't receive any key mapping | ||
2898 | * so far, we are in legacy wep mode (group key only), otherwise we are | 2908 | * so far, we are in legacy wep mode (group key only), otherwise we are |
2899 | * in 1X mode. | 2909 | * in 1X mode. |
2900 | * In legacy wep mode, we use another host command to the uCode */ | 2910 | * In legacy wep mode, we use another host command to the uCode. |
2901 | if (key->alg == ALG_WEP && sta_id == priv->hw_params.bcast_sta_id && | 2911 | */ |
2902 | priv->iw_mode != NL80211_IFTYPE_AP) { | 2912 | if (key->alg == ALG_WEP && !sta && vif->type != NL80211_IFTYPE_AP) { |
2903 | if (cmd == SET_KEY) | 2913 | if (cmd == SET_KEY) |
2904 | is_default_wep_key = !priv->key_mapping_key; | 2914 | is_default_wep_key = !priv->key_mapping_key; |
2905 | else | 2915 | else |
@@ -3033,19 +3043,6 @@ static void iwl_mac_sta_notify(struct ieee80211_hw *hw, | |||
3033 | } | 3043 | } |
3034 | } | 3044 | } |
3035 | 3045 | ||
3036 | /** | ||
3037 | * iwl_restore_wepkeys - Restore WEP keys to device | ||
3038 | */ | ||
3039 | static void iwl_restore_wepkeys(struct iwl_priv *priv) | ||
3040 | { | ||
3041 | mutex_lock(&priv->mutex); | ||
3042 | if (priv->iw_mode == NL80211_IFTYPE_STATION && | ||
3043 | priv->default_wep_key && | ||
3044 | iwl_send_static_wepkey_cmd(priv, 0)) | ||
3045 | IWL_ERR(priv, "Could not send WEP static key\n"); | ||
3046 | mutex_unlock(&priv->mutex); | ||
3047 | } | ||
3048 | |||
3049 | static int iwlagn_mac_sta_add(struct ieee80211_hw *hw, | 3046 | static int iwlagn_mac_sta_add(struct ieee80211_hw *hw, |
3050 | struct ieee80211_vif *vif, | 3047 | struct ieee80211_vif *vif, |
3051 | struct ieee80211_sta *sta) | 3048 | struct ieee80211_sta *sta) |
@@ -3072,8 +3069,6 @@ static int iwlagn_mac_sta_add(struct ieee80211_hw *hw, | |||
3072 | return ret; | 3069 | return ret; |
3073 | } | 3070 | } |
3074 | 3071 | ||
3075 | iwl_restore_wepkeys(priv); | ||
3076 | |||
3077 | /* Initialize rate scaling */ | 3072 | /* Initialize rate scaling */ |
3078 | IWL_DEBUG_INFO(priv, "Initializing rate scaling for station %pM\n", | 3073 | IWL_DEBUG_INFO(priv, "Initializing rate scaling for station %pM\n", |
3079 | sta->addr); | 3074 | sta->addr); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h index 5ad14055eda3..5d3142287e14 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h | |||
@@ -105,6 +105,8 @@ void iwlagn_init_alive_start(struct iwl_priv *priv); | |||
105 | int iwlagn_alive_notify(struct iwl_priv *priv); | 105 | int iwlagn_alive_notify(struct iwl_priv *priv); |
106 | 106 | ||
107 | /* lib */ | 107 | /* lib */ |
108 | void iwl_check_abort_status(struct iwl_priv *priv, | ||
109 | u8 frame_count, u32 status); | ||
108 | void iwlagn_rx_handler_setup(struct iwl_priv *priv); | 110 | void iwlagn_rx_handler_setup(struct iwl_priv *priv); |
109 | void iwlagn_setup_deferred_work(struct iwl_priv *priv); | 111 | void iwlagn_setup_deferred_work(struct iwl_priv *priv); |
110 | int iwlagn_hw_valid_rtc_data_addr(u32 addr); | 112 | int iwlagn_hw_valid_rtc_data_addr(u32 addr); |
@@ -143,7 +145,30 @@ void iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv, | |||
143 | struct iwl_rx_mem_buffer *rxb); | 145 | struct iwl_rx_mem_buffer *rxb); |
144 | int iwlagn_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index); | 146 | int iwlagn_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index); |
145 | void iwlagn_hw_txq_ctx_free(struct iwl_priv *priv); | 147 | void iwlagn_hw_txq_ctx_free(struct iwl_priv *priv); |
146 | int iwlagn_txq_ctx_reset(struct iwl_priv *priv); | 148 | int iwlagn_txq_ctx_alloc(struct iwl_priv *priv); |
149 | void iwlagn_txq_ctx_reset(struct iwl_priv *priv); | ||
147 | void iwlagn_txq_ctx_stop(struct iwl_priv *priv); | 150 | void iwlagn_txq_ctx_stop(struct iwl_priv *priv); |
148 | 151 | ||
152 | static inline u32 iwl_tx_status_to_mac80211(u32 status) | ||
153 | { | ||
154 | status &= TX_STATUS_MSK; | ||
155 | |||
156 | switch (status) { | ||
157 | case TX_STATUS_SUCCESS: | ||
158 | case TX_STATUS_DIRECT_DONE: | ||
159 | return IEEE80211_TX_STAT_ACK; | ||
160 | case TX_STATUS_FAIL_DEST_PS: | ||
161 | return IEEE80211_TX_STAT_TX_FILTERED; | ||
162 | default: | ||
163 | return 0; | ||
164 | } | ||
165 | } | ||
166 | |||
167 | static inline bool iwl_is_tx_success(u32 status) | ||
168 | { | ||
169 | status &= TX_STATUS_MSK; | ||
170 | return (status == TX_STATUS_SUCCESS) || | ||
171 | (status == TX_STATUS_DIRECT_DONE); | ||
172 | } | ||
173 | |||
149 | #endif /* __iwl_agn_h__ */ | 174 | #endif /* __iwl_agn_h__ */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h index 6383d9f8c9b3..d830086ca195 100644 --- a/drivers/net/wireless/iwlwifi/iwl-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-commands.h | |||
@@ -106,7 +106,7 @@ enum { | |||
106 | REPLY_TX = 0x1c, | 106 | REPLY_TX = 0x1c, |
107 | REPLY_RATE_SCALE = 0x47, /* 3945 only */ | 107 | REPLY_RATE_SCALE = 0x47, /* 3945 only */ |
108 | REPLY_LEDS_CMD = 0x48, | 108 | REPLY_LEDS_CMD = 0x48, |
109 | REPLY_TX_LINK_QUALITY_CMD = 0x4e, /* 4965 only */ | 109 | REPLY_TX_LINK_QUALITY_CMD = 0x4e, /* for 4965 and up */ |
110 | 110 | ||
111 | /* WiMAX coexistence */ | 111 | /* WiMAX coexistence */ |
112 | COEX_PRIORITY_TABLE_CMD = 0x5a, /* for 5000 series and up */ | 112 | COEX_PRIORITY_TABLE_CMD = 0x5a, /* for 5000 series and up */ |
@@ -512,8 +512,9 @@ struct iwl_init_alive_resp { | |||
512 | * | 512 | * |
513 | * Entries without timestamps contain only event_id and data. | 513 | * Entries without timestamps contain only event_id and data. |
514 | * | 514 | * |
515 | * | ||
515 | * 2) error_event_table_ptr indicates base of the error log. This contains | 516 | * 2) error_event_table_ptr indicates base of the error log. This contains |
516 | * information about any uCode error that occurs. For 4965, the format | 517 | * information about any uCode error that occurs. For agn, the format |
517 | * of the error log is: | 518 | * of the error log is: |
518 | * | 519 | * |
519 | * __le32 valid; (nonzero) valid, (0) log is empty | 520 | * __le32 valid; (nonzero) valid, (0) log is empty |
@@ -529,6 +530,30 @@ struct iwl_init_alive_resp { | |||
529 | * __le32 bcon_time; beacon timer | 530 | * __le32 bcon_time; beacon timer |
530 | * __le32 tsf_low; network timestamp function timer | 531 | * __le32 tsf_low; network timestamp function timer |
531 | * __le32 tsf_hi; network timestamp function timer | 532 | * __le32 tsf_hi; network timestamp function timer |
533 | * __le32 gp1; GP1 timer register | ||
534 | * __le32 gp2; GP2 timer register | ||
535 | * __le32 gp3; GP3 timer register | ||
536 | * __le32 ucode_ver; uCode version | ||
537 | * __le32 hw_ver; HW Silicon version | ||
538 | * __le32 brd_ver; HW board version | ||
539 | * __le32 log_pc; log program counter | ||
540 | * __le32 frame_ptr; frame pointer | ||
541 | * __le32 stack_ptr; stack pointer | ||
542 | * __le32 hcmd; last host command | ||
543 | * __le32 isr0; isr status register LMPM_NIC_ISR0: rxtx_flag | ||
544 | * __le32 isr1; isr status register LMPM_NIC_ISR1: host_flag | ||
545 | * __le32 isr2; isr status register LMPM_NIC_ISR2: enc_flag | ||
546 | * __le32 isr3; isr status register LMPM_NIC_ISR3: time_flag | ||
547 | * __le32 isr4; isr status register LMPM_NIC_ISR4: wico interrupt | ||
548 | * __le32 isr_pref; isr status register LMPM_NIC_PREF_STAT | ||
549 | * __le32 wait_event; wait event() caller address | ||
550 | * __le32 l2p_control; L2pControlField | ||
551 | * __le32 l2p_duration; L2pDurationField | ||
552 | * __le32 l2p_mhvalid; L2pMhValidBits | ||
553 | * __le32 l2p_addr_match; L2pAddrMatchStat | ||
554 | * __le32 lmpm_pmg_sel; indicate which clocks are turned on (LMPM_PMG_SEL) | ||
555 | * __le32 u_timestamp; indicate when the date and time of the compilation | ||
556 | * __le32 reserved; | ||
532 | * | 557 | * |
533 | * The Linux driver can print both logs to the system log when a uCode error | 558 | * The Linux driver can print both logs to the system log when a uCode error |
534 | * occurs. | 559 | * occurs. |
@@ -1637,7 +1662,7 @@ struct iwl_tx_cmd { | |||
1637 | struct ieee80211_hdr hdr[0]; | 1662 | struct ieee80211_hdr hdr[0]; |
1638 | } __attribute__ ((packed)); | 1663 | } __attribute__ ((packed)); |
1639 | 1664 | ||
1640 | /* TX command response is sent after *all* transmission attempts. | 1665 | /* TX command response is sent after *3945* transmission attempts. |
1641 | * | 1666 | * |
1642 | * NOTES: | 1667 | * NOTES: |
1643 | * | 1668 | * |
@@ -1665,24 +1690,65 @@ struct iwl_tx_cmd { | |||
1665 | * control line. Receiving is still allowed in this case. | 1690 | * control line. Receiving is still allowed in this case. |
1666 | */ | 1691 | */ |
1667 | enum { | 1692 | enum { |
1693 | TX_3945_STATUS_SUCCESS = 0x01, | ||
1694 | TX_3945_STATUS_DIRECT_DONE = 0x02, | ||
1695 | TX_3945_STATUS_FAIL_SHORT_LIMIT = 0x82, | ||
1696 | TX_3945_STATUS_FAIL_LONG_LIMIT = 0x83, | ||
1697 | TX_3945_STATUS_FAIL_FIFO_UNDERRUN = 0x84, | ||
1698 | TX_3945_STATUS_FAIL_MGMNT_ABORT = 0x85, | ||
1699 | TX_3945_STATUS_FAIL_NEXT_FRAG = 0x86, | ||
1700 | TX_3945_STATUS_FAIL_LIFE_EXPIRE = 0x87, | ||
1701 | TX_3945_STATUS_FAIL_DEST_PS = 0x88, | ||
1702 | TX_3945_STATUS_FAIL_ABORTED = 0x89, | ||
1703 | TX_3945_STATUS_FAIL_BT_RETRY = 0x8a, | ||
1704 | TX_3945_STATUS_FAIL_STA_INVALID = 0x8b, | ||
1705 | TX_3945_STATUS_FAIL_FRAG_DROPPED = 0x8c, | ||
1706 | TX_3945_STATUS_FAIL_TID_DISABLE = 0x8d, | ||
1707 | TX_3945_STATUS_FAIL_FRAME_FLUSHED = 0x8e, | ||
1708 | TX_3945_STATUS_FAIL_INSUFFICIENT_CF_POLL = 0x8f, | ||
1709 | TX_3945_STATUS_FAIL_TX_LOCKED = 0x90, | ||
1710 | TX_3945_STATUS_FAIL_NO_BEACON_ON_RADAR = 0x91, | ||
1711 | }; | ||
1712 | |||
1713 | /* | ||
1714 | * TX command response is sent after *agn* transmission attempts. | ||
1715 | * | ||
1716 | * both postpone and abort status are expected behavior from uCode. there is | ||
1717 | * no special operation required from driver; except for RFKILL_FLUSH, | ||
1718 | * which required tx flush host command to flush all the tx frames in queues | ||
1719 | */ | ||
1720 | enum { | ||
1668 | TX_STATUS_SUCCESS = 0x01, | 1721 | TX_STATUS_SUCCESS = 0x01, |
1669 | TX_STATUS_DIRECT_DONE = 0x02, | 1722 | TX_STATUS_DIRECT_DONE = 0x02, |
1723 | /* postpone TX */ | ||
1724 | TX_STATUS_POSTPONE_DELAY = 0x40, | ||
1725 | TX_STATUS_POSTPONE_FEW_BYTES = 0x41, | ||
1726 | TX_STATUS_POSTPONE_BT_PRIO = 0x42, | ||
1727 | TX_STATUS_POSTPONE_QUIET_PERIOD = 0x43, | ||
1728 | TX_STATUS_POSTPONE_CALC_TTAK = 0x44, | ||
1729 | /* abort TX */ | ||
1730 | TX_STATUS_FAIL_INTERNAL_CROSSED_RETRY = 0x81, | ||
1670 | TX_STATUS_FAIL_SHORT_LIMIT = 0x82, | 1731 | TX_STATUS_FAIL_SHORT_LIMIT = 0x82, |
1671 | TX_STATUS_FAIL_LONG_LIMIT = 0x83, | 1732 | TX_STATUS_FAIL_LONG_LIMIT = 0x83, |
1672 | TX_STATUS_FAIL_FIFO_UNDERRUN = 0x84, | 1733 | TX_STATUS_FAIL_FIFO_UNDERRUN = 0x84, |
1673 | TX_STATUS_FAIL_MGMNT_ABORT = 0x85, | 1734 | TX_STATUS_FAIL_DRAIN_FLOW = 0x85, |
1674 | TX_STATUS_FAIL_NEXT_FRAG = 0x86, | 1735 | TX_STATUS_FAIL_RFKILL_FLUSH = 0x86, |
1675 | TX_STATUS_FAIL_LIFE_EXPIRE = 0x87, | 1736 | TX_STATUS_FAIL_LIFE_EXPIRE = 0x87, |
1676 | TX_STATUS_FAIL_DEST_PS = 0x88, | 1737 | TX_STATUS_FAIL_DEST_PS = 0x88, |
1677 | TX_STATUS_FAIL_ABORTED = 0x89, | 1738 | TX_STATUS_FAIL_HOST_ABORTED = 0x89, |
1678 | TX_STATUS_FAIL_BT_RETRY = 0x8a, | 1739 | TX_STATUS_FAIL_BT_RETRY = 0x8a, |
1679 | TX_STATUS_FAIL_STA_INVALID = 0x8b, | 1740 | TX_STATUS_FAIL_STA_INVALID = 0x8b, |
1680 | TX_STATUS_FAIL_FRAG_DROPPED = 0x8c, | 1741 | TX_STATUS_FAIL_FRAG_DROPPED = 0x8c, |
1681 | TX_STATUS_FAIL_TID_DISABLE = 0x8d, | 1742 | TX_STATUS_FAIL_TID_DISABLE = 0x8d, |
1682 | TX_STATUS_FAIL_FRAME_FLUSHED = 0x8e, | 1743 | TX_STATUS_FAIL_FIFO_FLUSHED = 0x8e, |
1683 | TX_STATUS_FAIL_INSUFFICIENT_CF_POLL = 0x8f, | 1744 | TX_STATUS_FAIL_INSUFFICIENT_CF_POLL = 0x8f, |
1684 | TX_STATUS_FAIL_TX_LOCKED = 0x90, | 1745 | /* uCode drop due to FW drop request */ |
1685 | TX_STATUS_FAIL_NO_BEACON_ON_RADAR = 0x91, | 1746 | TX_STATUS_FAIL_FW_DROP = 0x90, |
1747 | /* | ||
1748 | * uCode drop due to station color mismatch | ||
1749 | * between tx command and station table | ||
1750 | */ | ||
1751 | TX_STATUS_FAIL_STA_COLOR_MISMATCH_DROP = 0x91, | ||
1686 | }; | 1752 | }; |
1687 | 1753 | ||
1688 | #define TX_PACKET_MODE_REGULAR 0x0000 | 1754 | #define TX_PACKET_MODE_REGULAR 0x0000 |
@@ -1704,30 +1770,6 @@ enum { | |||
1704 | TX_ABORT_REQUIRED_MSK = 0x80000000, /* bits 31:31 */ | 1770 | TX_ABORT_REQUIRED_MSK = 0x80000000, /* bits 31:31 */ |
1705 | }; | 1771 | }; |
1706 | 1772 | ||
1707 | static inline u32 iwl_tx_status_to_mac80211(u32 status) | ||
1708 | { | ||
1709 | status &= TX_STATUS_MSK; | ||
1710 | |||
1711 | switch (status) { | ||
1712 | case TX_STATUS_SUCCESS: | ||
1713 | case TX_STATUS_DIRECT_DONE: | ||
1714 | return IEEE80211_TX_STAT_ACK; | ||
1715 | case TX_STATUS_FAIL_DEST_PS: | ||
1716 | return IEEE80211_TX_STAT_TX_FILTERED; | ||
1717 | default: | ||
1718 | return 0; | ||
1719 | } | ||
1720 | } | ||
1721 | |||
1722 | static inline bool iwl_is_tx_success(u32 status) | ||
1723 | { | ||
1724 | status &= TX_STATUS_MSK; | ||
1725 | return (status == TX_STATUS_SUCCESS) || | ||
1726 | (status == TX_STATUS_DIRECT_DONE); | ||
1727 | } | ||
1728 | |||
1729 | |||
1730 | |||
1731 | /* ******************************* | 1773 | /* ******************************* |
1732 | * TX aggregation status | 1774 | * TX aggregation status |
1733 | ******************************* */ | 1775 | ******************************* */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 10f95724536f..d89755f5031a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -307,6 +307,7 @@ struct iwl_cfg { | |||
307 | u32 monitor_recover_period; | 307 | u32 monitor_recover_period; |
308 | bool temperature_kelvin; | 308 | bool temperature_kelvin; |
309 | bool off_channel_workaround; | 309 | bool off_channel_workaround; |
310 | u32 max_event_log_size; | ||
310 | }; | 311 | }; |
311 | 312 | ||
312 | /*************************** | 313 | /*************************** |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 4319bda487d9..9466e909f553 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -1120,7 +1120,6 @@ struct iwl_priv { | |||
1120 | __le16 sensitivity_tbl[HD_TABLE_SIZE]; | 1120 | __le16 sensitivity_tbl[HD_TABLE_SIZE]; |
1121 | 1121 | ||
1122 | struct iwl_ht_config current_ht_config; | 1122 | struct iwl_ht_config current_ht_config; |
1123 | u8 last_phy_res[100]; | ||
1124 | 1123 | ||
1125 | /* Rate scaling data */ | 1124 | /* Rate scaling data */ |
1126 | u8 retry_rate; | 1125 | u8 retry_rate; |
@@ -1167,7 +1166,6 @@ struct iwl_priv { | |||
1167 | int num_stations; | 1166 | int num_stations; |
1168 | struct iwl_station_entry stations[IWL_STATION_COUNT]; | 1167 | struct iwl_station_entry stations[IWL_STATION_COUNT]; |
1169 | struct iwl_wep_key wep_keys[WEP_KEYS_MAX]; /* protected by mutex */ | 1168 | struct iwl_wep_key wep_keys[WEP_KEYS_MAX]; /* protected by mutex */ |
1170 | u8 default_wep_key; | ||
1171 | u8 key_mapping_key; | 1169 | u8 key_mapping_key; |
1172 | unsigned long ucode_key_table; | 1170 | unsigned long ucode_key_table; |
1173 | 1171 | ||
@@ -1238,6 +1236,9 @@ struct iwl_priv { | |||
1238 | * no AGGREGATION | 1236 | * no AGGREGATION |
1239 | */ | 1237 | */ |
1240 | u8 agg_tids_count; | 1238 | u8 agg_tids_count; |
1239 | |||
1240 | struct iwl_rx_phy_res last_phy_res; | ||
1241 | bool last_phy_res_valid; | ||
1241 | } _agn; | 1242 | } _agn; |
1242 | #endif | 1243 | #endif |
1243 | }; | 1244 | }; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index e34ac0355c75..d86ecd2f9ec2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -194,7 +194,7 @@ int iwl_send_add_sta(struct iwl_priv *priv, | |||
194 | .flags = flags, | 194 | .flags = flags, |
195 | .data = data, | 195 | .data = data, |
196 | }; | 196 | }; |
197 | u8 sta_id = sta->sta.sta_id; | 197 | u8 sta_id __maybe_unused = sta->sta.sta_id; |
198 | 198 | ||
199 | IWL_DEBUG_INFO(priv, "Adding sta %u (%pM) %ssynchronously\n", | 199 | IWL_DEBUG_INFO(priv, "Adding sta %u (%pM) %ssynchronously\n", |
200 | sta_id, sta->sta.addr, flags & CMD_ASYNC ? "a" : ""); | 200 | sta_id, sta->sta.addr, flags & CMD_ASYNC ? "a" : ""); |
@@ -425,6 +425,7 @@ static void iwl_sta_init_lq(struct iwl_priv *priv, const u8 *addr, bool is_ap) | |||
425 | .reserved1 = 0, | 425 | .reserved1 = 0, |
426 | }; | 426 | }; |
427 | u32 rate_flags; | 427 | u32 rate_flags; |
428 | int ret = 0; | ||
428 | 429 | ||
429 | /* Set up the rate scaling to start at selected rate, fall back | 430 | /* Set up the rate scaling to start at selected rate, fall back |
430 | * all the way down to 1M in IEEE order, and then spin on 1M */ | 431 | * all the way down to 1M in IEEE order, and then spin on 1M */ |
@@ -458,8 +459,10 @@ static void iwl_sta_init_lq(struct iwl_priv *priv, const u8 *addr, bool is_ap) | |||
458 | /* Update the rate scaling for control frame Tx to AP */ | 459 | /* Update the rate scaling for control frame Tx to AP */ |
459 | link_cmd.sta_id = is_ap ? IWL_AP_ID : priv->hw_params.bcast_sta_id; | 460 | link_cmd.sta_id = is_ap ? IWL_AP_ID : priv->hw_params.bcast_sta_id; |
460 | 461 | ||
461 | iwl_send_cmd_pdu(priv, REPLY_TX_LINK_QUALITY_CMD, | 462 | ret = iwl_send_cmd_pdu(priv, REPLY_TX_LINK_QUALITY_CMD, |
462 | sizeof(link_cmd), &link_cmd); | 463 | sizeof(link_cmd), &link_cmd); |
464 | if (ret) | ||
465 | IWL_ERR(priv, "REPLY_TX_LINK_QUALITY_CMD failed (%d)\n", ret); | ||
463 | } | 466 | } |
464 | 467 | ||
465 | /* | 468 | /* |
@@ -759,7 +762,7 @@ int iwl_get_free_ucode_key_index(struct iwl_priv *priv) | |||
759 | } | 762 | } |
760 | EXPORT_SYMBOL(iwl_get_free_ucode_key_index); | 763 | EXPORT_SYMBOL(iwl_get_free_ucode_key_index); |
761 | 764 | ||
762 | int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty) | 765 | static int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty) |
763 | { | 766 | { |
764 | int i, not_empty = 0; | 767 | int i, not_empty = 0; |
765 | u8 buff[sizeof(struct iwl_wep_cmd) + | 768 | u8 buff[sizeof(struct iwl_wep_cmd) + |
@@ -803,7 +806,14 @@ int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty) | |||
803 | else | 806 | else |
804 | return 0; | 807 | return 0; |
805 | } | 808 | } |
806 | EXPORT_SYMBOL(iwl_send_static_wepkey_cmd); | 809 | |
810 | int iwl_restore_default_wep_keys(struct iwl_priv *priv) | ||
811 | { | ||
812 | WARN_ON(!mutex_is_locked(&priv->mutex)); | ||
813 | |||
814 | return iwl_send_static_wepkey_cmd(priv, 0); | ||
815 | } | ||
816 | EXPORT_SYMBOL(iwl_restore_default_wep_keys); | ||
807 | 817 | ||
808 | int iwl_remove_default_wep_key(struct iwl_priv *priv, | 818 | int iwl_remove_default_wep_key(struct iwl_priv *priv, |
809 | struct ieee80211_key_conf *keyconf) | 819 | struct ieee80211_key_conf *keyconf) |
@@ -815,11 +825,6 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv, | |||
815 | IWL_DEBUG_WEP(priv, "Removing default WEP key: idx=%d\n", | 825 | IWL_DEBUG_WEP(priv, "Removing default WEP key: idx=%d\n", |
816 | keyconf->keyidx); | 826 | keyconf->keyidx); |
817 | 827 | ||
818 | if (!test_and_clear_bit(keyconf->keyidx, &priv->ucode_key_table)) | ||
819 | IWL_ERR(priv, "index %d not used in uCode key table.\n", | ||
820 | keyconf->keyidx); | ||
821 | |||
822 | priv->default_wep_key--; | ||
823 | memset(&priv->wep_keys[keyconf->keyidx], 0, sizeof(priv->wep_keys[0])); | 828 | memset(&priv->wep_keys[keyconf->keyidx], 0, sizeof(priv->wep_keys[0])); |
824 | if (iwl_is_rfkill(priv)) { | 829 | if (iwl_is_rfkill(priv)) { |
825 | IWL_DEBUG_WEP(priv, "Not sending REPLY_WEPKEY command due to RFKILL.\n"); | 830 | IWL_DEBUG_WEP(priv, "Not sending REPLY_WEPKEY command due to RFKILL.\n"); |
@@ -851,12 +856,6 @@ int iwl_set_default_wep_key(struct iwl_priv *priv, | |||
851 | keyconf->hw_key_idx = HW_KEY_DEFAULT; | 856 | keyconf->hw_key_idx = HW_KEY_DEFAULT; |
852 | priv->stations[IWL_AP_ID].keyinfo.alg = ALG_WEP; | 857 | priv->stations[IWL_AP_ID].keyinfo.alg = ALG_WEP; |
853 | 858 | ||
854 | priv->default_wep_key++; | ||
855 | |||
856 | if (test_and_set_bit(keyconf->keyidx, &priv->ucode_key_table)) | ||
857 | IWL_ERR(priv, "index %d already used in uCode key table.\n", | ||
858 | keyconf->keyidx); | ||
859 | |||
860 | priv->wep_keys[keyconf->keyidx].key_size = keyconf->keylen; | 859 | priv->wep_keys[keyconf->keyidx].key_size = keyconf->keylen; |
861 | memcpy(&priv->wep_keys[keyconf->keyidx].key, &keyconf->key, | 860 | memcpy(&priv->wep_keys[keyconf->keyidx].key, &keyconf->key, |
862 | keyconf->keylen); | 861 | keyconf->keylen); |
@@ -1191,13 +1190,9 @@ int iwl_send_lq_cmd(struct iwl_priv *priv, | |||
1191 | .data = lq, | 1190 | .data = lq, |
1192 | }; | 1191 | }; |
1193 | 1192 | ||
1194 | if ((lq->sta_id == 0xFF) && | 1193 | if (WARN_ON(lq->sta_id == IWL_INVALID_STATION)) |
1195 | (priv->iw_mode == NL80211_IFTYPE_ADHOC)) | ||
1196 | return -EINVAL; | 1194 | return -EINVAL; |
1197 | 1195 | ||
1198 | if (lq->sta_id == 0xFF) | ||
1199 | lq->sta_id = IWL_AP_ID; | ||
1200 | |||
1201 | iwl_dump_lq_cmd(priv, lq); | 1196 | iwl_dump_lq_cmd(priv, lq); |
1202 | BUG_ON(init && (cmd.flags & CMD_ASYNC)); | 1197 | BUG_ON(init && (cmd.flags & CMD_ASYNC)); |
1203 | 1198 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.h b/drivers/net/wireless/iwlwifi/iwl-sta.h index 87a34997a758..42cd2f4a01cd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.h +++ b/drivers/net/wireless/iwlwifi/iwl-sta.h | |||
@@ -44,11 +44,11 @@ | |||
44 | */ | 44 | */ |
45 | u8 iwl_find_station(struct iwl_priv *priv, const u8 *bssid); | 45 | u8 iwl_find_station(struct iwl_priv *priv, const u8 *bssid); |
46 | 46 | ||
47 | int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty); | ||
48 | int iwl_remove_default_wep_key(struct iwl_priv *priv, | 47 | int iwl_remove_default_wep_key(struct iwl_priv *priv, |
49 | struct ieee80211_key_conf *key); | 48 | struct ieee80211_key_conf *key); |
50 | int iwl_set_default_wep_key(struct iwl_priv *priv, | 49 | int iwl_set_default_wep_key(struct iwl_priv *priv, |
51 | struct ieee80211_key_conf *key); | 50 | struct ieee80211_key_conf *key); |
51 | int iwl_restore_default_wep_keys(struct iwl_priv *priv); | ||
52 | int iwl_set_dynamic_key(struct iwl_priv *priv, | 52 | int iwl_set_dynamic_key(struct iwl_priv *priv, |
53 | struct ieee80211_key_conf *key, u8 sta_id); | 53 | struct ieee80211_key_conf *key, u8 sta_id); |
54 | int iwl_remove_dynamic_key(struct iwl_priv *priv, | 54 | int iwl_remove_dynamic_key(struct iwl_priv *priv, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index a631afef5e33..c3c6505a8c69 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -394,6 +394,26 @@ out_free_arrays: | |||
394 | } | 394 | } |
395 | EXPORT_SYMBOL(iwl_tx_queue_init); | 395 | EXPORT_SYMBOL(iwl_tx_queue_init); |
396 | 396 | ||
397 | void iwl_tx_queue_reset(struct iwl_priv *priv, struct iwl_tx_queue *txq, | ||
398 | int slots_num, u32 txq_id) | ||
399 | { | ||
400 | int actual_slots = slots_num; | ||
401 | |||
402 | if (txq_id == IWL_CMD_QUEUE_NUM) | ||
403 | actual_slots++; | ||
404 | |||
405 | memset(txq->meta, 0, sizeof(struct iwl_cmd_meta) * actual_slots); | ||
406 | |||
407 | txq->need_update = 0; | ||
408 | |||
409 | /* Initialize queue's high/low-water marks, and head/tail indexes */ | ||
410 | iwl_queue_init(priv, &txq->q, TFD_QUEUE_SIZE_MAX, slots_num, txq_id); | ||
411 | |||
412 | /* Tell device where to find queue */ | ||
413 | priv->cfg->ops->lib->txq_init(priv, txq); | ||
414 | } | ||
415 | EXPORT_SYMBOL(iwl_tx_queue_reset); | ||
416 | |||
397 | /*************** HOST COMMAND QUEUE FUNCTIONS *****/ | 417 | /*************** HOST COMMAND QUEUE FUNCTIONS *****/ |
398 | 418 | ||
399 | /** | 419 | /** |
@@ -629,29 +649,36 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) | |||
629 | EXPORT_SYMBOL(iwl_tx_cmd_complete); | 649 | EXPORT_SYMBOL(iwl_tx_cmd_complete); |
630 | 650 | ||
631 | #ifdef CONFIG_IWLWIFI_DEBUG | 651 | #ifdef CONFIG_IWLWIFI_DEBUG |
632 | #define TX_STATUS_ENTRY(x) case TX_STATUS_FAIL_ ## x: return #x | 652 | #define TX_STATUS_FAIL(x) case TX_STATUS_FAIL_ ## x: return #x |
653 | #define TX_STATUS_POSTPONE(x) case TX_STATUS_POSTPONE_ ## x: return #x | ||
633 | 654 | ||
634 | const char *iwl_get_tx_fail_reason(u32 status) | 655 | const char *iwl_get_tx_fail_reason(u32 status) |
635 | { | 656 | { |
636 | switch (status & TX_STATUS_MSK) { | 657 | switch (status & TX_STATUS_MSK) { |
637 | case TX_STATUS_SUCCESS: | 658 | case TX_STATUS_SUCCESS: |
638 | return "SUCCESS"; | 659 | return "SUCCESS"; |
639 | TX_STATUS_ENTRY(SHORT_LIMIT); | 660 | TX_STATUS_POSTPONE(DELAY); |
640 | TX_STATUS_ENTRY(LONG_LIMIT); | 661 | TX_STATUS_POSTPONE(FEW_BYTES); |
641 | TX_STATUS_ENTRY(FIFO_UNDERRUN); | 662 | TX_STATUS_POSTPONE(BT_PRIO); |
642 | TX_STATUS_ENTRY(MGMNT_ABORT); | 663 | TX_STATUS_POSTPONE(QUIET_PERIOD); |
643 | TX_STATUS_ENTRY(NEXT_FRAG); | 664 | TX_STATUS_POSTPONE(CALC_TTAK); |
644 | TX_STATUS_ENTRY(LIFE_EXPIRE); | 665 | TX_STATUS_FAIL(INTERNAL_CROSSED_RETRY); |
645 | TX_STATUS_ENTRY(DEST_PS); | 666 | TX_STATUS_FAIL(SHORT_LIMIT); |
646 | TX_STATUS_ENTRY(ABORTED); | 667 | TX_STATUS_FAIL(LONG_LIMIT); |
647 | TX_STATUS_ENTRY(BT_RETRY); | 668 | TX_STATUS_FAIL(FIFO_UNDERRUN); |
648 | TX_STATUS_ENTRY(STA_INVALID); | 669 | TX_STATUS_FAIL(DRAIN_FLOW); |
649 | TX_STATUS_ENTRY(FRAG_DROPPED); | 670 | TX_STATUS_FAIL(RFKILL_FLUSH); |
650 | TX_STATUS_ENTRY(TID_DISABLE); | 671 | TX_STATUS_FAIL(LIFE_EXPIRE); |
651 | TX_STATUS_ENTRY(FRAME_FLUSHED); | 672 | TX_STATUS_FAIL(DEST_PS); |
652 | TX_STATUS_ENTRY(INSUFFICIENT_CF_POLL); | 673 | TX_STATUS_FAIL(HOST_ABORTED); |
653 | TX_STATUS_ENTRY(TX_LOCKED); | 674 | TX_STATUS_FAIL(BT_RETRY); |
654 | TX_STATUS_ENTRY(NO_BEACON_ON_RADAR); | 675 | TX_STATUS_FAIL(STA_INVALID); |
676 | TX_STATUS_FAIL(FRAG_DROPPED); | ||
677 | TX_STATUS_FAIL(TID_DISABLE); | ||
678 | TX_STATUS_FAIL(FIFO_FLUSHED); | ||
679 | TX_STATUS_FAIL(INSUFFICIENT_CF_POLL); | ||
680 | TX_STATUS_FAIL(FW_DROP); | ||
681 | TX_STATUS_FAIL(STA_COLOR_MISMATCH_DROP); | ||
655 | } | 682 | } |
656 | 683 | ||
657 | return "UNKNOWN"; | 684 | return "UNKNOWN"; |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index c9188b9c5651..24e969440b31 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -1603,9 +1603,6 @@ static int iwl3945_print_last_event_logs(struct iwl_priv *priv, u32 capacity, | |||
1603 | return pos; | 1603 | return pos; |
1604 | } | 1604 | } |
1605 | 1605 | ||
1606 | /* For sanity check only. Actual size is determined by uCode, typ. 512 */ | ||
1607 | #define IWL3945_MAX_EVENT_LOG_SIZE (512) | ||
1608 | |||
1609 | #define DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES (20) | 1606 | #define DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES (20) |
1610 | 1607 | ||
1611 | int iwl3945_dump_nic_event_log(struct iwl_priv *priv, bool full_log, | 1608 | int iwl3945_dump_nic_event_log(struct iwl_priv *priv, bool full_log, |
@@ -1632,16 +1629,16 @@ int iwl3945_dump_nic_event_log(struct iwl_priv *priv, bool full_log, | |||
1632 | num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32))); | 1629 | num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32))); |
1633 | next_entry = iwl_read_targ_mem(priv, base + (3 * sizeof(u32))); | 1630 | next_entry = iwl_read_targ_mem(priv, base + (3 * sizeof(u32))); |
1634 | 1631 | ||
1635 | if (capacity > IWL3945_MAX_EVENT_LOG_SIZE) { | 1632 | if (capacity > priv->cfg->max_event_log_size) { |
1636 | IWL_ERR(priv, "Log capacity %d is bogus, limit to %d entries\n", | 1633 | IWL_ERR(priv, "Log capacity %d is bogus, limit to %d entries\n", |
1637 | capacity, IWL3945_MAX_EVENT_LOG_SIZE); | 1634 | capacity, priv->cfg->max_event_log_size); |
1638 | capacity = IWL3945_MAX_EVENT_LOG_SIZE; | 1635 | capacity = priv->cfg->max_event_log_size; |
1639 | } | 1636 | } |
1640 | 1637 | ||
1641 | if (next_entry > IWL3945_MAX_EVENT_LOG_SIZE) { | 1638 | if (next_entry > priv->cfg->max_event_log_size) { |
1642 | IWL_ERR(priv, "Log write index %d is bogus, limit to %d\n", | 1639 | IWL_ERR(priv, "Log write index %d is bogus, limit to %d\n", |
1643 | next_entry, IWL3945_MAX_EVENT_LOG_SIZE); | 1640 | next_entry, priv->cfg->max_event_log_size); |
1644 | next_entry = IWL3945_MAX_EVENT_LOG_SIZE; | 1641 | next_entry = priv->cfg->max_event_log_size; |
1645 | } | 1642 | } |
1646 | 1643 | ||
1647 | size = num_wraps ? capacity : next_entry; | 1644 | size = num_wraps ? capacity : next_entry; |