44ef27d
From 682ba5a44516529b29fc780c055e06104d36e31e Mon Sep 17 00:00:00 2001
44ef27d
From: Eliad Peller <eliad@wizery.com>
44ef27d
Date: Thu, 20 Oct 2011 19:05:49 +0200
44ef27d
Subject: [PATCH] mac80211: fix remain_off_channel regression
44ef27d
44ef27d
The offchannel code is currently broken - we should
44ef27d
remain_off_channel if the work was started, and
44ef27d
the work's channel and channel_type are the same
44ef27d
as local->tmp_channel and local->tmp_channel_type.
44ef27d
44ef27d
However, if wk->chan_type and local->tmp_channel_type
44ef27d
coexist (e.g. have the same channel type), we won't
44ef27d
remain_off_channel.
44ef27d
44ef27d
This behavior was introduced by commit da2fd1f
44ef27d
("mac80211: Allow work items to use existing
44ef27d
channel type.")
44ef27d
44ef27d
Tested-by: Ben Greear <greearb@candelatech.com>
44ef27d
Signed-off-by: Eliad Peller <eliad@wizery.com>
44ef27d
Cc: stable@kernel.org # 2.6.39+
44ef27d
Signed-off-by: John W. Linville <linville@tuxdriver.com>
44ef27d
---
44ef27d
 net/mac80211/work.c |    4 ++--
44ef27d
 1 files changed, 2 insertions(+), 2 deletions(-)
44ef27d
44ef27d
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
44ef27d
index 94472eb..bf5be22 100644
44ef27d
--- a/net/mac80211/work.c
44ef27d
+++ b/net/mac80211/work.c
44ef27d
@@ -1084,8 +1084,8 @@ static void ieee80211_work_work(struct work_struct *work)
44ef27d
 			continue;
44ef27d
 		if (wk->chan != local->tmp_channel)
44ef27d
 			continue;
44ef27d
-		if (ieee80211_work_ct_coexists(wk->chan_type,
44ef27d
-					       local->tmp_channel_type))
44ef27d
+		if (!ieee80211_work_ct_coexists(wk->chan_type,
44ef27d
+						local->tmp_channel_type))
44ef27d
 			continue;
44ef27d
 		remain_off_channel = true;
44ef27d
 	}
44ef27d
-- 
44ef27d
1.7.6.2
44ef27d