linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Wunderlich <sw@simonwunderlich.de>
To: linux-wireless@vger.kernel.org
Cc: johannes@sipsolutions.net,
	Simon Wunderlich <sw@simonwunderlich.de>,
	Eliad Peller <eliad@wizery.com>
Subject: [PATCH] mac80211: allow scans on radar channels, unless there is CAC or CSA
Date: Tue, 18 Sep 2018 16:16:33 +0200	[thread overview]
Message-ID: <20180918141633.10282-1-sw@simonwunderlich.de> (raw)

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

             reply	other threads:[~2018-09-18 19:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18 14:16 Simon Wunderlich [this message]
2018-09-20  9:20 ` [PATCH] mac80211: allow scans on radar channels, unless there is CAC or CSA 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180918141633.10282-1-sw@simonwunderlich.de \
    --to=sw@simonwunderlich.de \
    --cc=eliad@wizery.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).