linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: allow scans on radar channels, unless there is CAC or CSA
@ 2018-09-18 14:16 Simon Wunderlich
  2018-09-20  9:20 ` Dan Carpenter
  2018-09-20  9:21 ` Johannes Berg
  0 siblings, 2 replies; 7+ messages in thread
From: Simon Wunderlich @ 2018-09-18 14:16 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, Simon Wunderlich, Eliad Peller

Operating on a DFS channel doesn't mean we can't leave it for a short
time - actually, some features like off-channel CAC work by leaving the
operation channel to check other channels for availability (although
off-channel CAC isn't implemented in mac80211). In our case, we want to
use mesh while doing background surveys on other channels from time to
time.

Therefore, we can enable scans while on DFS channels, unless there is
CAC going on (must be continuous) or a CSA is happening.

Reported-by: Mathias Kretschmer <mathias.kretschmer@fit.fraunhofer.de>
Cc: Eliad Peller <eliad@wizery.com>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/mac80211/scan.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 47d2ed570470..58a454515a5a 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -477,8 +477,11 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local,
 static bool ieee80211_can_scan(struct ieee80211_local *local,
 			       struct ieee80211_sub_if_data *sdata)
 {
-	if (ieee80211_is_radar_required(local))
-		return false;
+	if (sdata->wdev.cac_started)
+		return -EBUSY;
+
+	if (sdata->vif.csa_active)
+		return -EBUSY;
 
 	if (!list_empty(&local->roc_list))
 		return false;
@@ -550,7 +553,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
 
 	lockdep_assert_held(&local->mtx);
 
-	if (local->scan_req || ieee80211_is_radar_required(local))
+	if (local->scan_req)
 		return -EBUSY;
 
 	if (!ieee80211_can_scan(local, sdata)) {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-03-29 10:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-18 14:16 [PATCH] mac80211: allow scans on radar channels, unless there is CAC or CSA Simon Wunderlich
2018-09-20  9:20 ` Dan Carpenter
2018-09-20 13:30   ` Simon Wunderlich
2018-09-20 13:40     ` Dan Carpenter
2018-09-20  9:21 ` Johannes Berg
2018-09-20 10:27   ` Simon Wunderlich
2019-03-29 10:35     ` Johannes Berg

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