blob: a789d90a18551b6b9aad53c26a33fd16d35b35fe [file] [log] [blame]
developer20d67712022-03-02 14:09:32 +08001diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
developer60cad402022-06-08 22:17:14 +08002index 27eecf3..0124d89 100644
developer20d67712022-03-02 14:09:32 +08003--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
4+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
developer60cad402022-06-08 22:17:14 +08005@@ -61,7 +61,8 @@ drv_mac80211_init_device_config() {
6 rx_stbc \
7 tx_stbc \
8 he_bss_color \
9- he_spr_non_srg_obss_pd_max_offset
10+ he_spr_non_srg_obss_pd_max_offset \
11+ radar_background
12 config_add_boolean \
13 ldpc \
14 greenfield \
15@@ -137,13 +138,10 @@ mac80211_hostapd_setup_base() {
16 [ -n "$acs_exclude_dfs" ] && [ "$acs_exclude_dfs" -gt 0 ] &&
17 append base_cfg "acs_exclude_dfs=1" "$N"
18
19- json_get_vars noscan ht_coex
20+ json_get_vars noscan ht_coex radar_background:0
developer20d67712022-03-02 14:09:32 +080021 json_get_values ht_capab_list ht_capab tx_burst
22 json_get_values channel_list channels
23
24- [ "$auto_channel" = 0 ] && [ -z "$channel_list" ] && \
25- channel_list="$channel"
26-
27 set_default noscan 0
28
29 [ "$noscan" -gt 0 ] && hostapd_noscan=1
developer60cad402022-06-08 22:17:14 +080030@@ -413,9 +411,9 @@ mac80211_hostapd_setup_base() {
developer20d67712022-03-02 14:09:32 +080031 he_spr_non_srg_obss_pd_max_offset:1 \
32 he_bss_color
33
34- he_phy_cap=$(iw phy "$phy" info | awk -F "[()]" '/HE PHY Capabilities/ { print $2 }' | head -1)
35+ he_phy_cap=$(iw phy "$phy" info | grep "HE Iftypes: AP" -A 50 | awk -F "[()]" '/HE PHY Capabilities/ { print $2 }' | head -1)
36 he_phy_cap=${he_phy_cap:2}
37- he_mac_cap=$(iw phy "$phy" info | awk -F "[()]" '/HE MAC Capabilities/ { print $2 }' | head -1)
38+ he_mac_cap=$(iw phy "$phy" info | grep "HE Iftypes: AP" -A 50 | awk -F "[()]" '/HE MAC Capabilities/ { print $2 }' | head -1)
39 he_mac_cap=${he_mac_cap:2}
40
41 append base_cfg "ieee80211ax=1" "$N"
developer60cad402022-06-08 22:17:14 +080042@@ -462,6 +460,8 @@ mac80211_hostapd_setup_base() {
43 append base_cfg "he_mu_edca_ac_vo_timer=255" "$N"
44 fi
45
46+ append base_cfg "enable_background_radar=$radar_background" "$N"
47+
48 hostapd_prepare_device_config "$hostapd_conf_file" nl80211
49 cat >> "$hostapd_conf_file" <<EOF
50 ${channel:+channel=$channel}
developere2597ba2022-06-24 13:09:16 +080051--- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
52+++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
53@@ -132,6 +132,13 @@
54 mode_band="$band"
55 channel="$chan"
56 htmode="$mode"
57+ if [ "$band" = "6g" ]
58+ then
59+ encryption=sae
60+ key=12345678
61+ else
62+ encryption=none
63+ fi
64 done
65 }
66
67@@ -157,6 +164,8 @@
68 channel=""
69 htmode=""
70 ht_capab=""
71+ encryption=""
72+ key=""
73
74 get_band_defaults "$dev"
75
76@@ -181,8 +190,11 @@
77 set wireless.default_radio${devidx}.network=lan
78 set wireless.default_radio${devidx}.mode=ap
79 set wireless.default_radio${devidx}.ssid=OpenWrt
80- set wireless.default_radio${devidx}.encryption=none
81+ set wireless.default_radio${devidx}.encryption=${encryption}
82 EOF
83+ [ -n "$key" ] && {
84+ uci -q set wireless.default_radio${devidx}.key=${key}
85+ }
86 uci -q commit wireless
87
88 devidx=$(($devidx + 1))
developer20d67712022-03-02 14:09:32 +080089--
902.29.2
91