[openwrt/openwrt] wifi-scripts: fix vht_oper_centr_freq_seg0_idx_map calculation

LEDE Commits lede-commits at lists.infradead.org
Tue Feb 18 23:13:36 PST 2025


blogic pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/7fd9340ec45dfb85c9d1eff5efe33b22af3d4ec7

commit 7fd9340ec45dfb85c9d1eff5efe33b22af3d4ec7
Author: Sean Khan <datapronix at protonmail.com>
AuthorDate: Mon Feb 17 16:35:32 2025 -0500

    wifi-scripts: fix vht_oper_centr_freq_seg0_idx_map calculation
    
    When selecting channels above 100 in VHT160+ modes the center
    frequency segment was incorrectly set to 50, causing the interface
    to not come up.
    
    Change logic to instead check if the channel is within ±28 channels
    of the intended center, which matches the actual 160+ MHz channel
    width specification for VHT160, HE160, and EHT160.
    
    Signed-off-by: Sean Khan <datapronix at protonmail.com>
    Link: https://github.com/openwrt/openwrt/pull/18013
    Signed-off-by: John Crispin <john at phrozen.org>
---
 .../config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc
index 0e3cfc5b90..01e29db8e2 100644
--- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc
+++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc
@@ -242,7 +242,7 @@ function device_htmode_append(config) {
 				[ 29, 15 ], [ 61, 47 ], [ 93, 79 ], [ 125, 111 ],
 				[ 157, 143 ], [ 189, 175 ], [ 221, 207 ]];
 		for (let k, v in vht_oper_centr_freq_seg0_idx_map)
-			if (v[0] <= config.channel) {
+			if (config.channel >= (v[0] - 28) && config.channel <= v[0]) {
 				config.vht_oper_centr_freq_seg0_idx = v[1];
 				break;
 			}




More information about the lede-commits mailing list