From 937dd79e2a4457a316d67b3091f6da7d14a99168 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 6 Apr 2021 13:24:43 +0200 Subject: [PATCH 01/29] hostapd: fix civic location option Signed-off-by: John Crispin --- package/network/services/hostapd/files/hostapd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 9e790f1e9d..8f977678fc 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -733,7 +733,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" - [ -n "$civic" ] && append bss_conf "lci=$civic" "$N" + [ -n "$civic" ] && append bss_conf "civic=$civic" "$N" } fi From 33c69aee4185a38f1ca542d236186450b81962d0 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 18 May 2021 15:51:00 +0200 Subject: [PATCH 02/29] hostapd: add missing inline stubs for ubus vlan event support Only used when building without ubus support Signed-off-by: Felix Fietkau --- package/network/services/hostapd/src/src/ap/ubus.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package/network/services/hostapd/src/src/ap/ubus.h b/package/network/services/hostapd/src/src/ap/ubus.h index de0d1182fd..f746c86e4f 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.h +++ b/package/network/services/hostapd/src/src/ap/ubus.h @@ -76,6 +76,14 @@ static inline void hostapd_ubus_free_bss(struct hostapd_data *hapd) { } +static inline void hostapd_ubus_add_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan) +{ +} + +static inline void hostapd_ubus_remove_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan) +{ +} + static inline int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req) { return 0; From 8e2ca15726bcfcf43051c3a2f7e2f96a51f0f001 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 18 May 2021 15:58:03 +0200 Subject: [PATCH 03/29] hostapd: improve channel switch support Instead of requiring the user to call it on each BSS individually, run it on all BSSs internally. Signed-off-by: John Crispin Signed-off-by: Felix Fietkau --- package/network/services/hostapd/src/src/ap/ubus.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index a34695f36a..bfa44e2915 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -728,6 +728,8 @@ hostapd_switch_chan(struct ubus_context *ctx, struct ubus_object *obj, struct blob_attr *tb[__CSA_MAX]; struct hostapd_data *hapd = get_hapd_from_object(obj); struct csa_settings css; + int ret = UBUS_STATUS_OK; + int i; blobmsg_parse(csa_policy, __CSA_MAX, tb, blob_data(msg), blob_len(msg)); @@ -752,10 +754,14 @@ hostapd_switch_chan(struct ubus_context *ctx, struct ubus_object *obj, SET_CSA_SETTING(CSA_VHT, freq_params.vht_enabled, bool); SET_CSA_SETTING(CSA_BLOCK_TX, block_tx, bool); + for (i = 0; i < hapd->iface->num_bss; i++) { + struct hostapd_data *bss = hapd->iface->bss[i]; - if (hostapd_switch_channel(hapd, &css) != 0) - return UBUS_STATUS_NOT_SUPPORTED; - return UBUS_STATUS_OK; + if (hostapd_switch_channel(bss, &css) != 0) + ret = UBUS_STATUS_NOT_SUPPORTED; + } + + return ret; #undef SET_CSA_SETTING } #endif From 753a91d1d122434a75e12d2e16568b6dba6bf034 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 18 May 2021 16:08:59 +0200 Subject: [PATCH 04/29] hostapd: report radar detected events via ubus Events are reported on all BSS interfaces Signed-off-by: Felix Fietkau --- .../hostapd/patches/600-ubus_support.patch | 11 ++++++++++ .../services/hostapd/src/src/ap/ubus.c | 21 +++++++++++++++++++ .../services/hostapd/src/src/ap/ubus.h | 6 ++++++ 3 files changed, 38 insertions(+) diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index 0d1cb2c3e4..8d9d3eb7c1 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -462,3 +462,14 @@ return hostapd_vlan_if_remove(hapd, vlan->ifname); } +--- a/src/ap/dfs.c ++++ b/src/ap/dfs.c +@@ -1179,6 +1179,8 @@ int hostapd_dfs_radar_detected(struct ho + "freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d", + freq, ht_enabled, chan_offset, chan_width, cf1, cf2); + ++ hostapd_ubus_notify_radar_detected(iface, freq, chan_width, cf1, cf2); ++ + /* Proceed only if DFS is not offloaded to the driver */ + if (iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) + return 0; diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index bfa44e2915..7cc2059fc1 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -1593,3 +1593,24 @@ void hostapd_ubus_notify_beacon_report( ubus_notify(ctx, &hapd->ubus.obj, "beacon-report", b.head, -1); } + +void hostapd_ubus_notify_radar_detected(struct hostapd_iface *iface, int frequency, + int chan_width, int cf1, int cf2) +{ + struct hostapd_data *hapd; + int i; + + if (!hapd->ubus.obj.has_subscribers) + return; + + blob_buf_init(&b, 0); + blobmsg_add_u16(&b, "frequency", frequency); + blobmsg_add_u16(&b, "width", chan_width); + blobmsg_add_u16(&b, "center1", cf1); + blobmsg_add_u16(&b, "center2", cf2); + + for (i = 0; i < iface->num_bss; i++) { + hapd = iface->bss[i]; + ubus_notify(ctx, &hapd->ubus.obj, "radar-detected", b.head, -1); + } +} diff --git a/package/network/services/hostapd/src/src/ap/ubus.h b/package/network/services/hostapd/src/src/ap/ubus.h index f746c86e4f..acdac74360 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.h +++ b/package/network/services/hostapd/src/src/ap/ubus.h @@ -52,6 +52,8 @@ void hostapd_ubus_notify_beacon_report(struct hostapd_data *hapd, const u8 *addr, u8 token, u8 rep_mode, struct rrm_measurement_beacon_report *rep, size_t len); +void hostapd_ubus_notify_radar_detected(struct hostapd_iface *iface, int frequency, + int chan_width, int cf1, int cf2); void hostapd_ubus_add(struct hapd_interfaces *interfaces); void hostapd_ubus_free(struct hapd_interfaces *interfaces); @@ -100,6 +102,10 @@ static inline void hostapd_ubus_notify_beacon_report(struct hostapd_data *hapd, size_t len) { } +static inline void hostapd_ubus_notify_radar_detected(struct hostapd_iface *iface, int frequency, + int chan_width, int cf1, int cf2) +{ +} static inline void hostapd_ubus_add(struct hapd_interfaces *interfaces) { From c76f1d8330c679774eb568a423feb57d956b3ca4 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 18 May 2021 17:06:48 +0200 Subject: [PATCH 05/29] hostapd: add extra options for hotspot 2.0 / interworking Signed-off-by: John Crispin Signed-off-by: Felix Fietkau --- .../network/services/hostapd/files/hostapd.sh | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 8f977678fc..5bc5f84974 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -316,7 +316,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 config_add_array iw_roaming_consortium iw_domain_name iw_anqp_3gpp_cell_net iw_nai_realm - config_add_array iw_anqp_elem + config_add_array iw_anqp_elem iw_venue_name iw_venue_url config_add_boolean hs20 disable_dgaf osen config_add_int anqp_domain_id @@ -327,6 +327,8 @@ 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 + config_add_string hs20_t_c_server_url + config_add_array airtime_sta_weight config_add_int airtime_bss_weight airtime_bss_limit @@ -396,10 +398,22 @@ append_iw_nai_realm() { [ -n "$1" ] && append bss_conf "nai_realm=$1" "$N" } +append_iw_venue_name() { + append bss_conf "venue_name=$1" "$N" +} + +append_iw_venue_url() { + append bss_conf "venue_url=$1" "$N" +} + append_hs20_oper_friendly_name() { append bss_conf "hs20_oper_friendly_name=$1" "$N" } +append_osu_provider_friendly_name() { + append bss_conf "osu_friendly_name=$1" "$N" +} + append_osu_provider_service_desc() { append bss_conf "osu_service_desc=$1" "$N" } @@ -447,6 +461,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 + config_list_foreach "$1" osu_friendly_name append_osu_friendly_name config_list_foreach "$1" osu_icon append_osu_icon append bss_conf "$N" @@ -879,6 +894,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 + json_get_vars iw_venue_name iw_venue_url set_default iw_enabled 0 if [ "$iw_enabled" = "1" ]; then @@ -907,6 +923,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 + json_for_each_item append_iw_venue_name iw_venue_name + json_for_each_item append_iw_venue_url iw_venue_url iw_domain_name_conf= json_for_each_item append_iw_domain_name iw_domain_name @@ -921,9 +939,11 @@ hostapd_set_bss_options() { local hs20 disable_dgaf osen anqp_domain_id hs20_deauth_req_timeout \ - osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp + osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp \ + hs20_t_c_server_url json_get_vars hs20 disable_dgaf osen anqp_domain_id hs20_deauth_req_timeout \ - osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp + osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp \ + hs20_t_c_server_url set_default hs20 0 set_default disable_dgaf $hs20 @@ -942,8 +962,9 @@ 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" - json_for_each_item append_hs20_conn_capab hs20_conn_capab + [ -n "$hs20_t_c_server_url" ] && append bss_conf "hs20_t_c_server_url=$hs20_t_c_server_url" "$N" json_for_each_item append_hs20_oper_friendly_name hs20_oper_friendly_name + json_for_each_item append_hs20_conn_capab hs20_conn_capab json_for_each_item append_osu_provider osu_provider json_for_each_item append_operator_icon operator_icon fi From 3bd6c8c728e72444bdf23b8904ef9c52ebb46bb7 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 18 May 2021 17:53:45 +0200 Subject: [PATCH 06/29] hostapd: add additional radius options - add functionality to configure RADIUS NAS-Id and Operator-Name - add functionality to configure RADIUS accounting interval - enable RADIUS "Chargeable User Identity" Signed-off-by: John Crispin Signed-off-by: Felix Fietkau --- .../network/services/hostapd/files/hostapd.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 5bc5f84974..7f03396cb5 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -335,6 +335,10 @@ hostapd_common_add_bss_config() { config_add_boolean multicast_to_unicast per_sta_vif config_add_array hostapd_bss_options + + config_add_boolean request_cui + config_add_array radius_auth_req_attr + config_add_array radius_acct_req_attr } hostapd_set_vlan_file() { @@ -471,6 +475,14 @@ append_hs20_conn_capab() { [ -n "$1" ] && append bss_conf "hs20_conn_capab=$1" "$N" } +append_radius_acct_req_attr() { + append bss_conf "radius_acct_req_attr=$1" "$N" +} + +append_radius_auth_req_attr() { + append bss_conf "radius_auth_req_attr=$1" "$N" +} + append_airtime_sta_weight() { [ -n "$1" ] && append bss_conf "airtime_sta_weight=$1" "$N" } @@ -562,6 +574,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" + json_for_each_item append_radius_acct_req_attr radius_acct_req_attr } case "$auth_type" in @@ -616,7 +629,7 @@ hostapd_set_bss_options() { auth_server auth_secret auth_port \ dae_client dae_secret dae_port \ ownip radius_client_addr \ - eap_reauth_period + eap_reauth_period request_cui # radius can provide VLAN ID for clients vlan_possible=1 @@ -628,18 +641,20 @@ hostapd_set_bss_options() { set_default auth_port 1812 set_default dae_port 3799 - + set_default request_cui 0 append bss_conf "auth_server_addr=$auth_server" "$N" append bss_conf "auth_server_port=$auth_port" "$N" append bss_conf "auth_server_shared_secret=$auth_secret" "$N" + [ "$request_cui" -gt 0 ] && append bss_conf "radius_request_cui=$request_cui" "$N" [ -n "$eap_reauth_period" ] && append bss_conf "eap_reauth_period=$eap_reauth_period" "$N" [ -n "$dae_client" -a -n "$dae_secret" ] && { append bss_conf "radius_das_port=$dae_port" "$N" append bss_conf "radius_das_client=$dae_client $dae_secret" "$N" } + json_for_each_item append_radius_auth_req_attr radius_auth_req_attr [ -n "$ownip" ] && append bss_conf "own_ip_addr=$ownip" "$N" [ -n "$radius_client_addr" ] && append bss_conf "radius_client_addr=$radius_client_addr" "$N" From 2319cf4ec048e50a7d3885d19dc27663b45e258d Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 18 May 2021 19:08:28 +0200 Subject: [PATCH 07/29] hostapd: fix max_oper_chwidth setting for HE Signed-off-by: Felix Fietkau --- package/network/services/hostapd/files/hostapd.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 7f03396cb5..9405127b15 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -1119,9 +1119,9 @@ wpa_supplicant_set_fixed_freq() { VHT*) append network_data "vht=1" "$N$T";; esac case "$htmode" in - VHT80) append network_data "max_oper_chwidth=1" "$N$T";; - VHT160) append network_data "max_oper_chwidth=2" "$N$T";; - VHT20|VHT40) append network_data "max_oper_chwidth=0" "$N$T";; + HE80|VHT80) append network_data "max_oper_chwidth=1" "$N$T";; + HE160|VHT160) append network_data "max_oper_chwidth=2" "$N$T";; + HE20|HE40|VHT20|VHT40) append network_data "max_oper_chwidth=0" "$N$T";; *) append network_data "disable_vht=1" "$N$T";; esac } From 26da5c235983d215a42983467149e0e5597e8de2 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 18 May 2021 17:46:01 +0200 Subject: [PATCH 08/29] hostapd: add support for configuring rts threshold Signed-off-by: Felix Fietkau --- package/network/services/hostapd/files/hostapd.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 9405127b15..5e9678eef6 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -99,6 +99,7 @@ hostapd_common_add_device_config() { config_add_string require_mode config_add_boolean legacy_rates config_add_int cell_density + config_add_int rts_threshold config_add_string acs_chan_bias config_add_array hostapd_options @@ -115,7 +116,8 @@ hostapd_prepare_device_config() { local base_cfg= 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 + acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density \ + rts_threshold hostapd_set_log_options base_cfg @@ -209,6 +211,7 @@ hostapd_prepare_device_config() { [ -n "$rlist" ] && append base_cfg "supported_rates=$rlist" "$N" [ -n "$brlist" ] && append base_cfg "basic_rates=$brlist" "$N" append base_cfg "beacon_int=$beacon_int" "$N" + [ -n "$rts_threshold" ] && append base_cfg "rts_threshold=$rts_threshold" "$N" append base_cfg "dtim_period=$dtim_period" "$N" [ "$airtime_mode" -gt 0 ] && append base_cfg "airtime_mode=$airtime_mode" "$N" From b5420dd710aaad703f6f7a900840609d4d1176a1 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Tue, 18 May 2021 07:13:50 +0200 Subject: [PATCH 09/29] iw: update to 8fab0c9e This fixes `iw dev wlan0-mesh station dump`. 8fab0c9 iw: fix ftm_request missing arguments segfault e816fbc iw: fix mgmt dump missing arguments segfault 5d9d1b8 iw: Fix timestamp output on 32-bit architectures 4b25ae3 iw: fix pointer arithmetic in __print_he_capa c3df363 iw: add option to print human readable event time cd64525 iw: print ctrl port tx status event 0ba98b9 iw: use correct type in policy check for mesh 9e38dee iw: scan: fixup HE caps whitespace 17e8564 iw: scan: parse HE capabilities 5735e58 iw: util: factor out HE capability parser 6d8d507 iw: scan: add extension tag parsing b4e1ec4 man: update wikipage URL, reformat SEE ALSO section c56036a iw: enable 80MHz support for 6GHz band 11s mesh fa72728 iw: handle positive error codes gracefully 7ba9093 iw: scan: add flag for scanning colocated ap 5ec60ed iw: Add 'coloc' and 'flush' options to sched_scan f8ade75 iw: update wikipage URL b6f2dac iw: Add support for specifying the 160MHz bandwidth when setting the channel/frequency Signed-off-by: Andre Heider --- package/network/utils/iw/Makefile | 11 +++---- .../utils/iw/patches/200-reduce_size.patch | 30 +++++++++---------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/package/network/utils/iw/Makefile b/package/network/utils/iw/Makefile index 6db9aaf105..8e11046189 100644 --- a/package/network/utils/iw/Makefile +++ b/package/network/utils/iw/Makefile @@ -8,12 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iw -PKG_VERSION:=5.9 -PKG_RELEASE:=1 +PKG_VERSION:=5.9-8fab0c9e +PKG_RELEASE:=$(AUTORELEASE) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=@KERNEL/software/network/iw -PKG_HASH:=293a07109aeb7e36267cf59e3ce52857e9ffae3a6666eb8ac77894b1839fe1f2 +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git +PKG_SOURCE_VERSION:=8fab0c9ee9db217587a58efcc37421c86edcb638 +PKG_MIRROR_HASH:=797b322bc03952f3127ae0a7da476c14ada1bbe9a9ae234a56dd6f864c568e16 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/iw/patches/200-reduce_size.patch b/package/network/utils/iw/patches/200-reduce_size.patch index af30876012..83e11405cb 100644 --- a/package/network/utils/iw/patches/200-reduce_size.patch +++ b/package/network/utils/iw/patches/200-reduce_size.patch @@ -1,6 +1,6 @@ --- a/event.c +++ b/event.c -@@ -944,6 +944,7 @@ static int print_event(struct nl_msg *ms +@@ -956,6 +956,7 @@ static int print_event(struct nl_msg *ms } switch (gnlh->cmd) { @@ -8,7 +8,7 @@ case NL80211_CMD_NEW_WIPHY: printf("renamed to %s\n", nla_get_string(tb[NL80211_ATTR_WIPHY_NAME])); break; -@@ -979,6 +980,7 @@ static int print_event(struct nl_msg *ms +@@ -991,6 +992,7 @@ static int print_event(struct nl_msg *ms case NL80211_CMD_SCHED_SCAN_RESULTS: printf("got scheduled scan results\n"); break; @@ -16,7 +16,7 @@ case NL80211_CMD_WIPHY_REG_CHANGE: case NL80211_CMD_REG_CHANGE: if (gnlh->cmd == NL80211_CMD_WIPHY_REG_CHANGE) -@@ -1061,6 +1063,7 @@ static int print_event(struct nl_msg *ms +@@ -1073,6 +1075,7 @@ static int print_event(struct nl_msg *ms mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC])); printf("del station %s\n", macbuf); break; @@ -24,7 +24,7 @@ case NL80211_CMD_JOIN_IBSS: mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC])); printf("IBSS %s joined\n", macbuf); -@@ -1254,9 +1257,9 @@ static int print_event(struct nl_msg *ms +@@ -1271,9 +1274,9 @@ static int print_event(struct nl_msg *ms case NL80211_CMD_CH_SWITCH_NOTIFY: parse_ch_switch_notify(tb, gnlh->cmd); break; @@ -134,7 +134,7 @@ { --- a/scan.c +++ b/scan.c -@@ -1297,6 +1297,9 @@ static void print_ht_op(const uint8_t ty +@@ -1306,6 +1306,9 @@ static void print_ht_op(const uint8_t ty printf("\t\t * secondary channel offset: %s\n", ht_secondary_offset[data[1] & 0x3]); printf("\t\t * STA channel width: %s\n", sta_chan_width[(data[1] & 0x4)>>2]); @@ -144,7 +144,7 @@ printf("\t\t * RIFS: %d\n", (data[1] & 0x8)>>3); printf("\t\t * HT protection: %s\n", protection[data[2] & 0x3]); printf("\t\t * non-GF present: %d\n", (data[2] & 0x4) >> 2); -@@ -1707,6 +1710,14 @@ static void print_ie(const struct ie_pri +@@ -1716,6 +1719,14 @@ static void print_ie(const struct ie_pri static const struct ie_print ieprinters[] = { [0] = { "SSID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), }, @@ -159,7 +159,7 @@ [1] = { "Supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), }, [3] = { "DS Parameter set", print_ds, 1, 1, BIT(PRINT_SCAN), }, [5] = { "TIM", print_tim, 4, 255, BIT(PRINT_SCAN), }, -@@ -1716,26 +1727,20 @@ static const struct ie_print ieprinters[ +@@ -1725,26 +1736,20 @@ static const struct ie_print ieprinters[ [32] = { "Power constraint", print_powerconstraint, 1, 1, BIT(PRINT_SCAN), }, [35] = { "TPC report", print_tpcreport, 2, 2, BIT(PRINT_SCAN), }, [42] = { "ERP", print_erp, 1, 255, BIT(PRINT_SCAN), }, @@ -187,15 +187,15 @@ }; static void print_wifi_wpa(const uint8_t type, uint8_t len, const uint8_t *data, -@@ -2279,6 +2284,7 @@ void print_ies(unsigned char *ie, int ie +@@ -2326,6 +2331,7 @@ void print_ies(unsigned char *ie, int ie ieprinters[ie[0]].flags & BIT(ptype)) { print_ie(&ieprinters[ie[0]], ie[0], ie[1], ie + 2, &ie_buffer); +#ifdef IW_FULL } else if (ie[0] == 221 /* vendor */) { print_vendor(ie[1], ie + 2, unknown, ptype); - } else if (unknown) { -@@ -2288,6 +2294,7 @@ void print_ies(unsigned char *ie, int ie + } else if (ie[0] == 255 /* extension */) { +@@ -2337,6 +2343,7 @@ void print_ies(unsigned char *ie, int ie for (i=0; i Date: Fri, 21 May 2021 14:29:31 +0200 Subject: [PATCH 10/29] wireless-regdb: update to version 2021.04.21 Signed-off-by: Felix Fietkau --- package/firmware/wireless-regdb/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/firmware/wireless-regdb/Makefile b/package/firmware/wireless-regdb/Makefile index 308ca40e22..c209d802e4 100644 --- a/package/firmware/wireless-regdb/Makefile +++ b/package/firmware/wireless-regdb/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wireless-regdb -PKG_VERSION:=2020.11.20 +PKG_VERSION:=2021.04.21 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/network/wireless-regdb/ -PKG_HASH:=b4164490d82ff7b0086e812ac42ab27baf57be24324d4c0ee1c5dd6ba27f2a52 +PKG_HASH:=9e4c02b2a9710df4dbdb327c39612e8cbbae6495987afeddaebab28c1ea3d8fa PKG_MAINTAINER:=Felix Fietkau From db072fdc9e1a93eacfc5402fed6ab796fdf205ed Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 24 May 2021 11:52:40 +0200 Subject: [PATCH 11/29] mac80211: add 6 GHz support to mac80211_hwsim Signed-off-by: Felix Fietkau --- ...320-mac80211_hwsim-add-6GHz-channels.patch | 123 ++++++++++++++++++ ...211_hwsim-make-6-GHz-channels-usable.patch | 74 +++++++++++ 2 files changed, 197 insertions(+) create mode 100644 package/kernel/mac80211/patches/subsys/320-mac80211_hwsim-add-6GHz-channels.patch create mode 100644 package/kernel/mac80211/patches/subsys/321-mac80211_hwsim-make-6-GHz-channels-usable.patch diff --git a/package/kernel/mac80211/patches/subsys/320-mac80211_hwsim-add-6GHz-channels.patch b/package/kernel/mac80211/patches/subsys/320-mac80211_hwsim-add-6GHz-channels.patch new file mode 100644 index 0000000000..a7c09f00bc --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/320-mac80211_hwsim-add-6GHz-channels.patch @@ -0,0 +1,123 @@ +From: Ramon Fontes +Date: Sun, 27 Dec 2020 00:11:55 -0300 +Subject: [PATCH] mac80211_hwsim: add 6GHz channels + +Advertise 6GHz channels to mac80211. + +Signed-off-by: Ramon Fontes +Link: https://lore.kernel.org/r/20201227031155.81161-1-ramonreisfontes@gmail.com +[reword commit message] +Signed-off-by: Johannes Berg +--- + +--- a/drivers/net/wireless/mac80211_hwsim.c ++++ b/drivers/net/wireless/mac80211_hwsim.c +@@ -311,6 +311,12 @@ static struct net_device *hwsim_mon; /* + .hw_value = (_freq), \ + } + ++#define CHAN6G(_freq) { \ ++ .band = NL80211_BAND_6GHZ, \ ++ .center_freq = (_freq), \ ++ .hw_value = (_freq), \ ++} ++ + static const struct ieee80211_channel hwsim_channels_2ghz[] = { + CHAN2G(2412), /* Channel 1 */ + CHAN2G(2417), /* Channel 2 */ +@@ -377,6 +383,68 @@ static const struct ieee80211_channel hw + CHAN5G(5925), /* Channel 185 */ + }; + ++static const struct ieee80211_channel hwsim_channels_6ghz[] = { ++ CHAN6G(5955), /* Channel 1 */ ++ CHAN6G(5975), /* Channel 5 */ ++ CHAN6G(5995), /* Channel 9 */ ++ CHAN6G(6015), /* Channel 13 */ ++ CHAN6G(6035), /* Channel 17 */ ++ CHAN6G(6055), /* Channel 21 */ ++ CHAN6G(6075), /* Channel 25 */ ++ CHAN6G(6095), /* Channel 29 */ ++ CHAN6G(6115), /* Channel 33 */ ++ CHAN6G(6135), /* Channel 37 */ ++ CHAN6G(6155), /* Channel 41 */ ++ CHAN6G(6175), /* Channel 45 */ ++ CHAN6G(6195), /* Channel 49 */ ++ CHAN6G(6215), /* Channel 53 */ ++ CHAN6G(6235), /* Channel 57 */ ++ CHAN6G(6255), /* Channel 61 */ ++ CHAN6G(6275), /* Channel 65 */ ++ CHAN6G(6295), /* Channel 69 */ ++ CHAN6G(6315), /* Channel 73 */ ++ CHAN6G(6335), /* Channel 77 */ ++ CHAN6G(6355), /* Channel 81 */ ++ CHAN6G(6375), /* Channel 85 */ ++ CHAN6G(6395), /* Channel 89 */ ++ CHAN6G(6415), /* Channel 93 */ ++ CHAN6G(6435), /* Channel 97 */ ++ CHAN6G(6455), /* Channel 181 */ ++ CHAN6G(6475), /* Channel 105 */ ++ CHAN6G(6495), /* Channel 109 */ ++ CHAN6G(6515), /* Channel 113 */ ++ CHAN6G(6535), /* Channel 117 */ ++ CHAN6G(6555), /* Channel 121 */ ++ CHAN6G(6575), /* Channel 125 */ ++ CHAN6G(6595), /* Channel 129 */ ++ CHAN6G(6615), /* Channel 133 */ ++ CHAN6G(6635), /* Channel 137 */ ++ CHAN6G(6655), /* Channel 141 */ ++ CHAN6G(6675), /* Channel 145 */ ++ CHAN6G(6695), /* Channel 149 */ ++ CHAN6G(6715), /* Channel 153 */ ++ CHAN6G(6735), /* Channel 157 */ ++ CHAN6G(6755), /* Channel 161 */ ++ CHAN6G(6775), /* Channel 165 */ ++ CHAN6G(6795), /* Channel 169 */ ++ CHAN6G(6815), /* Channel 173 */ ++ CHAN6G(6835), /* Channel 177 */ ++ CHAN6G(6855), /* Channel 181 */ ++ CHAN6G(6875), /* Channel 185 */ ++ CHAN6G(6895), /* Channel 189 */ ++ CHAN6G(6915), /* Channel 193 */ ++ CHAN6G(6935), /* Channel 197 */ ++ CHAN6G(6955), /* Channel 201 */ ++ CHAN6G(6975), /* Channel 205 */ ++ CHAN6G(6995), /* Channel 209 */ ++ CHAN6G(7015), /* Channel 213 */ ++ CHAN6G(7035), /* Channel 217 */ ++ CHAN6G(7055), /* Channel 221 */ ++ CHAN6G(7075), /* Channel 225 */ ++ CHAN6G(7095), /* Channel 229 */ ++ CHAN6G(7115), /* Channel 233 */ ++}; ++ + #define NUM_S1G_CHANS_US 51 + static struct ieee80211_channel hwsim_channels_s1g[NUM_S1G_CHANS_US]; + +@@ -548,6 +616,7 @@ struct mac80211_hwsim_data { + struct ieee80211_supported_band bands[NUM_NL80211_BANDS]; + struct ieee80211_channel channels_2ghz[ARRAY_SIZE(hwsim_channels_2ghz)]; + struct ieee80211_channel channels_5ghz[ARRAY_SIZE(hwsim_channels_5ghz)]; ++ struct ieee80211_channel channels_6ghz[ARRAY_SIZE(hwsim_channels_6ghz)]; + struct ieee80211_channel channels_s1g[ARRAY_SIZE(hwsim_channels_s1g)]; + struct ieee80211_rate rates[ARRAY_SIZE(hwsim_rates)]; + struct ieee80211_iface_combination if_combination; +@@ -578,7 +647,8 @@ struct mac80211_hwsim_data { + struct ieee80211_channel *channel; + unsigned long next_start, start, end; + } survey_data[ARRAY_SIZE(hwsim_channels_2ghz) + +- ARRAY_SIZE(hwsim_channels_5ghz)]; ++ ARRAY_SIZE(hwsim_channels_5ghz) + ++ ARRAY_SIZE(hwsim_channels_6ghz)]; + + struct ieee80211_channel *channel; + u64 beacon_int /* beacon interval in us */; +@@ -3149,6 +3219,8 @@ static int mac80211_hwsim_new_radio(stru + sizeof(hwsim_channels_2ghz)); + memcpy(data->channels_5ghz, hwsim_channels_5ghz, + sizeof(hwsim_channels_5ghz)); ++ memcpy(data->channels_6ghz, hwsim_channels_6ghz, ++ sizeof(hwsim_channels_6ghz)); + memcpy(data->channels_s1g, hwsim_channels_s1g, + sizeof(hwsim_channels_s1g)); + memcpy(data->rates, hwsim_rates, sizeof(hwsim_rates)); diff --git a/package/kernel/mac80211/patches/subsys/321-mac80211_hwsim-make-6-GHz-channels-usable.patch b/package/kernel/mac80211/patches/subsys/321-mac80211_hwsim-make-6-GHz-channels-usable.patch new file mode 100644 index 0000000000..4bac10eefe --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/321-mac80211_hwsim-make-6-GHz-channels-usable.patch @@ -0,0 +1,74 @@ +From: Felix Fietkau +Date: Mon, 24 May 2021 11:46:09 +0200 +Subject: [PATCH] mac80211_hwsim: make 6 GHz channels usable + +The previous commit that claimed to add 6 GHz channels didn't actually make +them usable, since the 6 GHz band was not registered with mac80211. + +Fixes: 28881922abd7 ("mac80211_hwsim: add 6GHz channels") +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/wireless/mac80211_hwsim.c ++++ b/drivers/net/wireless/mac80211_hwsim.c +@@ -2968,15 +2968,19 @@ static void mac80211_hwsim_he_capab(stru + { + u16 n_iftype_data; + +- if (sband->band == NL80211_BAND_2GHZ) { ++ switch (sband->band) { ++ case NL80211_BAND_2GHZ: + n_iftype_data = ARRAY_SIZE(he_capa_2ghz); + sband->iftype_data = + (struct ieee80211_sband_iftype_data *)he_capa_2ghz; +- } else if (sband->band == NL80211_BAND_5GHZ) { ++ break; ++ case NL80211_BAND_5GHZ: ++ case NL80211_BAND_6GHZ: + n_iftype_data = ARRAY_SIZE(he_capa_5ghz); + sband->iftype_data = + (struct ieee80211_sband_iftype_data *)he_capa_5ghz; +- } else { ++ break; ++ default: + return; + } + +@@ -3265,6 +3269,12 @@ static int mac80211_hwsim_new_radio(stru + sband->vht_cap.vht_mcs.tx_mcs_map = + sband->vht_cap.vht_mcs.rx_mcs_map; + break; ++ case NL80211_BAND_6GHZ: ++ sband->channels = data->channels_6ghz; ++ sband->n_channels = ARRAY_SIZE(hwsim_channels_6ghz); ++ sband->bitrates = data->rates + 4; ++ sband->n_bitrates = ARRAY_SIZE(hwsim_rates) - 4; ++ break; + case NL80211_BAND_S1GHZ: + memcpy(&sband->s1g_cap, &hwsim_s1g_cap, + sizeof(sband->s1g_cap)); +@@ -3275,6 +3285,13 @@ static int mac80211_hwsim_new_radio(stru + continue; + } + ++ mac80211_hwsim_he_capab(sband); ++ ++ hw->wiphy->bands[band] = sband; ++ ++ if (band == NL80211_BAND_6GHZ) ++ continue; ++ + sband->ht_cap.ht_supported = true; + sband->ht_cap.cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 | + IEEE80211_HT_CAP_GRN_FLD | +@@ -3288,10 +3305,6 @@ static int mac80211_hwsim_new_radio(stru + sband->ht_cap.mcs.rx_mask[0] = 0xff; + sband->ht_cap.mcs.rx_mask[1] = 0xff; + sband->ht_cap.mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED; +- +- mac80211_hwsim_he_capab(sband); +- +- hw->wiphy->bands[band] = sband; + } + + /* By default all radios belong to the first group */ From 8b8c1cb09bf2259e647a15d0c881b5dea15330da Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 24 May 2021 14:55:01 +0200 Subject: [PATCH 12/29] mac80211: make use of the new 'band' option Use it to look up frequencies only in the configured band to better deal with channel number overlap Signed-off-by: Felix Fietkau --- .../files/lib/netifd/wireless/mac80211.sh | 45 +++++++++++++------ 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 92c56afd24..fca7c1c1d6 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -26,7 +26,6 @@ drv_mac80211_init_device_config() { hostapd_common_add_device_config config_add_string path phy 'macaddr:macaddr' - config_add_string hwmode config_add_string tx_burst config_add_string distance config_add_int beacon_int chanbw frag rts @@ -689,14 +688,8 @@ mac80211_prepare_iw_htmode() { case "$htmode" in VHT20|HT20) iw_htmode=HT20;; HT40*|VHT40|VHT160) - case "$hwmode" in - a) - case "$(( ($channel / 4) % 2 ))" in - 1) iw_htmode="HT40+" ;; - 0) iw_htmode="HT40-";; - esac - ;; - *) + case "$band" in + 2g) case "$htmode" in HT40+) iw_htmode="HT40+";; HT40-) iw_htmode="HT40-";; @@ -709,6 +702,12 @@ mac80211_prepare_iw_htmode() { ;; esac ;; + *) + case "$(( ($channel / 4) % 2 ))" in + 1) iw_htmode="HT40+" ;; + 0) iw_htmode="HT40-";; + esac + ;; esac [ "$auto_channel" -gt 0 ] && iw_htmode="HT40+" ;; @@ -818,7 +817,6 @@ mac80211_setup_vif() { mesh) wireless_vif_parse_encryption [ -z "$htmode" ] && htmode="NOHT"; - freq="$(get_freq "$phy" "$channel")" if [ "$wpa" -gt 0 -o "$auto_channel" -gt 0 ] || chan_is_dfs "$phy" "$channel"; then mac80211_setup_supplicant $vif_enable || failed=1 else @@ -832,7 +830,6 @@ mac80211_setup_vif() { adhoc) wireless_vif_parse_encryption if [ "$wpa" -gt 0 -o "$auto_channel" -gt 0 ]; then - freq="$(get_freq "$phy" "$channel")" mac80211_setup_supplicant_noctl $vif_enable || failed=1 else mac80211_setup_adhoc $vif_enable @@ -849,10 +846,30 @@ mac80211_setup_vif() { get_freq() { local phy="$1" - local chan="$2" - iw "$phy" info | grep -E -m1 "(\* ${chan:-....} MHz${chan:+|\\[$chan\\]})" | grep MHz | awk '{print $2}' + local channel="$2" + local band="$3" + + case "$band" in + 2g) band="1:";; + 5g) band="2:";; + 60g) band="3:";; + 6g) band="4:";; + esac + + iw "$phy" info | awk -v band="$band" -v channel="[$channel]" ' + +$1 ~ /Band/ { + band_match = band == $2 } +band_match && $3 == "MHz" && $4 == channel { + print $2 + exit +} +' +} + + chan_is_dfs() { local phy="$1" local chan="$2" @@ -935,7 +952,7 @@ drv_mac80211_setup() { done # convert channel to frequency - [ "$auto_channel" -gt 0 ] || freq="$(get_freq "$phy" "$channel")" + [ "$auto_channel" -gt 0 ] || freq="$(get_freq "$phy" "$channel" "$band")" [ -n "$country" ] && { iw reg get | grep -q "^country $country:" || { From 8504212f65865449dd6b9ed9daa0ba9781f8f287 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 24 May 2021 14:56:02 +0200 Subject: [PATCH 13/29] mac80211: rework default config script Emit the new band option instead of hwmode Support 6 GHz band and HE options Signed-off-by: Felix Fietkau --- .../mac80211/files/lib/wifi/mac80211.sh | 105 ++++++++++++++---- 1 file changed, 85 insertions(+), 20 deletions(-) diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh index 3e99f06693..0763da8fd8 100644 --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh @@ -57,6 +57,85 @@ check_mac80211_device() { [ "$phy" = "$dev" ] && found=1 } + +__get_band_defaults() { + local phy="$1" + + ( iw phy "$phy" info; echo ) | awk ' +BEGIN { + bands = "" +} + +($1 == "Band" || $1 == "") && band { + if (channel) { + mode="NOHT" + if (ht) mode="HT20" + if (vht) mode="VHT80" + if (he) mode="HE80" + if (he && band == "1:") mode="HE20" + sub("\\[", "", channel) + sub("\\]", "", channel) + bands = bands band channel ":" mode " " + } + band="" +} + +$1 == "Band" { + band = $2 + channel = "" + vht = "" + ht = "" + he = "" +} + +$0 ~ "Capabilities:" { + ht=1 +} + +$0 ~ "VHT Capabilities:" { + vht=1 +} + +$0 ~ "HE Iftypes" { + he=1 +} + +$1 == "*" && $3 == "MHz" && $0 !~ /disabled/ && band && !channel { + channel = $4 +} + +END { + print bands +}' +} + +get_band_defaults() { + local phy="$1" + + for c in $(__get_band_defaults "$phy"); do + local band="${c%%:*}" + c="${c#*:}" + local chan="${c%%:*}" + c="${c#*:}" + local mode="${c%%:*}" + + case "$band" in + 1) band=2g;; + 2) band=5g;; + 3) band=60g;; + 4) band=6g;; + *) band="";; + esac + + [ -n "$band" ] || continue + [ -n "$mode_band" -a "$band" = "6g" ] && return + + mode_band="$band" + channel="$chan" + htmode="$mode" + done +} + detect_mac80211() { devidx=0 config_load wireless @@ -75,26 +154,12 @@ detect_mac80211() { config_foreach check_mac80211_device wifi-device [ "$found" -gt 0 ] && continue - mode_band="g" - channel="11" + mode_band="" + channel="" htmode="" ht_capab="" - iw phy "$dev" info | grep -q 'Capabilities:' && htmode=HT20 - - iw phy "$dev" info | grep -q '\* 5... MHz \[' && { - mode_band="a" - channel=$(iw phy "$dev" info | grep '\* 5... MHz \[' | grep '(disabled)' -v -m 1 | sed 's/[^[]*\[\|\].*//g') - iw phy "$dev" info | grep -q 'VHT Capabilities' && htmode="VHT80" - } - - iw phy "$dev" info | grep -q '\* 5.... MHz \[' && { - mode_band="ad" - channel=$(iw phy "$dev" info | grep '\* 5.... MHz \[' | grep '(disabled)' -v -m 1 | sed 's/[^[]*\[\|\|\].*//g') - iw phy "$dev" info | grep -q 'Capabilities:' && htmode="HT20" - } - - [ -n "$htmode" ] && ht_capab="set wireless.radio${devidx}.htmode=$htmode" + get_band_defaults "$dev" path="$(mac80211_phy_to_path "$dev")" if [ -n "$path" ]; then @@ -106,10 +171,10 @@ detect_mac80211() { uci -q batch <<-EOF set wireless.radio${devidx}=wifi-device set wireless.radio${devidx}.type=mac80211 - set wireless.radio${devidx}.channel=${channel} - set wireless.radio${devidx}.hwmode=11${mode_band} ${dev_id} - ${ht_capab} + set wireless.radio${devidx}.channel=${channel} + set wireless.radio${devidx}.band=${mode_band} + set wireless.radio${devidx}.htmode=$htmode set wireless.radio${devidx}.disabled=1 set wireless.default_radio${devidx}=wifi-iface From c8bcdd561909034a14cbfd785e13848cbd5f5e50 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 24 May 2021 18:45:57 +0200 Subject: [PATCH 14/29] mac80211: set hostapd op_class for 6 GHz This is needed to disambiguate it from 5 GHz channels Signed-off-by: Felix Fietkau --- .../kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index fca7c1c1d6..8771f12d2f 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -227,6 +227,14 @@ mac80211_hostapd_setup_base() { vht_center_seg0=$idx ;; esac + [ "$band" = "6g" ] && { + op_class= + case "$htmode" in + HE20) op_class=131;; + HE*) op_class=$((132 + $vht_oper_chwidth)) + esac + [ -n "$op_class" ] && append base_cfg "op_class=$op_class" "$N" + } [ "$hwmode" = "a" ] || enable_ac=0 if [ "$enable_ac" != "0" ]; then From eefed841b05c3cd4c65a78b50ce0934d879e6acf Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 24 May 2021 19:24:37 +0200 Subject: [PATCH 15/29] hostapd: update to version 2021-05-21 Signed-off-by: Felix Fietkau --- package/network/services/hostapd/Makefile | 6 +- ...-fix-frequency-setup-with-HE-enabled.patch | 196 ------------- ...> 001-wolfssl-init-RNG-with-ECC-key.patch} | 11 +- ...-init-order-disable-pri-sec-channel-.patch | 126 --------- ...andle-HT40-and-mode-downgrade-in-AP-.patch | 102 ------- ...ix-frequency-config-for-non-p2p-vht-.patch | 63 ----- ...nable-vht-and-he-in-default-config-p.patch | 25 -- ...er-debug-messages-for-some-error-cas.patch | 83 ------ ...lper-functions-for-vht-he-parameters.patch | 27 -- ...ompletion-callback-to-complete-mesh-.patch | 108 -------- ...-frequency-as-pri-sec-channel-switch.patch | 26 -- ...hannels-to-be-selected-if-dfs-is-ena.patch | 10 +- ...offchanok-on-DFS-channels-in-non-ETS.patch | 53 ---- ...rministic-channel-on-channel-switch.patch} | 2 +- ...-fix-channel-switch-error-during-CAC.patch | 66 ----- ...rnel-driver-DFS-handler-in-userspace.patch | 48 ---- .../014-mesh-fixes-for-mesh-init-deinit.patch | 158 ----------- .../015-mesh-fix-DFS-deinit-init.patch | 262 ------------------ ...sts-DFS-test-for-wpa_supplicant-mesh.patch | 94 ------- .../patches/017-mesh-fix-mesh_oom-test.patch | 24 -- ...ve-mesh-freq-setting-to-own-function.patch | 93 ------- ...020-ignore-4addr-mode-enabling-error.patch | 78 ------ ...0-mesh-make-forwarding-configurable.patch} | 28 +- ...-case-in-peer-addition-based-on-PD-R.patch | 45 --- .../patches/110-notify-mgmt-frames.patch | 116 -------- .../patches/110-wolfssl-compile-fix.patch | 10 - .../120-reconfigure-wps-credentials.patch | 178 ------------ .../hostapd/patches/200-multicall.patch | 80 +++--- .../services/hostapd/patches/300-noscan.patch | 6 +- .../hostapd/patches/301-mesh-noscan.patch | 10 +- .../patches/310-rescan_immediately.patch | 2 +- .../hostapd/patches/320-optional_rfkill.patch | 8 +- .../patches/330-nl80211_fix_set_freq.patch | 2 +- .../patches/340-reload_freq_change.patch | 6 +- .../341-mesh-ctrl-iface-channel-switch.patch | 2 +- .../patches/350-nl80211_del_beacon_bss.patch | 12 +- .../patches/360-ctrl_iface_reload.patch | 10 +- .../hostapd/patches/370-ap_sta_support.patch | 67 ++--- .../patches/380-disable_ctrl_iface_mib.patch | 34 +-- .../patches/390-wpa_ie_cap_workaround.patch | 4 +- .../patches/420-indicate-features.patch | 4 +- .../patches/430-hostapd_cli_ifdef.patch | 4 +- ...dd-new-config-params-to-be-used-with.patch | 8 +- ...-use-new-parameters-during-ibss-join.patch | 4 +- .../patches/463-add-mcast_rate-to-11s.patch | 10 +- .../patches/464-fix-mesh-obss-check.patch | 2 +- .../patches/470-survey_data_fallback.patch | 2 +- .../patches/500-lto-jobserver-support.patch | 19 +- .../hostapd/patches/600-ubus_support.patch | 78 +++--- .../hostapd/patches/700-wifi-reload.patch | 51 ++-- .../hostapd/patches/710-vlan_no_bridge.patch | 2 +- ...ate-if-no-available-channel-is-found.patch | 37 --- ...of-secondary-device-types-for-P2P-gr.patch | 33 --- 53 files changed, 239 insertions(+), 2296 deletions(-) delete mode 100644 package/network/services/hostapd/patches/001-HE-VHT-fix-frequency-setup-with-HE-enabled.patch rename package/network/services/hostapd/patches/{0001-wolfssl-init-RNG-with-ECC-key.patch => 001-wolfssl-init-RNG-with-ECC-key.patch} (76%) delete mode 100644 package/network/services/hostapd/patches/002-mesh-fix-channel-init-order-disable-pri-sec-channel-.patch delete mode 100644 package/network/services/hostapd/patches/003-wpa_supplicant-handle-HT40-and-mode-downgrade-in-AP-.patch delete mode 100644 package/network/services/hostapd/patches/004-wpa_supplicant-fix-frequency-config-for-non-p2p-vht-.patch delete mode 100644 package/network/services/hostapd/patches/005-wpa_supplicant-enable-vht-and-he-in-default-config-p.patch delete mode 100644 package/network/services/hostapd/patches/006-hw_features-better-debug-messages-for-some-error-cas.patch delete mode 100644 package/network/services/hostapd/patches/007-dfs-use-helper-functions-for-vht-he-parameters.patch delete mode 100644 package/network/services/hostapd/patches/008-mesh-use-setup-completion-callback-to-complete-mesh-.patch delete mode 100644 package/network/services/hostapd/patches/009-mesh-update-ssid-frequency-as-pri-sec-channel-switch.patch delete mode 100644 package/network/services/hostapd/patches/011-mesh-do-not-set-offchanok-on-DFS-channels-in-non-ETS.patch rename package/network/services/hostapd/patches/{019-mesh-use-deterministic-channel-on-channel-switch.patch => 011-mesh-use-deterministic-channel-on-channel-switch.patch} (97%) delete mode 100644 package/network/services/hostapd/patches/012-mesh-fix-channel-switch-error-during-CAC.patch delete mode 100644 package/network/services/hostapd/patches/013-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch delete mode 100644 package/network/services/hostapd/patches/014-mesh-fixes-for-mesh-init-deinit.patch delete mode 100644 package/network/services/hostapd/patches/015-mesh-fix-DFS-deinit-init.patch delete mode 100644 package/network/services/hostapd/patches/016-tests-DFS-test-for-wpa_supplicant-mesh.patch delete mode 100644 package/network/services/hostapd/patches/017-mesh-fix-mesh_oom-test.patch delete mode 100644 package/network/services/hostapd/patches/018-mesh-move-mesh-freq-setting-to-own-function.patch delete mode 100644 package/network/services/hostapd/patches/020-ignore-4addr-mode-enabling-error.patch rename package/network/services/hostapd/patches/{050-mesh-make-forwarding-configurable.patch => 020-mesh-make-forwarding-configurable.patch} (89%) delete mode 100644 package/network/services/hostapd/patches/060-P2P-Fix-a-corner-case-in-peer-addition-based-on-PD-R.patch delete mode 100644 package/network/services/hostapd/patches/110-notify-mgmt-frames.patch delete mode 100644 package/network/services/hostapd/patches/110-wolfssl-compile-fix.patch delete mode 100644 package/network/services/hostapd/patches/120-reconfigure-wps-credentials.patch delete mode 100644 package/network/services/hostapd/patches/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch delete mode 100644 package/network/services/hostapd/patches/801-P2P-Fix-copying-of-secondary-device-types-for-P2P-gr.patch diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 0779421b8d..ca6cc026c1 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -11,9 +11,9 @@ PKG_RELEASE:=33 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2020-06-08 -PKG_SOURCE_VERSION:=5a8b366233f5585e68a4ffbb604fbb4a848eb325 -PKG_MIRROR_HASH:=1b2a4947034142587a3f81eac2ea27dd64650e77f8943d973623b47533be2393 +PKG_SOURCE_DATE:=2021-05-21 +PKG_SOURCE_VERSION:=d98f4c46600d9449fa97186bd5263b76bedaf06e +PKG_MIRROR_HASH:=62ddbd570c0a86391c617b0cd7b337cdb49f6ae9dfbd227d58c0e1e9b43fef81 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause 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 --- a/package/network/services/hostapd/patches/001-HE-VHT-fix-frequency-setup-with-HE-enabled.patch +++ /dev/null @@ -1,196 +0,0 @@ -From 91976250359b263a44861aebe553b20627fe487e Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 13:53:17 +0200 -Subject: [PATCH 01/19] HE/VHT: fix frequency setup with HE enabled - -Some places in the code base were not using the -wrappers like hostapd_set_oper_centr_freq_seg0_idx -and friends. This could lead to errors, for example when -joining 80 MHz mesh networks. Fix this, by enforcing -usage of these wrappers. - -wpa_supplicant_conf_ap_ht now checks for HE capability -before dealing with VHT in order for these wrappers to work, -as they first check HE support in the config. - -While doing these changes, I've noticed that the extra -channel setup code for mesh networks in wpa_supplicant/mesh.c -should not be necessary anymore and dropped it. -wpa_supplicant_conf_ap_ht should handle this setup already. - -Acked-by: John Crispin -Signed-off-by: Markus Theil ---- - src/ap/dfs.c | 8 ++++---- - wpa_supplicant/ap.c | 40 +++++++++++++++++++++++----------------- - wpa_supplicant/mesh.c | 24 ------------------------ - 3 files changed, 27 insertions(+), 45 deletions(-) - ---- a/src/ap/dfs.c -+++ b/src/ap/dfs.c -@@ -1028,7 +1028,7 @@ static int hostapd_dfs_start_channel_swi - unsigned int i; - int err = 1; - struct hostapd_hw_modes *cmode = iface->current_mode; -- u8 current_vht_oper_chwidth = iface->conf->vht_oper_chwidth; -+ u8 current_vht_oper_chwidth = hostapd_get_oper_chwidth(iface->conf); - - wpa_printf(MSG_DEBUG, "%s called (CAC active: %s, CSA active: %s)", - __func__, iface->cac_started ? "yes" : "no", -@@ -1089,8 +1089,8 @@ static int hostapd_dfs_start_channel_swi - "freq=%d chan=%d sec_chan=%d", channel->freq, - channel->chan, secondary_channel); - -- new_vht_oper_chwidth = iface->conf->vht_oper_chwidth; -- iface->conf->vht_oper_chwidth = current_vht_oper_chwidth; -+ new_vht_oper_chwidth = hostapd_get_oper_chwidth(iface->conf); -+ hostapd_set_oper_chwidth(iface->conf, current_vht_oper_chwidth); - - /* Setup CSA request */ - os_memset(&csa_settings, 0, sizeof(csa_settings)); -@@ -1130,7 +1130,7 @@ static int hostapd_dfs_start_channel_swi - iface->freq = channel->freq; - iface->conf->channel = channel->chan; - iface->conf->secondary_channel = secondary_channel; -- iface->conf->vht_oper_chwidth = new_vht_oper_chwidth; -+ hostapd_set_oper_chwidth(iface->conf, new_vht_oper_chwidth); - hostapd_set_oper_centr_freq_seg0_idx(iface->conf, - oper_centr_freq_seg0_idx); - hostapd_set_oper_centr_freq_seg1_idx(iface->conf, ---- a/wpa_supplicant/ap.c -+++ b/wpa_supplicant/ap.c -@@ -52,6 +52,7 @@ static void wpas_conf_ap_vht(struct wpa_ - #ifdef CONFIG_P2P - u8 center_chan = 0; - u8 channel = conf->channel; -+ u8 freq_seg_idx; - #endif /* CONFIG_P2P */ - - if (!conf->secondary_channel) -@@ -59,19 +60,21 @@ static void wpas_conf_ap_vht(struct wpa_ - - /* Use the maximum oper channel width if it's given. */ - if (ssid->max_oper_chwidth) -- conf->vht_oper_chwidth = ssid->max_oper_chwidth; -+ hostapd_set_oper_chwidth(conf, ssid->max_oper_chwidth); - - ieee80211_freq_to_chan(ssid->vht_center_freq2, -- &conf->vht_oper_centr_freq_seg1_idx); -+ &freq_seg_idx); -+ hostapd_set_oper_centr_freq_seg1_idx(conf, freq_seg_idx); - - if (!ssid->p2p_group) { - if (!ssid->vht_center_freq1 || -- conf->vht_oper_chwidth == CHANWIDTH_USE_HT) -+ hostapd_get_oper_chwidth(conf) == CHANWIDTH_USE_HT) - goto no_vht; - ieee80211_freq_to_chan(ssid->vht_center_freq1, -- &conf->vht_oper_centr_freq_seg0_idx); -+ &freq_seg_idx); -+ hostapd_set_oper_centr_freq_seg0_idx(conf, freq_seg_idx); - wpa_printf(MSG_DEBUG, "VHT seg0 index %d for AP", -- conf->vht_oper_centr_freq_seg0_idx); -+ hostapd_get_oper_centr_freq_seg0_idx(conf)); - return; - } - -@@ -96,14 +99,14 @@ static void wpas_conf_ap_vht(struct wpa_ - * try oper_cwidth 160 MHz first then VHT 80 MHz, if 160 MHz is - * not supported. - */ -- conf->vht_oper_chwidth = CHANWIDTH_160MHZ; -+ hostapd_set_oper_chwidth(conf, CHANWIDTH_160MHZ); - center_chan = wpas_p2p_get_vht160_center(wpa_s, mode, channel); - if (center_chan) { - wpa_printf(MSG_DEBUG, - "VHT center channel %u for auto-selected 160 MHz bandwidth", - center_chan); - } else { -- conf->vht_oper_chwidth = CHANWIDTH_80MHZ; -+ hostapd_set_oper_chwidth(conf, CHANWIDTH_80MHZ); - center_chan = wpas_p2p_get_vht80_center(wpa_s, mode, - channel); - wpa_printf(MSG_DEBUG, -@@ -115,9 +118,9 @@ static void wpas_conf_ap_vht(struct wpa_ - if (!center_chan) - goto no_vht; - -- conf->vht_oper_centr_freq_seg0_idx = center_chan; -+ hostapd_set_oper_centr_freq_seg0_idx(conf, center_chan); - wpa_printf(MSG_DEBUG, "VHT seg0 index %d for P2P GO", -- conf->vht_oper_centr_freq_seg0_idx); -+ hostapd_get_oper_centr_freq_seg0_idx(conf)); - return; - #endif /* CONFIG_P2P */ - -@@ -125,9 +128,9 @@ no_vht: - wpa_printf(MSG_DEBUG, - "No VHT higher bandwidth support for the selected channel %d", - conf->channel); -- conf->vht_oper_centr_freq_seg0_idx = -- conf->channel + conf->secondary_channel * 2; -- conf->vht_oper_chwidth = CHANWIDTH_USE_HT; -+ hostapd_set_oper_centr_freq_seg0_idx(conf, -+ conf->channel + conf->secondary_channel * 2); -+ hostapd_set_oper_chwidth(conf, CHANWIDTH_USE_HT); - } - - -@@ -231,16 +234,19 @@ int wpa_supplicant_conf_ap_ht(struct wpa - HT_CAP_INFO_TX_STBC | - HT_CAP_INFO_MAX_AMSDU_SIZE); - -+ /* check this before VHT, because setting oper chan -+ * width and friends is the same call for HE and VHT -+ * and checks if conf->ieee8021ax == 1 */ -+ if (mode->he_capab[wpas_mode_to_ieee80211_mode( -+ ssid->mode)].he_supported && -+ ssid->he) -+ conf->ieee80211ax = 1; -+ - if (mode->vht_capab && ssid->vht) { - conf->ieee80211ac = 1; - conf->vht_capab |= mode->vht_capab; - wpas_conf_ap_vht(wpa_s, ssid, conf, mode); - } -- -- if (mode->he_capab[wpas_mode_to_ieee80211_mode( -- ssid->mode)].he_supported && -- ssid->he) -- conf->ieee80211ax = 1; - } - } - ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -333,30 +333,6 @@ static int wpa_supplicant_mesh_init(stru - frequency); - goto out_free; - } -- if (ssid->ht40) -- conf->secondary_channel = ssid->ht40; -- if (conf->hw_mode == HOSTAPD_MODE_IEEE80211A && ssid->vht) { -- if (ssid->max_oper_chwidth != DEFAULT_MAX_OPER_CHWIDTH) -- conf->vht_oper_chwidth = ssid->max_oper_chwidth; -- switch (conf->vht_oper_chwidth) { -- case CHANWIDTH_80MHZ: -- case CHANWIDTH_80P80MHZ: -- ieee80211_freq_to_chan( -- frequency, -- &conf->vht_oper_centr_freq_seg0_idx); -- conf->vht_oper_centr_freq_seg0_idx += ssid->ht40 * 2; -- break; -- case CHANWIDTH_160MHZ: -- ieee80211_freq_to_chan( -- frequency, -- &conf->vht_oper_centr_freq_seg0_idx); -- conf->vht_oper_centr_freq_seg0_idx += ssid->ht40 * 2; -- conf->vht_oper_centr_freq_seg0_idx += 40 / 5; -- break; -- } -- ieee80211_freq_to_chan(ssid->vht_center_freq2, -- &conf->vht_oper_centr_freq_seg1_idx); -- } - - if (ssid->mesh_basic_rates == NULL) { - /* diff --git a/package/network/services/hostapd/patches/0001-wolfssl-init-RNG-with-ECC-key.patch b/package/network/services/hostapd/patches/001-wolfssl-init-RNG-with-ECC-key.patch similarity index 76% rename from package/network/services/hostapd/patches/0001-wolfssl-init-RNG-with-ECC-key.patch rename to package/network/services/hostapd/patches/001-wolfssl-init-RNG-with-ECC-key.patch index 89d111e991..84fc1c9351 100644 --- a/package/network/services/hostapd/patches/0001-wolfssl-init-RNG-with-ECC-key.patch +++ b/package/network/services/hostapd/patches/001-wolfssl-init-RNG-with-ECC-key.patch @@ -14,11 +14,9 @@ Signed-off-by: David Bauer src/crypto/crypto_wolfssl.c | 4 ++++ 1 file changed, 4 insertions(+) -diff --git a/src/crypto/crypto_wolfssl.c b/src/crypto/crypto_wolfssl.c -index 2e4bf8962..ed2528159 100644 --- a/src/crypto/crypto_wolfssl.c +++ b/src/crypto/crypto_wolfssl.c -@@ -1303,6 +1303,7 @@ int ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, +@@ -1303,6 +1303,7 @@ int ecc_projective_add_point(ecc_point * struct crypto_ec { ecc_key key; @@ -26,7 +24,7 @@ index 2e4bf8962..ed2528159 100644 mp_int a; mp_int prime; mp_int order; -@@ -1357,6 +1358,8 @@ struct crypto_ec * crypto_ec_init(int group) +@@ -1357,6 +1358,8 @@ struct crypto_ec * crypto_ec_init(int gr return NULL; if (wc_ecc_init(&e->key) != 0 || @@ -35,7 +33,7 @@ index 2e4bf8962..ed2528159 100644 wc_ecc_set_curve(&e->key, 0, curve_id) != 0 || mp_init(&e->a) != MP_OKAY || mp_init(&e->prime) != MP_OKAY || -@@ -1388,6 +1391,7 @@ void crypto_ec_deinit(struct crypto_ec* e) +@@ -1388,6 +1391,7 @@ void crypto_ec_deinit(struct crypto_ec* mp_clear(&e->order); mp_clear(&e->prime); mp_clear(&e->a); @@ -43,6 +41,3 @@ index 2e4bf8962..ed2528159 100644 wc_ecc_free(&e->key); os_free(e); } --- -2.31.1 - diff --git a/package/network/services/hostapd/patches/002-mesh-fix-channel-init-order-disable-pri-sec-channel-.patch b/package/network/services/hostapd/patches/002-mesh-fix-channel-init-order-disable-pri-sec-channel-.patch deleted file mode 100644 index c7101b1dbc..0000000000 --- a/package/network/services/hostapd/patches/002-mesh-fix-channel-init-order-disable-pri-sec-channel-.patch +++ /dev/null @@ -1,126 +0,0 @@ -From d869c753b79a1423c2bd9b0afdfa0d89d55a930c Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 13:53:18 +0200 -Subject: [PATCH 02/19] mesh: fix channel init order, disable pri/sec channel - switch - -wpa_supplicant_conf_ap_ht has to happen before hostapd_setup_interface -in order for its configuration settings to have effect on interface -configuration. - -Disable primary and secondary channel switch because of missing tie -breaking rule/frames in mesh networks. A rather long comment about -this issue is placed in mesh.c in the corresponding place. - -In consequence, remove mesh coex test, which contradicts this change. - -I was not able to reproduce the memory corruption during -mesh_secure_ocv_mix_legacy, which lead to a revert of a similar patch -in the past. - -Signed-off-by: Markus Theil ---- - tests/hwsim/test_wpas_mesh.py | 50 ----------------------------------- - wpa_supplicant/mesh.c | 25 ++++++++++++++++-- - 2 files changed, 23 insertions(+), 52 deletions(-) - ---- a/tests/hwsim/test_wpas_mesh.py -+++ b/tests/hwsim/test_wpas_mesh.py -@@ -933,56 +933,6 @@ def _test_wpas_mesh_open_5ghz(dev, apdev - dev[0].dump_monitor() - dev[1].dump_monitor() - --def test_wpas_mesh_open_5ghz_coex(dev, apdev): -- """Mesh network on 5 GHz band and 20/40 coex change""" -- try: -- _test_wpas_mesh_open_5ghz_coex(dev, apdev) -- finally: -- dev[0].request("MESH_GROUP_REMOVE " + dev[0].ifname) -- dev[1].request("MESH_GROUP_REMOVE " + dev[1].ifname) -- set_world_reg(apdev0=apdev[0], dev0=dev[0]) -- dev[0].flush_scan_cache() -- dev[1].flush_scan_cache() -- --def _test_wpas_mesh_open_5ghz_coex(dev, apdev): -- check_mesh_support(dev[0]) -- subprocess.call(['iw', 'reg', 'set', 'US']) -- -- # Start a 20 MHz BSS on channel 40 that would be the secondary channel of -- # HT40+ mesh on channel 36. -- params = {"ssid": "test-ht40", -- "hw_mode": "a", -- "channel": "40", -- "country_code": "US"} -- hapd = hostapd.add_ap(apdev[0], params) -- bssid = hapd.own_addr() -- -- for i in range(2): -- for j in range(5): -- ev = dev[i].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=5) -- if ev is None: -- raise Exception("No regdom change event") -- if "alpha2=US" in ev: -- break -- dev[i].scan_for_bss(bssid, freq=5200) -- add_open_mesh_network(dev[i], freq="5180") -- -- check_mesh_joined_connected(dev) -- -- freq = dev[0].get_status_field("freq") -- if freq != "5200": -- raise Exception("Unexpected STATUS freq=" + freq) -- sig = dev[0].request("SIGNAL_POLL").splitlines() -- if "FREQUENCY=5200" not in sig: -- raise Exception("Unexpected SIGNAL_POLL output: " + str(sig)) -- -- hapd.disable() -- dev[0].mesh_group_remove() -- dev[1].mesh_group_remove() -- check_mesh_group_removed(dev[0]) -- check_mesh_group_removed(dev[1]) -- dev[0].dump_monitor() -- dev[1].dump_monitor() - - def test_wpas_mesh_open_ht40(dev, apdev): - """Mesh and HT40 support difference""" ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -363,6 +363,29 @@ static int wpa_supplicant_mesh_init(stru - conf->basic_rates[rate_len] = -1; - } - -+ /* While it can enhance performance to switch the primary channel, which -+ * is also the secondary channel of another network at the same time), -+ * to the other primary channel, problems exist with this in mesh networks. -+ * -+ * Example with problems: -+ * - 3 mesh nodes M1-M3, freq (5200, 5180) -+ * - other node O1, e.g. AP mode, freq (5180, 5200), -+ * Locations: O1 M1 M2 M3 -+ * -+ * M3 can only send frames to M1 over M2, no direct connection is possible -+ * Start O1, M1 and M3 first, M1 or O1 will switch channels to align with -+ * each other. M3 does not swap, because M1 or O1 cannot be reached. -+ * M2 is started afterwards and can either connect to M3 or M1 because of -+ * this primary secondary channel switch. -+ * -+ * Solutions: (1) central coordination -> not always possible -+ * (2) disable pri/sec channel switch in mesh networks -+ * -+ * In AP mode, when all nodes can work independently, this poses of course -+ * no problem, therefore disable it only in mesh mode.`*/ -+ conf->no_pri_sec_switch = 1; -+ wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf); -+ - if (wpa_drv_init_mesh(wpa_s)) { - wpa_msg(wpa_s, MSG_ERROR, "Failed to init mesh in driver"); - return -1; -@@ -374,8 +397,6 @@ static int wpa_supplicant_mesh_init(stru - return -1; - } - -- wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf); -- - return 0; - out_free: - wpa_supplicant_mesh_deinit(wpa_s); diff --git a/package/network/services/hostapd/patches/003-wpa_supplicant-handle-HT40-and-mode-downgrade-in-AP-.patch b/package/network/services/hostapd/patches/003-wpa_supplicant-handle-HT40-and-mode-downgrade-in-AP-.patch deleted file mode 100644 index f42620042d..0000000000 --- a/package/network/services/hostapd/patches/003-wpa_supplicant-handle-HT40-and-mode-downgrade-in-AP-.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 978a59514ccde994b5c06e1cbb49cc8cebe6381c Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 13:53:19 +0200 -Subject: [PATCH 03/19] wpa_supplicant: handle HT40 and mode downgrade in AP - mode - -This patch adds some missing pieces to the interface configuration -of AP/mesh mode in wpa_supplicant. - - check for secondary channel and HT40 capability - - try to downgrade to 11b if 11g is not available -Especially with the HT40 check, this code now performs all settings, -which the deleted/duplicated mesh code did. - -Signed-off-by: Markus Theil ---- - wpa_supplicant/ap.c | 49 ++++++++++++++++++++++++++++++++++++--------- - 1 file changed, 40 insertions(+), 9 deletions(-) - ---- a/wpa_supplicant/ap.c -+++ b/wpa_supplicant/ap.c -@@ -134,6 +134,23 @@ no_vht: - } - - -+static struct hostapd_hw_modes *wpa_supplicant_find_hw_mode(struct wpa_supplicant *wpa_s, -+ enum hostapd_hw_mode hw_mode) -+{ -+ struct hostapd_hw_modes *mode = NULL; -+ int i; -+ -+ for (i = 0; i < wpa_s->hw.num_modes; i++) { -+ if (wpa_s->hw.modes[i].mode == hw_mode) { -+ mode = &wpa_s->hw.modes[i]; -+ break; -+ } -+ } -+ -+ return mode; -+} -+ -+ - int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s, - struct wpa_ssid *ssid, - struct hostapd_config *conf) -@@ -147,9 +164,6 @@ int wpa_supplicant_conf_ap_ht(struct wpa - return -1; - } - -- /* TODO: enable HT40 if driver supports it; -- * drop to 11b if driver does not support 11g */ -- - /* - * Enable HT20 if the driver supports it, by setting conf->ieee80211n - * and a mask of allowed capabilities within conf->ht_capab. -@@ -158,17 +172,27 @@ int wpa_supplicant_conf_ap_ht(struct wpa - */ - if (wpa_s->hw.modes) { - struct hostapd_hw_modes *mode = NULL; -- int i, no_ht = 0; -+ int no_ht = 0; - - wpa_printf(MSG_DEBUG, - "Determining HT/VHT options based on driver capabilities (freq=%u chan=%u)", - ssid->frequency, conf->channel); - -- for (i = 0; i < wpa_s->hw.num_modes; i++) { -- if (wpa_s->hw.modes[i].mode == conf->hw_mode) { -- mode = &wpa_s->hw.modes[i]; -- break; -- } -+ mode = wpa_supplicant_find_hw_mode(wpa_s, conf->hw_mode); -+ -+ /* may drop drop to 11b if driver does not support 11g */ -+ if (!mode && conf->hw_mode == HOSTAPD_MODE_IEEE80211G) { -+ conf->hw_mode = HOSTAPD_MODE_IEEE80211B; -+ wpa_printf(MSG_INFO, -+ "Try downgrade to IEEE 802.11b as 802.11g is not " -+ "supported by the current hardware"); -+ mode = wpa_supplicant_find_hw_mode(wpa_s, conf->hw_mode); -+ } -+ -+ if (!mode) { -+ wpa_printf(MSG_ERROR, -+ "No match between requested and supported hw modes found"); -+ return -1; - } - - #ifdef CONFIG_HT_OVERRIDES -@@ -193,6 +217,13 @@ int wpa_supplicant_conf_ap_ht(struct wpa - HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET), - ssid->ht40); - conf->ieee80211n = 1; -+ -+ if (ssid->ht40 && -+ mode->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET) -+ conf->secondary_channel = ssid->ht40; -+ else -+ conf->secondary_channel = 0; -+ - #ifdef CONFIG_P2P - if (ssid->p2p_group && - conf->hw_mode == HOSTAPD_MODE_IEEE80211A && diff --git a/package/network/services/hostapd/patches/004-wpa_supplicant-fix-frequency-config-for-non-p2p-vht-.patch b/package/network/services/hostapd/patches/004-wpa_supplicant-fix-frequency-config-for-non-p2p-vht-.patch deleted file mode 100644 index e8682af644..0000000000 --- a/package/network/services/hostapd/patches/004-wpa_supplicant-fix-frequency-config-for-non-p2p-vht-.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 7f7325dae1d03a3964d4e91940d8369f3fed7b43 Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 13:53:20 +0200 -Subject: [PATCH 04/19] wpa_supplicant: fix frequency config for non p2p vht/he - cases - -Fix compile without CONFIG_P2P and only set secondary channel seg idx -if we use a mode supporting a sec channel for vht/he. - -Signed-off-by: Markus Theil ---- - wpa_supplicant/ap.c | 23 +++++++++++++---------- - 1 file changed, 13 insertions(+), 10 deletions(-) - ---- a/wpa_supplicant/ap.c -+++ b/wpa_supplicant/ap.c -@@ -52,8 +52,8 @@ static void wpas_conf_ap_vht(struct wpa_ - #ifdef CONFIG_P2P - u8 center_chan = 0; - u8 channel = conf->channel; -- u8 freq_seg_idx; - #endif /* CONFIG_P2P */ -+ u8 freq_seg_idx; - - if (!conf->secondary_channel) - goto no_vht; -@@ -62,24 +62,27 @@ static void wpas_conf_ap_vht(struct wpa_ - if (ssid->max_oper_chwidth) - hostapd_set_oper_chwidth(conf, ssid->max_oper_chwidth); - -- ieee80211_freq_to_chan(ssid->vht_center_freq2, -- &freq_seg_idx); -- hostapd_set_oper_centr_freq_seg1_idx(conf, freq_seg_idx); -- - if (!ssid->p2p_group) { -- if (!ssid->vht_center_freq1 || -- hostapd_get_oper_chwidth(conf) == CHANWIDTH_USE_HT) -+ if (!ssid->vht_center_freq1) - goto no_vht; - ieee80211_freq_to_chan(ssid->vht_center_freq1, - &freq_seg_idx); - hostapd_set_oper_centr_freq_seg0_idx(conf, freq_seg_idx); -- wpa_printf(MSG_DEBUG, "VHT seg0 index %d for AP", -- hostapd_get_oper_centr_freq_seg0_idx(conf)); -+ -+ if (hostapd_get_oper_chwidth(conf) == CHANWIDTH_80P80MHZ) { -+ ieee80211_freq_to_chan(ssid->vht_center_freq2, -+ &freq_seg_idx); -+ hostapd_set_oper_centr_freq_seg1_idx(conf, freq_seg_idx); -+ } -+ -+ wpa_printf(MSG_DEBUG, "VHT seg0 index %d and seg1 index %d for AP", -+ hostapd_get_oper_centr_freq_seg0_idx(conf), -+ hostapd_get_oper_centr_freq_seg1_idx(conf)); - return; - } - - #ifdef CONFIG_P2P -- switch (conf->vht_oper_chwidth) { -+ switch (hostapd_get_oper_chwidth(conf)) { - case CHANWIDTH_80MHZ: - case CHANWIDTH_80P80MHZ: - center_chan = wpas_p2p_get_vht80_center(wpa_s, mode, channel); diff --git a/package/network/services/hostapd/patches/005-wpa_supplicant-enable-vht-and-he-in-default-config-p.patch b/package/network/services/hostapd/patches/005-wpa_supplicant-enable-vht-and-he-in-default-config-p.patch deleted file mode 100644 index 25d74252cd..0000000000 --- a/package/network/services/hostapd/patches/005-wpa_supplicant-enable-vht-and-he-in-default-config-p.patch +++ /dev/null @@ -1,25 +0,0 @@ -From ff7fb3fa0831c8521327d777c5607a3b7d8736b8 Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 13:53:21 +0200 -Subject: [PATCH 05/19] wpa_supplicant: enable vht and he in default config - parameters - -Enable VHT and HE as default config parameters in order for -wpa_supplicant AP mode to use it, if hw support is given. - -Signed-off-by: Markus Theil ---- - wpa_supplicant/config.c | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/wpa_supplicant/config.c -+++ b/wpa_supplicant/config.c -@@ -3036,6 +3036,8 @@ void wpa_config_set_network_defaults(str - ssid->wpa_deny_ptk0_rekey = PTK0_REKEY_ALLOW_ALWAYS; - ssid->bg_scan_period = DEFAULT_BG_SCAN_PERIOD; - ssid->ht = 1; -+ ssid->vht = 1; -+ ssid->he = 1; - #ifdef IEEE8021X_EAPOL - ssid->eapol_flags = DEFAULT_EAPOL_FLAGS; - ssid->eap_workaround = DEFAULT_EAP_WORKAROUND; diff --git a/package/network/services/hostapd/patches/006-hw_features-better-debug-messages-for-some-error-cas.patch b/package/network/services/hostapd/patches/006-hw_features-better-debug-messages-for-some-error-cas.patch deleted file mode 100644 index 31b1ac0d38..0000000000 --- a/package/network/services/hostapd/patches/006-hw_features-better-debug-messages-for-some-error-cas.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 6522dcbbcf71abcb80cce84b93b4a9a5cfcd4fca Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 13:53:22 +0200 -Subject: [PATCH 06/19] hw_features: better debug messages for some error cases - -Signed-off-by: Markus Theil ---- - src/common/hw_features_common.c | 29 ++++++++++++++++++++++------- - 1 file changed, 22 insertions(+), 7 deletions(-) - ---- a/src/common/hw_features_common.c -+++ b/src/common/hw_features_common.c -@@ -540,13 +540,18 @@ int hostapd_set_freq_params(struct hosta - if (center_segment1 || - (center_segment0 != 0 && - 5000 + center_segment0 * 5 != data->center_freq1 && -- 2407 + center_segment0 * 5 != data->center_freq1)) -+ 2407 + center_segment0 * 5 != data->center_freq1)) { -+ wpa_printf(MSG_ERROR, "20/40 MHz: center segment 0 (=%i) and center freq 1 (=%i) not in sync", -+ center_segment0, data->center_freq1); - return -1; -+ } - break; - case CHANWIDTH_80P80MHZ: - if (center_segment1 == center_segment0 + 4 || -- center_segment1 == center_segment0 - 4) -+ center_segment1 == center_segment0 - 4) { -+ wpa_printf(MSG_ERROR, "80+80 MHz: center segment 1 only 20 MHz apart"); - return -1; -+ } - data->center_freq2 = 5000 + center_segment1 * 5; - /* fall through */ - case CHANWIDTH_80MHZ: -@@ -555,8 +560,10 @@ int hostapd_set_freq_params(struct hosta - center_segment1) || - (oper_chwidth == CHANWIDTH_80P80MHZ && - !center_segment1) || -- !sec_channel_offset) -+ !sec_channel_offset) { -+ wpa_printf(MSG_ERROR, "80/80+80 MHz: center segment 1 wrong or no second channel offset"); - return -1; -+ } - if (!center_segment0) { - if (channel <= 48) - center_segment0 = 42; -@@ -582,16 +589,22 @@ int hostapd_set_freq_params(struct hosta - center_segment0 == channel - 2 || - center_segment0 == channel - 6) - data->center_freq1 = 5000 + center_segment0 * 5; -- else -+ else { -+ wpa_printf(MSG_ERROR, "Wrong coupling between HT and VHT/HE channel setting"); - return -1; -+ } - } - break; - case CHANWIDTH_160MHZ: - data->bandwidth = 160; -- if (center_segment1) -+ if (center_segment1) { -+ wpa_printf(MSG_ERROR, "160 MHz: center segment 1 should not be set"); - return -1; -- if (!sec_channel_offset) -+ } -+ if (!sec_channel_offset) { -+ wpa_printf(MSG_ERROR, "160 MHz: second channel offset not set"); - return -1; -+ } - /* - * Note: HT/VHT config and params are coupled. Check if - * HT40 channel band is in VHT160 channel band configuration. -@@ -605,8 +618,10 @@ int hostapd_set_freq_params(struct hosta - center_segment0 == channel - 10 || - center_segment0 == channel - 14) - data->center_freq1 = 5000 + center_segment0 * 5; -- else -+ else { -+ wpa_printf(MSG_ERROR, "160 MHz: HT40 channel band is not in 160 MHz band"); - return -1; -+ } - break; - } - diff --git a/package/network/services/hostapd/patches/007-dfs-use-helper-functions-for-vht-he-parameters.patch b/package/network/services/hostapd/patches/007-dfs-use-helper-functions-for-vht-he-parameters.patch deleted file mode 100644 index 3481c52eef..0000000000 --- a/package/network/services/hostapd/patches/007-dfs-use-helper-functions-for-vht-he-parameters.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 6eacc14904b6f09a1490e697c01adf5dc56c4905 Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 13:53:23 +0200 -Subject: [PATCH 07/19] dfs: use helper functions for vht/he parameters - -Signed-off-by: Markus Theil ---- - src/ap/dfs.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - ---- a/src/ap/dfs.c -+++ b/src/ap/dfs.c -@@ -955,10 +955,12 @@ dfs_downgrade_bandwidth(struct hostapd_i - if (*skip_radar) { - *skip_radar = 0; - } else { -- if (iface->conf->vht_oper_chwidth == CHANWIDTH_USE_HT) -+ int oper_chwidth = hostapd_get_oper_chwidth(iface->conf); -+ -+ if (oper_chwidth == CHANWIDTH_USE_HT) - break; - *skip_radar = 1; -- iface->conf->vht_oper_chwidth--; -+ hostapd_set_oper_chwidth(iface->conf, oper_chwidth - 1); - } - } - diff --git a/package/network/services/hostapd/patches/008-mesh-use-setup-completion-callback-to-complete-mesh-.patch b/package/network/services/hostapd/patches/008-mesh-use-setup-completion-callback-to-complete-mesh-.patch deleted file mode 100644 index 28c283d035..0000000000 --- a/package/network/services/hostapd/patches/008-mesh-use-setup-completion-callback-to-complete-mesh-.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 11e5bbe58eebdb10793eec374b6c8ccc7daf7ec8 Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Tue, 30 Jun 2020 14:18:56 +0200 -Subject: [PATCH 08/19] mesh: use setup completion callback to complete mesh - join - -mesh join function is the last function to be called during -mesh join process, but it's been called a bit earlier than -it's supposed to be, so that some mesh parameter values -such as VHT capabilities not applied correct when mesh join -is in process. -Moreover current design of mesh join that is called directly -after mesh initialization isn't suitable for DFS channels to use, -since mesh join process should be paused until DFS CAC is -done and resumed after it's done. -The callback will be called by hostapd_setup_interface_complete_sync. -There is possiblity that completing mesh init fails, so add error -handle codes. - -Signed-off-by: Peter Oh ---- - src/ap/hostapd.c | 11 ++++++++++- - wpa_supplicant/mesh.c | 12 ++++++++++-- - 2 files changed, 20 insertions(+), 3 deletions(-) - ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -434,6 +434,8 @@ static void hostapd_free_hapd_data(struc - #ifdef CONFIG_MESH - wpabuf_free(hapd->mesh_pending_auth); - hapd->mesh_pending_auth = NULL; -+ /* handling setup failure is already done */ -+ hapd->setup_complete_cb = NULL; - #endif /* CONFIG_MESH */ - - hostapd_clean_rrm(hapd); -@@ -2156,6 +2158,13 @@ dfs_offload: - if (hapd->setup_complete_cb) - hapd->setup_complete_cb(hapd->setup_complete_cb_ctx); - -+#ifdef CONFIG_MESH -+ if (delay_apply_cfg && iface->mconf == NULL) { -+ wpa_printf(MSG_ERROR, "Error while completing mesh init"); -+ goto fail; -+ } -+#endif /* CONFIG_MESH */ -+ - wpa_printf(MSG_DEBUG, "%s: Setup of interface done.", - iface->bss[0]->conf->iface); - if (iface->interfaces && iface->interfaces->terminate_on_error > 0) -@@ -2299,7 +2308,7 @@ int hostapd_setup_interface(struct hosta - ret = setup_interface(iface); - if (ret) { - wpa_printf(MSG_ERROR, "%s: Unable to setup interface.", -- iface->bss[0]->conf->iface); -+ iface->conf ? iface->conf->bss[0]->iface : "N/A"); - return -1; - } - ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -193,7 +193,6 @@ static int wpas_mesh_init_rsn(struct wpa - return !wpa_s->mesh_rsn ? -1 : 0; - } - -- - static int wpas_mesh_complete(struct wpa_supplicant *wpa_s) - { - struct hostapd_iface *ifmsh = wpa_s->ifmsh; -@@ -244,6 +243,13 @@ static int wpas_mesh_complete(struct wpa - } - - -+static void wpas_mesh_complete_cb(void *arg) -+{ -+ struct wpa_supplicant *wpa_s = arg; -+ wpas_mesh_complete(wpa_s); -+} -+ -+ - static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, - struct wpa_ssid *ssid, - struct hostapd_freq_params *freq) -@@ -267,6 +273,7 @@ static int wpa_supplicant_mesh_init(stru - if (!ifmsh) - return -ENOMEM; - -+ ifmsh->owner = wpa_s; - ifmsh->drv_flags = wpa_s->drv_flags; - ifmsh->drv_flags2 = wpa_s->drv_flags2; - ifmsh->num_bss = 1; -@@ -285,6 +292,8 @@ static int wpa_supplicant_mesh_init(stru - bss->drv_priv = wpa_s->drv_priv; - bss->iface = ifmsh; - bss->mesh_sta_free_cb = mesh_mpm_free_sta; -+ bss->setup_complete_cb = wpas_mesh_complete_cb; -+ bss->setup_complete_cb_ctx = wpa_s; - frequency = ssid->frequency; - if (frequency != freq->freq && - frequency == freq->freq + freq->sec_channel_offset * 20) { -@@ -523,7 +532,6 @@ int wpa_supplicant_join_mesh(struct wpa_ - goto out; - } - -- ret = wpas_mesh_complete(wpa_s); - out: - return ret; - } diff --git a/package/network/services/hostapd/patches/009-mesh-update-ssid-frequency-as-pri-sec-channel-switch.patch b/package/network/services/hostapd/patches/009-mesh-update-ssid-frequency-as-pri-sec-channel-switch.patch deleted file mode 100644 index b48de67636..0000000000 --- a/package/network/services/hostapd/patches/009-mesh-update-ssid-frequency-as-pri-sec-channel-switch.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 87c5e8883898e7eb8e9637e212350c1925a22654 Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Tue, 30 Jun 2020 14:18:57 +0200 -Subject: [PATCH 09/19] mesh: update ssid->frequency as pri/sec channel switch - -ssid->frequency is one of variables used to gets channel -number from given frequency. Leave it as unchanged when -pri/sec channel switched will cause picking up wrong -channel number after applying secondary channel offset -for HT40 and leads failing interface bring-up. - -Signed-off-by: Peter Oh ---- - wpa_supplicant/mesh.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -299,6 +299,7 @@ static int wpa_supplicant_mesh_init(stru - frequency == freq->freq + freq->sec_channel_offset * 20) { - wpa_printf(MSG_DEBUG, "mesh: pri/sec channels switched"); - frequency = freq->freq; -+ ssid->frequency = frequency; - } - wpa_s->assoc_freq = frequency; - wpa_s->current_ssid = ssid; diff --git a/package/network/services/hostapd/patches/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch b/package/network/services/hostapd/patches/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch index 8afeba93ed..d948c41b30 100644 --- a/package/network/services/hostapd/patches/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch +++ b/package/network/services/hostapd/patches/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch @@ -14,7 +14,7 @@ Signed-off-by: Peter Oh --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2349,6 +2349,8 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2395,6 +2395,8 @@ void ibss_mesh_setup_freq(struct wpa_sup int chwidth, seg0, seg1; u32 vht_caps = 0; int is_24ghz; @@ -23,7 +23,7 @@ Signed-off-by: Peter Oh freq->freq = ssid->frequency; -@@ -2436,8 +2438,11 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2484,8 +2486,11 @@ void ibss_mesh_setup_freq(struct wpa_sup return; /* Check primary channel flags */ @@ -36,7 +36,7 @@ Signed-off-by: Peter Oh freq->channel = pri_chan->chan; -@@ -2470,8 +2475,11 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2518,8 +2523,11 @@ void ibss_mesh_setup_freq(struct wpa_sup return; /* Check secondary channel flags */ @@ -49,7 +49,7 @@ Signed-off-by: Peter Oh if (ht40 == -1) { if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS)) -@@ -2564,8 +2572,11 @@ skip_ht40: +@@ -2612,8 +2620,11 @@ skip_ht40: return; /* Back to HT configuration if channel not usable */ @@ -62,7 +62,7 @@ Signed-off-by: Peter Oh } chwidth = CHANWIDTH_80MHZ; -@@ -2585,10 +2596,12 @@ skip_ht40: +@@ -2633,10 +2644,12 @@ skip_ht40: if (!chan) continue; diff --git a/package/network/services/hostapd/patches/011-mesh-do-not-set-offchanok-on-DFS-channels-in-non-ETS.patch b/package/network/services/hostapd/patches/011-mesh-do-not-set-offchanok-on-DFS-channels-in-non-ETS.patch deleted file mode 100644 index d491f7c4bc..0000000000 --- a/package/network/services/hostapd/patches/011-mesh-do-not-set-offchanok-on-DFS-channels-in-non-ETS.patch +++ /dev/null @@ -1,53 +0,0 @@ -From af8dcbc87466ed6472850a4f1cfe252652cb3d26 Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Tue, 30 Jun 2020 14:18:59 +0200 -Subject: [PATCH 11/19] mesh: do not set offchanok on DFS channels in non-ETSI - -mac80211 does not allow mgmt tx to use off channel on -DFS channels in non-ETSI domain, because it will invalidate -CAC result on current operating channel. -(mac80211 commit: 34373d12f3cbb74960a73431138ef619d857996f) -Hence don't set offchanok for mgmt tx in case of DFS channels -in non-ETSI. - -Signed-off-by: Peter Oh ---- - src/drivers/driver_nl80211.c | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -7788,7 +7788,11 @@ static int wpa_driver_nl80211_send_actio - int ret = -1; - u8 *buf; - struct ieee80211_hdr *hdr; -+ struct hostapd_hw_modes *modes; - int offchanok = 1; -+ u16 num_modes, flags; -+ u8 dfs_domain; -+ int i; - - if (is_ap_interface(drv->nlmode) && (int) freq == bss->freq && - bss->beacon_set) -@@ -7817,6 +7821,21 @@ static int wpa_driver_nl80211_send_actio - os_memset(bss->rand_addr, 0, ETH_ALEN); - } - -+ if (is_mesh_interface(drv->nlmode)) { -+ modes = nl80211_get_hw_feature_data(bss, &num_modes, -+ &flags, &dfs_domain); -+ if (dfs_domain != HOSTAPD_DFS_REGION_ETSI && -+ ieee80211_is_dfs(bss->freq, modes, num_modes)) -+ offchanok = 0; -+ if (modes) { -+ for (i = 0; i < num_modes; i++) { -+ os_free(modes[i].channels); -+ os_free(modes[i].rates); -+ } -+ os_free(modes); -+ } -+ } -+ - if (is_ap_interface(drv->nlmode) && - (!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) || - (int) freq == bss->freq || drv->device_ap_sme || diff --git a/package/network/services/hostapd/patches/019-mesh-use-deterministic-channel-on-channel-switch.patch b/package/network/services/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch similarity index 97% rename from package/network/services/hostapd/patches/019-mesh-use-deterministic-channel-on-channel-switch.patch rename to package/network/services/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch index 8e38a8e53c..03a1e339a9 100644 --- a/package/network/services/hostapd/patches/019-mesh-use-deterministic-channel-on-channel-switch.patch +++ b/package/network/services/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch @@ -68,7 +68,7 @@ Signed-off-by: Markus Theil if (!chan) { --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -9473,6 +9473,10 @@ static int nl80211_switch_channel(void * +@@ -9872,6 +9872,10 @@ static int nl80211_switch_channel(void * if (ret) goto error; diff --git a/package/network/services/hostapd/patches/012-mesh-fix-channel-switch-error-during-CAC.patch b/package/network/services/hostapd/patches/012-mesh-fix-channel-switch-error-during-CAC.patch deleted file mode 100644 index f324d81ae3..0000000000 --- a/package/network/services/hostapd/patches/012-mesh-fix-channel-switch-error-during-CAC.patch +++ /dev/null @@ -1,66 +0,0 @@ -From ab6995f15aae17af93507dd2344615f91672a31a Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Tue, 30 Jun 2020 14:19:00 +0200 -Subject: [PATCH 12/19] mesh: fix channel switch error during CAC - -Mesh interface has used its channel parameters that configured -during its initialization even after channel switched due to -DFS radar detection during CAC which caused channel switch error. -This change fixes the error by updating its channel parameters -when channel's been changed from initial one. - -Signed-off-by: Peter Oh ---- - wpa_supplicant/mesh.c | 34 ++++++++++++++++++++++++++++++++++ - 1 file changed, 34 insertions(+) - ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -13,6 +13,7 @@ - #include "utils/uuid.h" - #include "common/ieee802_11_defs.h" - #include "common/wpa_ctrl.h" -+#include "common/hw_features_common.h" - #include "ap/sta_info.h" - #include "ap/hostapd.h" - #include "ap/ieee802_11.h" -@@ -206,6 +207,39 @@ static int wpas_mesh_complete(struct wpa - return -1; - } - -+ /* -+ * inspect if channel's been changed since initialized. -+ * i.e. DFS radar detection -+ */ -+ if (ifmsh->freq != params->freq.freq) { -+ wpa_s->assoc_freq = ifmsh->freq; -+ ssid->frequency = ifmsh->freq; -+ struct he_capabilities *he_capab = NULL; -+ -+ if (ifmsh->current_mode) -+ he_capab = &ifmsh->current_mode->he_capab[IEEE80211_MODE_MESH]; -+ -+ if (hostapd_set_freq_params(¶ms->freq, -+ ifmsh->conf->hw_mode, -+ ifmsh->freq, -+ ifmsh->conf->channel, -+ ifmsh->conf->enable_edmg, -+ ifmsh->conf->edmg_channel, -+ ifmsh->conf->ieee80211n, -+ ifmsh->conf->ieee80211ac, -+ ifmsh->conf->ieee80211ax, -+ ifmsh->conf->secondary_channel, -+ hostapd_get_oper_chwidth(ifmsh->conf), -+ hostapd_get_oper_centr_freq_seg0_idx(ifmsh->conf), -+ hostapd_get_oper_centr_freq_seg1_idx(ifmsh->conf), -+ ifmsh->conf->vht_capab, -+ he_capab)) { -+ wpa_printf(MSG_ERROR, "Error updating mesh frequency params."); -+ wpa_supplicant_mesh_deinit(wpa_s); -+ return -1; -+ } -+ } -+ - if (ifmsh->mconf->security != MESH_CONF_SEC_NONE && - wpas_mesh_init_rsn(wpa_s)) { - wpa_printf(MSG_ERROR, diff --git a/package/network/services/hostapd/patches/013-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch b/package/network/services/hostapd/patches/013-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch deleted file mode 100644 index fb4e68636e..0000000000 --- a/package/network/services/hostapd/patches/013-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch +++ /dev/null @@ -1,48 +0,0 @@ -From f1118eca5b1a63a4acb2a11ceea15dc4bc259c77 Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Tue, 30 Jun 2020 14:19:01 +0200 -Subject: [PATCH 13/19] mesh: inform kernel driver DFS handler in userspace - -NL80211_ATTR_HANDLE_DFS is required by kerenel space -to enable DFS channels that indicates DFS handler -resides in userspace. - -Signed-off-by: Peter Oh ---- - src/drivers/driver.h | 1 + - src/drivers/driver_nl80211.c | 3 +++ - wpa_supplicant/mesh.c | 1 + - 3 files changed, 5 insertions(+) - ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -1542,6 +1542,7 @@ struct wpa_driver_mesh_join_params { - #define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004 - #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008 - unsigned int flags; -+ u8 handle_dfs; - }; - - struct wpa_driver_set_key_params { ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -10070,6 +10070,9 @@ static int nl80211_join_mesh(struct i802 - - wpa_printf(MSG_DEBUG, " * flags=%08X", params->flags); - -+ if (params->handle_dfs) -+ if (nla_put_flag(msg, NL80211_ATTR_HANDLE_DFS)) -+ goto fail; - container = nla_nest_start(msg, NL80211_ATTR_MESH_SETUP); - if (!container) - goto fail; ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -355,6 +355,7 @@ static int wpa_supplicant_mesh_init(stru - conf->country[0] = wpa_s->conf->country[0]; - conf->country[1] = wpa_s->conf->country[1]; - conf->country[2] = ' '; -+ wpa_s->mesh_params->handle_dfs = 1; - } - - bss->iconf = conf; diff --git a/package/network/services/hostapd/patches/014-mesh-fixes-for-mesh-init-deinit.patch b/package/network/services/hostapd/patches/014-mesh-fixes-for-mesh-init-deinit.patch deleted file mode 100644 index fe12d401e4..0000000000 --- a/package/network/services/hostapd/patches/014-mesh-fixes-for-mesh-init-deinit.patch +++ /dev/null @@ -1,158 +0,0 @@ -From 30bdefd7559d57eae8c3c7e6f721ecf7be929bf2 Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 14:19:02 +0200 -Subject: [PATCH 14/19] mesh: fixes for mesh init/deinit - -Send mesh group started notification after join completion -callback is called. - -Implement outstanding TODO, to leave the mesh network on deinit. - -Signed-off-by: Markus Theil ---- - wpa_supplicant/mesh.c | 32 ++++++++++++++++++++------------ - wpa_supplicant/mesh.h | 6 ++++-- - wpa_supplicant/wpa_supplicant.c | 8 ++------ - 3 files changed, 26 insertions(+), 20 deletions(-) - ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -30,20 +30,20 @@ - - static void wpa_supplicant_mesh_deinit(struct wpa_supplicant *wpa_s) - { -- wpa_supplicant_mesh_iface_deinit(wpa_s, wpa_s->ifmsh); -+ wpa_supplicant_mesh_iface_deinit(wpa_s, wpa_s->ifmsh, true); - wpa_s->ifmsh = NULL; - wpa_s->current_ssid = NULL; - os_free(wpa_s->mesh_rsn); - wpa_s->mesh_rsn = NULL; - os_free(wpa_s->mesh_params); - wpa_s->mesh_params = NULL; -- /* TODO: leave mesh (stop beacon). This will happen on link down -- * anyway, so it's not urgent */ -+ wpa_supplicant_leave_mesh(wpa_s, false); - } - - - void wpa_supplicant_mesh_iface_deinit(struct wpa_supplicant *wpa_s, -- struct hostapd_iface *ifmsh) -+ struct hostapd_iface *ifmsh, -+ bool also_clear_hostapd) - { - if (!ifmsh) - return; -@@ -64,8 +64,10 @@ void wpa_supplicant_mesh_iface_deinit(st - } - - /* take care of shared data */ -- hostapd_interface_deinit(ifmsh); -- hostapd_interface_free(ifmsh); -+ if (also_clear_hostapd) { -+ hostapd_interface_deinit(ifmsh); -+ hostapd_interface_free(ifmsh); -+ } - } - - -@@ -244,8 +246,7 @@ static int wpas_mesh_complete(struct wpa - wpas_mesh_init_rsn(wpa_s)) { - wpa_printf(MSG_ERROR, - "mesh: RSN initialization failed - deinit mesh"); -- wpa_supplicant_mesh_deinit(wpa_s); -- wpa_drv_leave_mesh(wpa_s); -+ wpa_supplicant_mesh_iface_deinit(wpa_s, wpa_s->ifmsh, false); - return -1; - } - -@@ -270,9 +271,15 @@ static int wpas_mesh_complete(struct wpa - /* hostapd sets the interface down until we associate */ - wpa_drv_set_operstate(wpa_s, 1); - -- if (!ret) -+ if (!ret) { - wpa_supplicant_set_state(wpa_s, WPA_COMPLETED); - -+ wpa_msg(wpa_s, MSG_INFO, MESH_GROUP_STARTED "ssid=\"%s\" id=%d", -+ wpa_ssid_txt(ssid->ssid, ssid->ssid_len), -+ ssid->id); -+ wpas_notify_mesh_group_started(wpa_s, ssid); -+ } -+ - return ret; - } - -@@ -563,7 +570,7 @@ int wpa_supplicant_join_mesh(struct wpa_ - wpa_s->mesh_params = params; - if (wpa_supplicant_mesh_init(wpa_s, ssid, ¶ms->freq)) { - wpa_msg(wpa_s, MSG_ERROR, "Failed to init mesh"); -- wpa_drv_leave_mesh(wpa_s); -+ wpa_supplicant_leave_mesh(wpa_s, true); - ret = -1; - goto out; - } -@@ -573,14 +580,15 @@ out: - } - - --int wpa_supplicant_leave_mesh(struct wpa_supplicant *wpa_s) -+int wpa_supplicant_leave_mesh(struct wpa_supplicant *wpa_s, bool need_deinit) - { - int ret = 0; - - wpa_msg(wpa_s, MSG_INFO, "leaving mesh"); - - /* Need to send peering close messages first */ -- wpa_supplicant_mesh_deinit(wpa_s); -+ if (need_deinit) -+ wpa_supplicant_mesh_deinit(wpa_s); - - ret = wpa_drv_leave_mesh(wpa_s); - if (ret) ---- a/wpa_supplicant/mesh.h -+++ b/wpa_supplicant/mesh.h -@@ -11,9 +11,11 @@ - - int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s, - struct wpa_ssid *ssid); --int wpa_supplicant_leave_mesh(struct wpa_supplicant *wpa_s); -+int wpa_supplicant_leave_mesh(struct wpa_supplicant *wpa_s, -+ bool need_deinit); - void wpa_supplicant_mesh_iface_deinit(struct wpa_supplicant *wpa_s, -- struct hostapd_iface *ifmsh); -+ struct hostapd_iface *ifmsh, -+ bool also_clear_hostapd); - int wpas_mesh_scan_result_text(const u8 *ies, size_t ies_len, char *buf, - char *end); - int wpas_mesh_add_interface(struct wpa_supplicant *wpa_s, char *ifname, ---- a/wpa_supplicant/wpa_supplicant.c -+++ b/wpa_supplicant/wpa_supplicant.c -@@ -2225,10 +2225,6 @@ void wpa_supplicant_associate(struct wpa - return; - } - wpa_s->current_bss = bss; -- wpa_msg(wpa_s, MSG_INFO, MESH_GROUP_STARTED "ssid=\"%s\" id=%d", -- wpa_ssid_txt(ssid->ssid, ssid->ssid_len), -- ssid->id); -- wpas_notify_mesh_group_started(wpa_s, ssid); - #else /* CONFIG_MESH */ - wpa_msg(wpa_s, MSG_ERROR, - "mesh mode support not included in the build"); -@@ -3938,7 +3934,7 @@ void wpa_supplicant_deauthenticate(struc - wpa_s->ifname); - wpas_notify_mesh_group_removed(wpa_s, mconf->meshid, - mconf->meshid_len, reason_code); -- wpa_supplicant_leave_mesh(wpa_s); -+ wpa_supplicant_leave_mesh(wpa_s, true); - } - #endif /* CONFIG_MESH */ - -@@ -6551,7 +6547,7 @@ static void wpa_supplicant_deinit_iface( - - #ifdef CONFIG_MESH - if (wpa_s->ifmsh) { -- wpa_supplicant_mesh_iface_deinit(wpa_s, wpa_s->ifmsh); -+ wpa_supplicant_mesh_iface_deinit(wpa_s, wpa_s->ifmsh, true); - wpa_s->ifmsh = NULL; - } - #endif /* CONFIG_MESH */ diff --git a/package/network/services/hostapd/patches/015-mesh-fix-DFS-deinit-init.patch b/package/network/services/hostapd/patches/015-mesh-fix-DFS-deinit-init.patch deleted file mode 100644 index c540dd6786..0000000000 --- a/package/network/services/hostapd/patches/015-mesh-fix-DFS-deinit-init.patch +++ /dev/null @@ -1,262 +0,0 @@ -From d017f5d98a143c46c3c3fcb0e6507ca0b2bebdb0 Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 14:19:03 +0200 -Subject: [PATCH 15/19] mesh: fix DFS deinit/init - -The hostapd DFS code deinitializes and initializes the -AP interface, if a clean channel switch is not possible. -In this case the AP code paths would deinit the driver, for -example nl80211, without wpa_supplicant code paths getting -notice of this. - -Therefore add callbacks for wpa_supplicant mesh methods, -which are called on init/deinit of the AP bss. These -callbacks are then used to handle the reset in the mesh -code. - -Signed-off-by: Markus Theil ---- - src/ap/dfs.c | 2 +- - src/ap/hostapd.c | 17 ++++++-- - src/ap/hostapd.h | 6 +++ - wpa_supplicant/mesh.c | 90 +++++++++++++++++++++++++++++++++++++------ - 4 files changed, 100 insertions(+), 15 deletions(-) - ---- a/src/ap/dfs.c -+++ b/src/ap/dfs.c -@@ -1112,7 +1112,7 @@ static int hostapd_dfs_start_channel_swi - oper_centr_freq_seg0_idx, - oper_centr_freq_seg1_idx, - cmode->vht_capab, -- &cmode->he_capab[IEEE80211_MODE_AP]); -+ &cmode->he_capab[iface->conf->hw_mode]); - - if (err) { - wpa_printf(MSG_ERROR, "DFS failed to calculate CSA freq params"); ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -354,7 +354,7 @@ static int hostapd_broadcast_wep_set(str - #endif /* CONFIG_WEP */ - - --static void hostapd_free_hapd_data(struct hostapd_data *hapd) -+void hostapd_free_hapd_data(struct hostapd_data *hapd) - { - os_free(hapd->probereq_cb); - hapd->probereq_cb = NULL; -@@ -498,7 +498,7 @@ static void sta_track_deinit(struct host - } - - --static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface) -+void hostapd_cleanup_iface_partial(struct hostapd_iface *iface) - { - wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); - #ifdef NEED_AP_MLME -@@ -626,7 +626,7 @@ static int hostapd_flush_old_stations(st - } - - --static void hostapd_bss_deinit_no_free(struct hostapd_data *hapd) -+void hostapd_bss_deinit_no_free(struct hostapd_data *hapd) - { - hostapd_free_stas(hapd); - hostapd_flush_old_stations(hapd, WLAN_REASON_DEAUTH_LEAVING); -@@ -2690,6 +2690,13 @@ int hostapd_enable_iface(struct hostapd_ - { - size_t j; - -+ if (hapd_iface == NULL) -+ return -1; -+ -+ if (hapd_iface->enable_iface_cb != NULL) { -+ return hapd_iface->enable_iface_cb(hapd_iface); -+ } -+ - if (hapd_iface->bss[0]->drv_priv != NULL) { - wpa_printf(MSG_ERROR, "Interface %s already enabled", - hapd_iface->conf->bss[0]->iface); -@@ -2751,6 +2758,10 @@ int hostapd_disable_iface(struct hostapd - if (hapd_iface == NULL) - return -1; - -+ if (hapd_iface->disable_iface_cb != NULL) { -+ return hapd_iface->disable_iface_cb(hapd_iface); -+ } -+ - if (hapd_iface->bss[0]->drv_priv == NULL) { - wpa_printf(MSG_INFO, "Interface %s already disabled", - hapd_iface->conf->bss[0]->iface); ---- a/src/ap/hostapd.h -+++ b/src/ap/hostapd.h -@@ -589,6 +589,9 @@ struct hostapd_iface { - - /* Previous WMM element information */ - struct hostapd_wmm_ac_params prev_wmm[WMM_AC_NUM]; -+ -+ int (*enable_iface_cb)(struct hostapd_iface *iface); -+ int (*disable_iface_cb)(struct hostapd_iface *iface); - }; - - /* hostapd.c */ -@@ -617,6 +620,9 @@ void hostapd_interface_deinit_free(struc - int hostapd_enable_iface(struct hostapd_iface *hapd_iface); - int hostapd_reload_iface(struct hostapd_iface *hapd_iface); - int hostapd_disable_iface(struct hostapd_iface *hapd_iface); -+void hostapd_bss_deinit_no_free(struct hostapd_data *hapd); -+void hostapd_free_hapd_data(struct hostapd_data *hapd); -+void hostapd_cleanup_iface_partial(struct hostapd_iface *iface); - int hostapd_add_iface(struct hapd_interfaces *ifaces, char *buf); - int hostapd_remove_iface(struct hapd_interfaces *ifaces, char *buf); - void hostapd_channel_list_updated(struct hostapd_iface *iface, int initiator); ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -28,15 +28,20 @@ - #include "mesh.h" - - --static void wpa_supplicant_mesh_deinit(struct wpa_supplicant *wpa_s) -+static void wpa_supplicant_mesh_deinit(struct wpa_supplicant *wpa_s, bool also_clear_hostapd) - { -- wpa_supplicant_mesh_iface_deinit(wpa_s, wpa_s->ifmsh, true); -- wpa_s->ifmsh = NULL; -- wpa_s->current_ssid = NULL; -+ wpa_supplicant_mesh_iface_deinit(wpa_s, wpa_s->ifmsh, also_clear_hostapd); -+ -+ if (also_clear_hostapd) { -+ wpa_s->ifmsh = NULL; -+ wpa_s->current_ssid = NULL; -+ os_free(wpa_s->mesh_params); -+ wpa_s->mesh_params = NULL; -+ } -+ - os_free(wpa_s->mesh_rsn); - wpa_s->mesh_rsn = NULL; -- os_free(wpa_s->mesh_params); -- wpa_s->mesh_params = NULL; -+ - wpa_supplicant_leave_mesh(wpa_s, false); - } - -@@ -237,7 +242,7 @@ static int wpas_mesh_complete(struct wpa - ifmsh->conf->vht_capab, - he_capab)) { - wpa_printf(MSG_ERROR, "Error updating mesh frequency params."); -- wpa_supplicant_mesh_deinit(wpa_s); -+ wpa_supplicant_mesh_deinit(wpa_s, true); - return -1; - } - } -@@ -246,7 +251,7 @@ static int wpas_mesh_complete(struct wpa - wpas_mesh_init_rsn(wpa_s)) { - wpa_printf(MSG_ERROR, - "mesh: RSN initialization failed - deinit mesh"); -- wpa_supplicant_mesh_iface_deinit(wpa_s, wpa_s->ifmsh, false); -+ wpa_supplicant_mesh_deinit(wpa_s, false); - return -1; - } - -@@ -291,6 +296,67 @@ static void wpas_mesh_complete_cb(void * - } - - -+static int wpa_supplicant_mesh_enable_iface_cb(struct hostapd_iface *ifmsh) -+{ -+ struct wpa_supplicant *wpa_s = ifmsh->owner; -+ struct hostapd_data *bss; -+ -+ ifmsh->mconf = mesh_config_create(wpa_s, wpa_s->current_ssid); -+ -+ bss = ifmsh->bss[0]; -+ bss->msg_ctx = wpa_s; -+ os_memcpy(bss->own_addr, wpa_s->own_addr, ETH_ALEN); -+ bss->driver = wpa_s->driver; -+ bss->drv_priv = wpa_s->drv_priv; -+ bss->iface = ifmsh; -+ bss->mesh_sta_free_cb = mesh_mpm_free_sta; -+ bss->setup_complete_cb = wpas_mesh_complete_cb; -+ bss->setup_complete_cb_ctx = wpa_s; -+ -+ bss->conf->start_disabled = 1; -+ bss->conf->mesh = MESH_ENABLED; -+ bss->conf->ap_max_inactivity = wpa_s->conf->mesh_max_inactivity; -+ -+ if (wpa_drv_init_mesh(wpa_s)) { -+ wpa_msg(wpa_s, MSG_ERROR, "Failed to init mesh in driver"); -+ return -1; -+ } -+ -+ if (hostapd_setup_interface(ifmsh)) { -+ wpa_printf(MSG_ERROR, -+ "Failed to initialize hostapd interface for mesh"); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+ -+static int wpa_supplicant_mesh_disable_iface_cb(struct hostapd_iface *ifmsh) -+{ -+ struct wpa_supplicant *wpa_s = ifmsh->owner; -+ int j; -+ -+ wpa_supplicant_mesh_deinit(wpa_s, false); -+ -+#ifdef NEED_AP_MLME -+ for (j = 0; j < ifmsh->num_bss; j++) -+ hostapd_cleanup_cs_params(ifmsh->bss[j]); -+#endif /* NEED_AP_MLME */ -+ -+ /* same as hostapd_interface_deinit without deinitializing ctrl-iface */ -+ for (j = 0; j < ifmsh->num_bss; j++) { -+ struct hostapd_data *hapd = ifmsh->bss[j]; -+ hostapd_bss_deinit_no_free(hapd); -+ hostapd_free_hapd_data(hapd); -+ } -+ -+ hostapd_cleanup_iface_partial(ifmsh); -+ -+ return 0; -+} -+ -+ - static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, - struct wpa_ssid *ssid, - struct hostapd_freq_params *freq) -@@ -318,6 +384,8 @@ static int wpa_supplicant_mesh_init(stru - ifmsh->drv_flags = wpa_s->drv_flags; - ifmsh->drv_flags2 = wpa_s->drv_flags2; - ifmsh->num_bss = 1; -+ ifmsh->enable_iface_cb = wpa_supplicant_mesh_enable_iface_cb; -+ ifmsh->disable_iface_cb = wpa_supplicant_mesh_disable_iface_cb; - ifmsh->bss = os_calloc(wpa_s->ifmsh->num_bss, - sizeof(struct hostapd_data *)); - if (!ifmsh->bss) -@@ -451,7 +519,7 @@ static int wpa_supplicant_mesh_init(stru - - return 0; - out_free: -- wpa_supplicant_mesh_deinit(wpa_s); -+ wpa_supplicant_mesh_deinit(wpa_s, true); - return -ENOMEM; - } - -@@ -499,7 +567,7 @@ int wpa_supplicant_join_mesh(struct wpa_ - goto out; - } - -- wpa_supplicant_mesh_deinit(wpa_s); -+ wpa_supplicant_mesh_deinit(wpa_s, true); - - wpa_s->pairwise_cipher = WPA_CIPHER_NONE; - wpa_s->group_cipher = WPA_CIPHER_NONE; -@@ -588,7 +656,7 @@ int wpa_supplicant_leave_mesh(struct wpa - - /* Need to send peering close messages first */ - if (need_deinit) -- wpa_supplicant_mesh_deinit(wpa_s); -+ wpa_supplicant_mesh_deinit(wpa_s, true); - - ret = wpa_drv_leave_mesh(wpa_s); - if (ret) diff --git a/package/network/services/hostapd/patches/016-tests-DFS-test-for-wpa_supplicant-mesh.patch b/package/network/services/hostapd/patches/016-tests-DFS-test-for-wpa_supplicant-mesh.patch deleted file mode 100644 index b6a51b2f35..0000000000 --- a/package/network/services/hostapd/patches/016-tests-DFS-test-for-wpa_supplicant-mesh.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 6ee4e70d469b8ce05013ed524eea32ea303e6563 Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 14:19:04 +0200 -Subject: [PATCH 16/19] tests: DFS test for wpa_supplicant mesh - -Add a test with uses a DFS channel, waits for CAC -afterwards successfull mesh join and then triggers -a radar event and check if the mesh comes up again -on the same device. - -Signed-off-by: Markus Theil ---- - tests/hwsim/test_wpas_mesh.py | 56 +++++++++++++++++++++++++++++++++-- - 1 file changed, 54 insertions(+), 2 deletions(-) - ---- a/tests/hwsim/test_wpas_mesh.py -+++ b/tests/hwsim/test_wpas_mesh.py -@@ -80,8 +80,23 @@ def check_mesh_scan(dev, params, other_s - if '[MESH]' not in bss['flags']: - raise Exception("BSS output did not include MESH flag") - --def check_mesh_group_added(dev): -- ev = dev.wait_event(["MESH-GROUP-STARTED"]) -+def check_dfs_started(dev, timeout=10): -+ ev = dev.wait_event(["DFS-CAC-START"], timeout=timeout) -+ if ev is None: -+ raise Exception("Test exception: CAC did not start") -+ -+def check_dfs_finished(dev, timeout=70): -+ ev = dev.wait_event(["DFS-CAC-COMPLETED"], timeout=timeout) -+ if ev is None: -+ raise Exception("Test exception: CAC did not finish") -+ -+def check_mesh_radar_handling_finished(dev, timeout=75): -+ ev = dev.wait_event(["CTRL-EVENT-CHANNEL-SWITCH", "MESH-GROUP-STARTED"], timeout=timeout) -+ if ev is None: -+ raise Exception("Test exception: Couldn't join mesh") -+ -+def check_mesh_group_added(dev, timeout=10): -+ ev = dev.wait_event(["MESH-GROUP-STARTED"], timeout=timeout) - if ev is None: - raise Exception("Test exception: Couldn't join mesh") - -@@ -91,6 +106,10 @@ def check_mesh_group_removed(dev): - if ev is None: - raise Exception("Test exception: Couldn't leave mesh") - -+def check_regdom_change(dev, timeout=10): -+ ev = dev.wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=timeout) -+ if ev is None: -+ raise Exception("Test exception: No regdom change happened.") - - def check_mesh_peer_connected(dev, timeout=10): - ev = dev.wait_event(["MESH-PEER-CONNECTED"], timeout=timeout) -@@ -167,6 +186,39 @@ def test_wpas_mesh_group_remove(dev): - check_mesh_group_removed(dev[0]) - dev[0].mesh_group_remove() - -+def dfs_simulate_radar(dev): -+ logger.info("Trigger a simulated radar event") -+ phyname = dev.get_driver_status_field("phyname") -+ radar_file = '/sys/kernel/debug/ieee80211/' + phyname + '/hwsim/dfs_simulate_radar' -+ with open(radar_file, 'w') as f: -+ f.write('1') -+ -+@long_duration_test -+def test_wpas_mesh_peer_connected_dfs(dev): -+ """wpa_supplicant MESH peer connected""" -+ dev[0].set("country", "DE") -+ dev[1].set("country", "DE") -+ -+ check_regdom_change(dev[0]) -+ check_regdom_change(dev[1]) -+ -+ check_mesh_support(dev[0]) -+ add_open_mesh_network(dev[0], freq="5500", beacon_int=160) -+ add_open_mesh_network(dev[1], freq="5500", beacon_int=160) -+ check_dfs_started(dev[0]) -+ check_dfs_finished(dev[0]) -+ check_mesh_joined_connected(dev, timeout0=10) -+ -+ dfs_simulate_radar(dev[0]) -+ -+ check_mesh_radar_handling_finished(dev[0], timeout=75) -+ -+ dev[0].set("country", "00") -+ dev[1].set("country", "00") -+ -+ check_regdom_change(dev[0]) -+ check_regdom_change(dev[1]) -+ - def test_wpas_mesh_peer_connected(dev): - """wpa_supplicant MESH peer connected""" - check_mesh_support(dev[0]) diff --git a/package/network/services/hostapd/patches/017-mesh-fix-mesh_oom-test.patch b/package/network/services/hostapd/patches/017-mesh-fix-mesh_oom-test.patch deleted file mode 100644 index cc566c7de2..0000000000 --- a/package/network/services/hostapd/patches/017-mesh-fix-mesh_oom-test.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 928da9a270deaf4409aee4d87a33a6f61b56c136 Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 14:19:05 +0200 -Subject: [PATCH 17/19] mesh: fix mesh_oom test - -Only change freq params, if ifmsh->freq is set initially, which only -happens if hostapd_get_hw_features in setup_interface2 succeeds. - -Signed-off-by: Markus Theil ---- - wpa_supplicant/mesh.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -218,7 +218,7 @@ static int wpas_mesh_complete(struct wpa - * inspect if channel's been changed since initialized. - * i.e. DFS radar detection - */ -- if (ifmsh->freq != params->freq.freq) { -+ if (ifmsh->freq > 0 && ifmsh->freq != params->freq.freq) { - wpa_s->assoc_freq = ifmsh->freq; - ssid->frequency = ifmsh->freq; - struct he_capabilities *he_capab = NULL; diff --git a/package/network/services/hostapd/patches/018-mesh-move-mesh-freq-setting-to-own-function.patch b/package/network/services/hostapd/patches/018-mesh-move-mesh-freq-setting-to-own-function.patch deleted file mode 100644 index 1dd7d37411..0000000000 --- a/package/network/services/hostapd/patches/018-mesh-move-mesh-freq-setting-to-own-function.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 1eab0e62920f443f8814bad846f6439843223b69 Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 14:19:06 +0200 -Subject: [PATCH 18/19] mesh: move mesh freq setting to own function - -Signed-off-by: Markus Theil ---- - wpa_supplicant/mesh.c | 59 ++++++++++++++++++++++++++----------------- - 1 file changed, 36 insertions(+), 23 deletions(-) - ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -201,6 +201,40 @@ static int wpas_mesh_init_rsn(struct wpa - return !wpa_s->mesh_rsn ? -1 : 0; - } - -+ -+static int wpas_mesh_update_freq_params(struct wpa_supplicant *wpa_s) -+{ -+ struct wpa_driver_mesh_join_params *params = wpa_s->mesh_params; -+ struct hostapd_iface *ifmsh = wpa_s->ifmsh; -+ struct he_capabilities *he_capab = NULL; -+ -+ if (ifmsh->current_mode) -+ he_capab = &ifmsh->current_mode->he_capab[IEEE80211_MODE_MESH]; -+ -+ if (hostapd_set_freq_params(¶ms->freq, -+ ifmsh->conf->hw_mode, -+ ifmsh->freq, -+ ifmsh->conf->channel, -+ ifmsh->conf->enable_edmg, -+ ifmsh->conf->edmg_channel, -+ ifmsh->conf->ieee80211n, -+ ifmsh->conf->ieee80211ac, -+ ifmsh->conf->ieee80211ax, -+ ifmsh->conf->secondary_channel, -+ hostapd_get_oper_chwidth(ifmsh->conf), -+ hostapd_get_oper_centr_freq_seg0_idx(ifmsh->conf), -+ hostapd_get_oper_centr_freq_seg1_idx(ifmsh->conf), -+ ifmsh->conf->vht_capab, -+ he_capab)) { -+ wpa_printf(MSG_ERROR, "Error updating mesh frequency params."); -+ wpa_supplicant_mesh_deinit(wpa_s, true); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+ - static int wpas_mesh_complete(struct wpa_supplicant *wpa_s) - { - struct hostapd_iface *ifmsh = wpa_s->ifmsh; -@@ -221,30 +255,8 @@ static int wpas_mesh_complete(struct wpa - if (ifmsh->freq > 0 && ifmsh->freq != params->freq.freq) { - wpa_s->assoc_freq = ifmsh->freq; - ssid->frequency = ifmsh->freq; -- struct he_capabilities *he_capab = NULL; -- -- if (ifmsh->current_mode) -- he_capab = &ifmsh->current_mode->he_capab[IEEE80211_MODE_MESH]; -- -- if (hostapd_set_freq_params(¶ms->freq, -- ifmsh->conf->hw_mode, -- ifmsh->freq, -- ifmsh->conf->channel, -- ifmsh->conf->enable_edmg, -- ifmsh->conf->edmg_channel, -- ifmsh->conf->ieee80211n, -- ifmsh->conf->ieee80211ac, -- ifmsh->conf->ieee80211ax, -- ifmsh->conf->secondary_channel, -- hostapd_get_oper_chwidth(ifmsh->conf), -- hostapd_get_oper_centr_freq_seg0_idx(ifmsh->conf), -- hostapd_get_oper_centr_freq_seg1_idx(ifmsh->conf), -- ifmsh->conf->vht_capab, -- he_capab)) { -- wpa_printf(MSG_ERROR, "Error updating mesh frequency params."); -- wpa_supplicant_mesh_deinit(wpa_s, true); -+ if (wpas_mesh_update_freq_params(wpa_s) != 0) - return -1; -- } - } - - if (ifmsh->mconf->security != MESH_CONF_SEC_NONE && -@@ -518,6 +530,7 @@ static int wpa_supplicant_mesh_init(stru - } - - return 0; -+ - out_free: - wpa_supplicant_mesh_deinit(wpa_s, true); - return -ENOMEM; diff --git a/package/network/services/hostapd/patches/020-ignore-4addr-mode-enabling-error.patch b/package/network/services/hostapd/patches/020-ignore-4addr-mode-enabling-error.patch deleted file mode 100644 index 3431ac0949..0000000000 --- a/package/network/services/hostapd/patches/020-ignore-4addr-mode-enabling-error.patch +++ /dev/null @@ -1,78 +0,0 @@ -From c7cca9b08f3e1e49c4a4a59ec66c47d91448e6ae Mon Sep 17 00:00:00 2001 -From: Jouni Malinen -Date: Sat, 13 Feb 2021 23:59:28 +0200 -Subject: [PATCH] nl80211: Ignore 4addr mode enabling error if it was already - enabled - -nl80211_set_4addr_mode() could fail when trying to enable 4addr mode on -an interface that is in a bridge and has 4addr mode already enabled. -This operation would not have been necessary in the first place and this -failure results in disconnecting, e.g., when roaming from one backhaul -BSS to another BSS with Multi AP. - -Avoid this issue by ignoring the nl80211 command failure in the case -where 4addr mode is being enabled while it has already been enabled. - -Signed-off-by: Jouni Malinen ---- - src/drivers/driver_nl80211.c | 23 +++++++++++++++++++++++ - 1 file changed, 23 insertions(+) - -diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index 72189da24..011a15e68 100644 ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -617,6 +617,7 @@ struct wiphy_idx_data { - int wiphy_idx; - enum nl80211_iftype nlmode; - u8 *macaddr; -+ u8 use_4addr; - }; - - -@@ -639,6 +640,9 @@ static int netdev_info_handler(struct nl_msg *msg, void *arg) - os_memcpy(info->macaddr, nla_data(tb[NL80211_ATTR_MAC]), - ETH_ALEN); - -+ if (tb[NL80211_ATTR_4ADDR]) -+ info->use_4addr = nla_get_u8(tb[NL80211_ATTR_4ADDR]); -+ - return NL_SKIP; - } - -@@ -691,6 +695,20 @@ static int nl80211_get_macaddr(struct i802_bss *bss) - } - - -+static int nl80211_get_4addr(struct i802_bss *bss) -+{ -+ struct nl_msg *msg; -+ struct wiphy_idx_data data = { -+ .use_4addr = 0, -+ }; -+ -+ if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_GET_INTERFACE)) || -+ send_and_recv_msgs(bss->drv, msg, netdev_info_handler, &data)) -+ return -1; -+ return data.use_4addr; -+} -+ -+ - static int nl80211_register_beacons(struct wpa_driver_nl80211_data *drv, - struct nl80211_wiphy_data *w) - { -@@ -11482,6 +11500,11 @@ static int nl80211_set_4addr_mode(void *priv, const char *bridge_ifname, - - ret = send_and_recv_msgs(drv, msg, NULL, NULL); - msg = NULL; -+ if (ret && val && nl80211_get_4addr(bss) == 1) { -+ wpa_printf(MSG_DEBUG, -+ "nl80211: 4addr mode was already enabled"); -+ ret = 0; -+ } - if (!ret) { - if (bridge_ifname[0] && val && - i802_check_bridge(drv, bss, bridge_ifname, bss->ifname) < 0) --- -2.29.2 - diff --git a/package/network/services/hostapd/patches/050-mesh-make-forwarding-configurable.patch b/package/network/services/hostapd/patches/020-mesh-make-forwarding-configurable.patch similarity index 89% rename from package/network/services/hostapd/patches/050-mesh-make-forwarding-configurable.patch rename to package/network/services/hostapd/patches/020-mesh-make-forwarding-configurable.patch index 0ecb9ba078..75726a6750 100644 --- a/package/network/services/hostapd/patches/050-mesh-make-forwarding-configurable.patch +++ b/package/network/services/hostapd/patches/020-mesh-make-forwarding-configurable.patch @@ -31,7 +31,7 @@ Signed-off-by: Daniel Golle }; #define MAX_STA_COUNT 2007 -@@ -701,6 +702,7 @@ struct hostapd_bss_config { +@@ -696,6 +697,7 @@ struct hostapd_bss_config { #define MESH_ENABLED BIT(0) int mesh; @@ -41,7 +41,7 @@ Signed-off-by: Daniel Golle --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -1515,6 +1515,7 @@ struct wpa_driver_mesh_bss_params { +@@ -1584,6 +1584,7 @@ struct wpa_driver_mesh_bss_params { #define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004 #define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008 #define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010 @@ -49,7 +49,7 @@ Signed-off-by: Daniel Golle /* * TODO: Other mesh configuration parameters would go here. * See NL80211_MESHCONF_* for all the mesh config parameters. -@@ -1524,6 +1525,7 @@ struct wpa_driver_mesh_bss_params { +@@ -1593,6 +1594,7 @@ struct wpa_driver_mesh_bss_params { int peer_link_timeout; int max_peer_links; int rssi_threshold; @@ -59,7 +59,7 @@ Signed-off-by: Daniel Golle --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -10023,6 +10023,9 @@ static int nl80211_put_mesh_config(struc +@@ -10456,6 +10456,9 @@ static int nl80211_put_mesh_config(struc if (((params->flags & WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS) && nla_put_u8(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS, params->auto_plinks)) || @@ -71,7 +71,7 @@ Signed-off-by: Daniel Golle params->max_peer_links)) || --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -2473,6 +2473,7 @@ static const struct parse_data ssid_fiel +@@ -2527,6 +2527,7 @@ static const struct parse_data ssid_fiel #ifdef CONFIG_MESH { INT_RANGE(mode, 0, 5) }, { INT_RANGE(no_auto_peer, 0, 1) }, @@ -79,7 +79,7 @@ Signed-off-by: Daniel Golle { INT_RANGE(mesh_rssi_threshold, -255, 1) }, #else /* CONFIG_MESH */ { INT_RANGE(mode, 0, 4) }, -@@ -3049,6 +3050,7 @@ void wpa_config_set_network_defaults(str +@@ -3106,6 +3107,7 @@ void wpa_config_set_network_defaults(str ssid->dot11MeshRetryTimeout = DEFAULT_MESH_RETRY_TIMEOUT; ssid->dot11MeshConfirmTimeout = DEFAULT_MESH_CONFIRM_TIMEOUT; ssid->dot11MeshHoldingTimeout = DEFAULT_MESH_HOLDING_TIMEOUT; @@ -87,7 +87,7 @@ Signed-off-by: Daniel Golle ssid->mesh_rssi_threshold = DEFAULT_MESH_RSSI_THRESHOLD; #endif /* CONFIG_MESH */ #ifdef CONFIG_HT_OVERRIDES -@@ -4276,6 +4278,7 @@ struct wpa_config * wpa_config_alloc_emp +@@ -4347,6 +4349,7 @@ struct wpa_config * wpa_config_alloc_emp config->user_mpm = DEFAULT_USER_MPM; config->max_peer_links = DEFAULT_MAX_PEER_LINKS; config->mesh_max_inactivity = DEFAULT_MESH_MAX_INACTIVITY; @@ -95,7 +95,7 @@ Signed-off-by: Daniel Golle config->dot11RSNASAERetransPeriod = DEFAULT_DOT11_RSNA_SAE_RETRANS_PERIOD; config->fast_reauth = DEFAULT_FAST_REAUTH; -@@ -4914,6 +4917,7 @@ static const struct global_parse_data gl +@@ -5047,6 +5050,7 @@ static const struct global_parse_data gl { INT(user_mpm), 0 }, { INT_RANGE(max_peer_links, 0, 255), 0 }, { INT(mesh_max_inactivity), 0 }, @@ -113,7 +113,7 @@ Signed-off-by: Daniel Golle /* * The default dot11RSNASAERetransPeriod is defined as 40 ms in the standard, * but use 1000 ms in practice to avoid issues on low power CPUs. -@@ -1351,6 +1352,14 @@ struct wpa_config { +@@ -1378,6 +1379,14 @@ struct wpa_config { int mesh_max_inactivity; /** @@ -130,7 +130,7 @@ Signed-off-by: Daniel Golle * This timeout value is used in mesh STA to retransmit --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c -@@ -866,6 +866,7 @@ static void wpa_config_write_network(FIL +@@ -768,6 +768,7 @@ static void wpa_config_write_network(FIL #endif /* IEEE8021X_EAPOL */ INT(mode); INT(no_auto_peer); @@ -138,7 +138,7 @@ Signed-off-by: Daniel Golle INT(frequency); INT(enable_edmg); INT(edmg_channel); -@@ -1527,6 +1528,9 @@ static void wpa_config_write_global(FILE +@@ -1449,6 +1450,9 @@ static void wpa_config_write_global(FILE fprintf(f, "mesh_max_inactivity=%d\n", config->mesh_max_inactivity); @@ -164,7 +164,7 @@ Signed-off-by: Daniel Golle --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -137,6 +137,7 @@ static struct mesh_conf * mesh_config_cr +@@ -140,6 +140,7 @@ static struct mesh_conf * mesh_config_cr conf->mesh_cc_id = 0; conf->mesh_sp_id = MESH_SYNC_METHOD_NEIGHBOR_OFFSET; conf->mesh_auth_id = (conf->security & MESH_CONF_SEC_AUTH) ? 1 : 0; @@ -172,7 +172,7 @@ Signed-off-by: Daniel Golle conf->dot11MeshMaxRetries = ssid->dot11MeshMaxRetries; conf->dot11MeshRetryTimeout = ssid->dot11MeshRetryTimeout; conf->dot11MeshConfirmTimeout = ssid->dot11MeshConfirmTimeout; -@@ -434,6 +435,7 @@ static int wpa_supplicant_mesh_init(stru +@@ -441,6 +442,7 @@ static int wpa_supplicant_mesh_init(stru bss->conf->start_disabled = 1; bss->conf->mesh = MESH_ENABLED; bss->conf->ap_max_inactivity = wpa_s->conf->mesh_max_inactivity; @@ -180,7 +180,7 @@ Signed-off-by: Daniel Golle if (ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes, wpa_s->hw.num_modes) && wpa_s->conf->country[0]) { -@@ -647,6 +649,10 @@ int wpa_supplicant_join_mesh(struct wpa_ +@@ -655,6 +657,10 @@ int wpa_supplicant_join_mesh(struct wpa_ } params->conf.peer_link_timeout = wpa_s->conf->mesh_max_inactivity; diff --git a/package/network/services/hostapd/patches/060-P2P-Fix-a-corner-case-in-peer-addition-based-on-PD-R.patch b/package/network/services/hostapd/patches/060-P2P-Fix-a-corner-case-in-peer-addition-based-on-PD-R.patch deleted file mode 100644 index 1202ff3725..0000000000 --- a/package/network/services/hostapd/patches/060-P2P-Fix-a-corner-case-in-peer-addition-based-on-PD-R.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 8460e3230988ef2ec13ce6b69b687e941f6cdb32 Mon Sep 17 00:00:00 2001 -From: Jouni Malinen -Date: Tue, 8 Dec 2020 23:52:50 +0200 -Subject: [PATCH] P2P: Fix a corner case in peer addition based on PD Request - -p2p_add_device() may remove the oldest entry if there is no room in the -peer table for a new peer. This would result in any pointer to that -removed entry becoming stale. A corner case with an invalid PD Request -frame could result in such a case ending up using (read+write) freed -memory. This could only by triggered when the peer table has reached its -maximum size and the PD Request frame is received from the P2P Device -Address of the oldest remaining entry and the frame has incorrect P2P -Device Address in the payload. - -Fix this by fetching the dev pointer again after having called -p2p_add_device() so that the stale pointer cannot be used. - -Fixes: 17bef1e97a50 ("P2P: Add peer entry based on Provision Discovery Request") -Signed-off-by: Jouni Malinen ---- - src/p2p/p2p_pd.c | 12 +++++------- - 1 file changed, 5 insertions(+), 7 deletions(-) - ---- a/src/p2p/p2p_pd.c -+++ b/src/p2p/p2p_pd.c -@@ -595,14 +595,12 @@ void p2p_process_prov_disc_req(struct p2 - goto out; - } - -+ dev = p2p_get_device(p2p, sa); - if (!dev) { -- dev = p2p_get_device(p2p, sa); -- if (!dev) { -- p2p_dbg(p2p, -- "Provision Discovery device not found " -- MACSTR, MAC2STR(sa)); -- goto out; -- } -+ p2p_dbg(p2p, -+ "Provision Discovery device not found " -+ MACSTR, MAC2STR(sa)); -+ goto out; - } - } else if (msg.wfd_subelems) { - wpabuf_free(dev->info.wfd_subelems); diff --git a/package/network/services/hostapd/patches/110-notify-mgmt-frames.patch b/package/network/services/hostapd/patches/110-notify-mgmt-frames.patch deleted file mode 100644 index 9e187253d4..0000000000 --- a/package/network/services/hostapd/patches/110-notify-mgmt-frames.patch +++ /dev/null @@ -1,116 +0,0 @@ -From 53f8fdb534d5222a0e852e38afde3f49832ace06 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= -Date: Thu, 26 Nov 2020 09:27:40 +0100 -Subject: [PATCH] hostapd: Add an option to notify management frames on - ctrl_iface -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -In some contexts (e.g. Multi-AP) it can be useful to have access to -some of the management frames in upper layers (e.g. to be able to -process the content of association requests externally). - -Add 'notify_mgmt_frames'. When enabled, it will notify the ctrl_iface -when a management frame arrives using 'AP_MGMT_FRAME_RECEIVED'. - -Note that to avoid completely flooding the ctrl_iface, not all -management frames are included (e.g. beacons are excluded). - -Signed-off-by: Raphaël Mélotte ---- - hostapd/config_file.c | 2 ++ - hostapd/hostapd.conf | 4 ++++ - src/ap/ap_config.h | 2 ++ - src/ap/ieee802_11.c | 25 +++++++++++++++++++++++++ - src/common/wpa_ctrl.h | 3 +++ - 5 files changed, 36 insertions(+) - ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -4456,6 +4456,8 @@ static int hostapd_config_fill(struct ho - bss->multicast_to_unicast = atoi(pos); - } else if (os_strcmp(buf, "broadcast_deauth") == 0) { - bss->broadcast_deauth = atoi(pos); -+ } else if (os_strcmp(buf, "notify_mgmt_frames") == 0) { -+ conf->notify_mgmt_frames = atoi(pos); - #ifdef CONFIG_DPP - } else if (os_strcmp(buf, "dpp_name") == 0) { - os_free(bss->dpp_name); ---- a/hostapd/hostapd.conf -+++ b/hostapd/hostapd.conf -@@ -571,6 +571,10 @@ wmm_ac_vo_acm=0 - # Default: 1 (enabled) - #broadcast_deauth=1 - -+# Get notifications for management frames: -+# Default: 0 (disabled) -+#notify_mgmt_frames=0 -+ - ##### IEEE 802.11n related configuration ###################################### - - # ieee80211n: Whether IEEE 802.11n (HT) is enabled ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -1060,6 +1060,8 @@ struct hostapd_config { - unsigned int airtime_update_interval; - #define AIRTIME_MODE_MAX (__AIRTIME_MODE_MAX - 1) - #endif /* CONFIG_AIRTIME_POLICY */ -+ -+ u8 notify_mgmt_frames; - }; - - ---- a/src/ap/ieee802_11.c -+++ b/src/ap/ieee802_11.c -@@ -4878,6 +4878,28 @@ static int handle_action(struct hostapd_ - return 1; - } - -+/** -+ * notify_mgmt_frame - notify of management frames on the control interface. -+ * @hapd: hostapd BSS data structure (the BSS to which the management frame was -+ * sent to) -+ * @buf: management frame data (starting from IEEE 802.11 header) -+ * @len: length of frame data in octets -+ * -+ * Notify the control interface of any management frame. -+ */ -+static void notify_mgmt_frame(struct hostapd_data *hapd, const u8 *buf, -+ size_t len) -+{ -+ -+ int hex_len = len * 2 + 1; -+ char *hex = os_malloc(hex_len); -+ -+ if (hex) { -+ wpa_snprintf_hex(hex, hex_len, buf, len); -+ wpa_msg_ctrl(hapd->msg_ctx, MSG_INFO, AP_MGMT_FRAME_RECEIVED "buf=%s", hex); -+ os_free(hex); -+ } -+} - - /** - * ieee802_11_mgmt - process incoming IEEE 802.11 management frames -@@ -4969,6 +4991,9 @@ int ieee802_11_mgmt(struct hostapd_data - if (hapd->iconf->track_sta_max_num) - sta_track_add(hapd->iface, mgmt->sa, ssi_signal); - -+ if (hapd->iconf->notify_mgmt_frames) -+ notify_mgmt_frame(hapd, buf, len); -+ - switch (stype) { - case WLAN_FC_STYPE_AUTH: - wpa_printf(MSG_DEBUG, "mgmt::auth"); ---- a/src/common/wpa_ctrl.h -+++ b/src/common/wpa_ctrl.h -@@ -396,6 +396,9 @@ extern "C" { - #define BIT(x) (1U << (x)) - #endif - -+/* Event triggered for received management frame */ -+#define AP_MGMT_FRAME_RECEIVED "AP-MGMT-FRAME-RECEIVED " -+ - /* BSS command information masks */ - - #define WPA_BSS_MASK_ALL 0xFFFDFFFF diff --git a/package/network/services/hostapd/patches/110-wolfssl-compile-fix.patch b/package/network/services/hostapd/patches/110-wolfssl-compile-fix.patch deleted file mode 100644 index a7b5409602..0000000000 --- a/package/network/services/hostapd/patches/110-wolfssl-compile-fix.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/src/crypto/tls_wolfssl.c -+++ b/src/crypto/tls_wolfssl.c -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - - #if defined(EAP_FAST) || defined(EAP_FAST_DYNAMIC) || defined(EAP_SERVER_FAST) - #define HAVE_AESGCM diff --git a/package/network/services/hostapd/patches/120-reconfigure-wps-credentials.patch b/package/network/services/hostapd/patches/120-reconfigure-wps-credentials.patch deleted file mode 100644 index 1826b6685b..0000000000 --- a/package/network/services/hostapd/patches/120-reconfigure-wps-credentials.patch +++ /dev/null @@ -1,178 +0,0 @@ -From b389a77a0f6dccf495dbce5be9476000f6ec06a2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= -Date: Wed, 9 Dec 2020 19:55:53 +0100 -Subject: [PATCH] wps: reconfigure credentials on reload -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When new credentials are configured and hostapd is reconfigured using -SIGHUP (or reload on the ctrl_iface), also update the wps credentials. - -Before these changes, when WPS is triggered the registar always serves -the credentials that were configured when hostapd started. - -Signed-off-by: Raphaël Mélotte ---- - src/ap/wps_hostapd.c | 86 +++++++++++++++++++++++++++++++++++++++-- - src/wps/wps.h | 6 +++ - src/wps/wps_registrar.c | 29 ++++++++++++++ - 3 files changed, 118 insertions(+), 3 deletions(-) - ---- a/src/ap/wps_hostapd.c -+++ b/src/ap/wps_hostapd.c -@@ -1375,6 +1375,43 @@ static void hostapd_wps_nfc_clear(struct - #endif /* CONFIG_WPS_NFC */ - } - -+int hostapd_wps_update_multi_ap(struct hostapd_data *hapd, -+ struct wps_registrar *reg) { -+ struct hostapd_bss_config *conf = hapd->conf; -+ u8 *multi_ap_backhaul_network_key = NULL; -+ size_t multi_ap_backhaul_network_key_len = 0; -+ int ret = -1; -+ -+ if ((conf->multi_ap & FRONTHAUL_BSS) && -+ conf->multi_ap_backhaul_ssid.ssid_len) { -+ if (conf->multi_ap_backhaul_ssid.wpa_passphrase) { -+ multi_ap_backhaul_network_key = -+ (u8 *) os_strdup(conf->multi_ap_backhaul_ssid.wpa_passphrase); -+ if (multi_ap_backhaul_network_key == NULL) -+ return -1; -+ multi_ap_backhaul_network_key_len = -+ os_strlen(conf->multi_ap_backhaul_ssid.wpa_passphrase); -+ } else if (conf->multi_ap_backhaul_ssid.wpa_psk) { -+ multi_ap_backhaul_network_key = os_malloc(2 * PMK_LEN + 1); -+ if (multi_ap_backhaul_network_key == NULL) -+ return -1; -+ wpa_snprintf_hex((char *) multi_ap_backhaul_network_key, -+ 2 * PMK_LEN + 1, -+ conf->multi_ap_backhaul_ssid.wpa_psk->psk, -+ PMK_LEN); -+ multi_ap_backhaul_network_key_len = 2 * PMK_LEN; -+ } -+ ret = wps_registrar_update_multi_ap(reg, -+ conf->multi_ap_backhaul_ssid.ssid, -+ conf->multi_ap_backhaul_ssid.ssid_len, -+ multi_ap_backhaul_network_key, -+ multi_ap_backhaul_network_key_len); -+ os_free(multi_ap_backhaul_network_key); -+ } -+ return ret; -+} -+ -+ - - void hostapd_deinit_wps(struct hostapd_data *hapd) - { -@@ -1409,11 +1446,54 @@ void hostapd_update_wps(struct hostapd_d - hapd->wps->upc = hapd->conf->upc; - #endif /* CONFIG_WPS_UPNP */ - -- hostapd_wps_set_vendor_ext(hapd, hapd->wps); -- hostapd_wps_set_application_ext(hapd, hapd->wps); -+ struct wps_context *wps = hapd->wps; -+ struct hostapd_bss_config *conf = hapd->conf; -+ -+ os_memcpy(wps->ssid, conf->ssid.ssid, conf->ssid.ssid_len); -+ wps->ssid_len = conf->ssid.ssid_len; -+ -+ /* Clear wps settings, then fill them again */ -+ os_free(wps->network_key); -+ wps->network_key = NULL; -+ wps->network_key_len = 0; -+ wps->psk_set = 0; -+ if (conf->ssid.wpa_psk_file) { -+ /* Use per-device PSKs */ -+ } else if (conf->ssid.wpa_passphrase) { -+ wps->network_key = (u8 *) os_strdup(conf->ssid.wpa_passphrase); -+ if (wps->network_key == NULL) -+ return; -+ wps->network_key_len = os_strlen(conf->ssid.wpa_passphrase); -+ } else if (conf->ssid.wpa_psk) { -+ wps->network_key = os_malloc(2 * PMK_LEN + 1); -+ if (wps->network_key == NULL) -+ return; -+ wpa_snprintf_hex((char *) wps->network_key, 2 * PMK_LEN + 1, -+ conf->ssid.wpa_psk->psk, PMK_LEN); -+ wps->network_key_len = 2 * PMK_LEN; -+#ifdef CONFIG_WEP -+ } else if (conf->ssid.wep.keys_set && conf->ssid.wep.key[0]) { -+ wps->network_key = os_malloc(conf->ssid.wep.len[0]); -+ if (wps->network_key == NULL) -+ return; -+ os_memcpy(wps->network_key, conf->ssid.wep.key[0], -+ conf->ssid.wep.len[0]); -+ wps->network_key_len = conf->ssid.wep.len[0]; -+#endif /* CONFIG_WEP */ -+ } -+ -+ if (conf->ssid.wpa_psk) { -+ os_memcpy(wps->psk, conf->ssid.wpa_psk->psk, PMK_LEN); -+ wps->psk_set = 1; -+ } -+ -+ hostapd_wps_update_multi_ap(hapd, wps->registrar); -+ -+ hostapd_wps_set_vendor_ext(hapd, wps); -+ hostapd_wps_set_application_ext(hapd, wps); - - if (hapd->conf->wps_state) -- wps_registrar_update_ie(hapd->wps->registrar); -+ wps_registrar_update_ie(wps->registrar); - else - hostapd_deinit_wps(hapd); - } ---- a/src/wps/wps.h -+++ b/src/wps/wps.h -@@ -938,6 +938,12 @@ struct wpabuf * wps_build_nfc_handover_s - struct wpabuf *nfc_dh_pubkey, - struct wpabuf *nfc_dev_pw); - -+int wps_registrar_update_multi_ap(struct wps_registrar *reg, -+ const u8 *multi_ap_backhaul_ssid, -+ size_t multi_ap_backhaul_ssid_len, -+ const u8 *multi_ap_backhaul_network_key, -+ size_t multi_ap_backhaul_network_key_len); -+ - /* ndef.c */ - struct wpabuf * ndef_parse_wifi(const struct wpabuf *buf); - struct wpabuf * ndef_build_wifi(const struct wpabuf *buf); ---- a/src/wps/wps_registrar.c -+++ b/src/wps/wps_registrar.c -@@ -3669,6 +3669,35 @@ int wps_registrar_config_ap(struct wps_r - } - - -+int wps_registrar_update_multi_ap(struct wps_registrar *reg, -+ const u8 *multi_ap_backhaul_ssid, -+ size_t multi_ap_backhaul_ssid_len, -+ const u8 *multi_ap_backhaul_network_key, -+ size_t multi_ap_backhaul_network_key_len) -+{ -+ if (multi_ap_backhaul_ssid != NULL) { -+ os_memcpy(reg->multi_ap_backhaul_ssid, -+ multi_ap_backhaul_ssid, -+ multi_ap_backhaul_ssid_len); -+ reg->multi_ap_backhaul_ssid_len = -+ multi_ap_backhaul_ssid_len; -+ } -+ os_free(reg->multi_ap_backhaul_network_key); -+ reg->multi_ap_backhaul_network_key = NULL; -+ reg->multi_ap_backhaul_network_key_len = 0; -+ -+ if (multi_ap_backhaul_network_key != NULL) { -+ reg->multi_ap_backhaul_network_key = -+ os_memdup(multi_ap_backhaul_network_key, -+ multi_ap_backhaul_network_key_len); -+ if (reg->multi_ap_backhaul_network_key == NULL) -+ return -1; -+ reg->multi_ap_backhaul_network_key_len = -+ multi_ap_backhaul_network_key_len; -+ } -+ return 0; -+} -+ - #ifdef CONFIG_WPS_NFC - - int wps_registrar_add_nfc_pw_token(struct wps_registrar *reg, diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch index 4f3e3decfe..8dce260871 100644 --- a/package/network/services/hostapd/patches/200-multicall.patch +++ b/package/network/services/hostapd/patches/200-multicall.patch @@ -1,14 +1,14 @@ --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -31,6 +31,7 @@ CFLAGS += -I$(abspath ../src/utils) - export BINDIR ?= /usr/local/bin/ +@@ -1,6 +1,7 @@ + ALL=hostapd hostapd_cli + CONFIG_FILE = .config - -include .config +-include $(if $(MULTICALL), ../wpa_supplicant/.config) + include ../src/build.rules - ifndef CONFIG_NO_GITVER - # Add VERSION_STR postfix for builds from a git repository -@@ -204,7 +205,8 @@ endif + ifdef LIBS +@@ -199,7 +200,8 @@ endif ifdef CONFIG_NO_VLAN CFLAGS += -DCONFIG_NO_VLAN @@ -18,7 +18,7 @@ OBJS += ../src/ap/vlan_init.o OBJS += ../src/ap/vlan_ifconfig.o OBJS += ../src/ap/vlan.o -@@ -354,10 +356,14 @@ CFLAGS += -DCONFIG_MBO +@@ -349,10 +351,14 @@ CFLAGS += -DCONFIG_MBO OBJS += ../src/ap/mbo_ap.o endif @@ -36,9 +36,9 @@ LIBS += $(DRV_AP_LIBS) ifdef CONFIG_L2_PACKET -@@ -1311,6 +1317,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) - - BCHECK=../src/drivers/build.hostapd +@@ -1277,6 +1283,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) + _OBJS_VAR := OBJS + include ../src/objs.mk +hostapd_multi.a: $(BCHECK) $(OBJS) + $(Q)$(CC) -c -o hostapd_multi.o -Dmain=hostapd_main $(CFLAGS) main.c @@ -46,12 +46,12 @@ + @rm -f $@ + @$(AR) cr $@ hostapd_multi.o $(OBJS) + - hostapd: $(BCHECK) $(OBJS) + hostapd: $(OBJS) $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) @$(E) " LD " $@ -@@ -1374,6 +1386,12 @@ SOBJS += ../src/crypto/sha256-kdf.o - SOBJS += ../src/crypto/sha384-kdf.o - SOBJS += ../src/crypto/sha512-kdf.o +@@ -1351,6 +1363,12 @@ include ../src/objs.mk + _OBJS_VAR := SOBJS + include ../src/objs.mk +dump_cflags: + @printf "%s " "$(CFLAGS)" @@ -64,15 +64,15 @@ @$(E) " LD " $@ --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -27,6 +27,7 @@ CFLAGS += -I$(abspath ../src) - CFLAGS += -I$(abspath ../src/utils) +@@ -17,6 +17,7 @@ endif + EXTRA_TARGETS=dynamic_eap_methods - -include .config + CONFIG_FILE=.config +-include $(if $(MULTICALL),../hostapd/.config) + include ../src/build.rules - ifndef CONFIG_NO_GITVER - # Add VERSION_STR postfix for builds from a git repository -@@ -369,7 +370,9 @@ endif + ifdef LIBS +@@ -359,7 +360,9 @@ endif ifdef CONFIG_IBSS_RSN NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_IBSS_RSN @@ -82,7 +82,7 @@ OBJS += ibss_rsn.o endif -@@ -890,6 +893,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS +@@ -897,6 +900,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS LIBS += -ldl -rdynamic endif @@ -93,7 +93,7 @@ endif ifdef CONFIG_AP -@@ -897,9 +904,11 @@ NEED_EAP_COMMON=y +@@ -904,9 +911,11 @@ NEED_EAP_COMMON=y NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_AP OBJS += ap.o @@ -105,7 +105,7 @@ OBJS += ../src/ap/hostapd.o OBJS += ../src/ap/wpa_auth_glue.o OBJS += ../src/ap/utils.o -@@ -979,6 +988,12 @@ endif +@@ -986,6 +995,12 @@ endif ifdef CONFIG_HS20 OBJS += ../src/ap/hs20.o endif @@ -118,7 +118,7 @@ endif ifdef CONFIG_MBO -@@ -987,7 +1002,9 @@ CFLAGS += -DCONFIG_MBO +@@ -994,7 +1009,9 @@ CFLAGS += -DCONFIG_MBO endif ifdef NEED_RSN_AUTHENTICATOR @@ -128,10 +128,10 @@ NEED_AES_WRAP=y OBJS += ../src/ap/wpa_auth.o OBJS += ../src/ap/wpa_auth_ie.o -@@ -1897,6 +1914,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) - - $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config +@@ -1889,6 +1906,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) + _OBJS_VAR := OBJS + include ../src/objs.mk +wpa_supplicant_multi.a: .config $(BCHECK) $(OBJS) $(EXTRA_progs) + $(Q)$(CC) -c -o wpa_supplicant_multi.o -Dmain=wpa_supplicant_main $(CFLAGS) main.c + @$(E) " CC " $< @@ -141,7 +141,7 @@ wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) @$(E) " LD " $@ -@@ -1997,6 +2020,12 @@ endif +@@ -2021,6 +2044,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK) $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ @$(E) " sed" $< @@ -156,7 +156,7 @@ wpa_cli.exe: wpa_cli --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -5886,8 +5886,8 @@ union wpa_event_data { +@@ -6025,8 +6025,8 @@ union wpa_event_data { * Driver wrapper code should call this function whenever an event is received * from the driver. */ @@ -167,7 +167,7 @@ /** * wpa_supplicant_event_global - Report a driver event for wpa_supplicant -@@ -5899,7 +5899,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -6038,7 +6038,7 @@ void wpa_supplicant_event(void *ctx, enu * Same as wpa_supplicant_event(), but we search for the interface in * wpa_global. */ @@ -178,7 +178,7 @@ /* --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -1789,8 +1789,8 @@ err: +@@ -1836,8 +1836,8 @@ err: #endif /* CONFIG_OWE */ @@ -189,7 +189,7 @@ { struct hostapd_data *hapd = ctx; #ifndef CONFIG_NO_STDOUT_DEBUG -@@ -2035,7 +2035,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -2082,7 +2082,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -231,7 +231,7 @@ os_memset(&global, 0, sizeof(global)); --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -4581,8 +4581,8 @@ static void wpas_event_unprot_beacon(str +@@ -4665,8 +4665,8 @@ static void wpas_event_unprot_beacon(str } @@ -242,7 +242,7 @@ { struct wpa_supplicant *wpa_s = ctx; int resched; -@@ -5400,7 +5400,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -5511,7 +5511,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -253,7 +253,7 @@ struct wpa_supplicant *wpa_s; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -6594,7 +6594,6 @@ struct wpa_interface * wpa_supplicant_ma +@@ -6819,7 +6819,6 @@ struct wpa_interface * wpa_supplicant_ma return NULL; } @@ -261,7 +261,7 @@ /** * wpa_supplicant_match_existing - Match existing interfaces * @global: Pointer to global data from wpa_supplicant_init() -@@ -6631,6 +6630,11 @@ static int wpa_supplicant_match_existing +@@ -6854,6 +6853,11 @@ static int wpa_supplicant_match_existing #endif /* CONFIG_MATCH_IFACE */ @@ -273,7 +273,7 @@ /** * wpa_supplicant_add_iface - Add a new network interface -@@ -6887,6 +6891,8 @@ struct wpa_global * wpa_supplicant_init( +@@ -7110,6 +7114,8 @@ struct wpa_global * wpa_supplicant_init( #ifndef CONFIG_NO_WPA_MSG wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); #endif /* CONFIG_NO_WPA_MSG */ @@ -296,7 +296,7 @@ #ifdef CONFIG_WPS static int gen_uuid(const char *txt_addr) -@@ -684,6 +689,8 @@ int main(int argc, char *argv[]) +@@ -683,6 +688,8 @@ int main(int argc, char *argv[]) return -1; #endif /* CONFIG_DPP */ @@ -333,7 +333,7 @@ const struct wpa_driver_ops *const wpa_drivers[] = { NULL }; -@@ -1292,6 +1297,10 @@ static void usage(void) +@@ -1291,6 +1296,10 @@ static void usage(void) "option several times.\n"); } @@ -344,7 +344,7 @@ int main(int argc, char *argv[]) { -@@ -1312,6 +1321,8 @@ int main(int argc, char *argv[]) +@@ -1311,6 +1320,8 @@ int main(int argc, char *argv[]) if (os_program_init()) return -1; diff --git a/package/network/services/hostapd/patches/300-noscan.patch b/package/network/services/hostapd/patches/300-noscan.patch index 638b76f84e..93b0934283 100644 --- a/package/network/services/hostapd/patches/300-noscan.patch +++ b/package/network/services/hostapd/patches/300-noscan.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3493,6 +3493,10 @@ static int hostapd_config_fill(struct ho +@@ -3459,6 +3459,10 @@ static int hostapd_config_fill(struct ho if (bss->ocv && !bss->ieee80211w) bss->ieee80211w = 1; #endif /* CONFIG_OCV */ @@ -13,7 +13,7 @@ } else if (os_strcmp(buf, "ht_capab") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -984,6 +984,8 @@ struct hostapd_config { +@@ -1009,6 +1009,8 @@ struct hostapd_config { int ht_op_mode_fixed; u16 ht_capab; @@ -24,7 +24,7 @@ int no_pri_sec_switch; --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c -@@ -500,7 +500,8 @@ static int ieee80211n_check_40mhz(struct +@@ -517,7 +517,8 @@ static int ieee80211n_check_40mhz(struct int ret; /* Check that HT40 is used and PRI / SEC switch is allowed */ diff --git a/package/network/services/hostapd/patches/301-mesh-noscan.patch b/package/network/services/hostapd/patches/301-mesh-noscan.patch index f85b72453e..0d78329441 100644 --- a/package/network/services/hostapd/patches/301-mesh-noscan.patch +++ b/package/network/services/hostapd/patches/301-mesh-noscan.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -2478,6 +2478,7 @@ static const struct parse_data ssid_fiel +@@ -2532,6 +2532,7 @@ static const struct parse_data ssid_fiel #else /* CONFIG_MESH */ { INT_RANGE(mode, 0, 4) }, #endif /* CONFIG_MESH */ @@ -10,7 +10,7 @@ { STR(id_str) }, --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c -@@ -866,6 +866,7 @@ static void wpa_config_write_network(FIL +@@ -768,6 +768,7 @@ static void wpa_config_write_network(FIL #endif /* IEEE8021X_EAPOL */ INT(mode); INT(no_auto_peer); @@ -20,7 +20,7 @@ INT(enable_edmg); --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -467,6 +467,8 @@ static int wpa_supplicant_mesh_init(stru +@@ -474,6 +474,8 @@ static int wpa_supplicant_mesh_init(stru frequency); goto out_free; } @@ -31,7 +31,7 @@ /* --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2334,12 +2334,12 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2384,12 +2384,12 @@ void ibss_mesh_setup_freq(struct wpa_sup int ieee80211_mode = wpas_mode_to_ieee80211_mode(ssid->mode); enum hostapd_hw_mode hw_mode; struct hostapd_hw_modes *mode = NULL; @@ -46,7 +46,7 @@ unsigned int j, k; struct hostapd_freq_params vht_freq; int chwidth, seg0, seg1; -@@ -2421,7 +2421,7 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2473,7 +2473,7 @@ void ibss_mesh_setup_freq(struct wpa_sup #endif /* CONFIG_HE_OVERRIDES */ /* Setup higher BW only for 5 GHz */ diff --git a/package/network/services/hostapd/patches/310-rescan_immediately.patch b/package/network/services/hostapd/patches/310-rescan_immediately.patch index 0040b61c6b..7f5e207069 100644 --- a/package/network/services/hostapd/patches/310-rescan_immediately.patch +++ b/package/network/services/hostapd/patches/310-rescan_immediately.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -4949,7 +4949,7 @@ wpa_supplicant_alloc(struct wpa_supplica +@@ -5154,7 +5154,7 @@ wpa_supplicant_alloc(struct wpa_supplica if (wpa_s == NULL) return NULL; wpa_s->scan_req = INITIAL_SCAN_REQ; diff --git a/package/network/services/hostapd/patches/320-optional_rfkill.patch b/package/network/services/hostapd/patches/320-optional_rfkill.patch index a703c7e132..01537790e0 100644 --- a/package/network/services/hostapd/patches/320-optional_rfkill.patch +++ b/package/network/services/hostapd/patches/320-optional_rfkill.patch @@ -1,6 +1,6 @@ --- a/src/drivers/drivers.mak +++ b/src/drivers/drivers.mak -@@ -50,7 +50,6 @@ NEED_SME=y +@@ -54,7 +54,6 @@ NEED_SME=y NEED_AP_MLME=y NEED_NETLINK=y NEED_LINUX_IOCTL=y @@ -8,7 +8,7 @@ NEED_RADIOTAP=y NEED_LIBNL=y endif -@@ -107,7 +106,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT +@@ -111,7 +110,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT CONFIG_WIRELESS_EXTENSION=y NEED_NETLINK=y NEED_LINUX_IOCTL=y @@ -16,7 +16,7 @@ endif ifdef CONFIG_DRIVER_NDIS -@@ -133,7 +131,6 @@ endif +@@ -137,7 +135,6 @@ endif ifdef CONFIG_WIRELESS_EXTENSION DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION DRV_WPA_OBJS += ../src/drivers/driver_wext.o @@ -24,7 +24,7 @@ endif ifdef NEED_NETLINK -@@ -142,6 +139,7 @@ endif +@@ -146,6 +143,7 @@ endif ifdef NEED_RFKILL DRV_OBJS += ../src/drivers/rfkill.o diff --git a/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch b/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch index 9e2551ce60..9ced08801e 100644 --- a/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch +++ b/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4646,7 +4646,7 @@ static int nl80211_set_channel(struct i8 +@@ -4973,7 +4973,7 @@ static int nl80211_set_channel(struct i8 freq->freq, freq->ht_enabled, freq->vht_enabled, freq->he_enabled, freq->bandwidth, freq->center_freq1, freq->center_freq2); diff --git a/package/network/services/hostapd/patches/340-reload_freq_change.patch b/package/network/services/hostapd/patches/340-reload_freq_change.patch index e0e62c2a11..3d51a47a1e 100644 --- a/package/network/services/hostapd/patches/340-reload_freq_change.patch +++ b/package/network/services/hostapd/patches/340-reload_freq_change.patch @@ -1,6 +1,6 @@ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -114,6 +114,28 @@ static void hostapd_reload_bss(struct ho +@@ -115,6 +115,28 @@ static void hostapd_reload_bss(struct ho #endif /* CONFIG_NO_RADIUS */ ssid = &hapd->conf->ssid; @@ -29,7 +29,7 @@ if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next && ssid->wpa_passphrase_set && ssid->wpa_passphrase) { /* -@@ -215,6 +237,7 @@ int hostapd_reload_config(struct hostapd +@@ -216,6 +238,7 @@ int hostapd_reload_config(struct hostapd struct hostapd_data *hapd = iface->bss[0]; struct hostapd_config *newconf, *oldconf; size_t j; @@ -37,7 +37,7 @@ if (iface->config_fname == NULL) { /* Only in-memory config in use - assume it has been updated */ -@@ -265,24 +288,20 @@ int hostapd_reload_config(struct hostapd +@@ -266,24 +289,20 @@ int hostapd_reload_config(struct hostapd } iface->conf = newconf; diff --git a/package/network/services/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch b/package/network/services/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch index 90fa5eff5d..73f81f65e6 100644 --- a/package/network/services/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch +++ b/package/network/services/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c -@@ -1466,15 +1466,35 @@ int ap_switch_channel(struct wpa_supplic +@@ -1513,15 +1513,35 @@ int ap_switch_channel(struct wpa_supplic #ifdef CONFIG_CTRL_IFACE diff --git a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch index a2a03c04f7..1f9b74e97e 100644 --- a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch +++ b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -2788,10 +2788,15 @@ static int wpa_driver_nl80211_del_beacon +@@ -2918,10 +2918,15 @@ static int wpa_driver_nl80211_del_beacon struct nl_msg *msg; struct wpa_driver_nl80211_data *drv = bss->drv; @@ -15,10 +15,10 @@ nl80211_put_wiphy_data_ap(bss); - msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON); + msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_BEACON); - return send_and_recv_msgs(drv, msg, NULL, NULL); + return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL); } -@@ -5261,7 +5266,7 @@ static void nl80211_teardown_ap(struct i +@@ -5602,7 +5607,7 @@ static void nl80211_teardown_ap(struct i nl80211_mgmt_unsubscribe(bss, "AP teardown"); nl80211_put_wiphy_data_ap(bss); @@ -27,7 +27,7 @@ } -@@ -7679,8 +7684,6 @@ static int wpa_driver_nl80211_if_remove( +@@ -8051,8 +8056,6 @@ static int wpa_driver_nl80211_if_remove( } else { wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context"); nl80211_teardown_ap(bss); @@ -36,7 +36,7 @@ nl80211_destroy_bss(bss); if (!bss->added_if) i802_set_iface_flags(bss, 0); -@@ -8074,7 +8077,6 @@ static int wpa_driver_nl80211_deinit_ap( +@@ -8449,7 +8452,6 @@ static int wpa_driver_nl80211_deinit_ap( if (!is_ap_interface(drv->nlmode)) return -1; wpa_driver_nl80211_del_beacon(bss); @@ -44,7 +44,7 @@ /* * If the P2P GO interface was dynamically added, then it is -@@ -8094,7 +8096,6 @@ static int wpa_driver_nl80211_stop_ap(vo +@@ -8469,7 +8471,6 @@ static int wpa_driver_nl80211_stop_ap(vo if (!is_ap_interface(drv->nlmode)) return -1; wpa_driver_nl80211_del_beacon(bss); diff --git a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch index 31c5102cb1..349522e06a 100644 --- a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch +++ b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch @@ -1,6 +1,6 @@ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -65,6 +65,7 @@ +@@ -67,6 +67,7 @@ #include "fst/fst_ctrl_iface.h" #include "config_file.h" #include "ctrl_iface.h" @@ -8,7 +8,7 @@ #define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256 -@@ -80,6 +81,7 @@ static void hostapd_ctrl_iface_send(stru +@@ -82,6 +83,7 @@ static void hostapd_ctrl_iface_send(stru enum wpa_msg_type type, const char *buf, size_t len); @@ -16,7 +16,7 @@ static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd, struct sockaddr_storage *from, -@@ -131,6 +133,61 @@ static int hostapd_ctrl_iface_new_sta(st +@@ -133,6 +135,61 @@ static int hostapd_ctrl_iface_new_sta(st return 0; } @@ -78,7 +78,7 @@ #ifdef NEED_AP_MLME static int hostapd_ctrl_iface_sa_query(struct hostapd_data *hapd, -@@ -3546,6 +3603,8 @@ static int hostapd_ctrl_iface_receive_pr +@@ -3754,6 +3811,8 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "VENDOR ", 7) == 0) { reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply, reply_size); @@ -89,7 +89,7 @@ #ifdef RADIUS_SERVER --- a/src/ap/ctrl_iface_ap.c +++ b/src/ap/ctrl_iface_ap.c -@@ -917,7 +917,13 @@ int hostapd_parse_csa_settings(const cha +@@ -919,7 +919,13 @@ int hostapd_parse_csa_settings(const cha int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd) { diff --git a/package/network/services/hostapd/patches/370-ap_sta_support.patch b/package/network/services/hostapd/patches/370-ap_sta_support.patch index a7a646d2d1..c5cad3bb8d 100644 --- a/package/network/services/hostapd/patches/370-ap_sta_support.patch +++ b/package/network/services/hostapd/patches/370-ap_sta_support.patch @@ -1,17 +1,6 @@ --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -26,6 +26,10 @@ CFLAGS += $(EXTRA_CFLAGS) - CFLAGS += -I$(abspath ../src) - CFLAGS += -I$(abspath ../src/utils) - -+ifdef MULTICALL -+CFLAGS += -DMULTICALL -+endif -+ - -include .config - -include $(if $(MULTICALL),../hostapd/.config) - -@@ -118,6 +122,8 @@ OBJS_c += ../src/utils/common.o +@@ -108,6 +108,8 @@ OBJS_c += ../src/utils/common.o OBJS_c += ../src/common/cli.o OBJS += wmm_ac.o @@ -30,7 +19,7 @@ #include "drivers/driver.h" #include "eap_peer/eap.h" #include "wpa_supplicant_i.h" -@@ -294,6 +295,10 @@ void calculate_update_time(const struct +@@ -282,6 +283,10 @@ void calculate_update_time(const struct static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src, struct os_reltime *fetch_time) { @@ -41,7 +30,7 @@ dst->flags = src->flags; os_memcpy(dst->bssid, src->bssid, ETH_ALEN); dst->freq = src->freq; -@@ -306,6 +311,15 @@ static void wpa_bss_copy_res(struct wpa_ +@@ -294,6 +299,15 @@ static void wpa_bss_copy_res(struct wpa_ dst->est_throughput = src->est_throughput; dst->snr = src->snr; @@ -59,7 +48,7 @@ --- a/wpa_supplicant/bss.h +++ b/wpa_supplicant/bss.h -@@ -83,6 +83,10 @@ struct wpa_bss { +@@ -94,6 +94,10 @@ struct wpa_bss { u8 ssid[SSID_MAX_LEN]; /** Length of SSID */ size_t ssid_len; @@ -110,7 +99,7 @@ break; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -129,6 +129,54 @@ static void wpas_update_fils_connect_par +@@ -130,6 +130,54 @@ static void wpas_update_fils_connect_par static void wpas_update_owe_connect_params(struct wpa_supplicant *wpa_s); #endif /* CONFIG_OWE */ @@ -165,7 +154,7 @@ #ifdef CONFIG_WEP /* Configure default/group WEP keys for static WEP */ -@@ -991,6 +1039,8 @@ void wpa_supplicant_set_state(struct wpa +@@ -1007,6 +1055,8 @@ void wpa_supplicant_set_state(struct wpa sme_sched_obss_scan(wpa_s, 1); @@ -174,7 +163,7 @@ #if defined(CONFIG_FILS) && defined(IEEE8021X_EAPOL) if (!fils_hlp_sent && ssid && ssid->eap.erp) update_fils_connect_params = true; -@@ -1001,6 +1051,8 @@ void wpa_supplicant_set_state(struct wpa +@@ -1017,6 +1067,8 @@ void wpa_supplicant_set_state(struct wpa #endif /* CONFIG_OWE */ } else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING || state == WPA_ASSOCIATED) { @@ -183,7 +172,7 @@ wpa_s->new_connection = 1; wpa_drv_set_operstate(wpa_s, 0); #ifndef IEEE8021X_EAPOL -@@ -2225,6 +2277,8 @@ void wpa_supplicant_associate(struct wpa +@@ -2276,6 +2328,8 @@ void wpa_supplicant_associate(struct wpa return; } wpa_s->current_bss = bss; @@ -192,7 +181,7 @@ #else /* CONFIG_MESH */ wpa_msg(wpa_s, MSG_ERROR, "mesh mode support not included in the build"); -@@ -6207,6 +6261,16 @@ static int wpa_supplicant_init_iface(str +@@ -6426,6 +6480,16 @@ static int wpa_supplicant_init_iface(str sizeof(wpa_s->bridge_ifname)); } @@ -209,7 +198,7 @@ /* RSNA Supplicant Key Management - INITIALIZE */ eapol_sm_notify_portEnabled(wpa_s->eapol, false); eapol_sm_notify_portValid(wpa_s->eapol, false); -@@ -6540,6 +6604,11 @@ static void wpa_supplicant_deinit_iface( +@@ -6763,6 +6827,11 @@ static void wpa_supplicant_deinit_iface( if (terminate) wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); @@ -218,12 +207,12 @@ + wpa_s->hostapd = NULL; + } + - if (wpa_s->ctrl_iface) { - wpa_supplicant_ctrl_iface_deinit(wpa_s->ctrl_iface); - wpa_s->ctrl_iface = NULL; + wpa_supplicant_ctrl_iface_deinit(wpa_s, wpa_s->ctrl_iface); + wpa_s->ctrl_iface = NULL; + --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h -@@ -104,6 +104,11 @@ struct wpa_interface { +@@ -103,6 +103,11 @@ struct wpa_interface { const char *ifname; /** @@ -235,7 +224,7 @@ * bridge_ifname - Optional bridge interface name * * If the driver interface (ifname) is included in a Linux bridge -@@ -530,6 +535,8 @@ struct wpa_supplicant { +@@ -615,6 +620,8 @@ struct wpa_supplicant { #endif /* CONFIG_CTRL_IFACE_BINDER */ char bridge_ifname[16]; @@ -246,7 +235,7 @@ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -2712,6 +2712,11 @@ static int hostapd_ctrl_iface_chan_switc +@@ -2883,6 +2883,11 @@ static int hostapd_ctrl_iface_chan_switc return 0; } @@ -257,12 +246,12 @@ + for (i = 0; i < iface->num_bss; i++) { - /* Save CHAN_SWITCH VHT config */ + /* Save CHAN_SWITCH VHT and HE config */ --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -1468,11 +1468,6 @@ int ieee802_11_set_beacon(struct hostapd - struct wpabuf *beacon, *proberesp, *assocresp; - int res, ret = -1; +@@ -1758,11 +1758,6 @@ int ieee802_11_set_beacon(struct hostapd + return -1; + } - if (hapd->csa_in_progress) { - wpa_printf(MSG_ERROR, "Cannot set beacons during CSA period"); @@ -274,7 +263,7 @@ if (ieee802_11_build_ap_params(hapd, ¶ms) < 0) --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -4581,6 +4581,60 @@ static void wpas_event_unprot_beacon(str +@@ -4665,6 +4665,60 @@ static void wpas_event_unprot_beacon(str } @@ -335,7 +324,7 @@ void supplicant_event(void *ctx, enum wpa_event_type event, union wpa_event_data *data) { -@@ -4883,8 +4937,10 @@ void supplicant_event(void *ctx, enum wp +@@ -4980,8 +5034,10 @@ void supplicant_event(void *ctx, enum wp channel_width_to_string(data->ch_switch.ch_width), data->ch_switch.cf1, data->ch_switch.cf2); @@ -349,7 +338,7 @@ wpa_s->current_ssid->frequency = data->ch_switch.freq; --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -5690,6 +5690,7 @@ union wpa_event_data { +@@ -5829,6 +5829,7 @@ union wpa_event_data { /** * struct ch_switch @@ -357,7 +346,7 @@ * @freq: Frequency of new channel in MHz * @ht_enabled: Whether this is an HT channel * @ch_offset: Secondary channel offset -@@ -5698,6 +5699,7 @@ union wpa_event_data { +@@ -5837,6 +5838,7 @@ union wpa_event_data { * @cf2: Center frequency 2 */ struct ch_switch { @@ -367,7 +356,7 @@ int ch_offset; --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c -@@ -541,7 +541,7 @@ static void mlme_event_ch_switch(struct +@@ -684,7 +684,7 @@ static void mlme_event_ch_switch(struct struct nlattr *ifindex, struct nlattr *freq, struct nlattr *type, struct nlattr *bw, struct nlattr *cf1, struct nlattr *cf2, @@ -376,7 +365,7 @@ { struct i802_bss *bss; union wpa_event_data data; -@@ -600,6 +600,8 @@ static void mlme_event_ch_switch(struct +@@ -745,6 +745,8 @@ static void mlme_event_ch_switch(struct data.ch_switch.cf1 = nla_get_u32(cf1); if (cf2) data.ch_switch.cf2 = nla_get_u32(cf2); @@ -385,7 +374,7 @@ if (finished) bss->freq = data.ch_switch.freq; -@@ -2686,6 +2688,7 @@ static void do_process_drv_event(struct +@@ -3003,6 +3005,7 @@ static void do_process_drv_event(struct tb[NL80211_ATTR_CHANNEL_WIDTH], tb[NL80211_ATTR_CENTER_FREQ1], tb[NL80211_ATTR_CENTER_FREQ2], @@ -393,7 +382,7 @@ 0); break; case NL80211_CMD_CH_SWITCH_NOTIFY: -@@ -2696,6 +2699,7 @@ static void do_process_drv_event(struct +@@ -3013,6 +3016,7 @@ static void do_process_drv_event(struct tb[NL80211_ATTR_CHANNEL_WIDTH], tb[NL80211_ATTR_CENTER_FREQ1], tb[NL80211_ATTR_CENTER_FREQ2], diff --git a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch index b98b2d0cba..ca634077b7 100644 --- a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch +++ b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch @@ -1,6 +1,6 @@ --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -226,6 +226,9 @@ endif +@@ -221,6 +221,9 @@ endif ifdef CONFIG_NO_CTRL_IFACE CFLAGS += -DCONFIG_NO_CTRL_IFACE else @@ -12,7 +12,7 @@ else --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -3370,6 +3370,7 @@ static int hostapd_ctrl_iface_receive_pr +@@ -3569,6 +3569,7 @@ static int hostapd_ctrl_iface_receive_pr reply_size); } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { reply_len = hostapd_drv_status(hapd, reply, reply_size); @@ -20,7 +20,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = ieee802_11_get_mib(hapd, reply, reply_size); if (reply_len >= 0) { -@@ -3411,6 +3412,7 @@ static int hostapd_ctrl_iface_receive_pr +@@ -3610,6 +3611,7 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, reply_size); @@ -30,7 +30,7 @@ reply_len = -1; --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -952,6 +952,9 @@ ifdef CONFIG_FILS +@@ -955,6 +955,9 @@ ifdef CONFIG_FILS OBJS += ../src/ap/fils_hlp.o endif ifdef CONFIG_CTRL_IFACE @@ -42,7 +42,7 @@ --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c -@@ -2267,7 +2267,7 @@ static int wpa_supplicant_ctrl_iface_sta +@@ -2308,7 +2308,7 @@ static int wpa_supplicant_ctrl_iface_sta pos += ret; } @@ -51,7 +51,7 @@ if (wpa_s->ap_iface) { pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, end - pos, -@@ -10366,6 +10366,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -10919,6 +10919,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = -1; } else if (os_strncmp(buf, "NOTE ", 5) == 0) { wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); @@ -59,7 +59,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); if (reply_len >= 0) { -@@ -10378,6 +10379,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -10931,6 +10932,7 @@ char * wpa_supplicant_ctrl_iface_process reply_size - reply_len); #endif /* CONFIG_MACSEC */ } @@ -67,7 +67,7 @@ } else if (os_strncmp(buf, "STATUS", 6) == 0) { reply_len = wpa_supplicant_ctrl_iface_status( wpa_s, buf + 6, reply, reply_size); -@@ -10862,6 +10864,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -11419,6 +11421,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = wpa_supplicant_ctrl_iface_bss( wpa_s, buf + 4, reply, reply_size); #ifdef CONFIG_AP @@ -75,7 +75,7 @@ } else if (os_strcmp(buf, "STA-FIRST") == 0) { reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size); } else if (os_strncmp(buf, "STA ", 4) == 0) { -@@ -10870,12 +10873,15 @@ char * wpa_supplicant_ctrl_iface_process +@@ -11427,12 +11430,15 @@ char * wpa_supplicant_ctrl_iface_process } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, reply_size); @@ -109,7 +109,7 @@ #ifdef CONFIG_P2P_MANAGER static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, -@@ -806,12 +808,12 @@ int hostapd_ctrl_iface_status(struct hos +@@ -807,12 +809,12 @@ int hostapd_ctrl_iface_status(struct hos return len; len += ret; } @@ -126,7 +126,7 @@ if (os_snprintf_error(buflen - len, ret)) --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c -@@ -2711,6 +2711,7 @@ static const char * bool_txt(bool val) +@@ -2712,6 +2712,7 @@ static const char * bool_txt(bool val) return val ? "TRUE" : "FALSE"; } @@ -134,7 +134,7 @@ int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) { -@@ -2897,6 +2898,7 @@ int ieee802_1x_get_mib_sta(struct hostap +@@ -2898,6 +2899,7 @@ int ieee802_1x_get_mib_sta(struct hostap return len; } @@ -144,7 +144,7 @@ static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx) --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -4451,6 +4451,7 @@ static const char * wpa_bool_txt(int val +@@ -4519,6 +4519,7 @@ static const char * wpa_bool_txt(int val return val ? "TRUE" : "FALSE"; } @@ -152,7 +152,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ -@@ -4601,7 +4602,7 @@ int wpa_get_mib_sta(struct wpa_state_mac +@@ -4669,7 +4670,7 @@ int wpa_get_mib_sta(struct wpa_state_mac return len; } @@ -163,7 +163,7 @@ { --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -2728,6 +2728,8 @@ static u32 wpa_key_mgmt_suite(struct wpa +@@ -2767,6 +2767,8 @@ static u32 wpa_key_mgmt_suite(struct wpa } @@ -172,7 +172,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff -@@ -2809,6 +2811,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch +@@ -2848,6 +2850,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch return (int) len; } @@ -182,7 +182,7 @@ --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c -@@ -1324,7 +1324,7 @@ int wpas_ap_wps_nfc_report_handover(stru +@@ -1364,7 +1364,7 @@ int wpas_ap_wps_nfc_report_handover(stru #endif /* CONFIG_WPS */ diff --git a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch index 9dee2d738e..65a8b07e65 100644 --- a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch +++ b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch @@ -1,6 +1,6 @@ --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c -@@ -2121,6 +2121,31 @@ u32 wpa_akm_to_suite(int akm) +@@ -2444,6 +2444,31 @@ u32 wpa_akm_to_suite(int akm) } @@ -32,7 +32,7 @@ int wpa_compare_rsn_ie(int ft_initial_assoc, const u8 *ie1, size_t ie1len, const u8 *ie2, size_t ie2len) -@@ -2128,8 +2153,19 @@ int wpa_compare_rsn_ie(int ft_initial_as +@@ -2451,8 +2476,19 @@ int wpa_compare_rsn_ie(int ft_initial_as if (ie1 == NULL || ie2 == NULL) return -1; diff --git a/package/network/services/hostapd/patches/420-indicate-features.patch b/package/network/services/hostapd/patches/420-indicate-features.patch index 9f216347f4..f9dff66073 100644 --- a/package/network/services/hostapd/patches/420-indicate-features.patch +++ b/package/network/services/hostapd/patches/420-indicate-features.patch @@ -8,7 +8,7 @@ #include "crypto/random.h" #include "crypto/tls.h" #include "common/version.h" -@@ -692,7 +693,7 @@ int main(int argc, char *argv[]) +@@ -691,7 +692,7 @@ int main(int argc, char *argv[]) wpa_supplicant_event = hostapd_wpa_event; wpa_supplicant_event_global = hostapd_wpa_event_global; for (;;) { @@ -17,7 +17,7 @@ if (c < 0) break; switch (c) { -@@ -729,6 +730,8 @@ int main(int argc, char *argv[]) +@@ -728,6 +729,8 @@ int main(int argc, char *argv[]) break; #endif /* CONFIG_DEBUG_LINUX_TRACING */ case 'v': diff --git a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch index 3744464c89..dc1fa3d29d 100644 --- a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch +++ b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch @@ -32,7 +32,7 @@ static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc, -@@ -1532,13 +1528,10 @@ static const struct hostapd_cli_cmd host +@@ -1579,13 +1575,10 @@ static const struct hostapd_cli_cmd host { "disassociate", hostapd_cli_cmd_disassociate, hostapd_complete_stations, " = disassociate a station" }, @@ -46,7 +46,7 @@ { "wps_pin", hostapd_cli_cmd_wps_pin, NULL, " [timeout] [addr] = add WPS Enrollee PIN" }, { "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL, -@@ -1563,7 +1556,6 @@ static const struct hostapd_cli_cmd host +@@ -1610,7 +1603,6 @@ static const struct hostapd_cli_cmd host " = configure AP" }, { "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL, "= show current WPS status" }, diff --git a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch index 99c552821b..e0e687e161 100644 --- a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -22,7 +22,7 @@ Signed-hostap: Antonio Quartulli #include "common/defs.h" #include "common/ieee802_11_defs.h" #include "common/wpa_common.h" -@@ -850,6 +851,9 @@ struct wpa_driver_associate_params { +@@ -851,6 +852,9 @@ struct wpa_driver_associate_params { * responsible for selecting with which BSS to associate. */ const u8 *bssid; @@ -42,7 +42,7 @@ Signed-hostap: Antonio Quartulli #include "config.h" -@@ -2269,6 +2270,97 @@ static char * wpa_config_write_peerkey(c +@@ -2321,6 +2322,97 @@ static char * wpa_config_write_peerkey(c #endif /* NO_CONFIG_WRITE */ @@ -140,7 +140,7 @@ Signed-hostap: Antonio Quartulli /* Helper macros for network block parser */ #ifdef OFFSET -@@ -2552,6 +2644,8 @@ static const struct parse_data ssid_fiel +@@ -2606,6 +2698,8 @@ static const struct parse_data ssid_fiel { INT(ap_max_inactivity) }, { INT(dtim_period) }, { INT(beacon_int) }, @@ -174,7 +174,7 @@ Signed-hostap: Antonio Quartulli * macsec_policy - Determines the policy for MACsec secure session --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -3638,6 +3638,12 @@ static void wpas_start_assoc_cb(struct w +@@ -3726,6 +3726,12 @@ static void wpas_start_assoc_cb(struct w params.beacon_int = ssid->beacon_int; else params.beacon_int = wpa_s->conf->beacon_int; diff --git a/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch b/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch index 61d2089bc8..1d2a053faa 100644 --- a/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch +++ b/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch @@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -5584,7 +5584,7 @@ static int wpa_driver_nl80211_ibss(struc +@@ -5951,7 +5951,7 @@ static int wpa_driver_nl80211_ibss(struc struct wpa_driver_associate_params *params) { struct nl_msg *msg; @@ -19,7 +19,7 @@ Signed-hostap: Antonio Quartulli int count = 0; wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex); -@@ -5611,6 +5611,37 @@ retry: +@@ -5978,6 +5978,37 @@ retry: nl80211_put_beacon_int(msg, params->beacon_int)) goto fail; diff --git a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch index 33ef097e75..1794befe95 100644 --- a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch +++ b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch @@ -19,17 +19,17 @@ Tested-by: Simon Wunderlich --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -1549,6 +1549,7 @@ struct wpa_driver_mesh_join_params { +@@ -1618,6 +1618,7 @@ struct wpa_driver_mesh_join_params { #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008 unsigned int flags; - u8 handle_dfs; + bool handle_dfs; + int mcast_rate; }; struct wpa_driver_set_key_params { --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -10043,6 +10043,18 @@ static int nl80211_put_mesh_id(struct nl +@@ -10476,6 +10476,18 @@ static int nl80211_put_mesh_id(struct nl } @@ -48,7 +48,7 @@ Tested-by: Simon Wunderlich static int nl80211_put_mesh_config(struct nl_msg *msg, struct wpa_driver_mesh_bss_params *params) { -@@ -10104,6 +10116,7 @@ static int nl80211_join_mesh(struct i802 +@@ -10537,6 +10549,7 @@ static int nl80211_join_mesh(struct i802 nl80211_put_basic_rates(msg, params->basic_rates) || nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) || nl80211_put_beacon_int(msg, params->beacon_int) || @@ -58,7 +58,7 @@ Tested-by: Simon Wunderlich --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -592,6 +592,7 @@ int wpa_supplicant_join_mesh(struct wpa_ +@@ -600,6 +600,7 @@ int wpa_supplicant_join_mesh(struct wpa_ params->meshid = ssid->ssid; params->meshid_len = ssid->ssid_len; diff --git a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch index 6d48175163..4c7cb9ea36 100644 --- a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch +++ b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2407,11 +2407,13 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2457,11 +2457,13 @@ void ibss_mesh_setup_freq(struct wpa_sup for (j = 0; j < wpa_s->last_scan_res_used; j++) { struct wpa_bss *bss = wpa_s->last_scan_res[j]; diff --git a/package/network/services/hostapd/patches/470-survey_data_fallback.patch b/package/network/services/hostapd/patches/470-survey_data_fallback.patch index 57a78ee865..efd82599d3 100644 --- a/package/network/services/hostapd/patches/470-survey_data_fallback.patch +++ b/package/network/services/hostapd/patches/470-survey_data_fallback.patch @@ -20,7 +20,7 @@ total = survey->channel_time; -@@ -415,20 +409,19 @@ static int acs_usable_vht160_chan(const +@@ -422,20 +416,19 @@ static int acs_usable_bw160_chan(const s static int acs_survey_is_sufficient(struct freq_survey *survey) { if (!(survey->filled & SURVEY_HAS_NF)) { diff --git a/package/network/services/hostapd/patches/500-lto-jobserver-support.patch b/package/network/services/hostapd/patches/500-lto-jobserver-support.patch index 46030859de..1475590d06 100644 --- a/package/network/services/hostapd/patches/500-lto-jobserver-support.patch +++ b/package/network/services/hostapd/patches/500-lto-jobserver-support.patch @@ -1,16 +1,17 @@ --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -1327,14 +1327,14 @@ hostapd_multi.a: $(BCHECK) $(OBJS) +@@ -1293,7 +1293,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS) @$(AR) cr $@ hostapd_multi.o $(OBJS) - hostapd: $(BCHECK) $(OBJS) + hostapd: $(OBJS) - $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) + +$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) @$(E) " LD " $@ ifdef CONFIG_WPA_TRACE - OBJS_c += ../src/utils/trace.o - endif +@@ -1304,7 +1304,7 @@ _OBJS_VAR := OBJS_c + include ../src/objs.mk + hostapd_cli: $(OBJS_c) - $(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c) + +$(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c) @@ -19,7 +20,7 @@ NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -1930,23 +1930,23 @@ wpa_supplicant_multi.a: .config $(BCHECK +@@ -1918,31 +1918,31 @@ wpa_supplicant_multi.a: .config $(BCHECK @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS) wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) @@ -27,21 +28,29 @@ + +$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) @$(E) " LD " $@ + _OBJS_VAR := OBJS_t + include ../src/objs.mk eapol_test: $(OBJS_t) - $(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS) + +$(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS) @$(E) " LD " $@ + _OBJS_VAR := OBJS_t2 + include ../src/objs.mk preauth_test: $(OBJS_t2) - $(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS) + +$(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS) @$(E) " LD " $@ + _OBJS_VAR := OBJS_p + include ../src/objs.mk wpa_passphrase: $(OBJS_p) - $(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS) + +$(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS) @$(E) " LD " $@ + _OBJS_VAR := OBJS_c + include ../src/objs.mk wpa_cli: $(OBJS_c) - $(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c) + +$(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c) diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index 8d9d3eb7c1..013b81d25b 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -1,6 +1,6 @@ --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -171,6 +171,11 @@ OBJS += ../src/common/hw_features_common +@@ -166,6 +166,11 @@ OBJS += ../src/common/hw_features_common OBJS += ../src/eapol_auth/eapol_auth_sm.o @@ -39,7 +39,7 @@ int interface_added; /* virtual interface added for this BSS */ unsigned int started:1; unsigned int disabled:1; -@@ -606,6 +608,7 @@ hostapd_alloc_bss_data(struct hostapd_if +@@ -610,6 +612,7 @@ hostapd_alloc_bss_data(struct hostapd_if struct hostapd_bss_config *bss); int hostapd_setup_interface(struct hostapd_iface *iface); int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err); @@ -49,7 +49,7 @@ struct hostapd_iface * hostapd_alloc_iface(void); --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -395,6 +395,7 @@ void hostapd_free_hapd_data(struct hosta +@@ -396,6 +396,7 @@ void hostapd_free_hapd_data(struct hosta hapd->beacon_set_done = 0; wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); @@ -57,7 +57,7 @@ accounting_deinit(hapd); hostapd_deinit_wpa(hapd); vlan_deinit(hapd); -@@ -1417,6 +1418,8 @@ static int hostapd_setup_bss(struct host +@@ -1422,6 +1423,8 @@ static int hostapd_setup_bss(struct host if (hapd->driver && hapd->driver->set_operstate) hapd->driver->set_operstate(hapd->drv_priv, 1); @@ -66,7 +66,7 @@ return 0; } -@@ -1999,6 +2002,7 @@ static int hostapd_setup_interface_compl +@@ -2028,6 +2031,7 @@ static int hostapd_setup_interface_compl if (err) goto fail; @@ -74,7 +74,7 @@ wpa_printf(MSG_DEBUG, "Completing interface initialization"); if (iface->freq) { #ifdef NEED_AP_MLME -@@ -2196,6 +2200,7 @@ dfs_offload: +@@ -2225,6 +2229,7 @@ dfs_offload: fail: wpa_printf(MSG_ERROR, "Interface initialization failed"); @@ -82,7 +82,7 @@ hostapd_set_state(iface, HAPD_IFACE_DISABLED); wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); #ifdef CONFIG_FST -@@ -2669,6 +2674,7 @@ void hostapd_interface_deinit_free(struc +@@ -2700,6 +2705,7 @@ void hostapd_interface_deinit_free(struc (unsigned int) iface->conf->num_bss); driver = iface->bss[0]->driver; drv_priv = iface->bss[0]->drv_priv; @@ -92,7 +92,7 @@ __func__, driver, drv_priv); --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -2327,13 +2327,18 @@ static void handle_auth(struct hostapd_d +@@ -3553,13 +3553,18 @@ static void handle_auth(struct hostapd_d u16 auth_alg, auth_transaction, status_code; u16 resp = WLAN_STATUS_SUCCESS; struct sta_info *sta = NULL; @@ -112,7 +112,7 @@ if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) { wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)", -@@ -2493,6 +2498,13 @@ static void handle_auth(struct hostapd_d +@@ -3727,6 +3732,13 @@ static void handle_auth(struct hostapd_d resp = WLAN_STATUS_UNSPECIFIED_FAILURE; goto fail; } @@ -126,16 +126,16 @@ if (res == HOSTAPD_ACL_PENDING) return; -@@ -4166,7 +4178,7 @@ static void handle_assoc(struct hostapd_ +@@ -5446,7 +5458,7 @@ static void handle_assoc(struct hostapd_ int resp = WLAN_STATUS_SUCCESS; - u16 reply_res; + u16 reply_res = WLAN_STATUS_UNSPECIFIED_FAILURE; const u8 *pos; - int left, i; + int left, i, ubus_resp; struct sta_info *sta; u8 *tmp = NULL; #ifdef CONFIG_FILS -@@ -4379,6 +4391,11 @@ static void handle_assoc(struct hostapd_ +@@ -5659,6 +5671,11 @@ static void handle_assoc(struct hostapd_ left = res; } #endif /* CONFIG_FILS */ @@ -147,7 +147,7 @@ /* followed by SSID and Supported rates; and HT capabilities if 802.11n * is used */ -@@ -4543,6 +4560,14 @@ static void handle_assoc(struct hostapd_ +@@ -5823,6 +5840,14 @@ static void handle_assoc(struct hostapd_ pos, left, rssi, omit_rsnxe); os_free(tmp); @@ -160,9 +160,9 @@ + } + /* - * Remove the station in case tranmission of a success response fails + * Remove the station in case transmission of a success response fails * (the STA was added associated to the driver) or if the station was -@@ -4570,6 +4595,7 @@ static void handle_disassoc(struct hosta +@@ -5850,6 +5875,7 @@ static void handle_disassoc(struct hosta wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d", MAC2STR(mgmt->sa), le_to_host16(mgmt->u.disassoc.reason_code)); @@ -170,9 +170,9 @@ sta = ap_get_sta(hapd, mgmt->sa); if (sta == NULL) { -@@ -4636,6 +4662,8 @@ static void handle_deauth(struct hostapd - " reason_code=%d", - MAC2STR(mgmt->sa), le_to_host16(mgmt->u.deauth.reason_code)); +@@ -5919,6 +5945,8 @@ static void handle_deauth(struct hostapd + /* Clear the PTKSA cache entries for PASN */ + ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE); + hostapd_ubus_notify(hapd, "deauth", mgmt->sa); + @@ -181,7 +181,7 @@ wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying " --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -814,6 +814,12 @@ void handle_probe_req(struct hostapd_dat +@@ -823,6 +823,12 @@ void handle_probe_req(struct hostapd_dat u16 csa_offs[2]; size_t csa_offs_len; struct radius_sta rad_info; @@ -192,9 +192,9 @@ + .elems = &elems, + }; - if (len < IEEE80211_HDRLEN) - return; -@@ -996,6 +1002,12 @@ void handle_probe_req(struct hostapd_dat + if (hapd->iconf->rssi_ignore_probe_request && ssi_signal && + ssi_signal < hapd->iconf->rssi_ignore_probe_request) +@@ -1009,6 +1015,12 @@ void handle_probe_req(struct hostapd_dat } #endif /* CONFIG_P2P */ @@ -209,7 +209,7 @@ --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -119,6 +119,10 @@ int hostapd_notif_assoc(struct hostapd_d +@@ -145,6 +145,10 @@ int hostapd_notif_assoc(struct hostapd_d u16 reason = WLAN_REASON_UNSPECIFIED; int status = WLAN_STATUS_SUCCESS; const u8 *p2p_dev_addr = NULL; @@ -220,7 +220,7 @@ if (addr == NULL) { /* -@@ -211,6 +215,12 @@ int hostapd_notif_assoc(struct hostapd_d +@@ -237,6 +241,12 @@ int hostapd_notif_assoc(struct hostapd_d goto fail; } @@ -235,7 +235,7 @@ wpabuf_free(sta->p2p_ie); --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c -@@ -424,6 +424,7 @@ void ap_handle_timer(void *eloop_ctx, vo +@@ -459,6 +459,7 @@ void ap_handle_timer(void *eloop_ctx, vo HOSTAPD_LEVEL_INFO, "deauthenticated due to " "local deauth request"); ap_free_sta(hapd, sta); @@ -243,7 +243,7 @@ return; } -@@ -579,6 +580,7 @@ skip_poll: +@@ -614,6 +615,7 @@ skip_poll: hapd, sta, WLAN_REASON_PREV_AUTH_NOT_VALID); ap_free_sta(hapd, sta); @@ -251,7 +251,7 @@ break; } } -@@ -1294,6 +1296,7 @@ void ap_sta_set_authorized(struct hostap +@@ -1329,6 +1331,7 @@ void ap_sta_set_authorized(struct hostap buf, ip_addr, keyid_buf); } else { wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf); @@ -261,7 +261,7 @@ hapd->msg_ctx_parent != hapd->msg_ctx) --- a/src/ap/wpa_auth_glue.c +++ b/src/ap/wpa_auth_glue.c -@@ -259,6 +259,7 @@ static void hostapd_wpa_auth_psk_failure +@@ -265,6 +265,7 @@ static void hostapd_wpa_auth_psk_failure struct hostapd_data *hapd = ctx; wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR, MAC2STR(addr)); @@ -271,7 +271,7 @@ --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -190,6 +190,12 @@ ifdef CONFIG_EAPOL_TEST +@@ -176,6 +176,12 @@ ifdef CONFIG_EAPOL_TEST CFLAGS += -Werror -DEAPOL_TEST endif @@ -284,7 +284,7 @@ ifdef CONFIG_CODE_COVERAGE CFLAGS += -O0 -fprofile-arcs -ftest-coverage LIBS += -lgcov -@@ -956,6 +962,9 @@ ifdef CONFIG_CTRL_IFACE_MIB +@@ -959,6 +965,9 @@ ifdef CONFIG_CTRL_IFACE_MIB CFLAGS += -DCONFIG_CTRL_IFACE_MIB endif OBJS += ../src/ap/ctrl_iface_ap.o @@ -296,7 +296,7 @@ CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -6794,6 +6794,8 @@ struct wpa_supplicant * wpa_supplicant_a +@@ -7017,6 +7017,8 @@ struct wpa_supplicant * wpa_supplicant_a } #endif /* CONFIG_P2P */ @@ -305,7 +305,7 @@ return wpa_s; } -@@ -6820,6 +6822,8 @@ int wpa_supplicant_remove_iface(struct w +@@ -7043,6 +7045,8 @@ int wpa_supplicant_remove_iface(struct w struct wpa_supplicant *parent = wpa_s->parent; #endif /* CONFIG_MESH */ @@ -314,7 +314,7 @@ /* Remove interface from the global list of interfaces */ prev = global->ifaces; if (prev == wpa_s) { -@@ -7123,8 +7127,12 @@ int wpa_supplicant_run(struct wpa_global +@@ -7346,8 +7350,12 @@ int wpa_supplicant_run(struct wpa_global eloop_register_signal_terminate(wpa_supplicant_terminate, global); eloop_register_signal_reconfig(wpa_supplicant_reconfig, global); @@ -329,7 +329,7 @@ --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h -@@ -17,6 +17,7 @@ +@@ -19,6 +19,7 @@ #include "wps/wps_defs.h" #include "config_ssid.h" #include "wmm_ac.h" @@ -337,7 +337,7 @@ extern const char *const wpa_supplicant_version; extern const char *const wpa_supplicant_license; -@@ -310,6 +311,8 @@ struct wpa_global { +@@ -321,6 +322,8 @@ struct wpa_global { #endif /* CONFIG_WIFI_DISPLAY */ struct psk_list_entry *add_psk; /* From group formation */ @@ -346,7 +346,7 @@ }; -@@ -520,6 +523,7 @@ struct wpa_supplicant { +@@ -605,6 +608,7 @@ struct wpa_supplicant { unsigned char own_addr[ETH_ALEN]; unsigned char perm_addr[ETH_ALEN]; char ifname[100]; @@ -375,7 +375,7 @@ --- a/hostapd/main.c +++ b/hostapd/main.c -@@ -896,6 +896,7 @@ int main(int argc, char *argv[]) +@@ -895,6 +895,7 @@ int main(int argc, char *argv[]) } hostapd_global_ctrl_iface_init(&interfaces); @@ -383,7 +383,7 @@ if (hostapd_global_run(&interfaces, daemonize, pid_file)) { wpa_printf(MSG_ERROR, "Failed to start eloop"); -@@ -905,6 +906,7 @@ int main(int argc, char *argv[]) +@@ -904,6 +905,7 @@ int main(int argc, char *argv[]) ret = 0; out: @@ -464,7 +464,7 @@ --- a/src/ap/dfs.c +++ b/src/ap/dfs.c -@@ -1179,6 +1179,8 @@ int hostapd_dfs_radar_detected(struct ho +@@ -1193,6 +1193,8 @@ int hostapd_dfs_radar_detected(struct ho "freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d", freq, ht_enabled, chan_offset, chan_width, cf1, cf2); diff --git a/package/network/services/hostapd/patches/700-wifi-reload.patch b/package/network/services/hostapd/patches/700-wifi-reload.patch index b68c1aaa9d..ba3255b35b 100644 --- a/package/network/services/hostapd/patches/700-wifi-reload.patch +++ b/package/network/services/hostapd/patches/700-wifi-reload.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2501,6 +2501,8 @@ static int hostapd_config_fill(struct ho +@@ -2453,6 +2453,8 @@ static int hostapd_config_fill(struct ho bss->isolate = atoi(pos); } else if (os_strcmp(buf, "ap_max_inactivity") == 0) { bss->ap_max_inactivity = atoi(pos); @@ -9,7 +9,7 @@ } else if (os_strcmp(buf, "skip_inactivity_poll") == 0) { bss->skip_inactivity_poll = atoi(pos); } else if (os_strcmp(buf, "country_code") == 0) { -@@ -3197,6 +3199,8 @@ static int hostapd_config_fill(struct ho +@@ -3153,6 +3155,8 @@ static int hostapd_config_fill(struct ho } } else if (os_strcmp(buf, "acs_exclude_dfs") == 0) { conf->acs_exclude_dfs = atoi(pos); @@ -20,7 +20,7 @@ } else if (os_strcmp(buf, "channel") == 0) { --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c -@@ -780,6 +780,7 @@ void hostapd_config_free_bss(struct host +@@ -791,6 +791,7 @@ void hostapd_config_free_bss(struct host os_free(conf->radius_req_attr_sqlite); os_free(conf->rsn_preauth_interfaces); os_free(conf->ctrl_interface); @@ -28,7 +28,7 @@ os_free(conf->ca_cert); os_free(conf->server_cert); os_free(conf->server_cert2); -@@ -972,6 +973,7 @@ void hostapd_config_free(struct hostapd_ +@@ -987,6 +988,7 @@ void hostapd_config_free(struct hostapd_ for (i = 0; i < conf->num_bss; i++) hostapd_config_free_bss(conf->bss[i]); @@ -38,25 +38,26 @@ os_free(conf->basic_rates); --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -871,6 +871,7 @@ struct hostapd_bss_config { - */ - u8 mka_psk_set; - #endif /* CONFIG_MACSEC */ -+ char *config_id; - }; +@@ -279,6 +279,8 @@ struct hostapd_bss_config { + char vlan_bridge[IFNAMSIZ + 1]; + char wds_bridge[IFNAMSIZ + 1]; - /** -@@ -1062,6 +1063,7 @@ struct hostapd_config { - unsigned int airtime_update_interval; - #define AIRTIME_MODE_MAX (__AIRTIME_MODE_MAX - 1) ++ char *config_id; ++ + enum hostapd_logger_level logger_syslog_level, logger_stdout_level; + + unsigned int logger_syslog; /* module bitfield */ +@@ -782,6 +784,7 @@ struct hostapd_bss_config { + int airtime_limit; + struct airtime_sta_weight *airtime_weight_list; #endif /* CONFIG_AIRTIME_POLICY */ + char *config_id; - u8 notify_mgmt_frames; - }; + #ifdef CONFIG_MACSEC + /** --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -218,6 +218,10 @@ static int hostapd_iface_conf_changed(st +@@ -219,6 +219,10 @@ static int hostapd_iface_conf_changed(st { size_t i; @@ -67,7 +68,7 @@ if (newconf->num_bss != oldconf->num_bss) return 1; -@@ -231,7 +235,7 @@ static int hostapd_iface_conf_changed(st +@@ -232,7 +236,7 @@ static int hostapd_iface_conf_changed(st } @@ -76,7 +77,7 @@ { struct hapd_interfaces *interfaces = iface->interfaces; struct hostapd_data *hapd = iface->bss[0]; -@@ -254,13 +258,16 @@ int hostapd_reload_config(struct hostapd +@@ -255,13 +259,16 @@ int hostapd_reload_config(struct hostapd if (newconf == NULL) return -1; @@ -95,7 +96,7 @@ wpa_printf(MSG_DEBUG, "Configuration changes include interface/BSS modification - force full disable+enable sequence"); fname = os_strdup(iface->config_fname); -@@ -285,6 +292,24 @@ int hostapd_reload_config(struct hostapd +@@ -286,6 +293,24 @@ int hostapd_reload_config(struct hostapd wpa_printf(MSG_ERROR, "Failed to enable interface on config reload"); return res; @@ -120,7 +121,7 @@ } iface->conf = newconf; -@@ -301,6 +326,12 @@ int hostapd_reload_config(struct hostapd +@@ -302,6 +327,12 @@ int hostapd_reload_config(struct hostapd for (j = 0; j < iface->num_bss; j++) { hapd = iface->bss[j]; @@ -133,7 +134,7 @@ hapd->iconf = newconf; hapd->conf = newconf->bss[j]; hostapd_reload_bss(hapd); -@@ -2366,6 +2397,10 @@ hostapd_alloc_bss_data(struct hostapd_if +@@ -2397,6 +2428,10 @@ hostapd_alloc_bss_data(struct hostapd_if hapd->iconf = conf; hapd->conf = bss; hapd->iface = hapd_iface; @@ -163,7 +164,7 @@ int interface_added; /* virtual interface added for this BSS */ unsigned int started:1; unsigned int disabled:1; -@@ -600,7 +601,7 @@ struct hostapd_iface { +@@ -604,7 +605,7 @@ struct hostapd_iface { int hostapd_for_each_interface(struct hapd_interfaces *interfaces, int (*cb)(struct hostapd_iface *iface, void *ctx), void *ctx); @@ -174,7 +175,7 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface, --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4511,6 +4511,9 @@ static int wpa_driver_nl80211_set_ap(voi +@@ -4820,6 +4820,9 @@ static int wpa_driver_nl80211_set_ap(voi if (ret) { wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)", ret, strerror(-ret)); @@ -186,7 +187,7 @@ nl80211_set_bss(bss, params->cts_protect, params->preamble, --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -184,7 +184,7 @@ static int hostapd_ctrl_iface_update(str +@@ -186,7 +186,7 @@ static int hostapd_ctrl_iface_update(str iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read; reload_opts = txt; diff --git a/package/network/services/hostapd/patches/710-vlan_no_bridge.patch b/package/network/services/hostapd/patches/710-vlan_no_bridge.patch index 7de4e2c1d4..d5aa33520b 100644 --- a/package/network/services/hostapd/patches/710-vlan_no_bridge.patch +++ b/package/network/services/hostapd/patches/710-vlan_no_bridge.patch @@ -22,7 +22,7 @@ os_strcmp(ifname, vlan->ifname) != 0) --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3400,6 +3400,8 @@ static int hostapd_config_fill(struct ho +@@ -3366,6 +3366,8 @@ static int hostapd_config_fill(struct ho #ifndef CONFIG_NO_VLAN } else if (os_strcmp(buf, "dynamic_vlan") == 0) { bss->ssid.dynamic_vlan = atoi(pos); diff --git a/package/network/services/hostapd/patches/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch b/package/network/services/hostapd/patches/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch deleted file mode 100644 index 3e4638d7ff..0000000000 --- a/package/network/services/hostapd/patches/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch +++ /dev/null @@ -1,37 +0,0 @@ -From cefc52e6b93731c713f1bba1cb5e7e92105b758b Mon Sep 17 00:00:00 2001 -From: David Bauer -Date: Fri, 3 Jul 2020 23:00:34 +0200 -Subject: [PATCH] dfs: enter DFS state if no available channel is found - -Previously hostapd would not stop transmitting when a DFS event was -detected and no available channel to switch to was available. - -Disable and re-enable the interface to enter DFS state. This way, TX -does not happen until the kernel notifies hostapd about the NOP -expiring. - -Signed-off-by: David Bauer ---- - src/ap/dfs.c | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - ---- a/src/ap/dfs.c -+++ b/src/ap/dfs.c -@@ -1086,8 +1086,15 @@ static int hostapd_dfs_start_channel_swi - &oper_centr_freq_seg0_idx, - &oper_centr_freq_seg1_idx, - &skip_radar); -- if (!channel) -- return err; -+ if (!channel) { -+ /* -+ * Toggle interface state to enter DFS state -+ * until NOP is finished. -+ */ -+ hostapd_disable_iface(iface); -+ hostapd_enable_iface(iface); -+ return 0; -+ } - if (!skip_radar) { - iface->freq = channel->freq; - iface->conf->channel = channel->chan; diff --git a/package/network/services/hostapd/patches/801-P2P-Fix-copying-of-secondary-device-types-for-P2P-gr.patch b/package/network/services/hostapd/patches/801-P2P-Fix-copying-of-secondary-device-types-for-P2P-gr.patch deleted file mode 100644 index 944f7d71c9..0000000000 --- a/package/network/services/hostapd/patches/801-P2P-Fix-copying-of-secondary-device-types-for-P2P-gr.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 947272febe24a8f0ea828b5b2f35f13c3821901e Mon Sep 17 00:00:00 2001 -From: Jouni Malinen -Date: Mon, 9 Nov 2020 11:43:12 +0200 -Subject: [PATCH] P2P: Fix copying of secondary device types for P2P group - client - -Parsing and copying of WPS secondary device types list was verifying -that the contents is not too long for the internal maximum in the case -of WPS messages, but similar validation was missing from the case of P2P -group information which encodes this information in a different -attribute. This could result in writing beyond the memory area assigned -for these entries and corrupting memory within an instance of struct -p2p_device. This could result in invalid operations and unexpected -behavior when trying to free pointers from that corrupted memory. - -Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27269 -Fixes: e57ae6e19edf ("P2P: Keep track of secondary device types for peers") -Signed-off-by: Jouni Malinen ---- - src/p2p/p2p.c | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/src/p2p/p2p.c -+++ b/src/p2p/p2p.c -@@ -453,6 +453,8 @@ static void p2p_copy_client_info(struct - dev->info.config_methods = cli->config_methods; - os_memcpy(dev->info.pri_dev_type, cli->pri_dev_type, 8); - dev->info.wps_sec_dev_type_list_len = 8 * cli->num_sec_dev_types; -+ if (dev->info.wps_sec_dev_type_list_len > WPS_SEC_DEV_TYPE_MAX_LEN) -+ dev->info.wps_sec_dev_type_list_len = WPS_SEC_DEV_TYPE_MAX_LEN; - os_memcpy(dev->info.wps_sec_dev_type_list, cli->sec_dev_types, - dev->info.wps_sec_dev_type_list_len); - } From d87b58bb09100beaa4825d6c8e50c894783ca2d5 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 25 May 2021 10:50:16 +0200 Subject: [PATCH 16/29] hostapd: fix adding back stations after a missed deauth/disassoc Signed-off-by: Felix Fietkau --- ...ix-sta-add-after-previous-connection.patch | 26 +++++++++++++++++++ .../hostapd/patches/600-ubus_support.patch | 10 +++---- .../hostapd/patches/700-wifi-reload.patch | 12 ++++----- 3 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 package/network/services/hostapd/patches/021-fix-sta-add-after-previous-connection.patch diff --git a/package/network/services/hostapd/patches/021-fix-sta-add-after-previous-connection.patch b/package/network/services/hostapd/patches/021-fix-sta-add-after-previous-connection.patch new file mode 100644 index 0000000000..124fd8bdf1 --- /dev/null +++ b/package/network/services/hostapd/patches/021-fix-sta-add-after-previous-connection.patch @@ -0,0 +1,26 @@ +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -4942,6 +4942,13 @@ static int add_associated_sta(struct hos + * drivers to accept the STA parameter configuration. Since this is + * after a new FT-over-DS exchange, a new TK has been derived, so key + * reinstallation is not a concern for this case. ++ * ++ * If the STA was associated and authorized earlier, but came for a new ++ * connection (!added_unassoc + !reassoc), remove the existing STA entry ++ * so that it can be re-added. This case is rarely seen when the AP could ++ * not receive the deauth/disassoc frame from the STA. And the STA comes ++ * back with new connection within a short period or before the inactive ++ * STA entry is removed from the list. + */ + wpa_printf(MSG_DEBUG, "Add associated STA " MACSTR + " (added_unassoc=%d auth_alg=%u ft_over_ds=%u reassoc=%d authorized=%d ft_tk=%d fils_tk=%d)", +@@ -4955,7 +4962,8 @@ static int add_associated_sta(struct hos + (!(sta->flags & WLAN_STA_AUTHORIZED) || + (reassoc && sta->ft_over_ds && sta->auth_alg == WLAN_AUTH_FT) || + (!wpa_auth_sta_ft_tk_already_set(sta->wpa_sm) && +- !wpa_auth_sta_fils_tk_already_set(sta->wpa_sm)))) { ++ !wpa_auth_sta_fils_tk_already_set(sta->wpa_sm)) || ++ (!reassoc && (sta->flags & WLAN_STA_AUTHORIZED)))) { + hostapd_drv_sta_remove(hapd, sta->addr); + wpa_auth_sm_event(sta->wpa_sm, WPA_DRV_STA_REMOVED); + set = 0; diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index 013b81d25b..71537c9ec6 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -126,7 +126,7 @@ if (res == HOSTAPD_ACL_PENDING) return; -@@ -5446,7 +5458,7 @@ static void handle_assoc(struct hostapd_ +@@ -5454,7 +5466,7 @@ static void handle_assoc(struct hostapd_ int resp = WLAN_STATUS_SUCCESS; u16 reply_res = WLAN_STATUS_UNSPECIFIED_FAILURE; const u8 *pos; @@ -135,7 +135,7 @@ struct sta_info *sta; u8 *tmp = NULL; #ifdef CONFIG_FILS -@@ -5659,6 +5671,11 @@ static void handle_assoc(struct hostapd_ +@@ -5667,6 +5679,11 @@ static void handle_assoc(struct hostapd_ left = res; } #endif /* CONFIG_FILS */ @@ -147,7 +147,7 @@ /* followed by SSID and Supported rates; and HT capabilities if 802.11n * is used */ -@@ -5823,6 +5840,14 @@ static void handle_assoc(struct hostapd_ +@@ -5831,6 +5848,14 @@ static void handle_assoc(struct hostapd_ pos, left, rssi, omit_rsnxe); os_free(tmp); @@ -162,7 +162,7 @@ /* * Remove the station in case transmission of a success response fails * (the STA was added associated to the driver) or if the station was -@@ -5850,6 +5875,7 @@ static void handle_disassoc(struct hosta +@@ -5858,6 +5883,7 @@ static void handle_disassoc(struct hosta wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d", MAC2STR(mgmt->sa), le_to_host16(mgmt->u.disassoc.reason_code)); @@ -170,7 +170,7 @@ sta = ap_get_sta(hapd, mgmt->sa); if (sta == NULL) { -@@ -5919,6 +5945,8 @@ static void handle_deauth(struct hostapd +@@ -5927,6 +5953,8 @@ static void handle_deauth(struct hostapd /* Clear the PTKSA cache entries for PASN */ ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE); diff --git a/package/network/services/hostapd/patches/700-wifi-reload.patch b/package/network/services/hostapd/patches/700-wifi-reload.patch index ba3255b35b..5993b0d445 100644 --- a/package/network/services/hostapd/patches/700-wifi-reload.patch +++ b/package/network/services/hostapd/patches/700-wifi-reload.patch @@ -47,14 +47,14 @@ enum hostapd_logger_level logger_syslog_level, logger_stdout_level; unsigned int logger_syslog; /* module bitfield */ -@@ -782,6 +784,7 @@ struct hostapd_bss_config { - int airtime_limit; - struct airtime_sta_weight *airtime_weight_list; - #endif /* CONFIG_AIRTIME_POLICY */ +@@ -938,6 +940,7 @@ struct spatial_reuse { + struct hostapd_config { + struct hostapd_bss_config **bss, *last_bss; + size_t num_bss; + char *config_id; - #ifdef CONFIG_MACSEC - /** + u16 beacon_int; + int rts_threshold; --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -219,6 +219,10 @@ static int hostapd_iface_conf_changed(st From 8d79915327b7b9ed221f513589281328e4fdc6ef Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 25 May 2021 10:57:01 +0200 Subject: [PATCH 17/29] mac80211: fix center freq selection for 6 GHz Signed-off-by: Felix Fietkau --- .../files/lib/netifd/wireless/mac80211.sh | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 8771f12d2f..4c3ea50831 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -194,12 +194,14 @@ mac80211_hostapd_setup_base() { enable_ac=0 vht_oper_chwidth=0 vht_center_seg0= + chan_ofs=0 + [ "$band" = "6g" ] && chan_ofs=1 idx="$channel" case "$htmode" in VHT20|HE20) enable_ac=1;; VHT40|HE40) - case "$(( ($channel / 4) % 2 ))" in + case "$(( (($channel / 4) + $chan_ofs) % 2 ))" in 1) idx=$(($channel + 2));; 0) idx=$(($channel - 2));; esac @@ -207,7 +209,7 @@ mac80211_hostapd_setup_base() { vht_center_seg0=$idx ;; VHT80|HE80) - case "$(( ($channel / 4) % 4 ))" in + case "$(( (($channel / 4) + $chan_ofs) % 4 ))" in 1) idx=$(($channel + 6));; 2) idx=$(($channel + 2));; 3) idx=$(($channel - 2));; @@ -218,10 +220,22 @@ mac80211_hostapd_setup_base() { vht_center_seg0=$idx ;; VHT160|HE160) - case "$channel" in - 36|40|44|48|52|56|60|64) idx=50;; - 100|104|108|112|116|120|124|128) idx=114;; - esac + if [ "$band" = "6g" ]; then + case "$channel" in + 1|5|9|13|17|21|25|29) idx=15;; + 33|37|41|45|49|53|57|61) idx=47;; + 65|69|73|77|81|85|89|93) idx=79;; + 97|101|105|109|113|117|121|125) idx=111;; + 129|133|137|141|145|149|153|157) idx=143;; + 161|165|169|173|177|181|185|189) idx=175;; + 193|197|201|205|209|213|217|221) idx=207;; + esac + else + case "$channel" in + 36|40|44|48|52|56|60|64) idx=50;; + 100|104|108|112|116|120|124|128) idx=114;; + esac + fi enable_ac=1 vht_oper_chwidth=2 vht_center_seg0=$idx From fbd6f099f50e77d2bb95708c62e86a358779251a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 25 May 2021 11:10:51 +0200 Subject: [PATCH 18/29] mac80211: add more HE capabilities Signed-off-by: Felix Fietkau --- .../files/lib/netifd/wireless/mac80211.sh | 86 +++++++++++++++++-- 1 file changed, 81 insertions(+), 5 deletions(-) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 4c3ea50831..f1ed47802a 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -43,11 +43,24 @@ drv_mac80211_init_device_config() { su_beamformee \ mu_beamformer \ mu_beamformee \ + he_su_beamformer \ + he_su_beamformee \ + he_mu_beamformer \ vht_txop_ps \ htc_vht \ rx_antenna_pattern \ - tx_antenna_pattern - config_add_int vht_max_a_mpdu_len_exp vht_max_mpdu vht_link_adapt vht160 rx_stbc tx_stbc + tx_antenna_pattern \ + he_spr_sr_control \ + he_twt_required + config_add_int \ + vht_max_a_mpdu_len_exp \ + vht_max_mpdu \ + vht_link_adapt \ + vht160 \ + rx_stbc \ + tx_stbc \ + he_bss_color \ + he_spr_non_srg_obss_pd_max_offset config_add_boolean \ ldpc \ greenfield \ @@ -95,6 +108,23 @@ mac80211_add_capabilities() { export -n -- "$__var=$__out" } +mac80211_add_he_capabilities() { + local __out= oifs + + oifs="$IFS" + IFS=: + for capab in "$@"; do + set -- $capab + [ "$(($4))" -gt 0 ] || continue + [ "$(((0x$2) & $3))" -gt 0 ] || { + eval "$4=0" + continue + } + append base_cfg "$1=1" "$N" + done + IFS="$oifs" +} + mac80211_hostapd_setup_base() { local phy="$1" @@ -358,16 +388,62 @@ mac80211_hostapd_setup_base() { esac if [ "$enable_ax" != "0" ]; then + json_get_vars \ + he_su_beamformer:1 \ + he_su_beamformee:0 \ + he_mu_beamformer:1 \ + he_twt_required:0 \ + he_spr_sr_control:0 \ + he_spr_non_srg_obss_pd_max_offset:1 \ + he_bss_color + + he_phy_cap=$(iw phy "$phy" info | awk -F "[()]" '/HE PHY Capabilities/ { print $2 }' | head -1) + he_phy_cap=${he_phy_cap:2} + he_mac_cap=$(iw phy "$phy" info | awk -F "[()]" '/HE MAC Capabilities/ { print $2 }' | head -1) + he_mac_cap=${he_mac_cap:2} + append base_cfg "ieee80211ax=1" "$N" + [ -n "$he_bss_color" ] && append base_cfg "he_bss_color=$he_bss_color" "$N" [ "$hwmode" = "a" ] && { append base_cfg "he_oper_chwidth=$vht_oper_chwidth" "$N" append base_cfg "he_oper_centr_freq_seg0_idx=$vht_center_seg0" "$N" } + + mac80211_add_he_capabilities \ + he_su_beamformer:${he_phy_cap:6:2}:0x80:$he_su_beamformer \ + he_su_beamformee:${he_phy_cap:8:2}:0x1:$he_su_beamformee \ + he_mu_beamformer:${he_phy_cap:8:2}:0x2:$he_mu_beamformer \ + he_spr_sr_control:${he_phy_cap:14:2}:0x1:$he_spr_sr_control \ + he_twt_required:${he_mac_cap:0:2}:0x6:$he_twt_required + + [ "$he_spr_sr_control" -gt 0 ] && append base_cfg "he_spr_non_srg_obss_pd_max_offset=$he_spr_non_srg_obss_pd_max_offset" "$N" + append base_cfg "he_default_pe_duration=4" "$N" append base_cfg "he_rts_threshold=1023" "$N" - append base_cfg "he_su_beamformer=1" "$N" - append base_cfg "he_su_beamformee=1" "$N" - append base_cfg "he_mu_beamformer=1" "$N" + append base_cfg "he_mu_edca_qos_info_param_count=0" "$N" + append base_cfg "he_mu_edca_qos_info_q_ack=0" "$N" + append base_cfg "he_mu_edca_qos_info_queue_request=0" "$N" + append base_cfg "he_mu_edca_qos_info_txop_request=0" "$N" + append base_cfg "he_mu_edca_ac_be_aifsn=8" "$N" + append base_cfg "he_mu_edca_ac_be_aci=0" "$N" + append base_cfg "he_mu_edca_ac_be_ecwmin=9" "$N" + append base_cfg "he_mu_edca_ac_be_ecwmax=10" "$N" + append base_cfg "he_mu_edca_ac_be_timer=255" "$N" + append base_cfg "he_mu_edca_ac_bk_aifsn=15" "$N" + append base_cfg "he_mu_edca_ac_bk_aci=1" "$N" + append base_cfg "he_mu_edca_ac_bk_ecwmin=9" "$N" + append base_cfg "he_mu_edca_ac_bk_ecwmax=10" "$N" + append base_cfg "he_mu_edca_ac_bk_timer=255" "$N" + append base_cfg "he_mu_edca_ac_vi_ecwmin=5" "$N" + append base_cfg "he_mu_edca_ac_vi_ecwmax=7" "$N" + append base_cfg "he_mu_edca_ac_vi_aifsn=5" "$N" + append base_cfg "he_mu_edca_ac_vi_aci=2" "$N" + append base_cfg "he_mu_edca_ac_vi_timer=255" "$N" + append base_cfg "he_mu_edca_ac_vo_aifsn=5" "$N" + append base_cfg "he_mu_edca_ac_vo_aci=3" "$N" + append base_cfg "he_mu_edca_ac_vo_ecwmin=5" "$N" + append base_cfg "he_mu_edca_ac_vo_ecwmax=7" "$N" + append base_cfg "he_mu_edca_ac_vo_timer=255" "$N" fi hostapd_prepare_device_config "$hostapd_conf_file" nl80211 From 8dba71dd33c8e35e7f363ffdb2ba42259ab43ce2 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Wed, 26 May 2021 12:36:30 +0200 Subject: [PATCH 19/29] imx6: image: drop BOOT_SCRIPT and fix DEVICE_NAME This fixes Gateworks Ventana 'DEVICE_NAME' variable which value wasn't adjusted during migration to common 'vendor_model' image naming scheme (fixes: FS#3825). Furthermore, drop unused 'Build/boot-scr' recipe, get rid of redundant 'BOOT_SCRIPT' variable (use already provided 'DEVICE_NAME' instead) and drop custom 'DEVICE_NAME' variable from SolidRun CuBox-i image recipe (use default one instead). Fixes: cbc8bcfbaa ("imx6: image: use vendor_model scheme") Signed-off-by: Piotr Dymacz --- target/linux/imx6/image/Makefile | 17 +++-------------- ...lidrun_cubox => bootscript-solidrun_cubox-i} | 0 2 files changed, 3 insertions(+), 14 deletions(-) rename target/linux/imx6/image/{bootscript-solidrun_cubox => bootscript-solidrun_cubox-i} (100%) diff --git a/target/linux/imx6/image/Makefile b/target/linux/imx6/image/Makefile index 96d6a1caf9..948694381e 100644 --- a/target/linux/imx6/image/Makefile +++ b/target/linux/imx6/image/Makefile @@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/image.mk # Images ################################################# -DEVICE_VARS += MKUBIFS_OPTS UBOOT BOOT_SCRIPT +DEVICE_VARS += MKUBIFS_OPTS UBOOT define Build/boot-overlay rm -rf $@.boot @@ -49,13 +49,6 @@ define Build/bootfs.tar.gz -czvf $@ . endef -define Build/boot-scr - mkimage -A arm -O linux -T script -C none -a 0 -e 0 \ - -n '$(DEVICE_ID) OpenWrt bootscript' \ - -d ./bootscript-$(DEVICE_NAME) \ - $(BIN_DIR)/boot.scr -endef - define Build/recovery-scr mkimage -A arm -O linux -T script -C none -a 0 -e 0 \ -n '$(DEVICE_ID) OpenWrt recovery bootscript' \ @@ -82,7 +75,7 @@ define Build/imx6-combined-image mkimage -A arm -O linux -T script -C none -a 0 -e 0 \ -n '$(DEVICE_ID) OpenWrt bootscript' \ - -d $(BOOT_SCRIPT) \ + -d bootscript-$(DEVICE_NAME) \ $@.boot/boot.scr cp $@ $@.fs @@ -131,7 +124,7 @@ define Device/gateworks_ventana DEVICE_VENDOR := Gateworks DEVICE_MODEL := Ventana family DEVICE_VARIANT := normal NAND flash - DEVICE_NAME := ventana + DEVICE_NAME := gateworks_ventana DEVICE_DTS:= \ imx6dl-gw51xx \ imx6dl-gw52xx \ @@ -161,7 +154,6 @@ define Device/gateworks_ventana DEVICE_PACKAGES := kmod-sky2 kmod-sound-core kmod-sound-soc-imx \ kmod-sound-soc-imx-sgtl5000 kmod-can kmod-can-flexcan kmod-can-raw \ kmod-hwmon-gsc kmod-leds-gpio kmod-pps-gpio kobs-ng - BOOT_SCRIPT := bootscript-gateworks_ventana KERNEL += | boot-overlay IMAGES := nand.ubi bootfs.tar.gz dtb IMAGE/nand.ubi := append-ubi @@ -187,14 +179,12 @@ TARGET_DEVICES += gateworks_ventana-large define Device/solidrun_cubox-i DEVICE_VENDOR := SolidRun DEVICE_MODEL := CuBox-i - DEVICE_NAME := cubox DEVICE_DTS := \ imx6q-cubox-i \ imx6dl-cubox-i \ imx6q-hummingboard \ imx6dl-hummingboard DEVICE_PACKAGES := kmod-drm-imx kmod-drm-imx-hdmi kmod-usb-hid - BOOT_SCRIPT := bootscript-solidrun_cubox UBOOT := mx6cuboxi KERNEL := kernel-bin KERNEL_SUFFIX := -zImage @@ -217,7 +207,6 @@ define Device/toradex_apalis kmod-can kmod-can-flexcan kmod-can-raw \ kmod-leds-gpio kmod-gpio-button-hotplug \ kmod-pps-gpio kmod-rtc-ds1307 - BOOT_SCRIPT := bootscript-toradex_apalis FILESYSTEMS := squashfs IMAGES := combined.bin sysupgrade.bin DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1).$$(2) diff --git a/target/linux/imx6/image/bootscript-solidrun_cubox b/target/linux/imx6/image/bootscript-solidrun_cubox-i similarity index 100% rename from target/linux/imx6/image/bootscript-solidrun_cubox rename to target/linux/imx6/image/bootscript-solidrun_cubox-i From 91abeebd3bd29a98de516e49260d61165096009a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 26 May 2021 20:00:14 +0200 Subject: [PATCH 20/29] mac80211: sync nl80211.h with upstream and backport a WPA3 related commit Fixes compatibility issues with the latest hostapd update Signed-off-by: Felix Fietkau --- .../patches/subsys/010-sync-nl80211_h.patch | 297 ++++++++++++++++++ ...ort-immediate-reconnect-request-hint.patch | 22 -- ...port-to-configure-SAE-PWE-value-to-d.patch | 74 +++++ ...y-handle-A-MSDUs-that-start-with-an-.patch | 4 +- .../500-mac80211_configure_antenna_gain.patch | 18 +- .../utils/iw/patches/001-nl80211_h_sync.patch | 279 +++++++++++++++- 6 files changed, 659 insertions(+), 35 deletions(-) create mode 100644 package/kernel/mac80211/patches/subsys/010-sync-nl80211_h.patch create mode 100644 package/kernel/mac80211/patches/subsys/302-cfg80211-Add-support-to-configure-SAE-PWE-value-to-d.patch diff --git a/package/kernel/mac80211/patches/subsys/010-sync-nl80211_h.patch b/package/kernel/mac80211/patches/subsys/010-sync-nl80211_h.patch new file mode 100644 index 0000000000..e1f66ac1c3 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/010-sync-nl80211_h.patch @@ -0,0 +1,297 @@ +--- a/include/uapi/linux/nl80211.h ++++ b/include/uapi/linux/nl80211.h +@@ -655,6 +655,9 @@ + * When a security association was established on an 802.1X network using + * fast transition, this event should be followed by an + * %NL80211_CMD_PORT_AUTHORIZED event. ++ * Following a %NL80211_CMD_ROAM event userspace can issue ++ * %NL80211_CMD_GET_SCAN in order to obtain the scan information for the ++ * new BSS the card/driver roamed to. + * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify + * userspace that a connection was dropped by the AP or due to other + * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and +@@ -757,7 +760,8 @@ + * of any other interfaces, and other interfaces will again take + * precedence when they are used. + * +- * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. ++ * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface ++ * (no longer supported). + * + * @NL80211_CMD_SET_MULTICAST_TO_UNICAST: Configure if this AP should perform + * multicast to unicast conversion. When enabled, all multicast packets +@@ -1177,6 +1181,10 @@ + * includes the contents of the frame. %NL80211_ATTR_ACK flag is included + * if the recipient acknowledged the frame. + * ++ * @NL80211_CMD_SET_SAR_SPECS: SAR power limitation configuration is ++ * passed using %NL80211_ATTR_SAR_SPEC. %NL80211_ATTR_WIPHY is used to ++ * specify the wiphy index to be applied to. ++ * + * @NL80211_CMD_MAX: highest used command number + * @__NL80211_CMD_AFTER_LAST: internal use + */ +@@ -1407,6 +1415,8 @@ enum nl80211_commands { + + NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS, + ++ NL80211_CMD_SET_SAR_SPECS, ++ + /* add new commands above here */ + + /* used to define NL80211_CMD_MAX below */ +@@ -1750,8 +1760,9 @@ enum nl80211_commands { + * specify just a single bitrate, which is to be used for the beacon. + * The driver must also specify support for this with the extended + * features NL80211_EXT_FEATURE_BEACON_RATE_LEGACY, +- * NL80211_EXT_FEATURE_BEACON_RATE_HT and +- * NL80211_EXT_FEATURE_BEACON_RATE_VHT. ++ * NL80211_EXT_FEATURE_BEACON_RATE_HT, ++ * NL80211_EXT_FEATURE_BEACON_RATE_VHT and ++ * NL80211_EXT_FEATURE_BEACON_RATE_HE. + * + * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain + * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME. +@@ -1955,8 +1966,15 @@ enum nl80211_commands { + * @NL80211_ATTR_PROBE_RESP: Probe Response template data. Contains the entire + * probe-response frame. The DA field in the 802.11 header is zero-ed out, + * to be filled by the FW. +- * @NL80211_ATTR_DISABLE_HT: Force HT capable interfaces to disable +- * this feature. Currently, only supported in mac80211 drivers. ++ * @NL80211_ATTR_DISABLE_HT: Force HT capable interfaces to disable ++ * this feature during association. This is a flag attribute. ++ * Currently only supported in mac80211 drivers. ++ * @NL80211_ATTR_DISABLE_VHT: Force VHT capable interfaces to disable ++ * this feature during association. This is a flag attribute. ++ * Currently only supported in mac80211 drivers. ++ * @NL80211_ATTR_DISABLE_HE: Force HE capable interfaces to disable ++ * this feature during association. This is a flag attribute. ++ * Currently only supported in mac80211 drivers. + * @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the + * ATTR_HT_CAPABILITY to which attention should be paid. + * Currently, only mac80211 NICs support this feature. +@@ -2077,7 +2095,8 @@ enum nl80211_commands { + * until the channel switch event. + * @NL80211_ATTR_CH_SWITCH_BLOCK_TX: flag attribute specifying that transmission + * must be blocked on the current channel (before the channel switch +- * operation). ++ * operation). Also included in the channel switch started event if quiet ++ * was requested by the AP. + * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information + * for the time while performing a channel switch. + * @NL80211_ATTR_CNTDWN_OFFS_BEACON: An array of offsets (u16) to the channel +@@ -2527,6 +2546,20 @@ enum nl80211_commands { + * override mask. Used with NL80211_ATTR_S1G_CAPABILITY in + * NL80211_CMD_ASSOCIATE or NL80211_CMD_CONNECT. + * ++ * @NL80211_ATTR_SAE_PWE: Indicates the mechanism(s) allowed for SAE PWE ++ * derivation in WPA3-Personal networks which are using SAE authentication. ++ * This is a u8 attribute that encapsulates one of the values from ++ * &enum nl80211_sae_pwe_mechanism. ++ * ++ * @NL80211_ATTR_SAR_SPEC: SAR power limitation specification when ++ * used with %NL80211_CMD_SET_SAR_SPECS. The message contains fields ++ * of %nl80211_sar_attrs which specifies the sar type and related ++ * sar specs. Sar specs contains array of %nl80211_sar_specs_attrs. ++ * ++ * @NL80211_ATTR_RECONNECT_REQUESTED: flag attribute, used with deauth and ++ * disassoc events to indicate that an immediate reconnect to the AP ++ * is desired. ++ * + * @NUM_NL80211_ATTR: total number of nl80211_attrs available + * @NL80211_ATTR_MAX: highest attribute number currently defined + * @__NL80211_ATTR_AFTER_LAST: internal use +@@ -3016,6 +3049,14 @@ enum nl80211_attrs { + NL80211_ATTR_S1G_CAPABILITY, + NL80211_ATTR_S1G_CAPABILITY_MASK, + ++ NL80211_ATTR_SAE_PWE, ++ ++ NL80211_ATTR_RECONNECT_REQUESTED, ++ ++ NL80211_ATTR_SAR_SPEC, ++ ++ NL80211_ATTR_DISABLE_HE, ++ + /* add attributes here, update the policy in nl80211.c */ + + __NL80211_ATTR_AFTER_LAST, +@@ -5896,6 +5937,19 @@ enum nl80211_feature_flags { + * @NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP: Driver/device supports + * unsolicited broadcast probe response transmission + * ++ * @NL80211_EXT_FEATURE_BEACON_RATE_HE: Driver supports beacon rate ++ * configuration (AP/mesh) with HE rates. ++ * ++ * @NL80211_EXT_FEATURE_SECURE_LTF: Device supports secure LTF measurement ++ * exchange protocol. ++ * ++ * @NL80211_EXT_FEATURE_SECURE_RTT: Device supports secure RTT measurement ++ * exchange protocol. ++ * ++ * @NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE: Device supports management ++ * frame protection for all management frames exchanged during the ++ * negotiation and range measurement procedure. ++ * + * @NUM_NL80211_EXT_FEATURES: number of extended features. + * @MAX_NL80211_EXT_FEATURES: highest extended feature index. + */ +@@ -5956,6 +6010,10 @@ enum nl80211_ext_feature_index { + NL80211_EXT_FEATURE_SAE_OFFLOAD_AP, + NL80211_EXT_FEATURE_FILS_DISCOVERY, + NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP, ++ NL80211_EXT_FEATURE_BEACON_RATE_HE, ++ NL80211_EXT_FEATURE_SECURE_LTF, ++ NL80211_EXT_FEATURE_SECURE_RTT, ++ NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE, + + /* add new features before the definition below */ + NUM_NL80211_EXT_FEATURES, +@@ -6253,11 +6311,13 @@ struct nl80211_vendor_cmd_info { + * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable. + * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable. + * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable. ++ * @NL80211_TDLS_PEER_HE: TDLS peer is HE capable. + */ + enum nl80211_tdls_peer_capability { + NL80211_TDLS_PEER_HT = 1<<0, + NL80211_TDLS_PEER_VHT = 1<<1, + NL80211_TDLS_PEER_WMM = 1<<2, ++ NL80211_TDLS_PEER_HE = 1<<3, + }; + + /** +@@ -6849,6 +6909,9 @@ enum nl80211_peer_measurement_ftm_capa { + * if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor + * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based + * ranging will be used. ++ * @NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK: negotiate for LMR feedback. Only ++ * valid if either %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED or ++ * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set. + * + * @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal + * @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number +@@ -6867,6 +6930,7 @@ enum nl80211_peer_measurement_ftm_req { + NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC, + NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED, + NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED, ++ NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK, + + /* keep last */ + NUM_NL80211_PMSR_FTM_REQ_ATTR, +@@ -7124,4 +7188,115 @@ enum nl80211_unsol_bcast_probe_resp_attr + NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX = + __NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_LAST - 1 + }; ++ ++/** ++ * enum nl80211_sae_pwe_mechanism - The mechanism(s) allowed for SAE PWE ++ * derivation. Applicable only when WPA3-Personal SAE authentication is ++ * used. ++ * ++ * @NL80211_SAE_PWE_UNSPECIFIED: not specified, used internally to indicate that ++ * attribute is not present from userspace. ++ * @NL80211_SAE_PWE_HUNT_AND_PECK: hunting-and-pecking loop only ++ * @NL80211_SAE_PWE_HASH_TO_ELEMENT: hash-to-element only ++ * @NL80211_SAE_PWE_BOTH: both hunting-and-pecking loop and hash-to-element ++ * can be used. ++ */ ++enum nl80211_sae_pwe_mechanism { ++ NL80211_SAE_PWE_UNSPECIFIED, ++ NL80211_SAE_PWE_HUNT_AND_PECK, ++ NL80211_SAE_PWE_HASH_TO_ELEMENT, ++ NL80211_SAE_PWE_BOTH, ++}; ++ ++/** ++ * enum nl80211_sar_type - type of SAR specs ++ * ++ * @NL80211_SAR_TYPE_POWER: power limitation specified in 0.25dBm unit ++ * ++ */ ++enum nl80211_sar_type { ++ NL80211_SAR_TYPE_POWER, ++ ++ /* add new type here */ ++ ++ /* Keep last */ ++ NUM_NL80211_SAR_TYPE, ++}; ++ ++/** ++ * enum nl80211_sar_attrs - Attributes for SAR spec ++ * ++ * @NL80211_SAR_ATTR_TYPE: the SAR type as defined in &enum nl80211_sar_type. ++ * ++ * @NL80211_SAR_ATTR_SPECS: Nested array of SAR power ++ * limit specifications. Each specification contains a set ++ * of %nl80211_sar_specs_attrs. ++ * ++ * For SET operation, it contains array of %NL80211_SAR_ATTR_SPECS_POWER ++ * and %NL80211_SAR_ATTR_SPECS_RANGE_INDEX. ++ * ++ * For sar_capa dump, it contains array of ++ * %NL80211_SAR_ATTR_SPECS_START_FREQ ++ * and %NL80211_SAR_ATTR_SPECS_END_FREQ. ++ * ++ * @__NL80211_SAR_ATTR_LAST: Internal ++ * @NL80211_SAR_ATTR_MAX: highest sar attribute ++ * ++ * These attributes are used with %NL80211_CMD_SET_SAR_SPEC ++ */ ++enum nl80211_sar_attrs { ++ __NL80211_SAR_ATTR_INVALID, ++ ++ NL80211_SAR_ATTR_TYPE, ++ NL80211_SAR_ATTR_SPECS, ++ ++ __NL80211_SAR_ATTR_LAST, ++ NL80211_SAR_ATTR_MAX = __NL80211_SAR_ATTR_LAST - 1, ++}; ++ ++/** ++ * enum nl80211_sar_specs_attrs - Attributes for SAR power limit specs ++ * ++ * @NL80211_SAR_ATTR_SPECS_POWER: Required (s32)value to specify the actual ++ * power limit value in units of 0.25 dBm if type is ++ * NL80211_SAR_TYPE_POWER. (i.e., a value of 44 represents 11 dBm). ++ * 0 means userspace doesn't have SAR limitation on this associated range. ++ * ++ * @NL80211_SAR_ATTR_SPECS_RANGE_INDEX: Required (u32) value to specify the ++ * index of exported freq range table and the associated power limitation ++ * is applied to this range. ++ * ++ * Userspace isn't required to set all the ranges advertised by WLAN driver, ++ * and userspace can skip some certain ranges. These skipped ranges don't ++ * have SAR limitations, and they are same as setting the ++ * %NL80211_SAR_ATTR_SPECS_POWER to any unreasonable high value because any ++ * value higher than regulatory allowed value just means SAR power ++ * limitation is removed, but it's required to set at least one range. ++ * It's not allowed to set duplicated range in one SET operation. ++ * ++ * Every SET operation overwrites previous SET operation. ++ * ++ * @NL80211_SAR_ATTR_SPECS_START_FREQ: Required (u32) value to specify the start ++ * frequency of this range edge when registering SAR capability to wiphy. ++ * It's not a channel center frequency. The unit is kHz. ++ * ++ * @NL80211_SAR_ATTR_SPECS_END_FREQ: Required (u32) value to specify the end ++ * frequency of this range edge when registering SAR capability to wiphy. ++ * It's not a channel center frequency. The unit is kHz. ++ * ++ * @__NL80211_SAR_ATTR_SPECS_LAST: Internal ++ * @NL80211_SAR_ATTR_SPECS_MAX: highest sar specs attribute ++ */ ++enum nl80211_sar_specs_attrs { ++ __NL80211_SAR_ATTR_SPECS_INVALID, ++ ++ NL80211_SAR_ATTR_SPECS_POWER, ++ NL80211_SAR_ATTR_SPECS_RANGE_INDEX, ++ NL80211_SAR_ATTR_SPECS_START_FREQ, ++ NL80211_SAR_ATTR_SPECS_END_FREQ, ++ ++ __NL80211_SAR_ATTR_SPECS_LAST, ++ NL80211_SAR_ATTR_SPECS_MAX = __NL80211_SAR_ATTR_SPECS_LAST - 1, ++}; ++ + #endif /* __LINUX_NL80211_H */ diff --git a/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch b/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch index cbc2a2e03d..807d496080 100644 --- a/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch +++ b/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch @@ -31,28 +31,6 @@ Signed-off-by: Johannes Berg /** * cfg80211_rx_unprot_mlme_mgmt - notification of unprotected mlme mgmt frame ---- a/include/uapi/linux/nl80211.h -+++ b/include/uapi/linux/nl80211.h -@@ -2527,6 +2527,10 @@ enum nl80211_commands { - * override mask. Used with NL80211_ATTR_S1G_CAPABILITY in - * NL80211_CMD_ASSOCIATE or NL80211_CMD_CONNECT. - * -+ * @NL80211_ATTR_RECONNECT_REQUESTED: flag attribute, used with deauth and -+ * disassoc events to indicate that an immediate reconnect to the AP -+ * is desired. -+ * - * @NUM_NL80211_ATTR: total number of nl80211_attrs available - * @NL80211_ATTR_MAX: highest attribute number currently defined - * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -3016,6 +3020,8 @@ enum nl80211_attrs { - NL80211_ATTR_S1G_CAPABILITY, - NL80211_ATTR_S1G_CAPABILITY_MASK, - -+ NL80211_ATTR_RECONNECT_REQUESTED, -+ - /* add attributes here, update the policy in nl80211.c */ - - __NL80211_ATTR_AFTER_LAST, --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -2729,7 +2729,7 @@ static void ieee80211_report_disconnect( diff --git a/package/kernel/mac80211/patches/subsys/302-cfg80211-Add-support-to-configure-SAE-PWE-value-to-d.patch b/package/kernel/mac80211/patches/subsys/302-cfg80211-Add-support-to-configure-SAE-PWE-value-to-d.patch new file mode 100644 index 0000000000..acfdae0f5b --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/302-cfg80211-Add-support-to-configure-SAE-PWE-value-to-d.patch @@ -0,0 +1,74 @@ +From: Rohan Dutta +Date: Tue, 27 Oct 2020 12:09:10 +0200 +Subject: [PATCH] cfg80211: Add support to configure SAE PWE value to drivers + +Add support to configure SAE PWE preference from userspace to drivers in +both AP and STA modes. This is needed for cases where the driver takes +care of Authentication frame processing (SME in the driver) so that +correct enforcement of the acceptable PWE derivation mechanism can be +performed. + +The userspace applications can pass the sae_pwe value using the +NL80211_ATTR_SAE_PWE attribute in the NL80211_CMD_CONNECT and +NL80211_CMD_START_AP commands to the driver. This allows selection +between the hunting-and-pecking loop and hash-to-element options for PWE +derivation. For backwards compatibility, this new attribute is optional +and if not included, the driver is notified of the value being +unspecified. + +Signed-off-by: Rohan Dutta +Signed-off-by: Jouni Malinen +Link: https://lore.kernel.org/r/20201027100910.22283-1-jouni@codeaurora.org +Signed-off-by: Johannes Berg +--- + +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -1009,6 +1009,14 @@ struct survey_info { + * @sae_pwd: password for SAE authentication (for devices supporting SAE + * offload) + * @sae_pwd_len: length of SAE password (for devices supporting SAE offload) ++ * @sae_pwe: The mechanisms allowed for SAE PWE derivation ++ * NL80211_SAE_PWE_UNSPECIFIED: Not-specified, used to indicate userspace ++ * did not specify any preference. The driver should follow its ++ * internal policy in such a scenario. ++ * NL80211_SAE_PWE_HUNT_AND_PECK: Allow hunting-and-pecking loop only ++ * NL80211_SAE_PWE_HASH_TO_ELEMENT: Allow hash-to-element only ++ * NL80211_SAE_PWE_BOTH: Allow either hunting-and-pecking loop ++ * or hash-to-element + */ + struct cfg80211_crypto_settings { + u32 wpa_versions; +@@ -1027,6 +1035,7 @@ struct cfg80211_crypto_settings { + const u8 *psk; + const u8 *sae_pwd; + u8 sae_pwd_len; ++ enum nl80211_sae_pwe_mechanism sae_pwe; + }; + + /** +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -736,6 +736,9 @@ static const struct nla_policy nl80211_p + NLA_POLICY_EXACT_LEN(IEEE80211_S1G_CAPABILITY_LEN), + [NL80211_ATTR_S1G_CAPABILITY_MASK] = + NLA_POLICY_EXACT_LEN(IEEE80211_S1G_CAPABILITY_LEN), ++ [NL80211_ATTR_SAE_PWE] = ++ NLA_POLICY_RANGE(NLA_U8, NL80211_SAE_PWE_HUNT_AND_PECK, ++ NL80211_SAE_PWE_BOTH), + [NL80211_ATTR_RECONNECT_REQUESTED] = { .type = NLA_REJECT }, + }; + +@@ -9764,6 +9767,12 @@ static int nl80211_crypto_settings(struc + nla_len(info->attrs[NL80211_ATTR_SAE_PASSWORD]); + } + ++ if (info->attrs[NL80211_ATTR_SAE_PWE]) ++ settings->sae_pwe = ++ nla_get_u8(info->attrs[NL80211_ATTR_SAE_PWE]); ++ else ++ settings->sae_pwe = NL80211_SAE_PWE_UNSPECIFIED; ++ + return 0; + } + diff --git a/package/kernel/mac80211/patches/subsys/382-mac80211-properly-handle-A-MSDUs-that-start-with-an-.patch b/package/kernel/mac80211/patches/subsys/382-mac80211-properly-handle-A-MSDUs-that-start-with-an-.patch index 3fdabde219..d59fa05091 100644 --- a/package/kernel/mac80211/patches/subsys/382-mac80211-properly-handle-A-MSDUs-that-start-with-an-.patch +++ b/package/kernel/mac80211/patches/subsys/382-mac80211-properly-handle-A-MSDUs-that-start-with-an-.patch @@ -15,7 +15,7 @@ Signed-off-by: Johannes Berg --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -5628,7 +5628,7 @@ unsigned int ieee80211_get_mesh_hdrlen(s +@@ -5637,7 +5637,7 @@ unsigned int ieee80211_get_mesh_hdrlen(s */ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr, const u8 *addr, enum nl80211_iftype iftype, @@ -24,7 +24,7 @@ Signed-off-by: Johannes Berg /** * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3 -@@ -5640,7 +5640,7 @@ int ieee80211_data_to_8023_exthdr(struct +@@ -5649,7 +5649,7 @@ int ieee80211_data_to_8023_exthdr(struct static inline int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, enum nl80211_iftype iftype) { diff --git a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch index eb967f77d7..febe42eb9d 100644 --- a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch +++ b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch @@ -1,6 +1,6 @@ --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -3736,6 +3736,7 @@ struct mgmt_frame_regs { +@@ -3745,6 +3745,7 @@ struct mgmt_frame_regs { * (as advertised by the nl80211 feature flag.) * @get_tx_power: store the current TX power into the dbm variable; * return 0 if successful @@ -8,7 +8,7 @@ * * @set_wds_peer: set the WDS peer for a WDS interface * -@@ -4058,6 +4059,7 @@ struct cfg80211_ops { +@@ -4067,6 +4068,7 @@ struct cfg80211_ops { enum nl80211_tx_power_setting type, int mbm); int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, int *dbm); @@ -36,7 +36,7 @@ u8 ps_dtim_period; --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h -@@ -2531,6 +2531,9 @@ enum nl80211_commands { +@@ -2560,6 +2560,9 @@ enum nl80211_commands { * disassoc events to indicate that an immediate reconnect to the AP * is desired. * @@ -46,9 +46,9 @@ * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -3022,6 +3025,8 @@ enum nl80211_attrs { +@@ -3057,6 +3060,8 @@ enum nl80211_attrs { - NL80211_ATTR_RECONNECT_REQUESTED, + NL80211_ATTR_DISABLE_HE, + NL80211_ATTR_WIPHY_ANTENNA_GAIN, + @@ -129,15 +129,15 @@ local->hw.max_mtu = IEEE80211_MAX_DATA_LEN; --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -737,6 +737,7 @@ static const struct nla_policy nl80211_p - [NL80211_ATTR_S1G_CAPABILITY_MASK] = - NLA_POLICY_EXACT_LEN(IEEE80211_S1G_CAPABILITY_LEN), +@@ -740,6 +740,7 @@ static const struct nla_policy nl80211_p + NLA_POLICY_RANGE(NLA_U8, NL80211_SAE_PWE_HUNT_AND_PECK, + NL80211_SAE_PWE_BOTH), [NL80211_ATTR_RECONNECT_REQUESTED] = { .type = NLA_REJECT }, + [NL80211_ATTR_WIPHY_ANTENNA_GAIN] = { .type = NLA_U32 }, }; /* policy for the key attributes */ -@@ -3245,6 +3246,20 @@ static int nl80211_set_wiphy(struct sk_b +@@ -3248,6 +3249,20 @@ static int nl80211_set_wiphy(struct sk_b if (result) return result; } diff --git a/package/network/utils/iw/patches/001-nl80211_h_sync.patch b/package/network/utils/iw/patches/001-nl80211_h_sync.patch index 5aa3cd5146..1d6ea0fae0 100644 --- a/package/network/utils/iw/patches/001-nl80211_h_sync.patch +++ b/package/network/utils/iw/patches/001-nl80211_h_sync.patch @@ -1,9 +1,99 @@ --- a/nl80211.h +++ b/nl80211.h -@@ -2527,6 +2527,13 @@ enum nl80211_commands { +@@ -655,6 +655,9 @@ + * When a security association was established on an 802.1X network using + * fast transition, this event should be followed by an + * %NL80211_CMD_PORT_AUTHORIZED event. ++ * Following a %NL80211_CMD_ROAM event userspace can issue ++ * %NL80211_CMD_GET_SCAN in order to obtain the scan information for the ++ * new BSS the card/driver roamed to. + * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify + * userspace that a connection was dropped by the AP or due to other + * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and +@@ -757,7 +760,8 @@ + * of any other interfaces, and other interfaces will again take + * precedence when they are used. + * +- * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. ++ * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface ++ * (no longer supported). + * + * @NL80211_CMD_SET_MULTICAST_TO_UNICAST: Configure if this AP should perform + * multicast to unicast conversion. When enabled, all multicast packets +@@ -1177,6 +1181,10 @@ + * includes the contents of the frame. %NL80211_ATTR_ACK flag is included + * if the recipient acknowledged the frame. + * ++ * @NL80211_CMD_SET_SAR_SPECS: SAR power limitation configuration is ++ * passed using %NL80211_ATTR_SAR_SPEC. %NL80211_ATTR_WIPHY is used to ++ * specify the wiphy index to be applied to. ++ * + * @NL80211_CMD_MAX: highest used command number + * @__NL80211_CMD_AFTER_LAST: internal use + */ +@@ -1407,6 +1415,8 @@ enum nl80211_commands { + + NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS, + ++ NL80211_CMD_SET_SAR_SPECS, ++ + /* add new commands above here */ + + /* used to define NL80211_CMD_MAX below */ +@@ -1750,8 +1760,9 @@ enum nl80211_commands { + * specify just a single bitrate, which is to be used for the beacon. + * The driver must also specify support for this with the extended + * features NL80211_EXT_FEATURE_BEACON_RATE_LEGACY, +- * NL80211_EXT_FEATURE_BEACON_RATE_HT and +- * NL80211_EXT_FEATURE_BEACON_RATE_VHT. ++ * NL80211_EXT_FEATURE_BEACON_RATE_HT, ++ * NL80211_EXT_FEATURE_BEACON_RATE_VHT and ++ * NL80211_EXT_FEATURE_BEACON_RATE_HE. + * + * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain + * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME. +@@ -1955,8 +1966,15 @@ enum nl80211_commands { + * @NL80211_ATTR_PROBE_RESP: Probe Response template data. Contains the entire + * probe-response frame. The DA field in the 802.11 header is zero-ed out, + * to be filled by the FW. +- * @NL80211_ATTR_DISABLE_HT: Force HT capable interfaces to disable +- * this feature. Currently, only supported in mac80211 drivers. ++ * @NL80211_ATTR_DISABLE_HT: Force HT capable interfaces to disable ++ * this feature during association. This is a flag attribute. ++ * Currently only supported in mac80211 drivers. ++ * @NL80211_ATTR_DISABLE_VHT: Force VHT capable interfaces to disable ++ * this feature during association. This is a flag attribute. ++ * Currently only supported in mac80211 drivers. ++ * @NL80211_ATTR_DISABLE_HE: Force HE capable interfaces to disable ++ * this feature during association. This is a flag attribute. ++ * Currently only supported in mac80211 drivers. + * @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the + * ATTR_HT_CAPABILITY to which attention should be paid. + * Currently, only mac80211 NICs support this feature. +@@ -2077,7 +2095,8 @@ enum nl80211_commands { + * until the channel switch event. + * @NL80211_ATTR_CH_SWITCH_BLOCK_TX: flag attribute specifying that transmission + * must be blocked on the current channel (before the channel switch +- * operation). ++ * operation). Also included in the channel switch started event if quiet ++ * was requested by the AP. + * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information + * for the time while performing a channel switch. + * @NL80211_ATTR_CNTDWN_OFFS_BEACON: An array of offsets (u16) to the channel +@@ -2527,6 +2546,23 @@ enum nl80211_commands { * override mask. Used with NL80211_ATTR_S1G_CAPABILITY in * NL80211_CMD_ASSOCIATE or NL80211_CMD_CONNECT. * ++ * @NL80211_ATTR_SAE_PWE: Indicates the mechanism(s) allowed for SAE PWE ++ * derivation in WPA3-Personal networks which are using SAE authentication. ++ * This is a u8 attribute that encapsulates one of the values from ++ * &enum nl80211_sae_pwe_mechanism. ++ * ++ * @NL80211_ATTR_SAR_SPEC: SAR power limitation specification when ++ * used with %NL80211_CMD_SET_SAR_SPECS. The message contains fields ++ * of %nl80211_sar_attrs which specifies the sar type and related ++ * sar specs. Sar specs contains array of %nl80211_sar_specs_attrs. ++ * + * @NL80211_ATTR_RECONNECT_REQUESTED: flag attribute, used with deauth and + * disassoc events to indicate that an immediate reconnect to the AP + * is desired. @@ -14,14 +104,199 @@ * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -3016,6 +3023,10 @@ enum nl80211_attrs { +@@ -3016,6 +3052,16 @@ enum nl80211_attrs { NL80211_ATTR_S1G_CAPABILITY, NL80211_ATTR_S1G_CAPABILITY_MASK, ++ NL80211_ATTR_SAE_PWE, ++ + NL80211_ATTR_RECONNECT_REQUESTED, + ++ NL80211_ATTR_SAR_SPEC, ++ ++ NL80211_ATTR_DISABLE_HE, ++ + NL80211_ATTR_WIPHY_ANTENNA_GAIN, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, +@@ -5896,6 +5942,19 @@ enum nl80211_feature_flags { + * @NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP: Driver/device supports + * unsolicited broadcast probe response transmission + * ++ * @NL80211_EXT_FEATURE_BEACON_RATE_HE: Driver supports beacon rate ++ * configuration (AP/mesh) with HE rates. ++ * ++ * @NL80211_EXT_FEATURE_SECURE_LTF: Device supports secure LTF measurement ++ * exchange protocol. ++ * ++ * @NL80211_EXT_FEATURE_SECURE_RTT: Device supports secure RTT measurement ++ * exchange protocol. ++ * ++ * @NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE: Device supports management ++ * frame protection for all management frames exchanged during the ++ * negotiation and range measurement procedure. ++ * + * @NUM_NL80211_EXT_FEATURES: number of extended features. + * @MAX_NL80211_EXT_FEATURES: highest extended feature index. + */ +@@ -5956,6 +6015,10 @@ enum nl80211_ext_feature_index { + NL80211_EXT_FEATURE_SAE_OFFLOAD_AP, + NL80211_EXT_FEATURE_FILS_DISCOVERY, + NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP, ++ NL80211_EXT_FEATURE_BEACON_RATE_HE, ++ NL80211_EXT_FEATURE_SECURE_LTF, ++ NL80211_EXT_FEATURE_SECURE_RTT, ++ NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE, + + /* add new features before the definition below */ + NUM_NL80211_EXT_FEATURES, +@@ -6253,11 +6316,13 @@ struct nl80211_vendor_cmd_info { + * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable. + * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable. + * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable. ++ * @NL80211_TDLS_PEER_HE: TDLS peer is HE capable. + */ + enum nl80211_tdls_peer_capability { + NL80211_TDLS_PEER_HT = 1<<0, + NL80211_TDLS_PEER_VHT = 1<<1, + NL80211_TDLS_PEER_WMM = 1<<2, ++ NL80211_TDLS_PEER_HE = 1<<3, + }; + + /** +@@ -6849,6 +6914,9 @@ enum nl80211_peer_measurement_ftm_capa { + * if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor + * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based + * ranging will be used. ++ * @NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK: negotiate for LMR feedback. Only ++ * valid if either %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED or ++ * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set. + * + * @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal + * @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number +@@ -6867,6 +6935,7 @@ enum nl80211_peer_measurement_ftm_req { + NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC, + NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED, + NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED, ++ NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK, + + /* keep last */ + NUM_NL80211_PMSR_FTM_REQ_ATTR, +@@ -7124,4 +7193,115 @@ enum nl80211_unsol_bcast_probe_resp_attr + NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX = + __NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_LAST - 1 + }; ++ ++/** ++ * enum nl80211_sae_pwe_mechanism - The mechanism(s) allowed for SAE PWE ++ * derivation. Applicable only when WPA3-Personal SAE authentication is ++ * used. ++ * ++ * @NL80211_SAE_PWE_UNSPECIFIED: not specified, used internally to indicate that ++ * attribute is not present from userspace. ++ * @NL80211_SAE_PWE_HUNT_AND_PECK: hunting-and-pecking loop only ++ * @NL80211_SAE_PWE_HASH_TO_ELEMENT: hash-to-element only ++ * @NL80211_SAE_PWE_BOTH: both hunting-and-pecking loop and hash-to-element ++ * can be used. ++ */ ++enum nl80211_sae_pwe_mechanism { ++ NL80211_SAE_PWE_UNSPECIFIED, ++ NL80211_SAE_PWE_HUNT_AND_PECK, ++ NL80211_SAE_PWE_HASH_TO_ELEMENT, ++ NL80211_SAE_PWE_BOTH, ++}; ++ ++/** ++ * enum nl80211_sar_type - type of SAR specs ++ * ++ * @NL80211_SAR_TYPE_POWER: power limitation specified in 0.25dBm unit ++ * ++ */ ++enum nl80211_sar_type { ++ NL80211_SAR_TYPE_POWER, ++ ++ /* add new type here */ ++ ++ /* Keep last */ ++ NUM_NL80211_SAR_TYPE, ++}; ++ ++/** ++ * enum nl80211_sar_attrs - Attributes for SAR spec ++ * ++ * @NL80211_SAR_ATTR_TYPE: the SAR type as defined in &enum nl80211_sar_type. ++ * ++ * @NL80211_SAR_ATTR_SPECS: Nested array of SAR power ++ * limit specifications. Each specification contains a set ++ * of %nl80211_sar_specs_attrs. ++ * ++ * For SET operation, it contains array of %NL80211_SAR_ATTR_SPECS_POWER ++ * and %NL80211_SAR_ATTR_SPECS_RANGE_INDEX. ++ * ++ * For sar_capa dump, it contains array of ++ * %NL80211_SAR_ATTR_SPECS_START_FREQ ++ * and %NL80211_SAR_ATTR_SPECS_END_FREQ. ++ * ++ * @__NL80211_SAR_ATTR_LAST: Internal ++ * @NL80211_SAR_ATTR_MAX: highest sar attribute ++ * ++ * These attributes are used with %NL80211_CMD_SET_SAR_SPEC ++ */ ++enum nl80211_sar_attrs { ++ __NL80211_SAR_ATTR_INVALID, ++ ++ NL80211_SAR_ATTR_TYPE, ++ NL80211_SAR_ATTR_SPECS, ++ ++ __NL80211_SAR_ATTR_LAST, ++ NL80211_SAR_ATTR_MAX = __NL80211_SAR_ATTR_LAST - 1, ++}; ++ ++/** ++ * enum nl80211_sar_specs_attrs - Attributes for SAR power limit specs ++ * ++ * @NL80211_SAR_ATTR_SPECS_POWER: Required (s32)value to specify the actual ++ * power limit value in units of 0.25 dBm if type is ++ * NL80211_SAR_TYPE_POWER. (i.e., a value of 44 represents 11 dBm). ++ * 0 means userspace doesn't have SAR limitation on this associated range. ++ * ++ * @NL80211_SAR_ATTR_SPECS_RANGE_INDEX: Required (u32) value to specify the ++ * index of exported freq range table and the associated power limitation ++ * is applied to this range. ++ * ++ * Userspace isn't required to set all the ranges advertised by WLAN driver, ++ * and userspace can skip some certain ranges. These skipped ranges don't ++ * have SAR limitations, and they are same as setting the ++ * %NL80211_SAR_ATTR_SPECS_POWER to any unreasonable high value because any ++ * value higher than regulatory allowed value just means SAR power ++ * limitation is removed, but it's required to set at least one range. ++ * It's not allowed to set duplicated range in one SET operation. ++ * ++ * Every SET operation overwrites previous SET operation. ++ * ++ * @NL80211_SAR_ATTR_SPECS_START_FREQ: Required (u32) value to specify the start ++ * frequency of this range edge when registering SAR capability to wiphy. ++ * It's not a channel center frequency. The unit is kHz. ++ * ++ * @NL80211_SAR_ATTR_SPECS_END_FREQ: Required (u32) value to specify the end ++ * frequency of this range edge when registering SAR capability to wiphy. ++ * It's not a channel center frequency. The unit is kHz. ++ * ++ * @__NL80211_SAR_ATTR_SPECS_LAST: Internal ++ * @NL80211_SAR_ATTR_SPECS_MAX: highest sar specs attribute ++ */ ++enum nl80211_sar_specs_attrs { ++ __NL80211_SAR_ATTR_SPECS_INVALID, ++ ++ NL80211_SAR_ATTR_SPECS_POWER, ++ NL80211_SAR_ATTR_SPECS_RANGE_INDEX, ++ NL80211_SAR_ATTR_SPECS_START_FREQ, ++ NL80211_SAR_ATTR_SPECS_END_FREQ, ++ ++ __NL80211_SAR_ATTR_SPECS_LAST, ++ NL80211_SAR_ATTR_SPECS_MAX = __NL80211_SAR_ATTR_SPECS_LAST - 1, ++}; ++ + #endif /* __LINUX_NL80211_H */ From f8f8935adb2be1ebce46a8d7058c76a8d3a9bd89 Mon Sep 17 00:00:00 2001 From: Vinay Patil Date: Mon, 19 Apr 2021 06:52:51 +0530 Subject: [PATCH 21/29] ramips: add support for TP-Link Archer A6 v3 The patch adds support for the TP-Link Archer A6 v3 The router is sold in US and India with FCC ID TE7A6V3 Specification ------------- MediaTek MT7621 SOC RAM: 128MB DDR3 SPI Flash: W25Q128 (16MB) Ethernet: MT7530 5x 1000Base-T WiFi 5GHz: Mediatek MT7613BE WiFi 2.4GHz: Mediatek MT7603E UART/Serial: 115200 8n1 Device Configuration & Serial Port Pins --------------------------------------- ETH Ports: LAN4 LAN3 LAN2 LAN1 WAN _______________________ | | Serial Pins: | VCC GND TXD RXD | |_____________________| LEDs: Power Wifi2G Wifi5G LAN WAN Build Output ------------ The build will generate following set of files [1] openwrt-ramips-mt7621-tplink_archer-a6-v3-initramfs-kernel.bin [2] openwrt-ramips-mt7621-tplink_archer-a6-v3-squashfs-factory.bin [3] openwrt-ramips-mt7621-tplink_archer-a6-v3-squashfs-sysupgrade.bin How to Use - Flashing from TP-Link Web Interface ------------------------------------------------ * Go to "Advanced/System Tools/Firmware Update". * Click "Browse" and upload the OpenWrt factory image: factory.bin[2] * Click the "Upgrade" button, and select "Yes" when prompted. TFTP Booting ------------ Setup a TFTP boot server with address 192.168.0.5. While starting U-boot press '4' key to stop autoboot. Copy the initramfs-kernel.bin[1] to TFTP server folder, rename as test.bin From u-boot command prompt run tftpboot followed by bootm. Recovery -------- Archer A6 V3 has recovery page activated if SPI booting from flash fails. Recovery page can be activated from serial console only. Press 'x' while u-boot is starting Note: TFTP boot can be activated only from u-boot serial console. Device recovery address: 192.168.0.1 Thanks to: Frankis for Randmon MAC address fix. Signed-off-by: Vinay Patil [remove superfluous factory image definition, whitespacing] Signed-off-by: David Bauer --- .../ramips/dts/mt7621_tplink_archer-a6-v3.dts | 188 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 13 ++ .../mt7621/base-files/etc/board.d/01_leds | 4 + tools/firmware-utils/src/tplink-safeloader.c | 40 +++- 4 files changed, 244 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/mt7621_tplink_archer-a6-v3.dts diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-a6-v3.dts b/target/linux/ramips/dts/mt7621_tplink_archer-a6-v3.dts new file mode 100644 index 0000000000..46cb365da7 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_tplink_archer-a6-v3.dts @@ -0,0 +1,188 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "tplink,archer-a6-v3", "mediatek,mt7621-soc"; + model = "TP-Link Archer A6 v3"; + + aliases { + label-mac-device = &gmac0; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + gpios = <&gpio 28 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + wan_orange { + label = "orange:wan"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "green:lan"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wifi5g { + label = "green:wifi5g"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wifi2g { + label = "green:wifi2g"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wan_green { + label = "green:wan"; + gpios = <&gpio 45 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "firmware"; + compatible = "denx,uimage"; + reg = <0x40000 0xf60000>; + }; + + config: partition@fa0000 { + label = "config"; + reg = <0xfa0000 0x50000>; + read-only; + }; + + radio: partition@ff0000 { + label = "radio"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart2", "uart3", "jtag", "wdt"; + function = "gpio"; + }; +}; + +ðernet { + pinctrl-names = "default"; + pinctrl-0 = <&rgmii1_pins &mdio_pins>; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&radio 0x0>; + mtd-mac-address = <&config 0x8>; + mtd-mac-address-increment = <1>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&radio 0x8000>; + mtd-mac-address = <&config 0x8>; + mtd-mac-address-increment = <2>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&gmac0 { + mtd-mac-address = <&config 0x8>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "wan"; + }; + + port@1 { + status = "okay"; + label = "lan1"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan3"; + }; + + port@4 { + status = "okay"; + label = "lan4"; + }; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index b1c224ca16..6ac485688a 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1132,6 +1132,19 @@ define Device/totolink_x5000r endef TARGET_DEVICES += totolink_x5000r +define Device/tplink_archer-a6-v3 + $(Device/dsa-migration) + $(Device/tplink-safeloader) + DEVICE_MODEL := Archer A6 + DEVICE_VARIANT := V3 + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e \ + kmod-mt7663-firmware-ap kmod-mt7663-firmware-sta + TPLINK_BOARD_ID := ARCHER-A6-V3 + KERNEL := $(KERNEL_DTB) | uImage lzma + IMAGE_SIZE := 15744k +endef +TARGET_DEVICES += tplink_archer-a6-v3 + define Device/tplink_eap235-wall-v1 $(Device/dsa-migration) $(Device/tplink-safeloader) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 6743b7e6c3..70cf09df14 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -78,6 +78,10 @@ netgear,r6800) ucidef_set_led_netdev "lan3" "LAN3" "white:lan3" "lan3" ucidef_set_led_netdev "lan4" "LAN4" "white:lan4" "lan4" ;; +tplink,archer-a6-v3) + ucidef_set_led_netdev "lan" "LAN" "green:lan" "br-lan" + ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan" + ;; tplink,re350-v1) ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "blue:wifi2G" "wlan0" ucidef_set_led_netdev "wifi5g" "Wifi 5G" "blue:wifi5G" "wlan1" diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index 8a47e6a58f..ac83b686d8 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -1061,7 +1061,44 @@ static struct device_info boards[] = { .first_sysupgrade_partition = "os-image", .last_sysupgrade_partition = "file-system", }, + /** Firmware layout for the Archer A6 v3 */ + { + .id = "ARCHER-A6-V3", + .vendor = "", + .support_list = + "SupportList:\n" + "{product_name:Archer A6,product_ver:3.0.0,special_id:55530000}\n" + "{product_name:Archer A6,product_ver:3.0.0,special_id:54570000}\n", + .part_trail = 0x00, + .soft_ver = "soft_ver:1.0.5\n", + .partitions = { + {"fs-uboot", 0x00000, 0x40000}, + {"firmware", 0x40000, 0xf60000}, + {"default-mac", 0xfa0000, 0x00200}, + {"pin", 0xfa0200, 0x00100}, + {"device-id", 0xfa0300, 0x00100}, + {"product-info", 0xfa0400, 0x0fc00}, + {"default-config", 0xfb0000, 0x08000}, + {"ap-def-config", 0xfb8000, 0x08000}, + {"user-config", 0xfc0000, 0x0a000}, + {"ag-config", 0xfca000, 0x04000}, + {"certificate", 0xfce000, 0x02000}, + {"ap-config", 0xfd0000, 0x06000}, + {"router-config", 0xfd6000, 0x06000}, + {"favicon", 0xfdc000, 0x02000}, + {"logo", 0xfde000, 0x02000}, + {"partition-table", 0xfe0000, 0x00800}, + {"soft-version", 0xfe0800, 0x00100}, + {"support-list", 0xfe0900, 0x00200}, + {"profile", 0xfe0b00, 0x03000}, + {"extra-para", 0xfe3b00, 0x00100}, + {"radio", 0xff0000, 0x10000}, + {NULL, 0, 0} + }, + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "file-system", + }, /** Firmware layout for the C60v1 */ { .id = "ARCHER-C60-V1", @@ -2826,7 +2863,8 @@ static void build_image(const char *output, parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof, file_system_partition); /* Some devices need the extra-para partition to accept the firmware */ - if (strcasecmp(info->id, "ARCHER-A7-V5") == 0 || + if (strcasecmp(info->id, "ARCHER-A6-V3") == 0 || + strcasecmp(info->id, "ARCHER-A7-V5") == 0 || strcasecmp(info->id, "ARCHER-C2-V3") == 0 || strcasecmp(info->id, "ARCHER-C7-V4") == 0 || strcasecmp(info->id, "ARCHER-C7-V5") == 0 || From a46ad596a3e076599f38a4132b5d6dfee8a3102a Mon Sep 17 00:00:00 2001 From: Georgi Vlaev Date: Fri, 31 Jul 2020 14:02:21 +0300 Subject: [PATCH 22/29] ramips: add support for TP-Link Archer C6U v1 (EU) This patch adds support for TP-Link Archer C6U v1 (EU). The device is also known in some market as Archer C6 v3. This patch supports only Archer C6U v1 (EU). Specifications: -------------- * SoC: Mediatek MT7621AT 2C2T, 880MHz * RAM: 128MB DDR3 * Flash: 16MB SPI NOR flash (Winbond 25Q128) * WiFi 5GHz: Mediatek MT7613BEN (2x2:2) * WiFi 2.4GHz: Mediatek MT7603EN (2x2:2) * Ethernet: MT7630, 5x 1000Base-T. * LED: Power, WAN, LAN, WiFi 2GHz and 5GHz, USB * Buttons: Reset, WPS. * UART: Serial console (115200 8n1), J1(GND:3) * USB: One USB2 port. Installation: ------------ Install the OpenWrt factory image for C6U is from the TP-Link web interface. 1) Go to "Advanced/System Tools/Firmware Update". 2) Click "Browse" and upload the OpenWrt factory image: openwrt-ramips-mt7621-tplink_archer-c6u-v1-squashfs-factory.bin. 3) Click the "Upgrade" button, and select "Yes" when prompted. Recovery to stock firmware: -------------------------- The C6U bootloader has a failsafe mode that provides a web interface (running at 192.168.0.1) for reverting back to the stock TP-Link firmware. The failsafe interface is triggered from the serial console or on failed kernel boot. Unfortunately, there's no key combination that enables the failsafe mode. This gives us two options for recovery: 1) Recover using the serial console (J1 header). The recovery interface can be selected by hitting 'x' when prompted on boot. 2) Trigger the bootloader failsafe mode. A more dangerous option is force the bootloader into recovery mode by erasing the OpenWrt partition from the OpenWrt's shell - e.g "mtd erase firmware". Please be careful, since erasing the wrong partition can brick your device. MAC addresses: ------------- OEM firmware configuration: D8:07:B6:xx:xx:83 : 5G D8:07:B6:xx:xx:84 : LAN (label) D8:07:B6:xx:xx:84 : 2.4G D8:07:B6:xx:xx:85 : WAN Signed-off-by: Georgi Vlaev --- .../dts/mt7621_tplink_archer-c6u-v1.dts | 213 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 14 ++ .../mt7621/base-files/etc/board.d/01_leds | 3 +- tools/firmware-utils/src/tplink-safeloader.c | 35 +++ 4 files changed, 264 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts new file mode 100644 index 0000000000..7d38b7b096 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts @@ -0,0 +1,213 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "tplink,archer-c6u-v1", "mediatek,mt7621-soc"; + model = "TP-Link Archer C6U v1"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "green:usb"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + trigger-sources = <&ehci_port2>; + linux,default-trigger = "usbport"; + }; + + wan-orange { + label = "orange:wan"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "green:lan"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wifi5g { + label = "green:wifi5g"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wifi2g { + label = "green:wifi2g"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wan-green { + label = "green:wan"; + gpios = <&gpio 45 GPIO_ACTIVE_LOW>; + }; + }; + + reg_usb_vbus: regulator { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio 3 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <80000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x040000 0xf60000>; + }; + + config: partition@fa0000 { + label = "config"; + reg = <0xfa0000 0x010000>; + read-only; + }; + + partition@fb0000 { + label = "tplink"; + reg = <0xfb0000 0x040000>; + read-only; + }; + + radio: partition@ff0000 { + label = "radio"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + mt76@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&radio 0x0>; + mtd-mac-address = <&config 0x8>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + mt76@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&radio 0x8000>; + mtd-mac-address = <&config 0x8>; + mtd-mac-address-increment = <(-1)>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +ðernet { + pinctrl-names = "default"; + pinctrl-0 = <&rgmii1_pins &mdio_pins>; +}; + +&gmac0 { + mtd-mac-address = <&config 0x8>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "wan"; + mtd-mac-address = <&config 0x8>; + mtd-mac-address-increment = <1>; + }; + + port@1 { + status = "okay"; + label = "lan1"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan3"; + }; + + port@4 { + status = "okay"; + label = "lan4"; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart2", "uart3", "jtag", "wdt", "sdhci"; + function = "gpio"; + }; +}; + +&xhci { + vbus-supply = <®_usb_vbus>; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 6ac485688a..9ff066c8c3 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1145,6 +1145,20 @@ define Device/tplink_archer-a6-v3 endef TARGET_DEVICES += tplink_archer-a6-v3 +define Device/tplink_archer-c6u-v1 + $(Device/dsa-migration) + $(Device/tplink-safeloader) + DEVICE_MODEL := Archer C6U + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-mt7603 \ + kmod-mt7615e kmod-mt7663-firmware-ap \ + kmod-usb3 kmod-usb-ledtrig-usbport + KERNEL := $(KERNEL_DTB) | uImage lzma + TPLINK_BOARD_ID := ARCHER-C6U-V1 + IMAGE_SIZE := 15744k +endef +TARGET_DEVICES += tplink_archer-c6u-v1 + define Device/tplink_eap235-wall-v1 $(Device/dsa-migration) $(Device/tplink-safeloader) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 70cf09df14..5855b469e3 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -78,7 +78,8 @@ netgear,r6800) ucidef_set_led_netdev "lan3" "LAN3" "white:lan3" "lan3" ucidef_set_led_netdev "lan4" "LAN4" "white:lan4" "lan4" ;; -tplink,archer-a6-v3) +tplink,archer-a6-v3|\ +tplink,archer-c6u-v1) ucidef_set_led_netdev "lan" "LAN" "green:lan" "br-lan" ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan" ;; diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index ac83b686d8..878a0afbe5 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -1099,6 +1099,40 @@ static struct device_info boards[] = { .first_sysupgrade_partition = "os-image", .last_sysupgrade_partition = "file-system", }, + /** Firmware layout for the Archer C6U v1 */ + { + .id = "ARCHER-C6U-V1", + .vendor = "", + .support_list = + "SupportList:\n" + "{product_name:Archer C6U,product_ver:1.0.0,special_id:45550000}\n", + .part_trail = 0x00, + .soft_ver = "soft_ver:1.0.2\n", + + .partitions = { + {"fs-uboot", 0x00000, 0x40000}, + {"firmware", 0x40000, 0xf60000}, + {"default-mac", 0xfa0000, 0x00200}, + {"pin", 0xfa0200, 0x00100}, + {"device-id", 0xfa0300, 0x00100}, + {"product-info", 0xfa0400, 0x0fc00}, + {"default-config", 0xfb0000, 0x08000}, + {"ap-def-config", 0xfb8000, 0x08000}, + {"user-config", 0xfc0000, 0x0c000}, + {"certificate", 0xfcc000, 0x04000}, + {"ap-config", 0xfd0000, 0x08000}, + {"router-config", 0xfd8000, 0x08000}, + {"partition-table", 0xfe0000, 0x00800}, + {"soft-version", 0xfe0800, 0x00100}, + {"support-list", 0xfe0900, 0x00200}, + {"profile", 0xfe0b00, 0x03000}, + {"extra-para", 0xfe3b00, 0x00100}, + {"radio", 0xff0000, 0x10000}, + {NULL, 0, 0} + }, + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "file-system", + }, /** Firmware layout for the C60v1 */ { .id = "ARCHER-C60-V1", @@ -2872,6 +2906,7 @@ static void build_image(const char *output, strcasecmp(info->id, "ARCHER-C59-V2") == 0 || strcasecmp(info->id, "ARCHER-C60-V2") == 0 || strcasecmp(info->id, "ARCHER-C60-V3") == 0 || + strcasecmp(info->id, "ARCHER-C6U-V1") == 0 || strcasecmp(info->id, "TLWR1043NV5") == 0) { const uint8_t extra_para[2] = {0x01, 0x00}; parts[5] = make_extra_para(info, extra_para, From 3501db9b9b4a71ae52c539b46af817783c327866 Mon Sep 17 00:00:00 2001 From: "Leon M. George" Date: Thu, 24 Dec 2020 11:32:47 +0100 Subject: [PATCH 23/29] ramips: add support for cudy WR2100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Specifications SoC: MT7621 CPU: 880 MHz Flash: 16 MiB RAM: 128 MiB WLAN: 2.4 GHz b/g/n, 5 GHz a/n/ac MT7603E / MT7615E Ethernet: 5x Gbit ports Installation There are two known options: 1) The Luci-based UI. 2) Press and hold the reset button during power up. The router will request 'recovery.bin' from a TFTP server at 192.168.1.88. Both options require a signed firmware binary. The openwrt image supplied by cudy is signed and can be used to install unsigned images. R4 & R5 need to be shorted (0-100Ω) for the UART to work. Signed-off-by: Leon M. George [remove non-required switch-port node - remove trgmii phy-mode] Signed-off-by: David Bauer --- .../linux/ramips/dts/mt7621_cudy_wr2100.dts | 201 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 10 + .../mt7621/base-files/etc/board.d/01_leds | 7 + 3 files changed, 218 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_cudy_wr2100.dts diff --git a/target/linux/ramips/dts/mt7621_cudy_wr2100.dts b/target/linux/ramips/dts/mt7621_cudy_wr2100.dts new file mode 100644 index 0000000000..692c94da55 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_cudy_wr2100.dts @@ -0,0 +1,201 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "cudy,wr2100", "mediatek,mt7621-soc"; + model = "Cudy WR2100"; + + aliases { + led-boot = &led_internet_blue; + led-failsafe = &led_internet_blue; + led-running = &led_internet_blue; + led-upgrade = &led_internet_blue; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_internet_blue: internet_blue { + label = "blue:internet"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + internet_red { + label = "red:internet"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "green:wan"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + lan1 { + label = "green:lan1"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "green:lan2"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "green:lan3"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + lan4 { + label = "green:lan4"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&gmac0 { + mtd-mac-address = <&bdinfo 0xde00>; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi@1,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xf80000>; + }; + + partition@fd0000 { + label = "debug"; + reg = <0xfd0000 0x10000>; + read-only; + }; + + partition@fe0000 { + label = "backup"; + reg = <0xfe0000 0x10000>; + read-only; + }; + + bdinfo: partition@ff0000 { + label = "bdinfo"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "jtag", "uart2", "uart3", "wdt"; + function = "gpio"; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan1"; + }; + + port@1 { + status = "okay"; + label = "lan2"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + + port@3 { + status = "okay"; + label = "lan4"; + }; + + port@4 { + status = "okay"; + label = "wan"; + + mtd-mac-address = <&bdinfo 0xde00>; + mtd-mac-address-increment = <1>; + }; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 9ff066c8c3..1ae49cb96e 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -240,6 +240,16 @@ define Device/cudy_wr1300 endef TARGET_DEVICES += cudy_wr1300 +define Device/cudy_wr2100 + $(Device/dsa-migration) + DEVICE_VENDOR := Cudy + DEVICE_MODEL := WR2100 + IMAGE_SIZE := 15872k + UIMAGE_NAME := R11 + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware +endef +TARGET_DEVICES += cudy_wr2100 + define Device/dlink_dir-8xx-a1 $(Device/dsa-migration) IMAGE_SIZE := 16000k diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 5855b469e3..427983e44b 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -11,6 +11,13 @@ asus,rt-n56u-b1) ucidef_set_led_netdev "lan" "LAN link" "blue:lan" "br-lan" ucidef_set_led_netdev "wan" "WAN link" "blue:wan" "wan" ;; +cudy,wr2100) + ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "lan1" + ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "lan2" + ucidef_set_led_netdev "lan3" "lan3" "green:lan3" "lan3" + ucidef_set_led_netdev "lan4" "lan4" "green:lan4" "lan4" + ucidef_set_led_netdev "wan" "wan" "green:wan" "wan" + ;; d-team,newifi-d2) ucidef_set_led_netdev "internet" "internet" "amber:internet" "wan" ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "blue:wlan2g" "wlan0" From 57cb387cfeee2a07902a2f1383ca471ef47265f3 Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Sun, 16 May 2021 20:10:05 +0800 Subject: [PATCH 24/29] ramips: add support for JCG Q20 JCG Q20 is an AX 1800M router. Hardware specs: SoC: MediaTek MT7621AT Flash: Winbond W29N01HV 128 MiB RAM: Winbond W632GU6NB-11 256 MiB WiFi: MT7915 2.4/5 GHz 2T2R Ethernet: 10/100/1000 Mbps x3 LED: Status (red / blue) Button: Reset, WPS Power: DC 12V,1A Flash instructions: Upload factory.bin in stock firmware's upgrade page, do not preserve settings. MAC addresses map: 0x00004 *:3e wlan2g/wlan5g 0x3fff4 *:3c lan/label 0x3fffa *:3c wan Signed-off-by: Chukun Pan --- package/boot/uboot-envtools/files/ramips | 3 + target/linux/ramips/dts/mt7621_jcg_q20.dts | 175 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 17 ++ .../mt7621/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 4 + .../mt7621/base-files/lib/upgrade/platform.sh | 1 + 6 files changed, 201 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_jcg_q20.dts diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index bce2e5f0fb..ee2d95115c 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -43,6 +43,9 @@ ravpower,rp-wd03) [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000" ;; +jcg,q20) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" + ;; linksys,ea7300-v1|\ linksys,ea7300-v2|\ linksys,ea7500-v2|\ diff --git a/target/linux/ramips/dts/mt7621_jcg_q20.dts b/target/linux/ramips/dts/mt7621_jcg_q20.dts new file mode 100644 index 0000000000..f0e829393c --- /dev/null +++ b/target/linux/ramips/dts/mt7621_jcg_q20.dts @@ -0,0 +1,175 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "jcg,q20", "mediatek,mt7621-soc"; + model = "JCG Q20"; + + aliases { + led-boot = &led_status_red; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_blue; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_status_red: status_red { + label = "red:status"; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + }; + + led_status_blue: status_blue { + label = "blue:status"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + ubi-concat { + compatible = "mtd-concat"; + devices = <&ubiconcat0 &ubiconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ubi"; + reg = <0x0 0x5900000>; + }; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Bootloader"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "Config"; + reg = <0x80000 0x80000>; + }; + + factory: partition@100000 { + label = "Factory"; + reg = <0x100000 0x80000>; + read-only; + }; + + partition@180000 { + label = "kernel"; + reg = <0x180000 0x400000>; + }; + + ubiconcat0: partition@580000 { + label = "ubiconcat0"; + reg = <0x580000 0x1c00000>; + }; + + partition@2180000 { + label = "firmware_backup"; + reg = <0x2180000 0x2000000>; + }; + + partition@4180000 { + label = "rootfs_data_back"; + reg = <0x4180000 0x80000>; + read-only; + }; + + partition@4200000 { + label = "nvram_config"; + reg = <0x4200000 0x80000>; + read-only; + }; + + ubiconcat1: partition@4280000 { + label = "ubiconcat1"; + reg = <0x4280000 0x3d00000>; + }; + + /* + * last 512 KiB are for the bad block table + */ + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + }; +}; + +&gmac0 { + mtd-mac-address = <&factory 0x3fff4>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "wan"; + mtd-mac-address = <&factory 0x3fffa>; + }; + + port@1 { + status = "okay"; + label = "lan1"; + }; + + port@4 { + status = "okay"; + label = "lan2"; + }; + }; +}; + +&state_default { + gpio { + groups = "jtag", "wdt"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 1ae49cb96e..20433f783d 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -720,6 +720,23 @@ define Device/jcg_jhr-ac876m endef TARGET_DEVICES += jcg_jhr-ac876m +define Device/jcg_q20 + $(Device/dsa-migration) + BLOCKSIZE := 128k + PAGESIZE := 2048 + UBINIZE_OPTS := -E 5 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 91136k + IMAGES += factory.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ + check-size + DEVICE_VENDOR := JCG + DEVICE_MODEL := Q20 + DEVICE_PACKAGES := kmod-mt7915e uboot-envtools +endef +TARGET_DEVICES += jcg_q20 + define Device/jcg_y2 $(Device/dsa-migration) $(Device/uimage-lzma-loader) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index cde3cba9bc..9c946fa7f7 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -14,6 +14,7 @@ ramips_setup_interfaces() ;; asiarf,ap7621-nv1|\ glinet,gl-mt1300|\ + jcg,q20|\ lenovo,newifi-d1|\ mikrotik,routerboard-m33g|\ xiaomi,mi-router-3g|\ diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index e7f778aaf8..427bde4e38 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -14,6 +14,10 @@ case "$board" in [ "$PHYNBR" = "1" ] && \ macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1 > /sys${DEVPATH}/macaddress ;; + jcg,q20) + [ "$PHYNBR" = "1" ] && \ + macaddr_setbit_la "$(mtd_get_mac_binary Factory 0x4)" > /sys${DEVPATH}/macaddress + ;; linksys,ea7300-v1|\ linksys,ea7300-v2|\ linksys,ea7500-v2) diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index d30bc3db2e..98e429fdbf 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -49,6 +49,7 @@ platform_do_upgrade() { dlink,dir-2640-a1|\ dlink,dir-2660-a1|\ hiwifi,hc5962|\ + jcg,q20|\ linksys,ea7300-v1|\ linksys,ea7300-v2|\ linksys,ea7500-v2|\ From 3e9318f3c0be1ae14d9d4eb705b02e7441d5d26e Mon Sep 17 00:00:00 2001 From: Evgeny Kolesnikov Date: Tue, 25 May 2021 16:38:33 +0200 Subject: [PATCH 25/29] kernel: fix AutoLoad parameter for uleds module The name of the module is 'uleds', not 'leds-uleds'. Signed-off-by: Evgeny Kolesnikov [improve commit title] Signed-off-by: David Bauer --- package/kernel/linux/modules/leds.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/leds.mk b/package/kernel/linux/modules/leds.mk index 301d314b1d..0ef0aee3fb 100644 --- a/package/kernel/linux/modules/leds.mk +++ b/package/kernel/linux/modules/leds.mk @@ -151,7 +151,7 @@ define KernelPackage/leds-uleds TITLE:=Userspace LEDs KCONFIG:=CONFIG_LEDS_USER FILES:=$(LINUX_DIR)/drivers/leds/uleds.ko - AUTOLOAD:=$(call AutoLoad,60,leds-uleds,1) + AUTOLOAD:=$(call AutoLoad,60,uleds,1) endef define KernelPackage/leds-uleds/description From 862bc9f59779afe06d7279e2534843dbcccd9c2c Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 26 May 2021 11:37:42 +0200 Subject: [PATCH 26/29] ath79: add missing v5.4 SPI chipselect patch The patch was not applied to the v5.4 target, thus breaking Kernel 5.4 on devices with multiple flash chips attache to the SPI bus. Fixes commit bd54e739541b ("ath79: set number of chipselect lines") Signed-off-by: David Bauer --- ...ath79-set-number-of-chipselect-lines.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 target/linux/ath79/patches-5.4/412-spi-ath79-set-number-of-chipselect-lines.patch diff --git a/target/linux/ath79/patches-5.4/412-spi-ath79-set-number-of-chipselect-lines.patch b/target/linux/ath79/patches-5.4/412-spi-ath79-set-number-of-chipselect-lines.patch new file mode 100644 index 0000000000..614bcbcded --- /dev/null +++ b/target/linux/ath79/patches-5.4/412-spi-ath79-set-number-of-chipselect-lines.patch @@ -0,0 +1,26 @@ +From e2e9f6d9f9bd7449ff113c157b639ce1a24b9d3f Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Sat, 24 Apr 2021 16:14:48 +0200 +Subject: [PATCH 2/2] spi: ath79: set number of chipselect lines + +All chipsets from AR7100 up to QCA9563 have three dedicated chipselect +lines for the integrated SPI controller. Remove the number of +chipselects from the platform data, as there is no need to manually set +this to a different value. + +Signed-off-by: David Bauer +--- + drivers/spi/spi-ath79.c | 2 +- + include/linux/platform_data/spi-ath79.h | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/spi/spi-ath79.c ++++ b/drivers/spi/spi-ath79.c +@@ -187,6 +187,7 @@ static int ath79_spi_probe(struct platfo + master->use_gpio_descriptors = true; + master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 32); + master->flags = SPI_MASTER_GPIO_SS; ++ master->num_chipselect = 3; + + sp->bitbang.master = master; + sp->bitbang.chipselect = ath79_spi_chipselect; From 553cc47ec75ee15ff51fde714a75403450bac730 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 26 May 2021 22:23:35 +0200 Subject: [PATCH 27/29] hostapd: ACS: fix channel 100 frequency Channel 100 is a valid channel to choose for 80MHz operation. However, it's assigned to 5500 MHz, not 5550MHz. In fact, there is no channel assigned to this frequency. Fix this obbvious typo to allow ACS to select channel 100 for 80 MHz operation again. Signed-off-by: David Bauer --- package/network/services/hostapd/Makefile | 2 +- .../720-ACS-fix-channel-100-frequency.patch | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 package/network/services/hostapd/patches/720-ACS-fix-channel-100-frequency.patch diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index ca6cc026c1..05a35d3751 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=33 +PKG_RELEASE:=34 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/hostapd/patches/720-ACS-fix-channel-100-frequency.patch b/package/network/services/hostapd/patches/720-ACS-fix-channel-100-frequency.patch new file mode 100644 index 0000000000..3ef19e5298 --- /dev/null +++ b/package/network/services/hostapd/patches/720-ACS-fix-channel-100-frequency.patch @@ -0,0 +1,30 @@ +From 5a24286ed6315e1fef755ca1970792554f59b1fc Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Wed, 26 May 2021 22:15:35 +0200 +Subject: [PATCH] ACS: fix channel 100 frequency + +Channel 100 is a valid channel to choose for 80MHz operation. However, +it's assigned to 5500 MHz, not 5550MHz. In fact, there is no channel +assigned to this frequency. + +Fix this obbvious typo to allow ACS to select channel 100 for 80 MHz +operation again. + +Fixes commit bef5eee4f7b2 ("Convert channel to frequency based selection for AP mode ACS") + +Signed-off-by: David Bauer +--- + src/ap/acs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/src/ap/acs.c ++++ b/src/ap/acs.c +@@ -386,7 +386,7 @@ static int acs_usable_bw40_chan(const st + + static int acs_usable_bw80_chan(const struct hostapd_channel_data *chan) + { +- const int allowed[] = { 5180, 5260, 5550, 5580, 5660, 5745, 5955, 6035, ++ const int allowed[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955, 6035, + 6115, 6195, 6275, 6355, 6435, 6515, 6595, 6675, + 6755, 6835, 6915, 6995 }; + unsigned int i; From 4b9a67362d70c544b85078b8d5c661f43f7472d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 24 May 2021 16:45:06 +0200 Subject: [PATCH 28/29] base-files: generate network config with "device" options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace "ifname" with "device" as netifd has been recently patches to used the later one. It's more clear and accurate. Signed-off-by: Rafał Miłecki --- package/base-files/files/bin/config_generate | 26 +++++++++---------- .../files/lib/functions/uci-defaults.sh | 10 +++---- .../gemini/base-files/etc/board.d/02_network | 6 ++--- .../realtek/base-files/etc/board.d/02_network | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index be688a4ba3..d895090309 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -40,7 +40,7 @@ generate_static_network() { uci -q batch <<-EOF delete network.loopback set network.loopback='interface' - set network.loopback.ifname='lo' + set network.loopback.device='lo' set network.loopback.proto='static' set network.loopback.ipaddr='127.0.0.1' set network.loopback.netmask='255.0.0.0' @@ -91,22 +91,22 @@ generate_static_network() { addr_offset=2 generate_network() { - local ports ifname macaddr protocol type ipaddr netmask vlan + local ports device macaddr protocol type ipaddr netmask vlan local bridge=$2 json_select network json_select "$1" + json_get_vars device macaddr protocol ipaddr netmask vlan json_get_values ports ports - json_get_vars ifname macaddr protocol ipaddr netmask vlan json_select .. json_select .. - [ -n "$ifname" -o -n "$ports" ] || return + [ -n "$device" -o -n "$ports" ] || return # Force bridge for "lan" as it may have other devices (e.g. wireless) # bridged [ "$1" = "lan" -a -z "$ports" ] && { - ports="$ifname" + ports="$device" } [ -n "$ports" -a -z "$bridge" ] && { @@ -117,19 +117,19 @@ generate_network() { set network.@device[-1].macaddr='$macaddr' EOF for port in $ports; do uci add_list network.@device[-1].ports="$port"; done - ifname=br-$1 + device=br-$1 type= macaddr="" } [ -n "$bridge" ] && { - [ -z "$ports" ] && ports="$ifname" + [ -z "$ports" ] && ports="$device" if [ -z "$vlan" ]; then bridge_vlan_id=$((bridge_vlan_id + 1)) vlan=$bridge_vlan_id fi generate_bridge_vlan $1 $bridge "$ports" $vlan - ifname=$bridge.$vlan + device=$bridge.$vlan type="" } @@ -137,12 +137,12 @@ generate_network() { delete network.$1 set network.$1='interface' set network.$1.type='$type' - set network.$1.ifname='$ifname' + set network.$1.device='$device' set network.$1.proto='none' EOF if [ -n "$macaddr" ]; then - for name in $ifname; do + for name in $device; do uci -q batch <<-EOF delete network.$1_${name/./_}_dev set network.$1_${name/./_}_dev='device' @@ -172,14 +172,14 @@ generate_network() { dhcp) # fixup IPv6 slave interface if parent is a bridge - [ "$type" = "bridge" ] && ifname="br-$1" + [ "$type" = "bridge" ] && device="br-$1" uci set network.$1.proto='dhcp' [ -e /proc/sys/net/ipv6 ] && { uci -q batch <<-EOF delete network.${1}6 set network.${1}6='interface' - set network.${1}6.ifname='$ifname' + set network.${1}6.device='$device' set network.${1}6.proto='dhcpv6' EOF } @@ -196,7 +196,7 @@ generate_network() { set network.$1.ipv6='1' delete network.${1}6 set network.${1}6='interface' - set network.${1}6.ifname='@${1}' + set network.${1}6.device='@${1}' set network.${1}6.proto='dhcpv6' EOF } diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index 407a9c710f..02882f43ca 100644 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -39,7 +39,7 @@ ucidef_set_interface() { [ -n "$opt" -a -n "$val" ] || break - [ "$opt" = "ifname" -a "$val" != "${val/ //}" ] && { + [ "$opt" = "device" -a "$val" != "${val/ //}" ] && { json_select_array "ports" for e in $val; do json_add_string "" "$e"; done json_close_array @@ -79,11 +79,11 @@ ucidef_set_compat_version() { } ucidef_set_interface_lan() { - ucidef_set_interface "lan" ifname "$1" protocol "${2:-static}" + ucidef_set_interface "lan" device "$1" protocol "${2:-static}" } ucidef_set_interface_wan() { - ucidef_set_interface "wan" ifname "$1" protocol "${2:-dhcp}" + ucidef_set_interface "wan" device "$1" protocol "${2:-dhcp}" } ucidef_set_interfaces_lan_wan() { @@ -201,14 +201,14 @@ _ucidef_finish_switch_roles() { json_select_object "$role" # attach previous interfaces (for multi-switch devices) - json_get_var devices ifname + json_get_var devices device if ! list_contains devices "$device"; then devices="${devices:+$devices }$device" fi json_select .. json_select .. - ucidef_set_interface "$role" ifname "$devices" + ucidef_set_interface "$role" device "$devices" done } diff --git a/target/linux/gemini/base-files/etc/board.d/02_network b/target/linux/gemini/base-files/etc/board.d/02_network index 58eb9ed40c..d6ee5cadfe 100644 --- a/target/linux/gemini/base-files/etc/board.d/02_network +++ b/target/linux/gemini/base-files/etc/board.d/02_network @@ -6,17 +6,17 @@ board_config_update case "$(board_name)" in dlink,dir-685) # These are all connected to eth0 thru RTL8366RB - ucidef_set_interface "eth" ifname "eth0" protocol "none" + ucidef_set_interface "eth" device "eth0" protocol "none" ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3" "wan" ;; itian,sq201) # These are all connected to eth1 thru VSC7395 - ucidef_set_interface "eth" ifname "eth1" protocol "none" + ucidef_set_interface "eth" device "eth1" protocol "none" ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "eth0" ;; storlink,gemini324) # These are all connected to eth1 thru VSC7385 - ucidef_set_interface "eth" ifname "eth1" protocol "none" + ucidef_set_interface "eth" device "eth1" protocol "none" ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "eth0" ;; esac diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index c1dd230bb8..6568017b52 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -23,7 +23,7 @@ for lan in /sys/class/net/lan*; do done ucidef_set_bridge_device switch ucidef_set_interface_wan "$lan_list" -ucidef_set_interface "lan" ifname "lan1:t" protocol "static" vlan 100 +ucidef_set_interface "lan" device "lan1:t" protocol "static" vlan 100 lan_mac="" wan_mac="" From 962d530dea44bb7df79f088643ac35f7275c7ac7 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 27 May 2021 12:16:52 +0200 Subject: [PATCH 29/29] hostapd: support verbose build using V=sc Signed-off-by: Felix Fietkau --- package/network/services/hostapd/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 05a35d3751..e0e55ab99e 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -524,6 +524,7 @@ define Build/RunMake LIBS_c="$(TARGET_LDFLAGS_C)" \ AR="$(TARGET_CROSS)gcc-ar" \ BCHECK= \ + $(if $(findstring s,$(OPENWRT_VERBOSE)),V=1) \ $(2) endef