From patchwork Thu Apr 21 23:02:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 1620500 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=rZP+YYfJ; 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=loxHRA2Z; 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 4KktQ873Gpz9sFN for ; Fri, 22 Apr 2022 09:04:00 +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=JWaTmSCb7wxiSIKbr2st6zMk4mVcBRKHiny64MvRk/Q=; b=rZP+YYfJ86qz+j Nju1oDw2w/7F978NemvLvsq3j/igqpO27hIQQlsKJziirJpNV1gUxOQ9URrr6+nxPlDtNjnVU/5uF PI+SmGVP8qTNIAl/WYUonA6rTghMxtrYp0OxcIQ5i7KXqcrFFlBHHVETkC7Rg+gA7K6LJNxe//YSp wI4seOBT46kemQTjwwO4bkFl6q7miXOyRMm5T6t7EdbE3YEbjOmVjoIy4Yy84A8DtnnLoDbNnRxGe UaCfKk9T446OyBMyj3+MSEirtqPYp90AaUEbvsZW5y2Bd9vnWWcEFc0bKymlqJVxe6FhXG8pFeeza XIyo9JTV1GQPnCiYEXUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhfp6-00FJzo-4m; Thu, 21 Apr 2022 23:02:52 +0000 Received: from dispatch1-us1.ppe-hosted.com ([67.231.154.164]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhfp1-00FJzJ-29 for hostap@lists.infradead.org; Thu, 21 Apr 2022 23:02:50 +0000 X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.110.51.174]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 0254520061 for ; Thu, 21 Apr 2022 23:02:43 +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 BC2ED7C007C for ; Thu, 21 Apr 2022 23:02:42 +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 2192913C2B0; Thu, 21 Apr 2022 16:02:42 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com 2192913C2B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1650582162; bh=i/Awlo6FQJhPaO8AQSurfCmnzrwA67G6mcPMVNpuzxQ=; h=From:To:Cc:Subject:Date:From; b=loxHRA2ZlfHpVxumoPlhG8yhUdTCr+NXncZl+WxougCrqSl2T47Z0gyMgxjH5ztQx 8izep5DUy7tyh9nS/uwI78gZq86p1rjJ2eWJsVYQ2mRT5Apn4YjlBSW8lX0ZkA0hY8 QOV01w/pAQGrN7OwOukVhc7nTQcKKX+fChDLxInI= From: greearb@candelatech.com To: hostap@lists.infradead.org Cc: Ben Greear Subject: [PATCH] hostapd: allow enabling background radar Date: Thu, 21 Apr 2022 16:02:39 -0700 Message-Id: <20220421230239.30025-1-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-MDID: 1650582163-PP6ultpFtuwD X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220421_160247_291324_D1840DDA X-CRM114-Status: GOOD ( 15.23 ) 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 This feature does not work on all radios that advertise this feature, and possibly some users don't want to use it even if it works fine, so disable it by default, but let users enable it as desired. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [67.231.154.164 listed in list.dnswl.org] -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 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 This feature does not work on all radios that advertise this feature, and possibly some users don't want to use it even if it works fine, so disable it by default, but let users enable it as desired. Signed-off-by: Ben Greear --- hostapd/config_file.c | 2 ++ hostapd/hostapd.conf | 8 ++++++++ src/ap/ap_config.c | 1 + src/ap/ap_config.h | 1 + src/ap/dfs.c | 3 ++- 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 81bfb6ef7..4f1655311 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, "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 fb2a3e83e..a118eba8b 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -225,6 +225,14 @@ channel=1 # Default behavior is to include all PSC and non-PSC channels. #acs_exclude_6ghz_non_psc=1 +# Enable background radar feature. Also requires that radio supports it +# before feature will actually be enabled. 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. +# 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.c b/src/ap/ap_config.c index f33a25a18..3c1e7bf26 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->enable_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..356327c85 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 enable_background_radar; enum { LONG_PREAMBLE = 0, SHORT_PREAMBLE = 1 diff --git a/src/ap/dfs.c b/src/ap/dfs.c index 2c92e1dd3..f3c84a33f 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->enable_background_radar; }