diff options
author | Ben Greear <greearb@candelatech.com> | 2011-02-08 00:44:38 +0300 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-02-10 00:09:48 +0300 |
commit | 59bdf3b0fe7a183f18ce94696259c4c76abb4568 (patch) | |
tree | f78a9a59703b0e68156f2fce509b7c9e3a80ae70 /net/mac80211 | |
parent | 603b3eefb92e0886ed4dd5f73d4c07b304405b40 (diff) | |
download | linux-59bdf3b0fe7a183f18ce94696259c4c76abb4568.tar.xz |
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.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) changed |= IEEE80211_CONF_CHANGE_SMPS; } - if (scan_chan) + if ((local->scanning & SCAN_SW_SCANNING) || + (local->scanning & SCAN_HW_SCANNING)) power = chan->max_power; else 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, mutex_lock(&local->mtx); on_oper_chan = ieee80211_cfg_on_oper_channel(local); + WARN_ON(local->scanning & (SCAN_SW_SCANNING | SCAN_HW_SCANNING)); + if (was_hw_scan || !on_oper_chan) { if (WARN_ON(local->scan_channel)) local->scan_channel = NULL; ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); - } + } else + /* Set power back to normal operating levels. */ + ieee80211_hw_config(local, 0); if (!was_hw_scan) { bool on_oper_chan2; @@ -377,6 +381,9 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local) ieee80211_configure_filter(local); + /* We need to set power level at maximum rate for scanning. */ + ieee80211_hw_config(local, 0); + ieee80211_queue_delayed_work(&local->hw, &local->scan_work, IEEE80211_CHANNEL_TIME); |