aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/recv.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-08-28 12:21:21 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-31 14:22:23 -0400
commit56363ddeeed3afc5277ca227209773bc1042cc7b (patch)
tree2f92621e743983cb10175bbbd009ae2e167d1054 /drivers/net/wireless/ath/ath9k/recv.c
parent3653910714a4a9b19aadb202c24f7b1ae61d3556 (diff)
ath9k: fix spurious MIC failure reports
According to the hardware documentation, the MIC failure bit is only valid if the frame was decrypted using a valid TKIP key and is not a fragment. In some setups I've seen hardware-reported MIC failures on an AP that was configured for CCMP only, so it's clear that additional checks are necessary. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/recv.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index a3fc987ebab0..534a91bcc1d9 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -870,15 +870,18 @@ static bool ath9k_rx_accept(struct ath_common *common,
870 if (rx_stats->rs_status & ATH9K_RXERR_DECRYPT) { 870 if (rx_stats->rs_status & ATH9K_RXERR_DECRYPT) {
871 *decrypt_error = true; 871 *decrypt_error = true;
872 } else if (rx_stats->rs_status & ATH9K_RXERR_MIC) { 872 } else if (rx_stats->rs_status & ATH9K_RXERR_MIC) {
873 if (ieee80211_is_ctl(fc)) 873 /*
874 /* 874 * The MIC error bit is only valid if the frame
875 * Sometimes, we get invalid 875 * is not a control frame or fragment, and it was
876 * MIC failures on valid control frames. 876 * decrypted using a valid TKIP key.
877 * Remove these mic errors. 877 */
878 */ 878 if (!ieee80211_is_ctl(fc) &&
879 rx_stats->rs_status &= ~ATH9K_RXERR_MIC; 879 !ieee80211_has_morefrags(fc) &&
880 else 880 !(le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) &&
881 test_bit(rx_stats->rs_keyix, common->tkip_keymap))
881 rxs->flag |= RX_FLAG_MMIC_ERROR; 882 rxs->flag |= RX_FLAG_MMIC_ERROR;
883 else
884 rx_stats->rs_status &= ~ATH9K_RXERR_MIC;
882 } 885 }
883 /* 886 /*
884 * Reject error frames with the exception of 887 * Reject error frames with the exception of