diff options
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/dvm/lib.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/dvm/lib.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/lib.c b/drivers/net/wireless/intel/iwlwifi/dvm/lib.c index 4841be2aa499..1799469268ea 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/lib.c +++ b/drivers/net/wireless/intel/iwlwifi/dvm/lib.c | |||
@@ -943,14 +943,16 @@ static void iwlagn_wowlan_program_keys(struct ieee80211_hw *hw, | |||
943 | switch (key->cipher) { | 943 | switch (key->cipher) { |
944 | case WLAN_CIPHER_SUITE_TKIP: | 944 | case WLAN_CIPHER_SUITE_TKIP: |
945 | if (sta) { | 945 | if (sta) { |
946 | u64 pn64; | ||
947 | |||
946 | tkip_sc = data->rsc_tsc->all_tsc_rsc.tkip.unicast_rsc; | 948 | tkip_sc = data->rsc_tsc->all_tsc_rsc.tkip.unicast_rsc; |
947 | tkip_tx_sc = &data->rsc_tsc->all_tsc_rsc.tkip.tsc; | 949 | tkip_tx_sc = &data->rsc_tsc->all_tsc_rsc.tkip.tsc; |
948 | 950 | ||
949 | rx_p1ks = data->tkip->rx_uni; | 951 | rx_p1ks = data->tkip->rx_uni; |
950 | 952 | ||
951 | ieee80211_get_key_tx_seq(key, &seq); | 953 | pn64 = atomic64_read(&key->tx_pn); |
952 | tkip_tx_sc->iv16 = cpu_to_le16(seq.tkip.iv16); | 954 | tkip_tx_sc->iv16 = cpu_to_le16(TKIP_PN_TO_IV16(pn64)); |
953 | tkip_tx_sc->iv32 = cpu_to_le32(seq.tkip.iv32); | 955 | tkip_tx_sc->iv32 = cpu_to_le32(TKIP_PN_TO_IV32(pn64)); |
954 | 956 | ||
955 | ieee80211_get_tkip_p1k_iv(key, seq.tkip.iv32, p1k); | 957 | ieee80211_get_tkip_p1k_iv(key, seq.tkip.iv32, p1k); |
956 | iwlagn_convert_p1k(p1k, data->tkip->tx.p1k); | 958 | iwlagn_convert_p1k(p1k, data->tkip->tx.p1k); |
@@ -996,19 +998,13 @@ static void iwlagn_wowlan_program_keys(struct ieee80211_hw *hw, | |||
996 | break; | 998 | break; |
997 | case WLAN_CIPHER_SUITE_CCMP: | 999 | case WLAN_CIPHER_SUITE_CCMP: |
998 | if (sta) { | 1000 | if (sta) { |
999 | u8 *pn = seq.ccmp.pn; | 1001 | u64 pn64; |
1000 | 1002 | ||
1001 | aes_sc = data->rsc_tsc->all_tsc_rsc.aes.unicast_rsc; | 1003 | aes_sc = data->rsc_tsc->all_tsc_rsc.aes.unicast_rsc; |
1002 | aes_tx_sc = &data->rsc_tsc->all_tsc_rsc.aes.tsc; | 1004 | aes_tx_sc = &data->rsc_tsc->all_tsc_rsc.aes.tsc; |
1003 | 1005 | ||
1004 | ieee80211_get_key_tx_seq(key, &seq); | 1006 | pn64 = atomic64_read(&key->tx_pn); |
1005 | aes_tx_sc->pn = cpu_to_le64( | 1007 | aes_tx_sc->pn = cpu_to_le64(pn64); |
1006 | (u64)pn[5] | | ||
1007 | ((u64)pn[4] << 8) | | ||
1008 | ((u64)pn[3] << 16) | | ||
1009 | ((u64)pn[2] << 24) | | ||
1010 | ((u64)pn[1] << 32) | | ||
1011 | ((u64)pn[0] << 40)); | ||
1012 | } else | 1008 | } else |
1013 | aes_sc = data->rsc_tsc->all_tsc_rsc.aes.multicast_rsc; | 1009 | aes_sc = data->rsc_tsc->all_tsc_rsc.aes.multicast_rsc; |
1014 | 1010 | ||