From 42251224b34b3b7dab0922c7d5372b1e787ed54c Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 25 Jun 2021 09:18:09 +0200 Subject: [PATCH] ucentral: development update * more mac80211/hapd script improvements * more led blink/off commands * update ucentral-schema * further improvement on maverick * various ipq807x led improvements Signed-off-by: John Crispin --- .../0038-mac80211-update-to-latest-HEAD.patch | 103 ++++----- .../0039-hostapd-upsate-to-latest-HEAD.patch | 198 ++++++++++++++---- feeds/tip/maverick/files/etc/init.d/maverick | 3 +- feeds/ucentral/ucentral-schema/Makefile | 2 +- .../files/etc/ucentral/examples/unit.json | 75 +++++++ .../libexec/ucentral/ucentral_led_blink.sh | 6 +- feeds/wifi-ax/hostapd/files/hostapd.sh | 47 +++-- .../files/lib/netifd/wireless/mac80211.sh | 43 ++-- ...x-add-the-Qualcomm-AX-target-support.patch | 74 ++++--- ...-a-turnoff-command-to-the-led-script.patch | 24 ++- 10 files changed, 397 insertions(+), 178 deletions(-) create mode 100644 feeds/ucentral/ucentral-schema/files/etc/ucentral/examples/unit.json diff --git a/backports/0038-mac80211-update-to-latest-HEAD.patch b/backports/0038-mac80211-update-to-latest-HEAD.patch index 7af35fff4..796fc1100 100644 --- a/backports/0038-mac80211-update-to-latest-HEAD.patch +++ b/backports/0038-mac80211-update-to-latest-HEAD.patch @@ -1,7 +1,7 @@ -From 8cbdd62c20daadf82ac2058a85523bb7454f390b Mon Sep 17 00:00:00 2001 +From 943d9c1ac5834d572273eef7db8fcec474943e91 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 27 May 2021 13:25:03 +0200 -Subject: [PATCH 01/36] mac80211: update to latest HEAD +Subject: [PATCH 02/36] mac80211: update to latest HEAD Signed-off-by: John Crispin --- @@ -9,7 +9,7 @@ Signed-off-by: John Crispin package/kernel/mac80211/ath.mk | 13 +- package/kernel/mac80211/broadcom.mk | 4 +- .../mac80211/files/lib/netifd/mac80211.sh | 36 - - .../files/lib/netifd/wireless/mac80211.sh | 200 +++-- + .../files/lib/netifd/wireless/mac80211.sh | 179 ++++- .../mac80211/files/lib/wifi/mac80211.sh | 110 ++- package/kernel/mac80211/mac80211.sh.diff | 58 ++ .../patches/ath/402-ath_regd_optional.patch | 2 +- @@ -87,7 +87,7 @@ Signed-off-by: John Crispin ...11-minstrel_ht-fix-sample-time-check.patch | 23 + ...iwlwifi-specific-workaround-that-bro.patch | 51 ++ .../500-mac80211_configure_antenna_gain.patch | 24 +- - 82 files changed, 1547 insertions(+), 1358 deletions(-) + 82 files changed, 1546 insertions(+), 1338 deletions(-) delete mode 100644 package/kernel/mac80211/files/lib/netifd/mac80211.sh create mode 100644 package/kernel/mac80211/mac80211.sh.diff delete mode 100644 package/kernel/mac80211/patches/ath/560-ath9k-fix-transmitting-to-stations-in-dynamic-SMPS-m.patch @@ -352,7 +352,7 @@ index 92e5c0e395..0000000000 - done -} diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh -index 92c56afd24..d92f6605de 100644 +index 92c56afd24..0b7a84d7c9 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -1,7 +1,6 @@ @@ -608,7 +608,7 @@ index 92c56afd24..d92f6605de 100644 mac80211_setup_supplicant_noctl $vif_enable || failed=1 else mac80211_setup_adhoc $vif_enable -@@ -849,9 +943,29 @@ mac80211_setup_vif() { +@@ -849,10 +943,30 @@ mac80211_setup_vif() { get_freq() { local phy="$1" @@ -628,33 +628,33 @@ index 92c56afd24..d92f6605de 100644 + +$1 ~ /Band/ { + band_match = band == $2 -+} -+ + } + +band_match && $3 == "MHz" && $4 == channel { + print $2 + exit - } ++} +' +} + - ++ chan_is_dfs() { local phy="$1" -@@ -921,13 +1035,6 @@ drv_mac80211_setup() { - local found + local chan="$2" +@@ -907,10 +1021,8 @@ drv_mac80211_setup() { + return 1 + } - for wdev in $(list_phy_interfaces "$phy"); do -- found=0 -- for cwdev in $OLDAPLIST $OLDSPLIST $OLDUMLIST; do -- if [ "$wdev" = "$cwdev" ]; then -- found=1 -- break -- fi -- done - if [ "$found" = "0" ]; then - ip link set dev "$wdev" down - iw dev "$wdev" del -@@ -935,7 +1042,7 @@ drv_mac80211_setup() { +- [ -z "$(uci -q -P /var/state show wireless._${phy})" ] && { +- uci -q -P /var/state set wireless._${phy}=phy +- wireless_set_data phy="$phy" +- } ++ wireless_set_data phy="$phy" ++ [ -z "$(uci -q -P /var/state show wireless._${phy})" ] && uci -q -P /var/state set wireless._${phy}=phy + + OLDAPLIST=$(uci -q -P /var/state get wireless._${phy}.aplist) + OLDSPLIST=$(uci -q -P /var/state get wireless._${phy}.splist) +@@ -935,7 +1047,7 @@ drv_mac80211_setup() { done # convert channel to frequency @@ -663,48 +663,25 @@ index 92c56afd24..d92f6605de 100644 [ -n "$country" ] && { iw reg get | grep -q "^country $country:" || { -@@ -992,33 +1099,24 @@ drv_mac80211_setup() { - for_each_interface "sta adhoc mesh monitor" mac80211_prepare_vif - NEWAPLIST= - for_each_interface "ap" mac80211_prepare_vif -- NEW_MD5=$(test -e "${hostapd_conf_file}" && md5sum ${hostapd_conf_file}) -- OLD_MD5=$(uci -q -P /var/state get wireless._${phy}.md5) -- if [ "${NEWAPLIST}" != "${OLDAPLIST}" ]; then -- mac80211_vap_cleanup hostapd "${OLDAPLIST}" -- fi -+ mac80211_vap_cleanup hostapd "${OLDAPLIST}" - [ -n "${NEWAPLIST}" ] && mac80211_iw_interface_add "$phy" "${NEWAPLIST%% *}" __ap - local add_ap=0 - local primary_ap=${NEWAPLIST%% *} +@@ -1003,6 +1115,7 @@ drv_mac80211_setup() { [ -n "$hostapd_ctrl" ] && { local no_reload=1 if [ -n "$(ubus list | grep hostapd.$primary_ap)" ]; then -- [ "${NEW_MD5}" = "${OLD_MD5}" ] || { -- ubus call hostapd.$primary_ap reload -- no_reload=$? -- if [ "$no_reload" != "0" ]; then -- mac80211_vap_cleanup hostapd "${OLDAPLIST}" -- mac80211_vap_cleanup wpa_supplicant "$(uci -q -P /var/state get wireless._${phy}.splist)" -- mac80211_vap_cleanup none "$(uci -q -P /var/state get wireless._${phy}.umlist)" -- sleep 2 -- mac80211_iw_interface_add "$phy" "${NEWAPLIST%% *}" __ap -- for_each_interface "sta adhoc mesh monitor" mac80211_prepare_vif -- fi -- } -+ mac80211_vap_cleanup hostapd "${OLDAPLIST}" -+ mac80211_vap_cleanup wpa_supplicant "$(uci -q -P /var/state get wireless._${phy}.splist)" -+ mac80211_vap_cleanup none "$(uci -q -P /var/state get wireless._${phy}.umlist)" -+ sleep 2 -+ mac80211_iw_interface_add "$phy" "${NEWAPLIST%% *}" __ap -+ for_each_interface "sta adhoc mesh monitor" mac80211_prepare_vif - fi - if [ "$no_reload" != "0" ]; then - add_ap=1 - ubus wait_for hostapd -+ ip link set $primary_ap down - local hostapd_res="$(ubus call hostapd config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}")" - ret="$?" - [ "$ret" != 0 -o -z "$hostapd_res" ] && { ++ no_reload=0 + [ "${NEW_MD5}" = "${OLD_MD5}" ] || { + ubus call hostapd.$primary_ap reload + no_reload=$? +@@ -1077,6 +1190,10 @@ drv_mac80211_teardown() { + json_select data + json_get_vars phy + json_select .. ++ [ -n "$phy" ] || { ++ echo "Bug: PHY is undefined for device '$1'" ++ return 1 ++ } + + mac80211_interface_cleanup "$phy" + uci -q -P /var/state revert wireless._${phy} diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh index 3e99f06693..6aa46b0c74 100644 --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh diff --git a/backports/0039-hostapd-upsate-to-latest-HEAD.patch b/backports/0039-hostapd-upsate-to-latest-HEAD.patch index 11f1d0ace..f1d518e0d 100644 --- a/backports/0039-hostapd-upsate-to-latest-HEAD.patch +++ b/backports/0039-hostapd-upsate-to-latest-HEAD.patch @@ -1,14 +1,14 @@ -From 0c477e5d60ab6c19df882f010a58d911d77ae657 Mon Sep 17 00:00:00 2001 +From 1df5febb67e8f2980ad38e1e320dd1d5c3588610 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 27 May 2021 13:25:19 +0200 -Subject: [PATCH 01/34] hostapd: upsate to latest HEAD +Subject: [PATCH 03/36] hostapd: upsate to latest HEAD Signed-off-by: John Crispin --- package/network/services/hostapd/Makefile | 9 +- .../hostapd/files/hostapd-basic.config | 2 +- .../hostapd/files/hostapd-full.config | 4 +- - .../network/services/hostapd/files/hostapd.sh | 122 ++++++-- + .../network/services/hostapd/files/hostapd.sh | 152 ++++++++-- ...-fix-frequency-setup-with-HE-enabled.patch | 196 ------------- .../001-wolfssl-init-RNG-with-ECC-key.patch | 43 +++ ...-init-order-disable-pri-sec-channel-.patch | 126 --------- @@ -66,7 +66,7 @@ Signed-off-by: John Crispin ...of-secondary-device-types-for-P2P-gr.patch | 33 --- .../services/hostapd/src/src/ap/ubus.c | 70 ++++- .../services/hostapd/src/src/ap/ubus.h | 16 ++ - 61 files changed, 696 insertions(+), 2312 deletions(-) + 61 files changed, 718 insertions(+), 2320 deletions(-) delete mode 100644 package/network/services/hostapd/patches/001-HE-VHT-fix-frequency-setup-with-HE-enabled.patch create mode 100644 package/network/services/hostapd/patches/001-wolfssl-init-RNG-with-ECC-key.patch delete mode 100644 package/network/services/hostapd/patches/002-mesh-fix-channel-init-order-disable-pri-sec-channel-.patch @@ -160,30 +160,20 @@ index df272e443a..61b6daf861 100644 # EAP-SAKE for the integrated EAP server #CONFIG_EAP_SAKE=y diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh -index 45a49b8faa..399352aa89 100644 +index 45a49b8faa..7d035a299b 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh -@@ -49,6 +49,11 @@ hostapd_append_wpa_key_mgmt() { - eap192) - append wpa_key_mgmt "WPA-EAP-SUITE-B-192" - [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-EAP" -+ [ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-EAP-SHA256" -+ ;; -+ eap256) -+ append wpa_key_mgmt "WPA-EAP-SHA256" -+ [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-EAP" - ;; - eap-eap192) - append wpa_key_mgmt "WPA-EAP-SUITE-B-192" -@@ -91,6 +96,7 @@ hostapd_add_log_config() { +@@ -91,14 +91,19 @@ hostapd_add_log_config() { hostapd_common_add_device_config() { config_add_array basic_rate config_add_array supported_rates + config_add_string beacon_rate - config_add_string country +- config_add_string country ++ config_add_string country country3 config_add_boolean country_ie doth -@@ -99,6 +105,10 @@ hostapd_common_add_device_config() { + config_add_boolean spectrum_mgmt_required + config_add_int local_pwr_constraint config_add_string require_mode config_add_boolean legacy_rates config_add_int cell_density @@ -194,17 +184,27 @@ index 45a49b8faa..399352aa89 100644 config_add_string acs_chan_bias config_add_array hostapd_options -@@ -115,7 +125,8 @@ hostapd_prepare_device_config() { +@@ -114,8 +119,9 @@ hostapd_prepare_device_config() { + local base_cfg= - json_get_vars country country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \ +- json_get_vars country country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \ - acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density ++ json_get_vars country country3 country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \ + acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density \ + rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc hostapd_set_log_options base_cfg -@@ -206,11 +217,16 @@ hostapd_prepare_device_config() { +@@ -128,6 +134,7 @@ hostapd_prepare_device_config() { + + [ -n "$country" ] && { + append base_cfg "country_code=$country" "$N" ++ [ -n "$country3" ] && append base_cfg "country3=$country3" "$N" + + [ "$country_ie" -gt 0 ] && { + append base_cfg "ieee80211d=1" "$N" +@@ -206,11 +213,16 @@ hostapd_prepare_device_config() { hostapd_add_rate brlist "$br" done @@ -221,7 +221,16 @@ index 45a49b8faa..399352aa89 100644 json_get_values opts hostapd_options for val in $opts; do -@@ -266,7 +282,7 @@ hostapd_common_add_bss_config() { +@@ -251,6 +263,8 @@ hostapd_common_add_bss_config() { + config_add_int acct_port + config_add_int acct_interval + ++ config_add_int bss_load_update_period chan_util_avg_period ++ + config_add_string dae_client + config_add_string dae_secret + config_add_int dae_port +@@ -266,7 +280,7 @@ hostapd_common_add_bss_config() { config_add_array domain_match domain_match2 domain_suffix_match domain_suffix_match2 config_add_string ieee80211w_mgmt_cipher @@ -230,6 +239,26 @@ index 45a49b8faa..399352aa89 100644 config_add_string vlan_tagged_interface vlan_bridge config_add_string vlan_file +@@ -281,9 +295,10 @@ hostapd_common_add_bss_config() { + config_add_string wps_device_type wps_device_name wps_manufacturer wps_pin + config_add_string multi_ap_backhaul_ssid multi_ap_backhaul_key + +- config_add_boolean wnm_sleep_mode bss_transition ++ config_add_boolean wnm_sleep_mode wnm_sleep_mode_no_keys bss_transition + config_add_int time_advertisement + config_add_string time_zone ++ config_add_string vendor_elements + + config_add_boolean ieee80211k rrm_neighbor_report rrm_beacon_report + +@@ -308,6 +323,7 @@ hostapd_common_add_bss_config() { + config_add_array supported_rates + + config_add_boolean sae_require_mfp ++ config_add_int sae_pwe + + config_add_string 'owe_transition_bssid:macaddr' 'owe_transition_ssid:string' + @@ -316,7 +332,7 @@ hostapd_common_add_bss_config() { config_add_int iw_ipaddr_type_availability iw_gas_address3 config_add_string iw_hessid iw_network_auth_type iw_qos_map_set @@ -239,7 +268,7 @@ index 45a49b8faa..399352aa89 100644 config_add_boolean hs20 disable_dgaf osen config_add_int anqp_domain_id -@@ -327,12 +343,21 @@ hostapd_common_add_bss_config() { +@@ -327,12 +343,22 @@ hostapd_common_add_bss_config() { config_add_array hs20_conn_capab config_add_string osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp @@ -252,6 +281,7 @@ index 45a49b8faa..399352aa89 100644 + config_add_boolean multicast_to_unicast proxy_arp per_sta_vif config_add_array hostapd_bss_options ++ config_add_boolean default_disabled + + config_add_boolean request_cui + config_add_array radius_auth_req_attr @@ -262,7 +292,7 @@ index 45a49b8faa..399352aa89 100644 } hostapd_set_vlan_file() { -@@ -396,10 +421,22 @@ append_iw_nai_realm() { +@@ -396,10 +422,22 @@ append_iw_nai_realm() { [ -n "$1" ] && append bss_conf "nai_realm=$1" "$N" } @@ -285,7 +315,7 @@ index 45a49b8faa..399352aa89 100644 append_osu_provider_service_desc() { append bss_conf "osu_service_desc=$1" "$N" } -@@ -447,6 +484,7 @@ append_osu_provider() { +@@ -447,6 +485,7 @@ append_osu_provider() { append bss_conf "osu_method_list=$osu_method_list" "$N" config_list_foreach "$1" osu_service_desc append_osu_provider_service_desc @@ -293,7 +323,7 @@ index 45a49b8faa..399352aa89 100644 config_list_foreach "$1" osu_icon append_osu_icon append bss_conf "$N" -@@ -456,6 +494,14 @@ append_hs20_conn_capab() { +@@ -456,6 +495,14 @@ append_hs20_conn_capab() { [ -n "$1" ] && append bss_conf "hs20_conn_capab=$1" "$N" } @@ -302,23 +332,28 @@ index 45a49b8faa..399352aa89 100644 +} + +append_radius_auth_req_attr() { -+ [ -n "$1" ] && append bss_conf "radius_auth_req_attr=$1" "$N" ++ [ -n "$1" ] && append bss_conf "radius_auth_req_attr=$1" "$N" +} + append_airtime_sta_weight() { [ -n "$1" ] && append bss_conf "airtime_sta_weight=$1" "$N" } -@@ -482,7 +528,8 @@ hostapd_set_bss_options() { - bss_load_update_period chan_util_avg_period sae_require_mfp \ +@@ -479,10 +526,12 @@ hostapd_set_bss_options() { + macfilter ssid utf8_ssid wmm uapsd hidden short_preamble rsn_preauth \ + iapp_interface eapol_version dynamic_vlan ieee80211w nasid \ + acct_server acct_secret acct_port acct_interval \ +- bss_load_update_period chan_util_avg_period sae_require_mfp \ ++ bss_load_update_period chan_util_avg_period sae_require_mfp sae_pwe \ multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key skip_inactivity_poll \ airtime_bss_weight airtime_bss_limit airtime_sta_weight \ - multicast_to_unicast per_sta_vif + multicast_to_unicast proxy_arp per_sta_vif \ -+ eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id ++ eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id \ ++ vendor_elements set_default isolate 0 set_default maxassoc 0 -@@ -503,6 +550,7 @@ hostapd_set_bss_options() { +@@ -503,6 +552,7 @@ hostapd_set_bss_options() { set_default multi_ap 0 set_default airtime_bss_weight 0 set_default airtime_bss_limit 0 @@ -326,7 +361,15 @@ index 45a49b8faa..399352aa89 100644 append bss_conf "ctrl_interface=/var/run/hostapd" if [ "$isolate" -gt 0 ]; then -@@ -547,6 +595,7 @@ hostapd_set_bss_options() { +@@ -529,6 +579,7 @@ hostapd_set_bss_options() { + append bss_conf "uapsd_advertisement_enabled=$uapsd" "$N" + append bss_conf "utf8_ssid=$utf8_ssid" "$N" + append bss_conf "multi_ap=$multi_ap" "$N" ++ [ -n "$vendor_elements" ] && append bss_conf "vendor_elements=$vendor_elements" "$N" + + [ "$tdls_prohibit" -gt 0 ] && append bss_conf "tdls_prohibit=$tdls_prohibit" "$N" + +@@ -547,6 +598,7 @@ hostapd_set_bss_options() { append bss_conf "acct_server_shared_secret=$acct_secret" "$N" [ -n "$acct_interval" ] && \ append bss_conf "radius_acct_interim_interval=$acct_interval" "$N" @@ -334,7 +377,15 @@ index 45a49b8faa..399352aa89 100644 } case "$auth_type" in -@@ -601,7 +650,7 @@ hostapd_set_bss_options() { +@@ -560,6 +612,7 @@ hostapd_set_bss_options() { + ;; + esac + [ -n "$sae_require_mfp" ] && append bss_conf "sae_require_mfp=$sae_require_mfp" "$N" ++ [ -n "$sae_pwe" ] && append bss_conf "sae_pwe=$sae_pwe" "$N" + + local vlan_possible="" + +@@ -601,7 +654,7 @@ hostapd_set_bss_options() { auth_server auth_secret auth_port \ dae_client dae_secret dae_port \ ownip radius_client_addr \ @@ -343,7 +394,7 @@ index 45a49b8faa..399352aa89 100644 # radius can provide VLAN ID for clients vlan_possible=1 -@@ -613,18 +662,22 @@ hostapd_set_bss_options() { +@@ -613,18 +666,22 @@ hostapd_set_bss_options() { set_default auth_port 1812 set_default dae_port 3799 @@ -370,7 +421,27 @@ index 45a49b8faa..399352aa89 100644 [ -n "$ownip" ] && append bss_conf "own_ip_addr=$ownip" "$N" [ -n "$radius_client_addr" ] && append bss_conf "radius_client_addr=$radius_client_addr" "$N" -@@ -733,7 +786,7 @@ hostapd_set_bss_options() { +@@ -703,13 +760,17 @@ hostapd_set_bss_options() { + append bss_conf "iapp_interface=$ifname" "$N" + } + +- json_get_vars time_advertisement time_zone wnm_sleep_mode bss_transition ++ json_get_vars time_advertisement time_zone wnm_sleep_mode wnm_sleep_mode_no_keys bss_transition + set_default bss_transition 0 + set_default wnm_sleep_mode 0 ++ set_default wnm_sleep_mode_no_keys 0 + + [ -n "$time_advertisement" ] && append bss_conf "time_advertisement=$time_advertisement" "$N" + [ -n "$time_zone" ] && append bss_conf "time_zone=$time_zone" "$N" +- [ "$wnm_sleep_mode" -eq "1" ] && append bss_conf "wnm_sleep_mode=1" "$N" ++ if [ "$wnm_sleep_mode" -eq "1" ]; then ++ append bss_conf "wnm_sleep_mode=1" "$N" ++ [ "$wnm_sleep_mode_no_keys" -eq "1" ] && append bss_conf "wnm_sleep_mode_no_keys=1" "$N" ++ fi + [ "$bss_transition" -eq "1" ] && append bss_conf "bss_transition=1" "$N" + + json_get_vars ieee80211k rrm_neighbor_report rrm_beacon_report +@@ -733,7 +794,7 @@ hostapd_set_bss_options() { append bss_conf "ftm_responder=1" "$N" [ "$stationary_ap" -eq "1" ] && append bss_conf "stationary_ap=1" "$N" [ -n "$lci" ] && append bss_conf "lci=$lci" "$N" @@ -379,7 +450,15 @@ index 45a49b8faa..399352aa89 100644 } fi -@@ -771,6 +824,13 @@ hostapd_set_bss_options() { +@@ -757,6 +818,7 @@ hostapd_set_bss_options() { + ;; + esac + ++ [ -n "$network_ifname" ] && append bss_conf "ft_iface=$network_ifname" "$N" + append bss_conf "mobility_domain=$mobility_domain" "$N" + append bss_conf "ft_psk_generate_local=$ft_psk_generate_local" "$N" + append bss_conf "ft_over_ds=$ft_over_ds" "$N" +@@ -771,6 +833,13 @@ hostapd_set_bss_options() { set_default r0_key_lifetime 10000 set_default pmk_r1_push 0 @@ -393,7 +472,7 @@ index 45a49b8faa..399352aa89 100644 [ -n "$r1_key_holder" ] && append bss_conf "r1_key_holder=$r1_key_holder" "$N" append bss_conf "r0_key_lifetime=$r0_key_lifetime" "$N" append bss_conf "pmk_r1_push=$pmk_r1_push" "$N" -@@ -856,13 +916,17 @@ hostapd_set_bss_options() { +@@ -856,13 +925,17 @@ hostapd_set_bss_options() { } [ -n "$vlan_possible" -a -n "$dynamic_vlan" ] && { @@ -413,7 +492,7 @@ index 45a49b8faa..399352aa89 100644 [ -n "$vlan_tagged_interface" ] && \ append bss_conf "vlan_tagged_interface=$vlan_tagged_interface" "$N" [ -n "$vlan_file" ] && { -@@ -875,6 +939,7 @@ hostapd_set_bss_options() { +@@ -875,6 +948,7 @@ hostapd_set_bss_options() { json_get_vars iw_hessid iw_venue_group iw_venue_type iw_network_auth_type json_get_vars iw_roaming_consortium iw_domain_name iw_anqp_3gpp_cell_net iw_nai_realm json_get_vars iw_anqp_elem iw_qos_map_set iw_ipaddr_type_availability iw_gas_address3 @@ -421,7 +500,7 @@ index 45a49b8faa..399352aa89 100644 set_default iw_enabled 0 if [ "$iw_enabled" = "1" ]; then -@@ -903,6 +968,8 @@ hostapd_set_bss_options() { +@@ -903,6 +977,8 @@ hostapd_set_bss_options() { json_for_each_item append_iw_roaming_consortium iw_roaming_consortium json_for_each_item append_iw_anqp_elem iw_anqp_elem json_for_each_item append_iw_nai_realm iw_nai_realm @@ -430,7 +509,7 @@ index 45a49b8faa..399352aa89 100644 iw_domain_name_conf= json_for_each_item append_iw_domain_name iw_domain_name -@@ -917,9 +984,11 @@ hostapd_set_bss_options() { +@@ -917,9 +993,11 @@ hostapd_set_bss_options() { local hs20 disable_dgaf osen anqp_domain_id hs20_deauth_req_timeout \ @@ -444,7 +523,7 @@ index 45a49b8faa..399352aa89 100644 set_default hs20 0 set_default disable_dgaf $hs20 -@@ -938,16 +1007,31 @@ hostapd_set_bss_options() { +@@ -938,16 +1016,31 @@ hostapd_set_bss_options() { [ -n "$hs20_operating_class" ] && append bss_conf "hs20_operating_class=$hs20_operating_class" "$N" [ -n "$hs20_t_c_filename" ] && append bss_conf "hs20_t_c_filename=$hs20_t_c_filename" "$N" [ -n "$hs20_t_c_timestamp" ] && append bss_conf "hs20_t_c_timestamp=$hs20_t_c_timestamp" "$N" @@ -477,7 +556,7 @@ index 45a49b8faa..399352aa89 100644 set_default per_sta_vif 0 if [ "$per_sta_vif" -gt 0 ]; then -@@ -1079,9 +1163,9 @@ wpa_supplicant_set_fixed_freq() { +@@ -1079,9 +1172,9 @@ wpa_supplicant_set_fixed_freq() { VHT*) append network_data "vht=1" "$N$T";; esac case "$htmode" in @@ -490,6 +569,36 @@ index 45a49b8faa..399352aa89 100644 *) append network_data "disable_vht=1" "$N$T";; esac } +@@ -1099,7 +1192,8 @@ wpa_supplicant_add_network() { + ssid bssid key \ + basic_rate mcast_rate \ + ieee80211w ieee80211r \ +- multi_ap ++ multi_ap \ ++ default_disabled + + case "$auth_type" in + sae|owe|eap192|eap-eap192) +@@ -1112,6 +1206,7 @@ wpa_supplicant_add_network() { + + set_default ieee80211r 0 + set_default multi_ap 0 ++ set_default default_disabled 0 + + local key_mgmt='NONE' + local network_data= +@@ -1143,7 +1238,10 @@ wpa_supplicant_add_network() { + scan_ssid="" + } + +- [ "$multi_ap" = 1 -a "$_w_mode" = "sta" ] && append network_data "multi_ap_backhaul_sta=1" "$N$T" ++ [ "$_w_mode" = "sta" ] && { ++ [ "$multi_ap" = 1 ] && append network_data "multi_ap_backhaul_sta=1" "$N$T" ++ [ "$default_disabled" = 1 ] && append network_data "disabled=1" "$N$T" ++ } + + case "$auth_type" in + none) ;; diff --git a/package/network/services/hostapd/patches/001-HE-VHT-fix-frequency-setup-with-HE-enabled.patch b/package/network/services/hostapd/patches/001-HE-VHT-fix-frequency-setup-with-HE-enabled.patch deleted file mode 100644 index 37c17c50af..0000000000 @@ -4973,3 +5082,4 @@ index e16017394f..acdac74360 100644 { -- 2.25.1 + diff --git a/feeds/tip/maverick/files/etc/init.d/maverick b/feeds/tip/maverick/files/etc/init.d/maverick index 74bd525f5..1968acde2 100755 --- a/feeds/tip/maverick/files/etc/init.d/maverick +++ b/feeds/tip/maverick/files/etc/init.d/maverick @@ -6,7 +6,8 @@ USE_PROCD=1 PROG=/usr/sbin/maverick start_service() { - [ -f /etc/ucentral/ucentral.active ] && return 0 + active=$(readlink /etc/ucentral/ucentral.active) + [ -n "$active" -a "$active" != "/etc/ucentral/ucentral.cfg.0000000001" ] && return 0 procd_open_instance procd_set_param command "$PROG" procd_close_instance diff --git a/feeds/ucentral/ucentral-schema/Makefile b/feeds/ucentral/ucentral-schema/Makefile index 93af2bdb1..6da2e1fd8 100644 --- a/feeds/ucentral/ucentral-schema/Makefile +++ b/feeds/ucentral/ucentral-schema/Makefile @@ -6,7 +6,7 @@ PKG_RELEASE:=1 PKG_SOURCE_URL=https://github.com/blogic/ucentral-schema.git PKG_SOURCE_PROTO:=git PKG_SOURCE_DATE:=2021-02-15 -PKG_SOURCE_VERSION:=d40781dbab7a1574d03061e2cae5ba92cdba1c55 +PKG_SOURCE_VERSION:=1364520714bc7666705b1395714a2d752c0e9b67 PKG_MAINTAINER:=John Crispin PKG_LICENSE:=BSD-3-Clause diff --git a/feeds/ucentral/ucentral-schema/files/etc/ucentral/examples/unit.json b/feeds/ucentral/ucentral-schema/files/etc/ucentral/examples/unit.json new file mode 100644 index 000000000..95ebf3105 --- /dev/null +++ b/feeds/ucentral/ucentral-schema/files/etc/ucentral/examples/unit.json @@ -0,0 +1,75 @@ +{ + "uuid": 2, + "unit": { + "name": "test-name", + "location": "garden", + "timezone": "EST5EDT,M3.2.0,M11.1.0", + "led-active": false + }, + "radios": [ + { + "band": "2G", + "country": "CA", + "channel-mode": "HE", + "channel-width": 80, + "channel": 32 + } + ], + + "interfaces": [ + { + "name": "WAN", + "role": "upstream", + "services": [ "lldp" ], + "ethernet": [ + { + "select-ports": [ + "WAN*" + ] + } + ], + "ipv4": { + "addressing": "dynamic" + } + }, + { + "name": "LAN", + "role": "downstream", + "services": [ "ssh", "lldp" ], + "ethernet": [ + { + "select-ports": [ + "LAN*" + ] + } + ], + "ipv4": { + "addressing": "static", + "subnet": "192.168.1.1/24", + "dhcp": { + "lease-first": 10, + "lease-count": 100, + "lease-time": "6h" + } + } + } + ], + "metrics": { + "statistics": { + "interval": 120, + "types": [ "ssids", "lldp", "clients" ] + }, + "health": { + "interval": 120 + } + }, + "services": { + "lldp": { + "describe": "uCentral", + "location": "universe" + }, + "ssh": { + "port": 22 + } + } +} diff --git a/feeds/ucentral/ucentral-schema/files/usr/libexec/ucentral/ucentral_led_blink.sh b/feeds/ucentral/ucentral-schema/files/usr/libexec/ucentral/ucentral_led_blink.sh index d4ae0b4b6..e156ca7f6 100755 --- a/feeds/ucentral/ucentral-schema/files/usr/libexec/ucentral/ucentral_led_blink.sh +++ b/feeds/ucentral/ucentral-schema/files/usr/libexec/ucentral/ucentral_led_blink.sh @@ -2,9 +2,7 @@ timeout=$1 -. /etc/diag.sh -set_state upgrade +/etc/init.d/led blink sleep $1 -status_led_off -set_state done +/etc/init.d/led restart exit 0 diff --git a/feeds/wifi-ax/hostapd/files/hostapd.sh b/feeds/wifi-ax/hostapd/files/hostapd.sh index 399352aa8..c8b2b24b0 100644 --- a/feeds/wifi-ax/hostapd/files/hostapd.sh +++ b/feeds/wifi-ax/hostapd/files/hostapd.sh @@ -51,10 +51,6 @@ hostapd_append_wpa_key_mgmt() { [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-EAP" [ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-EAP-SHA256" ;; - eap256) - append wpa_key_mgmt "WPA-EAP-SHA256" - [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-EAP" - ;; eap-eap192) append wpa_key_mgmt "WPA-EAP-SUITE-B-192" append wpa_key_mgmt "WPA-EAP" @@ -98,7 +94,7 @@ hostapd_common_add_device_config() { config_add_array supported_rates config_add_string beacon_rate - config_add_string country + config_add_string country country3 config_add_boolean country_ie doth config_add_boolean spectrum_mgmt_required config_add_int local_pwr_constraint @@ -124,7 +120,7 @@ hostapd_prepare_device_config() { local base_cfg= - json_get_vars country country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \ + json_get_vars country country3 country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \ acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density \ rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc @@ -139,6 +135,7 @@ hostapd_prepare_device_config() { [ -n "$country" ] && { append base_cfg "country_code=$country" "$N" + [ -n "$country3" ] && append base_cfg "country3=$country3" "$N" [ "$country_ie" -gt 0 ] && { append base_cfg "ieee80211d=1" "$N" @@ -267,6 +264,8 @@ hostapd_common_add_bss_config() { config_add_int acct_port config_add_int acct_interval + config_add_int bss_load_update_period chan_util_avg_period + config_add_string dae_client config_add_string dae_secret config_add_int dae_port @@ -297,9 +296,10 @@ hostapd_common_add_bss_config() { config_add_string wps_device_type wps_device_name wps_manufacturer wps_pin config_add_string multi_ap_backhaul_ssid multi_ap_backhaul_key - config_add_boolean wnm_sleep_mode bss_transition + config_add_boolean wnm_sleep_mode wnm_sleep_mode_no_keys bss_transition config_add_int time_advertisement config_add_string time_zone + config_add_string vendor_elements config_add_boolean ieee80211k rrm_neighbor_report rrm_beacon_report @@ -324,6 +324,7 @@ hostapd_common_add_bss_config() { config_add_array supported_rates config_add_boolean sae_require_mfp + config_add_int sae_pwe config_add_string 'owe_transition_bssid:macaddr' 'owe_transition_ssid:string' @@ -351,6 +352,7 @@ hostapd_common_add_bss_config() { config_add_boolean multicast_to_unicast proxy_arp per_sta_vif config_add_array hostapd_bss_options + config_add_boolean default_disabled config_add_boolean request_cui config_add_array radius_auth_req_attr @@ -364,8 +366,8 @@ hostapd_set_vlan_file() { local ifname="$1" local vlan="$2" json_get_vars name vid - echo "${vid} ${ifname}-${name}" >> /var/run/hostapd-${ifname}.vlan - wireless_add_vlan "${vlan}" "${ifname}-${name}" + echo "${vid} ${ifname}.${name}" >> /var/run/hostapd-${ifname}.vlan + wireless_add_vlan "${vlan}" "${ifname}.${name}" } hostapd_set_vlan() { @@ -499,7 +501,7 @@ append_radius_acct_req_attr() { } append_radius_auth_req_attr() { - [ -n "$1" ] && append bss_conf "radius_auth_req_attr=$1" "$N" + [ -n "$1" ] && append bss_conf "radius_auth_req_attr=$1" "$N" } append_airtime_sta_weight() { @@ -525,11 +527,12 @@ hostapd_set_bss_options() { macfilter ssid utf8_ssid wmm uapsd hidden short_preamble rsn_preauth \ iapp_interface eapol_version dynamic_vlan ieee80211w nasid \ acct_server acct_secret acct_port acct_interval \ - bss_load_update_period chan_util_avg_period sae_require_mfp \ + bss_load_update_period chan_util_avg_period sae_require_mfp sae_pwe \ multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key skip_inactivity_poll \ airtime_bss_weight airtime_bss_limit airtime_sta_weight \ multicast_to_unicast proxy_arp per_sta_vif \ - eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id + eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id \ + vendor_elements set_default isolate 0 set_default maxassoc 0 @@ -577,6 +580,7 @@ hostapd_set_bss_options() { append bss_conf "uapsd_advertisement_enabled=$uapsd" "$N" append bss_conf "utf8_ssid=$utf8_ssid" "$N" append bss_conf "multi_ap=$multi_ap" "$N" + [ -n "$vendor_elements" ] && append bss_conf "vendor_elements=$vendor_elements" "$N" [ "$tdls_prohibit" -gt 0 ] && append bss_conf "tdls_prohibit=$tdls_prohibit" "$N" @@ -609,6 +613,7 @@ hostapd_set_bss_options() { ;; esac [ -n "$sae_require_mfp" ] && append bss_conf "sae_require_mfp=$sae_require_mfp" "$N" + [ -n "$sae_pwe" ] && append bss_conf "sae_pwe=$sae_pwe" "$N" local vlan_possible="" @@ -756,13 +761,17 @@ hostapd_set_bss_options() { append bss_conf "iapp_interface=$ifname" "$N" } - json_get_vars time_advertisement time_zone wnm_sleep_mode bss_transition + json_get_vars time_advertisement time_zone wnm_sleep_mode wnm_sleep_mode_no_keys bss_transition set_default bss_transition 0 set_default wnm_sleep_mode 0 + set_default wnm_sleep_mode_no_keys 0 [ -n "$time_advertisement" ] && append bss_conf "time_advertisement=$time_advertisement" "$N" [ -n "$time_zone" ] && append bss_conf "time_zone=$time_zone" "$N" - [ "$wnm_sleep_mode" -eq "1" ] && append bss_conf "wnm_sleep_mode=1" "$N" + if [ "$wnm_sleep_mode" -eq "1" ]; then + append bss_conf "wnm_sleep_mode=1" "$N" + [ "$wnm_sleep_mode_no_keys" -eq "1" ] && append bss_conf "wnm_sleep_mode_no_keys=1" "$N" + fi [ "$bss_transition" -eq "1" ] && append bss_conf "bss_transition=1" "$N" json_get_vars ieee80211k rrm_neighbor_report rrm_beacon_report @@ -810,6 +819,7 @@ hostapd_set_bss_options() { ;; esac + [ -n "$network_ifname" ] && append bss_conf "ft_iface=$network_ifname" "$N" append bss_conf "mobility_domain=$mobility_domain" "$N" append bss_conf "ft_psk_generate_local=$ft_psk_generate_local" "$N" append bss_conf "ft_over_ds=$ft_over_ds" "$N" @@ -1183,7 +1193,8 @@ wpa_supplicant_add_network() { ssid bssid key \ basic_rate mcast_rate \ ieee80211w ieee80211r \ - multi_ap + multi_ap \ + default_disabled case "$auth_type" in sae|owe|eap192|eap-eap192) @@ -1196,6 +1207,7 @@ wpa_supplicant_add_network() { set_default ieee80211r 0 set_default multi_ap 0 + set_default default_disabled 0 local key_mgmt='NONE' local network_data= @@ -1227,7 +1239,10 @@ wpa_supplicant_add_network() { scan_ssid="" } - [ "$multi_ap" = 1 -a "$_w_mode" = "sta" ] && append network_data "multi_ap_backhaul_sta=1" "$N$T" + [ "$_w_mode" = "sta" ] && { + [ "$multi_ap" = 1 ] && append network_data "multi_ap_backhaul_sta=1" "$N$T" + [ "$default_disabled" = 1 ] && append network_data "disabled=1" "$N$T" + } case "$auth_type" in none) ;; diff --git a/feeds/wifi-ax/mac80211/files/lib/netifd/wireless/mac80211.sh b/feeds/wifi-ax/mac80211/files/lib/netifd/wireless/mac80211.sh index d92f6605d..0b7a84d7c 100644 --- a/feeds/wifi-ax/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/feeds/wifi-ax/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -1021,10 +1021,8 @@ drv_mac80211_setup() { return 1 } - [ -z "$(uci -q -P /var/state show wireless._${phy})" ] && { - uci -q -P /var/state set wireless._${phy}=phy - wireless_set_data phy="$phy" - } + wireless_set_data phy="$phy" + [ -z "$(uci -q -P /var/state show wireless._${phy})" ] && uci -q -P /var/state set wireless._${phy}=phy OLDAPLIST=$(uci -q -P /var/state get wireless._${phy}.aplist) OLDSPLIST=$(uci -q -P /var/state get wireless._${phy}.splist) @@ -1035,6 +1033,13 @@ drv_mac80211_setup() { local found for wdev in $(list_phy_interfaces "$phy"); do + found=0 + for cwdev in $OLDAPLIST $OLDSPLIST $OLDUMLIST; do + if [ "$wdev" = "$cwdev" ]; then + found=1 + break + fi + done if [ "$found" = "0" ]; then ip link set dev "$wdev" down iw dev "$wdev" del @@ -1099,24 +1104,34 @@ drv_mac80211_setup() { for_each_interface "sta adhoc mesh monitor" mac80211_prepare_vif NEWAPLIST= for_each_interface "ap" mac80211_prepare_vif - mac80211_vap_cleanup hostapd "${OLDAPLIST}" + NEW_MD5=$(test -e "${hostapd_conf_file}" && md5sum ${hostapd_conf_file}) + OLD_MD5=$(uci -q -P /var/state get wireless._${phy}.md5) + if [ "${NEWAPLIST}" != "${OLDAPLIST}" ]; then + mac80211_vap_cleanup hostapd "${OLDAPLIST}" + fi [ -n "${NEWAPLIST}" ] && mac80211_iw_interface_add "$phy" "${NEWAPLIST%% *}" __ap local add_ap=0 local primary_ap=${NEWAPLIST%% *} [ -n "$hostapd_ctrl" ] && { local no_reload=1 if [ -n "$(ubus list | grep hostapd.$primary_ap)" ]; then - mac80211_vap_cleanup hostapd "${OLDAPLIST}" - mac80211_vap_cleanup wpa_supplicant "$(uci -q -P /var/state get wireless._${phy}.splist)" - mac80211_vap_cleanup none "$(uci -q -P /var/state get wireless._${phy}.umlist)" - sleep 2 - mac80211_iw_interface_add "$phy" "${NEWAPLIST%% *}" __ap - for_each_interface "sta adhoc mesh monitor" mac80211_prepare_vif + no_reload=0 + [ "${NEW_MD5}" = "${OLD_MD5}" ] || { + ubus call hostapd.$primary_ap reload + no_reload=$? + if [ "$no_reload" != "0" ]; then + mac80211_vap_cleanup hostapd "${OLDAPLIST}" + mac80211_vap_cleanup wpa_supplicant "$(uci -q -P /var/state get wireless._${phy}.splist)" + mac80211_vap_cleanup none "$(uci -q -P /var/state get wireless._${phy}.umlist)" + sleep 2 + mac80211_iw_interface_add "$phy" "${NEWAPLIST%% *}" __ap + for_each_interface "sta adhoc mesh monitor" mac80211_prepare_vif + fi + } fi if [ "$no_reload" != "0" ]; then add_ap=1 ubus wait_for hostapd - ip link set $primary_ap down local hostapd_res="$(ubus call hostapd config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}")" ret="$?" [ "$ret" != 0 -o -z "$hostapd_res" ] && { @@ -1175,6 +1190,10 @@ drv_mac80211_teardown() { json_select data json_get_vars phy json_select .. + [ -n "$phy" ] || { + echo "Bug: PHY is undefined for device '$1'" + return 1 + } mac80211_interface_cleanup "$phy" uci -q -P /var/state revert wireless._${phy} diff --git a/patches/0017-ipq807x-add-the-Qualcomm-AX-target-support.patch b/patches/0017-ipq807x-add-the-Qualcomm-AX-target-support.patch index 1bf1ab111..123854456 100644 --- a/patches/0017-ipq807x-add-the-Qualcomm-AX-target-support.patch +++ b/patches/0017-ipq807x-add-the-Qualcomm-AX-target-support.patch @@ -1,7 +1,7 @@ -From 7890393e2bb05b5d9e9cf351642b99585b068a13 Mon Sep 17 00:00:00 2001 +From a524aed3cf42831f98fdd88ef31e3eb491372d0e Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sat, 18 Jul 2020 08:53:44 +0200 -Subject: [PATCH 01/14] ipq807x: add the Qualcomm AX target support +Subject: [PATCH 21/36] ipq807x: add the Qualcomm AX target support Signed-off-by: John Crispin --- @@ -12,7 +12,7 @@ Signed-off-by: John Crispin .../etc/hotplug.d/firmware/11-ath10k-caldata | 5 + target/linux/ipq807x/109-logspam.patch | 24 + target/linux/ipq807x/Makefile | 22 + - .../ipq807x/base-files/etc/board.d/01_leds | 35 + + .../ipq807x/base-files/etc/board.d/01_leds | 36 + .../ipq807x/base-files/etc/board.d/02_network | 77 + .../etc/hotplug.d/firmware/10-ath11k-caldata | 97 ++ .../ipq807x/base-files/etc/init.d/aq_phy | 15 + @@ -53,7 +53,7 @@ Signed-off-by: John Crispin .../linux/ipq807x/patches/108-log-spam.patch | 37 + target/linux/ipq807x/patches/109-tplink.patch | 1518 +++++++++++++++++ .../ipq807x/patches/110-add-esmt-nand.patch | 37 + - 48 files changed, 9338 insertions(+), 3 deletions(-) + 48 files changed, 9339 insertions(+), 3 deletions(-) create mode 100644 package/boot/uboot-envtools/files/ipq807x create mode 100644 target/linux/ipq807x/109-logspam.patch create mode 100644 target/linux/ipq807x/Makefile @@ -186,6 +186,21 @@ index 0000000000..6c429f1852 +config_foreach ubootenv_add_app_config ubootenv + +exit 0 +diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh +index 7d035a299b..986c74dc4d 100644 +--- a/package/network/services/hostapd/files/hostapd.sh ++++ b/package/network/services/hostapd/files/hostapd.sh +@@ -365,8 +365,8 @@ hostapd_set_vlan_file() { + local ifname="$1" + local vlan="$2" + json_get_vars name vid +- echo "${vid} ${ifname}-${name}" >> /var/run/hostapd-${ifname}.vlan +- wireless_add_vlan "${vlan}" "${ifname}-${name}" ++ echo "${vid} ${ifname}.${name}" >> /var/run/hostapd-${ifname}.vlan ++ wireless_add_vlan "${vlan}" "${ifname}.${name}" + } + + hostapd_set_vlan() { diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index c4d9dd78e3..6670d310db 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -262,10 +277,10 @@ index 0000000000..66031ace35 +$(eval $(call BuildTarget)) diff --git a/target/linux/ipq807x/base-files/etc/board.d/01_leds b/target/linux/ipq807x/base-files/etc/board.d/01_leds new file mode 100755 -index 0000000000..60a3ccdc52 +index 0000000000..35b4d9b529 --- /dev/null +++ b/target/linux/ipq807x/base-files/etc/board.d/01_leds -@@ -0,0 +1,35 @@ +@@ -0,0 +1,36 @@ +#!/bin/sh + +. /lib/functions/uci-defaults.sh @@ -278,13 +293,13 @@ index 0000000000..60a3ccdc52 +sercomm,wallaby|\ +cig,wf188n|\ +cig,wf194c) -+ ucidef_set_led_netdev "wan" "WAN" "green:wan" "br-wan" "tx rx link" -+ ucidef_set_led_netdev "lan" "LAN" "green:lan" "br-lan" "tx rx link" ++ ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0" "tx rx link" ++ ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy0tx" ++ ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy1tx" + ;; +esac + +case "$board" in -+cig,wf188n|\ +edgecore,eap101) + ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy0tx" + ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy1tx" @@ -293,6 +308,7 @@ index 0000000000..60a3ccdc52 + ucidef_set_led_netdev "poe" "poe" "green:wan" "eth0" + ;; +edgecore,eap102) ++ ucidef_set_led_netdev "poe" "poe" "green:wan" "eth0" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy0tx" + ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy1tx" + ;; @@ -6306,7 +6322,7 @@ index 0000000000..ba4a5ef3ca +}; diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-eap102.dts b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-eap102.dts new file mode 100755 -index 0000000000..fdb0d03a30 +index 0000000000..d04cb1020c --- /dev/null +++ b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-eap102.dts @@ -0,0 +1,918 @@ @@ -6982,10 +6998,10 @@ index 0000000000..fdb0d03a30 + pinctrl-0 = <&led_pins>; + pinctrl-names = "default"; + -+ led_power: led_pwr { -+ label = "green:power"; ++ led_pwr { ++ label = "green:wan"; + gpios = <&tlmm 46 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; ++ default-state = "off"; + linux,default-trigger = "led_pwr"; + }; + @@ -7001,10 +7017,10 @@ index 0000000000..fdb0d03a30 + default-state = "off"; + }; + -+ led_bt { ++ led_power: led_bt { + gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; -+ label = "green:bt"; -+ default-state = "off"; ++ label = "green:power"; ++ default-state = "on"; + linux,default-trigger = "led_bt"; + }; + }; @@ -8752,7 +8768,7 @@ index 0000000000..5744a2a5bf + struct comp_opts { diff --git a/target/linux/ipq807x/patches/102-cig-wf188.patch b/target/linux/ipq807x/patches/102-cig-wf188.patch new file mode 100644 -index 0000000000..225ea45d08 +index 0000000000..a9d3015b79 --- /dev/null +++ b/target/linux/ipq807x/patches/102-cig-wf188.patch @@ -0,0 +1,869 @@ @@ -9085,25 +9101,25 @@ index 0000000000..225ea45d08 ++ pinctrl-names = "default"; ++ ++ led@25 { -++ label = "led_5g"; +++ label = "green:wifi5"; ++ gpios = <&tlmm 25 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "wf188:green:5g"; ++ default-state = "off"; ++ }; ++ led@24 { -++ label = "led_2g"; +++ label = "green:wifi2"; ++ gpios = <&tlmm 24 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "wf188:green:2g"; ++ default-state = "off"; ++ }; ++ led@18 { -++ label = "led_eth"; +++ label = "green:wan"; ++ gpios = <&tlmm 18 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "wf188:green:eth"; ++ default-state = "off"; ++ }; ++ led_power: led@16 { -++ label = "led_pwr"; +++ label = "green:power"; ++ gpios = <&tlmm 16 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "wf188:green:power"; ++ default-state = "off"; @@ -9513,28 +9529,28 @@ index 0000000000..225ea45d08 ++ pinctrl-names = "default"; ++ ++ led@25 { -++ label = "led_5g"; +++ label = "green:wifi5"; ++ gpios = <&tlmm 25 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "wf188:green:5g"; ++ default-state = "off"; ++ }; ++ led@24 { -++ label = "led_2g"; +++ label = "green:wifi2"; ++ gpios = <&tlmm 24 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "wf188:green:2g"; ++ default-state = "off"; ++ }; ++ led@18 { -++ label = "led_eth"; +++ label = "green:wan"; ++ gpios = <&tlmm 18 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "wf188:green:eth"; ++ default-state = "off"; ++ }; ++ led_power: led@16 { -++ label = "led_pwr"; +++ label = "green:power"; ++ gpios = <&tlmm 16 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "wf188:green:power"; -++ default-state = "off"; +++ default-state = "on"; ++ }; ++ }; ++ @@ -11288,7 +11304,7 @@ index 0000000000..f91601ec59 + /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ diff --git a/target/linux/ipq807x/patches/106-eap101.patch b/target/linux/ipq807x/patches/106-eap101.patch new file mode 100644 -index 0000000000..228dadb611 +index 0000000000..188870b8dc --- /dev/null +++ b/target/linux/ipq807x/patches/106-eap101.patch @@ -0,0 +1,993 @@ @@ -12184,13 +12200,13 @@ index 0000000000..228dadb611 ++ ++ led@25 { ++ label = "green:wifi5"; -++ gpios = <&tlmm 35 GPIO_ACTIVE_LOW>; +++ gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "wf188:green:5g"; ++ default-state = "off"; ++ }; ++ led@24 { ++ label = "green:wifi2"; -++ gpios = <&tlmm 37 GPIO_ACTIVE_LOW>; +++ gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "wf188:green:2g"; ++ default-state = "off"; ++ }; diff --git a/patches/0030-base-files-add-a-turnoff-command-to-the-led-script.patch b/patches/0030-base-files-add-a-turnoff-command-to-the-led-script.patch index d9c322714..fd7e60270 100644 --- a/patches/0030-base-files-add-a-turnoff-command-to-the-led-script.patch +++ b/patches/0030-base-files-add-a-turnoff-command-to-the-led-script.patch @@ -1,27 +1,28 @@ -From 43f1072a42dd19a0718c44c58daf3f9e5a3c9421 Mon Sep 17 00:00:00 2001 +From d459f53ff9608c47fbf0b634fa4380bce1099d49 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 19 Apr 2021 13:49:20 +0200 -Subject: [PATCH] base-files: add a turnoff command to the led script +Subject: [PATCH 31/36] base-files: add a turnoff command to the led script Signed-off-by: John Crispin --- - package/base-files/files/etc/init.d/led | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) + package/base-files/files/etc/init.d/led | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led -index 8d97515d52..9f7930feed 100755 +index 8d97515d52..3221c8c44c 100755 --- a/package/base-files/files/etc/init.d/led +++ b/package/base-files/files/etc/init.d/led -@@ -3,6 +3,8 @@ +@@ -3,6 +3,9 @@ START=96 +extra_command "turnoff" "Turn all leds off" ++extra_command "blink" "Blink all leds" + load_led() { local name local sysfs -@@ -122,7 +124,18 @@ load_led() { +@@ -122,7 +125,25 @@ load_led() { } } @@ -31,6 +32,13 @@ index 8d97515d52..9f7930feed 100755 + echo 0 > /sys/class/leds/$led/brightness + done +} ++ ++blink() { ++ for led in `ls /sys/class/leds/`; do ++ echo 0 > /sys/class/leds/$led/brightness ++ echo timer > /sys/class/leds/$led/trigger ++ done ++} + start() { + [ "$(uci get system.@system[-1].leds_off)" -eq 1 ] && { @@ -40,7 +48,7 @@ index 8d97515d52..9f7930feed 100755 [ -e /sys/class/leds/ ] && { [ -s /var/run/led.state ] && { local led trigger brightness -@@ -138,5 +151,7 @@ start() { +@@ -138,5 +159,7 @@ start() { config_load system config_foreach load_led led