diff options
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/main.c | 3 | ||||
-rw-r--r-- | net/mac80211/scan.c | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 86562ce99221..e7eb2cfaf400 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -199,7 +199,8 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed) | |||
199 | changed |= IEEE80211_CONF_CHANGE_SMPS; | 199 | changed |= IEEE80211_CONF_CHANGE_SMPS; |
200 | } | 200 | } |
201 | 201 | ||
202 | if (scan_chan) | 202 | if ((local->scanning & SCAN_SW_SCANNING) || |
203 | (local->scanning & SCAN_HW_SCANNING)) | ||
203 | power = chan->max_power; | 204 | power = chan->max_power; |
204 | else | 205 | else |
205 | power = local->power_constr_level ? | 206 | power = local->power_constr_level ? |
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 0e70d7a160b4..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); |