]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Allow enabling background radar
authorBen Greear <greearb@candelatech.com>
Thu, 21 Apr 2022 23:02:39 +0000 (16:02 -0700)
committerJouni Malinen <j@w1.fi>
Sat, 23 Apr 2022 20:38:58 +0000 (23:38 +0300)
This feature does not work on all radios that advertise this feature
with the current driver implementation, and possibly some users don't
want to use it even if it works fine, so disable it by default for now,
but let users enable it as desired with enable_background_radar=1.

Signed-off-by: Ben Greear <greearb@candelatech.com>
hostapd/config_file.c
hostapd/hostapd.conf
src/ap/ap_config.h
src/ap/dfs.c

index 7d1004fc92128fc08181c22a0c597add93d9af22..b1958e99a79bd93407af49adabf11644900c56e3 100644 (file)
@@ -3148,6 +3148,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                conf->acs_freq_list_present = 1;
        } else if (os_strcmp(buf, "acs_exclude_6ghz_non_psc") == 0) {
                conf->acs_exclude_6ghz_non_psc = atoi(pos);
+       } else if (os_strcmp(buf, "enable_background_radar") == 0) {
+               conf->enable_background_radar = atoi(pos);
        } else if (os_strcmp(buf, "min_tx_power") == 0) {
                int val = atoi(pos);
 
index 7fad30227c9560633b9e7d12554ca574d2c5ff6c..4efb73467c341b4b11ad8eae97fa61093056d731 100644 (file)
@@ -225,6 +225,16 @@ channel=1
 # Default behavior is to include all PSC and non-PSC channels.
 #acs_exclude_6ghz_non_psc=1
 
+# Enable background radar feature
+# This feature allows CAC to be run on dedicated radio RF chains while the
+# radio(s) are otherwise running normal AP activities on other channels.
+# This requires that the driver and the radio support it before feature will
+# actually be enabled, i.e., this parameter value is ignored with drivers that
+# do not advertise support for the capability.
+# 0: Leave disabled (default)
+# 1: Enable it.
+#enable_background_radar=1
+
 # Set minimum permitted max TX power (in dBm) for ACS and DFS channel selection.
 # (default 0, i.e., not constraint)
 #min_tx_power=20
index 7f44de4014f93ba406e6eb418b82b4441f116d9c..20fa863f30d0bd4ef4165ca406423d09e2f534bd 100644 (file)
@@ -969,6 +969,7 @@ struct hostapd_config {
        u8 min_tx_power;
        enum hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */
        int acs_exclude_6ghz_non_psc;
+       int enable_background_radar;
        enum {
                LONG_PREAMBLE = 0,
                SHORT_PREAMBLE = 1
index 53c705ffc5268ec6a7d1a1fdac1841b99c4bb7d8..ed9978b6e7f43ca5e9b59a5411319acb336ac386 100644 (file)
@@ -34,7 +34,8 @@ dfs_downgrade_bandwidth(struct hostapd_iface *iface, int *secondary_channel,
 
 static bool dfs_use_radar_background(struct hostapd_iface *iface)
 {
-       return iface->drv_flags2 & WPA_DRIVER_RADAR_BACKGROUND;
+       return (iface->drv_flags2 & WPA_DRIVER_RADAR_BACKGROUND) &&
+               iface->conf->enable_background_radar;
 }