developer | ce9e509 | 2022-11-10 22:41:59 +0800 | [diff] [blame] | 1 | diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile |
developer | 619eaa3 | 2023-08-29 13:33:51 +0800 | [diff] [blame^] | 2 | index a7472ee7..f06c889b 100644 |
developer | ce9e509 | 2022-11-10 22:41:59 +0800 | [diff] [blame] | 3 | --- a/package/kernel/mac80211/Makefile |
| 4 | +++ b/package/kernel/mac80211/Makefile |
developer | ad1f317 | 2023-05-02 11:10:08 +0800 | [diff] [blame] | 5 | @@ -20,6 +20,7 @@ PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz |
developer | ce9e509 | 2022-11-10 22:41:59 +0800 | [diff] [blame] | 6 | PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION) |
| 7 | PKG_BUILD_PARALLEL:=1 |
developer | 356ecec | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 8 | |
developer | ce9e509 | 2022-11-10 22:41:59 +0800 | [diff] [blame] | 9 | +SOURCE_PATH:=./src |
| 10 | PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name> |
developer | 356ecec | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 11 | |
developer | ce9e509 | 2022-11-10 22:41:59 +0800 | [diff] [blame] | 12 | PKG_DRIVERS = \ |
developer | ad1f317 | 2023-05-02 11:10:08 +0800 | [diff] [blame] | 13 | @@ -72,6 +73,10 @@ config-y:= \ |
developer | 6ec8e34 | 2022-11-21 18:47:15 +0800 | [diff] [blame] | 14 | WLAN_VENDOR_ST \ |
| 15 | WLAN_VENDOR_TI \ |
| 16 | WLAN_VENDOR_ZYDAS \ |
| 17 | + MAC80211_DEBUG_MENU \ |
| 18 | + MAC80211_MLME_DEBUG \ |
| 19 | + MAC80211_STA_DEBUG \ |
| 20 | + MAC80211_HT_DEBUG \ |
| 21 | |
| 22 | config-$(call config_package,cfg80211) += CFG80211 |
| 23 | config-$(CONFIG_PACKAGE_CFG80211_TESTMODE) += NL80211_TESTMODE |
developer | ad1f317 | 2023-05-02 11:10:08 +0800 | [diff] [blame] | 24 | @@ -297,6 +302,8 @@ define Build/Prepare |
developer | 356ecec | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 25 | mkdir -p $(PKG_BUILD_DIR) |
| 26 | $(PKG_UNPACK) |
| 27 | $(Build/Patch) |
| 28 | + $(CP) $(SOURCE_PATH)/net $(PKG_BUILD_DIR) 2>/dev/null || : |
| 29 | + $(CP) $(SOURCE_PATH)/include $(PKG_BUILD_DIR) 2>/dev/null || : |
| 30 | rm -rf \ |
| 31 | $(PKG_BUILD_DIR)/include/linux/ssb \ |
| 32 | $(PKG_BUILD_DIR)/include/linux/bcma \ |
developer | 20d6771 | 2022-03-02 14:09:32 +0800 | [diff] [blame] | 33 | diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh |
developer | 619eaa3 | 2023-08-29 13:33:51 +0800 | [diff] [blame^] | 34 | index 39683376..3b1b5a55 100644 |
developer | 20d6771 | 2022-03-02 14:09:32 +0800 | [diff] [blame] | 35 | --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh |
| 36 | +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 37 | @@ -24,6 +24,7 @@ drv_mac80211_init_device_config() { |
developer | 0ba09b6 | 2023-03-10 18:43:49 +0800 | [diff] [blame] | 38 | |
| 39 | config_add_string path phy 'macaddr:macaddr' |
| 40 | config_add_string tx_burst |
developer | 2c6592a | 2023-07-21 11:20:56 +0800 | [diff] [blame] | 41 | + config_add_int mbssid mu_onoff sr_enable sr_enhanced rnr |
developer | 0ba09b6 | 2023-03-10 18:43:49 +0800 | [diff] [blame] | 42 | config_add_string distance |
| 43 | config_add_int beacon_int chanbw frag rts |
| 44 | config_add_int rxantenna txantenna antenna_gain txpower min_tx_power |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 45 | @@ -50,7 +51,10 @@ drv_mac80211_init_device_config() { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 46 | he_spr_sr_control \ |
| 47 | he_spr_psr_enabled \ |
| 48 | he_bss_color_enabled \ |
| 49 | - he_twt_required |
| 50 | + he_twt_required \ |
| 51 | + he_twt_responder \ |
| 52 | + etxbfen \ |
| 53 | + itxbfen |
| 54 | config_add_int \ |
| 55 | beamformer_antennas \ |
| 56 | beamformee_antennas \ |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 57 | @@ -137,13 +141,11 @@ mac80211_hostapd_setup_base() { |
developer | 0ba09b6 | 2023-03-10 18:43:49 +0800 | [diff] [blame] | 58 | [ -n "$acs_exclude_dfs" ] && [ "$acs_exclude_dfs" -gt 0 ] && |
| 59 | append base_cfg "acs_exclude_dfs=1" "$N" |
| 60 | |
| 61 | - json_get_vars noscan ht_coex min_tx_power:0 tx_burst |
developer | 2c6592a | 2023-07-21 11:20:56 +0800 | [diff] [blame] | 62 | + json_get_vars noscan ht_coex min_tx_power:0 tx_burst mbssid mu_onoff rnr |
developer | 2c4f7e8 | 2023-05-11 19:56:55 +0800 | [diff] [blame] | 63 | + json_get_vars etxbfen:1 itxbfen:0 |
developer | 8d77be3 | 2022-10-20 15:08:25 +0800 | [diff] [blame] | 64 | json_get_values ht_capab_list ht_capab |
developer | 20d6771 | 2022-03-02 14:09:32 +0800 | [diff] [blame] | 65 | json_get_values channel_list channels |
| 66 | |
| 67 | - [ "$auto_channel" = 0 ] && [ -z "$channel_list" ] && \ |
| 68 | - channel_list="$channel" |
| 69 | - |
developer | 9b3248d | 2022-07-06 00:44:05 +0800 | [diff] [blame] | 70 | [ "$min_tx_power" -gt 0 ] && append base_cfg "min_tx_power=$min_tx_power" |
developer | 20d6771 | 2022-03-02 14:09:32 +0800 | [diff] [blame] | 71 | |
developer | 9b3248d | 2022-07-06 00:44:05 +0800 | [diff] [blame] | 72 | set_default noscan 0 |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 73 | @@ -157,8 +159,8 @@ mac80211_hostapd_setup_base() { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 74 | ieee80211n=1 |
| 75 | ht_capab= |
| 76 | case "$htmode" in |
| 77 | - VHT20|HT20|HE20) ;; |
| 78 | - HT40*|VHT40|VHT80|VHT160|HE40|HE80|HE160) |
| 79 | + VHT20|HT20|HE20|EHT20) ;; |
developer | be3cf97 | 2023-04-27 09:58:26 +0800 | [diff] [blame] | 80 | + HT40*|VHT40|VHT80|VHT160|HE40*|HE80|HE160|EHT40*|EHT80|EHT160|EHT320*) |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 81 | case "$hwmode" in |
| 82 | a) |
| 83 | case "$(( (($channel / 4) + $chan_ofs) % 2 ))" in |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 84 | @@ -168,8 +170,22 @@ mac80211_hostapd_setup_base() { |
developer | be3cf97 | 2023-04-27 09:58:26 +0800 | [diff] [blame] | 85 | ;; |
| 86 | *) |
| 87 | case "$htmode" in |
| 88 | - HT40+) ht_capab="[HT40+]";; |
| 89 | - HT40-) ht_capab="[HT40-]";; |
| 90 | + HT40+|HE40+|EHT40+) |
| 91 | + if [ "$channel" -gt 9 ]; then |
| 92 | + echo "Could not set the center freq with this HT mode setting" |
| 93 | + return 1 |
| 94 | + else |
| 95 | + ht_capab="[HT40+]" |
| 96 | + fi |
| 97 | + ;; |
| 98 | + HT40-|HE40-|EHT40-) |
| 99 | + if [ "$channel" -lt 5 ]; then |
| 100 | + echo "Could not set the center freq with this HT mode setting" |
| 101 | + return 1 |
| 102 | + else |
| 103 | + ht_capab="[HT40-]" |
| 104 | + fi |
| 105 | + ;; |
| 106 | *) |
| 107 | if [ "$channel" -lt 7 ]; then |
| 108 | ht_capab="[HT40+]" |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 109 | @@ -202,7 +218,7 @@ mac80211_hostapd_setup_base() { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 110 | dsss_cck_40:1 |
| 111 | |
| 112 | ht_cap_mask=0 |
| 113 | - for cap in $(iw phy "$phy" info | grep 'Capabilities:' | cut -d: -f2); do |
| 114 | + for cap in $(iw phy "$phy" info | grep 'Capabilities: 0x' | cut -d: -f2); do |
| 115 | ht_cap_mask="$(($ht_cap_mask | $cap))" |
| 116 | done |
| 117 | |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 118 | @@ -233,8 +249,8 @@ mac80211_hostapd_setup_base() { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 119 | |
| 120 | idx="$channel" |
| 121 | case "$htmode" in |
| 122 | - VHT20|HE20) enable_ac=1;; |
| 123 | - VHT40|HE40) |
| 124 | + VHT20|HE20|EHT20) enable_ac=1;; |
| 125 | + VHT40|HE40|EHT40) |
| 126 | case "$(( (($channel / 4) + $chan_ofs) % 2 ))" in |
| 127 | 1) idx=$(($channel + 2));; |
| 128 | 0) idx=$(($channel - 2));; |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 129 | @@ -242,7 +258,7 @@ mac80211_hostapd_setup_base() { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 130 | enable_ac=1 |
| 131 | vht_center_seg0=$idx |
| 132 | ;; |
| 133 | - VHT80|HE80) |
| 134 | + VHT80|HE80|EHT80) |
| 135 | case "$(( (($channel / 4) + $chan_ofs) % 4 ))" in |
| 136 | 1) idx=$(($channel + 6));; |
| 137 | 2) idx=$(($channel + 2));; |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 138 | @@ -253,7 +269,7 @@ mac80211_hostapd_setup_base() { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 139 | vht_oper_chwidth=1 |
| 140 | vht_center_seg0=$idx |
| 141 | ;; |
| 142 | - VHT160|HE160) |
| 143 | + VHT160|HE160|EHT160) |
| 144 | if [ "$band" = "6g" ]; then |
| 145 | case "$channel" in |
| 146 | 1|5|9|13|17|21|25|29) idx=15;; |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 147 | @@ -268,12 +284,43 @@ mac80211_hostapd_setup_base() { |
developer | add8de6 | 2023-05-02 16:25:52 +0800 | [diff] [blame] | 148 | case "$channel" in |
| 149 | 36|40|44|48|52|56|60|64) idx=50;; |
| 150 | 100|104|108|112|116|120|124|128) idx=114;; |
| 151 | + 149|153|157|161|165|169|173|177) idx=163;; |
| 152 | esac |
| 153 | fi |
| 154 | enable_ac=1 |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 155 | vht_oper_chwidth=2 |
| 156 | vht_center_seg0=$idx |
| 157 | ;; |
| 158 | + EHT320*) |
| 159 | + case "$channel" in |
| 160 | + 1|5|9|13|17|21|25|29) idx=31;; |
| 161 | + 33|37|41|45|49|53|57|61| \ |
| 162 | + 65|69|73|77|81|85|89|93) idx=63;; |
| 163 | + 97|101|105|109|113|117|121|125| \ |
| 164 | + 129|133|137|141|145|149|153|157) idx=127;; |
| 165 | + 161|165|169|173|177|181|185|189| \ |
| 166 | + 193|197|201|205|209|213|217|221) idx=191;; |
| 167 | + esac |
| 168 | + if [[ "$htmode" = "EHT320-1" && "$channel" -ge "193" ]] || |
| 169 | + [[ "$htmode" = "EHT320-2" && "$channel" -le "29" ]]; then |
| 170 | + echo "Could not set the center freq with this EHT setting" |
| 171 | + return 1 |
| 172 | + elif [[ "$htmode" = "EHT320-1" && "$channel" -ge "33" ]]; then |
| 173 | + if [ "$channel" -gt $idx ]; then |
| 174 | + idx=$(($idx + 32)) |
| 175 | + else |
| 176 | + idx=$(($idx - 32)) |
| 177 | + fi |
| 178 | + fi |
| 179 | + vht_oper_chwidth=2 |
| 180 | + if [ "$channel" -gt $idx ]; then |
| 181 | + vht_center_seg0=$(($idx + 16)) |
| 182 | + else |
| 183 | + vht_center_seg0=$(($idx - 16)) |
| 184 | + fi |
| 185 | + eht_oper_chwidth=9 |
| 186 | + eht_oper_centr_freq_seg0_idx=$idx |
| 187 | + ;; |
| 188 | esac |
| 189 | [ "$band" = "5g" ] && { |
| 190 | json_get_vars background_radar:0 |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 191 | @@ -283,8 +330,9 @@ mac80211_hostapd_setup_base() { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 192 | [ "$band" = "6g" ] && { |
| 193 | op_class= |
| 194 | case "$htmode" in |
| 195 | - HE20) op_class=131;; |
| 196 | - HE*) op_class=$((132 + $vht_oper_chwidth)) |
| 197 | + HE20|EHT20) op_class=131;; |
| 198 | + EHT320*) op_class=137;; |
| 199 | + HE*|EHT*) op_class=$((132 + $vht_oper_chwidth)) |
| 200 | esac |
| 201 | [ -n "$op_class" ] && append base_cfg "op_class=$op_class" "$N" |
| 202 | } |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 203 | @@ -312,7 +360,6 @@ mac80211_hostapd_setup_base() { |
developer | 8b04dfd | 2022-12-07 16:29:19 +0800 | [diff] [blame] | 204 | vht_link_adapt:3 \ |
| 205 | vht160:2 |
| 206 | |
| 207 | - set_default tx_burst 2.0 |
| 208 | append base_cfg "ieee80211ac=1" "$N" |
| 209 | vht_cap=0 |
| 210 | for cap in $(iw phy "$phy" info | awk -F "[()]" '/VHT Capabilities/ { print $2 }'); do |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 211 | @@ -326,6 +373,12 @@ mac80211_hostapd_setup_base() { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 212 | [ "$rx_stbc" -lt "$cap_rx_stbc" ] && cap_rx_stbc="$rx_stbc" |
| 213 | vht_cap="$(( ($vht_cap & ~(0x700)) | ($cap_rx_stbc << 8) ))" |
| 214 | |
| 215 | + [ "$etxbfen" -eq 0 ] && { |
| 216 | + su_beamformer=0 |
| 217 | + su_beamformee=0 |
| 218 | + mu_beamformer=0 |
| 219 | + } |
| 220 | + |
| 221 | mac80211_add_capabilities vht_capab $vht_cap \ |
| 222 | RXLDPC:0x10::$rxldpc \ |
| 223 | SHORT-GI-80:0x20::$short_gi_80 \ |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 224 | @@ -407,7 +460,7 @@ mac80211_hostapd_setup_base() { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 225 | # 802.11ax |
| 226 | enable_ax=0 |
| 227 | case "$htmode" in |
| 228 | - HE*) enable_ax=1 ;; |
| 229 | + HE*|EHT*) enable_ax=1 ;; |
| 230 | esac |
| 231 | |
| 232 | if [ "$enable_ax" != "0" ]; then |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 233 | @@ -416,10 +469,11 @@ mac80211_hostapd_setup_base() { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 234 | he_su_beamformee:1 \ |
| 235 | he_mu_beamformer:1 \ |
| 236 | he_twt_required:0 \ |
| 237 | + he_twt_responder \ |
| 238 | he_spr_sr_control:3 \ |
| 239 | he_spr_psr_enabled:0 \ |
| 240 | he_spr_non_srg_obss_pd_max_offset:0 \ |
| 241 | - he_bss_color:128 \ |
| 242 | + he_bss_color \ |
| 243 | he_bss_color_enabled:1 |
| 244 | |
| 245 | he_phy_cap=$(iw phy "$phy" info | sed -n '/HE Iftypes: AP/,$p' | awk -F "[()]" '/HE PHY Capabilities/ { print $2 }' | head -1) |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 246 | @@ -433,6 +487,11 @@ mac80211_hostapd_setup_base() { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 247 | append base_cfg "he_oper_centr_freq_seg0_idx=$vht_center_seg0" "$N" |
| 248 | } |
| 249 | |
| 250 | + [ "$etxbfen" -eq 0 ] && { |
| 251 | + he_su_beamformer=0 |
| 252 | + he_mu_beamformer=0 |
| 253 | + } |
| 254 | + |
| 255 | mac80211_add_he_capabilities \ |
| 256 | he_su_beamformer:${he_phy_cap:6:2}:0x80:$he_su_beamformer \ |
| 257 | he_su_beamformee:${he_phy_cap:8:2}:0x1:$he_su_beamformee \ |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 258 | @@ -440,7 +499,14 @@ mac80211_hostapd_setup_base() { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 259 | he_spr_psr_enabled:${he_phy_cap:14:2}:0x1:$he_spr_psr_enabled \ |
| 260 | he_twt_required:${he_mac_cap:0:2}:0x6:$he_twt_required |
| 261 | |
| 262 | + if [ -n "$he_twt_responder" ]; then |
| 263 | + append base_cfg "he_twt_responder=$he_twt_responder" "$N" |
| 264 | + fi |
| 265 | if [ "$he_bss_color_enabled" -gt 0 ]; then |
developer | 830efa7 | 2023-05-18 19:32:48 +0800 | [diff] [blame] | 266 | + if !([ "$he_bss_color" -gt 0 ] && [ "$he_bss_color" -le 64 ]); then |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 267 | + rand=$(head -n 1 /dev/urandom | tr -dc 0-9 | head -c 2) |
| 268 | + he_bss_color=$((rand % 63 + 1)) |
| 269 | + fi |
| 270 | append base_cfg "he_bss_color=$he_bss_color" "$N" |
| 271 | [ "$he_spr_non_srg_obss_pd_max_offset" -gt 0 ] && { \ |
| 272 | append base_cfg "he_spr_non_srg_obss_pd_max_offset=$he_spr_non_srg_obss_pd_max_offset" "$N" |
developer | 619eaa3 | 2023-08-29 13:33:51 +0800 | [diff] [blame^] | 273 | @@ -459,34 +525,69 @@ mac80211_hostapd_setup_base() { |
| 274 | append base_cfg "he_mu_edca_qos_info_q_ack=0" "$N" |
| 275 | append base_cfg "he_mu_edca_qos_info_queue_request=0" "$N" |
| 276 | append base_cfg "he_mu_edca_qos_info_txop_request=0" "$N" |
| 277 | - append base_cfg "he_mu_edca_ac_be_aifsn=8" "$N" |
| 278 | + append base_cfg "he_mu_edca_ac_be_aifsn=0" "$N" |
| 279 | append base_cfg "he_mu_edca_ac_be_aci=0" "$N" |
| 280 | append base_cfg "he_mu_edca_ac_be_ecwmin=9" "$N" |
| 281 | append base_cfg "he_mu_edca_ac_be_ecwmax=10" "$N" |
| 282 | append base_cfg "he_mu_edca_ac_be_timer=255" "$N" |
| 283 | - append base_cfg "he_mu_edca_ac_bk_aifsn=15" "$N" |
| 284 | + append base_cfg "he_mu_edca_ac_bk_aifsn=0" "$N" |
| 285 | append base_cfg "he_mu_edca_ac_bk_aci=1" "$N" |
| 286 | append base_cfg "he_mu_edca_ac_bk_ecwmin=9" "$N" |
| 287 | append base_cfg "he_mu_edca_ac_bk_ecwmax=10" "$N" |
| 288 | append base_cfg "he_mu_edca_ac_bk_timer=255" "$N" |
| 289 | append base_cfg "he_mu_edca_ac_vi_ecwmin=5" "$N" |
| 290 | append base_cfg "he_mu_edca_ac_vi_ecwmax=7" "$N" |
| 291 | - append base_cfg "he_mu_edca_ac_vi_aifsn=5" "$N" |
| 292 | + append base_cfg "he_mu_edca_ac_vi_aifsn=0" "$N" |
| 293 | append base_cfg "he_mu_edca_ac_vi_aci=2" "$N" |
| 294 | append base_cfg "he_mu_edca_ac_vi_timer=255" "$N" |
| 295 | - append base_cfg "he_mu_edca_ac_vo_aifsn=5" "$N" |
| 296 | + append base_cfg "he_mu_edca_ac_vo_aifsn=0" "$N" |
| 297 | append base_cfg "he_mu_edca_ac_vo_aci=3" "$N" |
| 298 | append base_cfg "he_mu_edca_ac_vo_ecwmin=5" "$N" |
| 299 | append base_cfg "he_mu_edca_ac_vo_ecwmax=7" "$N" |
developer | 8b04dfd | 2022-12-07 16:29:19 +0800 | [diff] [blame] | 300 | append base_cfg "he_mu_edca_ac_vo_timer=255" "$N" |
| 301 | fi |
| 302 | |
developer | 18015ad | 2023-07-13 13:18:19 +0800 | [diff] [blame] | 303 | + set_default tx_burst 2 |
developer | 8b04dfd | 2022-12-07 16:29:19 +0800 | [diff] [blame] | 304 | + |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 305 | + # 802.11be |
| 306 | + enable_be=0 |
| 307 | + case "$htmode" in |
| 308 | + EHT*) enable_be=1 ;; |
| 309 | + esac |
| 310 | + |
| 311 | + if [ "$enable_be" != "0" ]; then |
| 312 | + append base_cfg "ieee80211be=1" "$N" |
| 313 | + if [ "$etxbfen" -eq 0 ]; then |
| 314 | + append base_cfg "eht_su_beamformee=1" "$N" |
| 315 | + else |
| 316 | + append base_cfg "eht_su_beamformer=1" "$N" |
| 317 | + append base_cfg "eht_su_beamformee=1" "$N" |
| 318 | + append base_cfg "eht_mu_beamformer=1" "$N" |
| 319 | + fi |
| 320 | + [ "$hwmode" = "a" ] && { |
| 321 | + case $htmode in |
| 322 | + EHT320*) |
| 323 | + append base_cfg "eht_oper_chwidth=$eht_oper_chwidth" "$N" |
| 324 | + append base_cfg "eht_oper_centr_freq_seg0_idx=$eht_oper_centr_freq_seg0_idx" "$N" |
| 325 | + ;; |
| 326 | + *) |
| 327 | + append base_cfg "eht_oper_chwidth=$vht_oper_chwidth" "$N" |
| 328 | + append base_cfg "eht_oper_centr_freq_seg0_idx=$vht_center_seg0" "$N" |
| 329 | + ;; |
| 330 | + esac |
| 331 | + } |
| 332 | + fi |
| 333 | + |
developer | 8b04dfd | 2022-12-07 16:29:19 +0800 | [diff] [blame] | 334 | hostapd_prepare_device_config "$hostapd_conf_file" nl80211 |
| 335 | cat >> "$hostapd_conf_file" <<EOF |
| 336 | ${channel:+channel=$channel} |
developer | 0ba09b6 | 2023-03-10 18:43:49 +0800 | [diff] [blame] | 337 | ${channel_list:+chanlist=$channel_list} |
| 338 | ${hostapd_noscan:+noscan=1} |
| 339 | ${tx_burst:+tx_queue_data2_burst=$tx_burst} |
| 340 | +${mbssid:+mbssid=$mbssid} |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 341 | +${mu_onoff:+mu_onoff=$mu_onoff} |
| 342 | +${itxbfen:+ibf_enable=$itxbfen} |
developer | 2c6592a | 2023-07-21 11:20:56 +0800 | [diff] [blame] | 343 | +${rnr:+rnr=$rnr} |
developer | 0ba09b6 | 2023-03-10 18:43:49 +0800 | [diff] [blame] | 344 | $base_cfg |
| 345 | |
| 346 | EOF |
developer | 5b3b7a9 | 2023-08-12 03:41:52 +0800 | [diff] [blame] | 347 | @@ -512,7 +613,7 @@ mac80211_hostapd_setup_bss() { |
developer | 093e1a3 | 2023-02-24 16:10:53 +0800 | [diff] [blame] | 348 | append hostapd_cfg "wds_sta=1" "$N" |
| 349 | [ -n "$wds_bridge" ] && append hostapd_cfg "wds_bridge=$wds_bridge" "$N" |
| 350 | } |
| 351 | - [ "$staidx" -gt 0 -o "$start_disabled" -eq 1 ] && append hostapd_cfg "start_disabled=1" "$N" |
| 352 | + [ "$start_disabled" -eq 1 ] && append hostapd_cfg "start_disabled=1" "$N" |
| 353 | |
| 354 | cat >> /var/run/hostapd-$phy.conf <<EOF |
| 355 | $hostapd_cfg |
developer | 5b3b7a9 | 2023-08-12 03:41:52 +0800 | [diff] [blame] | 356 | @@ -522,6 +623,31 @@ ${max_listen_int:+max_listen_interval=$max_listen_int} |
developer | 0ba09b6 | 2023-03-10 18:43:49 +0800 | [diff] [blame] | 357 | EOF |
| 358 | } |
| 359 | |
| 360 | +mac80211_generate_mbssid_mac() { |
| 361 | + local phy="$1" |
| 362 | + local transmitted_bssid="$2" |
developer | 1952bcd | 2023-06-20 20:14:37 +0800 | [diff] [blame] | 363 | + local id="${mbssidx:-0}" |
developer | 0ba09b6 | 2023-03-10 18:43:49 +0800 | [diff] [blame] | 364 | + |
| 365 | + local ref="$(cat /sys/class/ieee80211/${phy}/macaddress)" |
developer | 0ba09b6 | 2023-03-10 18:43:49 +0800 | [diff] [blame] | 366 | + |
| 367 | + if [ -z "$transmitted_bssid" ]; then |
| 368 | + transmitted_bssid=$ref |
| 369 | + fi |
| 370 | + |
| 371 | + if [ $id -eq 0 ]; then |
| 372 | + echo "$transmitted_bssid" |
| 373 | + return |
| 374 | + fi |
| 375 | + |
| 376 | + local oIFS="$IFS"; IFS=":"; set -- $transmitted_bssid; IFS="$oIFS" |
| 377 | + |
| 378 | + # Calculate nontransmitted bssid |
developer | 0ba09b6 | 2023-03-10 18:43:49 +0800 | [diff] [blame] | 379 | + b6="0x$6" |
| 380 | + ref_b6=$(($b6 % $max_mbssid)) |
developer | 1952bcd | 2023-06-20 20:14:37 +0800 | [diff] [blame] | 381 | + b6=$(($b6 - $ref_b6 + ($ref_b6 + $id) % $max_mbssid)) |
developer | 0ba09b6 | 2023-03-10 18:43:49 +0800 | [diff] [blame] | 382 | + printf "%s:%s:%s:%s:%s:%02x" $1 $2 $3 $4 $5 $b6 |
| 383 | +} |
| 384 | + |
| 385 | mac80211_get_addr() { |
| 386 | local phy="$1" |
| 387 | local idx="$(($2 + 1))" |
developer | 5b3b7a9 | 2023-08-12 03:41:52 +0800 | [diff] [blame] | 388 | @@ -684,7 +810,19 @@ mac80211_prepare_vif() { |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 389 | set_default powersave 0 |
| 390 | json_add_string _ifname "$ifname" |
developer | 0ba09b6 | 2023-03-10 18:43:49 +0800 | [diff] [blame] | 391 | |
| 392 | - if [ -z "$macaddr" ]; then |
developer | d2fbd57 | 2023-06-19 19:48:25 +0800 | [diff] [blame] | 393 | + if [ "$mbssid" -gt 0 ] && [ "$mode" == "ap" ]; then |
developer | 1952bcd | 2023-06-20 20:14:37 +0800 | [diff] [blame] | 394 | + [ "$mbssidx" -eq 0 ] && { |
| 395 | + if [ -z $macaddr ]; then |
| 396 | + transmitted_bssid="$(mac80211_generate_mac $phy)" |
| 397 | + else |
| 398 | + # uci set mac address |
| 399 | + transmitted_bssid=$macaddr |
| 400 | + fi |
| 401 | + macidx="$(($macidx + 1))" |
developer | 0ba09b6 | 2023-03-10 18:43:49 +0800 | [diff] [blame] | 402 | + } |
| 403 | + macaddr="$(mac80211_generate_mbssid_mac $phy $transmitted_bssid)" |
developer | 1952bcd | 2023-06-20 20:14:37 +0800 | [diff] [blame] | 404 | + mbssidx="$(($mbssidx + 1))" |
developer | 0ba09b6 | 2023-03-10 18:43:49 +0800 | [diff] [blame] | 405 | + elif [ -z "$macaddr" ]; then |
| 406 | macaddr="$(mac80211_generate_mac $phy)" |
| 407 | macidx="$(($macidx + 1))" |
| 408 | elif [ "$macaddr" = 'random' ]; then |
developer | 5b3b7a9 | 2023-08-12 03:41:52 +0800 | [diff] [blame] | 409 | @@ -948,6 +1086,14 @@ hostapd_set_config() { |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 410 | } |
| 411 | |
| 412 | ubus wait_for hostapd |
| 413 | + |
| 414 | + # each phy sleeps different times to prevent for ubus race condition. |
| 415 | + if [ "$phy" = "phy1" ]; then |
| 416 | + sleep 1; |
| 417 | + elif [ "$phy" = "phy2" ]; then |
| 418 | + sleep 2; |
| 419 | + fi |
| 420 | + |
| 421 | local hostapd_res="$(ubus call hostapd config_set "{ \"phy\": \"$phy\", \"config\":\"${hostapd_conf_file}\", \"prev_config\": \"${hostapd_conf_file}.prev\"}")" |
| 422 | ret="$?" |
| 423 | [ "$ret" != 0 -o -z "$hostapd_res" ] && { |
developer | 5b3b7a9 | 2023-08-12 03:41:52 +0800 | [diff] [blame] | 424 | @@ -1024,6 +1170,9 @@ mac80211_setup_vif() { |
developer | f0de14b | 2022-12-14 23:07:34 +0800 | [diff] [blame] | 425 | |
| 426 | json_select .. |
| 427 | [ -n "$failed" ] || wireless_add_vif "$name" "$ifname" |
| 428 | + |
| 429 | + echo "Setup SMP Affinity" |
| 430 | + /sbin/smp-mt76.sh |
| 431 | } |
| 432 | |
| 433 | get_freq() { |
developer | 5b3b7a9 | 2023-08-12 03:41:52 +0800 | [diff] [blame] | 434 | @@ -1075,6 +1224,10 @@ mac80211_reset_config() { |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 435 | wdev_tool "$phy" '{}' |
developer | 0ba09b6 | 2023-03-10 18:43:49 +0800 | [diff] [blame] | 436 | } |
| 437 | |
| 438 | +mac80211_count_ap() { |
| 439 | + total_num_ap=$(($total_num_ap + 1)) |
| 440 | +} |
| 441 | + |
| 442 | drv_mac80211_setup() { |
| 443 | json_select config |
| 444 | json_get_vars \ |
developer | 5b3b7a9 | 2023-08-12 03:41:52 +0800 | [diff] [blame] | 445 | @@ -1082,7 +1235,8 @@ drv_mac80211_setup() { |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 446 | country chanbw distance \ |
| 447 | txpower antenna_gain \ |
| 448 | rxantenna txantenna \ |
| 449 | - frag rts beacon_int:100 htmode |
| 450 | + frag rts beacon_int:100 htmode \ |
| 451 | + sr_enable sr_enhanced |
| 452 | json_get_values basic_rate_list basic_rate |
| 453 | json_get_values scan_list scan_list |
| 454 | json_select .. |
developer | 5b3b7a9 | 2023-08-12 03:41:52 +0800 | [diff] [blame] | 455 | @@ -1117,6 +1271,7 @@ drv_mac80211_setup() { |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 456 | |
developer | 1952bcd | 2023-06-20 20:14:37 +0800 | [diff] [blame] | 457 | macidx=0 |
| 458 | staidx=0 |
| 459 | + mbssidx=0 |
| 460 | |
| 461 | [ -n "$chanbw" ] && { |
| 462 | for file in /sys/kernel/debug/ieee80211/$phy/ath9k*/chanbw /sys/kernel/debug/ieee80211/$phy/ath5k/bwmode; do |
developer | 5b3b7a9 | 2023-08-12 03:41:52 +0800 | [diff] [blame] | 463 | @@ -1167,6 +1322,16 @@ drv_mac80211_setup() { |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 464 | |
| 465 | wpa_supplicant_init_config |
developer | 0ba09b6 | 2023-03-10 18:43:49 +0800 | [diff] [blame] | 466 | |
| 467 | + total_num_ap=0 |
| 468 | + max_mbssid=1 |
| 469 | + for_each_interface "ap" mac80211_count_ap |
| 470 | + total_num_ap=$(($total_num_ap - 1)) |
| 471 | + while [ $total_num_ap -gt 0 ] |
| 472 | + do |
| 473 | + total_num_ap=$(($total_num_ap >> 1)) |
| 474 | + max_mbssid=$(($max_mbssid << 1)) |
| 475 | + done |
| 476 | + |
| 477 | mac80211_prepare_iw_htmode |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 478 | active_ifnames= |
| 479 | for_each_interface "ap sta adhoc mesh monitor" mac80211_prepare_vif |
developer | 5b3b7a9 | 2023-08-12 03:41:52 +0800 | [diff] [blame] | 480 | @@ -1175,6 +1340,9 @@ drv_mac80211_setup() { |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 481 | [ -x /usr/sbin/wpa_supplicant ] && wpa_supplicant_set_config "$phy" |
| 482 | [ -x /usr/sbin/hostapd ] && hostapd_set_config "$phy" |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 483 | |
| 484 | + [ -n "$sr_enable" ] && echo "$sr_enable" > /sys/kernel/debug/ieee80211/$phy/mt76/sr_enable |
| 485 | + [ -n "$sr_enhanced" ] && echo "$sr_enhanced" > /sys/kernel/debug/ieee80211/$phy/mt76/sr_enhanced_enable |
| 486 | + |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 487 | [ -x /usr/sbin/wpa_supplicant ] && wpa_supplicant_start "$phy" |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 488 | |
developer | 2468486 | 2023-08-02 08:10:38 +0800 | [diff] [blame] | 489 | json_set_namespace wdev_uc prev |
developer | 9b3248d | 2022-07-06 00:44:05 +0800 | [diff] [blame] | 490 | diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh |
developer | 619eaa3 | 2023-08-29 13:33:51 +0800 | [diff] [blame^] | 491 | index e24a2a63..20e60688 100644 |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 492 | --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh |
| 493 | +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh |
developer | 20ce7bd | 2023-05-20 13:25:14 +0800 | [diff] [blame] | 494 | @@ -60,6 +60,9 @@ BEGIN { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 495 | if (vht && band != "1:") mode="VHT80" |
| 496 | if (he) mode="HE80" |
| 497 | if (he && band == "1:") mode="HE20" |
developer | 20ce7bd | 2023-05-20 13:25:14 +0800 | [diff] [blame] | 498 | + if (eht && band == "2:") mode="EHT160" |
| 499 | + if (eht && band == "4:") mode="EHT320" |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 500 | + if (eht && band == "1:") mode="EHT20" |
| 501 | sub("\\[", "", channel) |
| 502 | sub("\\]", "", channel) |
| 503 | bands = bands band channel ":" mode " " |
developer | 20ce7bd | 2023-05-20 13:25:14 +0800 | [diff] [blame] | 504 | @@ -73,6 +76,7 @@ $1 == "Band" { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 505 | vht = "" |
| 506 | ht = "" |
| 507 | he = "" |
| 508 | + eht = "" |
| 509 | } |
| 510 | |
| 511 | $0 ~ "Capabilities:" { |
developer | 20ce7bd | 2023-05-20 13:25:14 +0800 | [diff] [blame] | 512 | @@ -87,6 +91,18 @@ $0 ~ "HE Iftypes" { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 513 | he=1 |
| 514 | } |
| 515 | |
| 516 | +$0 ~ "EHT Iftypes" { |
| 517 | + eht=1 |
| 518 | +} |
| 519 | + |
developer | 20ce7bd | 2023-05-20 13:25:14 +0800 | [diff] [blame] | 520 | +$0 ~ / *HE MAC Capabilities \(0x000000000000\)/ { |
| 521 | + he=0 |
| 522 | +} |
| 523 | + |
| 524 | +$0 ~ / *EHT MAC Capabilities \(0x0000\)/ { |
| 525 | + eht=0 |
| 526 | +} |
| 527 | + |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 528 | $1 == "*" && $3 == "MHz" && $0 !~ /disabled/ && band && !channel { |
| 529 | channel = $4 |
| 530 | } |
developer | 2c6592a | 2023-07-21 11:20:56 +0800 | [diff] [blame] | 531 | @@ -120,6 +136,19 @@ get_band_defaults() { |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 532 | mode_band="$band" |
| 533 | channel="$chan" |
| 534 | htmode="$mode" |
| 535 | + if [ "$band" = "6g" ] |
| 536 | + then |
| 537 | + encryption=sae |
| 538 | + key=12345678 |
developer | 20ce7bd | 2023-05-20 13:25:14 +0800 | [diff] [blame] | 539 | + sae_pwe=2 |
| 540 | + ieee80211w=2 |
developer | adbb45b | 2023-06-09 14:43:01 +0800 | [diff] [blame] | 541 | + channel=37 |
| 542 | + mbssid=1 |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 543 | + else |
developer | 659b07e | 2023-05-25 12:34:13 +0800 | [diff] [blame] | 544 | + noscan=1 |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 545 | + encryption=none |
developer | 2c6592a | 2023-07-21 11:20:56 +0800 | [diff] [blame] | 546 | + rnr=1 |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 547 | + fi |
| 548 | done |
| 549 | } |
| 550 | |
developer | 2c6592a | 2023-07-21 11:20:56 +0800 | [diff] [blame] | 551 | @@ -153,6 +182,10 @@ detect_mac80211() { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 552 | |
| 553 | json_load_file /etc/board.json |
| 554 | |
| 555 | + # generate random bytes for macaddr |
| 556 | + rand=$(hexdump -C /dev/urandom | head -n 1 &) |
| 557 | + killall hexdump |
| 558 | + |
| 559 | for _dev in /sys/class/ieee80211/*; do |
| 560 | [ -e "$_dev" ] || continue |
| 561 | |
developer | 2c6592a | 2023-07-21 11:20:56 +0800 | [diff] [blame] | 562 | @@ -162,6 +195,13 @@ detect_mac80211() { |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 563 | channel="" |
| 564 | htmode="" |
| 565 | ht_capab="" |
| 566 | + encryption="" |
developer | 659b07e | 2023-05-25 12:34:13 +0800 | [diff] [blame] | 567 | + noscan="" |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 568 | + key="" |
developer | 0925793 | 2023-05-09 13:41:30 +0800 | [diff] [blame] | 569 | + sae_pwe="" |
developer | 20ce7bd | 2023-05-20 13:25:14 +0800 | [diff] [blame] | 570 | + ieee80211w="" |
developer | adbb45b | 2023-06-09 14:43:01 +0800 | [diff] [blame] | 571 | + mbssid="" |
developer | 2c6592a | 2023-07-21 11:20:56 +0800 | [diff] [blame] | 572 | + rnr="" |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 573 | |
| 574 | get_band_defaults "$dev" |
| 575 | |
developer | 2c6592a | 2023-07-21 11:20:56 +0800 | [diff] [blame] | 576 | @@ -196,6 +236,14 @@ detect_mac80211() { |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 577 | ;; |
| 578 | esac |
| 579 | |
developer | 212c0d8 | 2023-07-13 19:41:47 +0800 | [diff] [blame] | 580 | + macaddr="" |
developer | 1325ba7 | 2023-06-26 13:43:31 +0800 | [diff] [blame] | 581 | + if (dmesg | grep -q "eeprom load fail"); then |
developer | 1952bcd | 2023-06-20 20:14:37 +0800 | [diff] [blame] | 582 | + for i in $(seq 2 3); do |
| 583 | + macaddr=${macaddr}:$(echo $rand | cut -d ' ' -f $i) |
| 584 | + done |
| 585 | + macaddr="00:0$(($devidx - 1)):55:66${macaddr}" |
developer | 1952bcd | 2023-06-20 20:14:37 +0800 | [diff] [blame] | 586 | + fi |
developer | 785b650 | 2023-04-19 18:31:11 +0800 | [diff] [blame] | 587 | + |
| 588 | uci -q batch <<-EOF |
| 589 | set wireless.${name}=wifi-device |
| 590 | set wireless.${name}.type=mac80211 |
developer | 2c6592a | 2023-07-21 11:20:56 +0800 | [diff] [blame] | 591 | @@ -203,15 +251,40 @@ detect_mac80211() { |
developer | 0925793 | 2023-05-09 13:41:30 +0800 | [diff] [blame] | 592 | set wireless.${name}.channel=${channel} |
| 593 | set wireless.${name}.band=${mode_band} |
| 594 | set wireless.${name}.htmode=$htmode |
| 595 | - set wireless.${name}.disabled=1 |
developer | 20ce7bd | 2023-05-20 13:25:14 +0800 | [diff] [blame] | 596 | + set wireless.${name}.country='US' |
developer | 659b07e | 2023-05-25 12:34:13 +0800 | [diff] [blame] | 597 | + set wireless.${name}.noscan=${noscan} |
developer | 0925793 | 2023-05-09 13:41:30 +0800 | [diff] [blame] | 598 | + set wireless.${name}.disabled=0 |
developer | adbb45b | 2023-06-09 14:43:01 +0800 | [diff] [blame] | 599 | +EOF |
| 600 | + [ -n "$mbssid" ] && { |
| 601 | + uci -q set wireless.${name}.mbssid=${mbssid} |
| 602 | + } |
developer | 2c6592a | 2023-07-21 11:20:56 +0800 | [diff] [blame] | 603 | + [ -n "$rnr" ] && { |
| 604 | + uci -q set wireless.${name}.rnr=${rnr} |
| 605 | + } |
developer | 0925793 | 2023-05-09 13:41:30 +0800 | [diff] [blame] | 606 | |
developer | adbb45b | 2023-06-09 14:43:01 +0800 | [diff] [blame] | 607 | + uci -q batch <<-EOF |
developer | 0925793 | 2023-05-09 13:41:30 +0800 | [diff] [blame] | 608 | set wireless.default_${name}=wifi-iface |
| 609 | set wireless.default_${name}.device=${name} |
developer | 8d77be3 | 2022-10-20 15:08:25 +0800 | [diff] [blame] | 610 | set wireless.default_${name}.network=lan |
| 611 | set wireless.default_${name}.mode=ap |
developer | 0925793 | 2023-05-09 13:41:30 +0800 | [diff] [blame] | 612 | - set wireless.default_${name}.ssid=OpenWrt |
developer | 8d77be3 | 2022-10-20 15:08:25 +0800 | [diff] [blame] | 613 | - set wireless.default_${name}.encryption=none |
developer | 0925793 | 2023-05-09 13:41:30 +0800 | [diff] [blame] | 614 | + set wireless.default_${name}.ssid=OpenWrt-${mode_band} |
developer | 8d77be3 | 2022-10-20 15:08:25 +0800 | [diff] [blame] | 615 | + set wireless.default_${name}.encryption=${encryption} |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 616 | EOF |
developer | 212c0d8 | 2023-07-13 19:41:47 +0800 | [diff] [blame] | 617 | + |
| 618 | + # calibrated board will use eeprom macaddress, not ramdom address |
| 619 | + [ -n "$macaddr" ] && { |
| 620 | + uci -q set wireless.default_${name}.macaddr=${macaddr} |
| 621 | + } |
| 622 | + |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 623 | + [ -n "$key" ] && { |
developer | 8d77be3 | 2022-10-20 15:08:25 +0800 | [diff] [blame] | 624 | + uci -q set wireless.default_${name}.key=${key} |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 625 | + } |
developer | 0925793 | 2023-05-09 13:41:30 +0800 | [diff] [blame] | 626 | + [ -n "$sae_pwe" ] && { |
| 627 | + uci -q set wireless.default_${name}.sae_pwe=${sae_pwe} |
| 628 | + } |
developer | 20ce7bd | 2023-05-20 13:25:14 +0800 | [diff] [blame] | 629 | + [ -n "$ieee80211w" ] && { |
| 630 | + uci -q set wireless.default_${name}.ieee80211w=${ieee80211w} |
| 631 | + } |
developer | e2597ba | 2022-06-24 13:09:16 +0800 | [diff] [blame] | 632 | uci -q commit wireless |
developer | 8d77be3 | 2022-10-20 15:08:25 +0800 | [diff] [blame] | 633 | done |
| 634 | } |
developer | 85839fe | 2023-02-23 10:32:51 +0800 | [diff] [blame] | 635 | diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh |
developer | 619eaa3 | 2023-08-29 13:33:51 +0800 | [diff] [blame^] | 636 | index 65ae662c..6eab470d 100644 |
developer | 85839fe | 2023-02-23 10:32:51 +0800 | [diff] [blame] | 637 | --- a/package/network/services/hostapd/files/hostapd.sh |
| 638 | +++ b/package/network/services/hostapd/files/hostapd.sh |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 639 | @@ -60,7 +60,14 @@ hostapd_append_wpa_key_mgmt() { |
| 640 | [ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-EAP-SHA256" |
| 641 | ;; |
| 642 | sae) |
| 643 | - append wpa_key_mgmt "SAE" |
| 644 | + case "$encryption" in |
| 645 | + *sae-ext*) |
| 646 | + append wpa_key_mgmt "SAE-EXT-KEY" |
| 647 | + ;; |
| 648 | + *) |
| 649 | + append wpa_key_mgmt "SAE" |
| 650 | + ;; |
| 651 | + esac |
| 652 | [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-SAE" |
| 653 | ;; |
| 654 | psk-sae) |
| 655 | @@ -115,6 +122,7 @@ hostapd_common_add_device_config() { |
| 656 | config_add_int rts_threshold |
| 657 | config_add_int rssi_reject_assoc_rssi |
| 658 | config_add_int rssi_ignore_probe_request |
| 659 | + config_add_int rssi_reject_assoc_timeout |
| 660 | config_add_int maxassoc |
| 661 | |
| 662 | config_add_string acs_chan_bias |
| 663 | @@ -227,8 +235,10 @@ hostapd_prepare_device_config() { |
| 664 | hostapd_add_rate brlist "$br" |
| 665 | done |
| 666 | |
| 667 | + json_get_vars rssi_reject_assoc_timeout |
| 668 | [ -n "$rssi_reject_assoc_rssi" ] && append base_cfg "rssi_reject_assoc_rssi=$rssi_reject_assoc_rssi" "$N" |
| 669 | [ -n "$rssi_ignore_probe_request" ] && append base_cfg "rssi_ignore_probe_request=$rssi_ignore_probe_request" "$N" |
| 670 | + [ -n "$rssi_reject_assoc_timeout" ] && append base_cfg "rssi_reject_assoc_timeout=$rssi_reject_assoc_timeout" "$N" |
| 671 | [ -n "$beacon_rate" ] && append base_cfg "beacon_rate=$beacon_rate" "$N" |
| 672 | [ -n "$rlist" ] && append base_cfg "supported_rates=$rlist" "$N" |
| 673 | [ -n "$brlist" ] && append base_cfg "basic_rates=$brlist" "$N" |
| 674 | @@ -379,6 +389,24 @@ hostapd_common_add_bss_config() { |
developer | 8240889 | 2023-03-27 15:09:00 +0800 | [diff] [blame] | 675 | config_add_string fils_dhcp |
| 676 | |
| 677 | config_add_int ocv |
| 678 | + |
| 679 | + config_add_int disable_eht |
| 680 | + config_add_int disable_he |
| 681 | + config_add_int disable_vht |
| 682 | + config_add_int disable_ht |
developer | 813f5d7 | 2023-03-28 17:44:38 +0800 | [diff] [blame] | 683 | + |
developer | f166f54 | 2023-05-25 14:40:30 +0800 | [diff] [blame] | 684 | + config_add_boolean beacon_prot interworking |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 685 | + |
| 686 | + config_add_int unsol_bcast_probe_resp_interval |
| 687 | + config_add_int fils_discovery_min_interval |
| 688 | + config_add_int fils_discovery_max_interval |
| 689 | + config_add_boolean rnr |
| 690 | + |
| 691 | + config_add_array sae_groups |
| 692 | + config_add_array owe_groups |
| 693 | + config_add_array pairwise |
| 694 | + config_add_string group_cipher |
| 695 | + |
developer | 8240889 | 2023-03-27 15:09:00 +0800 | [diff] [blame] | 696 | } |
| 697 | |
| 698 | hostapd_set_vlan_file() { |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 699 | @@ -443,11 +471,11 @@ append_iw_nai_realm() { |
developer | f166f54 | 2023-05-25 14:40:30 +0800 | [diff] [blame] | 700 | } |
| 701 | |
| 702 | append_iw_venue_name() { |
| 703 | - append bss_conf "venue_name=$1" "$N" |
| 704 | + [ -n "$1" ] && append bss_conf "venue_name=$1" "$N" |
| 705 | } |
| 706 | |
| 707 | append_iw_venue_url() { |
| 708 | - append bss_conf "venue_url=$1" "$N" |
| 709 | + [ -n "$1" ] && append bss_conf "venue_url=$1" "$N" |
| 710 | } |
| 711 | |
| 712 | append_hs20_oper_friendly_name() { |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 713 | @@ -565,7 +593,8 @@ hostapd_set_bss_options() { |
| 714 | ppsk airtime_bss_weight airtime_bss_limit airtime_sta_weight \ |
| 715 | multicast_to_unicast_all proxy_arp per_sta_vif \ |
| 716 | eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id \ |
| 717 | - vendor_elements fils ocv |
| 718 | + vendor_elements fils ocv unsol_bcast_probe_resp_interval fils_discovery_min_interval \ |
| 719 | + fils_discovery_max_interval rnr group_cipher |
| 720 | |
| 721 | set_default fils 0 |
| 722 | set_default isolate 0 |
developer | 9097e5e | 2023-07-19 10:22:24 +0800 | [diff] [blame] | 723 | @@ -793,6 +822,35 @@ hostapd_set_bss_options() { |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 724 | local auth_algs="$((($auth_mode_shared << 1) | $auth_mode_open))" |
| 725 | append bss_conf "auth_algs=${auth_algs:-1}" "$N" |
| 726 | append bss_conf "wpa=$wpa" "$N" |
| 727 | + |
| 728 | + json_get_values pairwise pairwise |
developer | 9097e5e | 2023-07-19 10:22:24 +0800 | [diff] [blame] | 729 | + if [ -n "$pairwise" ]; then |
| 730 | + case "$pairwise" in |
| 731 | + *tkip+aes|*tkip+ccmp|*aes+tkip|*ccmp+tkip) |
| 732 | + wpa_cipher="CCMP TKIP" |
| 733 | + ;; |
| 734 | + *ccmp256) |
| 735 | + wpa_cipher="CCMP-256" |
| 736 | + ;; |
| 737 | + *aes|*ccmp) |
| 738 | + wpa_cipher="CCMP" |
| 739 | + ;; |
| 740 | + *tkip) |
| 741 | + wpa_cipher="TKIP" |
| 742 | + ;; |
| 743 | + *gcmp256) |
| 744 | + wpa_cipher="GCMP-256" |
| 745 | + ;; |
| 746 | + *gcmp) |
| 747 | + wpa_cipher="GCMP" |
| 748 | + ;; |
| 749 | + *) |
| 750 | + wpa_cipher="" |
| 751 | + ;; |
| 752 | + esac |
| 753 | + fi |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 754 | + [ -n "$wpa_cipher" ] && wpa_pairwise="$wpa_cipher" |
| 755 | + |
| 756 | [ -n "$wpa_pairwise" ] && append bss_conf "wpa_pairwise=$wpa_pairwise" "$N" |
| 757 | |
| 758 | set_default wps_pushbutton 0 |
developer | 9097e5e | 2023-07-19 10:22:24 +0800 | [diff] [blame] | 759 | @@ -844,7 +902,7 @@ hostapd_set_bss_options() { |
developer | da72319 | 2023-05-22 19:46:10 +0800 | [diff] [blame] | 760 | } |
| 761 | |
| 762 | append bss_conf "ssid=$ssid" "$N" |
| 763 | - [ -n "$network_bridge" ] && append bss_conf "bridge=$network_bridge${N}wds_bridge=" "$N" |
| 764 | + [ -n "$network_bridge" ] && append bss_conf "bridge=$network_bridge${N}wds_bridge=$network_bridge" "$N" |
| 765 | [ -n "$network_ifname" ] && append bss_conf "snoop_iface=$network_ifname" "$N" |
| 766 | [ -n "$iapp_interface" ] && { |
| 767 | local ifname |
developer | 9097e5e | 2023-07-19 10:22:24 +0800 | [diff] [blame] | 768 | @@ -957,6 +1015,8 @@ hostapd_set_bss_options() { |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 769 | fi |
| 770 | |
| 771 | if [ "$wpa" -ge "2" ]; then |
| 772 | + json_get_values sae_groups sae_groups |
| 773 | + json_get_values owe_groups owe_groups |
| 774 | if [ -n "$network_bridge" -a "$rsn_preauth" = 1 ]; then |
| 775 | set_default auth_cache 1 |
| 776 | append bss_conf "rsn_preauth=1" "$N" |
developer | 9097e5e | 2023-07-19 10:22:24 +0800 | [diff] [blame] | 777 | @@ -975,17 +1035,42 @@ hostapd_set_bss_options() { |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 778 | append bss_conf "okc=$auth_cache" "$N" |
| 779 | [ "$auth_cache" = 0 -a "$fils" = 0 ] && append bss_conf "disable_pmksa_caching=1" "$N" |
| 780 | |
| 781 | + [ -z "$group_cipher" ] && group_cipher="$wpa_cipher" |
| 782 | + |
| 783 | + if [ -n "$sae_groups" -o -n "$owe_groups" ]; then |
| 784 | + case "$auth_type" in |
| 785 | + sae*) |
| 786 | + append bss_conf "sae_groups=$sae_groups" "$N" |
| 787 | + append bss_conf "group_cipher=$group_cipher" "$N" |
| 788 | + ;; |
| 789 | + owe) |
| 790 | + append bss_conf "owe_groups=$owe_groups" "$N" |
| 791 | + append bss_conf "group_cipher=$group_cipher" "$N" |
| 792 | + ;; |
| 793 | + esac |
| 794 | + fi |
| 795 | + |
developer | 813f5d7 | 2023-03-28 17:44:38 +0800 | [diff] [blame] | 796 | # RSN -> allow management frame protection |
| 797 | case "$ieee80211w" in |
| 798 | [012]) |
| 799 | - json_get_vars ieee80211w_mgmt_cipher ieee80211w_max_timeout ieee80211w_retry_timeout |
| 800 | + json_get_vars ieee80211w_mgmt_cipher ieee80211w_max_timeout ieee80211w_retry_timeout beacon_prot |
| 801 | append bss_conf "ieee80211w=$ieee80211w" "$N" |
| 802 | [ "$ieee80211w" -gt "0" ] && { |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 803 | + case "$group_cipher" in |
| 804 | + CCMP*) |
| 805 | + ieee80211w_mgmt_cipher="AES-128-CMAC" |
| 806 | + ;; |
| 807 | + GCMP-256) |
| 808 | + [[ "$encryption" != "*owe*" ]] && ieee80211w_mgmt_cipher="BIP-GMAC-256" |
| 809 | + ;; |
| 810 | + esac |
developer | 813f5d7 | 2023-03-28 17:44:38 +0800 | [diff] [blame] | 811 | if [ "$auth_type" = "eap192" ]; then |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 812 | append bss_conf "group_mgmt_cipher=BIP-GMAC-256" "$N" |
developer | 813f5d7 | 2023-03-28 17:44:38 +0800 | [diff] [blame] | 813 | else |
| 814 | append bss_conf "group_mgmt_cipher=${ieee80211w_mgmt_cipher:-AES-128-CMAC}" "$N" |
| 815 | fi |
| 816 | + [ -n "$beacon_prot" ] && \ |
| 817 | + append bss_conf "beacon_prot=$beacon_prot" "$N" |
| 818 | [ -n "$ieee80211w_max_timeout" ] && \ |
| 819 | append bss_conf "assoc_sa_query_max_timeout=$ieee80211w_max_timeout" "$N" |
| 820 | [ -n "$ieee80211w_retry_timeout" ] && \ |
developer | 9097e5e | 2023-07-19 10:22:24 +0800 | [diff] [blame] | 821 | @@ -1050,9 +1135,10 @@ hostapd_set_bss_options() { |
developer | f166f54 | 2023-05-25 14:40:30 +0800 | [diff] [blame] | 822 | json_get_vars iw_roaming_consortium iw_domain_name iw_anqp_3gpp_cell_net iw_nai_realm |
| 823 | json_get_vars iw_anqp_elem iw_qos_map_set iw_ipaddr_type_availability iw_gas_address3 |
| 824 | json_get_vars iw_venue_name iw_venue_url |
| 825 | + json_get_vars interworking |
| 826 | |
| 827 | set_default iw_enabled 0 |
| 828 | - if [ "$iw_enabled" = "1" ]; then |
| 829 | + if [ "$iw_enabled" = "1" ] || [ "$interworking" = "1" ]; then |
| 830 | append bss_conf "interworking=1" "$N" |
| 831 | set_default iw_internet 1 |
| 832 | set_default iw_asra 0 |
developer | 9097e5e | 2023-07-19 10:22:24 +0800 | [diff] [blame] | 833 | @@ -1159,6 +1245,22 @@ hostapd_set_bss_options() { |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 834 | append bss_conf "$val" "$N" |
| 835 | done |
| 836 | |
| 837 | + if [ "$unsol_bcast_probe_resp_interval" -gt 0 ]; then |
| 838 | + append bss_conf "unsol_bcast_probe_resp_interval=$unsol_bcast_probe_resp_interval" "$N" |
| 839 | + fi |
| 840 | + |
| 841 | + if [ -n "$fils_discovery_min_interval" ]; then |
| 842 | + append bss_conf "fils_discovery_min_interval=$fils_discovery_min_interval" "$N" |
| 843 | + fi |
| 844 | + |
| 845 | + if [ -n "$fils_discovery_max_interval" ]; then |
| 846 | + append bss_conf "fils_discovery_max_interval=$fils_discovery_max_interval" "$N" |
| 847 | + fi |
| 848 | + |
| 849 | + if [ -n "$rnr" ]; then |
| 850 | + append bss_conf "rnr=$rnr" "$N" |
| 851 | + fi |
| 852 | + |
developer | 5b3b7a9 | 2023-08-12 03:41:52 +0800 | [diff] [blame] | 853 | append "$var" "$bss_conf" "$N" |
| 854 | return 0 |
| 855 | } |
| 856 | @@ -1246,6 +1348,7 @@ wpa_supplicant_prepare_interface() { |
developer | 18015ad | 2023-07-13 13:18:19 +0800 | [diff] [blame] | 857 | country_str="country=$country" |
| 858 | } |
| 859 | |
developer | 2cf3f4c | 2023-07-24 16:58:25 +0800 | [diff] [blame] | 860 | + local tx_queue_data2_burst="tx_queue_data2_burst=0" |
developer | 18015ad | 2023-07-13 13:18:19 +0800 | [diff] [blame] | 861 | multiap_flag_file="${_config}.is_multiap" |
| 862 | if [ "$multi_ap" = "1" ]; then |
| 863 | touch "$multiap_flag_file" |
developer | 5b3b7a9 | 2023-08-12 03:41:52 +0800 | [diff] [blame] | 864 | @@ -1257,6 +1360,7 @@ wpa_supplicant_prepare_interface() { |
developer | 18015ad | 2023-07-13 13:18:19 +0800 | [diff] [blame] | 865 | ${scan_list:+freq_list=$scan_list} |
| 866 | $ap_scan |
| 867 | $country_str |
| 868 | +$tx_queue_data2_burst |
| 869 | EOF |
| 870 | return 0 |
| 871 | } |
developer | 5b3b7a9 | 2023-08-12 03:41:52 +0800 | [diff] [blame] | 872 | @@ -1528,12 +1632,38 @@ wpa_supplicant_add_network() { |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 873 | ;; |
| 874 | esac |
| 875 | |
developer | bb29b5e | 2023-07-25 20:41:04 +0800 | [diff] [blame] | 876 | - [ "$wpa_cipher" = GCMP ] && { |
| 877 | - append network_data "pairwise=GCMP" "$N$T" |
| 878 | - append network_data "group=GCMP" "$N$T" |
| 879 | - } |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 880 | + json_get_values pairwise pairwise |
developer | 9097e5e | 2023-07-19 10:22:24 +0800 | [diff] [blame] | 881 | + if [ -n "$pairwise" ]; then |
| 882 | + case "$pairwise" in |
| 883 | + *tkip+aes|*tkip+ccmp|*aes+tkip|*ccmp+tkip) |
| 884 | + wpa_cipher="CCMP TKIP" |
| 885 | + ;; |
| 886 | + *ccmp256) |
| 887 | + wpa_cipher="CCMP-256" |
| 888 | + ;; |
| 889 | + *aes|*ccmp) |
| 890 | + wpa_cipher="CCMP" |
| 891 | + ;; |
| 892 | + *tkip) |
| 893 | + wpa_cipher="TKIP" |
| 894 | + ;; |
| 895 | + *gcmp256) |
| 896 | + wpa_cipher="GCMP-256" |
| 897 | + ;; |
| 898 | + *gcmp) |
| 899 | + wpa_cipher="GCMP" |
| 900 | + ;; |
| 901 | + *) |
| 902 | + wpa_cipher="" |
| 903 | + ;; |
| 904 | + esac |
| 905 | + fi |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 906 | + [ -n "$wpa_cipher" ] && wpa_pairwise="$wpa_cipher" |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 907 | |
| 908 | [ "$mode" = mesh ] || { |
| 909 | + json_get_values sae_groups sae_groups |
| 910 | + json_get_values owe_groups owe_groups |
| 911 | + |
| 912 | case "$wpa" in |
| 913 | 1) |
| 914 | append network_data "proto=WPA" "$N$T" |
developer | 5b3b7a9 | 2023-08-12 03:41:52 +0800 | [diff] [blame] | 915 | @@ -1543,12 +1673,48 @@ wpa_supplicant_add_network() { |
developer | 7450311 | 2023-06-29 17:34:49 +0800 | [diff] [blame] | 916 | ;; |
| 917 | esac |
| 918 | |
| 919 | + [ -n "$wpa_pairwise" ] && append network_data "pairwise=$wpa_pairwise" "$N$T" |
| 920 | + [ -z "$group_cipher" ] && group_cipher="$wpa_cipher" |
| 921 | + |
| 922 | + if [ -n "$sae_groups" -o -n "$owe_groups" ]; then |
| 923 | + case "$auth_type" in |
| 924 | + sae*) |
| 925 | + echo "sae_groups=$sae_groups" >> "$_config" |
| 926 | + append network_data "group=$group_cipher" "$N$T" |
| 927 | + ;; |
| 928 | + owe) |
| 929 | + append network_data "owe_group=$owe_groups" "$N$T" |
| 930 | + append network_data "group=$group_cipher" "$N$T" |
| 931 | + ;; |
| 932 | + esac |
| 933 | + fi |
| 934 | + |
| 935 | + # RSN -> allow management frame protection |
| 936 | case "$ieee80211w" in |
| 937 | [012]) |
| 938 | - [ "$wpa" -ge 2 ] && append network_data "ieee80211w=$ieee80211w" "$N$T" |
| 939 | + json_get_vars ieee80211w_mgmt_cipher ieee80211w_max_timeout ieee80211w_retry_timeout beacon_prot |
| 940 | + append network_data "ieee80211w=$ieee80211w" "$N$T" |
| 941 | + [ "$ieee80211w" -gt "0" ] && { |
| 942 | + case "$group_cipher" in |
| 943 | + CCMP*) |
| 944 | + ieee80211w_mgmt_cipher="AES-128-CMAC" |
| 945 | + ;; |
| 946 | + GCMP-256) |
| 947 | + [[ "$encryption" != "*owe*" ]] && ieee80211w_mgmt_cipher="BIP-GMAC-256" |
| 948 | + ;; |
| 949 | + esac |
| 950 | + if [ "$auth_type" = "eap192" ]; then |
| 951 | + append network_data "group_mgmt=BIP-GMAC-256" "$N$T" |
| 952 | + else |
| 953 | + append network_data "group_mgmt=${ieee80211w_mgmt_cipher:-AES-128-CMAC}" "$N$T" |
| 954 | + fi |
| 955 | + [ -n "$beacon_prot" ] && \ |
| 956 | + append network_data "beacon_prot=$beacon_prot" "$N$T" |
| 957 | + } |
| 958 | ;; |
| 959 | esac |
| 960 | } |
| 961 | + |
| 962 | [ -n "$bssid" ] && append network_data "bssid=$bssid" "$N$T" |
| 963 | [ -n "$beacon_int" ] && append network_data "beacon_int=$beacon_int" "$N$T" |
| 964 | |
developer | 5b3b7a9 | 2023-08-12 03:41:52 +0800 | [diff] [blame] | 965 | @@ -1559,6 +1725,20 @@ wpa_supplicant_add_network() { |
developer | 8240889 | 2023-03-27 15:09:00 +0800 | [diff] [blame] | 966 | [ -n "$bssid_blacklist" ] && append network_data "bssid_blacklist=$bssid_blacklist" "$N$T" |
| 967 | [ -n "$bssid_whitelist" ] && append network_data "bssid_whitelist=$bssid_whitelist" "$N$T" |
| 968 | |
| 969 | + local disable_eht |
| 970 | + local disable_he |
| 971 | + local disable_vht |
| 972 | + local disable_ht |
| 973 | + json_get_vars disable_eht |
| 974 | + json_get_vars disable_he |
| 975 | + json_get_vars disable_vht |
| 976 | + json_get_vars disable_ht |
| 977 | + |
| 978 | + [ -n "$disable_eht" ] && append network_data "disable_eht=$disable_eht" "$N$T" |
| 979 | + [ -n "$disable_he" ] && append network_data "disable_he=$disable_he" "$N$T" |
| 980 | + [ -n "$disable_vht" ] && append network_data "disable_vht=$disable_vht" "$N$T" |
| 981 | + [ -n "$disable_ht" ] && append network_data "disable_ht=$disable_ht" "$N$T" |
| 982 | + |
| 983 | [ -n "$basic_rate" ] && { |
| 984 | local br rate_list= |
| 985 | for br in $basic_rate; do |
developer | 5b3b7a9 | 2023-08-12 03:41:52 +0800 | [diff] [blame] | 986 | @@ -1573,6 +1753,11 @@ wpa_supplicant_add_network() { |
developer | 85839fe | 2023-02-23 10:32:51 +0800 | [diff] [blame] | 987 | append network_data "mcast_rate=$mc_rate" "$N$T" |
| 988 | } |
| 989 | |
| 990 | + if [ "$auth_type" = "sae" ]; then |
| 991 | + json_get_vars sae_pwe sae_pwe |
| 992 | + [ -n "$sae_pwe" ] && echo "sae_pwe=$sae_pwe" >> "$_config" |
| 993 | + fi |
| 994 | + |
| 995 | if [ "$key_mgmt" = "WPS" ]; then |
| 996 | echo "wps_cred_processing=1" >> "$_config" |
| 997 | else |