From patchwork Thu Nov 9 15:04:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Escande X-Patchwork-Id: 1862122 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=mS8oV5l9; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=U1J7IfH2; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SR4yc05jvz1yQl for ; Fri, 10 Nov 2023 02:05:44 +1100 (AEDT) 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=si/Do7z24oJ9TwUaybupGYQ3tBia2alq6bsgm56JnXw=; b=mS8oV5l9kBCA5+ 5EbOJcf4AEa5ix4wA3LmC4UyCobYqttwjOBd2F9fYXROlzJIsLSO3agh4L2vqfkeYZvPdYeJdL6aZ R/sEQdMRSHHfY5z6V2mlcBZ6ara4EknvQQLj+sRGw44OG65sfuPwo2E3b7n/HapBEjCZPYhKqzPvO tLtxqtooivpkPuO/svk2ZL+G+ygv+YYSyq/Kpt2G+mxz6CI184V2qaCwkPt2Mx9TusXtSI6t+EGeI FRUpOp4mU9itIswC/1nCA+7EpAFYD9wp6WFT+DQaDEQ3/KlqVmX73dgymvQxhIg62KLfMYawbOyHE HI2eh6s7N6kWoLnPg8mA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r16aO-006XjN-0L; Thu, 09 Nov 2023 15:04:48 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r16aM-006Xj0-0K for hostap@lists.infradead.org; Thu, 09 Nov 2023 15:04:47 +0000 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-32f87b1c725so636131f8f.3 for ; Thu, 09 Nov 2023 07:04:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699542283; x=1700147083; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dPlsWxGIAPT/de0sFRgphn7X1RbvCJaTveeV64BrxAE=; b=U1J7IfH2wJtzRg616z0vQBZWcneNeWX9q1rF/SQpOxbyy59HnDuzSlkAbw+rKbino8 USb7i8PYj+9ee+D/yYtqChLwcXDmpDtko+XGCJAnAUxRU1vUF5blKS9FAmE3oX2+mhMS 3izAa4DZui2/KKdh9qheaMKaBbXK95c0qJSPGa9rTfC/FTxl7q4MyJ3AbcNZGqRbQ0RJ i0d5UXx9QZJ2IISwtoo4yBNJhnJ6QbvMJaU0EwlEsTimwZmN12z3amBHBlmEVki9HnPF 8603OO/5SU4ZoPuyecjAKS9s2XLslm6NbkHHAna0npjQbpqHrQ5I9c1WB+vPIVL1s21r 6eqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699542283; x=1700147083; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dPlsWxGIAPT/de0sFRgphn7X1RbvCJaTveeV64BrxAE=; b=j66MnVK2YIVDY/zBRS134XRi4N6lc6G1/fEu+yq1pAaNOYLJy+F0EJPra27WSSMFvy 6p6df6Hy56hKFGF7Veq3D3CAOFPTpHf3lrw2tA2eWPESp2Ho/FIZfKGOqjU57z+sUAHM 9qBTgT3D1R7ApRVd5UxuG0Kqo059pbWgsw3p2zNOiqEhQSDSReAWv+WfNS4qImTICI+b pWqRBtyM3pl3DhHv4QlCwM3sfKa2mTHPM8prqVwgDO0nLqYXxxqS/hw5cSIEB8N2E3ch THQLvIqQuf6Fm/IJrbZnbLdjbRPSiX8grvLTPYOD4hNu/uVtGfxU3wRZAsLHHgW4JHd1 lgOw== X-Gm-Message-State: AOJu0YycYncZtjifnnxMrLnwk9MvN3GPW4B8QOE+SKY18Ta/I5gN/Qyv qxo5XRd3WTF6NNuV64xKmEXvJgsMA4Q= X-Google-Smtp-Source: AGHT+IEBoXZVGqZFDadrZCx8OJFm9HxSgIYtFoAwdIOCQQPjNU1nXG7gmXLJ2/lFdpUc69UUf4q3dA== X-Received: by 2002:adf:fe4c:0:b0:32d:9a1b:5d80 with SMTP id m12-20020adffe4c000000b0032d9a1b5d80mr4390443wrs.35.1699542283131; Thu, 09 Nov 2023 07:04:43 -0800 (PST) Received: from syracuse.iliad.local (freebox.vlq16.iliad.fr. [213.36.7.13]) by smtp.gmail.com with ESMTPSA id d7-20020adffd87000000b0032fb7b4f191sm7497355wrr.91.2023.11.09.07.04.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 07:04:42 -0800 (PST) From: Nicolas Escande To: hostap@lists.infradead.org Cc: Nicolas Escande Subject: [PATCH] ACS: Add 320MHz support for 80211be Date: Thu, 9 Nov 2023 16:04:08 +0100 Message-ID: <20231109150408.3644508-1-nico.escande@gmail.com> X-Mailer: git-send-email 2.42.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231109_070446_161598_00274A4F X-CRM114-Status: GOOD ( 15.90 ) 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: This enables support for ACS in the 80211be/320MHZ. To do so we just: - add channel definitions for the 3 320MHZ blocks of the 6GHz band - handle CONF_OPER_CHWIDTH_320MHZ in the different cases - rest [...] 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 [2a00:1450:4864:20:0:0:0:435 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.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [nico.escande[at]gmail.com] -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 This enables support for ACS in the 80211be/320MHZ. To do so we just: - add channel definitions for the 3 320MHZ blocks of the 6GHz band - handle CONF_OPER_CHWIDTH_320MHZ in the different cases - restrict 320MHZ to 80211be only Signed-off-by: Nicolas Escande --- src/ap/acs.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/ap/acs.c b/src/ap/acs.c index fdc9c0d35..770a571a6 100644 --- a/src/ap/acs.c +++ b/src/ap/acs.c @@ -246,6 +246,7 @@ enum bw_type { ACS_BW40, ACS_BW80, ACS_BW160, + ACS_BW320, }; struct bw_item { @@ -287,10 +288,15 @@ static const struct bw_item bw_160[] = { { 6435, 6575, 111 }, { 6595, 6735, 143 }, { 6755, 6895, 175 }, { 6915, 7055, 207 }, { -1, -1, -1 } }; +static const struct bw_item bw_320[] = { + { 6115, 6415, 63 }, { 6435, 6735, 127 }, { 66755, 7055, 191 }, + { -1, -1, -1 } +}; static const struct bw_item *bw_desc[] = { [ACS_BW40] = bw_40, [ACS_BW80] = bw_80, [ACS_BW160] = bw_160, + [ACS_BW320] = bw_320, }; @@ -860,6 +866,18 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface, } } + if (mode->mode == HOSTAPD_MODE_IEEE80211A && + iface->conf->ieee80211be) { + if (hostapd_get_oper_chwidth(iface->conf) == + CONF_OPER_CHWIDTH_320MHZ && + !acs_usable_bw_chan(chan, ACS_BW320)) { + wpa_printf(MSG_DEBUG, + "ACS: Channel %d: not allowed as primary channel for 320 MHz bandwidth", + chan->chan); + continue; + } + } + factor = 0; if (acs_usable_chan(chan)) factor = chan->interference_factor; @@ -1035,7 +1053,8 @@ acs_find_ideal_chan(struct hostapd_iface *iface) iface->conf->secondary_channel) n_chans = 2; - if (iface->conf->ieee80211ac || iface->conf->ieee80211ax) { + if (iface->conf->ieee80211ac || iface->conf->ieee80211ax || + iface->conf->ieee80211be) { switch (hostapd_get_oper_chwidth(iface->conf)) { case CONF_OPER_CHWIDTH_80MHZ: n_chans = 4; @@ -1043,6 +1062,9 @@ acs_find_ideal_chan(struct hostapd_iface *iface) case CONF_OPER_CHWIDTH_160MHZ: n_chans = 8; break; + case CONF_OPER_CHWIDTH_320MHZ: + n_chans = 16; + break; default: break; } @@ -1126,11 +1148,14 @@ static void acs_adjust_center_freq(struct hostapd_iface *iface) case CONF_OPER_CHWIDTH_160MHZ: center = acs_get_bw_center_chan(iface->freq, ACS_BW160); break; + case CONF_OPER_CHWIDTH_320MHZ: + center = acs_get_bw_center_chan(iface->freq, ACS_BW320); + break; default: /* TODO: How can this be calculated? Adjust * acs_find_ideal_chan() */ wpa_printf(MSG_INFO, - "ACS: Only VHT20/40/80/160 is supported now"); + "ACS: Only VHT20/40/80/160/320 is supported now"); return; } @@ -1193,7 +1218,8 @@ static void acs_study(struct hostapd_iface *iface) iface->conf->punct_bitmap = ideal_chan->punct_bitmap; #endif /* CONFIG_IEEE80211BE */ - if (iface->conf->ieee80211ac || iface->conf->ieee80211ax) { + if (iface->conf->ieee80211ac || iface->conf->ieee80211ax || + iface->conf->ieee80211be) { acs_adjust_secondary(iface); acs_adjust_center_freq(iface); }