linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: fix driver offchannel notification when the channel does not change
@ 2010-07-29 15:36 Felix Fietkau
  0 siblings, 0 replies; only message in thread
From: Felix Fietkau @ 2010-07-29 15:36 UTC (permalink / raw)
  To: linux-wireless; +Cc: John W. Linville, Johannes Berg

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: Felix Fietkau <nbd@openwrt.org>
---
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -103,11 +103,13 @@ int ieee80211_hw_config(struct ieee80211
 	int ret = 0;
 	int power;
 	enum nl80211_channel_type channel_type;
+	u32 offchannel_flag;
 
 	might_sleep();
 
 	scan_chan = local->scan_channel;
 
+	offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
 	if (scan_chan) {
 		chan = scan_chan;
 		channel_type = NL80211_CHAN_NO_HT;
@@ -121,8 +123,9 @@ int ieee80211_hw_config(struct ieee80211
 		channel_type = local->_oper_channel_type;
 		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) {
 		local->hw.conf.channel = chan;
 		local->hw.conf.channel_type = channel_type;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-07-29 15:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-29 15:36 [PATCH] mac80211: fix driver offchannel notification when the channel does not change Felix Fietkau

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).