eb09da5f42262f3caf23cdaa3b4688e0eac33fa4
[openwrt.git] / package / mac80211 / patches / 520-ath0k_hw_mcast_search.patch
1 --- a/drivers/net/wireless/ath/ath9k/hw.c
2 +++ b/drivers/net/wireless/ath/ath9k/hw.c
3 @@ -1497,6 +1497,7 @@ EXPORT_SYMBOL(ath9k_hw_keyreset);
4 bool ath9k_hw_keysetmac(struct ath_hw *ah, u16 entry, const u8 *mac)
5 {
6 u32 macHi, macLo;
7 + u32 unicast_flag = AR_KEYTABLE_VALID;
8
9 if (entry >= ah->caps.keycache_size) {
10 ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
11 @@ -1505,6 +1506,16 @@ bool ath9k_hw_keysetmac(struct ath_hw *a
12 }
13
14 if (mac != NULL) {
15 + /*
16 + * AR_KEYTABLE_VALID indicates that the address is a unicast
17 + * address, which must match the transmitter address for
18 + * decrypting frames.
19 + * Not setting this bit allows the hardware to use the key
20 + * for multicast frame decryption.
21 + */
22 + if (mac[0] & 0x01)
23 + unicast_flag = 0;
24 +
25 macHi = (mac[5] << 8) | mac[4];
26 macLo = (mac[3] << 24) |
27 (mac[2] << 16) |
28 @@ -1517,7 +1528,7 @@ bool ath9k_hw_keysetmac(struct ath_hw *a
29 macLo = macHi = 0;
30 }
31 REG_WRITE(ah, AR_KEYTABLE_MAC0(entry), macLo);
32 - REG_WRITE(ah, AR_KEYTABLE_MAC1(entry), macHi | AR_KEYTABLE_VALID);
33 + REG_WRITE(ah, AR_KEYTABLE_MAC1(entry), macHi | unicast_flag);
34
35 return true;
36 }
This page took 0.043602 seconds and 3 git commands to generate.