From patchwork Mon Apr 11 21:54:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 1615955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=McQE0CJC; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=candelatech.com header.i=@candelatech.com header.a=rsa-sha256 header.s=default header.b=bef8UfS8; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KcjMc03dfz9sCD for ; Tue, 12 Apr 2022 07:55:23 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=oKQ33pcH2dzhqrIqojAOP4CYbAJrrsYbM00Ufb3+l/8=; b=McQE0CJCQwBpTU ZXiPM4SbLdfVyAKb+0YDqgFJEESlDBtgynSOoX7KeIe/nDW6yICFid9mrJTLc1yQmV92OD35+lY9p NdCQmbbU4brKvBYck42WHEpPnC7Yc72vzX7x8u9OvbL0eerlAb1fW6yoacvupPK4YfuPW/C0Jm/qc S4C64Y7PhKgocjENZzBtPSq3E6snbKNWL3ZcRztLhG5SXknqU/Wtyh17hijmCJTVxDJAdfNxsP+vu fD+a58WlNyDs6+m0nXU13Nj2W6abvkGyKrSlVR0lQ/Lm5yYntbqKv788C41POG1N2kriFenZ5WstR /exHoHQ9iFRkJAgRJ6jg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ne1z8-00Ab1I-P3; Mon, 11 Apr 2022 21:54:10 +0000 Received: from dispatch1-us1.ppe-hosted.com ([148.163.129.52]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ne1z5-00Aazt-3G for hostap@lists.infradead.org; Mon, 11 Apr 2022 21:54:08 +0000 X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.7.66.137]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id B0FEA1C0081 for ; Mon, 11 Apr 2022 21:54:04 +0000 (UTC) Received: from mail3.candelatech.com (mail2.candelatech.com [208.74.158.173]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 8E65D140075 for ; Mon, 11 Apr 2022 21:54:04 +0000 (UTC) Received: from ben-dt4.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id 25ADC13C2B0; Mon, 11 Apr 2022 14:54:04 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com 25ADC13C2B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1649714044; bh=l9eCqIcwINlhZC2neCnhWWxHXOJ6r2mKq0eZH6pbOCQ=; h=From:To:Cc:Subject:Date:From; b=bef8UfS8kwWsZpbUz/h37GXwR26PIOIuRJgnfMCfQ1jF7aDyGP/1rvrkKiIgVP8cN GGh/MMUlQJErrrV+HBZO9KX+YmL71X5WyvhqvPfgCaDRo/rdFalLJUUv1Z18aicOus RAEZT8uKjj1Zb4UJ1heJhzZ/iPrHLLT1tS/TSthY= From: greearb@candelatech.com To: hostap@lists.infradead.org Cc: Ben Greear Subject: [PATCH] hostapd: allow disabling background radar Date: Mon, 11 Apr 2022 14:54:02 -0700 Message-Id: <20220411215402.31939-1-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-MDID: 1649714045-Rjmj-GkxF6wB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220411_145407_230112_B3A5C33C X-CRM114-Status: GOOD ( 13.12 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Ben Greear To work around buggy drivers and/or for any other user preference. Signed-off-by: Ben Greear --- hostapd/config_file.c | 2 ++ hostapd/hostapd.conf | 5 +++++ src/ap/ap_config.c | 1 + src/ap/ap_config.h | 1 + src/ap/dfs.c | 3 ++- 5 files chang [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [148.163.129.52 listed in wl.mailspike.net] X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Ben Greear To work around buggy drivers and/or for any other user preference. Signed-off-by: Ben Greear --- hostapd/config_file.c | 2 ++ hostapd/hostapd.conf | 5 +++++ src/ap/ap_config.c | 1 + src/ap/ap_config.h | 1 + src/ap/dfs.c | 3 ++- 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 81bfb6ef7..998529bcc 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -3210,6 +3210,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, "disable_background_radar") == 0) { + conf->disable_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 fb2a3e83e..07fc625cb 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -225,6 +225,11 @@ channel=1 # Default behavior is to include all PSC and non-PSC channels. #acs_exclude_6ghz_non_psc=1 +# Disable background radar feature, even if radio supports it. +# 0: Leave active (default) +# 1: Disable it. +#disable_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.c b/src/ap/ap_config.c index f33a25a18..3cae18626 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -250,6 +250,7 @@ struct hostapd_config * hostapd_config_defaults(void) conf->ap_table_max_size = 255; conf->ap_table_expiration_time = 60; conf->track_sta_max_age = 180; + conf->disable_background_radar = 0; #ifdef CONFIG_TESTING_OPTIONS conf->ignore_probe_probability = 0.0; diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index d1f387221..4ff0382c4 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -974,6 +974,7 @@ struct hostapd_config { u8 min_tx_power; enum hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */ int acs_exclude_6ghz_non_psc; + int disable_background_radar; enum { LONG_PREAMBLE = 0, SHORT_PREAMBLE = 1 diff --git a/src/ap/dfs.c b/src/ap/dfs.c index 2c92e1dd3..9384b0bca 100644 --- a/src/ap/dfs.c +++ b/src/ap/dfs.c @@ -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->disable_background_radar; }