提交 ffd2778b 编写于 作者: F Felix Fietkau 提交者: John W. Linville

mac80211: fix driver offchannel notification when the channel does not change

When running in client mode and associating to an AP, the channel
change is usually performed with the offchannel flag still set.
However after the assoc is complete, the following channel change event
is suppressed because the run time channel is already set to the operating channel.
Fix this by sending channel change notifications to the driver even if
only the offchannel flag changes.
Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 4d7ede7f
...@@ -99,11 +99,13 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed) ...@@ -99,11 +99,13 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
int ret = 0; int ret = 0;
int power; int power;
enum nl80211_channel_type channel_type; enum nl80211_channel_type channel_type;
u32 offchannel_flag;
might_sleep(); might_sleep();
scan_chan = local->scan_channel; scan_chan = local->scan_channel;
offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
if (scan_chan) { if (scan_chan) {
chan = scan_chan; chan = scan_chan;
channel_type = NL80211_CHAN_NO_HT; channel_type = NL80211_CHAN_NO_HT;
...@@ -117,8 +119,9 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed) ...@@ -117,8 +119,9 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
channel_type = local->_oper_channel_type; channel_type = local->_oper_channel_type;
local->hw.conf.flags &= ~IEEE80211_CONF_OFFCHANNEL; local->hw.conf.flags &= ~IEEE80211_CONF_OFFCHANNEL;
} }
offchannel_flag ^= local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
if (chan != local->hw.conf.channel || if (offchannel_flag || chan != local->hw.conf.channel ||
channel_type != local->hw.conf.channel_type) { channel_type != local->hw.conf.channel_type) {
local->hw.conf.channel = chan; local->hw.conf.channel = chan;
local->hw.conf.channel_type = channel_type; local->hw.conf.channel_type = channel_type;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册