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.kretsch...@fit.fraunhofer.de>
Cc: Eliad Peller <el...@wizery.com>
Signed-off-by: Simon Wunderlich <s...@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 via email to