aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 0ccd1567f51f..e4fdfaa2b9b2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -43,7 +43,7 @@ int iwl_get_free_ucode_key_index(struct iwl_priv *priv)
43 int i; 43 int i;
44 44
45 for (i = 0; i < STA_KEY_MAX_NUM; i++) 45 for (i = 0; i < STA_KEY_MAX_NUM; i++)
46 if (test_and_set_bit(i, &priv->ucode_key_table)) 46 if (!test_and_set_bit(i, &priv->ucode_key_table))
47 return i; 47 return i;
48 48
49 return -1; 49 return -1;
@@ -243,6 +243,8 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv,
243 priv->stations[sta_id].keyinfo.alg = keyconf->alg; 243 priv->stations[sta_id].keyinfo.alg = keyconf->alg;
244 priv->stations[sta_id].keyinfo.conf = keyconf; 244 priv->stations[sta_id].keyinfo.conf = keyconf;
245 priv->stations[sta_id].keyinfo.keylen = 16; 245 priv->stations[sta_id].keyinfo.keylen = 16;
246 priv->stations[sta_id].sta.key.key_offset =
247 iwl_get_free_ucode_key_index(priv);
246 248
247 /* This copy is acutally not needed: we get the key with each TX */ 249 /* This copy is acutally not needed: we get the key with each TX */
248 memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16); 250 memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16);
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 745b462103bd..0eb4220f035f 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -6810,8 +6810,6 @@ static void iwl4965_mac_update_tkip_key(struct ieee80211_hw *hw,
6810 6810
6811 spin_lock_irqsave(&priv->sta_lock, flags); 6811 spin_lock_irqsave(&priv->sta_lock, flags);
6812 6812
6813 priv->stations[sta_id].sta.key.key_offset =
6814 iwl_get_free_ucode_key_index(priv);
6815 priv->stations[sta_id].sta.key.key_flags = key_flags; 6813 priv->stations[sta_id].sta.key.key_flags = key_flags;
6816 priv->stations[sta_id].sta.key.tkip_rx_tsc_byte2 = (u8) iv32; 6814 priv->stations[sta_id].sta.key.tkip_rx_tsc_byte2 = (u8) iv32;
6817 6815