diff options
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 659ed07f28e3..fd6cc7348a4e 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -648,8 +648,8 @@ static int ath_keyset(struct ath_softc *sc, u16 keyix, | |||
648 | } | 648 | } |
649 | 649 | ||
650 | static int ath_setkey_tkip(struct ath_softc *sc, u16 keyix, const u8 *key, | 650 | static int ath_setkey_tkip(struct ath_softc *sc, u16 keyix, const u8 *key, |
651 | struct ath9k_keyval *hk, | 651 | struct ath9k_keyval *hk, const u8 *addr, |
652 | const u8 *addr) | 652 | bool authenticator) |
653 | { | 653 | { |
654 | const u8 *key_rxmic; | 654 | const u8 *key_rxmic; |
655 | const u8 *key_txmic; | 655 | const u8 *key_txmic; |
@@ -659,7 +659,13 @@ static int ath_setkey_tkip(struct ath_softc *sc, u16 keyix, const u8 *key, | |||
659 | 659 | ||
660 | if (addr == NULL) { | 660 | if (addr == NULL) { |
661 | /* Group key installation */ | 661 | /* Group key installation */ |
662 | memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic)); | 662 | if (authenticator) { |
663 | memcpy(hk->kv_mic, key_txmic, sizeof(hk->kv_mic)); | ||
664 | memcpy(hk->kv_txmic, key_txmic, sizeof(hk->kv_mic)); | ||
665 | } else { | ||
666 | memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic)); | ||
667 | memcpy(hk->kv_txmic, key_rxmic, sizeof(hk->kv_mic)); | ||
668 | } | ||
663 | return ath_keyset(sc, keyix, hk, addr); | 669 | return ath_keyset(sc, keyix, hk, addr); |
664 | } | 670 | } |
665 | if (!sc->splitmic) { | 671 | if (!sc->splitmic) { |
@@ -769,6 +775,7 @@ static int ath_reserve_key_cache_slot(struct ath_softc *sc) | |||
769 | } | 775 | } |
770 | 776 | ||
771 | static int ath_key_config(struct ath_softc *sc, | 777 | static int ath_key_config(struct ath_softc *sc, |
778 | struct ieee80211_vif *vif, | ||
772 | struct ieee80211_sta *sta, | 779 | struct ieee80211_sta *sta, |
773 | struct ieee80211_key_conf *key) | 780 | struct ieee80211_key_conf *key) |
774 | { | 781 | { |
@@ -828,7 +835,8 @@ static int ath_key_config(struct ath_softc *sc, | |||
828 | } | 835 | } |
829 | 836 | ||
830 | if (key->alg == ALG_TKIP) | 837 | if (key->alg == ALG_TKIP) |
831 | ret = ath_setkey_tkip(sc, idx, key->key, &hk, mac); | 838 | ret = ath_setkey_tkip(sc, idx, key->key, &hk, mac, |
839 | vif->type == NL80211_IFTYPE_AP); | ||
832 | else | 840 | else |
833 | ret = ath_keyset(sc, idx, &hk, mac); | 841 | ret = ath_keyset(sc, idx, &hk, mac); |
834 | 842 | ||
@@ -2481,7 +2489,7 @@ static int ath9k_set_key(struct ieee80211_hw *hw, | |||
2481 | 2489 | ||
2482 | switch (cmd) { | 2490 | switch (cmd) { |
2483 | case SET_KEY: | 2491 | case SET_KEY: |
2484 | ret = ath_key_config(sc, sta, key); | 2492 | ret = ath_key_config(sc, vif, sta, key); |
2485 | if (ret >= 0) { | 2493 | if (ret >= 0) { |
2486 | key->hw_key_idx = ret; | 2494 | key->hw_key_idx = ret; |
2487 | /* push IV and Michael MIC generation to stack */ | 2495 | /* push IV and Michael MIC generation to stack */ |