Commit 4f2e9d91 authored by Ben Greear's avatar Ben Greear Committed by John W. Linville

mac80211: Allow scanning on existing channel-type.

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: default avatarBen Greear <greearb@candelatech.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4d51e149
...@@ -112,6 +112,12 @@ bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local) ...@@ -112,6 +112,12 @@ bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local)
/* This logic needs to match logic in ieee80211_hw_config */ /* This logic needs to match logic in ieee80211_hw_config */
if (local->scan_channel) { if (local->scan_channel) {
chan = local->scan_channel; chan = local->scan_channel;
/* 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; channel_type = NL80211_CHAN_NO_HT;
} else if (local->tmp_channel) { } else if (local->tmp_channel) {
chan = scan_chan = local->tmp_channel; chan = scan_chan = local->tmp_channel;
...@@ -151,6 +157,12 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed) ...@@ -151,6 +157,12 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL; offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
if (scan_chan) { if (scan_chan) {
chan = scan_chan; chan = scan_chan;
/* 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; channel_type = NL80211_CHAN_NO_HT;
} else if (local->tmp_channel) { } else if (local->tmp_channel) {
chan = scan_chan = local->tmp_channel; chan = scan_chan = local->tmp_channel;
......
...@@ -517,8 +517,7 @@ static void ieee80211_scan_state_decision(struct ieee80211_local *local, ...@@ -517,8 +517,7 @@ static void ieee80211_scan_state_decision(struct ieee80211_local *local,
if (ieee80211_cfg_on_oper_channel(local)) { if (ieee80211_cfg_on_oper_channel(local)) {
/* We're currently on operating channel. */ /* We're currently on operating channel. */
if ((next_chan == local->oper_channel) && if (next_chan == local->oper_channel)
(local->_oper_channel_type == NL80211_CHAN_NO_HT))
/* We don't need to move off of operating channel. */ /* We don't need to move off of operating channel. */
local->next_scan_state = SCAN_SET_CHANNEL; local->next_scan_state = SCAN_SET_CHANNEL;
else else
...@@ -620,8 +619,7 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local, ...@@ -620,8 +619,7 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
local->scan_channel = chan; local->scan_channel = chan;
/* Only call hw-config if we really need to change channels. */ /* Only call hw-config if we really need to change channels. */
if ((chan != local->hw.conf.channel) || if (chan != local->hw.conf.channel)
(local->hw.conf.channel_type != NL80211_CHAN_NO_HT))
if (ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL)) if (ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL))
skip = 1; skip = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment