[openwrt/openwrt] wifi-scripts: fix WiFi 6E discovery for 6GHz 320MHz operation
LEDE Commits
lede-commits at lists.infradead.org
Wed Jan 21 13:31:28 PST 2026
robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/f70c393d62eef704ea212bbabf02bb3444d4edd1
commit f70c393d62eef704ea212bbabf02bb3444d4edd1
Author: Ryan Chen <rchen14b at gmail.com>
AuthorDate: Sat Jan 17 20:51:14 2026 -0600
wifi-scripts: fix WiFi 6E discovery for 6GHz 320MHz operation
WiFi 6E (802.11ax) clients cannot discover 6GHz APs operating at
320MHz because the HE Operation element contains uninitialized
center frequency values.
For EHT320 mode, the code sets eht_oper_centr_freq_seg0_idx but not
the corresponding HE values. Later, the HE values are copied from
VHT values, but VHT is not used on 6GHz, leaving he_oper_chwidth
and he_oper_centr_freq_seg0_idx at 0. This causes WiFi 6E clients
to see incorrect channel width information, making the AP invisible
to them during scanning.
Fix this by:
1. Setting he_oper_chwidth to 3 (160MHz) for EHT320 mode
2. Computing he_oper_centr_freq_seg0_idx based on the 160MHz segment
that contains the primary channel
3. Preserving these pre-set values instead of overwriting them with
uninitialized VHT values
WiFi 7 clients continue to see 320MHz operation via the EHT Operation
element, while WiFi 6E clients can now discover and connect at 160MHz.
Signed-off-by: Ryan Chen <rchen14b at gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21588
Signed-off-by: Robert Marko <robimarko at gmail.com>
(cherry picked from commit a8bdb1e6d65adac21d2dc1b40cdbae1af2af4d15)
---
.../files-ucode/usr/share/ucode/wifi/hostapd.uc | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
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 33eaa0ee15..61570d76f2 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
@@ -283,6 +283,17 @@ function device_htmode_append(config) {
}
config.op_class = 137;
config.eht_oper_chwidth = 7;
+
+ /*
+ * Set HE operation values for 160MHz backward compatibility
+ * with WiFi 6E clients. Pick the 160MHz half that contains
+ * the primary channel.
+ */
+ config.he_oper_chwidth = 3;
+ if (config.channel < config.eht_oper_centr_freq_seg0_idx)
+ config.he_oper_centr_freq_seg0_idx = config.eht_oper_centr_freq_seg0_idx - 16;
+ else
+ config.he_oper_centr_freq_seg0_idx = config.eht_oper_centr_freq_seg0_idx + 16;
break;
case 'HE40':
@@ -383,8 +394,15 @@ function device_htmode_append(config) {
config.ieee80211ax = true;
if (config.hw_mode == 'a') {
- config.he_oper_chwidth = config.vht_oper_chwidth;
- config.he_oper_centr_freq_seg0_idx = config.vht_oper_centr_freq_seg0_idx;
+ /*
+ * Only set HE values from VHT if not already set.
+ * For 6GHz 320MHz, these are pre-set for 160MHz backward
+ * compatibility with WiFi 6E clients.
+ */
+ if (!config.he_oper_chwidth)
+ config.he_oper_chwidth = config.vht_oper_chwidth;
+ if (!config.he_oper_centr_freq_seg0_idx)
+ config.he_oper_centr_freq_seg0_idx = config.vht_oper_centr_freq_seg0_idx;
}
if (config.band == "6g") {
More information about the lede-commits
mailing list