ath9k: fix a regression in handling of MAC key miss events (should improve connection...
[openwrt.git] / package / mac80211 / patches / 551-ath9k_fix_keymiss_handling.patch
1 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
2 +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
3 @@ -525,8 +525,8 @@ int ath9k_hw_process_rxdesc_edma(struct
4 rxs->rs_status |= ATH9K_RXERR_DECRYPT;
5 else if (rxsp->status11 & AR_MichaelErr)
6 rxs->rs_status |= ATH9K_RXERR_MIC;
7 - else if (rxsp->status11 & AR_KeyMiss)
8 - rxs->rs_status |= ATH9K_RXERR_DECRYPT;
9 + if (rxsp->status11 & AR_KeyMiss)
10 + rxs->rs_status |= ATH9K_RXERR_KEYMISS;
11 }
12
13 return 0;
14 --- a/drivers/net/wireless/ath/ath9k/mac.c
15 +++ b/drivers/net/wireless/ath/ath9k/mac.c
16 @@ -620,8 +620,8 @@ int ath9k_hw_rxprocdesc(struct ath_hw *a
17 rs->rs_status |= ATH9K_RXERR_DECRYPT;
18 else if (ads.ds_rxstatus8 & AR_MichaelErr)
19 rs->rs_status |= ATH9K_RXERR_MIC;
20 - else if (ads.ds_rxstatus8 & AR_KeyMiss)
21 - rs->rs_status |= ATH9K_RXERR_DECRYPT;
22 + if (ads.ds_rxstatus8 & AR_KeyMiss)
23 + rs->rs_status |= ATH9K_RXERR_KEYMISS;
24 }
25
26 return 0;
27 --- a/drivers/net/wireless/ath/ath9k/mac.h
28 +++ b/drivers/net/wireless/ath/ath9k/mac.h
29 @@ -181,6 +181,7 @@ struct ath_htc_rx_status {
30 #define ATH9K_RXERR_FIFO 0x04
31 #define ATH9K_RXERR_DECRYPT 0x08
32 #define ATH9K_RXERR_MIC 0x10
33 +#define ATH9K_RXERR_KEYMISS 0x20
34
35 #define ATH9K_RX_MORE 0x01
36 #define ATH9K_RX_MORE_AGGR 0x02
37 --- a/drivers/net/wireless/ath/ath9k/recv.c
38 +++ b/drivers/net/wireless/ath/ath9k/recv.c
39 @@ -854,6 +854,8 @@ static bool ath9k_rx_accept(struct ath_c
40 * descriptors.
41 */
42 if (rx_stats->rs_status != 0) {
43 + u8 status_mask;
44 +
45 if (rx_stats->rs_status & ATH9K_RXERR_CRC) {
46 rxs->flag |= RX_FLAG_FAILED_FCS_CRC;
47 mic_error = false;
48 @@ -861,7 +863,8 @@ static bool ath9k_rx_accept(struct ath_c
49 if (rx_stats->rs_status & ATH9K_RXERR_PHY)
50 return false;
51
52 - if (rx_stats->rs_status & ATH9K_RXERR_DECRYPT) {
53 + if ((rx_stats->rs_status & ATH9K_RXERR_DECRYPT) ||
54 + (!is_mc && (rx_stats->rs_status & ATH9K_RXERR_KEYMISS))) {
55 *decrypt_error = true;
56 mic_error = false;
57 }
58 @@ -871,17 +874,14 @@ static bool ath9k_rx_accept(struct ath_c
59 * decryption and MIC failures. For monitor mode,
60 * we also ignore the CRC error.
61 */
62 - if (ah->is_monitoring) {
63 - if (rx_stats->rs_status &
64 - ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC |
65 - ATH9K_RXERR_CRC))
66 - return false;
67 - } else {
68 - if (rx_stats->rs_status &
69 - ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC)) {
70 - return false;
71 - }
72 - }
73 + status_mask = ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC |
74 + ATH9K_RXERR_KEYMISS;
75 +
76 + if (ah->is_monitoring)
77 + status_mask |= ATH9K_RXERR_CRC;
78 +
79 + if (rx_stats->rs_status & ~status_mask)
80 + return false;
81 }
82
83 /*
This page took 0.048691 seconds and 5 git commands to generate.