wifi-scripts: add beacon_prot and spp_amsdu support
authorRany Hany <[email protected]>
Sat, 15 Nov 2025 15:32:31 +0000 (15:32 +0000)
committerHauke Mehrtens <[email protected]>
Sun, 30 Nov 2025 23:51:31 +0000 (00:51 +0100)
This adds support for beacon_prot and spp_amsdu in hostapd and
beacon_prot in wpa_supplicant (spp_amsdu is not relevant there).
Both options are disabled by default unless set in the config.

Signed-off-by: Rany Hany <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20793
Signed-off-by: Hauke Mehrtens <[email protected]>
package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-iface.json
package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc
package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc
package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh

index 3e66c6bb182cf3561257fcdb781c871ab8c4cad5..c246c8fa4fff91da1fb1f947596dbad1ca3b30df 100644 (file)
                "basic_rate": {
                        "type": "array"
                },
+               "beacon_prot": {
+                       "description": "Management frame protection for Beacon frames",
+                       "type": "boolean"
+               },
                "bss_load_update_period": {
                        "description": "BSS Load update period (in BUs)",
                        "type": "number",
                        "type": "boolean",
                        "default": false
                },
+               "spp_amsdu": {
+                       "description": "Signaling and Payload Protected A-MSDU",
+                       "type": "boolean"
+               },
                "ssid": {
                        "type": "string"
                },
index 4ec8e8f8159e1b74154e8b3e138546588d1a4661..e91f8e4ef9da7f4e906b234722eec5c7c146997c 100644 (file)
@@ -57,7 +57,7 @@ function iface_setup(config) {
                'disassoc_low_ack', 'skip_inactivity_poll', 'ignore_broadcast_ssid', 'uapsd_advertisement_enabled',
                'utf8_ssid', 'multi_ap', 'multi_ap_vlanid', 'multi_ap_profile', 'tdls_prohibit', 'bridge',
                'wds_sta', 'wds_bridge', 'snoop_iface', 'vendor_elements', 'nas_identifier', 'radius_acct_interim_interval',
-               'ocv', 'multicast_to_unicast', 'preamble', 'proxy_arp', 'per_sta_vif', 'mbo',
+               'ocv', 'beacon_prot', 'spp_amsdu', 'multicast_to_unicast', 'preamble', 'proxy_arp', 'per_sta_vif', 'mbo',
                'bss_transition', 'wnm_sleep_mode', 'wnm_sleep_mode_no_keys', 'qos_map_set', 'max_listen_int',
                'dtim_period', 'wmm_enabled', 'start_disabled', 'na_mcast_to_ucast',
        ]);
index f796ae99a79461be07aaf67d107dd01e0ade3635..6d65b5b248ddfae9470812ac7a9a6d5b9b87a0b7 100644 (file)
@@ -176,7 +176,7 @@ function setup_sta(data, config) {
        network_append_string_vars(config, [ 'ssid' ]);
        network_append_vars(config, [
                'rsn_overriding', 'scan_ssid', 'noscan', 'disabled', 'multi_ap_profile', 'multi_ap_backhaul_sta',
-               'ocv', 'key_mgmt', 'sae_pwe', 'psk', 'sae_password', 'pairwise', 'group', 'bssid',
+               'ocv', 'beacon_prot', 'key_mgmt', 'sae_pwe', 'psk', 'sae_password', 'pairwise', 'group', 'bssid',
                'proto', 'mesh_fwding', 'mesh_rssi_threshold', 'frequency', 'fixed_freq',
                'disable_ht', 'disable_ht40', 'disable_vht', 'vht', 'max_oper_chwidth',
                'ht40', 'beacon_int', 'ieee80211w', 'basic_rate', 'mcast_rate',
index b0061cf4c3d911ee90112948820643a981e7f844..81ebebbe2b74df6bd86ae1ba14fc25f7858c72b6 100644 (file)
@@ -401,6 +401,7 @@ hostapd_common_add_bss_config() {
        config_add_string fils_dhcp
 
        config_add_int ocv
+       config_add_boolean beacon_prot spp_amsdu
 
        config_add_boolean apup
        config_add_string apup_peer_ifname_prefix
@@ -562,7 +563,7 @@ hostapd_set_bss_options() {
                ppsk airtime_bss_weight airtime_bss_limit airtime_sta_weight \
                multicast_to_unicast_all proxy_arp per_sta_vif na_mcast_to_ucast \
                eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id radius_server_clients radius_server_auth_port \
-               vendor_elements fils ocv apup rsn_override
+               vendor_elements fils ocv beacon_prot spp_amsdu apup rsn_override
 
        set_default rsn_override 1
        set_default fils 0
@@ -634,6 +635,8 @@ hostapd_set_bss_options() {
        json_for_each_item append_radius_acct_req_attr radius_acct_req_attr
 
        [ -n "$ocv" ] && append bss_conf "ocv=$ocv" "$N"
+       [ -n "$beacon_prot" ] && append bss_conf "beacon_prot=$beacon_prot" "$N"
+       [ -n "$spp_amsdu" ] && append bss_conf "spp_amsdu=$spp_amsdu" "$N"
 
        case "$auth_type" in
                sae|owe|eap2|eap192)
@@ -1331,7 +1334,7 @@ wpa_supplicant_add_network() {
        json_get_vars \
                ssid bssid key rsn_override \
                mcast_rate \
-               ieee80211w ieee80211r fils ocv \
+               ieee80211w ieee80211r fils ocv beacon_prot \
                multi_ap \
                default_disabled
 
@@ -1389,6 +1392,7 @@ wpa_supplicant_add_network() {
        }
 
        [ -n "$ocv" ] && append network_data "ocv=$ocv" "$N$T"
+       [ -n "$beacon_prot" ] && append network_data "beacon_prot=$beacon_prot" "$N$T"
 
        rsn_overriding=0
        case "$htmode" in