wifi-scripts: failed to start hostapd if he_spr_psr_enabled is set
authorLix Zhou <xeontz@gmail.com>
Wed, 19 Feb 2025 05:22:12 +0000 (13:22 +0800)
committerJohn Crispin <john@phrozen.org>
Wed, 19 Feb 2025 07:07:52 +0000 (08:07 +0100)
he_spr_psr_enabled is appended to hostapd.conf if it's enabled, but hostapd
doesn't support this config, it should be used as an internal flag to control
the he_spr_sr_control configuring.

Signed-off-by: Lix Zhou <xeontz@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18025
Signed-off-by: John Crispin <john@phrozen.org>
package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh

index b4aa19bf526ec28b42235efb9a48d2d30fdf44b5..61813ab81bf2e3a8eaccf92eee9c2d4fdaded8f3 100755 (executable)
@@ -471,7 +471,6 @@ mac80211_hostapd_setup_base() {
                        he_su_beamformer:${he_phy_cap:6:2}:0x80:$he_su_beamformer \
                        he_su_beamformee:${he_phy_cap:8:2}:0x1:$he_su_beamformee \
                        he_mu_beamformer:${he_phy_cap:8:2}:0x2:$he_mu_beamformer \
-                       he_spr_psr_enabled:${he_phy_cap:14:2}:0x1:$he_spr_psr_enabled \
                        he_twt_required:${he_mac_cap:0:2}:0x6:$he_twt_required
 
                if [ "$he_bss_color_enabled" -gt 0 ]; then
@@ -480,6 +479,7 @@ mac80211_hostapd_setup_base() {
                                append base_cfg "he_spr_non_srg_obss_pd_max_offset=$he_spr_non_srg_obss_pd_max_offset" "$N"
                                he_spr_sr_control=$((he_spr_sr_control | (1 << 2)))
                        }
+                       [ "$he_spr_psr_enabled" -gt 0 ] && he_spr_psr_enabled=$((0x${he_phy_cap:14:2} & 0x1))
                        [ "$he_spr_psr_enabled" -gt 0 ] || he_spr_sr_control=$((he_spr_sr_control | (1 << 0)))
                        append base_cfg "he_spr_sr_control=$he_spr_sr_control" "$N"
                else