From 5bcbf3aa777f298ceb5d1865e1f5d660bb2bfb87 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 8 Oct 2026 09:03:27 +0200 Subject: [PATCH] wifi-scripts: pass the SRG spatial reuse settings to hostapd The Spatial Reuse Parameter Set takes SRG OBSS PD offsets and the SRG BSS colour and partial BSSID bitmaps (IEEE Std 802.11-2024 9.4.2.251), and hostapd reads them as he_spr_srg_obss_pd_min_offset, he_spr_srg_obss_pd_max_offset, he_spr_srg_bss_colors and he_spr_srg_partial_bssid. The schema had none of them, so a radio could not run with SRG information. Add the four options. Either offset sets SR Control bit 3 (SRG Information Present). The non-SRG offset now sets bit 2 by its presence: an offset of 0 is a valid offset, and before it left the field out of the element. Signed-off-by: Felix Fietkau --- .../share/schema/wireless.wifi-device.json | 22 +++++++++++++++++++ .../usr/share/ucode/wifi/hostapd.uc | 13 +++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json index f6dac167aa2..99946c9f64f 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json @@ -334,6 +334,28 @@ "type": "number", "default": 3 }, + "he_spr_srg_bss_colors": { + "description": "BSS colors (0-63) of the Spatial Reuse Group", + "type": "array", + "items": { + "type": "number" + } + }, + "he_spr_srg_obss_pd_max_offset": { + "description": "SRG OBSS PD Max Offset", + "type": "number" + }, + "he_spr_srg_obss_pd_min_offset": { + "description": "SRG OBSS PD Min Offset", + "type": "number" + }, + "he_spr_srg_partial_bssid": { + "description": "Partial BSSID values (0-63) of the Spatial Reuse Group", + "type": "array", + "items": { + "type": "number" + } + }, "he_su_beamformee": { "description": "", "type": "boolean", 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 10f5a99922f..b1cb26c61f4 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 @@ -406,11 +406,20 @@ function device_htmode_append(config) { } if (config.he_bss_color_enabled) { - if (config.he_spr_non_srg_obss_pd_max_offset) + /* An offset of 0 is a valid offset, so the presence of the + * option sets the Present bit, and not its value. */ + if (config.he_spr_non_srg_obss_pd_max_offset != null) config.he_spr_sr_control |= 1 << 2; + if (config.he_spr_srg_obss_pd_min_offset != null || + config.he_spr_srg_obss_pd_max_offset != null) + config.he_spr_sr_control |= 1 << 3; if (!config.he_spr_psr_enabled) config.he_spr_sr_control |= 1; - append_vars(config, [ 'he_bss_color', 'he_spr_non_srg_obss_pd_max_offset', 'he_spr_sr_control' ]); + append_vars(config, [ + 'he_bss_color', 'he_spr_non_srg_obss_pd_max_offset', 'he_spr_sr_control', + 'he_spr_srg_obss_pd_min_offset', 'he_spr_srg_obss_pd_max_offset', + 'he_spr_srg_bss_colors', 'he_spr_srg_partial_bssid' + ]); } if (!(he_phy_cap[3] & 0x80))