blob: 392252e7aeeef61d56a9a10d0382de818fd6d318 [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
developer9b3248d2022-07-06 00:44:05 +08002index 5d6ca7c..cfe4243 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
developer9b3248d2022-07-06 00:44:05 +08005@@ -141,9 +141,6 @@ mac80211_hostapd_setup_base() {
developer20d67712022-03-02 14:09:32 +08006 json_get_values ht_capab_list ht_capab tx_burst
7 json_get_values channel_list channels
8
9- [ "$auto_channel" = 0 ] && [ -z "$channel_list" ] && \
10- channel_list="$channel"
11-
developer9b3248d2022-07-06 00:44:05 +080012 [ "$min_tx_power" -gt 0 ] && append base_cfg "min_tx_power=$min_tx_power"
developer20d67712022-03-02 14:09:32 +080013
developer9b3248d2022-07-06 00:44:05 +080014 set_default noscan 0
15@@ -420,9 +417,9 @@ mac80211_hostapd_setup_base() {
developer20d67712022-03-02 14:09:32 +080016 he_spr_non_srg_obss_pd_max_offset:1 \
17 he_bss_color
18
19- he_phy_cap=$(iw phy "$phy" info | awk -F "[()]" '/HE PHY Capabilities/ { print $2 }' | head -1)
20+ he_phy_cap=$(iw phy "$phy" info | grep "HE Iftypes: AP" -A 50 | awk -F "[()]" '/HE PHY Capabilities/ { print $2 }' | head -1)
21 he_phy_cap=${he_phy_cap:2}
22- he_mac_cap=$(iw phy "$phy" info | awk -F "[()]" '/HE MAC Capabilities/ { print $2 }' | head -1)
23+ he_mac_cap=$(iw phy "$phy" info | grep "HE Iftypes: AP" -A 50 | awk -F "[()]" '/HE MAC Capabilities/ { print $2 }' | head -1)
24 he_mac_cap=${he_mac_cap:2}
25
26 append base_cfg "ieee80211ax=1" "$N"
developer9b3248d2022-07-06 00:44:05 +080027diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
28index 6aa46b0..5551835 100644
developere2597ba2022-06-24 13:09:16 +080029--- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
30+++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
developer9b3248d2022-07-06 00:44:05 +080031@@ -132,6 +132,13 @@ get_band_defaults() {
developere2597ba2022-06-24 13:09:16 +080032 mode_band="$band"
33 channel="$chan"
34 htmode="$mode"
35+ if [ "$band" = "6g" ]
36+ then
37+ encryption=sae
38+ key=12345678
39+ else
40+ encryption=none
41+ fi
42 done
43 }
44
developer9b3248d2022-07-06 00:44:05 +080045@@ -157,6 +164,8 @@ detect_mac80211() {
developere2597ba2022-06-24 13:09:16 +080046 channel=""
47 htmode=""
48 ht_capab=""
49+ encryption=""
50+ key=""
51
52 get_band_defaults "$dev"
53
developer9b3248d2022-07-06 00:44:05 +080054@@ -181,8 +190,11 @@ detect_mac80211() {
developere2597ba2022-06-24 13:09:16 +080055 set wireless.default_radio${devidx}.network=lan
56 set wireless.default_radio${devidx}.mode=ap
57 set wireless.default_radio${devidx}.ssid=OpenWrt
58- set wireless.default_radio${devidx}.encryption=none
59+ set wireless.default_radio${devidx}.encryption=${encryption}
60 EOF
61+ [ -n "$key" ] && {
62+ uci -q set wireless.default_radio${devidx}.key=${key}
63+ }
64 uci -q commit wireless
65
66 devidx=$(($devidx + 1))
developer20d67712022-03-02 14:09:32 +080067--
developer9b3248d2022-07-06 00:44:05 +0800682.36.1
developer20d67712022-03-02 14:09:32 +080069