From: greearb@candelatech.com
To: linux-wireless@vger.kernel.org
Cc: Ben Greear <greearb@candelatech.com>
Subject: [PATCH 4/7] mac80211: Allow scanning on existing channel-type.
Date: Mon, 7 Feb 2011 13:44:35 -0800 [thread overview]
Message-ID: <1297115078-27773-4-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>
Previous code set the channel type to NO_HT, but it
appears that NO_HT packets can be sent on any channel
type, so we do not need to change the channel type
as long as the channel is correct.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 c155c0b... 86562ce... M net/mac80211/main.c
:100644 100644 93da164... 1f277c9... M net/mac80211/scan.c
net/mac80211/main.c | 16 ++++++++++++++--
net/mac80211/scan.c | 6 ++----
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index c155c0b..86562ce 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -112,7 +112,13 @@ bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local)
/* This logic needs to match logic in ieee80211_hw_config */
if (local->scan_channel) {
chan = local->scan_channel;
- channel_type = NL80211_CHAN_NO_HT;
+ /* If scanning on oper channel, use whatever channel-type
+ * is currently in use.
+ */
+ if (chan == local->oper_channel)
+ channel_type = local->_oper_channel_type;
+ else
+ channel_type = NL80211_CHAN_NO_HT;
} else if (local->tmp_channel) {
chan = scan_chan = local->tmp_channel;
channel_type = local->tmp_channel_type;
@@ -151,7 +157,13 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
if (scan_chan) {
chan = scan_chan;
- channel_type = NL80211_CHAN_NO_HT;
+ /* If scanning on oper channel, use whatever channel-type
+ * is currently in use.
+ */
+ if (chan == local->oper_channel)
+ channel_type = local->_oper_channel_type;
+ else
+ channel_type = NL80211_CHAN_NO_HT;
} else if (local->tmp_channel) {
chan = scan_chan = local->tmp_channel;
channel_type = local->tmp_channel_type;
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 93da164..1f277c9 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -574,8 +574,7 @@ static void ieee80211_scan_state_decision(struct ieee80211_local *local,
if (ieee80211_cfg_on_oper_channel(local)) {
/* We're currently on operating channel. */
- if ((next_chan == local->oper_channel) &&
- (local->_oper_channel_type == NL80211_CHAN_NO_HT))
+ if (next_chan == local->oper_channel)
/* We don't need to move off of operating channel. */
local->next_scan_state = SCAN_SET_CHANNEL;
else
@@ -677,8 +676,7 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
local->scan_channel = chan;
/* Only call hw-config if we really need to change channels. */
- if ((chan != local->hw.conf.channel) ||
- (local->hw.conf.channel_type != NL80211_CHAN_NO_HT))
+ if (chan != local->hw.conf.channel)
if (ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL))
skip = 1;
--
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 ` greearb [this message]
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 ` [PATCH 7/7] mac80211: Ensure power-level set properly for scanning greearb
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-4-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).