summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwmc3200wifi/cfg80211.c
diff options
context:
space:
mode:
authorSamuel Ortiz <samuel.ortiz@intel.com>2009-06-15 21:59:54 +0200
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 14:57:52 -0400
commit3549716484a95fd16f7fcf8b68699bd4c803b382 (patch)
treef1fd8ce07afec9562f178455a03aacf1faa43dc5 /drivers/net/wireless/iwmc3200wifi/cfg80211.c
parent191506ecbce03f09f6afa76f1af069574bf99bec (diff)
downloadblackbird-op-linux-3549716484a95fd16f7fcf8b68699bd4c803b382.tar.gz
blackbird-op-linux-3549716484a95fd16f7fcf8b68699bd4c803b382.zip
iwmc3200wifi: cache keys when interface is down
When the interface is down and one sets a WEP key from userspace, we should be able to simply cache it. Since that implies setting part of the profile's security settings, we now alloc/free the umac_profile at probe/remove time, and no longer at interface bring up/down time. Simply resetting it during the latter is enough. Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwmc3200wifi/cfg80211.c')
-rw-r--r--drivers/net/wireless/iwmc3200wifi/cfg80211.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/cfg80211.c b/drivers/net/wireless/iwmc3200wifi/cfg80211.c
index 739bd9b0ddea..0cdd7ef68b78 100644
--- a/drivers/net/wireless/iwmc3200wifi/cfg80211.c
+++ b/drivers/net/wireless/iwmc3200wifi/cfg80211.c
@@ -271,6 +271,10 @@ static int iwm_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev,
if (key_index == iwm->default_key)
iwm->default_key = -1;
+ /* If the interface is down, we just cache this */
+ if (!test_bit(IWM_STATUS_READY, &iwm->status))
+ return 0;
+
return iwm_set_key(iwm, 1, key);
}
@@ -288,12 +292,16 @@ static int iwm_cfg80211_set_default_key(struct wiphy *wiphy,
return -EINVAL;
}
+ iwm->default_key = key_index;
+
+ /* If the interface is down, we just cache this */
+ if (!test_bit(IWM_STATUS_READY, &iwm->status))
+ return 0;
+
ret = iwm_set_tx_key(iwm, key_index);
if (ret < 0)
return ret;
- iwm->default_key = key_index;
-
return iwm_reset_profile(iwm);
}
OpenPOWER on IntegriCloud