mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-12 11:06:43 +07:00
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>
This commit is contained in:
parent
f07a6c495e
commit
17683c65c8
@ -960,6 +960,7 @@ int ath5k_hw_beaconq_finish(struct ath5k_hw *ah, unsigned long phys_addr)
|
||||
int ath5k_hw_reset_key(struct ath5k_hw *ah, u16 entry)
|
||||
{
|
||||
unsigned int i, type;
|
||||
u16 micentry = entry + AR5K_KEYTABLE_MIC_OFFSET;
|
||||
|
||||
ATH5K_TRACE(ah->ah_sc);
|
||||
AR5K_ASSERT_ENTRY(entry, AR5K_KEYTABLE_SIZE);
|
||||
@ -972,10 +973,10 @@ int ath5k_hw_reset_key(struct ath5k_hw *ah, u16 entry)
|
||||
/* Reset associated MIC entry if TKIP
|
||||
* is enabled located at offset (entry + 64) */
|
||||
if (type == AR5K_KEYTABLE_TYPE_TKIP) {
|
||||
entry = entry + AR5K_KEYTABLE_MIC_OFFSET;
|
||||
AR5K_ASSERT_ENTRY(entry, AR5K_KEYTABLE_SIZE);
|
||||
AR5K_ASSERT_ENTRY(micentry, AR5K_KEYTABLE_SIZE);
|
||||
for (i = 0; i < AR5K_KEYCACHE_SIZE / 2 ; i++)
|
||||
ath5k_hw_reg_write(ah, 0, AR5K_KEYTABLE_OFF(entry, i));
|
||||
ath5k_hw_reg_write(ah, 0,
|
||||
AR5K_KEYTABLE_OFF(micentry, i));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -987,10 +988,16 @@ int ath5k_hw_reset_key(struct ath5k_hw *ah, u16 entry)
|
||||
* Note2: Windows driver (ndiswrapper) sets this to
|
||||
* 0x00000714 instead of 0x00000007
|
||||
*/
|
||||
if (ah->ah_version > AR5K_AR5211)
|
||||
if (ah->ah_version > AR5K_AR5211) {
|
||||
ath5k_hw_reg_write(ah, AR5K_KEYTABLE_TYPE_NULL,
|
||||
AR5K_KEYTABLE_TYPE(entry));
|
||||
|
||||
if (type == AR5K_KEYTABLE_TYPE_TKIP) {
|
||||
ath5k_hw_reg_write(ah, AR5K_KEYTABLE_TYPE_NULL,
|
||||
AR5K_KEYTABLE_TYPE(micentry));
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user