aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index d902878faeed..df277e467b87 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1485,6 +1485,7 @@ EXPORT_SYMBOL(ath9k_hw_keyreset);
1485bool ath9k_hw_keysetmac(struct ath_hw *ah, u16 entry, const u8 *mac) 1485bool ath9k_hw_keysetmac(struct ath_hw *ah, u16 entry, const u8 *mac)
1486{ 1486{
1487 u32 macHi, macLo; 1487 u32 macHi, macLo;
1488 u32 unicast_flag = AR_KEYTABLE_VALID;
1488 1489
1489 if (entry >= ah->caps.keycache_size) { 1490 if (entry >= ah->caps.keycache_size) {
1490 ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, 1491 ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
@@ -1493,6 +1494,16 @@ bool ath9k_hw_keysetmac(struct ath_hw *ah, u16 entry, const u8 *mac)
1493 } 1494 }
1494 1495
1495 if (mac != NULL) { 1496 if (mac != NULL) {
1497 /*
1498 * AR_KEYTABLE_VALID indicates that the address is a unicast
1499 * address, which must match the transmitter address for
1500 * decrypting frames.
1501 * Not setting this bit allows the hardware to use the key
1502 * for multicast frame decryption.
1503 */
1504 if (mac[0] & 0x01)
1505 unicast_flag = 0;
1506
1496 macHi = (mac[5] << 8) | mac[4]; 1507 macHi = (mac[5] << 8) | mac[4];
1497 macLo = (mac[3] << 24) | 1508 macLo = (mac[3] << 24) |
1498 (mac[2] << 16) | 1509 (mac[2] << 16) |
@@ -1505,7 +1516,7 @@ bool ath9k_hw_keysetmac(struct ath_hw *ah, u16 entry, const u8 *mac)
1505 macLo = macHi = 0; 1516 macLo = macHi = 0;
1506 } 1517 }
1507 REG_WRITE(ah, AR_KEYTABLE_MAC0(entry), macLo); 1518 REG_WRITE(ah, AR_KEYTABLE_MAC0(entry), macLo);
1508 REG_WRITE(ah, AR_KEYTABLE_MAC1(entry), macHi | AR_KEYTABLE_VALID); 1519 REG_WRITE(ah, AR_KEYTABLE_MAC1(entry), macHi | unicast_flag);
1509 1520
1510 return true; 1521 return true;
1511} 1522}