From nobody Sat May 03 15:39:13 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZqX5Y47zkz5vVf7; Sat, 03 May 2025 15:39:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZqX5Y29X9z3b8s; Sat, 03 May 2025 15:39:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1746286753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LJO+SQzYXFbKi1etGH/nMZYnm34z54sWXPiABXenZJ8=; b=tJCu4Aa2VGPTf8QaO4guoIMSknXvJTnN9KK1nrUa+nu/P66coEG7+7JpEcL/hCR6BWEiNV kpWAHqKFizQ/mFCgtyouWep4Sc0ZzgJKtksgG4Q8tYwsxRe9qywzVyHKdYvC+uIodZVFeU 7LqZ3gSgi9LzfqwhQOUo1I+UvSfNZsH9l+cu5badsEpoqIuXWYOEssnma3y4fxPSbtgDHB 5Tu4Rwt1LCmzX5Dxe3jgkCKBYZXeMXs0GvJxpz2hY9NrUyrlHMp/9SxwOmmFy0Yg8CrSCf kRaQW0N8nfH1foQi0WMbPSNtwoxNUitafnOgQOrMsIYMylVTzofoGYn6JP+1Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1746286753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LJO+SQzYXFbKi1etGH/nMZYnm34z54sWXPiABXenZJ8=; b=smgnWN/w3M5cXReuzee/LqbqKWiKScxzgSZXktpj/3/bXmiZG0nqhSq20xYxRxm6JK83Fk eWA0x170zUZJwYQBBNABIx1VIEb4/Ls18h+Sb3rPu3ug7KbSbCPqSU/XmzcuLICcFedIcx Kvh5WA5+/h7As+wTXQxBQEV2rr3DRNl5btjxBFbKs7hc27yhS1ob0xo4uDnsVFmd94Q+M8 dPyB0L1aK4Pf7bQOzAGeMjrOYQjv8UN/ct1l97DkfJ/K7pmsJjnRuK4YmzAf+ztrhwYV/g 5p5CWDnyURqr+XCemPOEYT2gGI3YrTQv0viQUDLnANtMclkTNtd1NDaFROuNwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1746286753; a=rsa-sha256; cv=none; b=LmbpMRi6a827o/F+N/+XDse7FT1QykVkkRZngBmPRj7CkfOLdbFUHhHTpkDW2I6OVD0qTe wRIeA9cVr7z+XGL2dmfIqJfoLSqqetE2OsrEir/Y+JevCRh9LVkAqoR4m9WfQ1sZAMPl91 QA6BwWfjh9BIDJhAJWBbb33XKe8jaOk4IwN0wYbUgjnhDH0WSZYBpIExHJQ6erYh2TEGLT kD01oXcEAl9Ysnk9jNH79EA7pP6b/slTXla0f9dSecxSPVK11MNTqE65YZwq0nTvYSfroQ QfZLScgitPrGkh9KG+KZ5zE9ufYf2ozievGkMRwRNxE3/xMwoznS6ZOO1tZV7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZqX5Y1Thqznxk; Sat, 03 May 2025 15:39:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 543FdDGl083080; Sat, 3 May 2025 15:39:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 543FdDxU083077; Sat, 3 May 2025 15:39:13 GMT (envelope-from git) Date: Sat, 3 May 2025 15:39:13 GMT Message-Id: <202505031539.543FdDxU083077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 363846a7e31b - main - net80211: fix VHT80/VHT160 transmit width checks List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 363846a7e31b013dc7ebccd8017578fe79ee5103 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=363846a7e31b013dc7ebccd8017578fe79ee5103 commit 363846a7e31b013dc7ebccd8017578fe79ee5103 Author: Adrian Chadd AuthorDate: 2025-05-01 04:09:52 +0000 Commit: Adrian Chadd CommitDate: 2025-05-03 15:38:25 +0000 net80211: fix VHT80/VHT160 transmit width checks I didn't double check to see if ni_chw had been updated to actually implement values other than 20/40. It's just implementing the HT channel width stuff during both association and upon receiving a HT TX channel width action frame. This meant the VHT80/VHT160 transmit width checks were never going to be true, as ni_chw is never set to VHT80 / VHT160. After checking the HT action frame and looking for VHT changes, I'm pretty sure there's nothing explicit about VHT width, as it's normally done via CCA (clear channel access) and/or RTS/CTS exchanges - each 20MHz subchannel is RTS/CTS'ed / will be checked and if they're busy, a narrower frame will be transmitted. So, change the VHT80 / VHT160 checks to only check if ni_chw is 20MHz. If it's 20MHz then a HT action frame has come out saying to TX at 20MHz, and we should obey it. Otherwise, do 80/160MHz as available. Differential Revision: https://reviews.freebsd.org/D50096 Reviewed by: bz --- sys/net80211/ieee80211_vht.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sys/net80211/ieee80211_vht.c b/sys/net80211/ieee80211_vht.c index 0df95d87d01a..eb4ea615da75 100644 --- a/sys/net80211/ieee80211_vht.c +++ b/sys/net80211/ieee80211_vht.c @@ -992,9 +992,15 @@ ieee80211_vht_check_tx_vht80(const struct ieee80211_node *ni) vap = ni->ni_vap; bss_chan = vap->iv_bss->ni_chan; + /* + * ni_chw represents 20MHz or 40MHz from the HT + * TX width action frame / HT channel negotiation. + * If a HT TX width action frame sets it to 20MHz + * then reject doing 80MHz. + */ return (IEEE80211_IS_CHAN_VHT80(bss_chan) && IEEE80211_IS_CHAN_VHT80(ni->ni_chan) && - (ni->ni_chw == IEEE80211_STA_RX_BW_80)); + (ni->ni_chw != IEEE80211_STA_RX_BW_20)); } /* @@ -1015,7 +1021,13 @@ ieee80211_vht_check_tx_vht160(const struct ieee80211_node *ni) vap = ni->ni_vap; bss_chan = vap->iv_bss->ni_chan; - if (ni->ni_chw != IEEE80211_STA_RX_BW_160) + /* + * ni_chw represents 20MHz or 40MHz from the HT + * TX width action frame / HT channel negotiation. + * If a HT TX width action frame sets it to 20MHz + * then reject doing 160MHz. + */ + if (ni->ni_chw == IEEE80211_STA_RX_BW_20) return (false); if (IEEE80211_IS_CHAN_VHT160(bss_chan) &&