From: greearb@candelatech.com
To: linux-wireless@vger.kernel.org
Cc: Ben Greear <greearb@candelatech.com>
Subject: [PATCH 7/7] mac80211: Ensure power-level set properly for scanning.
Date: Mon, 7 Feb 2011 13:44:38 -0800 [thread overview]
Message-ID: <1297115078-27773-7-git-send-email-greearb@candelatech.com> (raw)
In-Reply-To: <1297115078-27773-1-git-send-email-greearb@candelatech.com>
From: Ben Greear <greearb@candelatech.com>
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>
---
:100644 100644 86562ce... e7eb2cf... M net/mac80211/main.c
:100644 100644 1f277c9... ab8d2c6... M net/mac80211/scan.c
net/mac80211/main.c | 3 ++-
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 86562ce..e7eb2cf 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 1f277c9..ab8d2c6 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;
@@ -434,6 +438,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);
--
1.7.2.3
next prev parent reply other threads:[~2011-02-07 21:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-07 21:44 [PATCH 1/7] mac80211: Make STA disconnect messages warn instead of debug greearb
2011-02-07 21:44 ` [PATCH 2/7] ath9k: Print channel-type in chan-change dbg message greearb
2011-02-07 21:44 ` [PATCH 3/7] mac80211: Properly set work-item channel-type greearb
2011-02-14 10:21 ` Johannes Berg
2011-02-07 21:44 ` [PATCH 4/7] mac80211: Allow scanning on existing channel-type greearb
2011-02-07 21:44 ` [PATCH 5/7] mac80211: Allow work items to use existing channel type greearb
2011-02-07 21:44 ` [PATCH 6/7] ath9k: Add debug info for configuring power level greearb
2011-02-07 21:44 ` greearb [this message]
2011-02-08 14:04 ` [PATCH 1/7] mac80211: Make STA disconnect messages warn instead of debug Kalle Valo
2011-02-08 17:10 ` Ben Greear
2011-02-09 12:07 ` Kalle Valo
2011-02-09 14:26 ` Ben Greear
2011-02-14 10:21 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1297115078-27773-7-git-send-email-greearb@candelatech.com \
--to=greearb@candelatech.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).