aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/common.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/common.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/common.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/common.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/common.c b/drivers/net/wireless/ath/ath9k/common.c
index 31cfe468e3fc..2dab64bb23a8 100644
--- a/drivers/net/wireless/ath/ath9k/common.c
+++ b/drivers/net/wireless/ath/ath9k/common.c
@@ -372,9 +372,13 @@ int ath9k_cmn_key_config(struct ath_common *common,
372 set_bit(idx, common->keymap); 372 set_bit(idx, common->keymap);
373 if (key->cipher == WLAN_CIPHER_SUITE_TKIP) { 373 if (key->cipher == WLAN_CIPHER_SUITE_TKIP) {
374 set_bit(idx + 64, common->keymap); 374 set_bit(idx + 64, common->keymap);
375 set_bit(idx, common->tkip_keymap);
376 set_bit(idx + 64, common->tkip_keymap);
375 if (common->splitmic) { 377 if (common->splitmic) {
376 set_bit(idx + 32, common->keymap); 378 set_bit(idx + 32, common->keymap);
377 set_bit(idx + 64 + 32, common->keymap); 379 set_bit(idx + 64 + 32, common->keymap);
380 set_bit(idx + 32, common->tkip_keymap);
381 set_bit(idx + 64 + 32, common->tkip_keymap);
378 } 382 }
379 } 383 }
380 384
@@ -399,10 +403,17 @@ void ath9k_cmn_key_delete(struct ath_common *common,
399 return; 403 return;
400 404
401 clear_bit(key->hw_key_idx + 64, common->keymap); 405 clear_bit(key->hw_key_idx + 64, common->keymap);
406
407 clear_bit(key->hw_key_idx, common->tkip_keymap);
408 clear_bit(key->hw_key_idx + 64, common->tkip_keymap);
409
402 if (common->splitmic) { 410 if (common->splitmic) {
403 ath9k_hw_keyreset(ah, key->hw_key_idx + 32); 411 ath9k_hw_keyreset(ah, key->hw_key_idx + 32);
404 clear_bit(key->hw_key_idx + 32, common->keymap); 412 clear_bit(key->hw_key_idx + 32, common->keymap);
405 clear_bit(key->hw_key_idx + 64 + 32, common->keymap); 413 clear_bit(key->hw_key_idx + 64 + 32, common->keymap);
414
415 clear_bit(key->hw_key_idx + 32, common->tkip_keymap);
416 clear_bit(key->hw_key_idx + 64 + 32, common->tkip_keymap);
406 } 417 }
407} 418}
408EXPORT_SYMBOL(ath9k_cmn_key_delete); 419EXPORT_SYMBOL(ath9k_cmn_key_delete);