aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath9k/hw.c15
-rw-r--r--drivers/net/wireless/ath9k/hw.h2
-rw-r--r--drivers/net/wireless/ath9k/main.c2
-rw-r--r--drivers/net/wireless/ath9k/phy.h2
4 files changed, 8 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c
index 5672f43e58e2..c8929edfe9d6 100644
--- a/drivers/net/wireless/ath9k/hw.c
+++ b/drivers/net/wireless/ath9k/hw.c
@@ -2415,14 +2415,11 @@ bool ath9k_hw_keysetmac(struct ath_hw *ah, u16 entry, const u8 *mac)
2415 2415
2416bool ath9k_hw_set_keycache_entry(struct ath_hw *ah, u16 entry, 2416bool ath9k_hw_set_keycache_entry(struct ath_hw *ah, u16 entry,
2417 const struct ath9k_keyval *k, 2417 const struct ath9k_keyval *k,
2418 const u8 *mac, int xorKey) 2418 const u8 *mac)
2419{ 2419{
2420 const struct ath9k_hw_capabilities *pCap = &ah->caps; 2420 const struct ath9k_hw_capabilities *pCap = &ah->caps;
2421 u32 key0, key1, key2, key3, key4; 2421 u32 key0, key1, key2, key3, key4;
2422 u32 keyType; 2422 u32 keyType;
2423 u32 xorMask = xorKey ?
2424 (ATH9K_KEY_XOR << 24 | ATH9K_KEY_XOR << 16 | ATH9K_KEY_XOR << 8
2425 | ATH9K_KEY_XOR) : 0;
2426 2423
2427 if (entry >= pCap->keycache_size) { 2424 if (entry >= pCap->keycache_size) {
2428 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, 2425 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE,
@@ -2474,11 +2471,11 @@ bool ath9k_hw_set_keycache_entry(struct ath_hw *ah, u16 entry,
2474 return false; 2471 return false;
2475 } 2472 }
2476 2473
2477 key0 = get_unaligned_le32(k->kv_val + 0) ^ xorMask; 2474 key0 = get_unaligned_le32(k->kv_val + 0);
2478 key1 = (get_unaligned_le16(k->kv_val + 4) ^ xorMask) & 0xffff; 2475 key1 = get_unaligned_le16(k->kv_val + 4);
2479 key2 = get_unaligned_le32(k->kv_val + 6) ^ xorMask; 2476 key2 = get_unaligned_le32(k->kv_val + 6);
2480 key3 = (get_unaligned_le16(k->kv_val + 10) ^ xorMask) & 0xffff; 2477 key3 = get_unaligned_le16(k->kv_val + 10);
2481 key4 = get_unaligned_le32(k->kv_val + 12) ^ xorMask; 2478 key4 = get_unaligned_le32(k->kv_val + 12);
2482 if (k->kv_len <= LEN_WEP104) 2479 if (k->kv_len <= LEN_WEP104)
2483 key4 &= 0xff; 2480 key4 &= 0xff;
2484 2481
diff --git a/drivers/net/wireless/ath9k/hw.h b/drivers/net/wireless/ath9k/hw.h
index 5ec416b3d7ec..89936a038da3 100644
--- a/drivers/net/wireless/ath9k/hw.h
+++ b/drivers/net/wireless/ath9k/hw.h
@@ -584,7 +584,7 @@ bool ath9k_hw_keyreset(struct ath_hw *ah, u16 entry);
584bool ath9k_hw_keysetmac(struct ath_hw *ah, u16 entry, const u8 *mac); 584bool ath9k_hw_keysetmac(struct ath_hw *ah, u16 entry, const u8 *mac);
585bool ath9k_hw_set_keycache_entry(struct ath_hw *ah, u16 entry, 585bool ath9k_hw_set_keycache_entry(struct ath_hw *ah, u16 entry,
586 const struct ath9k_keyval *k, 586 const struct ath9k_keyval *k,
587 const u8 *mac, int xorKey); 587 const u8 *mac);
588bool ath9k_hw_keyisvalid(struct ath_hw *ah, u16 entry); 588bool ath9k_hw_keyisvalid(struct ath_hw *ah, u16 entry);
589 589
590/* GPIO / RFKILL / Antennae */ 590/* GPIO / RFKILL / Antennae */
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index fd6cc7348a4e..28200ce1d88e 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -642,7 +642,7 @@ static int ath_keyset(struct ath_softc *sc, u16 keyix,
642 bool status; 642 bool status;
643 643
644 status = ath9k_hw_set_keycache_entry(sc->sc_ah, 644 status = ath9k_hw_set_keycache_entry(sc->sc_ah,
645 keyix, hk, mac, false); 645 keyix, hk, mac);
646 646
647 return status != false; 647 return status != false;
648} 648}
diff --git a/drivers/net/wireless/ath9k/phy.h b/drivers/net/wireless/ath9k/phy.h
index 3dbdd54be4e9..6222e32c7748 100644
--- a/drivers/net/wireless/ath9k/phy.h
+++ b/drivers/net/wireless/ath9k/phy.h
@@ -559,8 +559,6 @@ bool ath9k_hw_init_rf(struct ath_hw *ah,
559 } \ 559 } \
560 } while (0) 560 } while (0)
561 561
562#define ATH9K_KEY_XOR 0xaa
563
564#define ATH9K_IS_MIC_ENABLED(ah) \ 562#define ATH9K_IS_MIC_ENABLED(ah) \
565 ((ah)->sta_id1_defaults & AR_STA_ID1_CRPT_MIC_ENABLE) 563 ((ah)->sta_id1_defaults & AR_STA_ID1_CRPT_MIC_ENABLE)
566 564