aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-sta.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-03-30 13:11:46 -0400
committerReinette Chatre <reinette.chatre@intel.com>2010-04-09 14:27:31 -0400
commit335348b1702cf78c9e79987a3d66e85a05c98b5c (patch)
tree92cb89d0b0da052129346aac9c22fbbe22dff633 /drivers/net/wireless/iwlwifi/iwl-sta.c
parent678b385d07835c6c21371c12eaaa3fba4de05168 (diff)
iwlwifi: make WEP key restoring explicit
The firmware clears default WEP keys on transitions to !associated, so we need to restore them just like stations. This is rather implicit as part of sending a station right now, which is odd. Make it explicit instead and only for agn since 3945 doesn't use hw crypto for WEP. Due to that, iwl_send_static_wepkey_cmd is now only used in iwl-sta.c and can be static. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-sta.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index e34ac0355c75..be3d222d8f2b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -759,7 +759,7 @@ int iwl_get_free_ucode_key_index(struct iwl_priv *priv)
759} 759}
760EXPORT_SYMBOL(iwl_get_free_ucode_key_index); 760EXPORT_SYMBOL(iwl_get_free_ucode_key_index);
761 761
762int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty) 762static int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty)
763{ 763{
764 int i, not_empty = 0; 764 int i, not_empty = 0;
765 u8 buff[sizeof(struct iwl_wep_cmd) + 765 u8 buff[sizeof(struct iwl_wep_cmd) +
@@ -803,7 +803,14 @@ int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty)
803 else 803 else
804 return 0; 804 return 0;
805} 805}
806EXPORT_SYMBOL(iwl_send_static_wepkey_cmd); 806
807int iwl_restore_default_wep_keys(struct iwl_priv *priv)
808{
809 WARN_ON(!mutex_is_locked(&priv->mutex));
810
811 return iwl_send_static_wepkey_cmd(priv, 0);
812}
813EXPORT_SYMBOL(iwl_restore_default_wep_keys);
807 814
808int iwl_remove_default_wep_key(struct iwl_priv *priv, 815int iwl_remove_default_wep_key(struct iwl_priv *priv,
809 struct ieee80211_key_conf *keyconf) 816 struct ieee80211_key_conf *keyconf)
@@ -819,7 +826,6 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv,
819 IWL_ERR(priv, "index %d not used in uCode key table.\n", 826 IWL_ERR(priv, "index %d not used in uCode key table.\n",
820 keyconf->keyidx); 827 keyconf->keyidx);
821 828
822 priv->default_wep_key--;
823 memset(&priv->wep_keys[keyconf->keyidx], 0, sizeof(priv->wep_keys[0])); 829 memset(&priv->wep_keys[keyconf->keyidx], 0, sizeof(priv->wep_keys[0]));
824 if (iwl_is_rfkill(priv)) { 830 if (iwl_is_rfkill(priv)) {
825 IWL_DEBUG_WEP(priv, "Not sending REPLY_WEPKEY command due to RFKILL.\n"); 831 IWL_DEBUG_WEP(priv, "Not sending REPLY_WEPKEY command due to RFKILL.\n");
@@ -851,8 +857,6 @@ int iwl_set_default_wep_key(struct iwl_priv *priv,
851 keyconf->hw_key_idx = HW_KEY_DEFAULT; 857 keyconf->hw_key_idx = HW_KEY_DEFAULT;
852 priv->stations[IWL_AP_ID].keyinfo.alg = ALG_WEP; 858 priv->stations[IWL_AP_ID].keyinfo.alg = ALG_WEP;
853 859
854 priv->default_wep_key++;
855
856 if (test_and_set_bit(keyconf->keyidx, &priv->ucode_key_table)) 860 if (test_and_set_bit(keyconf->keyidx, &priv->ucode_key_table))
857 IWL_ERR(priv, "index %d already used in uCode key table.\n", 861 IWL_ERR(priv, "index %d already used in uCode key table.\n",
858 keyconf->keyidx); 862 keyconf->keyidx);