From patchwork Wed Apr 10 13:32:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 1922004 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=Eq3B1q0D; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=MtsRVemh; 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 4VF3gM41FQz1yYB for ; Wed, 10 Apr 2024 23:33:17 +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:References:In-Reply-To: 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: List-Owner; bh=fdsxasL9chEYUc1QriCFYgftLoIZvpxypcUDDt00QBw=; b=Eq3B1q0DA24hmh VgU3Kqp4OtxPv9SaxZtGfGwRFLWVr5Z0yBoVMdrXJWKvYQvmMyt/a0KoAPxYUeIAouhdZyupEBbAS Sj4on28tZsco94hWBItjyQ3pqGOZt8Hee1zoQhZsXjWBdrYI/wp1MwKg2RnKJ1q/s3w6En2kyuU0p nAND1w8w3CoA3T5un6Ox7rf7+FSqSmDxW858KmHBnb7GzK4UUdhF2eBb2MiNTs8Y22kpGs34BRQSr gBBudhNaAgkE2jSaZHlGZav6i+EpvERPZF3jm5wGQ5vYN9tkXs0Whipz8OQVM+DpZfBTzShVQLvpH J+4HLtLn2xiFjvKgVKbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruY4O-00000007BRq-3P0d; Wed, 10 Apr 2024 13:32:56 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruY4J-00000007BOl-1D8o for hostap@lists.infradead.org; Wed, 10 Apr 2024 13:32:52 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id C453E61CBD; Wed, 10 Apr 2024 13:32:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBD26C43390; Wed, 10 Apr 2024 13:32:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712755970; bh=kEDFy/oj1nbdEQwpd1DvdMt0mj6eM9QtPM0/GJ9oMZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MtsRVemhKVzQSnJlW0AS5j876F9RzYYnzzpMCvCkT8w66zQzcS7LcMUFwCmhU1Syo F+zUU+IN3iFT+WFvm+wfZDG8IhN9yWeJF1WvnK90qAcPgspQor9iUp9denJDSw7nTb y7fwukd0bKhVzGuEfQAM0JqVOMOFN0CbR/o7ww45aeUtInL4Pmq+5g0r471mnxLnYV 7Vp1voFyiXWv56fp0yWqxP4c99r6izqrlv4F8L7/zWuJNBMfH1Ku1wTnroy70J3c7t ID6lMYqCKr4tgS6omihm7JIod+RYdoECM7+vPqSrL/iJ50HkZr68OCxecL9OfqgsOP dZcn7UgjfUpGQ== From: Lorenzo Bianconi To: hostap@lists.infradead.org Cc: j@w1.fi, lorenzo.bianconi83@gmail.com, ryder.lee@mediatek.com, evelyn.tsai@mediatek.com, nbd@nbd.name, allen.ye@mediatek.com Subject: [PATCH v4 2/4] hostapd: export hostapd_is_usable_chans utility routine Date: Wed, 10 Apr 2024 15:32:20 +0200 Message-ID: <41a1c05a7a573828cd05359379d4e0383a6ed82b.1712755468.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240410_063251_402531_75C4FEA5 X-CRM114-Status: GOOD ( 10.18 ) X-Spam-Score: -7.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 is a preliminary patch to introduce AFC support. Tested-by: Felix Fietkau Tested-by: Allen Ye Signed-off-by: Lorenzo Bianconi --- src/ap/hw_features.c | 2 +- src/ap/hw_features.h | 6 ++++++ [...] Content analysis details: (-7.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [139.178.84.217 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -2.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 is a preliminary patch to introduce AFC support. Tested-by: Felix Fietkau Tested-by: Allen Ye Signed-off-by: Lorenzo Bianconi --- src/ap/hw_features.c | 2 +- src/ap/hw_features.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index fd401d78a..e652d7504 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c @@ -995,7 +995,7 @@ static bool hostapd_is_usable_punct_bitmap(struct hostapd_iface *iface) * 0 = not usable * -1 = not currently usable due to 6 GHz NO-IR */ -static int hostapd_is_usable_chans(struct hostapd_iface *iface) +int hostapd_is_usable_chans(struct hostapd_iface *iface) { int secondary_freq; struct hostapd_channel_data *pri_chan; diff --git a/src/ap/hw_features.h b/src/ap/hw_features.h index c682c6d20..eeffb1abd 100644 --- a/src/ap/hw_features.h +++ b/src/ap/hw_features.h @@ -30,6 +30,7 @@ void hostapd_stop_setup_timers(struct hostapd_iface *iface); int hostapd_hw_skip_mode(struct hostapd_iface *iface, struct hostapd_hw_modes *mode); int hostapd_determine_mode(struct hostapd_iface *iface); +int hostapd_is_usable_chans(struct hostapd_iface *iface); #else /* NEED_AP_MLME */ static inline void hostapd_free_hw_features(struct hostapd_hw_modes *hw_features, @@ -103,6 +104,11 @@ static inline int hostapd_determine_mode(struct hostapd_iface *iface) return 0; } +static inline int hostapd_is_usable_chans(struct hostapd_iface *iface) +{ + return 1; +} + #endif /* NEED_AP_MLME */ #endif /* HW_FEATURES_H */