diff options
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r-- | net/mac80211/scan.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 0ea6adae3e06..842954509925 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -307,11 +307,15 @@ static void __ieee80211_scan_completed_finish(struct ieee80211_hw *hw, | |||
307 | mutex_lock(&local->mtx); | 307 | mutex_lock(&local->mtx); |
308 | on_oper_chan = ieee80211_cfg_on_oper_channel(local); | 308 | on_oper_chan = ieee80211_cfg_on_oper_channel(local); |
309 | 309 | ||
310 | WARN_ON(local->scanning & (SCAN_SW_SCANNING | SCAN_HW_SCANNING)); | ||
311 | |||
310 | if (was_hw_scan || !on_oper_chan) { | 312 | if (was_hw_scan || !on_oper_chan) { |
311 | if (WARN_ON(local->scan_channel)) | 313 | if (WARN_ON(local->scan_channel)) |
312 | local->scan_channel = NULL; | 314 | local->scan_channel = NULL; |
313 | ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); | 315 | ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); |
314 | } | 316 | } else |
317 | /* Set power back to normal operating levels. */ | ||
318 | ieee80211_hw_config(local, 0); | ||
315 | 319 | ||
316 | if (!was_hw_scan) { | 320 | if (!was_hw_scan) { |
317 | bool on_oper_chan2; | 321 | bool on_oper_chan2; |
@@ -377,6 +381,9 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local) | |||
377 | 381 | ||
378 | ieee80211_configure_filter(local); | 382 | ieee80211_configure_filter(local); |
379 | 383 | ||
384 | /* We need to set power level at maximum rate for scanning. */ | ||
385 | ieee80211_hw_config(local, 0); | ||
386 | |||
380 | ieee80211_queue_delayed_work(&local->hw, | 387 | ieee80211_queue_delayed_work(&local->hw, |
381 | &local->scan_work, | 388 | &local->scan_work, |
382 | IEEE80211_CHANNEL_TIME); | 389 | IEEE80211_CHANNEL_TIME); |
@@ -517,8 +524,7 @@ static void ieee80211_scan_state_decision(struct ieee80211_local *local, | |||
517 | 524 | ||
518 | if (ieee80211_cfg_on_oper_channel(local)) { | 525 | if (ieee80211_cfg_on_oper_channel(local)) { |
519 | /* We're currently on operating channel. */ | 526 | /* We're currently on operating channel. */ |
520 | if ((next_chan == local->oper_channel) && | 527 | if (next_chan == local->oper_channel) |
521 | (local->_oper_channel_type == NL80211_CHAN_NO_HT)) | ||
522 | /* We don't need to move off of operating channel. */ | 528 | /* We don't need to move off of operating channel. */ |
523 | local->next_scan_state = SCAN_SET_CHANNEL; | 529 | local->next_scan_state = SCAN_SET_CHANNEL; |
524 | else | 530 | else |
@@ -620,8 +626,7 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local, | |||
620 | local->scan_channel = chan; | 626 | local->scan_channel = chan; |
621 | 627 | ||
622 | /* Only call hw-config if we really need to change channels. */ | 628 | /* Only call hw-config if we really need to change channels. */ |
623 | if ((chan != local->hw.conf.channel) || | 629 | if (chan != local->hw.conf.channel) |
624 | (local->hw.conf.channel_type != NL80211_CHAN_NO_HT)) | ||
625 | if (ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL)) | 630 | if (ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL)) |
626 | skip = 1; | 631 | skip = 1; |
627 | 632 | ||