From patchwork Thu Sep 5 05:55:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Ye X-Patchwork-Id: 1981086 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=MXE/GIDy; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mediatek.com header.i=@mediatek.com header.a=rsa-sha256 header.s=dk header.b=j2LAFf0l; 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 4WzpXd07HGz1ygP for ; Thu, 5 Sep 2024 15:57:05 +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=FY6bOsjJWp2kMdqSwXYt2dLshT8iQpuQyOUdOIKhh60=; b=MXE/GIDyotzpe0 yzK8GfEidhyXj9BW6PZVSl+jt/VITJxQh8S7PABdUloCMTKHIiDbSFRFea89mrmqSh6t6yp5W28eF I1Jio1JAo04vQqf2dfa8770fZGI9lj4zcZY7iIOqlRhd1yEPfWERlqeFCx8IetYP3qC7qjp+VKD7M EcuqlB4ZFIABqw2TlaNqvqGzCCnDrgPPpoSXZvGN/gWc+xgqT+4irEu1RW6/VoLs8hOluHiXQKwC2 NkOfHpzdjOztozfTBoJQfD1vqOF18VLRTNHQb8o7TjZw6kaMyvy+os0zHhybLaRMjUC5E7f9Xg6bN XMkOHhD0E0FevEh6KxBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm5U4-000000076Pr-1Qw9; Thu, 05 Sep 2024 05:56:44 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm5U1-000000076Ow-2YFw for hostap@lists.infradead.org; Thu, 05 Sep 2024 05:56:43 +0000 X-UUID: 9d49d47e6b4b11efb3adad29d29602c1-20240904 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=oEJR+o/VbaxBgN/oXSoiSt9fA45PxqbaLUQtNVASwxA=; b=j2LAFf0ltNlvIUUrV5TwX/5Lq4ca196sQI8uKRAijLdsKa0AIcIEnIx499XGpuF2Ze6qo2NHlZZRM6z8GOoJfGgYHL/xS2Yj4KbZJ3UEDV0ZiJfCpy8nXBON6rndjhOB9DcT0KC6YokiK9vG+OuddWRVVuQdIGq188f0xOM/cYw=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.41,REQID:32b615e8-7307-4b47-a184-e9936226bdd6,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:6dc6a47,CLOUDID:2b5b3805-42cd-428b-a1e3-ab5b763cfa17,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES :1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_ULN,TF_CID_SPAM_SNR X-UUID: 9d49d47e6b4b11efb3adad29d29602c1-20240904 Received: from mtkmbs14n1.mediatek.inc [(172.21.101.75)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1022753061; Wed, 04 Sep 2024 22:56:37 -0700 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 5 Sep 2024 13:56:04 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 5 Sep 2024 13:56:04 +0800 From: Allen Ye To: Jouni Malinen CC: , Felix Fietkau , Evelyn Tsai , "Money . Wang" , "Shayne Chen" , Allen Ye Subject: [PATCH] hostapd: Fix length of bandwidth indication subelement Date: Thu, 5 Sep 2024 13:55:28 +0800 Message-ID: <20240905055530.26519-1-allen.ye@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--5.224800-8.000000 X-TMASE-MatchedRID: dHqkmzbglWZDeuA2fujoFV4SsF49N47Ah+w9Wz/xXDpcU0dNErOD+vlY oV6p/cSxy5X05u8Zm4KAMuqetGVetiVvu9chHp+mavP8b9lJtWr6C0ePs7A07YFInLyeDAoZLSn Anmk9BMygmt3Mxcj0/xXFSpRFtZdbH0piLA5buKm6i2jyM7+h6w== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--5.224800-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: C7709C20E0449315C6090189F14B6BDD8E97BFCB909AF863A92EC1CBBFA5CED32000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240904_225641_695565_68F7A5E0 X-CRM114-Status: GOOD ( 10.89 ) X-Spam-Score: -2.1 (--) 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: Shayne Chen The default length of the bandwidth indication subelement should be equal to the minimum size of ieee80211_bw_ind_element structure. Signed-off-by: Shayne Chen Signed-off-by: Allen Ye --- src/ap/ieee802_11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -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 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [216.200.240.184 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [216.200.240.184 listed in sa-accredit.habeas.com] -0.0 T_SCC_BODY_TEXT_LINE No description available. 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [216.200.240.184 listed in bl.score.senderscore.com] 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: Shayne Chen The default length of the bandwidth indication subelement should be equal to the minimum size of ieee80211_bw_ind_element structure. Signed-off-by: Shayne Chen Signed-off-by: Allen Ye --- src/ap/ieee802_11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 230fdb7b2..aeac546ff 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -7306,7 +7306,7 @@ static u8 * hostapd_eid_bw_indication(struct hostapd_data *hapd, u8 *eid, { u16 punct_bitmap = hostapd_get_punct_bitmap(hapd); struct ieee80211_bw_ind_element *bw_ind_elem; - size_t elen = 3; + size_t elen = 4; if (hapd->cs_freq_params.bandwidth <= 160 && !punct_bitmap) return eid; From patchwork Thu Sep 5 05:55:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Ye X-Patchwork-Id: 1981087 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=n1B/oz4U; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mediatek.com header.i=@mediatek.com header.a=rsa-sha256 header.s=dk header.b=diAUsdCN; 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 4WzpXd06ldz1yg7 for ; Thu, 5 Sep 2024 15:57:05 +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=TRnQwWpaJ232Nnoi8VAGuj+QSDqLpQlcqZbUFjnR4cM=; b=n1B/oz4UBjDdcE VafhJGZb2tUubQ+ye/8OEnJHROd0cZVgu2v2hPXALGnMLRh+TYVyEZFCaCMod1gQ8E0IxjG49Absw Jn54ONqI6+V6ueoLE5C0W/7YbYJpdqa0X6hzstulwCYSplE0JvzNW/bXZi/Ys9H3F7k4roAw0dG5z XVi1a8Xih7mcFzuV5fR/c0vYGjkjdfUxRKml34WwGu6RVSPfmUdtdg0YiNJnYf9hICW0nFMFlAG9X wLTbWDHLif6PaQ6d+qaJwotwvWJ1WLLVvagz+e75tK9n6d2pZ0mowhncD7S4x6R6n3vd/u859E2IW 9/PqjiOdHvZodOo7IVsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm5Tn-000000076Il-0jUY; Thu, 05 Sep 2024 05:56:27 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm5Tj-000000076GD-1NB8 for hostap@lists.infradead.org; Thu, 05 Sep 2024 05:56:24 +0000 X-UUID: 8fef6fb46b4b11efba0aef63c0775dbf-20240904 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=ySvm9WuT0eB8hlkGwh0D33k+IIx3DI5XgStxCimK/O0=; b=diAUsdCNrpUrb37w7cIbhOsMg57cjdSLUjhUPeW98LAhhLdkmHpNTUmku7JLpwElDyeVSmrxRx7xQZWd7YcS/VibfitO25t1ktKi4eEfDufx06EOcDfqqZNRCNBtmR68OcEIfkaAh++9EFKujOvgCMGziboX8WtmW2eyGDlScZc=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.41,REQID:e1bd7ced-0670-4348-ad28-93d4d5fbeb72,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:1,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:1 X-CID-META: VersionHash:6dc6a47,CLOUDID:df593805-42cd-428b-a1e3-ab5b763cfa17,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES :1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_ULN,TF_CID_SPAM_SNR X-UUID: 8fef6fb46b4b11efba0aef63c0775dbf-20240904 Received: from mtkmbs14n1.mediatek.inc [(172.21.101.75)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1086202909; Wed, 04 Sep 2024 22:56:15 -0700 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 5 Sep 2024 13:56:12 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 5 Sep 2024 13:56:12 +0800 From: Allen Ye To: Jouni Malinen CC: , Felix Fietkau , Evelyn Tsai , "Money . Wang" , "Allen Ye" Subject: [PATCH 2/3] hostapd: Move punct_bitmap into hostapd_freq_params Date: Thu, 5 Sep 2024 13:55:29 +0800 Message-ID: <20240905055530.26519-2-allen.ye@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20240905055530.26519-1-allen.ye@mediatek.com> References: <20240905055530.26519-1-allen.ye@mediatek.com> MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--9.018400-8.000000 X-TMASE-MatchedRID: W1Gv3YQwcksr7JS62M1xTLiMC5wdwKqd87zcVbwFno2mg3jaUxa3XjQ7 21gyGB/Y/pUg0ca/WV/ijpjet3oGSJCoy9iDotiwSHCU59h5KrFYN1akkye0qEPL6pqegFS6gRP Vy4A/OEbDQ8bgdhnmdBGANLLqeoDYcc8G9KynN+MWny127IX6IDcrNBn1oTp1rY9uF6odMlzD/y 2uTT9Sb1jpXqbP7E7MuGd8VeYUEEUNzLbygMeXAopaUeCa/DFo5YswxsjURa6safcFLFlU1MLVN xnf7kfV4vM1YF6AJbbCCfuIMF6xLcK21zBg2KlfviI7BBDiM2KGTOctQgsxNm8Gulg6do75+ftc P5QlXbFHnhN7bdfs+A== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--9.018400-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: B8B5147C42249430118962181691FFC9054B2CD09E4300F5CE7386ADAB3C17552000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240904_225623_411873_DDEA06FB X-CRM114-Status: GOOD ( 16.39 ) X-Spam-Score: -2.1 (--) 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: Move punct_bitmap into hostapd_freq_params to allow hostapd_data structure to access the new puncturing bitmap during a channel switch. Co-developed-by: Money Wang Signed-off-by: Allen Ye --- hostapd/ctrl_iface.c | 2 +- src/ap/ctrl_iface_ap.c | 12 + src/ap/hostapd.c | 12 ++- [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -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 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [216.200.240.185 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [216.200.240.185 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [216.200.240.185 listed in bl.score.senderscore.com] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines -0.0 T_SCC_BODY_TEXT_LINE No description available. 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 Move punct_bitmap into hostapd_freq_params to allow hostapd_data structure to access the new puncturing bitmap during a channel switch. Co-developed-by: Money Wang Signed-off-by: Allen Ye --- hostapd/ctrl_iface.c | 2 +- src/ap/ctrl_iface_ap.c | 12 +----------- src/ap/hostapd.c | 12 ++---------- src/common/hw_features_common.c | 1 + src/drivers/driver.h | 10 ++++++++-- src/drivers/driver_nl80211.c | 6 +++--- 6 files changed, 16 insertions(+), 27 deletions(-) diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index bae827caf..74c4ade20 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -2703,7 +2703,7 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface, } ret = hostapd_ctrl_check_freq_params(&settings.freq_params, - settings.punct_bitmap); + settings.freq_params.punct_bitmap); if (ret) { wpa_printf(MSG_INFO, "chanswitch: invalid frequency settings provided"); diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c index b93a5d215..25e989125 100644 --- a/src/ap/ctrl_iface_ap.c +++ b/src/ap/ctrl_iface_ap.c @@ -1127,20 +1127,11 @@ int hostapd_parse_csa_settings(const char *pos, } \ } while (0) -#define SET_CSA_SETTING_EXT(str) \ - do { \ - const char *pos2 = os_strstr(pos, " " #str "="); \ - if (pos2) { \ - pos2 += sizeof(" " #str "=") - 1; \ - settings->str = atoi(pos2); \ - } \ - } while (0) - SET_CSA_SETTING(center_freq1); SET_CSA_SETTING(center_freq2); SET_CSA_SETTING(bandwidth); SET_CSA_SETTING(sec_channel_offset); - SET_CSA_SETTING_EXT(punct_bitmap); + SET_CSA_SETTING(punct_bitmap); settings->freq_params.ht_enabled = !!os_strstr(pos, " ht"); settings->freq_params.vht_enabled = !!os_strstr(pos, " vht"); settings->freq_params.eht_enabled = !!os_strstr(pos, " eht"); @@ -1148,7 +1139,6 @@ int hostapd_parse_csa_settings(const char *pos, settings->freq_params.eht_enabled; settings->block_tx = !!os_strstr(pos, " blocktx"); #undef SET_CSA_SETTING -#undef SET_CSA_SETTING_EXT return 0; } diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index f97311587..38a45ef50 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -4382,6 +4382,8 @@ static int hostapd_change_config_freq(struct hostapd_data *hapd, hostapd_set_oper_centr_freq_seg0_idx(conf, seg0); hostapd_set_oper_centr_freq_seg1_idx(conf, seg1); + conf->punct_bitmap = params->punct_bitmap; + /* TODO: maybe call here hostapd_config_check here? */ return 0; @@ -4394,9 +4396,6 @@ static int hostapd_fill_csa_settings(struct hostapd_data *hapd, struct hostapd_iface *iface = hapd->iface; struct hostapd_freq_params old_freq; int ret; -#ifdef CONFIG_IEEE80211BE - u16 old_punct_bitmap; -#endif /* CONFIG_IEEE80211BE */ u8 chan, bandwidth; os_memset(&old_freq, 0, sizeof(old_freq)); @@ -4445,16 +4444,9 @@ static int hostapd_fill_csa_settings(struct hostapd_data *hapd, if (ret) return ret; -#ifdef CONFIG_IEEE80211BE - old_punct_bitmap = iface->conf->punct_bitmap; - iface->conf->punct_bitmap = settings->punct_bitmap; -#endif /* CONFIG_IEEE80211BE */ ret = hostapd_build_beacon_data(hapd, &settings->beacon_after); /* change back the configuration */ -#ifdef CONFIG_IEEE80211BE - iface->conf->punct_bitmap = old_punct_bitmap; -#endif /* CONFIG_IEEE80211BE */ hostapd_change_config_freq(iface->bss[0], iface->conf, &old_freq, NULL); diff --git a/src/common/hw_features_common.c b/src/common/hw_features_common.c index bffb44078..9ce5cb547 100644 --- a/src/common/hw_features_common.c +++ b/src/common/hw_features_common.c @@ -481,6 +481,7 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data, data->sec_channel_offset = sec_channel_offset; data->center_freq1 = freq + sec_channel_offset * 10; data->center_freq2 = 0; + data->punct_bitmap = punct_bitmap; if (oper_chwidth == CONF_OPER_CHWIDTH_80MHZ) data->bandwidth = 80; else if (oper_chwidth == CONF_OPER_CHWIDTH_160MHZ || diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 30cbbc568..fa36db3af 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -891,6 +891,14 @@ struct hostapd_freq_params { */ bool eht_enabled; + /** + * punct_bitmap - Preamble puncturing bitmap + * Each bit corresponds to a 20 MHz subchannel, the lowest bit for the + * channel with the lowest frequency. A bit set to 1 indicates that the + * subchannel is punctured, otherwise active. + */ + u16 punct_bitmap; + /** * link_id: If >=0 indicates the link of the AP MLD to configure */ @@ -2765,7 +2773,6 @@ struct beacon_data { * @beacon_after: Next beacon/probe resp/asooc resp info * @counter_offset_beacon: Offset to the count field in beacon's tail * @counter_offset_presp: Offset to the count field in probe resp. - * @punct_bitmap - Preamble puncturing bitmap * @link_id: Link ID to determine the link for MLD; -1 for non-MLD * @ubpr: Unsolicited broadcast Probe Response frame data */ @@ -2780,7 +2787,6 @@ struct csa_settings { u16 counter_offset_beacon[2]; u16 counter_offset_presp[2]; - u16 punct_bitmap; int link_id; struct unsol_bcast_probe_resp ubpr; diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index f1a25cccc..9f99384c1 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -11378,7 +11378,7 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings) settings->freq_params.bandwidth, settings->freq_params.center_freq1, settings->freq_params.center_freq2, - settings->punct_bitmap, + settings->freq_params.punct_bitmap, settings->link_id, settings->freq_params.ht_enabled ? " ht" : "", settings->freq_params.vht_enabled ? " vht" : "", @@ -11451,9 +11451,9 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings) (ret = nl80211_put_freq_params(msg, &settings->freq_params)) || (settings->block_tx && nla_put_flag(msg, NL80211_ATTR_CH_SWITCH_BLOCK_TX)) || - (settings->punct_bitmap && + (settings->freq_params.punct_bitmap && nla_put_u32(msg, NL80211_ATTR_PUNCT_BITMAP, - settings->punct_bitmap)) || + settings->freq_params.punct_bitmap)) || (settings->link_id != NL80211_DRV_LINK_ID_NA && nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, settings->link_id))) goto error; From patchwork Thu Sep 5 05:55:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Ye X-Patchwork-Id: 1981088 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=46/ERi5W; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mediatek.com header.i=@mediatek.com header.a=rsa-sha256 header.s=dk header.b=JSXlrtJg; 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 4WzpXm4VWLz1yg7 for ; Thu, 5 Sep 2024 15:57:12 +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=lZTeGqEpSt23alruziasajPWR1y6BhZ+pJPx+3oGKBM=; b=46/ERi5Ws/QFs2 Sp9+j2zqQpy3W6T564YxaWqQYQ1qf84ERe7AFw2T0ismkT+UlR+HcTCdHHEnCVOE3eZEnzEx+skur Wg4a7I3v6zNEENfcBR+3xKNCMTmt2KE1yDrBUmvvaJumofTQ7i7w0bupbgAkVKkiFFViu2BZNC17h kpKv7BJsq2c6a+3LUIGbuYf6aEKYtllS0gplsQjnBO/p1iKMNYtAZ9/GdUDr6mF0nHUFOLQywoumX PS4pZaoyUoIQet3+tQFl+MuCP9GkwSticgclZ0Kub1H4mFRoPAa6kbeaGo4p8+ZH7R9+8TcsB2Y5C ivH2ciN3pZ40AKvOQ9SA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm5UF-000000076VR-1YTm; Thu, 05 Sep 2024 05:56:55 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm5U9-000000076SG-3wZx for hostap@lists.infradead.org; Thu, 05 Sep 2024 05:56:52 +0000 X-UUID: a1a4a18e6b4b11efb3adad29d29602c1-20240904 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=f5USsd144PVzpu7PjQZn6mnIDEdd6kNl5iDVeZ2A0so=; b=JSXlrtJgwgksr3laJwGe1g46WFywOJrgOPseOEXnVYyf5NYfiPToz9XqL07D3XtF2ZdGf4GTMyYdfDiJ3+xm6R3nKy5nYg+CVJelMCsOAAHX5MZVLvKwkCn77lqtu6PWakiQFp6QK1okuPfqk0kc6RwWueg8BJgJC5jJzjZHOpE=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.41,REQID:afea8e89-ad90-46f1-bd50-47ec986b8c90,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:2,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:2 X-CID-META: VersionHash:6dc6a47,CLOUDID:b8a27abf-d7af-4351-93aa-42531abf0c7b,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES :1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULN X-UUID: a1a4a18e6b4b11efb3adad29d29602c1-20240904 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 721900750; Wed, 04 Sep 2024 22:56:45 -0700 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 5 Sep 2024 13:56:13 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 5 Sep 2024 13:56:13 +0800 From: Allen Ye To: Jouni Malinen CC: , Felix Fietkau , Evelyn Tsai , "Money . Wang" , "Allen Ye" Subject: [PATCH 3/3] hostapd: Fix wrong puncturing bitmap in bandwidth indication subelement Date: Thu, 5 Sep 2024 13:55:30 +0800 Message-ID: <20240905055530.26519-3-allen.ye@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20240905055530.26519-1-allen.ye@mediatek.com> References: <20240905055530.26519-1-allen.ye@mediatek.com> MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--5.799700-8.000000 X-TMASE-MatchedRID: 24o13rjD2huMWJBKyAKo0bIGMNfiwa5NUK80YYUAl4sXdhT0BAdFzlO4 BD7nLMxnThbvLLI8RvN4LHI6F5wnnFxxDx5qbkR9FEUknJ/kEl5q8/xv2Um1avoLR4+zsDTtIAm DJ33CtzxAbPJ+MdBkmHWh3gm/noMeXxnJ7mrP1BrJ/tnugoGWveimkbXjmqIC X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--5.799700-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: E8E54B151D10A0A132B6A8A0733391216B1AD9316D974BE4FB57D77F3E045A662000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240904_225650_062826_36DC13F9 X-CRM114-Status: GOOD ( 10.22 ) X-Spam-Score: -2.1 (--) 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: The bandwidth indication subelement should present the puncturing bitmap of channel switch request, but the bitmap returned by hostapd_get_punct_bitmap is the original one. Co-developed-by: Money Wang Signed-off-by: Allen Ye --- src/ap/ieee802_11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [216.200.240.184 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [216.200.240.184 listed in bl.score.senderscore.com] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [216.200.240.184 listed in sa-accredit.habeas.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -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 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 T_SCC_BODY_TEXT_LINE No description available. 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 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 The bandwidth indication subelement should present the puncturing bitmap of channel switch request, but the bitmap returned by hostapd_get_punct_bitmap is the original one. Co-developed-by: Money Wang Signed-off-by: Allen Ye --- src/ap/ieee802_11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index aeac546ff..ce7fe5f48 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -7304,7 +7304,7 @@ static u8 * hostapd_eid_wb_channel_switch(struct hostapd_data *hapd, u8 *eid, static u8 * hostapd_eid_bw_indication(struct hostapd_data *hapd, u8 *eid, u8 chan1, u8 chan2) { - u16 punct_bitmap = hostapd_get_punct_bitmap(hapd); + u16 punct_bitmap = hapd->cs_freq_params.punct_bitmap; struct ieee80211_bw_ind_element *bw_ind_elem; size_t elen = 4;