Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Mar 2026 16:53:42 +0000
From:      Bjoern A. Zeeb <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 68fcf0b94c51 - stable/15 - net80211: fix VHT160/80P80/80 chanwidth selection in the "40-" case
Message-ID:  <69b19e16.44acb.13ff800e@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=68fcf0b94c5167f89481052f358064c9b6732553

commit 68fcf0b94c5167f89481052f358064c9b6732553
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2026-03-08 00:57:33 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-03-11 16:53:24 +0000

    net80211: fix VHT160/80P80/80 chanwidth selection in the "40-" case
    
    Depending on the base channel ni_vht_chan2 - ni_vht_chan1 can be
    negative.  Apply abs() as indicated in the comments right above
            | CCFS1 - CCFS0 | = 8  or > 16
    in order to fix the channel width selection.
    
    Sponsored by:   The FreeBSD Foundation
    PR:             293645
    Fixes:          4bf049bfeefd9
    Reviewed by:    adrian
    Differential Revision: https://reviews.freebsd.org/D55717
    
    (cherry picked from commit 6cfd2b93e68061c7831016b91c2e308d01658764)
---
 sys/net80211/ieee80211_ht.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c
index b3c9532764d9..508ddc7de920 100644
--- a/sys/net80211/ieee80211_ht.c
+++ b/sys/net80211/ieee80211_ht.c
@@ -34,6 +34,7 @@
 
 #include <sys/param.h>
 #include <sys/kernel.h>
+#include <sys/libkern.h>
 #include <sys/malloc.h>
 #include <sys/systm.h> 
 #include <sys/endian.h>
@@ -2036,11 +2037,11 @@ do {									\
 	}
 
 	/* CCFS1 > 0 and | CCFS1 - CCFS0 | = 8 */
-	if (ni->ni_vht_chan2 > 0 && (ni->ni_vht_chan2 - ni->ni_vht_chan1) == 8)
+	if (ni->ni_vht_chan2 > 0 && abs(ni->ni_vht_chan2 - ni->ni_vht_chan1) == 8)
 		can_vht160 = can_vht80 = true;
 
 	/* CCFS1 > 0 and | CCFS1 - CCFS0 | > 16 */
-	if (ni->ni_vht_chan2 > 0 && (ni->ni_vht_chan2 - ni->ni_vht_chan1) > 16)
+	if (ni->ni_vht_chan2 > 0 && abs(ni->ni_vht_chan2 - ni->ni_vht_chan1) > 16)
 		can_vht80p80 = can_vht80 = true;
 
 	/* CFFS1 == 0 */


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69b19e16.44acb.13ff800e>