diff options
Diffstat (limited to 'drivers/net/wireless/iwlegacy/common.c')
-rw-r--r-- | drivers/net/wireless/iwlegacy/common.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c index e5ac04739bcc..eaf249452e51 100644 --- a/drivers/net/wireless/iwlegacy/common.c +++ b/drivers/net/wireless/iwlegacy/common.c | |||
@@ -4508,6 +4508,7 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
4508 | { | 4508 | { |
4509 | struct il_priv *il = hw->priv; | 4509 | struct il_priv *il = hw->priv; |
4510 | int err; | 4510 | int err; |
4511 | bool reset; | ||
4511 | 4512 | ||
4512 | mutex_lock(&il->mutex); | 4513 | mutex_lock(&il->mutex); |
4513 | D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr); | 4514 | D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr); |
@@ -4518,7 +4519,12 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
4518 | goto out; | 4519 | goto out; |
4519 | } | 4520 | } |
4520 | 4521 | ||
4521 | if (il->vif) { | 4522 | /* |
4523 | * We do not support multiple virtual interfaces, but on hardware reset | ||
4524 | * we have to add the same interface again. | ||
4525 | */ | ||
4526 | reset = (il->vif == vif); | ||
4527 | if (il->vif && !reset) { | ||
4522 | err = -EOPNOTSUPP; | 4528 | err = -EOPNOTSUPP; |
4523 | goto out; | 4529 | goto out; |
4524 | } | 4530 | } |
@@ -4528,8 +4534,11 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
4528 | 4534 | ||
4529 | err = il_set_mode(il); | 4535 | err = il_set_mode(il); |
4530 | if (err) { | 4536 | if (err) { |
4531 | il->vif = NULL; | 4537 | IL_WARN("Fail to set mode %d\n", vif->type); |
4532 | il->iw_mode = NL80211_IFTYPE_STATION; | 4538 | if (!reset) { |
4539 | il->vif = NULL; | ||
4540 | il->iw_mode = NL80211_IFTYPE_STATION; | ||
4541 | } | ||
4533 | } | 4542 | } |
4534 | 4543 | ||
4535 | out: | 4544 | out: |
@@ -5279,9 +5288,9 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
5279 | D_MAC80211("BSSID %pM\n", bss_conf->bssid); | 5288 | D_MAC80211("BSSID %pM\n", bss_conf->bssid); |
5280 | 5289 | ||
5281 | /* | 5290 | /* |
5282 | * If there is currently a HW scan going on in the | 5291 | * If there is currently a HW scan going on in the background, |
5283 | * background then we need to cancel it else the RXON | 5292 | * then we need to cancel it, otherwise sometimes we are not |
5284 | * below/in post_associate will fail. | 5293 | * able to authenticate (FIXME: why ?) |
5285 | */ | 5294 | */ |
5286 | if (il_scan_cancel_timeout(il, 100)) { | 5295 | if (il_scan_cancel_timeout(il, 100)) { |
5287 | D_MAC80211("leave - scan abort failed\n"); | 5296 | D_MAC80211("leave - scan abort failed\n"); |
@@ -5290,14 +5299,10 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
5290 | } | 5299 | } |
5291 | 5300 | ||
5292 | /* mac80211 only sets assoc when in STATION mode */ | 5301 | /* mac80211 only sets assoc when in STATION mode */ |
5293 | if (vif->type == NL80211_IFTYPE_ADHOC || bss_conf->assoc) { | 5302 | memcpy(il->staging.bssid_addr, bss_conf->bssid, ETH_ALEN); |
5294 | memcpy(il->staging.bssid_addr, bss_conf->bssid, | ||
5295 | ETH_ALEN); | ||
5296 | 5303 | ||
5297 | /* currently needed in a few places */ | 5304 | /* FIXME: currently needed in a few places */ |
5298 | memcpy(il->bssid, bss_conf->bssid, ETH_ALEN); | 5305 | memcpy(il->bssid, bss_conf->bssid, ETH_ALEN); |
5299 | } else | ||
5300 | il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | ||
5301 | } | 5306 | } |
5302 | 5307 | ||
5303 | /* | 5308 | /* |