[rdkb][common][bsp][Refactor and sync wifi from openwrt]

[Description]
ced8594f [MAC80211][WiFi6][Misc][Fix the MT76 WiFi6 Makefile]
7221999e [MAC80211][WiFi7][Misc][Correct the MAC80211 WiFi7 Makefile.]
9d87794a [MAC80211][WiFi7][Misc][Correct the MT76 WiFi7 Makefile.]
ff24e1b2 [openwrt-24][Mac80211][Fix patch conflict with upstream openwrt]
3a6c13e2 [mac80211][misc][fix patch fail due to openwrt update]
05763faa [MAC80211][WiFi7][misc][fix patch failed of wifi-scripts]
f34fd014 [mac80211][misc][fix patch fail due to openwrt update]
f6796660 [openwrt-24][Release][Fix build fail of Wi-Fi7 MT76]
7076d96c [MAC80211][WiFi7][Misc][Fix release build fail because of mt76 version upgradation]
1f748b17 [mac80211][misc][fix patch fail due to openwrt update]
95ba6722 [mac80211][misc][fix patch fail due to openwrt update]
17680d7f [MAC80211][WiFi7][misc][Rename eeprom of eFEM variants]
b97cefa1 [MAC80211][WiFi7][app][Add Griffin support for atenl/iwpriv]
6de718a4 [MAC80211][WiFi7][misc][fix wifi-scripts patch failed]
9f1ace86 [MAC80211][WiFi7][misc][fix hostapd Makefile patch]
e4d0d28e [MAC80211][Misc][Add MT7990 Firmware OpenWrt config]
f3a8a8f7 [MAC80211][Release][Fix build fail of Wi-Fi6 MT76]
dabe8eae [openwrt-24][common][bsp][Fix line ending]
6d438a9d [openwrt-24][common][bsp][Use zstd to compress rootfs debug symbols for unified autobuild]
c268e47e [openwrt][common][bsp][Change SMC ID of wdt nonrst reg of reset-boot-count to 0x570]
c6819fbc [openwrt-24][Release][Update release note for Filogic 880 alpha release]
6897b4de [openwrt-24][common][bsp][Adjust unified autobuild for internal build detection]
fb9b9762 [MAC80211][WiFi6/7][app][Add ext eeprom write back cmd support]
d42b42a3 [openwrt-24][common][bsp][Add kernel6.6 Filogic880 BE19000/BE14000]
3806f047 [MAC80211][misc][Add Bpi-R4 support]
ddbda753 [MAC80211][WiFi7][Misc][Fix build fail because of mt76 version upgradation]
90959b08 [MAC80211][WiFi6][mt76][Rebase mt76 pathes]
728a3362 [MAC80211][WiFi6][mt76][Refactor Qos Map]
b46277b5 [MAC80211][WiFi6][mt76][Fix add ba issue on tid not equal to zero]
c084ee8b [MAC80211][WiFi7][mt76][split mt76 Makefile patch]
bbaec094 [MAC80211][Release][Update Filogic 830/820/630 firmware]
5ce2eece [MAC80211][wifi6][MT76][Fix build fail]
5ac1121f [MAC80211][wifi6][MT76][Fix mt76 version to 2024-07-13]
485f92b1 [MAC80211][WiFi7][misc][synchronize PP bitmap when association]
84db8818 [MAC80211][WiFi6/7][app][Add ATETXNSS in iwpriv wrapper]
cc5a4605 [MAC80211][WiFi7][mt76][fix patch failed of Makefile]

[Release-log]

Change-Id: I06704c04c4b5571af4ffd189d636c1fc9f0567fd
diff --git a/recipes-wifi/hostapd/files/hostapd.uc b/recipes-wifi/hostapd/files/hostapd.uc
index 19b1490..6d56655 100644
--- a/recipes-wifi/hostapd/files/hostapd.uc
+++ b/recipes-wifi/hostapd/files/hostapd.uc
@@ -22,6 +22,14 @@
 	eap_sim_db: true,
 };
 
+hostapd.data.iface_fields = {
+	ft_iface: true,
+	upnp_iface: true,
+	snoop_iface: true,
+	bridge: true,
+	iapp_interface: true,
+};
+
 function iface_remove(cfg)
 {
 	if (!cfg || !cfg.bss || !cfg.bss[0] || !cfg.bss[0].ifname)
@@ -243,6 +251,16 @@
 	pending.next();
 }
 
+function iface_macaddr_init(phydev, config, macaddr_list)
+{
+	let macaddr_data = {
+		num_global: config.num_global_macaddr ?? 1,
+		mbssid: config.mbssid ?? 0,
+	};
+
+	return phydev.macaddr_init(macaddr_list, macaddr_data);
+}
+
 function iface_restart(phydev, config, old_config)
 {
 	let phy = phydev.name;
@@ -260,7 +278,7 @@
 		return;
 	}
 
-	phydev.macaddr_init(iface_config_macaddr_list(config));
+	iface_macaddr_init(phydev, config, iface_config_macaddr_list(config));
 	for (let i = 0; i < length(config.bss); i++) {
 		let bss = config.bss[i];
 		if (bss.default_macaddr)
@@ -328,9 +346,24 @@
 	return new_cfg;
 }
 
+function bss_ifindex_list(config)
+{
+	config = filter(config, (line) => !!hostapd.data.iface_fields[split(line, "=")[0]]);
+
+	return join(",", map(config, (line) => {
+		try {
+			let file = "/sys/class/net/" + split(line, "=")[1] + "/ifindex";
+			let val = trim(readfile(file));
+			return val;
+		} catch (e) {
+			return "";
+		}
+	}));
+}
+
 function bss_config_hash(config)
 {
-	return hostapd.sha1(remove_file_fields(config) + "");
+	return hostapd.sha1(remove_file_fields(config) + bss_ifindex_list(config));
 }
 
 function bss_find_existing(config, prev_config, prev_hash)
@@ -514,11 +547,7 @@
 	}
 
 	// Step 6: assign BSSID for newly created interfaces
-	let macaddr_data = {
-		num_global: config.num_global_macaddr ?? 1,
-		mbssid: config.mbssid ?? 0,
-	};
-	macaddr_list = phydev.macaddr_init(macaddr_list, macaddr_data);
+	macaddr_list = iface_macaddr_init(phydev, config, macaddr_list);
 	for (let i = 0; i < length(config.bss); i++) {
 		if (bss_list[i])
 			continue;
@@ -689,7 +718,7 @@
 
 		if (val[0] == "#num_global_macaddr" ||
 		    val[0] == "mbssid")
-			config[val[0]] = int(val[1]);
+			config[substr(val[0], 1)] = int(val[1]);
 
 		if (val[0] == "#single_hw")
 			config["single_hw"] = int(val[1]);
@@ -940,13 +969,13 @@
 		hostapd.udebug_set(null);
 		hostapd.ubus.disconnect();
 	},
-	bss_add: function(name, obj) {
+	bss_add: function(phy, name, obj) {
 		bss_event("add", name);
 	},
-	bss_reload: function(name, obj, reconf) {
+	bss_reload: function(phy, name, obj, reconf) {
 		bss_event("reload", name, { reconf: reconf != 0 });
 	},
-	bss_remove: function(name, obj) {
+	bss_remove: function(phy, name, obj) {
 		bss_event("remove", name);
 	}
 };
diff --git a/recipes-wifi/hostapd/files/openwrt_script/hostapd.sh b/recipes-wifi/hostapd/files/openwrt_script/hostapd.sh
index 40266db..9ffb465 100644
--- a/recipes-wifi/hostapd/files/openwrt_script/hostapd.sh
+++ b/recipes-wifi/hostapd/files/openwrt_script/hostapd.sh
@@ -120,6 +120,8 @@
 	config_add_int rssi_reject_assoc_rssi
 	config_add_int rssi_ignore_probe_request
 	config_add_int maxassoc
+	config_add_int reg_power_type
+	config_add_boolean stationary_ap
 
 	config_add_string acs_chan_bias
 	config_add_array hostapd_options
@@ -139,7 +141,7 @@
 	json_get_vars country country3 country_ie beacon_int:100 doth require_mode legacy_rates \
 		acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density \
 		rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc \
-		mbssid:0
+		mbssid:0 band reg_power_type stationary_ap
 
 	hostapd_set_log_options base_cfg
 
@@ -242,6 +244,14 @@
 	[ -n "$maxassoc" ] && append base_cfg "iface_max_num_sta=$maxassoc" "$N"
 	[ "$mbssid" -gt 0 ] && [ "$mbssid" -le 2 ] && append base_cfg "mbssid=$mbssid" "$N"
 
+	[ "$band" = "6g" ] && {
+		set_default reg_power_type 0
+		append base_cfg "he_6ghz_reg_pwr_type=$reg_power_type" "$N"
+	}
+
+	set_default stationary_ap 1
+	append base_cfg "stationary_ap=$stationary_ap" "$N"
+
 	json_get_values opts hostapd_options
 	for val in $opts; do
 		append base_cfg "$val" "$N"
@@ -376,8 +386,8 @@
 	config_add_array radius_auth_req_attr
 	config_add_array radius_acct_req_attr
 
-	config_add_int eap_server
-	config_add_string eap_user_file ca_cert server_cert private_key private_key_passwd server_id
+	config_add_int eap_server radius_server_auth_port
+	config_add_string eap_user_file ca_cert server_cert private_key private_key_passwd server_id radius_server_clients
 
 	config_add_boolean fils
 	config_add_string fils_dhcp
@@ -437,7 +447,7 @@
 	if [ -z "$iw_anqp_3gpp_cell_net_conf" ]; then
 		iw_anqp_3gpp_cell_net_conf="$1"
 	else
-		iw_anqp_3gpp_cell_net_conf="$iw_anqp_3gpp_cell_net_conf:$1"
+		iw_anqp_3gpp_cell_net_conf="$iw_anqp_3gpp_cell_net_conf;$1"
 	fi
 }
 
@@ -571,7 +581,7 @@
 		multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key skip_inactivity_poll \
 		ppsk airtime_bss_weight airtime_bss_limit airtime_sta_weight \
 		multicast_to_unicast_all proxy_arp per_sta_vif \
-		eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id \
+		eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id radius_server_clients radius_server_auth_port \
 		vendor_elements fils ocv apup
 
 	set_default fils 0
@@ -1151,6 +1161,8 @@
 		[ -n "$private_key" ] && append bss_conf "private_key=$private_key" "$N"
 		[ -n "$private_key_passwd" ] && append bss_conf "private_key_passwd=$private_key_passwd" "$N"
 		[ -n "$server_id" ] && append bss_conf "server_id=$server_id" "$N"
+		[ -n "$radius_server_clients" ] && append bss_conf "radius_server_clients=$radius_server_clients" "$N"
+		[ -n "$radius_server_auth_port" ] && append bss_conf "radius_server_auth_port=$radius_server_auth_port" "$N"
 	fi
 
 	set_default multicast_to_unicast_all 0
diff --git a/recipes-wifi/hostapd/files/src-2.10.3/src/ap/ubus.c b/recipes-wifi/hostapd/files/src-2.10.3/src/ap/ubus.c
index 8689494..2256720 100644
--- a/recipes-wifi/hostapd/files/src-2.10.3/src/ap/ubus.c
+++ b/recipes-wifi/hostapd/files/src-2.10.3/src/ap/ubus.c
@@ -1783,6 +1783,7 @@
 
 	blob_buf_init(&b, 0);
 	blobmsg_add_macaddr(&b, "address", addr);
+	blobmsg_add_string(&b, "ifname", hapd->conf->iface);
 	if (req->mgmt_frame)
 		blobmsg_add_macaddr(&b, "target", req->mgmt_frame->da);
 	if (req->ssi_signal)
@@ -1857,6 +1858,7 @@
 
 	blob_buf_init(&b, 0);
 	blobmsg_add_macaddr(&b, "address", addr);
+	blobmsg_add_string(&b, "ifname", hapd->conf->iface);
 
 	ubus_notify(ctx, &hapd->ubus.obj, type, b.head, -1);
 }
@@ -1869,6 +1871,9 @@
 
 	blob_buf_init(&b, 0);
 	blobmsg_add_macaddr(&b, "address", sta->addr);
+	if (sta->vlan_id)
+		blobmsg_add_u32(&b, "vlan", sta->vlan_id);
+	blobmsg_add_string(&b, "ifname", hapd->conf->iface);
 	if (auth_alg)
 		blobmsg_add_string(&b, "auth-alg", auth_alg);
 
@@ -2004,3 +2009,31 @@
 	return ureq.resp;
 #endif
 }
+
+#ifdef CONFIG_APUP
+void hostapd_ubus_notify_apup_newpeer(
+	struct hostapd_data *hapd, const u8 *addr, const char *ifname)
+{
+	if (!hapd->ubus.obj.has_subscribers)
+		return;
+
+	blob_buf_init(&b, 0);
+	blobmsg_add_macaddr(&b, "address", addr);
+	blobmsg_add_string(&b, "ifname", ifname);
+
+	ubus_notify(ctx, &hapd->ubus.obj, "apup-newpeer", b.head, -1);
+}
+#endif // def CONFIG_APUP
+
+void hostapd_ubus_notify_csa(struct hostapd_data *hapd, int freq)
+{
+	if (!hapd->ubus.obj.has_subscribers)
+		return;
+
+	blob_buf_init(&b, 0);
+	blobmsg_add_string(&b, "ifname", hapd->conf->iface);
+	blobmsg_add_u32(&b, "freq", freq);
+	blobmsg_printf(&b, "bssid", MACSTR, MAC2STR(hapd->conf->bssid));
+
+	ubus_notify(ctx, &hapd->ubus.obj, "channel-switch", b.head, -1);
+}
diff --git a/recipes-wifi/hostapd/files/src-2.10.3/src/ap/ubus.h b/recipes-wifi/hostapd/files/src-2.10.3/src/ap/ubus.h
index 22767d6..055a18c 100644
--- a/recipes-wifi/hostapd/files/src-2.10.3/src/ap/ubus.h
+++ b/recipes-wifi/hostapd/files/src-2.10.3/src/ap/ubus.h
@@ -8,8 +8,6 @@
 #ifndef __HOSTAPD_UBUS_H
 #define __HOSTAPD_UBUS_H
 
-#include "sta_info.h"
-
 enum hostapd_ubus_event_type {
 	HOSTAPD_UBUS_PROBE_REQ,
 	HOSTAPD_UBUS_AUTH_REQ,
@@ -70,6 +68,12 @@
 	const u8 *candidate_list, u16 candidate_list_len);
 void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta,
 				    const char *auth_alg);
+void hostapd_ubus_notify_csa(struct hostapd_data *hapd, int freq);
+
+#ifdef CONFIG_APUP
+void hostapd_ubus_notify_apup_newpeer(
+	struct hostapd_data *hapd, const u8 *addr, const char *ifname);
+#endif // def CONFIG_APUP
 
 #else
 
@@ -152,6 +156,11 @@
 {
 }
 
+static inline void
+hostapd_ubus_notify_csa(struct hostapd_data *hapd, int freq)
+{
+}
+
 #endif
 
 #endif
diff --git a/recipes-wifi/hostapd/files/src-2.10.3/src/ap/ucode.c b/recipes-wifi/hostapd/files/src-2.10.3/src/ap/ucode.c
index 68fb450..a5630d7 100644
--- a/recipes-wifi/hostapd/files/src-2.10.3/src/ap/ucode.c
+++ b/recipes-wifi/hostapd/files/src-2.10.3/src/ap/ucode.c
@@ -3,7 +3,7 @@
 #include "utils/includes.h"
 #include "utils/common.h"
 #include "utils/ucode.h"
-#include "hostapd.h"
+#include "sta_info.h"
 #include "beacon.h"
 #include "hw_features.h"
 #include "ap_drv_ops.h"
@@ -259,6 +259,7 @@
 
 	hostapd_setup_bss(hapd, hapd == iface->bss[0], true);
 	hostapd_ucode_update_interfaces();
+	hostapd_owe_update_trans(iface);
 
 done:
 	ret = 0;
@@ -379,6 +380,7 @@
 	conf->bss[idx] = NULL;
 	ret = hostapd_ucode_bss_get_uval(hapd);
 	hostapd_ucode_update_interfaces();
+	hostapd_owe_update_trans(iface);
 	goto out;
 
 deinit_ctrl:
@@ -531,10 +533,12 @@
 		return NULL;
 
 #define UPDATE_VAL(field, name)							\
-	if ((intval = ucv_int64_get(ucv_object_get(info, name, NULL))) &&	\
-		!errno && intval != conf->field) do {				\
-		conf->field = intval;						\
-		changed = true;							\
+	do {									\
+		intval = ucv_int64_get(ucv_object_get(info, name, NULL));	\
+		if (!errno && intval != conf->field) {				\
+			conf->field = intval;					\
+			changed = true;						\
+		}								\
 	} while(0)
 
 	conf = iface->conf;
@@ -607,6 +611,7 @@
 
 		ieee802_11_set_beacon(hapd);
 	}
+	hostapd_owe_update_trans(iface);
 
 	return ucv_boolean_new(true);
 }
@@ -698,6 +703,7 @@
 	hostapd_ubus_add_bss(hapd);
 
 	hostapd_ucode_update_interfaces();
+	hostapd_owe_update_trans(hapd->iface);
 out:
 	if (interfaces->ctrl_iface_init)
 		interfaces->ctrl_iface_init(hapd);
@@ -770,48 +776,52 @@
 	wpa_ucode_registry_remove(iface_registry, iface->ucode.idx);
 }
 
-void hostapd_ucode_add_bss(struct hostapd_data *hapd)
+void hostapd_ucode_bss_cb(struct hostapd_data *hapd, const char *type)
 {
 	uc_value_t *val;
 
-	if (wpa_ucode_call_prepare("bss_add"))
+	if (wpa_ucode_call_prepare(type))
 		return;
 
 	val = hostapd_ucode_bss_get_uval(hapd);
+	uc_value_push(ucv_get(ucv_string_new(hapd->iface->phy)));
 	uc_value_push(ucv_get(ucv_string_new(hapd->conf->iface)));
 	uc_value_push(ucv_get(val));
-	ucv_put(wpa_ucode_call(2));
+	ucv_put(wpa_ucode_call(3));
 	ucv_gc(vm);
 }
 
-void hostapd_ucode_reload_bss(struct hostapd_data *hapd)
+void hostapd_ucode_free_bss(struct hostapd_data *hapd)
 {
 	uc_value_t *val;
 
-	if (wpa_ucode_call_prepare("bss_reload"))
+	val = wpa_ucode_registry_remove(bss_registry, hapd->ucode.idx);
+	if (!val)
 		return;
 
-	val = hostapd_ucode_bss_get_uval(hapd);
-	uc_value_push(ucv_get(ucv_string_new(hapd->conf->iface)));
+	hapd->ucode.idx = 0;
+	if (wpa_ucode_call_prepare("bss_remove"))
+		return;
+
+	uc_value_push(ucv_string_new(hapd->conf->iface));
 	uc_value_push(ucv_get(val));
 	ucv_put(wpa_ucode_call(2));
 	ucv_gc(vm);
 }
 
-void hostapd_ucode_free_bss(struct hostapd_data *hapd)
+#ifdef CONFIG_APUP
+void hostapd_ucode_apup_newpeer(struct hostapd_data *hapd, const char *ifname)
 {
 	uc_value_t *val;
 
-	val = wpa_ucode_registry_remove(bss_registry, hapd->ucode.idx);
-	if (!val)
-		return;
-
-	hapd->ucode.idx = 0;
-	if (wpa_ucode_call_prepare("bss_remove"))
+	if (wpa_ucode_call_prepare("apup_newpeer"))
 		return;
 
-	uc_value_push(ucv_string_new(hapd->conf->iface));
+	val = hostapd_ucode_bss_get_uval(hapd);
+	uc_value_push(ucv_get(ucv_string_new(hapd->conf->iface))); // BSS ifname
 	uc_value_push(ucv_get(val));
+	uc_value_push(ucv_get(ucv_string_new(ifname))); // APuP peer ifname
 	ucv_put(wpa_ucode_call(2));
 	ucv_gc(vm);
 }
+#endif // def CONFIG_APUP
diff --git a/recipes-wifi/hostapd/files/src-2.10.3/src/ap/ucode.h b/recipes-wifi/hostapd/files/src-2.10.3/src/ap/ucode.h
index d00b787..2f7bcd6 100644
--- a/recipes-wifi/hostapd/files/src-2.10.3/src/ap/ucode.h
+++ b/recipes-wifi/hostapd/files/src-2.10.3/src/ap/ucode.h
@@ -23,9 +23,12 @@
 
 void hostapd_ucode_free(void);
 void hostapd_ucode_free_iface(struct hostapd_iface *iface);
-void hostapd_ucode_add_bss(struct hostapd_data *hapd);
 void hostapd_ucode_free_bss(struct hostapd_data *hapd);
-void hostapd_ucode_reload_bss(struct hostapd_data *hapd);
+void hostapd_ucode_bss_cb(struct hostapd_data *hapd, const char *type);
+
+#ifdef CONFIG_APUP
+void hostapd_ucode_apup_newpeer(struct hostapd_data *hapd, const char *ifname);
+#endif // def CONFIG_APUP
 
 #else
 
@@ -39,10 +42,7 @@
 static inline void hostapd_ucode_free_iface(struct hostapd_iface *iface)
 {
 }
-static inline void hostapd_ucode_reload_bss(struct hostapd_data *hapd)
-{
-}
-static inline void hostapd_ucode_add_bss(struct hostapd_data *hapd)
+static inline void hostapd_ucode_bss_cb(struct hostapd_data *hapd, const char *type)
 {
 }
 static inline void hostapd_ucode_free_bss(struct hostapd_data *hapd)
@@ -51,4 +51,19 @@
 
 #endif
 
+static inline void hostapd_ucode_create_bss(struct hostapd_data *hapd)
+{
+	hostapd_ucode_bss_cb(hapd, "bss_create");
+}
+
+static inline void hostapd_ucode_add_bss(struct hostapd_data *hapd)
+{
+	hostapd_ucode_bss_cb(hapd, "bss_add");
+}
+
+static inline void hostapd_ucode_reload_bss(struct hostapd_data *hapd)
+{
+	hostapd_ucode_bss_cb(hapd, "bss_reload");
+}
+
 #endif
diff --git a/recipes-wifi/hostapd/files/src-2.10.3/src/utils/build_features.h b/recipes-wifi/hostapd/files/src-2.10.3/src/utils/build_features.h
index 553769e..cc88315 100644
--- a/recipes-wifi/hostapd/files/src-2.10.3/src/utils/build_features.h
+++ b/recipes-wifi/hostapd/files/src-2.10.3/src/utils/build_features.h
@@ -15,6 +15,10 @@
 	if (!strcmp(feat, "11ax"))
 		return 1;
 #endif
+#ifdef CONFIG_IEEE80211BE
+	if (!strcmp(feat, "11be"))
+		return 1;
+#endif
 #ifdef CONFIG_IEEE80211R
 	if (!strcmp(feat, "11r"))
 		return 1;
diff --git a/recipes-wifi/hostapd/files/wifi-detect.uc b/recipes-wifi/hostapd/files/wifi-detect.uc
index bbaae18..8fef4f6 100644
--- a/recipes-wifi/hostapd/files/wifi-detect.uc
+++ b/recipes-wifi/hostapd/files/wifi-detect.uc
@@ -79,6 +79,9 @@
 		return;
 
 	for (let phy in phys) {
+		if (!phy)
+			continue;
+
 		let name = phy.wiphy_name;
 		let path = phy_path(name);
 		let info = {
@@ -110,6 +113,7 @@
 			if (band.vht_capa > 0)
 				band_info.vht = true;
 			let he_phy_cap = 0;
+			let eht_phy_cap = 0;
 
 			for (let ift in band.iftype_data) {
 				if (!ift.he_cap_phy)
@@ -117,9 +121,15 @@
 
 				band_info.he = true;
 				he_phy_cap |= ift.he_cap_phy[0];
+
+				/* if (!ift.eht_cap_phy) */
+				/*	continue; */
+
 				/* TODO: EHT */
 				/* FIXME: hardcode */
 				band_info.eht = true;
+				eht_phy_cap = 2;
+				/* eht_phy_cap |= ift.eht_cap_phy[0]; */
 			}
 
 			if (band_name == "6G" && band_info.eht)
@@ -149,12 +159,11 @@
 				if (band_info.vht)
 					push(modes, "VHT40")
 			}
-			if (he_phy_cap & 0x2) {
+			if (he_phy_cap & 2)
 				push(modes, "HE40");
 
-				if (band_info.eht)
-					push(modes, "EHT40");
-			}
+			if (eht_phy_cap && he_phy_cap & 2)
+				push(modes, "EHT40");
 
 			for (let freq in band.freqs) {
 				if (freq.disabled)
@@ -168,21 +177,25 @@
 
 			if (band_name == "2G")
 				continue;
+
+			if (he_phy_cap & 4)
+				push(modes, "HE40");
+			if (eht_phy_cap && he_phy_cap & 4)
+				push(modes, "EHT40");
 			if (band_info.vht)
 				push(modes, "VHT80");
-			if (he_phy_cap & 4) {
+			if (he_phy_cap & 4)
 				push(modes, "HE80");
-				if (band_info.eht)
-					push(modes, "EHT80");
-			}
+			if (eht_phy_cap && he_phy_cap & 4)
+				push(modes, "EHT80");
 			if ((band.vht_capa >> 2) & 0x3)
 				push(modes, "VHT160");
-			if (he_phy_cap & 0x18) {
+			if (he_phy_cap & 0x18)
 				push(modes, "HE160");
-				if (band_info.eht)
-					push(modes, "EHT160");
-			}
-			if (band_name == "6G" && band_info.eht)
+			if (eht_phy_cap && he_phy_cap & 0x18)
+				push(modes, "EHT160");
+
+			if (eht_phy_cap & 2)
 				push(modes, "EHT320");
 		}
 
diff --git a/recipes-wifi/hostapd/files/wpa_supplicant.uc b/recipes-wifi/hostapd/files/wpa_supplicant.uc
index 2ccb21c..c70b0b3 100644
--- a/recipes-wifi/hostapd/files/wpa_supplicant.uc
+++ b/recipes-wifi/hostapd/files/wpa_supplicant.uc
@@ -68,7 +68,7 @@
 	return { config: config };
 }
 
-function set_config(phy_name, config_list)
+function set_config(phy_name, num_global_macaddr, config_list)
 {
 	let phy = wpas.data.config[phy_name];
 
@@ -77,6 +77,8 @@
 		wpas.data.config[phy_name] = phy;
 	}
 
+	phy.num_global_macaddr = num_global_macaddr;
+
 	let values = [];
 	for (let config in config_list)
 		push(values, [ config.iface, prepare_config(config) ]);
@@ -99,7 +101,7 @@
 	}
 
 	let macaddr_list = wpas.data.macaddr_list[phy_name];
-	phydev.macaddr_init(macaddr_list);
+	phydev.macaddr_init(macaddr_list, { num_global: phy.num_global_macaddr });
 
 	for (let ifname in phy.data)
 		iface_start(phydev, phy.data[ifname]);
@@ -185,6 +187,7 @@
 	config_set: {
 		args: {
 			phy: "",
+			num_global_macaddr: 0,
 			config: [],
 			defer: true,
 		},
@@ -195,7 +198,7 @@
 			wpas.printf(`Set new config for phy ${req.args.phy}`);
 			try {
 				if (req.args.config)
-					set_config(req.args.phy, req.args.config);
+					set_config(req.args.phy, req.args.num_global_macaddr, req.args.config);
 
 				if (!req.args.defer)
 					start_pending(req.args.phy);
@@ -281,6 +284,7 @@
 		msg.ch_width = status.ch_width;
 		msg.bw320_offset = status.bw320_offset;
 		msg.band_idx = status.band_idx;
+		msg.punct_bitmap = status.punct_bitmap;
 		break;
 	default:
 		return;