hostapd: introduce background_radar option
[openwrt/staging/ansuel.git] / package / kernel / mac80211 / files / lib / netifd / wireless / mac80211.sh
index 27eecf3a7f979f33c419bac6f112bd3fe11cbb81..3ffe6de66bd6cb1ee36170f54aeb9a1a4fb5ef29 100644 (file)
@@ -29,7 +29,7 @@ drv_mac80211_init_device_config() {
        config_add_string distance
        config_add_int beacon_int chanbw frag rts
        config_add_int rxantenna txantenna antenna_gain txpower
-       config_add_boolean noscan ht_coex acs_exclude_dfs
+       config_add_boolean noscan ht_coex acs_exclude_dfs background_radar
        config_add_array ht_capab
        config_add_array channels
        config_add_array scan_list
@@ -273,6 +273,11 @@ mac80211_hostapd_setup_base() {
                        vht_center_seg0=$idx
                ;;
        esac
+       [ "$band" = "5g" ] && {
+               json_get_vars background_radar:0
+
+               [ "$background_radar" -eq 1 ] && append base_cfg "enable_background_radar=1" "$N"
+       }
        [ "$band" = "6g" ] && {
                op_class=
                case "$htmode" in
@@ -419,12 +424,14 @@ mac80211_hostapd_setup_base() {
                he_mac_cap=${he_mac_cap:2}
 
                append base_cfg "ieee80211ax=1" "$N"
-               [ -n "$he_bss_color" ] && append base_cfg "he_bss_color=$he_bss_color" "$N"
                [ "$hwmode" = "a" ] && {
                        append base_cfg "he_oper_chwidth=$vht_oper_chwidth" "$N"
                        append base_cfg "he_oper_centr_freq_seg0_idx=$vht_center_seg0" "$N"
                }
 
+               set_default he_bss_color 128
+               append base_cfg "he_bss_color=$he_bss_color" "$N"
+
                mac80211_add_he_capabilities \
                        he_su_beamformer:${he_phy_cap:6:2}:0x80:$he_su_beamformer \
                        he_su_beamformee:${he_phy_cap:8:2}:0x1:$he_su_beamformee \