diff options
Diffstat (limited to 'drivers/net/wireless/iwmc3200wifi/cfg80211.c')
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/cfg80211.c | 12 |
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, | |||
271 | if (key_index == iwm->default_key) | 271 | if (key_index == iwm->default_key) |
272 | iwm->default_key = -1; | 272 | iwm->default_key = -1; |
273 | 273 | ||
274 | /* If the interface is down, we just cache this */ | ||
275 | if (!test_bit(IWM_STATUS_READY, &iwm->status)) | ||
276 | return 0; | ||
277 | |||
274 | return iwm_set_key(iwm, 1, key); | 278 | return iwm_set_key(iwm, 1, key); |
275 | } | 279 | } |
276 | 280 | ||
@@ -288,12 +292,16 @@ static int iwm_cfg80211_set_default_key(struct wiphy *wiphy, | |||
288 | return -EINVAL; | 292 | return -EINVAL; |
289 | } | 293 | } |
290 | 294 | ||
295 | iwm->default_key = key_index; | ||
296 | |||
297 | /* If the interface is down, we just cache this */ | ||
298 | if (!test_bit(IWM_STATUS_READY, &iwm->status)) | ||
299 | return 0; | ||
300 | |||
291 | ret = iwm_set_tx_key(iwm, key_index); | 301 | ret = iwm_set_tx_key(iwm, key_index); |
292 | if (ret < 0) | 302 | if (ret < 0) |
293 | return ret; | 303 | return ret; |
294 | 304 | ||
295 | iwm->default_key = key_index; | ||
296 | |||
297 | return iwm_reset_profile(iwm); | 305 | return iwm_reset_profile(iwm); |
298 | } | 306 | } |
299 | 307 | ||