]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
iwlwifi: remove wrong key use check
authorJohannes Berg <johannes.berg@intel.com>
Tue, 30 Mar 2010 09:43:05 +0000 (02:43 -0700)
committerReinette Chatre <reinette.chatre@intel.com>
Fri, 9 Apr 2010 18:27:41 +0000 (11:27 -0700)
Default WEP keys and regular keys are not allocated
from the same space in the firmware, so we shouldn't
use the same bits to indicate in use.

For default WEP keys, however, mac80211 won't allow
using the same key index twice, so the check is not
necessary at all -- add/remove are perfectly nested
due to those checks.

Other keys are allocated in the device in a global
array that only has a certain number of slots, so
for that we need to keep the allocation bitmap; but
the 802.11 key index isn't relevant there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
drivers/net/wireless/iwlwifi/iwl-sta.c

index be3d222d8f2baf6ecf95419df49da8a3e6d34cad..a43493f2abcfb62f7ada18619b224eb452e903a6 100644 (file)
@@ -822,10 +822,6 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv,
        IWL_DEBUG_WEP(priv, "Removing default WEP key: idx=%d\n",
                      keyconf->keyidx);
 
-       if (!test_and_clear_bit(keyconf->keyidx, &priv->ucode_key_table))
-               IWL_ERR(priv, "index %d not used in uCode key table.\n",
-                         keyconf->keyidx);
-
        memset(&priv->wep_keys[keyconf->keyidx], 0, sizeof(priv->wep_keys[0]));
        if (iwl_is_rfkill(priv)) {
                IWL_DEBUG_WEP(priv, "Not sending REPLY_WEPKEY command due to RFKILL.\n");
@@ -857,10 +853,6 @@ int iwl_set_default_wep_key(struct iwl_priv *priv,
        keyconf->hw_key_idx = HW_KEY_DEFAULT;
        priv->stations[IWL_AP_ID].keyinfo.alg = ALG_WEP;
 
-       if (test_and_set_bit(keyconf->keyidx, &priv->ucode_key_table))
-               IWL_ERR(priv, "index %d already used in uCode key table.\n",
-                         keyconf->keyidx);
-
        priv->wep_keys[keyconf->keyidx].key_size = keyconf->keylen;
        memcpy(&priv->wep_keys[keyconf->keyidx].key, &keyconf->key,
                                                        keyconf->keylen);