aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2008-10-29 23:24:26 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-11-10 15:11:57 -0500
commit17683c65c8a5f3f29f5408334992986b996d8205 (patch)
tree2733d77fba5ffb3c2d434afc27a54fa099b52772 /drivers/net/wireless/ath5k
parentf07a6c495e88ae0143e3c20b1ed666314197277f (diff)
ath5k: fix keytable type buglet in ath5k_hw_reset_key
Be sure we clear out both the mic (if applicable) and the encryption key type. Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k')
-rw-r--r--drivers/net/wireless/ath5k/pcu.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath5k/pcu.c b/drivers/net/wireless/ath5k/pcu.c
index 5674639f7bf8..9c6698520edc 100644
--- a/drivers/net/wireless/ath5k/pcu.c
+++ b/drivers/net/wireless/ath5k/pcu.c
@@ -960,6 +960,7 @@ int ath5k_hw_beaconq_finish(struct ath5k_hw *ah, unsigned long phys_addr)
960int ath5k_hw_reset_key(struct ath5k_hw *ah, u16 entry) 960int ath5k_hw_reset_key(struct ath5k_hw *ah, u16 entry)
961{ 961{
962 unsigned int i, type; 962 unsigned int i, type;
963 u16 micentry = entry + AR5K_KEYTABLE_MIC_OFFSET;
963 964
964 ATH5K_TRACE(ah->ah_sc); 965 ATH5K_TRACE(ah->ah_sc);
965 AR5K_ASSERT_ENTRY(entry, AR5K_KEYTABLE_SIZE); 966 AR5K_ASSERT_ENTRY(entry, AR5K_KEYTABLE_SIZE);
@@ -972,10 +973,10 @@ int ath5k_hw_reset_key(struct ath5k_hw *ah, u16 entry)
972 /* Reset associated MIC entry if TKIP 973 /* Reset associated MIC entry if TKIP
973 * is enabled located at offset (entry + 64) */ 974 * is enabled located at offset (entry + 64) */
974 if (type == AR5K_KEYTABLE_TYPE_TKIP) { 975 if (type == AR5K_KEYTABLE_TYPE_TKIP) {
975 entry = entry + AR5K_KEYTABLE_MIC_OFFSET; 976 AR5K_ASSERT_ENTRY(micentry, AR5K_KEYTABLE_SIZE);
976 AR5K_ASSERT_ENTRY(entry, AR5K_KEYTABLE_SIZE);
977 for (i = 0; i < AR5K_KEYCACHE_SIZE / 2 ; i++) 977 for (i = 0; i < AR5K_KEYCACHE_SIZE / 2 ; i++)
978 ath5k_hw_reg_write(ah, 0, AR5K_KEYTABLE_OFF(entry, i)); 978 ath5k_hw_reg_write(ah, 0,
979 AR5K_KEYTABLE_OFF(micentry, i));
979 } 980 }
980 981
981 /* 982 /*
@@ -987,10 +988,16 @@ int ath5k_hw_reset_key(struct ath5k_hw *ah, u16 entry)
987 * Note2: Windows driver (ndiswrapper) sets this to 988 * Note2: Windows driver (ndiswrapper) sets this to
988 * 0x00000714 instead of 0x00000007 989 * 0x00000714 instead of 0x00000007
989 */ 990 */
990 if (ah->ah_version > AR5K_AR5211) 991 if (ah->ah_version > AR5K_AR5211) {
991 ath5k_hw_reg_write(ah, AR5K_KEYTABLE_TYPE_NULL, 992 ath5k_hw_reg_write(ah, AR5K_KEYTABLE_TYPE_NULL,
992 AR5K_KEYTABLE_TYPE(entry)); 993 AR5K_KEYTABLE_TYPE(entry));
993 994
995 if (type == AR5K_KEYTABLE_TYPE_TKIP) {
996 ath5k_hw_reg_write(ah, AR5K_KEYTABLE_TYPE_NULL,
997 AR5K_KEYTABLE_TYPE(micentry));
998 }
999 }
1000
994 return 0; 1001 return 0;
995} 1002}
996 1003