aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-sta.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2008-04-15 19:01:44 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-16 16:00:01 -0400
commit77bab6024c69de781464c6ad094db6996d996938 (patch)
tree0fde332619fb03b548aec9ed82ef4c7a56e9e28b /drivers/net/wireless/iwlwifi/iwl-sta.c
parent7e8c519ecbd44cbe017f1749eb1f0f87d86d6ea2 (diff)
iwlwifi: Fix TKIP update key and get_free_ucode_key
This patch fixes a bug in update_tkip_key: only one key needs to be allocated in uCode, every time it is updated, the old one will be overwritten Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-sta.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c4
1 files changed, 3 insertions, 1 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);