| From c9205badb2f9bc385c3cdfe74ceae033fc3e4923 Mon Sep 17 00:00:00 2001 |
| From: dzou <dzou@company.com> |
| Date: Sun, 5 Jun 2022 23:23:40 +0800 |
| Subject: [PATCH 909/911] hostapd: Allow enabling background radar |
| |
| 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 | 2 ++ |
| hostapd/hostapd.conf | 10 ++++++++++ |
| src/ap/ap_config.h | 1 + |
| src/ap/dfs.c | 3 ++- |
| 4 files changed, 15 insertions(+), 1 deletion(-) |
| |
| diff --git a/hostapd/config_file.c b/hostapd/config_file.c |
| index 0d3554375..b423789b8 100644 |
| --- a/hostapd/config_file.c |
| +++ b/hostapd/config_file.c |
| @@ -3211,6 +3211,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); |
| |
| diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf |
| index 3c2019f73..f839ba708 100644 |
| --- a/hostapd/hostapd.conf |
| +++ b/hostapd/hostapd.conf |
| @@ -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 |
| diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h |
| index f3aff369f..8ed7c2aa1 100644 |
| --- a/src/ap/ap_config.h |
| +++ b/src/ap/ap_config.h |
| @@ -964,6 +964,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 |
| diff --git a/src/ap/dfs.c b/src/ap/dfs.c |
| index d63caaee3..48cd93507 100644 |
| --- a/src/ap/dfs.c |
| +++ b/src/ap/dfs.c |
| @@ -35,7 +35,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; |
| } |
| |
| |
| -- |
| 2.29.2 |
| |