aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2011-02-07 16:44:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-02-09 16:09:48 -0500
commit59bdf3b0fe7a183f18ce94696259c4c76abb4568 (patch)
treef78a9a59703b0e68156f2fce509b7c9e3a80ae70 /net/mac80211
parent603b3eefb92e0886ed4dd5f73d4c07b304405b40 (diff)
mac80211: Ensure power-level set properly for scanning.
My previous patch to optimize scanning on operating channel accidentally removed the code that would ensure power was set to maximum for scanning. This patch re-adds that functionality. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/main.c3
-rw-r--r--net/mac80211/scan.c9
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);