[rdkb][common][bsp][Refactor and sync wifi from openwrt]
[Description]
3a2eef0b [MAC80211][Release][Update release note for Filogic 880/860 MLO Beta release]
cfbd2411 [MAC80211][Release][Filogic 880/860 MLO Beta release]
6c180e3f [MAC80211][WiFi7][misc][Add Eagle BE14000 efem default bin]
a55f34db [MAC80211][Release][Prepare for Filogic 880/860 release]
5b45ebca [MAC80211][WiFi7][hostapd][Add puncture bitmap to ucode]
95bbea73 [MAC80211][WiFi6][mt76][Add PID to only report data-frame TX rate]
b15ced26 [MAC80211][WiFi6][hostapd][Fix DFS channel selection issue]
d59133cb [MAC80211][WiFi6][mt76][Fix pse info not correct information]
3921b4b2 [MAC80211][WiFi6][mt76][Fix incomplete QoS-map setting to FW]
4e7690c7 [MAC80211][WiFi6/7][app][Change ATECHANNEL mapping cmd]
eb37af90 [MAC80211][WiFi7][app][Add support for per-packet bw & primary selection]
0ea82adf [MAC80211][WiFi6][core][Fix DFS CAC issue after CSA]
[Release-log]
Change-Id: I9bec97ec1b2e1c49ed43a812a07a5b21fcbb70a6
diff --git a/recipes-wifi/wpa-supplicant/files/003-fix_wpa_supplicant_build_issue.patch b/recipes-wifi/wpa-supplicant/files/003-fix_wpa_supplicant_build_issue.patch
new file mode 100644
index 0000000..dc050a0
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/003-fix_wpa_supplicant_build_issue.patch
@@ -0,0 +1,73 @@
+diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
+index bd71083..9da8f8b 100644
+--- a/src/ap/ap_drv_ops.c
++++ b/src/ap/ap_drv_ops.c
+@@ -1399,6 +1399,7 @@ int hostapd_drv_txpower_ctrl(struct hostapd_data *hapd)
+ {
+ s8 link_id = -1, sku_idx = hapd->iconf->sku_idx, ret = 0, i;
+ s8 **afc_power_table = NULL;
++ int lpi_mode = 0;
+
+ if (!hapd->driver || !hapd->driver->txpower_ctrl)
+ return 0;
+@@ -1407,6 +1408,7 @@ int hostapd_drv_txpower_ctrl(struct hostapd_data *hapd)
+ link_id = hapd->mld_link_id;
+
+ #ifdef CONFIG_AFC
++ lpi_mode = hapd->iface->afc.lpi_mode;
+ if (hapd->iface->current_mode->is_6ghz &&
+ he_reg_is_sp(hapd->iface->conf->he_6ghz_reg_pwr_type) &&
+ !hapd->iface->afc.lpi_mode) {
+@@ -1424,7 +1426,7 @@ int hostapd_drv_txpower_ctrl(struct hostapd_data *hapd)
+ hapd->iconf->lpi_bcn_enhance,
+ link_id,
+ afc_power_table,
+- hapd->iface->afc.lpi_mode);
++ lpi_mode);
+ #ifdef CONFIG_AFC
+ out:
+ if (afc_power_table)
+diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
+index 0625bb7..643506f 100644
+--- a/src/ap/hostapd.h
++++ b/src/ap/hostapd.h
+@@ -869,7 +869,7 @@ static inline void hostap_afc_disable_channels(struct hostapd_iface *iface)
+ {
+ }
+
+-int hostapd_afc_translate_table(struct hostapd_iface *iface,
++static inline int hostapd_afc_translate_table(struct hostapd_iface *iface,
+ s8 ***power_table)
+ {
+ return -EINVAL;
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index a08afb5..414d0df 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -15708,12 +15708,12 @@ static int nl80211_txpower_ctrl(void *priv, u8 lpi_psd, u8 sku_idx, u8 lpi_bcn_e
+
+ if (link_id > -1)
+ nla_put_u8(msg, MTK_VENDOR_ATTR_TXPOWER_CTRL_LINK_ID, link_id);
+-
++#ifdef CONFIG_AFC
+ if (power_table && *power_table) {
+ nla_put(msg, MTK_VENDOR_ATTR_TXPOWER_CTRL_AFC_TABLE,
+ MAX_CHANNEL_NUM_6G * afc_power_table_num, power_table);
+ }
+-
++#endif
+ nla_put_u8(msg, MTK_VENDOR_ATTR_TXPOWER_CTRL_AFC_LPI, lpi_mode);
+ nla_nest_end(msg, data);
+ ret = send_and_recv_cmd(drv, msg);
+diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
+index d2982cb..23a3e44 100644
+--- a/wpa_supplicant/Makefile
++++ b/wpa_supplicant/Makefile
+@@ -1082,6 +1082,7 @@ endif
+ ifdef CONFIG_IEEE80211BE
+ CONFIG_IEEE80211AX=y
+ CFLAGS += -DCONFIG_IEEE80211BE
++OBJS += ../src/ap/scs.o
+ endif
+ ifdef CONFIG_IEEE80211AX
+ CFLAGS += -DCONFIG_IEEE80211AX
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0001-ctrl_iface-create-link-based-hapd-control-sockets.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0001-ctrl_iface-create-link-based-hapd-control-sockets.patch
new file mode 100644
index 0000000..580179a
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0001-ctrl_iface-create-link-based-hapd-control-sockets.patch
@@ -0,0 +1,228 @@
+From 166ae43a8066cbc70d5d990cfd29cb6c4c2afc67 Mon Sep 17 00:00:00 2001
+From: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
+Date: Tue, 23 Apr 2024 11:01:23 +0530
+Subject: [PATCH 001/126] ctrl_iface: create link based hapd control sockets
+
+Create link based control sockets to access the link based commands
+through hostapd_cli. This will create the link interfaces in the name of
+wlan<X>_link<X>
+
+Example:
+To fetch link 0 status from wlan0, below command can be used -
+ $ hostapd_cli -i wlan0 -l 0 status
+
+On failure of link/interface selection, below error will be observed
+ $ hostapd_cli -i wlan0 -l 2 status
+ Failed to connect to hostapd - wpa_ctrl_open: No such file or directory
+
+Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
+Co-developed-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
+Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
+---
+ hostapd/ctrl_iface.c | 16 ++++++++++++++--
+ hostapd/hostapd_cli.c | 30 ++++++++++++++++++++++++++++--
+ src/ap/hostapd.c | 28 ++++++++++++++++++++++++++++
+ src/ap/hostapd.h | 1 +
+ src/common/wpa_ctrl.h | 4 ++++
+ 5 files changed, 75 insertions(+), 4 deletions(-)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index 39b9ef59d..3fa33be7a 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -4687,18 +4687,26 @@ static char * hostapd_ctrl_iface_path(struct hostapd_data *hapd)
+ {
+ char *buf;
+ size_t len;
++ char *ctrl_sock_iface;
++
++#ifdef CONFIG_IEEE80211BE
++ ctrl_sock_iface = hapd->ctrl_sock_iface;
++#else
++ ctrl_sock_iface = hapd->conf->iface;
++#endif /* CONFIG_IEEE80211BE */
+
+ if (hapd->conf->ctrl_interface == NULL)
+ return NULL;
+
+ len = os_strlen(hapd->conf->ctrl_interface) +
+- os_strlen(hapd->conf->iface) + 2;
++ os_strlen(ctrl_sock_iface) + 2;
++
+ buf = os_malloc(len);
+ if (buf == NULL)
+ return NULL;
+
+ os_snprintf(buf, len, "%s/%s",
+- hapd->conf->ctrl_interface, hapd->conf->iface);
++ hapd->conf->ctrl_interface, ctrl_sock_iface);
+ buf[len - 1] = '\0';
+ return buf;
+ }
+@@ -4869,7 +4877,11 @@ fail:
+ #endif /* ANDROID */
+
+ if (os_strlen(hapd->conf->ctrl_interface) + 1 +
++#ifdef CONFIG_IEEE80211BE
++ os_strlen(hapd->ctrl_sock_iface) >= sizeof(addr.sun_path))
++#else
+ os_strlen(hapd->conf->iface) >= sizeof(addr.sun_path))
++#endif /* CONFIG_IEEE80211BE */
+ goto fail;
+
+ s = socket(PF_UNIX, SOCK_DGRAM, 0);
+diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
+index eb8a38350..f05a734fe 100644
+--- a/hostapd/hostapd_cli.c
++++ b/hostapd/hostapd_cli.c
+@@ -54,7 +54,11 @@ static void usage(void)
+ fprintf(stderr, "%s\n", hostapd_cli_version);
+ fprintf(stderr,
+ "\n"
++#ifdef CONFIG_IEEE80211BE
++ "usage: hostapd_cli [-p<path>] [-i<ifname>] [-l<link_id>] [-hvBr] "
++#else
+ "usage: hostapd_cli [-p<path>] [-i<ifname>] [-hvBr] "
++#endif /* CONFIG_IEEE80211BE */
+ "[-a<path>] \\\n"
+ " [-P<pid file>] [-G<ping interval>] [command..]\n"
+ "\n"
+@@ -74,7 +78,12 @@ static void usage(void)
+ " -B run a daemon in the background\n"
+ " -i<ifname> Interface to listen on (default: first "
+ "interface found in the\n"
+- " socket path)\n\n");
++ " socket path)\n"
++#ifdef CONFIG_IEEE80211BE
++ " -l<link_id> Link ID of the interface in case of Multi-Link\n"
++ " Operation\n"
++#endif /* CONFIG_IEEE80211BE */
++ "\n");
+ print_help(stderr, NULL);
+ }
+
+@@ -2205,19 +2214,26 @@ static void hostapd_cli_action(struct wpa_ctrl *ctrl)
+ eloop_unregister_read_sock(fd);
+ }
+
+-
+ int main(int argc, char *argv[])
+ {
+ int warning_displayed = 0;
+ int c;
+ int daemonize = 0;
+ int reconnect = 0;
++#ifdef CONFIG_IEEE80211BE
++ int link_id = -1;
++ char buf[300];
++#endif /* CONFIG_IEEE80211BE */
+
+ if (os_program_init())
+ return -1;
+
+ for (;;) {
++#ifdef CONFIG_IEEE80211BE
++ c = getopt(argc, argv, "a:BhG:i:l:p:P:rs:v");
++#else
+ c = getopt(argc, argv, "a:BhG:i:p:P:rs:v");
++#endif /* CONFIG_IEEE80211BE */
+ if (c < 0)
+ break;
+ switch (c) {
+@@ -2252,6 +2268,16 @@ int main(int argc, char *argv[])
+ case 's':
+ client_socket_dir = optarg;
+ break;
++#ifdef CONFIG_IEEE80211BE
++ case 'l':
++ link_id = atoi(optarg);
++ os_memset(buf, '\0', sizeof(buf));
++ os_snprintf(buf, sizeof(buf), "%s_%s%d",
++ ctrl_ifname, WPA_CTRL_IFACE_LINK_NAME, link_id);
++ os_free(ctrl_ifname);
++ ctrl_ifname = os_strdup(buf);
++ break;
++#endif /* CONFIG_IEEE80211BE */
+ default:
+ usage();
+ return -1;
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index a05de030d..c819c30cf 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -1808,12 +1808,37 @@ int hostapd_set_acl(struct hostapd_data *hapd)
+ }
+
+
++static void hostapd_set_ctrl_sock_iface(struct hostapd_data *hapd)
++{
++#ifdef CONFIG_IEEE80211BE
++ os_memset(hapd->ctrl_sock_iface, '\0',
++ sizeof(hapd->ctrl_sock_iface));
++ os_strlcpy(hapd->ctrl_sock_iface, hapd->conf->iface,
++ sizeof(hapd->ctrl_sock_iface));
++
++ if (hapd->conf->mld_ap) {
++ char buf[128];
++
++ os_memset(buf, '\0', sizeof(buf));
++ os_snprintf(buf, sizeof(buf), "%s_%s%d",
++ hapd->conf->iface, WPA_CTRL_IFACE_LINK_NAME,
++ hapd->mld_link_id);
++ os_memset(hapd->ctrl_sock_iface, '\0',
++ sizeof(hapd->ctrl_sock_iface));
++ os_strlcpy(hapd->ctrl_sock_iface, buf, sizeof(buf));
++ }
++#endif /* CONFIG_IEEE80211BE */
++}
++
++
+ static int start_ctrl_iface_bss(struct hostapd_data *hapd)
+ {
+ if (!hapd->iface->interfaces ||
+ !hapd->iface->interfaces->ctrl_iface_init)
+ return 0;
+
++ hostapd_set_ctrl_sock_iface(hapd);
++
+ if (hapd->iface->interfaces->ctrl_iface_init(hapd)) {
+ wpa_printf(MSG_ERROR,
+ "Failed to setup control interface for %s",
+@@ -1834,6 +1859,9 @@ static int start_ctrl_iface(struct hostapd_iface *iface)
+
+ for (i = 0; i < iface->num_bss; i++) {
+ struct hostapd_data *hapd = iface->bss[i];
++
++ hostapd_set_ctrl_sock_iface(hapd);
++
+ if (iface->interfaces->ctrl_iface_init(hapd)) {
+ wpa_printf(MSG_ERROR,
+ "Failed to setup control interface for %s",
+diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
+index dcf395ca5..34a665562 100644
+--- a/src/ap/hostapd.h
++++ b/src/ap/hostapd.h
+@@ -476,6 +476,7 @@ struct hostapd_data {
+ struct hostapd_mld *mld;
+ struct dl_list link;
+ u8 mld_link_id;
++ char ctrl_sock_iface[IFNAMSIZ + 1];
+ #ifdef CONFIG_TESTING_OPTIONS
+ u8 eht_mld_link_removal_count;
+ #endif /* CONFIG_TESTING_OPTIONS */
+diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h
+index f6142501e..865ac6d91 100644
+--- a/src/common/wpa_ctrl.h
++++ b/src/common/wpa_ctrl.h
+@@ -674,4 +674,8 @@ char * wpa_ctrl_get_remote_ifname(struct wpa_ctrl *ctrl);
+ }
+ #endif
+
++#ifdef CONFIG_IEEE80211BE
++#define WPA_CTRL_IFACE_LINK_NAME "link"
++#endif /* CONFIG_IEEE80211BE */
++
+ #endif /* WPA_CTRL_H */
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0001-hostapd-MLO-fix-for_each_mld_link-macro.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0001-hostapd-MLO-fix-for_each_mld_link-macro.patch
deleted file mode 100644
index c8e7f92..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0001-hostapd-MLO-fix-for_each_mld_link-macro.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From f5102b209870065c3e3719dd113892eafd4bb59e Mon Sep 17 00:00:00 2001
-From: Aditya Kumar Singh <quic_adisi@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:31 +0530
-Subject: [PATCH 001/104] hostapd: MLO: fix for_each_mld_link macro
-
-Currently for_each_mld_link macro uses 3 nested for loops. Since now the
-affliated links are linked together via linked list, the logic can
-be improvised by using dl_list_for_each macro instead which uses one for
-loop.
-
-Modify for_each_mld_link macro to use dl_list_for_each instead.
-
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/ap/beacon.c | 10 +---------
- src/ap/hostapd.h | 17 +++--------------
- src/ap/sta_info.c | 4 +---
- 3 files changed, 5 insertions(+), 26 deletions(-)
-
-diff --git a/src/ap/beacon.c b/src/ap/beacon.c
-index 32865f667..195c7bbd9 100644
---- a/src/ap/beacon.c
-+++ b/src/ap/beacon.c
-@@ -945,7 +945,6 @@ static void hostapd_fill_probe_resp_ml_params(struct hostapd_data *hapd,
- {
- struct probe_resp_params sta_info_params;
- struct hostapd_data *link;
-- unsigned int probed_mld_id, i, j;
-
- params->mld_ap = NULL;
- params->mld_info = os_zalloc(sizeof(*params->mld_info));
-@@ -956,14 +955,7 @@ static void hostapd_fill_probe_resp_ml_params(struct hostapd_data *hapd,
- "MLD: Got ML probe request with AP MLD ID %d for links %04x",
- mld_id, links);
-
-- /*
-- * We want to include the AP MLD ID in the response if it was
-- * included in the request.
-- */
-- probed_mld_id = mld_id != -1 ? mld_id : hostapd_get_mld_id(hapd);
--
-- for_each_mld_link(link, i, j, hapd->iface->interfaces,
-- probed_mld_id) {
-+ for_each_mld_link(link, hapd) {
- struct mld_link_info *link_info;
- size_t buflen;
- u8 mld_link_id = link->mld_link_id;
-diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
-index affe4f604..d12efb104 100644
---- a/src/ap/hostapd.h
-+++ b/src/ap/hostapd.h
-@@ -817,19 +817,8 @@ struct hostapd_data * hostapd_mld_get_first_bss(struct hostapd_data *hapd);
-
- bool hostapd_mld_is_first_bss(struct hostapd_data *hapd);
-
--#define for_each_mld_link(_link, _bss_idx, _iface_idx, _ifaces, _mld_id) \
-- for (_iface_idx = 0; \
-- _iface_idx < (_ifaces)->count; \
-- _iface_idx++) \
-- for (_bss_idx = 0; \
-- _bss_idx < \
-- (_ifaces)->iface[_iface_idx]->num_bss; \
-- _bss_idx++) \
-- for (_link = \
-- (_ifaces)->iface[_iface_idx]->bss[_bss_idx]; \
-- _link && _link->conf->mld_ap && \
-- hostapd_get_mld_id(_link) == _mld_id; \
-- _link = NULL)
-+#define for_each_mld_link(partner, self) \
-+ dl_list_for_each(partner, &self->mld->links, struct hostapd_data, link)
-
- #else /* CONFIG_IEEE80211BE */
-
-@@ -838,7 +827,7 @@ static inline bool hostapd_mld_is_first_bss(struct hostapd_data *hapd)
- return true;
- }
-
--#define for_each_mld_link(_link, _bss_idx, _iface_idx, _ifaces, _mld_id) \
-+#define for_each_mld_link(partner, self) \
- if (false)
-
- #endif /* CONFIG_IEEE80211BE */
-diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
-index 122880a3d..2423ff189 100644
---- a/src/ap/sta_info.c
-+++ b/src/ap/sta_info.c
-@@ -1761,10 +1761,8 @@ static void ap_sta_remove_link_sta(struct hostapd_data *hapd,
- struct sta_info *sta)
- {
- struct hostapd_data *tmp_hapd;
-- unsigned int i, j;
-
-- for_each_mld_link(tmp_hapd, i, j, hapd->iface->interfaces,
-- hostapd_get_mld_id(hapd)) {
-+ for_each_mld_link(tmp_hapd, hapd) {
- struct sta_info *tmp_sta;
-
- if (hapd == tmp_hapd)
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0002-ctrl_iface-MLO-introduce-MLD-level-socket.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0002-ctrl_iface-MLO-introduce-MLD-level-socket.patch
new file mode 100644
index 0000000..448534e
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0002-ctrl_iface-MLO-introduce-MLD-level-socket.patch
@@ -0,0 +1,479 @@
+From 631a48c1a241bf9515d296eeea5d6060bef96cff Mon Sep 17 00:00:00 2001
+From: Aditya Kumar Singh <quic_adisi@quicinc.com>
+Date: Tue, 23 Apr 2024 11:01:24 +0530
+Subject: [PATCH 002/126] ctrl_iface: MLO: introduce MLD level socket
+
+With MLO, each link have socket created with "<ifname>_link<link id>" under
+the control interface directory.
+
+Introduce a MLD level socket - "<ifname>" as well under the same control
+interface directory. This socket can be used to pass the command to its
+partner links directly instead of using the link level socket. Link ID
+needs to be passed with the command.
+
+The structure of the command is -
+ "<COMMAND APPLICABALE FOR THE LINK> LINKID <link id>"
+
+Directory looks something like this -
+ $ ls /var/run/hostapd/
+ wlan0
+ wlan0_link0
+ wlan0_link1
+
+wlan0 here is the MLD level socket. Rest are each link level.
+
+This would also help to maintain backwards compatibility with applications
+which looks for <ifname> under the control interface directory.`
+
+Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
+---
+ hostapd/ctrl_iface.c | 335 +++++++++++++++++++++++++++++++++++++++++++
+ hostapd/ctrl_iface.h | 4 +
+ hostapd/main.c | 5 +
+ src/ap/hostapd.c | 11 ++
+ src/ap/hostapd.h | 6 +
+ 5 files changed, 361 insertions(+)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index 3fa33be7a..5fe29147f 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -4682,6 +4682,341 @@ done:
+ }
+
+
++#ifdef CONFIG_IEEE80211BE
++#ifndef CONFIG_CTRL_IFACE_UDP
++static int hostapd_mld_ctrl_iface_attach(struct hostapd_mld *mld,
++ struct sockaddr_storage *from,
++ socklen_t fromlen, const char *input)
++{
++ return ctrl_iface_attach(&mld->ctrl_dst, from, fromlen, input);
++}
++
++
++static int hostapd_mld_ctrl_iface_detach(struct hostapd_mld *mld,
++ struct sockaddr_storage *from,
++ socklen_t fromlen)
++{
++ return ctrl_iface_detach(&mld->ctrl_dst, from, fromlen);
++}
++
++
++static int hostapd_mld_ctrl_iface_receive_process(struct hostapd_mld *mld,
++ char *buf, char *reply,
++ int reply_size,
++ struct sockaddr_storage *from,
++ socklen_t fromlen)
++{
++ struct hostapd_data *link_hapd, *link_itr;
++ int reply_len, link_id = -1;
++ char *link_cmd;
++ bool found = false;
++
++ os_memcpy(reply, "OK\n", 3);
++ reply_len = 3;
++
++ /* Check if link id is provided in the command or not */
++ link_cmd = os_strstr(buf, "LINKID");
++ if (link_cmd) {
++ /* Trim the link id part now */
++ *(link_cmd - 1) = '\0';
++
++ link_cmd += 7;
++ link_id = atoi(link_cmd);
++
++ if (link_id < 0 || link_id >= 15) {
++ os_memcpy(reply, "INVALID LINK ID\n", 16);
++ reply_len = 16;
++ return reply_len;
++ }
++
++ link_hapd = mld->fbss;
++ if (!link_hapd) {
++ os_memcpy(reply, "NO LINKS ACTIVE\n", 16);
++ reply_len = 16;
++ return reply_len;
++ }
++
++ for_each_mld_link(link_itr, link_hapd) {
++ if (link_itr->mld_link_id == link_id) {
++ found = true;
++ break;
++ }
++ }
++
++ if (!found) {
++ os_memcpy(reply, "FAIL\n", 5);
++ reply_len = 5;
++ return reply_len;
++ }
++
++ link_hapd = link_itr;
++ } else {
++ link_hapd = mld->fbss;
++ }
++
++ if (os_strcmp(buf, "PING") == 0) {
++ os_memcpy(reply, "PONG\n", 5);
++ reply_len = 5;
++ } else if (os_strcmp(buf, "ATTACH") == 0) {
++ if (hostapd_mld_ctrl_iface_attach(mld, from, fromlen, NULL))
++ reply_len = -1;
++ } else if (os_strncmp(buf, "ATTACH ", 7) == 0) {
++ if (hostapd_mld_ctrl_iface_attach(mld, from, fromlen, buf + 7))
++ reply_len = -1;
++ } else if (os_strcmp(buf, "DETACH") == 0) {
++ if (hostapd_mld_ctrl_iface_detach(mld, from, fromlen))
++ reply_len = -1;
++ } else {
++ if (link_id == -1)
++ wpa_printf(MSG_DEBUG, "Link ID not provided, using first link BSS (if available)");
++
++ if (!link_hapd)
++ reply_len = -1;
++ else
++ reply_len =
++ hostapd_ctrl_iface_receive_process(link_hapd, buf,
++ reply, reply_size,
++ from, fromlen);
++ }
++
++ if (reply_len < 0) {
++ os_memcpy(reply, "FAIL\n", 5);
++ reply_len = 5;
++ }
++
++ return reply_len;
++}
++
++
++static void hostapd_mld_ctrl_iface_receive(int sock, void *eloop_ctx,
++ void *sock_ctx)
++{
++ struct hostapd_mld *mld = eloop_ctx;
++ char buf[4096];
++ int res;
++ struct sockaddr_storage from;
++ socklen_t fromlen = sizeof(from);
++ char *reply, *pos = buf;
++ const int reply_size = 4096;
++ int reply_len;
++ int level = MSG_DEBUG;
++
++ res = recvfrom(sock, buf, sizeof(buf) - 1, 0,
++ (struct sockaddr *) &from, &fromlen);
++ if (res < 0) {
++ wpa_printf(MSG_ERROR, "recvfrom(mld ctrl_iface): %s",
++ strerror(errno));
++ return;
++ }
++ buf[res] = '\0';
++
++ reply = os_malloc(reply_size);
++ if (reply == NULL) {
++ if (sendto(sock, "FAIL\n", 5, 0, (struct sockaddr *) &from,
++ fromlen) < 0) {
++ wpa_printf(MSG_DEBUG, "MLD CTRL: sendto failed: %s",
++ strerror(errno));
++ }
++ return;
++ }
++
++ if (os_strcmp(pos, "PING") == 0)
++ level = MSG_EXCESSIVE;
++
++ wpa_hexdump_ascii(level, "RX MLD ctrl_iface", pos, res);
++
++ reply_len = hostapd_mld_ctrl_iface_receive_process(mld, pos,
++ reply, reply_size,
++ &from, fromlen);
++
++ if (sendto(sock, reply, reply_len, 0, (struct sockaddr *) &from,
++ fromlen) < 0) {
++ wpa_printf(MSG_DEBUG, "MLD CTRL: sendto failed: %s",
++ strerror(errno));
++ }
++ os_free(reply);
++}
++
++
++static char * hostapd_mld_ctrl_iface_path(struct hostapd_mld *mld)
++{
++ char *buf;
++ size_t len;
++
++ if (!mld->ctrl_interface)
++ return NULL;
++
++ len = os_strlen(mld->ctrl_interface) + os_strlen(mld->name) + 2;
++
++ buf = os_malloc(len);
++ if (buf == NULL)
++ return NULL;
++
++ os_snprintf(buf, len, "%s/%s", mld->ctrl_interface, mld->name);
++ buf[len - 1] = '\0';
++ return buf;
++}
++#endif /* !CONFIG_CTRL_IFACE_UDP */
++
++
++int hostapd_mld_ctrl_iface_init(struct hostapd_mld *mld)
++{
++#ifndef CONFIG_CTRL_IFACE_UDP
++ struct sockaddr_un addr;
++ int s = -1;
++ char *fname = NULL;
++
++ if (!mld)
++ return -1;
++
++ if (mld->ctrl_sock > -1) {
++ wpa_printf(MSG_DEBUG, "MLD %s ctrl_iface already exists!",
++ mld->name);
++ return 0;
++ }
++
++ dl_list_init(&mld->ctrl_dst);
++
++ if (mld->ctrl_interface == NULL)
++ return 0;
++
++ if (mkdir(mld->ctrl_interface, S_IRWXU | S_IRWXG) < 0) {
++ if (errno == EEXIST) {
++ wpa_printf(MSG_DEBUG, "Using existing control "
++ "interface directory.");
++ } else {
++ wpa_printf(MSG_ERROR, "mkdir[ctrl_interface]: %s",
++ strerror(errno));
++ goto fail;
++ }
++ }
++
++ if (os_strlen(mld->ctrl_interface) + 1 +
++ os_strlen(mld->name) >= sizeof(addr.sun_path))
++ goto fail;
++
++ s = socket(PF_UNIX, SOCK_DGRAM, 0);
++ if (s < 0) {
++ wpa_printf(MSG_ERROR, "socket(PF_UNIX): %s", strerror(errno));
++ goto fail;
++ }
++
++ os_memset(&addr, 0, sizeof(addr));
++#ifdef __FreeBSD__
++ addr.sun_len = sizeof(addr);
++#endif /* __FreeBSD__ */
++ addr.sun_family = AF_UNIX;
++
++ fname = hostapd_mld_ctrl_iface_path(mld);
++ if (fname == NULL)
++ goto fail;
++
++ os_strlcpy(addr.sun_path, fname, sizeof(addr.sun_path));
++
++ wpa_printf(MSG_DEBUG, "Setting up MLD %s ctrl_iface", mld->name);
++
++ if (bind(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
++ wpa_printf(MSG_DEBUG, "ctrl_iface bind(PF_UNIX) failed: %s",
++ strerror(errno));
++ if (connect(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
++ wpa_printf(MSG_DEBUG, "ctrl_iface exists, but does not"
++ " allow connections - assuming it was left"
++ "over from forced program termination");
++ if (unlink(fname) < 0) {
++ wpa_printf(MSG_ERROR,
++ "Could not unlink existing ctrl_iface socket '%s': %s",
++ fname, strerror(errno));
++ goto fail;
++ }
++ if (bind(s, (struct sockaddr *) &addr, sizeof(addr)) <
++ 0) {
++ wpa_printf(MSG_ERROR,
++ "hostapd-ctrl-iface: bind(PF_UNIX): %s",
++ strerror(errno));
++ goto fail;
++ }
++ wpa_printf(MSG_DEBUG, "Successfully replaced leftover "
++ "ctrl_iface socket '%s'", fname);
++ } else {
++ wpa_printf(MSG_INFO, "ctrl_iface exists and seems to "
++ "be in use - cannot override it");
++ wpa_printf(MSG_INFO, "Delete '%s' manually if it is "
++ "not used anymore", fname);
++ os_free(fname);
++ fname = NULL;
++ goto fail;
++ }
++ }
++
++ if (chmod(fname, S_IRWXU | S_IRWXG) < 0) {
++ wpa_printf(MSG_ERROR, "chmod[ctrl_interface/ifname]: %s",
++ strerror(errno));
++ goto fail;
++ }
++ os_free(fname);
++
++ mld->ctrl_sock = s;
++
++ if (eloop_register_read_sock(s, hostapd_mld_ctrl_iface_receive, mld,
++ NULL) < 0)
++ return -1;
++
++ return 0;
++
++fail:
++ if (s >= 0)
++ close(s);
++ if (fname) {
++ unlink(fname);
++ os_free(fname);
++ }
++ return -1;
++#endif /* !CONFIG_CTRL_IFACE_UDP */
++ return 0;
++}
++
++
++void hostapd_mld_ctrl_iface_deinit(struct hostapd_mld *mld)
++{
++#ifndef CONFIG_CTRL_IFACE_UDP
++ struct wpa_ctrl_dst *dst, *prev;
++
++ if (mld->ctrl_sock > -1) {
++ char *fname;
++ eloop_unregister_read_sock(mld->ctrl_sock);
++ close(mld->ctrl_sock);
++ mld->ctrl_sock = -1;
++
++ fname = hostapd_mld_ctrl_iface_path(mld);
++ if (fname)
++ unlink(fname);
++ os_free(fname);
++
++ if (mld->ctrl_interface &&
++ rmdir(mld->ctrl_interface) < 0) {
++ if (errno == ENOTEMPTY) {
++ wpa_printf(MSG_DEBUG, "MLD Control interface "
++ "directory not empty - leaving it "
++ "behind");
++ } else {
++ wpa_printf(MSG_ERROR,
++ "rmdir[ctrl_interface=%s]: %s",
++ mld->ctrl_interface,
++ strerror(errno));
++ }
++ }
++ }
++
++ dl_list_for_each_safe(dst, prev, &mld->ctrl_dst, struct wpa_ctrl_dst,
++ list)
++ os_free(dst);
++#endif /* !CONFIG_CTRL_IFACE_UDP */
++
++ os_free(mld->ctrl_interface);
++}
++#endif /* CONFIG_IEEE80211BE */
++
++
+ #ifndef CONFIG_CTRL_IFACE_UDP
+ static char * hostapd_ctrl_iface_path(struct hostapd_data *hapd)
+ {
+diff --git a/hostapd/ctrl_iface.h b/hostapd/ctrl_iface.h
+index 3341a66bd..ec5a95be7 100644
+--- a/hostapd/ctrl_iface.h
++++ b/hostapd/ctrl_iface.h
+@@ -14,6 +14,10 @@ int hostapd_ctrl_iface_init(struct hostapd_data *hapd);
+ void hostapd_ctrl_iface_deinit(struct hostapd_data *hapd);
+ int hostapd_global_ctrl_iface_init(struct hapd_interfaces *interface);
+ void hostapd_global_ctrl_iface_deinit(struct hapd_interfaces *interface);
++#ifdef CONFIG_IEEE80211BE
++int hostapd_mld_ctrl_iface_init(struct hostapd_mld *mld);
++void hostapd_mld_ctrl_iface_deinit(struct hostapd_mld *mld);
++#endif /* CONFIG_IEEE80211BE */
+ #else /* CONFIG_NO_CTRL_IFACE */
+ static inline int hostapd_ctrl_iface_init(struct hostapd_data *hapd)
+ {
+diff --git a/hostapd/main.c b/hostapd/main.c
+index 00e02bb03..aa1f69812 100644
+--- a/hostapd/main.c
++++ b/hostapd/main.c
+@@ -748,6 +748,7 @@ static void hostapd_global_cleanup_mld(struct hapd_interfaces *interfaces)
+ if (!interfaces->mld[i])
+ continue;
+
++ interfaces->mld_ctrl_iface_deinit(interfaces->mld[i]);
+ os_free(interfaces->mld[i]);
+ interfaces->mld[i] = NULL;
+ }
+@@ -793,6 +794,10 @@ int main(int argc, char *argv[])
+ interfaces.global_iface_path = NULL;
+ interfaces.global_iface_name = NULL;
+ interfaces.global_ctrl_sock = -1;
++#ifdef CONFIG_IEEE80211BE
++ interfaces.mld_ctrl_iface_init = hostapd_mld_ctrl_iface_init;
++ interfaces.mld_ctrl_iface_deinit = hostapd_mld_ctrl_iface_deinit;
++#endif /* CONFIG_IEEE80211BE */
+ dl_list_init(&interfaces.global_ctrl_dst);
+ #ifdef CONFIG_ETH_P_OUI
+ dl_list_init(&interfaces.eth_p_oui);
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index c819c30cf..36d48ae09 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -3093,9 +3093,18 @@ static void hostapd_bss_setup_multi_link(struct hostapd_data *hapd,
+
+ os_strlcpy(mld->name, conf->iface, sizeof(conf->iface));
+ dl_list_init(&mld->links);
++ mld->ctrl_sock = -1;
++ mld->ctrl_interface = os_strdup(hapd->conf->ctrl_interface);
+
+ wpa_printf(MSG_DEBUG, "AP MLD %s created", mld->name);
+
++ /*
++ * Initialize MLD control interfaces early to allow external monitoring of
++ * link setup operations.
++ */
++ if (interfaces->mld_ctrl_iface_init(mld))
++ goto fail;
++
+ hapd->mld = mld;
+ hostapd_mld_ref_inc(mld);
+ hostapd_bss_alloc_link_id(hapd);
+@@ -3155,6 +3164,8 @@ static void hostapd_cleanup_unused_mlds(struct hapd_interfaces *interfaces)
+ if (!remove && !forced_remove)
+ continue;
+
++ interfaces->mld_ctrl_iface_deinit(mld);
++
+ wpa_printf(MSG_DEBUG, "AP MLD %s: Freed%s", mld->name,
+ forced_remove ? " (forced)" : "");
+ os_free(mld);
+diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
+index 34a665562..2ef63e5f2 100644
+--- a/src/ap/hostapd.h
++++ b/src/ap/hostapd.h
+@@ -97,6 +97,8 @@ struct hapd_interfaces {
+ #ifdef CONFIG_IEEE80211BE
+ struct hostapd_mld **mld;
+ size_t mld_count;
++ int (*mld_ctrl_iface_init)(struct hostapd_mld *mld);
++ void (*mld_ctrl_iface_deinit)(struct hostapd_mld *mld);
+ #endif /* CONFIG_IEEE80211BE */
+ };
+
+@@ -519,6 +521,10 @@ struct hostapd_mld {
+
+ struct hostapd_data *fbss;
+ struct dl_list links; /* List head of all affiliated links */
++
++ int ctrl_sock;
++ struct dl_list ctrl_dst;
++ char *ctrl_interface; /* directory for UNIX domain sockets */
+ };
+
+ #define HOSTAPD_MLD_MAX_REF_COUNT 0xFF
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0002-hostapd-MLO-frame-link-add-command-on-per-BSS-basis.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0002-hostapd-MLO-frame-link-add-command-on-per-BSS-basis.patch
deleted file mode 100644
index 86c2263..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0002-hostapd-MLO-frame-link-add-command-on-per-BSS-basis.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 3ca32441ecd9d1a52f736d4a4fffdc24de629e90 Mon Sep 17 00:00:00 2001
-From: Aditya Kumar Singh <quic_adisi@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:32 +0530
-Subject: [PATCH 002/104] hostapd: MLO: frame link add command on per BSS basis
-
-Currently function nl80211_link_add() creates the link add NL message on
-drv basis which in turn uses drv's first BSS always. In order to support
-link add for various other interfaces, use BSS handler to create the NL
-message.
-
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/drivers/driver_nl80211.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 4949de577..042bc97a8 100644
---- a/src/drivers/driver_nl80211.c
-+++ b/src/drivers/driver_nl80211.c
-@@ -13876,7 +13876,7 @@ static int nl80211_link_add(void *priv, u8 link_id, const u8 *addr,
- }
- }
-
-- msg = nl80211_drv_msg(drv, 0, NL80211_CMD_ADD_LINK);
-+ msg = nl80211_bss_msg(bss, 0, NL80211_CMD_ADD_LINK);
- if (!msg ||
- nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id) ||
- nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr)) {
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0003-hostapd_cli-MLO-pass-LINKID-in-the-command.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0003-hostapd_cli-MLO-pass-LINKID-in-the-command.patch
new file mode 100644
index 0000000..9b45d05
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0003-hostapd_cli-MLO-pass-LINKID-in-the-command.patch
@@ -0,0 +1,194 @@
+From 702fc9f42fc30acd7f956994f887d02eef3c3ade Mon Sep 17 00:00:00 2001
+From: Aditya Kumar Singh <quic_adisi@quicinc.com>
+Date: Tue, 23 Apr 2024 11:01:25 +0530
+Subject: [PATCH 003/126] hostapd_cli: MLO: pass 'LINKID' in the command
+
+MLD level socket can take 'LINKID <link id>'. Add changes to pass this via
+hostapd_cli. User needs to give "link_id=<link_id>" in post fix fashion in
+the command in order to pass this link_id from cli.
+
+For example -
+$ hostapd_cli -i wlan0 status link_id=0 | grep freq=
+freq=2437
+
+$ hostapd_cli -i wlan0
+...
+Interactive mode
+
+> ping
+PONG
+>
+> status link_id=0
+Command for 'LINKID 0'
+state=ENABLED
+phy=phy0
+freq=2437
+
+Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
+---
+ hostapd/hostapd_cli.c | 39 +++++++++++++++++++++++++++++++
+ src/common/wpa_ctrl.c | 54 +++++++++++++++++++++++++++++++++++++++++++
+ src/common/wpa_ctrl.h | 3 +++
+ 3 files changed, 96 insertions(+)
+
+diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
+index f05a734fe..d69525502 100644
+--- a/hostapd/hostapd_cli.c
++++ b/hostapd/hostapd_cli.c
+@@ -1962,6 +1962,45 @@ static void wpa_request(struct wpa_ctrl *ctrl, int argc, char *argv[])
+ } else if (count == 0) {
+ printf("Unknown command '%s'\n", argv[0]);
+ } else {
++#ifdef CONFIG_IEEE80211BE
++ char *pos, *end;
++ int i, j, link_id;
++ bool link_found = false;
++
++ wpa_ctrl_reset_mld_link(ctrl);
++ i = 0;
++
++ while (i < argc) {
++ pos = os_strstr(argv[i], "link_id=");
++ if (!pos) {
++ i++;
++ continue;
++ }
++
++ pos = pos + 8;
++ link_id = strtol(pos, &end, 10);
++
++ if (link_id < 0 || link_id >= 15) {
++ printf("Invalid link ID '%d'\n", link_id);
++ return;
++ }
++
++ link_found = true;
++
++ /* remove this link_id= from the arguements */
++ for (j = i + 1; j < argc; j++)
++ argv[j - 1] = argv[j];
++
++ argc--;
++ i = 0;
++ }
++
++ if (link_found) {
++ wpa_ctrl_set_mld_link(ctrl, link_id);
++ printf("Command for '%s'\n",
++ wpa_ctrl_get_mld_link(ctrl));
++ }
++#endif /* CONFIG_IEEE80211BE */
+ match->handler(ctrl, argc - 1, &argv[1]);
+ }
+ }
+diff --git a/src/common/wpa_ctrl.c b/src/common/wpa_ctrl.c
+index 7e197f094..d0c174c05 100644
+--- a/src/common/wpa_ctrl.c
++++ b/src/common/wpa_ctrl.c
+@@ -72,6 +72,13 @@ struct wpa_ctrl {
+ #ifdef CONFIG_CTRL_IFACE_NAMED_PIPE
+ HANDLE pipe;
+ #endif /* CONFIG_CTRL_IFACE_NAMED_PIPE */
++#ifdef CONFIG_IEEE80211BE
++ /* 'LINKID ' - 7 chars including space
++ * 'XX' - Two chars max for link id
++ * Total required 10 chars at least
++ */
++ char link_id_str[10];
++#endif /* CONFIG_IEEE80211BE */
+ };
+
+
+@@ -488,6 +495,7 @@ int wpa_ctrl_request(struct wpa_ctrl *ctrl, const char *cmd, size_t cmd_len,
+ fd_set rfds;
+ const char *_cmd;
+ char *cmd_buf = NULL;
++ char *link_cmd_buf = NULL;
+ size_t _cmd_len;
+
+ #ifdef CONFIG_CTRL_IFACE_UDP
+@@ -510,6 +518,28 @@ int wpa_ctrl_request(struct wpa_ctrl *ctrl, const char *cmd, size_t cmd_len,
+ _cmd_len = cmd_len;
+ }
+
++#ifdef CONFIG_IEEE80211BE
++ if (os_strlen(ctrl->link_id_str)) {
++ char *pos;
++
++ _cmd_len = _cmd_len + 1 + os_strlen(ctrl->link_id_str);
++ link_cmd_buf = os_malloc(_cmd_len);
++ if (link_cmd_buf == NULL) {
++ if (cmd_buf)
++ os_free(cmd_buf);
++ return -1;
++ }
++
++ pos = link_cmd_buf;
++ os_strlcpy(pos, _cmd, _cmd_len);
++ pos += os_strlen(_cmd);
++ *pos++ = ' ';
++ os_memcpy(pos, ctrl->link_id_str, os_strlen(ctrl->link_id_str));
++ _cmd = link_cmd_buf;
++ wpa_ctrl_reset_mld_link(ctrl);
++ }
++#endif /* CONFIG_IEEE80211BE */
++
+ errno = 0;
+ started_at.sec = 0;
+ started_at.usec = 0;
+@@ -535,9 +565,11 @@ retry_send:
+ }
+ send_err:
+ os_free(cmd_buf);
++ os_free(link_cmd_buf);
+ return -1;
+ }
+ os_free(cmd_buf);
++ os_free(link_cmd_buf);
+
+ os_get_reltime(&ending_at);
+ ending_at.sec += 10;
+@@ -773,4 +805,26 @@ int wpa_ctrl_get_fd(struct wpa_ctrl *ctrl)
+
+ #endif /* CONFIG_CTRL_IFACE_NAMED_PIPE */
+
++
++#ifdef CONFIG_IEEE80211BE
++void wpa_ctrl_reset_mld_link(struct wpa_ctrl *ctrl)
++{
++ os_memset(ctrl->link_id_str, '\0', sizeof(ctrl->link_id_str));
++}
++
++
++void wpa_ctrl_set_mld_link(struct wpa_ctrl *ctrl, int link_id)
++{
++ os_snprintf(ctrl->link_id_str, sizeof(ctrl->link_id_str),
++ "LINKID %d", link_id);
++}
++
++
++char *wpa_ctrl_get_mld_link(struct wpa_ctrl *ctrl)
++{
++ return ctrl->link_id_str;
++}
++#endif /* CONFIG_IEEE80211BE */
++
++
+ #endif /* CONFIG_CTRL_IFACE */
+diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h
+index 865ac6d91..d1ce1dd29 100644
+--- a/src/common/wpa_ctrl.h
++++ b/src/common/wpa_ctrl.h
+@@ -676,6 +676,9 @@ char * wpa_ctrl_get_remote_ifname(struct wpa_ctrl *ctrl);
+
+ #ifdef CONFIG_IEEE80211BE
+ #define WPA_CTRL_IFACE_LINK_NAME "link"
++void wpa_ctrl_reset_mld_link(struct wpa_ctrl *ctrl);
++void wpa_ctrl_set_mld_link(struct wpa_ctrl *ctrl, int link_id);
++char *wpa_ctrl_get_mld_link(struct wpa_ctrl *ctrl);
+ #endif /* CONFIG_IEEE80211BE */
+
+ #endif /* WPA_CTRL_H */
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0003-nl80211-Print-the-interface-name-in-debug-during-lin.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0003-nl80211-Print-the-interface-name-in-debug-during-lin.patch
deleted file mode 100644
index 8dfcc5c..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0003-nl80211-Print-the-interface-name-in-debug-during-lin.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 695a2dbff28bb259c2b4f8bfdfb9040f81ab7e90 Mon Sep 17 00:00:00 2001
-From: Aditya Kumar Singh <quic_adisi@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:33 +0530
-Subject: [PATCH 003/104] nl80211: Print the interface name in debug during
- link add
-
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/drivers/driver_nl80211.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 042bc97a8..98948bfb1 100644
---- a/src/drivers/driver_nl80211.c
-+++ b/src/drivers/driver_nl80211.c
-@@ -13900,8 +13900,8 @@ static int nl80211_link_add(void *priv, u8 link_id, const u8 *addr,
- bss->valid_links |= BIT(link_id);
- bss->links[link_id].ctx = bss_ctx;
-
-- wpa_printf(MSG_DEBUG, "nl80211: MLD: valid_links=0x%04x",
-- bss->valid_links);
-+ wpa_printf(MSG_DEBUG, "nl80211: MLD: valid_links=0x%04x on %s",
-+ bss->valid_links, bss->ifname);
- return 0;
- }
-
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0004-hostapd-MLO-send-link_id-on-sta_deauth.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0004-hostapd-MLO-send-link_id-on-sta_deauth.patch
deleted file mode 100644
index 5f56b72..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0004-hostapd-MLO-send-link_id-on-sta_deauth.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 49a31ee63f482c930e001e2b6a13bf9261fcf5de Mon Sep 17 00:00:00 2001
-From: Aditya Kumar Singh <quic_adisi@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:34 +0530
-Subject: [PATCH 004/104] hostapd: MLO: send link_id on sta_deauth()
-
-Function i802_sta_deauth() already has the link_id passed to it in its
-arguments. Use that to pass it down to send mlme handler.
-
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/drivers/driver_nl80211.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 98948bfb1..e5fa22b59 100644
---- a/src/drivers/driver_nl80211.c
-+++ b/src/drivers/driver_nl80211.c
-@@ -8254,7 +8254,7 @@ static int i802_sta_deauth(void *priv, const u8 *own_addr, const u8 *addr,
- return wpa_driver_nl80211_send_mlme(bss, (u8 *) &mgmt,
- IEEE80211_HDRLEN +
- sizeof(mgmt.u.deauth), 0, 0, 0, 0,
-- 0, NULL, 0, 0, -1);
-+ 0, NULL, 0, 0, link_id);
- }
-
-
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0004-hostapd_cli-MLO-add-status-command-for-MLD-socket.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0004-hostapd_cli-MLO-add-status-command-for-MLD-socket.patch
new file mode 100644
index 0000000..08a7a11
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0004-hostapd_cli-MLO-add-status-command-for-MLD-socket.patch
@@ -0,0 +1,99 @@
+From 8e2802b52f5469e12dcb0bc38929f2721a2f0a83 Mon Sep 17 00:00:00 2001
+From: Aditya Kumar Singh <quic_adisi@quicinc.com>
+Date: Tue, 23 Apr 2024 11:01:26 +0530
+Subject: [PATCH 004/126] hostapd_cli: MLO: add status command for MLD socket
+
+Add MLD level 'status' command. Currently each link level socket has got
+'status' command. When the same is passed on MLD level socket without any
+link id, it routes it to first BSS of the MLD if available. Handle this
+now properly.
+
+If link id is not passed then it will be treated as MLD level status
+command.
+
+$ hostapd_cli -i wlan0
+....
+Interactive mode
+
+> status
+name=wlan0
+mld_address=AA:BB:CC:DD:EE:FF
+num_links=2
+LINK INFORMATION
+link_id=0
+link_addr=AA:BB:CC:DD:EE:EE
+link_id=1
+link_addr=AA:BB:CC:DD:FF:FF
+
+Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
+---
+ hostapd/ctrl_iface.c | 46 ++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 46 insertions(+)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index 5fe29147f..a584d370e 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -4700,6 +4700,49 @@ static int hostapd_mld_ctrl_iface_detach(struct hostapd_mld *mld,
+ }
+
+
++int hostapd_ctrl_mld_iface_status(struct hostapd_mld *mld, char *buf,
++ size_t buflen)
++{
++ struct hostapd_data *link_hapd;
++ int len = 0, ret;
++
++ ret = os_snprintf(buf + len, buflen - len,
++ "name=%s\n"
++ "mld_address=" MACSTR "\n"
++ "num_links=%d\n",
++ mld->name, MAC2STR(mld->mld_addr), mld->num_links);
++ if (os_snprintf_error(buflen - len, ret))
++ return len;
++ len += ret;
++
++ if (!mld->fbss) {
++ ret = os_snprintf(buf + len, buflen - len,
++ "\n No Link information present\n");
++ if (os_snprintf_error(buflen - len, ret))
++ return len;
++ len += ret;
++ }
++
++ ret = os_snprintf(buf + len, buflen - len,
++ "LINK INFORMATION\n");
++ if (os_snprintf_error(buflen - len, ret))
++ return len;
++ len += ret;
++
++ dl_list_for_each(link_hapd, &mld->links, struct hostapd_data, link) {
++ ret = os_snprintf(buf + len, buflen - len,
++ "link_id=%d\n"
++ "link_addr=" MACSTR "\n",
++ link_hapd->mld_link_id, MAC2STR(link_hapd->own_addr));
++ if (os_snprintf_error(buflen - len, ret))
++ return len;
++ len += ret;
++ }
++
++ return len;
++}
++
++
+ static int hostapd_mld_ctrl_iface_receive_process(struct hostapd_mld *mld,
+ char *buf, char *reply,
+ int reply_size,
+@@ -4766,6 +4809,9 @@ static int hostapd_mld_ctrl_iface_receive_process(struct hostapd_mld *mld,
+ } else if (os_strcmp(buf, "DETACH") == 0) {
+ if (hostapd_mld_ctrl_iface_detach(mld, from, fromlen))
+ reply_len = -1;
++ } else if (os_strcmp(buf, "STATUS") == 0 && link_id == -1){
++ reply_len = hostapd_ctrl_mld_iface_status(mld, reply,
++ reply_size);
+ } else {
+ if (link_id == -1)
+ wpa_printf(MSG_DEBUG, "Link ID not provided, using first link BSS (if available)");
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0005-hostapd-MLO-handle-auth-assoc-on-link-address.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0005-hostapd-MLO-handle-auth-assoc-on-link-address.patch
deleted file mode 100644
index e8adbc0..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0005-hostapd-MLO-handle-auth-assoc-on-link-address.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From ec1fdb73853632e9a9003f8c59620d1e12f6d2d0 Mon Sep 17 00:00:00 2001
-From: Sriram R <quic_srirrama@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:35 +0530
-Subject: [PATCH 005/104] hostapd: MLO: handle auth/assoc on link address
-
-Modify authentication and association frames to be always sent with link
-address as A1 and A3 for ease of Tx status handling.
-
-Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/ap/ieee802_11.c | 25 ++-----------------------
- 1 file changed, 2 insertions(+), 23 deletions(-)
-
-diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index 5a3132de4..b20300bab 100644
---- a/src/ap/ieee802_11.c
-+++ b/src/ap/ieee802_11.c
-@@ -416,14 +416,7 @@ static int send_auth_reply(struct hostapd_data *hapd, struct sta_info *sta,
- struct wpabuf *ml_resp = NULL;
-
- #ifdef CONFIG_IEEE80211BE
-- /*
-- * Once a non-AP MLD is added to the driver, the addressing should use
-- * the MLD MAC address. Thus, use the MLD address instead of translating
-- * the addresses.
-- */
- if (ap_sta_is_mld(hapd, sta)) {
-- sa = hapd->mld->mld_addr;
--
- ml_resp = hostapd_ml_auth_resp(hapd);
- if (!ml_resp)
- return -1;
-@@ -444,7 +437,7 @@ static int send_auth_reply(struct hostapd_data *hapd, struct sta_info *sta,
- WLAN_FC_STYPE_AUTH);
- os_memcpy(reply->da, dst, ETH_ALEN);
- os_memcpy(reply->sa, sa, ETH_ALEN);
-- os_memcpy(reply->bssid, bssid, ETH_ALEN);
-+ os_memcpy(reply->bssid, sa, ETH_ALEN);
-
- reply->u.auth.auth_alg = host_to_le16(auth_alg);
- reply->u.auth.auth_transaction = host_to_le16(auth_transaction);
-@@ -3265,14 +3258,9 @@ static void handle_auth(struct hostapd_data *hapd,
- bssid = mgmt->bssid;
-
- #ifdef CONFIG_IEEE80211BE
-- /*
-- * Once a non-AP MLD is added to the driver, the addressing should use
-- * the MLD MAC address. It is the responsibility of the driver to
-- * handle the translations.
-- */
- if (ap_sta_is_mld(hapd, sta)) {
- dst = sta->addr;
-- bssid = hapd->mld->mld_addr;
-+ bssid = hapd->own_addr;
- }
- #endif /* CONFIG_IEEE80211BE */
-
-@@ -4823,15 +4811,6 @@ static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
- (reassoc ? WLAN_FC_STYPE_REASSOC_RESP :
- WLAN_FC_STYPE_ASSOC_RESP));
-
--#ifdef CONFIG_IEEE80211BE
-- /*
-- * Once a non-AP MLD is added to the driver, the addressing should use
-- * MLD MAC address.
-- */
-- if (ap_sta_is_mld(hapd, sta) && allow_mld_addr_trans)
-- sa = hapd->mld->mld_addr;
--#endif /* CONFIG_IEEE80211BE */
--
- os_memcpy(reply->da, addr, ETH_ALEN);
- os_memcpy(reply->sa, sa, ETH_ALEN);
- os_memcpy(reply->bssid, sa, ETH_ALEN);
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0005-hostapd-afcd-add-AFC-daemon-support.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0005-hostapd-afcd-add-AFC-daemon-support.patch
new file mode 100644
index 0000000..2955527
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0005-hostapd-afcd-add-AFC-daemon-support.patch
@@ -0,0 +1,615 @@
+From f25cbdd28ff46a7beedd07f575614da7c7d269d7 Mon Sep 17 00:00:00 2001
+From: Lorenzo Bianconi <lorenzo@kernel.org>
+Date: Fri, 17 May 2024 11:50:25 +0200
+Subject: [PATCH 005/126] hostapd: afcd: add AFC daemon support
+
+Introduce Automated Frequency Coordination Daemon (AFCD) support
+for UNII-5 and UNII-7 6GHz bands.
+AFCD will be used by hostapd AFC client in order to forward the AFC
+request to the AFC coordinator and decouple AFC connection management
+from hostapd.
+AFC is required for Standard Power Devices (SPDs) to determine a lists
+of channels and EIRP/PSD powers that are available in the 6GHz spectrum.
+AFCD is tested with AFC DUT Test Harness [0].
+Add afc-reply.json as reference for replies from the AFC coordinator.
+
+[0] https://github.com/Wi-FiTestSuite/AFC-DUT/tree/main
+
+Tested-by: Felix Fietkau <nbd@nbd.name>
+Tested-by: Allen Ye <allen.ye@mediatek.com>
+Tested-by: Krishna Chaitanya <chaitanya.mgit@gmail.com>
+Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
+---
+ afc/.gitignore | 1 +
+ afc/Makefile | 31 +++++
+ afc/afc-reply.txt | 219 +++++++++++++++++++++++++++++++++
+ afc/afcd.c | 305 ++++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 556 insertions(+)
+ create mode 100644 afc/.gitignore
+ create mode 100644 afc/Makefile
+ create mode 100644 afc/afc-reply.txt
+ create mode 100644 afc/afcd.c
+
+diff --git a/afc/.gitignore b/afc/.gitignore
+new file mode 100644
+index 000000000..8d8cca905
+--- /dev/null
++++ b/afc/.gitignore
+@@ -0,0 +1 @@
++afcd
+diff --git a/afc/Makefile b/afc/Makefile
+new file mode 100644
+index 000000000..a83bd01db
+--- /dev/null
++++ b/afc/Makefile
+@@ -0,0 +1,31 @@
++ALL=afcd
++
++include ../src/build.rules
++
++CFLAGS += -I../src/utils
++CFLAGS += -I../src
++
++OBJS=afcd.o
++OBJS += ../src/utils/common.o
++OBJS += ../src/utils/wpa_debug.o
++OBJS += ../src/utils/wpabuf.o
++
++ifndef CONFIG_OS
++ifdef CONFIG_NATIVE_WINDOWS
++CONFIG_OS=win32
++else
++CONFIG_OS=unix
++endif
++endif
++OBJS += ../src/utils/os_$(CONFIG_OS).o
++
++LIBS += -lcurl
++
++_OBJS_VAR := OBJS
++include ../src/objs.mk
++afcd: $(OBJS)
++ $(Q)$(LDO) $(LDFLAGS) -o afcd $(OBJS) $(LIBS)
++ @$(E) " LD " $@
++
++clean: common-clean
++ rm -f core *~
+diff --git a/afc/afc-reply.txt b/afc/afc-reply.txt
+new file mode 100644
+index 000000000..aaa4f8956
+--- /dev/null
++++ b/afc/afc-reply.txt
+@@ -0,0 +1,219 @@
++HTTP/1.1 200 OK
++Content-Type: application/json
++Content-Length: 4843
++
++{
++ "availableSpectrumInquiryResponses":[
++ {
++ "availabilityExpireTime":"2023-02-23T12:53:18Z",
++ "availableChannelInfo":[
++ {
++ "channelCfi":[
++ 1,
++ 5,
++ 9,
++ 13,
++ 17,
++ 21,
++ 25,
++ 29,
++ 33,
++ 37,
++ 41,
++ 45,
++ 49,
++ 53,
++ 57,
++ 61,
++ 65,
++ 69,
++ 73,
++ 77,
++ 81,
++ 85,
++ 89,
++ 93,
++ 117,
++ 121,
++ 125,
++ 129,
++ 133,
++ 137,
++ 141,
++ 145,
++ 149,
++ 153,
++ 157,
++ 161,
++ 165,
++ 169,
++ 173,
++ 177,
++ 181
++ ],
++ "globalOperatingClass":131,
++ "maxEirp":[
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5
++ ]
++ },
++ {
++ "channelCfi":[
++ 3,
++ 11,
++ 19,
++ 27,
++ 35,
++ 43,
++ 51,
++ 59,
++ 67,
++ 75,
++ 83,
++ 91,
++ 123,
++ 131,
++ 139,
++ 147,
++ 155,
++ 163,
++ 171,
++ 179
++ ],
++ "globalOperatingClass":132,
++ "maxEirp":[
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5
++ ]
++ },
++ {
++ "channelCfi":[
++ 7,
++ 23,
++ 39,
++ 55,
++ 71,
++ 87,
++ 135,
++ 151,
++ 167
++ ],
++ "globalOperatingClass":133,
++ "maxEirp":[
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5,
++ 5
++ ]
++ },
++ {
++ "channelCfi":[
++ 15,
++ 47,
++ 79,
++ 143
++ ],
++ "globalOperatingClass":134,
++ "maxEirp":[
++ 5,
++ 5,
++ 5,
++ 5
++ ]
++ },
++ {
++ "channelCfi":[
++ ],
++ "globalOperatingClass":135,
++ "maxEirp":[
++ ]
++ }
++ ],
++ "availableFrequencyInfo":[
++ {
++ "frequencyRange":{
++ "highFrequency":6425,
++ "lowFrequency":5925
++ },
++ "maxPSD":3.98970004336019
++ },
++ {
++ "frequencyRange":{
++ "highFrequency":6865,
++ "lowFrequency":6525
++ },
++ "maxPSD":3.98970004336019
++ }
++ ],
++ "requestId":"11235813",
++ "response":{
++ "responseCode":0,
++ "shortDescription":"Success"
++ },
++ "rulesetId":"US_47_CFR_PART_15_SUBPART_E"
++ }
++ ],
++ "version":"1.1"
++}
+diff --git a/afc/afcd.c b/afc/afcd.c
+new file mode 100644
+index 000000000..2b99940ae
+--- /dev/null
++++ b/afc/afcd.c
+@@ -0,0 +1,305 @@
++/*
++ * Automated Frequency Coordination Daemon
++ * Copyright (c) 2024, Lorenzo Bianconi <lorenzo@kernel.org>
++ *
++ * This software may be distributed under the terms of the BSD license.
++ * See README for more details.
++ */
++
++#include <curl/curl.h>
++#include <sys/un.h>
++#include <sys/stat.h>
++
++#include "utils/includes.h"
++#include "utils/common.h"
++
++#define CURL_TIMEOUT 60
++#define AFCD_SOCK "afcd.sock"
++
++struct curl_ctx {
++ char *buf;
++ size_t buf_len;
++};
++
++static volatile bool exiting;
++
++static char *path = "/var/run";
++static char *bearer_token;
++static char *url;
++static int port = 443;
++
++
++static size_t afcd_curl_cb_write(void *ptr, size_t size, size_t nmemb,
++ void *userdata)
++{
++ struct curl_ctx *ctx = userdata;
++ char *buf;
++
++ buf = os_realloc(ctx->buf, ctx->buf_len + size * nmemb + 1);
++ if (!buf)
++ return 0;
++
++ ctx->buf = buf;
++ os_memcpy(buf + ctx->buf_len, ptr, size * nmemb);
++ buf[ctx->buf_len + size * nmemb] = '\0';
++ ctx->buf_len += size * nmemb;
++
++ return size * nmemb;
++}
++
++
++static int afcd_send_request(struct curl_ctx *ctx, unsigned char *request)
++{
++ struct curl_slist *headers = NULL, *tmp;
++ int ret = CURLE_FAILED_INIT;
++ CURL *curl;
++
++ wpa_printf(MSG_DEBUG, "Sending AFC request to %s", url);
++
++ curl_global_init(CURL_GLOBAL_ALL);
++ curl = curl_easy_init();
++ if (!curl)
++ goto out_global_cleanup;
++
++ headers = curl_slist_append(headers, "Accept: application/json");
++ if (!headers)
++ goto out_easy_cleanup;
++
++ tmp = curl_slist_append(headers, "Content-Type: application/json");
++ if (!tmp)
++ goto out_slist_free_all;
++ headers = tmp;
++
++ tmp = curl_slist_append(headers, "charset: utf-8");
++ if (!tmp)
++ goto out_slist_free_all;
++ headers = tmp;
++
++ curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
++ curl_easy_setopt(curl, CURLOPT_URL, url);
++ curl_easy_setopt(curl, CURLOPT_PORT, port);
++ curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
++ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,
++ afcd_curl_cb_write);
++ curl_easy_setopt(curl, CURLOPT_WRITEDATA, ctx);
++ curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcrp/0.1");
++ curl_easy_setopt(curl, CURLOPT_TIMEOUT, CURL_TIMEOUT);
++ curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
++ if (bearer_token)
++ curl_easy_setopt(curl, CURLOPT_XOAUTH2_BEARER, bearer_token);
++ curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BEARER);
++ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
++ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 1L);
++ curl_easy_setopt(curl, CURLOPT_POSTFIELDS, request);
++ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYSTATUS, 1L);
++
++ ret = curl_easy_perform(curl);
++ if (ret != CURLE_OK)
++ wpa_printf(MSG_ERROR, "curl_easy_perform failed: %s",
++ curl_easy_strerror(ret));
++
++out_slist_free_all:
++ curl_slist_free_all(headers);
++out_easy_cleanup:
++ curl_easy_cleanup(curl);
++out_global_cleanup:
++ curl_global_cleanup();
++
++ return ret == CURLE_OK ? 0 : -EINVAL;
++}
++
++
++static void handle_term(int sig)
++{
++ wpa_printf(MSG_ERROR, "Received signal %d", sig);
++ exiting = true;
++}
++
++
++static void usage(void)
++{
++ wpa_printf(MSG_ERROR,
++ "%s:\n"
++ "afcd -u<url> [-p<port>][-t<token>][-D<unix-sock dir>][-P<PID file>][-dB]",
++ __func__);
++}
++
++
++#define BUFSIZE 8192
++static int afcd_server_run(void)
++{
++ size_t len = os_strlen(path) + 1 + os_strlen(AFCD_SOCK);
++ struct sockaddr_un addr = {
++ .sun_family = AF_UNIX,
++#ifdef __FreeBSD__
++ .sun_len = sizeof(addr),
++#endif /* __FreeBSD__ */
++ };
++ int sockfd, ret = 0;
++ char *fname = NULL;
++ unsigned char *buf;
++ fd_set read_set;
++
++ if (len >= sizeof(addr.sun_path))
++ return -EINVAL;
++
++ if (mkdir(path, S_IRWXU | S_IRWXG) < 0 && errno != EEXIST)
++ return -EINVAL;
++
++ buf = os_malloc(BUFSIZE);
++ if (!buf)
++ return -ENOMEM;
++
++ fname = os_malloc(len + 1);
++ if (!fname) {
++ ret = -ENOMEM;
++ goto free_buf;
++ }
++
++ os_snprintf(fname, len + 1, "%s/%s", path, AFCD_SOCK);
++ fname[len] = '\0';
++ os_strlcpy(addr.sun_path, fname, sizeof(addr.sun_path));
++
++ sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
++ if (sockfd < 0) {
++ wpa_printf(MSG_ERROR, "Failed creating socket");
++ ret = -errno;
++ goto unlink;
++ }
++
++ if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
++ wpa_printf(MSG_ERROR, "Failed to bind socket");
++ ret = -errno;
++ goto close;
++ }
++
++ if (listen(sockfd, 10) < 0) {
++ wpa_printf(MSG_ERROR, "Failed to listen on socket");
++ ret = -errno;
++ goto close;
++ }
++
++ FD_ZERO(&read_set);
++ while (!exiting) {
++ socklen_t addr_len = sizeof(addr);
++ struct sockaddr_in6 c_addr;
++ struct timeval timeout = {
++ .tv_sec = 1,
++ };
++ struct curl_ctx ctx = {};
++ int fd;
++
++ FD_SET(sockfd, &read_set);
++ if (select(sockfd + 1, &read_set, NULL, NULL, &timeout) < 0) {
++ if (errno != EINTR) {
++ wpa_printf(MSG_ERROR,
++ "Select failed on socket");
++ ret = -errno;
++ break;
++ }
++ continue;
++ }
++
++ if (!FD_ISSET(sockfd, &read_set))
++ continue;
++
++ fd = accept(sockfd, (struct sockaddr *)&c_addr,
++ &addr_len);
++ if (fd < 0) {
++ if (errno != EINTR) {
++ wpa_printf(MSG_ERROR,
++ "Failed accepting connections");
++ ret = -errno;
++ break;
++ }
++ continue;
++ }
++
++ os_memset(buf, 0, BUFSIZE);
++ if (recv(fd, buf, BUFSIZE - 1, 0) <= 0) {
++ close(fd);
++ continue;
++ }
++
++ wpa_printf(MSG_DEBUG, "Received request: %s", buf);
++ if (!afcd_send_request(&ctx, buf)) {
++ wpa_printf(MSG_DEBUG, "Received reply: %s", ctx.buf);
++ send(fd, ctx.buf, ctx.buf_len, MSG_NOSIGNAL);
++ free(ctx.buf);
++ }
++ close(fd);
++ }
++close:
++ close(sockfd);
++unlink:
++ unlink(fname);
++ os_free(fname);
++free_buf:
++ os_free(buf);
++
++ return ret;
++}
++
++
++int main(int argc, char **argv)
++{
++ bool daemonize = false;
++ char *pid_file = NULL;
++
++ if (os_program_init())
++ return -1;
++
++ for (;;) {
++ int c = getopt(argc, argv, "u:p:t:D:P:hdB");
++
++ if (c < 0)
++ break;
++
++ switch (c) {
++ case 'h':
++ usage();
++ return 0;
++ case 'B':
++ daemonize = true;
++ break;
++ case 'D':
++ path = optarg;
++ break;
++ case 'P':
++ os_free(pid_file);
++ pid_file = os_rel2abs_path(optarg);
++ break;
++ case 'u':
++ url = optarg;
++ break;
++ case 'p':
++ port = atoi(optarg);
++ break;
++ case 'd':
++ if (wpa_debug_level > 0)
++ wpa_debug_level--;
++ break;
++ case 't':
++ bearer_token = optarg;
++ break;
++ default:
++ usage();
++ return -EINVAL;
++ }
++ }
++
++ if (!url) {
++ usage();
++ return -EINVAL;
++ }
++
++ if (daemonize && os_daemonize(pid_file)) {
++ wpa_printf(MSG_ERROR, "daemon: %s", strerror(errno));
++ return -EINVAL;
++ }
++
++ signal(SIGTERM, handle_term);
++ signal(SIGINT, handle_term);
++
++ return afcd_server_run();
++}
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0006-hostapd-MLO-reset-auth-state-machine-s-ML-info.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0006-hostapd-MLO-reset-auth-state-machine-s-ML-info.patch
deleted file mode 100644
index 2a7bacd..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0006-hostapd-MLO-reset-auth-state-machine-s-ML-info.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-From 4be7c245a946016c41a69c7469e00d22aaa32a46 Mon Sep 17 00:00:00 2001
-From: Aditya Kumar Singh <quic_adisi@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:36 +0530
-Subject: [PATCH 006/104] hostapd: MLO: reset auth state machine's ML info
-
-Currently auth state machine ML info is set only when the it is created
-newly. However, if the association is tried again, the state machine will
-exist already and hence the ML info will not be refreshed. This leads to
-an issue where if in the subsequent association request, the MLD info is
-different than old info then validation of it will fail.
-
-Fix this issue by refreshing the auth state machine's ML info every time
-association request is handled.
-
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/ap/ieee802_11.c | 32 ++++++++++++++++++--------------
- src/ap/wpa_auth.c | 1 +
- 2 files changed, 19 insertions(+), 14 deletions(-)
-
-diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index b20300bab..98398ccdd 100644
---- a/src/ap/ieee802_11.c
-+++ b/src/ap/ieee802_11.c
-@@ -4032,15 +4032,15 @@ static int __check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
-
- if (hapd->conf->wpa && wpa_ie) {
- enum wpa_validate_result res;
-+#ifdef CONFIG_IEEE80211BE
-+ struct mld_info *info = &sta->mld_info;
-+ bool init = false;
-+#endif /* CONFIG_IEEE80211BE */
-
- wpa_ie -= 2;
- wpa_ie_len += 2;
-
- if (!sta->wpa_sm) {
--#ifdef CONFIG_IEEE80211BE
-- struct mld_info *info = &sta->mld_info;
--#endif /* CONFIG_IEEE80211BE */
--
- sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth,
- sta->addr,
- p2p_dev_addr);
-@@ -4050,19 +4050,23 @@ static int __check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
- "Failed to initialize RSN state machine");
- return WLAN_STATUS_UNSPECIFIED_FAILURE;
- }
--
- #ifdef CONFIG_IEEE80211BE
-- if (ap_sta_is_mld(hapd, sta)) {
-- wpa_printf(MSG_DEBUG,
-- "MLD: Set ML info in RSN Authenticator");
-- wpa_auth_set_ml_info(sta->wpa_sm,
-- hapd->mld->mld_addr,
-- sta->mld_assoc_link_id,
-- info);
-- }
--#endif /* CONFIG_IEEE80211BE */
-+ init = true;
- }
-
-+ if (ap_sta_is_mld(hapd, sta)) {
-+ wpa_printf(MSG_DEBUG,
-+ "MLD: %s ML info in RSN Authenticator",
-+ init ? "Set" : "Reset");
-+ wpa_auth_set_ml_info(sta->wpa_sm,
-+ hapd->mld->mld_addr,
-+ sta->mld_assoc_link_id,
-+ info);
-+ }
-+#else
-+ }
-+#endif /* CONFIG_IEEE80211BE */
-+
- wpa_auth_set_auth_alg(sta->wpa_sm, sta->auth_alg);
- res = wpa_validate_wpa_ie(hapd->wpa_auth, sta->wpa_sm,
- hapd->iface->freq,
-diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
-index 01a10b23c..0d15c4209 100644
---- a/src/ap/wpa_auth.c
-+++ b/src/ap/wpa_auth.c
-@@ -6820,6 +6820,7 @@ void wpa_auth_set_ml_info(struct wpa_state_machine *sm, const u8 *mld_addr,
- return;
-
- os_memset(sm->mld_links, 0, sizeof(sm->mld_links));
-+ sm->n_mld_affiliated_links = 0;
-
- wpa_auth_logger(sm->wpa_auth, wpa_auth_get_spa(sm), LOGGER_DEBUG,
- "MLD: Initialization");
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0024-backport-hostapd-export-hostapd_is_usable_chans-util.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0006-hostapd-export-hostapd_is_usable_chans-utility-routi.patch
similarity index 75%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0024-backport-hostapd-export-hostapd_is_usable_chans-util.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0006-hostapd-export-hostapd_is_usable_chans-utility-routi.patch
index aac2145..7dc2584 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0024-backport-hostapd-export-hostapd_is_usable_chans-util.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0006-hostapd-export-hostapd_is_usable_chans-utility-routi.patch
@@ -1,12 +1,14 @@
-From 524c84524695034b8d531d70b546d5479d59641f Mon Sep 17 00:00:00 2001
-From: Evelyn Tsai <evelyn.tsai@mediatek.com>
-Date: Wed, 20 Mar 2024 07:17:31 +0800
-Subject: [PATCH 024/104] backport: hostapd: export hostapd_is_usable_chans
- utility routine
+From ce1dd0c7ab931cc448bed621a12033fbc94f36f1 Mon Sep 17 00:00:00 2001
+From: Lorenzo Bianconi <lorenzo@kernel.org>
+Date: Fri, 17 May 2024 11:50:26 +0200
+Subject: [PATCH 006/126] hostapd: export hostapd_is_usable_chans utility
+ routine
This is a preliminary patch to introduce AFC support.
+Tested-by: Felix Fietkau <nbd@nbd.name>
Tested-by: Allen Ye <allen.ye@mediatek.com>
+Tested-by: Krishna Chaitanya <chaitanya.mgit@gmail.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
src/ap/hw_features.c | 2 +-
@@ -14,10 +16,10 @@
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
-index fd401d78a..e652d7504 100644
+index c4556603d..85e67080d 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
-@@ -995,7 +995,7 @@ static bool hostapd_is_usable_punct_bitmap(struct hostapd_iface *iface)
+@@ -1008,7 +1008,7 @@ static bool hostapd_is_usable_punct_bitmap(struct hostapd_iface *iface)
* 0 = not usable
* -1 = not currently usable due to 6 GHz NO-IR
*/
@@ -51,5 +53,5 @@
#endif /* HW_FEATURES_H */
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0007-hostapd-MLO-add-support-for-cohosted-ML-BSS.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0007-hostapd-MLO-add-support-for-cohosted-ML-BSS.patch
deleted file mode 100644
index 9afd8f4..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0007-hostapd-MLO-add-support-for-cohosted-ML-BSS.patch
+++ /dev/null
@@ -1,201 +0,0 @@
-From d56daa4ebdf544a30f30986097edd6d5f9b8674f Mon Sep 17 00:00:00 2001
-From: Sriram R <quic_srirrama@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:37 +0530
-Subject: [PATCH 007/104] hostapd: MLO: add support for cohosted ML BSS
-
-Currently MLO is being supported with an assumption of only single BSS per
-link in the hostapd conf file. This needs to be extended when cohosted ML
-BSS exist in the same config file.
-
-Extend the support for cohosted BSSes. This is required for MBSSID MLO
-support as well.
-
-Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- hostapd/main.c | 38 +++++++-------------------
- src/ap/hostapd.c | 70 +++++++++++++++++++++++++++++++++++++++++++-----
- 2 files changed, 73 insertions(+), 35 deletions(-)
-
-diff --git a/hostapd/main.c b/hostapd/main.c
-index a43d3a5be..524a10274 100644
---- a/hostapd/main.c
-+++ b/hostapd/main.c
-@@ -158,6 +158,9 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
- struct hostapd_bss_config *conf = hapd->conf;
- u8 *b = conf->bssid;
- struct wpa_driver_capa capa;
-+#ifdef CONFIG_IEEE80211BE
-+ struct hostapd_data *h_hapd = NULL;
-+#endif /* CONFIG_IEEE80211BE */
-
- if (hapd->driver == NULL || hapd->driver->hapd_init == NULL) {
- wpa_printf(MSG_ERROR, "No hostapd driver wrapper available");
-@@ -165,35 +168,10 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
- }
-
- #ifdef CONFIG_IEEE80211BE
-- for (i = 0; conf->mld_ap && i < iface->interfaces->count; i++) {
-- struct hostapd_iface *h = iface->interfaces->iface[i];
-- struct hostapd_data *h_hapd = h->bss[0];
-- struct hostapd_bss_config *hconf = h_hapd->conf;
--
-- if (h == iface) {
-- wpa_printf(MSG_DEBUG, "MLD: Skip own interface");
-- continue;
-- }
--
-- if (!hconf->mld_ap) {
-- wpa_printf(MSG_DEBUG,
-- "MLD: Skip non-MLD");
-- continue;
-- }
--
-- if (!hostapd_is_ml_partner(hapd, h_hapd)) {
-- wpa_printf(MSG_DEBUG,
-- "MLD: Skip non matching MLD vif name");
-- continue;
-- }
--
-- wpa_printf(MSG_DEBUG, "MLD: Found matching MLD interface");
-- if (!h_hapd->drv_priv) {
-- wpa_printf(MSG_DEBUG,
-- "MLD: Matching MLD BSS not initialized yet");
-- continue;
-- }
-+ if (conf->mld_ap)
-+ h_hapd = hostapd_mld_get_first_bss(hapd);
-
-+ if (h_hapd) {
- hapd->drv_priv = h_hapd->drv_priv;
- hapd->interface_added = h_hapd->interface_added;
-
-@@ -214,6 +192,8 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
- }
-
- hostapd_mld_add_link(hapd);
-+ wpa_printf(MSG_DEBUG, "Setup of non first link (%d) BSS of MLD %s",
-+ hapd->mld_link_id, hapd->conf->iface);
-
- goto setup_mld;
- }
-@@ -298,6 +278,8 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
- os_memcpy(hapd->own_addr, b, ETH_ALEN);
-
- hostapd_mld_add_link(hapd);
-+ wpa_printf(MSG_DEBUG, "Setup of first link (%d) BSS of MLD %s",
-+ hapd->mld_link_id, hapd->conf->iface);
- }
-
- setup_mld:
-diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index f8cb6432d..ff1d8f9d0 100644
---- a/src/ap/hostapd.c
-+++ b/src/ap/hostapd.c
-@@ -1333,6 +1333,9 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first,
- char force_ifname[IFNAMSIZ];
- u8 if_addr[ETH_ALEN];
- int flush_old_stations = 1;
-+#ifdef CONFIG_IEEE80211BE
-+ struct hostapd_data *h_hapd = NULL;
-+#endif /* CONFIG_IEEE80211BE */
-
- if (!hostapd_mld_is_first_bss(hapd))
- wpa_printf(MSG_DEBUG,
-@@ -1379,6 +1382,21 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first,
- } while (mac_in_conf(hapd->iconf, hapd->own_addr));
- }
-
-+#ifdef CONFIG_IEEE80211BE
-+ if (conf->mld_ap) {
-+ h_hapd = hostapd_mld_get_first_bss(hapd);
-+
-+ if (h_hapd) {
-+ hapd->drv_priv = h_hapd->drv_priv;
-+ hapd->interface_added = h_hapd->interface_added;
-+ hostapd_mld_add_link(hapd);
-+ wpa_printf(MSG_DEBUG, "Setup of non first link (%d) BSS of MLD %s",
-+ hapd->mld_link_id, hapd->conf->iface);
-+ goto setup_mld;
-+ }
-+ }
-+#endif /* CONFIG_IEEE80211BE */
-+
- hapd->interface_added = 1;
- if (hostapd_if_add(hapd->iface->bss[0], WPA_IF_AP_BSS,
- conf->iface, addr, hapd,
-@@ -1393,8 +1411,33 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first,
-
- if (!addr)
- os_memcpy(hapd->own_addr, if_addr, ETH_ALEN);
-+
-+#ifdef CONFIG_IEEE80211BE
-+ if (hapd->conf->mld_ap) {
-+ wpa_printf(MSG_DEBUG, "Setup of first link (%d) BSS of MLD %s",
-+ hapd->mld_link_id, hapd->conf->iface);
-+ os_memcpy(hapd->mld->mld_addr, hapd->own_addr, ETH_ALEN);
-+ hostapd_mld_add_link(hapd);
-+ }
- }
-
-+setup_mld:
-+
-+ if (hapd->conf->mld_ap && !first) {
-+ wpa_printf(MSG_DEBUG,
-+ "MLD: Set link_id=%u, mld_addr=" MACSTR
-+ ", own_addr=" MACSTR,
-+ hapd->mld_link_id, MAC2STR(hapd->mld->mld_addr),
-+ MAC2STR(hapd->own_addr));
-+
-+ if (hostapd_drv_link_add(hapd, hapd->mld_link_id,
-+ hapd->own_addr))
-+ return -1;
-+ }
-+#else
-+ }
-+#endif /* CONFIG_IEEE80211BE */
-+
- if (conf->wmm_enabled < 0)
- conf->wmm_enabled = hapd->iconf->ieee80211n |
- hapd->iconf->ieee80211ax;
-@@ -4679,17 +4722,30 @@ void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx)
- struct hostapd_data * hostapd_mld_get_link_bss(struct hostapd_data *hapd,
- u8 link_id)
- {
-- unsigned int i;
-+ struct hostapd_iface *iface;
-+ struct hostapd_data *bss;
-+ struct hostapd_bss_config *conf;
-+ unsigned int i, j;
-
- for (i = 0; i < hapd->iface->interfaces->count; i++) {
-- struct hostapd_iface *h = hapd->iface->interfaces->iface[i];
-- struct hostapd_data *h_hapd = h->bss[0];
--
-- if (!hostapd_is_ml_partner(hapd, h_hapd))
-+ iface = hapd->iface->interfaces->iface[i];
-+ if (!iface)
- continue;
-
-- if (h_hapd->mld_link_id == link_id)
-- return h_hapd;
-+ for (j = 0; j < iface->num_bss; j++) {
-+ bss = iface->bss[j];
-+ conf = bss->conf;
-+
-+ if (!conf->mld_ap ||
-+ !hostapd_is_ml_partner(hapd, bss))
-+ continue;
-+
-+ if (!bss->drv_priv)
-+ continue;
-+
-+ if (bss->mld_link_id == link_id)
-+ return bss;
-+ }
- }
-
- return NULL;
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0025-backport-hostapd-ap-add-AFC-client-support.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0007-hostapd-ap-add-AFC-client-support.patch
similarity index 86%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0025-backport-hostapd-ap-add-AFC-client-support.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0007-hostapd-ap-add-AFC-client-support.patch
index 357ca69..0dce399 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0025-backport-hostapd-ap-add-AFC-client-support.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0007-hostapd-ap-add-AFC-client-support.patch
@@ -1,7 +1,7 @@
-From c635af2f526c7dc7a862e5c6fed5f2015d8e85b6 Mon Sep 17 00:00:00 2001
-From: Evelyn Tsai <evelyn.tsai@mediatek.com>
-Date: Wed, 20 Mar 2024 07:18:37 +0800
-Subject: [PATCH 025/104] backport: hostapd: ap: add AFC client support
+From 3bd1d33a94f25337fd70df60ee5a42a60f95cba9 Mon Sep 17 00:00:00 2001
+From: Lorenzo Bianconi <lorenzo@kernel.org>
+Date: Fri, 17 May 2024 11:50:27 +0200
+Subject: [PATCH 007/126] hostapd: ap: add AFC client support
Introduce Automated Frequency Coordination (AFC) support for UNII-5 and
UNII-7 6GHz bands.
@@ -13,47 +13,52 @@
[0] https://github.com/Wi-FiTestSuite/AFC-DUT/tree/main
+Tested-by: Felix Fietkau <nbd@nbd.name>
Tested-by: Allen Ye <allen.ye@mediatek.com>
+Tested-by: Krishna Chaitanya <chaitanya.mgit@gmail.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
- hostapd/Makefile | 6 +
- hostapd/config_file.c | 262 ++++++++++++
- hostapd/defconfig | 3 +
- hostapd/hostapd.conf | 42 ++
- src/ap/afc.c | 918 ++++++++++++++++++++++++++++++++++++++++++
- src/ap/ap_config.c | 16 +
- src/ap/ap_config.h | 47 +++
- src/ap/hostapd.c | 60 +++
- src/ap/hostapd.h | 29 ++
- src/ap/hw_features.c | 2 +
- 10 files changed, 1385 insertions(+)
+ hostapd/Makefile | 8 +
+ hostapd/config_file.c | 261 +++++++++++
+ hostapd/defconfig | 3 +
+ hostapd/hostapd.conf | 42 ++
+ src/ap/afc.c | 1041 +++++++++++++++++++++++++++++++++++++++++
+ src/ap/ap_config.c | 16 +
+ src/ap/ap_config.h | 47 ++
+ src/ap/hostapd.c | 16 +
+ src/ap/hostapd.h | 45 ++
+ src/ap/hw_features.c | 2 +
+ 10 files changed, 1481 insertions(+)
create mode 100644 src/ap/afc.c
diff --git a/hostapd/Makefile b/hostapd/Makefile
-index b3cb68673..405e05e5f 100644
+index ca4439234..78171025e 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
-@@ -103,6 +103,12 @@ CFLAGS += -DCONFIG_TAXONOMY
+@@ -104,6 +104,14 @@ CFLAGS += -DCONFIG_TAXONOMY
OBJS += ../src/ap/taxonomy.o
endif
++ifdef CONFIG_IEEE80211AX
+ifdef CONFIG_AFC
+CFLAGS += -DCONFIG_AFC
+OBJS += ../src/ap/afc.o
+LIBS += -ljson-c
+endif
++endif
+
ifdef CONFIG_MODULE_TESTS
CFLAGS += -DCONFIG_MODULE_TESTS
OBJS += hapd_module_tests.o
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index 56b2df3ae..261905368 100644
+index 96f1b1749..a86621ed9 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -2436,6 +2436,191 @@ static int get_u16(const char *pos, int line, u16 *ret_val)
- #endif /* CONFIG_IEEE80211BE */
-
+@@ -1281,6 +1281,190 @@ static int hostapd_parse_he_srg_bitmap(u8 *bitmap, char *val)
+ return 0;
+ }
++
+#ifdef CONFIG_AFC
+static int hostapd_afc_parse_cert_ids(struct hostapd_config *conf, char *pos)
+{
@@ -237,12 +242,10 @@
+ return 0;
+}
+#endif /* CONFIG_AFC */
-+
-+
- static int hostapd_config_fill(struct hostapd_config *conf,
- struct hostapd_bss_config *bss,
- const char *buf, char *pos, int line)
-@@ -3862,6 +4047,83 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+ #endif /* CONFIG_IEEE80211AX */
+
+
+@@ -3955,6 +4139,83 @@ static int hostapd_config_fill(struct hostapd_config *conf,
return 1;
}
bss->unsol_bcast_probe_resp_interval = val;
@@ -338,10 +341,10 @@
+# Enable Automated Frequency Coordination for 6GHz outdoor
+#CONFIG_AFC=y
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
-index d80abcac0..0d10998af 100644
+index 93524cf5d..56442c69d 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
-@@ -1005,6 +1005,48 @@ wmm_ac_vo_acm=0
+@@ -1030,6 +1030,48 @@ wmm_ac_vo_acm=0
# Valid range: 0..20 TUs; default is 0 (disabled)
#unsol_bcast_probe_resp_interval=0
@@ -392,10 +395,10 @@
#ieee80211be: Whether IEEE 802.11be (EHT) is enabled
diff --git a/src/ap/afc.c b/src/ap/afc.c
new file mode 100644
-index 000000000..c75d5d582
+index 000000000..cfee83fe7
--- /dev/null
+++ b/src/ap/afc.c
-@@ -0,0 +1,918 @@
+@@ -0,0 +1,1041 @@
+/*
+ * Automated Frequency Coordination
+ * Copyright (c) 2024, Lorenzo Bianconi <lorenzo@kernel.org>
@@ -417,7 +420,7 @@
+
+#define HOSTAPD_AFC_RETRY_TIMEOUT 180
+#define HOSTAPD_AFC_TIMEOUT 86400 /* 24h */
-+#define HOSTAPD_AFC_BUFSIZE 4096
++#define HOSTAPD_AFC_BUFSIZE 8192
+
+static void hostapd_afc_timeout_handler(void *eloop_ctx, void *timeout_ctx);
+
@@ -438,6 +441,9 @@
+ struct afc_linear_polygon *lp =
+ &iconf->afc.location.linear_polygon_data[0];
+
++ if (!lp)
++ goto error;
++
+ ellipse_obj = json_object_new_object();
+ if (!ellipse_obj)
+ goto error;
@@ -458,7 +464,6 @@
+ goto error;
+
+ json_object_object_add(center_obj, "latitude", str_obj);
-+
+ }
+
+ switch (iconf->afc.location.type) {
@@ -574,11 +579,14 @@
+ goto error;
+
+ json_object_object_add(elevation_obj, "height", str_obj);
-+ str_obj = json_object_new_string(iconf->afc.location.height_type);
-+ if (!str_obj)
-+ goto error;
++ if (iconf->afc.location.height_type) {
++ str_obj = json_object_new_string(iconf->afc.location.height_type);
++ if (!str_obj)
++ goto error;
+
-+ json_object_object_add(elevation_obj, "heightType", str_obj);
++ json_object_object_add(elevation_obj, "heightType", str_obj);
++ }
++
+ str_obj = json_object_new_int(iconf->afc.location.vertical_tolerance);
+ if (!str_obj)
+ goto error;
@@ -845,6 +853,9 @@
+ struct json_object *max_psd_obj;
+
+ range_elem_obj = json_object_array_get_idx(obj, i);
++ if (!range_elem_obj)
++ continue;
++
+ if (!json_object_object_get_ex(range_elem_obj,
+ "frequencyRange",
+ &freq_range_obj))
@@ -947,6 +958,9 @@
+ int ch, op_class;
+
+ range_elem_obj = json_object_array_get_idx(obj, i);
++ if (!range_elem_obj)
++ continue;
++
+ if (!json_object_object_get_ex(range_elem_obj,
+ "globalOperatingClass",
+ &op_class_obj))
@@ -1017,42 +1031,65 @@
+
+ wpa_printf(MSG_DEBUG, "Received AFC reply: %s", reply);
+ payload_obj = json_tokener_parse(reply);
-+ if (!payload_obj)
++ if (!payload_obj) {
++ wpa_printf(MSG_ERROR, "Failed to parse AFC reply payload");
+ return -EINVAL;
++ }
+
-+ if (!json_object_object_get_ex(payload_obj, "version", &version_obj))
++ if (!json_object_object_get_ex(payload_obj, "version", &version_obj)) {
++ wpa_printf(MSG_ERROR, "Missing version in AFC reply");
+ return -EINVAL;
++ }
+
+ if (iconf->afc.request.version &&
+ os_strcmp(iconf->afc.request.version,
-+ json_object_get_string(version_obj)))
++ json_object_get_string(version_obj))) {
++ wpa_printf(MSG_ERROR, "Mismatch in AFC reply version");
+ return -EINVAL;
++ }
+
+ if (!json_object_object_get_ex(payload_obj,
+ "availableSpectrumInquiryResponses",
-+ &reply_obj))
++ &reply_obj)) {
++ wpa_printf(MSG_ERROR,
++ "Missing availableSpectrumInquiry in AFC reply");
+ return -EINVAL;
++ }
+
+ for (i = 0; i < json_object_array_length(reply_obj); i++) {
+ struct json_object *reply_elem_obj, *obj, *status_obj;
+ int j, status = -EINVAL;
+
+ reply_elem_obj = json_object_array_get_idx(reply_obj, i);
-+ if (!reply_elem_obj)
++ if (!reply_elem_obj) {
++ wpa_printf(MSG_DEBUG,
++ "Failed to get reply element at index %d",
++ i);
+ continue;
++ }
+
+ if (!json_object_object_get_ex(reply_elem_obj, "requestId",
-+ &obj))
++ &obj)) {
++ wpa_printf(MSG_DEBUG,
++ "Missing requestId in reply element %d", i);
+ continue;
++ }
+
+ if (iconf->afc.request.id &&
+ os_strcmp(iconf->afc.request.id,
-+ json_object_get_string(obj)))
++ json_object_get_string(obj))) {
++ wpa_printf(MSG_DEBUG,
++ "RequestId mismatch in reply element %d",
++ i);
+ continue;
++ }
+
+ if (!json_object_object_get_ex(reply_elem_obj, "rulesetId",
-+ &obj))
++ &obj)) {
++ wpa_printf(MSG_DEBUG,
++ "Missing rulesetId in reply element %d", i);
+ continue;
++ }
+
+ for (j = 0; j < iconf->afc.n_cert_ids; j++) {
+ if (!os_strcmp(iconf->afc.cert_ids[j].rulset,
@@ -1060,12 +1097,20 @@
+ break;
+ }
+
-+ if (j == iconf->afc.n_cert_ids)
++ if (j == iconf->afc.n_cert_ids) {
++ wpa_printf(MSG_DEBUG,
++ "RulesetId mismatch in reply element %d",
++ i);
+ continue;
++ }
+
+ if (!json_object_object_get_ex(reply_elem_obj, "response",
-+ &obj))
++ &obj)) {
++ wpa_printf(MSG_DEBUG,
++ "Missing response field in reply element %d",
++ i);
+ continue;
++ }
+
+ if (json_object_object_get_ex(obj, "shortDescription",
+ &status_obj))
@@ -1076,8 +1121,12 @@
+ &status_obj))
+ status = json_object_get_int(status_obj);
+
-+ if (status < 0)
++ if (status < 0) {
++ wpa_printf(MSG_DEBUG,
++ "Reply element %d invalid responseCode: %d",
++ i, status);
+ continue;
++ }
+
+ if (hostad_afc_parse_available_freq_info(iface,
+ reply_elem_obj) ||
@@ -1119,8 +1168,8 @@
+ .sun_len = sizeof(addr),
+#endif /* __FreeBSD__ */
+ };
-+ char buf[HOSTAPD_AFC_BUFSIZE] = {};
+ const char *request;
++ char *buf = NULL;
+ int sockfd, ret;
+ fd_set read_set;
+
@@ -1129,6 +1178,11 @@
+ return 0;
+ }
+
++ if (!iconf->afc.socket) {
++ wpa_printf(MSG_ERROR, "Missing AFC socket string");
++ return -EINVAL;
++ }
++
+ iface->afc.timeout = HOSTAPD_AFC_RETRY_TIMEOUT;
+ if (os_strlen(iconf->afc.socket) >= sizeof(addr.sun_path)) {
+ wpa_printf(MSG_ERROR, "Malformed AFC socket string %s",
@@ -1175,12 +1229,21 @@
+ goto close_sock;
+ }
+
++ buf = os_zalloc(HOSTAPD_AFC_BUFSIZE);
++ if (!buf) {
++ ret = -ENOMEM;
++ goto close_sock;
++ }
++
-+ ret = recv(sockfd, buf, sizeof(buf), 0);
++ ret = recv(sockfd, buf, HOSTAPD_AFC_BUFSIZE - 1, 0);
+ if (ret <= 0)
+ goto close_sock;
+
+ ret = hostapd_afc_parse_reply(iface, buf);
++ if (ret)
++ wpa_printf(MSG_ERROR, "Failed parsing AFC reply: %d", ret);
+close_sock:
++ os_free(buf);
+ json_object_put(request_obj);
+ close(sockfd);
+
@@ -1207,7 +1270,7 @@
+
+ if (chan->chan == ch &&
+ !(chan->flag & HOSTAPD_CHAN_DISABLED))
-+ return true;
++ return true;
+ }
+ }
+
@@ -1246,13 +1309,17 @@
+ if (!hostapd_afc_has_usable_chans(iface))
+ goto resched;
+
-+ /* Trigger an ACS freq scan */
-+ iconf->channel = 0;
-+ iface->freq = 0;
++ if (!hostapd_is_usable_chans(iface)) {
++ /* Trigger an ACS freq scan */
++ iconf->channel = 0;
++ iface->freq = 0;
+
-+ if (acs_init(iface) != HOSTAPD_CHAN_ACS) {
-+ wpa_printf(MSG_ERROR, "Could not start ACS");
-+ ret = -EINVAL;
++ if (acs_init(iface) != HOSTAPD_CHAN_ACS) {
++ wpa_printf(MSG_ERROR, "Could not start ACS");
++ ret = -EINVAL;
++ }
++ } else {
++ ret = 1;
+ }
+
+resched:
@@ -1286,7 +1353,7 @@
+
+ hostapd_afc_delete_data_from_server(iface);
+ if (iface->state != HAPD_IFACE_ENABLED) {
-+ /* Hostapd is not fully enabled yet, toogle the interface */
++ /* Hostapd is not fully enabled yet, toggle the interface */
+ goto restart_interface;
+ }
+
@@ -1314,11 +1381,70 @@
+ eloop_register_timeout(iface->afc.timeout, 0,
+ hostapd_afc_timeout_handler, iface, NULL);
+}
++
++
++void hostapd_afc_stop(struct hostapd_iface *iface)
++{
++ eloop_cancel_timeout(hostapd_afc_timeout_handler, iface, NULL);
++}
++
++
++void hostap_afc_disable_channels(struct hostapd_iface *iface)
++{
++ struct hostapd_hw_modes *mode = NULL;
++ int i;
++
++ for (i = 0; i < iface->num_hw_features; i++) {
++ mode = &iface->hw_features[i];
++ if (mode->mode == HOSTAPD_MODE_IEEE80211A &&
++ mode->is_6ghz)
++ break;
++ }
++
++ if (i == iface->num_hw_features)
++ return;
++
++ if (!he_reg_is_sp(iface->conf->he_6ghz_reg_pwr_type))
++ return;
++
++ if (!iface->afc.data_valid)
++ return;
++
++ for (i = 0; i < mode->num_channels; i++) {
++ struct hostapd_channel_data *chan = &mode->channels[i];
++ int j;
++
++ if (!is_6ghz_freq(chan->freq))
++ continue;
++
++ for (j = 0; j < iface->afc.num_freq_range; j++) {
++ if (chan->freq >= iface->afc.freq_range[j].low_freq &&
++ chan->freq <= iface->afc.freq_range[j].high_freq)
++ break;
++ }
++
++ if (j != iface->afc.num_freq_range)
++ continue;
++
++ for (j = 0; j < iface->afc.num_chan_info; j++) {
++ if (chan->chan == iface->afc.chan_info_list[j].chan)
++ break;
++ }
++
++ if (j != iface->afc.num_chan_info)
++ continue;
++
++ chan->flag |= HOSTAPD_CHAN_DISABLED;
++ wpa_printf(MSG_MSGDUMP,
++ "Disabling freq=%d MHz (not allowed by AFC)",
++ chan->freq);
++ }
++}
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
-index 1a18df617..ca67aeb41 100644
+index c6aa49610..9e34e029a 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
-@@ -1035,6 +1035,22 @@ void hostapd_config_free(struct hostapd_config *conf)
+@@ -1047,6 +1047,22 @@ void hostapd_config_free(struct hostapd_config *conf)
#endif /* CONFIG_ACS */
wpabuf_free(conf->lci);
wpabuf_free(conf->civic);
@@ -1342,13 +1468,13 @@
os_free(conf);
}
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 754d55331..2330163c4 100644
+index d42076785..e6669e6a3 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1225,6 +1225,53 @@ struct hostapd_config {
- MBSSID_ENABLED = 1,
- ENHANCED_MBSSID_ENABLED = 2,
- } mbssid;
+@@ -1249,6 +1249,53 @@ struct hostapd_config {
+
+ /* Whether to enable TWT responder in HT and VHT modes */
+ bool ht_vht_twt_responder;
+
+#ifdef CONFIG_AFC
+ struct {
@@ -1400,14 +1526,22 @@
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index ff1d8f9d0..916ac00c4 100644
+index 36d48ae09..5a8cdc90e 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -2497,6 +2497,16 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface,
+@@ -715,6 +715,7 @@ void hostapd_cleanup_iface_partial(struct hostapd_iface *iface)
+ static void hostapd_cleanup_iface(struct hostapd_iface *iface)
+ {
+ wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface);
++ hostapd_afc_stop(iface);
+ eloop_cancel_timeout(hostapd_interface_setup_failure_handler, iface,
+ NULL);
+
+@@ -2559,6 +2560,16 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface,
}
#endif /* CONFIG_MESH */
-+#ifdef CONFIG_AFC
++#ifdef CONFIG_IEEE80211AX
+ /* check AFC for 6GHz channels. */
+ res = hostapd_afc_handle_request(iface);
+ if (res <= 0) {
@@ -1415,12 +1549,20 @@
+ goto fail;
+ return res;
+ }
-+#endif /* CONFIG_AFC */
++#endif /* CONFIG_IEEE80211AX */
+
if (!delay_apply_cfg &&
hostapd_set_freq(hapd, hapd->iconf->hw_mode, iface->freq,
hapd->iconf->channel,
-@@ -2968,6 +2978,10 @@ void hostapd_interface_free(struct hostapd_iface *iface)
+@@ -2957,6 +2968,7 @@ void hostapd_interface_deinit(struct hostapd_iface *iface)
+
+ hostapd_set_state(iface, HAPD_IFACE_DISABLED);
+
++ hostapd_afc_stop(iface);
+ eloop_cancel_timeout(channel_list_update_timeout, iface, NULL);
+ iface->wait_channel_update = 0;
+ iface->is_no_ir = false;
+@@ -3030,6 +3042,10 @@ void hostapd_interface_free(struct hostapd_iface *iface)
__func__, iface->bss[j]);
os_free(iface->bss[j]);
}
@@ -1431,64 +1573,14 @@
hostapd_cleanup_iface(iface);
}
-@@ -4888,3 +4902,49 @@ u16 hostapd_get_punct_bitmap(struct hostapd_data *hapd)
-
- return punct_bitmap;
- }
-+
-+
-+void hostap_afc_disable_channels(struct hostapd_iface *iface)
-+{
-+#ifdef CONFIG_AFC
-+ struct hostapd_hw_modes *mode;
-+ int i;
-+
-+ if (iface->num_hw_features < HOSTAPD_MODE_IEEE80211A)
-+ return;
-+
-+ if (!he_reg_is_sp(iface->conf->he_6ghz_reg_pwr_type))
-+ return;
-+
-+ if (!iface->afc.data_valid)
-+ return;
-+
-+ mode = &iface->hw_features[HOSTAPD_MODE_IEEE80211A];
-+ for (i = 0; i < mode->num_channels; i++) {
-+ struct hostapd_channel_data *chan = &mode->channels[i];
-+ int j;
-+
-+ if (!is_6ghz_freq(chan->freq))
-+ continue;
-+
-+ for (j = 0; j < iface->afc.num_freq_range; j++) {
-+ if (chan->freq >= iface->afc.freq_range[j].low_freq &&
-+ chan->freq <= iface->afc.freq_range[j].high_freq)
-+ break;
-+ }
-+
-+ if (j != iface->afc.num_freq_range)
-+ continue;
-+
-+ for (j = 0; j < iface->afc.num_chan_info; j++) {
-+ if (chan->chan == iface->afc.chan_info_list[j].chan)
-+ break;
-+ }
-+
-+ if (j != iface->afc.num_chan_info)
-+ continue;
-+
-+ chan->flag |= HOSTAPD_CHAN_DISABLED;
-+ }
-+#endif /* CONFIG_AFC */
-+}
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
-index d12efb104..18bcb82d9 100644
+index 2ef63e5f2..d67a0afa0 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
-@@ -700,9 +700,38 @@ struct hostapd_iface {
-
- /* Configured freq of interface is NO_IR */
+@@ -718,9 +718,54 @@ struct hostapd_iface {
bool is_no_ir;
+
+ bool is_ch_switch_dfs; /* Channel switch from ACS to DFS */
+
+#ifdef CONFIG_AFC
+ struct {
@@ -1518,14 +1610,30 @@
};
/* hostapd.c */
-+void hostap_afc_disable_channels(struct hostapd_iface *iface);
++#ifdef CONFIG_AFC
+int hostapd_afc_handle_request(struct hostapd_iface *iface);
++void hostapd_afc_stop(struct hostapd_iface *iface);
++void hostap_afc_disable_channels(struct hostapd_iface *iface);
++#else
++static inline int hostapd_afc_handle_request(struct hostapd_iface *iface)
++{
++ return 1;
++}
++
++static inline void hostapd_afc_stop(struct hostapd_iface *iface)
++{
++}
++
++static inline void hostap_afc_disable_channels(struct hostapd_iface *iface)
++{
++}
++#endif /* CONFIG_AFC */
+
int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
int (*cb)(struct hostapd_iface *iface,
void *ctx), void *ctx);
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
-index e652d7504..222f3dc05 100644
+index 85e67080d..8aa0b3ab5 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -114,6 +114,8 @@ int hostapd_get_hw_features(struct hostapd_iface *iface)
@@ -1538,5 +1646,5 @@
struct hostapd_hw_modes *feature = &modes[i];
int dfs_enabled = hapd->iconf->ieee80211h &&
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0008-hostapd-MLO-extend-support-for-cohosted-ML-BSS.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0008-hostapd-MLO-extend-support-for-cohosted-ML-BSS.patch
deleted file mode 100644
index 42c4b67..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0008-hostapd-MLO-extend-support-for-cohosted-ML-BSS.patch
+++ /dev/null
@@ -1,368 +0,0 @@
-From 27dbd9d9796d656c8cf78d51d48162208080a987 Mon Sep 17 00:00:00 2001
-From: Sriram R <quic_srirrama@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:38 +0530
-Subject: [PATCH 008/104] hostapd: MLO: extend support for cohosted ML BSS
-
-Modify necessary helper apis to support multiple BSS support for MLO to
-make the changes scalable.
-
-Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/ap/ieee802_11.c | 116 ++++++++++++++++------------------------
- src/ap/ieee802_11_eht.c | 27 +++-------
- src/ap/wpa_auth_glue.c | 52 +++++++++++-------
- 3 files changed, 89 insertions(+), 106 deletions(-)
-
-diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index 98398ccdd..26e3d8356 100644
---- a/src/ap/ieee802_11.c
-+++ b/src/ap/ieee802_11.c
-@@ -4567,7 +4567,7 @@ int hostapd_process_assoc_ml_info(struct hostapd_data *hapd,
- bool offload)
- {
- #ifdef CONFIG_IEEE80211BE
-- unsigned int i, j;
-+ unsigned int i;
-
- if (!hostapd_is_mld_ap(hapd))
- return 0;
-@@ -4582,25 +4582,25 @@ int hostapd_process_assoc_ml_info(struct hostapd_data *hapd,
- hostapd_wpa_ie(hapd, WLAN_EID_RSNX);
-
- for (i = 0; i < MAX_NUM_MLD_LINKS; i++) {
-- struct hostapd_iface *iface = NULL;
-+ struct hostapd_data *bss = NULL;
- struct mld_link_info *link = &sta->mld_info.links[i];
-+ bool link_bss_found = false;
-
- if (!link->valid)
- continue;
-
-- for (j = 0; j < hapd->iface->interfaces->count; j++) {
-- iface = hapd->iface->interfaces->iface[j];
-+ for_each_mld_link(bss, hapd) {
-+ if (bss == hapd)
-+ continue;
-
-- if (hapd->iface == iface)
-+ if (bss->mld_link_id != i)
- continue;
-
-- if (hostapd_is_ml_partner(hapd, iface->bss[0]) &&
-- i == iface->bss[0]->mld_link_id)
-- break;
-+ link_bss_found = true;
-+ break;
- }
-
-- if (!iface || j == hapd->iface->interfaces->count ||
-- TEST_FAIL()) {
-+ if (!link_bss_found || TEST_FAIL()) {
- wpa_printf(MSG_DEBUG,
- "MLD: No link match for link_id=%u", i);
-
-@@ -4613,7 +4613,7 @@ int hostapd_process_assoc_ml_info(struct hostapd_data *hapd,
- if (!offload)
- ieee80211_ml_build_assoc_resp(hapd, link);
- } else {
-- if (ieee80211_ml_process_link(iface->bss[0], sta, link,
-+ if (ieee80211_ml_process_link(bss, sta, link,
- ies, ies_len, reassoc,
- offload))
- return -1;
-@@ -5777,7 +5777,7 @@ static bool hostapd_ml_handle_disconnect(struct hostapd_data *hapd,
- #ifdef CONFIG_IEEE80211BE
- struct hostapd_data *assoc_hapd, *tmp_hapd;
- struct sta_info *assoc_sta;
-- unsigned int i, link_id;
-+ struct sta_info *tmp_sta;
-
- if (!hostapd_is_mld_ap(hapd))
- return false;
-@@ -5790,45 +5790,27 @@ static bool hostapd_ml_handle_disconnect(struct hostapd_data *hapd,
- if (!assoc_sta)
- return false;
-
-- for (link_id = 0; link_id < MAX_NUM_MLD_LINKS; link_id++) {
-- for (i = 0; i < assoc_hapd->iface->interfaces->count; i++) {
-- struct sta_info *tmp_sta;
--
-- if (!assoc_sta->mld_info.links[link_id].valid)
-- continue;
-+ for_each_mld_link(tmp_hapd, assoc_hapd) {
-+ if (tmp_hapd == assoc_hapd)
-+ continue;
-
-- tmp_hapd =
-- assoc_hapd->iface->interfaces->iface[i]->bss[0];
-+ if (!assoc_sta->mld_info.links[tmp_hapd->mld_link_id].valid)
-+ continue;
-
-- if (!hostapd_is_ml_partner(assoc_hapd, tmp_hapd))
-+ for (tmp_sta = tmp_hapd->sta_list; tmp_sta;
-+ tmp_sta = tmp_sta->next) {
-+ if (tmp_sta->mld_assoc_link_id !=
-+ assoc_sta->mld_assoc_link_id ||
-+ tmp_sta->aid != assoc_sta->aid)
- continue;
-
-- for (tmp_sta = tmp_hapd->sta_list; tmp_sta;
-- tmp_sta = tmp_sta->next) {
-- /*
-- * Remove the station on which the association
-- * was done only after all other link stations
-- * are removed. Since there is only a single
-- * station per struct hostapd_hapd with the
-- * same association link simply break out from
-- * the loop.
-- */
-- if (tmp_sta == assoc_sta)
-- break;
--
-- if (tmp_sta->mld_assoc_link_id !=
-- assoc_sta->mld_assoc_link_id ||
-- tmp_sta->aid != assoc_sta->aid)
-- continue;
--
-- if (!disassoc)
-- hostapd_deauth_sta(tmp_hapd, tmp_sta,
-- mgmt);
-- else
-- hostapd_disassoc_sta(tmp_hapd, tmp_sta,
-- mgmt);
-- break;
-- }
-+ if (!disassoc)
-+ hostapd_deauth_sta(tmp_hapd, tmp_sta,
-+ mgmt);
-+ else
-+ hostapd_disassoc_sta(tmp_hapd, tmp_sta,
-+ mgmt);
-+ break;
- }
- }
-
-@@ -6451,38 +6433,34 @@ static void hostapd_ml_handle_assoc_cb(struct hostapd_data *hapd,
- struct sta_info *sta, bool ok)
- {
- #ifdef CONFIG_IEEE80211BE
-- unsigned int i, link_id;
-+ struct hostapd_data *tmp_hapd;
-
- if (!hostapd_is_mld_ap(hapd))
- return;
-
-- for (link_id = 0; link_id < MAX_NUM_MLD_LINKS; link_id++) {
-- struct mld_link_info *link = &sta->mld_info.links[link_id];
-+ for_each_mld_link(tmp_hapd, hapd) {
-+ struct mld_link_info *link =
-+ &sta->mld_info.links[tmp_hapd->mld_link_id];
-+ struct sta_info *tmp_sta;
-
-- if (!link->valid)
-+ if (tmp_hapd == hapd)
- continue;
-
-- for (i = 0; i < hapd->iface->interfaces->count; i++) {
-- struct sta_info *tmp_sta;
-- struct hostapd_data *tmp_hapd =
-- hapd->iface->interfaces->iface[i]->bss[0];
-+ if (!link->valid)
-+ continue;
-
-- if (!hostapd_is_ml_partner(tmp_hapd, hapd))
-+ for (tmp_sta = tmp_hapd->sta_list; tmp_sta;
-+ tmp_sta = tmp_sta->next) {
-+ if (tmp_sta == sta ||
-+ tmp_sta->mld_assoc_link_id !=
-+ sta->mld_assoc_link_id ||
-+ tmp_sta->aid != sta->aid)
- continue;
-
-- for (tmp_sta = tmp_hapd->sta_list; tmp_sta;
-- tmp_sta = tmp_sta->next) {
-- if (tmp_sta == sta ||
-- tmp_sta->mld_assoc_link_id !=
-- sta->mld_assoc_link_id ||
-- tmp_sta->aid != sta->aid)
-- continue;
--
-- ieee80211_ml_link_sta_assoc_cb(tmp_hapd,
-- tmp_sta, link,
-- ok);
-- break;
-- }
-+ ieee80211_ml_link_sta_assoc_cb(tmp_hapd,
-+ tmp_sta, link,
-+ ok);
-+ break;
- }
- }
- #endif /* CONFIG_IEEE80211BE */
-diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
-index 7365057ad..353a4116e 100644
---- a/src/ap/ieee802_11_eht.c
-+++ b/src/ap/ieee802_11_eht.c
-@@ -1029,7 +1029,7 @@ const u8 * hostapd_process_ml_auth(struct hostapd_data *hapd,
- static int hostapd_mld_validate_assoc_info(struct hostapd_data *hapd,
- struct sta_info *sta)
- {
-- u8 i, link_id;
-+ u8 link_id;
- struct mld_info *info = &sta->mld_info;
-
- if (!ap_sta_is_mld(hapd, sta)) {
-@@ -1049,31 +1049,20 @@ static int hostapd_mld_validate_assoc_info(struct hostapd_data *hapd,
- for (link_id = 0; link_id < MAX_NUM_MLD_LINKS; link_id++) {
- struct hostapd_data *other_hapd;
-
-- if (!info->links[link_id].valid)
-+ if (!info->links[link_id].valid || link_id == hapd->mld_link_id)
- continue;
-
-- for (i = 0; i < hapd->iface->interfaces->count; i++) {
-- other_hapd = hapd->iface->interfaces->iface[i]->bss[0];
--
-- if (hapd == other_hapd)
-- continue;
--
-- if (hostapd_is_ml_partner(hapd, other_hapd) &&
-- link_id == other_hapd->mld_link_id)
-- break;
-- }
--
-- if (i == hapd->iface->interfaces->count &&
-- link_id != hapd->mld_link_id) {
-+ other_hapd = hostapd_mld_get_link_bss(hapd, link_id);
-+ if (!other_hapd) {
- wpa_printf(MSG_DEBUG, "MLD: Invalid link ID=%u",
- link_id);
- return -1;
- }
-
-- if (i < hapd->iface->interfaces->count)
-- os_memcpy(info->links[link_id].local_addr,
-- other_hapd->own_addr,
-- ETH_ALEN);
-+ os_memcpy(info->links[link_id].local_addr,
-+ other_hapd->own_addr,
-+ ETH_ALEN);
-+
- }
-
- return 0;
-diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c
-index 012f2b803..d3cd44695 100644
---- a/src/ap/wpa_auth_glue.c
-+++ b/src/ap/wpa_auth_glue.c
-@@ -1537,7 +1537,7 @@ static int hostapd_wpa_auth_get_ml_rsn_info(void *ctx,
- struct wpa_auth_ml_rsn_info *info)
- {
- struct hostapd_data *hapd = ctx;
-- unsigned int i, j;
-+ unsigned int i;
-
- wpa_printf(MSG_DEBUG, "WPA_AUTH: MLD: Get RSN info CB: n_mld_links=%u",
- info->n_mld_links);
-@@ -1547,26 +1547,33 @@ static int hostapd_wpa_auth_get_ml_rsn_info(void *ctx,
-
- for (i = 0; i < info->n_mld_links; i++) {
- unsigned int link_id = info->links[i].link_id;
-+ struct hostapd_data *bss = NULL;
-+ bool link_bss_found = false;
-
- wpa_printf(MSG_DEBUG,
- "WPA_AUTH: MLD: Get link RSN CB: link_id=%u",
- link_id);
-
-- for (j = 0; j < hapd->iface->interfaces->count; j++) {
-- struct hostapd_iface *iface =
-- hapd->iface->interfaces->iface[j];
-+ if (hapd->mld_link_id == link_id) {
-+ wpa_auth_ml_get_rsn_info(hapd->wpa_auth,
-+ &info->links[i]);
-+ continue;
-+ }
-
-- if (!hostapd_is_ml_partner(hapd, iface->bss[0]) ||
-- link_id != iface->bss[0]->mld_link_id ||
-- !iface->bss[0]->wpa_auth)
-+ for_each_mld_link(bss, hapd) {
-+ if (bss == hapd)
- continue;
-
-- wpa_auth_ml_get_rsn_info(iface->bss[0]->wpa_auth,
-+ if (bss->mld_link_id != link_id)
-+ continue;
-+
-+ wpa_auth_ml_get_rsn_info(bss->wpa_auth,
- &info->links[i]);
-+ link_bss_found = true;
- break;
- }
-
-- if (j == hapd->iface->interfaces->count)
-+ if (!link_bss_found)
- wpa_printf(MSG_DEBUG,
- "WPA_AUTH: MLD: link=%u not found", link_id);
- }
-@@ -1579,7 +1586,7 @@ static int hostapd_wpa_auth_get_ml_key_info(void *ctx,
- struct wpa_auth_ml_key_info *info)
- {
- struct hostapd_data *hapd = ctx;
-- unsigned int i, j;
-+ unsigned int i;
-
- wpa_printf(MSG_DEBUG, "WPA_AUTH: MLD: Get key info CB: n_mld_links=%u",
- info->n_mld_links);
-@@ -1588,29 +1595,38 @@ static int hostapd_wpa_auth_get_ml_key_info(void *ctx,
- return -1;
-
- for (i = 0; i < info->n_mld_links; i++) {
-+ struct hostapd_data *bss = NULL;
- u8 link_id = info->links[i].link_id;
-+ bool link_bss_found = false;
-
- wpa_printf(MSG_DEBUG,
- "WPA_AUTH: MLD: Get link info CB: link_id=%u",
- link_id);
-
-- for (j = 0; j < hapd->iface->interfaces->count; j++) {
-- struct hostapd_iface *iface =
-- hapd->iface->interfaces->iface[j];
-+ if (hapd->mld_link_id == link_id) {
-+ wpa_auth_ml_get_key_info(hapd->wpa_auth,
-+ &info->links[i],
-+ info->mgmt_frame_prot,
-+ info->beacon_prot);
-+ continue;
-+ }
-+
-+ for_each_mld_link(bss, hapd) {
-+ if (bss == hapd)
-+ continue;
-
-- if (!hostapd_is_ml_partner(hapd, iface->bss[0]) ||
-- link_id != iface->bss[0]->mld_link_id ||
-- !iface->bss[0]->wpa_auth)
-+ if (bss->mld_link_id != link_id)
- continue;
-
-- wpa_auth_ml_get_key_info(iface->bss[0]->wpa_auth,
-+ wpa_auth_ml_get_key_info(bss->wpa_auth,
- &info->links[i],
- info->mgmt_frame_prot,
- info->beacon_prot);
-+ link_bss_found = true;
- break;
- }
-
-- if (j == hapd->iface->interfaces->count)
-+ if (!link_bss_found)
- wpa_printf(MSG_DEBUG,
- "WPA_AUTH: MLD: link=%u not found", link_id);
- }
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0026-backport-hostapd-update-TPE-IE-according-to-AFC.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0008-hostapd-update-TPE-IE-according-to-AFC.patch
similarity index 77%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0026-backport-hostapd-update-TPE-IE-according-to-AFC.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0008-hostapd-update-TPE-IE-according-to-AFC.patch
index 42ff1d2..c6752f7 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0026-backport-hostapd-update-TPE-IE-according-to-AFC.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0008-hostapd-update-TPE-IE-according-to-AFC.patch
@@ -1,31 +1,34 @@
-From b2078261e779c949218974a054dc52f3dc5493c7 Mon Sep 17 00:00:00 2001
-From: Evelyn Tsai <evelyn.tsai@mediatek.com>
-Date: Wed, 20 Mar 2024 07:20:01 +0800
-Subject: [PATCH 026/104] backport: hostapd: update TPE IE according to AFC
+From 4e29b0943aeb681e09dcd0e59ae3532246f44c3d Mon Sep 17 00:00:00 2001
+From: Lorenzo Bianconi <lorenzo@kernel.org>
+Date: Fri, 17 May 2024 11:50:28 +0200
+Subject: [PATCH 008/126] hostapd: update TPE IE according to AFC
Update Transmit Power Envelope (TPE) IE according to the reply from AFC
coordinator on UNII-5 or UNII-7 6GHz bands.
+Tested-by: Felix Fietkau <nbd@nbd.name>
Tested-by: Allen Ye <allen.ye@mediatek.com>
+Tested-by: Krishna Chaitanya <chaitanya.mgit@gmail.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
- src/ap/hostapd.c | 39 +++++++++++++++++++++++++++++++++++++
- src/ap/hostapd.h | 2 ++
+ src/ap/afc.c | 37 +++++++++++++++++++++++++++++++++++
+ src/ap/hostapd.h | 9 +++++++++
src/ap/ieee802_11.c | 47 ++++++++++++++++++++++++++++-----------------
- 3 files changed, 70 insertions(+), 18 deletions(-)
+ 3 files changed, 75 insertions(+), 18 deletions(-)
-diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index 916ac00c4..b899c9831 100644
---- a/src/ap/hostapd.c
-+++ b/src/ap/hostapd.c
-@@ -4904,6 +4904,45 @@ u16 hostapd_get_punct_bitmap(struct hostapd_data *hapd)
+diff --git a/src/ap/afc.c b/src/ap/afc.c
+index cfee83fe7..361ecb575 100644
+--- a/src/ap/afc.c
++++ b/src/ap/afc.c
+@@ -1039,3 +1039,40 @@ void hostap_afc_disable_channels(struct hostapd_iface *iface)
+ chan->freq);
+ }
}
-
-
++
++
+int hostap_afc_get_chan_max_eirp_power(struct hostapd_iface *iface, bool psd,
+ int *power)
+{
-+#ifdef CONFIG_AFC
+ int i;
+
+ if (!he_reg_is_sp(iface->conf->he_6ghz_reg_pwr_type))
@@ -56,32 +59,37 @@
+ }
+ }
+ }
-+#endif /* CONFIG_AFC */
+ return -EINVAL;
+}
-+
-+
- void hostap_afc_disable_channels(struct hostapd_iface *iface)
- {
- #ifdef CONFIG_AFC
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
-index 18bcb82d9..594866fbb 100644
+index d67a0afa0..996977fdf 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
-@@ -729,6 +729,8 @@ struct hostapd_iface {
- };
+@@ -748,10 +748,19 @@ struct hostapd_iface {
/* hostapd.c */
+ #ifdef CONFIG_AFC
+int hostap_afc_get_chan_max_eirp_power(struct hostapd_iface *iface, bool psd,
+ int *power);
- void hostap_afc_disable_channels(struct hostapd_iface *iface);
int hostapd_afc_handle_request(struct hostapd_iface *iface);
-
+ void hostapd_afc_stop(struct hostapd_iface *iface);
+ void hostap_afc_disable_channels(struct hostapd_iface *iface);
+ #else
++static inline int
++hostap_afc_get_chan_max_eirp_power(struct hostapd_iface *iface, bool psd,
++ int *power)
++{
++ return -EINVAL;
++}
++
+ static inline int hostapd_afc_handle_request(struct hostapd_iface *iface)
+ {
+ return 1;
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index 9a23c7240..179af5e28 100644
+index fd1de5ebc..d8d82d737 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
-@@ -7047,42 +7047,53 @@ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
+@@ -7110,42 +7110,53 @@ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
*/
if (is_6ghz_op_class(iconf->op_class)) {
enum max_tx_pwr_interpretation tx_pwr_intrpn;
@@ -154,5 +162,5 @@
#endif /* CONFIG_IEEE80211AX */
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0009-hostapd-MLO-pass-link_id-in-get_hapd_bssid-helper-fu.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0009-hostapd-MLO-pass-link_id-in-get_hapd_bssid-helper-fu.patch
deleted file mode 100644
index 6b9fc79..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0009-hostapd-MLO-pass-link_id-in-get_hapd_bssid-helper-fu.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-From 30cd94f678f5f85703854812f0deb6467b37df5f Mon Sep 17 00:00:00 2001
-From: Sriram R <quic_srirrama@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:39 +0530
-Subject: [PATCH 009/104] hostapd: MLO: pass link_id in get_hapd_bssid helper
- function
-
-Currently get_hapd_bssid() function matches the given bssid in all bsses
-of its own iface. However with MLO, there is requirement to check its
-own partner BSS at least.
-
-Make changes to compare its link partners as well and if link id passed
-matches with the link id of the partner then return it.
-
-Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/ap/drv_callbacks.c | 47 +++++++++++++++++++++++++-----------------
- 1 file changed, 28 insertions(+), 19 deletions(-)
-
-diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
-index 2d3206909..adac2d478 100644
---- a/src/ap/drv_callbacks.c
-+++ b/src/ap/drv_callbacks.c
-@@ -1750,7 +1750,7 @@ switch_link_hapd(struct hostapd_data *hapd, int link_id)
- #define HAPD_BROADCAST ((struct hostapd_data *) -1)
-
- static struct hostapd_data * get_hapd_bssid(struct hostapd_iface *iface,
-- const u8 *bssid)
-+ const u8 *bssid, int link_id)
- {
- size_t i;
-
-@@ -1761,8 +1761,30 @@ static struct hostapd_data * get_hapd_bssid(struct hostapd_iface *iface,
- return HAPD_BROADCAST;
-
- for (i = 0; i < iface->num_bss; i++) {
-+#ifdef CONFIG_IEEE80211BE
-+ struct hostapd_data *hapd, *p_hapd;
-+
-+ hapd = iface->bss[i];
-+ if (ether_addr_equal(bssid, hapd->own_addr) ||
-+ (hapd->conf->mld_ap &&
-+ ether_addr_equal(bssid, hapd->mld->mld_addr) &&
-+ link_id == hapd->mld_link_id)) {
-+ return hapd;
-+ } else if (hapd->conf->mld_ap) {
-+ for_each_mld_link(p_hapd, hapd) {
-+ if (p_hapd == hapd)
-+ continue;
-+
-+ if (ether_addr_equal(bssid, p_hapd->own_addr) ||
-+ (ether_addr_equal(bssid, p_hapd->mld->mld_addr) &&
-+ link_id == p_hapd->mld_link_id))
-+ return p_hapd;
-+ }
-+ }
-+#else
- if (ether_addr_equal(bssid, iface->bss[i]->own_addr))
- return iface->bss[i];
-+#endif /*CONFIG_IEEE80211BE */
- }
-
- return NULL;
-@@ -1773,7 +1795,7 @@ static void hostapd_rx_from_unknown_sta(struct hostapd_data *hapd,
- const u8 *bssid, const u8 *addr,
- int wds)
- {
-- hapd = get_hapd_bssid(hapd->iface, bssid);
-+ hapd = get_hapd_bssid(hapd->iface, bssid, -1);
- if (hapd == NULL || hapd == HAPD_BROADCAST)
- return;
-
-@@ -1813,14 +1835,7 @@ static int hostapd_mgmt_rx(struct hostapd_data *hapd, struct rx_mgmt *rx_mgmt)
- if (bssid == NULL)
- return 0;
-
--#ifdef CONFIG_IEEE80211BE
-- if (hapd->conf->mld_ap &&
-- ether_addr_equal(hapd->mld->mld_addr, bssid))
-- is_mld = true;
--#endif /* CONFIG_IEEE80211BE */
--
-- if (!is_mld)
-- hapd = get_hapd_bssid(iface, bssid);
-+ hapd = get_hapd_bssid(iface, bssid, rx_mgmt->link_id);
-
- if (!hapd) {
- u16 fc = le_to_host16(hdr->frame_control);
-@@ -1872,17 +1887,11 @@ static void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, const u8 *buf,
- struct ieee80211_hdr *hdr;
- struct hostapd_data *orig_hapd, *tmp_hapd;
-
--#ifdef CONFIG_IEEE80211BE
-- if (hapd->conf->mld_ap && link_id != -1) {
-- tmp_hapd = hostapd_mld_get_link_bss(hapd, link_id);
-- if (tmp_hapd)
-- hapd = tmp_hapd;
-- }
--#endif /* CONFIG_IEEE80211BE */
- orig_hapd = hapd;
-
- hdr = (struct ieee80211_hdr *) buf;
-- tmp_hapd = get_hapd_bssid(hapd->iface, get_hdr_bssid(hdr, len));
-+ hapd = switch_link_hapd(hapd, link_id);
-+ tmp_hapd = get_hapd_bssid(hapd->iface, get_hdr_bssid(hdr, len), link_id);
- if (tmp_hapd) {
- hapd = tmp_hapd;
- #ifdef CONFIG_IEEE80211BE
-@@ -1899,7 +1908,7 @@ static void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, const u8 *buf,
- if (stype != WLAN_FC_STYPE_ACTION || len <= 25 ||
- buf[24] != WLAN_ACTION_PUBLIC)
- return;
-- hapd = get_hapd_bssid(orig_hapd->iface, hdr->addr2);
-+ hapd = get_hapd_bssid(orig_hapd->iface, hdr->addr2, link_id);
- if (!hapd || hapd == HAPD_BROADCAST)
- return;
- /*
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0027-hostapd-sync-2024-01-18-openwrt-trunk-src-folder.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0009-sync-2024-06-21-openwrt-trunk-src-folder.patch
similarity index 99%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0027-hostapd-sync-2024-01-18-openwrt-trunk-src-folder.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0009-sync-2024-06-21-openwrt-trunk-src-folder.patch
index cbe2769..66a6d8c 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0027-hostapd-sync-2024-01-18-openwrt-trunk-src-folder.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0009-sync-2024-06-21-openwrt-trunk-src-folder.patch
@@ -1,13 +1,17 @@
-From ccb5628a9c5eae2b56cb88f43f850146863cba30 Mon Sep 17 00:00:00 2001
-From: Evelyn Tsai <evelyn.tsai@mediatek.com>
-Date: Tue, 23 Jan 2024 16:46:44 +0800
-Subject: [PATCH 027/104] hostapd: sync 2024-01-18 openwrt/trunk src folder
+From 2acddad81c876fda04bfd94e7d45dca4bc72a843 Mon Sep 17 00:00:00 2001
+From: Shayne Chen <shayne.chen@mediatek.com>
+Date: Fri, 19 Jul 2024 15:23:02 +0800
+Subject: [PATCH 009/126] sync 2024-06-21 openwrt/trunk src folder
+Sync to 032d3fcf7a861b140435b6507b2b0b66361c92f8
+"hostapd: use strdup on string passed to hostapd_add_iface"
+
+Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
---
hostapd/radius.c | 715 +++++++++++++
- src/ap/ubus.c | 2005 ++++++++++++++++++++++++++++++++++++
- src/ap/ubus.h | 154 +++
- src/ap/ucode.c | 813 +++++++++++++++
+ src/ap/ubus.c | 2006 ++++++++++++++++++++++++++++++++++++
+ src/ap/ubus.h | 157 +++
+ src/ap/ucode.c | 817 +++++++++++++++
src/ap/ucode.h | 54 +
src/utils/build_features.h | 65 ++
src/utils/ucode.c | 502 +++++++++
@@ -16,7 +20,7 @@
wpa_supplicant/ubus.h | 55 +
wpa_supplicant/ucode.c | 299 ++++++
wpa_supplicant/ucode.h | 49 +
- 12 files changed, 5021 insertions(+)
+ 12 files changed, 5029 insertions(+)
create mode 100644 hostapd/radius.c
create mode 100644 src/ap/ubus.c
create mode 100644 src/ap/ubus.h
@@ -753,10 +757,10 @@
+}
diff --git a/src/ap/ubus.c b/src/ap/ubus.c
new file mode 100644
-index 000000000..f2041a0c9
+index 000000000..8689494bc
--- /dev/null
+++ b/src/ap/ubus.c
-@@ -0,0 +1,2005 @@
+@@ -0,0 +1,2006 @@
+/*
+ * hostapd / ubus support
+ * Copyright (c) 2013, Felix Fietkau <nbd@nbd.name>
@@ -1533,7 +1537,8 @@
+ mode ? &mode->he_capab[IEEE80211_MODE_AP] :
+ NULL,
+ mode ? &mode->eht_capab[IEEE80211_MODE_AP] :
-+ NULL, hostapd_get_punct_bitmap(hapd));
++ NULL,
++ hostapd_get_punct_bitmap(hapd));
+
+ for (i = 0; i < hapd->iface->num_bss; i++) {
+ struct hostapd_data *bss = hapd->iface->bss[i];
@@ -2764,10 +2769,10 @@
+}
diff --git a/src/ap/ubus.h b/src/ap/ubus.h
new file mode 100644
-index 000000000..b0f7c44ab
+index 000000000..22767d67e
--- /dev/null
+++ b/src/ap/ubus.h
-@@ -0,0 +1,154 @@
+@@ -0,0 +1,157 @@
+/*
+ * hostapd / ubus support
+ * Copyright (c) 2013, Felix Fietkau <nbd@nbd.name>
@@ -2778,6 +2783,8 @@
+#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,
@@ -2797,6 +2804,7 @@
+struct hostapd_data;
+struct hapd_interfaces;
+struct rrm_measurement_beacon_report;
++struct sta_info;
+
+#ifdef UBUS_SUPPORT
+
@@ -2924,10 +2932,10 @@
+#endif
diff --git a/src/ap/ucode.c b/src/ap/ucode.c
new file mode 100644
-index 000000000..16d1b5153
+index 000000000..68fb45088
--- /dev/null
+++ b/src/ap/ucode.c
-@@ -0,0 +1,813 @@
+@@ -0,0 +1,817 @@
+#include <sys/un.h>
+
+#include "utils/includes.h"
@@ -2981,7 +2989,7 @@
+ int i;
+
+ list = ucv_array_new(vm);
-+ for (i = 0; i < iface->num_bss; i++) {
++ for (i = 0; iface->bss && i < iface->num_bss; i++) {
+ struct hostapd_data *hapd = iface->bss[i];
+ uc_value_t *val = hostapd_ucode_bss_get_uval(hapd);
+
@@ -3016,12 +3024,16 @@
+uc_hostapd_add_iface(uc_vm_t *vm, size_t nargs)
+{
+ uc_value_t *iface = uc_fn_arg(0);
++ char *data;
+ int ret;
+
+ if (ucv_type(iface) != UC_STRING)
+ return ucv_int64_new(-1);
+
-+ ret = hostapd_add_iface(interfaces, ucv_string_get(iface));
++ data = strdup(ucv_string_get(iface));
++ ret = hostapd_add_iface(interfaces, data);
++ free(data);
++
+ hostapd_ucode_update_interfaces();
+
+ return ucv_int64_new(ret);
@@ -5124,5 +5136,5 @@
+
+#endif
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0010-hostapd-MLO-pass-ctx-in-mlme_event_mgmt.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0010-hostapd-MLO-pass-ctx-in-mlme_event_mgmt.patch
deleted file mode 100644
index de6b62e..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0010-hostapd-MLO-pass-ctx-in-mlme_event_mgmt.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 33c9e4624040e1e0f331260c239fccdccbe52528 Mon Sep 17 00:00:00 2001
-From: Sriram R <quic_srirrama@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:40 +0530
-Subject: [PATCH 010/104] hostapd: MLO: pass ctx in mlme_event_mgmt()
-
-Add support to pass ctx in mlme_event_mgmt(). This will help in to route
-the event properly to link BSS.
-
-Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/ap/drv_callbacks.c | 2 +-
- src/drivers/driver.h | 8 ++++++++
- src/drivers/driver_nl80211_event.c | 1 +
- 3 files changed, 10 insertions(+), 1 deletion(-)
-
-diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
-index adac2d478..3b24aa4f4 100644
---- a/src/ap/drv_callbacks.c
-+++ b/src/ap/drv_callbacks.c
-@@ -1810,8 +1810,8 @@ static int hostapd_mgmt_rx(struct hostapd_data *hapd, struct rx_mgmt *rx_mgmt)
- const u8 *bssid;
- struct hostapd_frame_info fi;
- int ret;
-- bool is_mld = false;
-
-+ hapd = rx_mgmt->ctx ? rx_mgmt->ctx : hapd;
- hapd = switch_link_hapd(hapd, rx_mgmt->link_id);
- iface = hapd->iface;
-
-diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index d67c949b6..a7455ef6e 100644
---- a/src/drivers/driver.h
-+++ b/src/drivers/driver.h
-@@ -6345,6 +6345,14 @@ union wpa_event_data {
- */
- void *drv_priv;
-
-+ /**
-+ * ctx - Pointer to store ctx of private BSS information
-+ *
-+ * If not set to NULL, this is used for forwarding the packet
-+ * to right link BSS of ML BSS.
-+ */
-+ void *ctx;
-+
- /**
- * freq - Frequency (in MHz) on which the frame was received
- */
-diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
-index 51b27bd5e..1ca8b5bce 100644
---- a/src/drivers/driver_nl80211_event.c
-+++ b/src/drivers/driver_nl80211_event.c
-@@ -1367,6 +1367,7 @@ static void mlme_event_mgmt(struct i802_bss *bss,
- event.rx_mgmt.frame_len = len;
- event.rx_mgmt.ssi_signal = ssi_signal;
- event.rx_mgmt.drv_priv = bss;
-+ event.rx_mgmt.ctx = bss->ctx;
- event.rx_mgmt.link_id = link_id;
-
- wpa_supplicant_event(drv->ctx, EVENT_RX_MGMT, &event);
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0028-hostapd-sync-2024-01-18-openwrt-trunk-patch-folder.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0010-sync-2024-08-13-openwrt-trunk-patches-folder.patch
similarity index 91%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0028-hostapd-sync-2024-01-18-openwrt-trunk-patch-folder.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0010-sync-2024-08-13-openwrt-trunk-patches-folder.patch
index 1dff1f3..6fe601b 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0028-hostapd-sync-2024-01-18-openwrt-trunk-patch-folder.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0010-sync-2024-08-13-openwrt-trunk-patches-folder.patch
@@ -1,36 +1,45 @@
-From 2eff271199b22ce44432d531e8b44809368ac5d2 Mon Sep 17 00:00:00 2001
-From: Evelyn Tsai <evelyn.tsai@mediatek.com>
-Date: Tue, 23 Jan 2024 17:07:17 +0800
-Subject: [PATCH 028/104] hostapd: sync 2024-01-18 openwrt/trunk patch folder
+From 1a9b003e08a15df0e52604b991c1dd851a9bd265 Mon Sep 17 00:00:00 2001
+From: Shayne Chen <shayne.chen@mediatek.com>
+Date: Fri, 19 Jul 2024 15:26:42 +0800
+Subject: [PATCH 010/126] sync 2024-08-13 openwrt/trunk patches folder
+Sync to e80520197c9ca7bced50d3605d6baba6dead6e35
+"hostapd: Add support for APuP"
+
+Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
---
- hostapd/Makefile | 149 +-
- hostapd/config_file.c | 39 +-
+ hostapd/Makefile | 153 +-
+ hostapd/config_file.c | 42 +-
hostapd/ctrl_iface.c | 4 +
hostapd/defconfig | 15 +-
hostapd/hostapd_cli.c | 10 +-
hostapd/main.c | 21 +-
src/ap/acs.c | 5 +-
src/ap/airtime_policy.c | 15 +-
- src/ap/ap_config.h | 8 +
- src/ap/ap_drv_ops.c | 5 +-
- src/ap/ap_drv_ops.h | 21 +-
- src/ap/beacon.c | 14 +-
+ src/ap/ap_config.h | 37 +
+ src/ap/ap_drv_ops.c | 28 +-
+ src/ap/ap_drv_ops.h | 24 +-
+ src/ap/apup.c | 168 +
+ src/ap/apup.h | 24 +
+ src/ap/beacon.c | 16 +-
src/ap/ctrl_iface_ap.c | 45 +-
src/ap/dfs.c | 22 +-
src/ap/drv_callbacks.c | 16 +-
- src/ap/hostapd.c | 51 +-
- src/ap/hostapd.h | 42 +
+ src/ap/hostapd.c | 59 +-
+ src/ap/hostapd.h | 41 +
src/ap/hw_features.c | 3 +-
- src/ap/ieee802_11.c | 50 +-
+ src/ap/ieee802_11.c | 55 +-
+ src/ap/ieee802_11.h | 2 +
src/ap/ieee802_11_ht.c | 15 +
- src/ap/ieee802_11_shared.c | 2 -
src/ap/ieee802_11_vht.c | 17 +
src/ap/ieee802_1x.c | 6 +
- src/ap/ndisc_snoop.c | 1 +
- src/ap/rrm.c | 8 +
+ src/ap/rrm.c | 10 +
src/ap/sta_info.c | 35 +-
- src/ap/sta_info.h | 12 +-
+ src/ap/sta_info.h | 16 +-
+ src/ap/ubus.c | 15 +
+ src/ap/ubus.h | 5 +
+ src/ap/ucode.c | 17 +
+ src/ap/ucode.h | 4 +
src/ap/vlan_full.c | 4 +
src/ap/vlan_init.c | 8 +-
src/ap/wnm_ap.c | 16 +-
@@ -38,19 +47,18 @@
src/ap/wpa_auth_glue.c | 9 +-
src/ap/wps_hostapd.c | 6 +-
src/ap/x_snoop.c | 22 +-
+ src/common/defs.h | 4 +
src/common/dpp_crypto.c | 10 +-
src/common/hw_features_common.c | 1 +
src/common/ieee802_11_defs.h | 2 +
src/common/sae.c | 7 +
- src/common/wpa_common.c | 40 +-
src/common/wpa_ctrl.c | 10 +-
src/crypto/Makefile | 129 +-
src/crypto/crypto_mbedtls.c | 4228 +++++++++++++++++++++
src/crypto/crypto_module_tests.c | 134 +
- src/crypto/crypto_wolfssl.c | 18 +
src/crypto/tls_mbedtls.c | 3313 ++++++++++++++++
- src/drivers/driver.h | 36 +-
- src/drivers/driver_nl80211.c | 300 +-
+ src/drivers/driver.h | 38 +-
+ src/drivers/driver_nl80211.c | 174 +-
src/drivers/driver_nl80211_capa.c | 4 +
src/drivers/driver_nl80211_event.c | 5 +
src/drivers/driver_nl80211_scan.c | 2 +-
@@ -69,15 +77,15 @@
src/utils/uloop.c | 64 +
src/utils/wpa_debug.c | 49 +-
src/utils/wpa_debug.h | 73 +-
- tests/Makefile | 65 +-
- tests/hwsim/example-hostapd.config | 10 +-
- tests/hwsim/example-wpa_supplicant.config | 11 +-
- tests/hwsim/test_ap_eap.py | 112 +-
+ tests/Makefile | 76 +-
+ tests/hwsim/example-hostapd.config | 8 +-
+ tests/hwsim/example-wpa_supplicant.config | 9 +-
+ tests/hwsim/test_ap_eap.py | 114 +-
tests/hwsim/test_ap_ft.py | 4 +-
tests/hwsim/test_authsrv.py | 9 +-
tests/hwsim/test_dpp.py | 19 +-
tests/hwsim/test_erp.py | 16 +-
- tests/hwsim/test_fils.py | 12 +
+ tests/hwsim/test_fils.py | 4 +
tests/hwsim/test_pmksa_cache.py | 4 +-
tests/hwsim/test_sae.py | 7 +
tests/hwsim/test_suite_b.py | 3 +
@@ -86,31 +94,33 @@
tests/test-crypto_module.c | 16 +
tests/test-https.c | 12 +-
tests/test-https_server.c | 12 +-
- wpa_supplicant/Makefile | 144 +-
- wpa_supplicant/ap.c | 22 +-
+ wpa_supplicant/Makefile | 143 +-
+ wpa_supplicant/ap.c | 28 +-
wpa_supplicant/config.c | 95 +
wpa_supplicant/config_file.c | 8 +-
- wpa_supplicant/config_ssid.h | 7 +
+ wpa_supplicant/config_ssid.h | 5 +
wpa_supplicant/ctrl_iface.c | 12 +-
wpa_supplicant/defconfig | 6 +-
wpa_supplicant/eapol_test.c | 11 +
- wpa_supplicant/events.c | 13 +-
+ wpa_supplicant/events.c | 7 +-
wpa_supplicant/main.c | 14 +-
wpa_supplicant/mesh.c | 3 +
wpa_supplicant/wpa_cli.c | 9 +
wpa_supplicant/wpa_priv.c | 8 +-
- wpa_supplicant/wpa_supplicant.c | 75 +-
+ wpa_supplicant/wpa_supplicant.c | 76 +-
wpa_supplicant/wpa_supplicant_i.h | 6 +
wpa_supplicant/wps_supplicant.c | 3 +
wpa_supplicant/wps_supplicant.h | 3 +-
- 99 files changed, 9786 insertions(+), 464 deletions(-)
+ 103 files changed, 9984 insertions(+), 401 deletions(-)
+ create mode 100644 src/ap/apup.c
+ create mode 100644 src/ap/apup.h
create mode 100644 src/crypto/crypto_mbedtls.c
create mode 100644 src/crypto/tls_mbedtls.c
create mode 100644 src/utils/uloop.c
create mode 100644 tests/test-crypto_module.c
diff --git a/hostapd/Makefile b/hostapd/Makefile
-index 405e05e5f..f5c1dc029 100644
+index 78171025e..8dc6e6216 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -1,6 +1,7 @@
@@ -132,7 +142,7 @@
OBJS += ../src/ap/hostapd.o
OBJS += ../src/ap/wpa_auth_glue.o
OBJS += ../src/ap/drv_callbacks.o
-@@ -171,6 +176,24 @@ OBJS += ../src/common/hw_features_common.o
+@@ -174,6 +179,24 @@ OBJS += ../src/common/hw_features_common.o
OBJS += ../src/eapol_auth/eapol_auth_sm.o
@@ -157,7 +167,7 @@
ifdef CONFIG_CODE_COVERAGE
CFLAGS += -O0 -fprofile-arcs -ftest-coverage -U_FORTIFY_SOURCE
-@@ -205,7 +228,8 @@ endif
+@@ -208,7 +231,8 @@ endif
ifdef CONFIG_NO_VLAN
CFLAGS += -DCONFIG_NO_VLAN
@@ -167,7 +177,7 @@
OBJS += ../src/ap/vlan_init.o
OBJS += ../src/ap/vlan_ifconfig.o
OBJS += ../src/ap/vlan.o
-@@ -225,6 +249,9 @@ endif
+@@ -228,6 +252,9 @@ endif
ifdef CONFIG_NO_CTRL_IFACE
CFLAGS += -DCONFIG_NO_CTRL_IFACE
else
@@ -177,15 +187,7 @@
ifeq ($(CONFIG_CTRL_IFACE), udp)
CFLAGS += -DCONFIG_CTRL_IFACE_UDP
else
-@@ -332,6 +359,7 @@ ifdef CONFIG_FILS
- CFLAGS += -DCONFIG_FILS
- OBJS += ../src/ap/fils_hlp.o
- NEED_SHA384=y
-+NEED_HMAC_SHA384_KDF=y
- NEED_AES_SIV=y
- ifdef CONFIG_FILS_SK_PFS
- CFLAGS += -DCONFIG_FILS_SK_PFS
-@@ -364,10 +392,14 @@ CFLAGS += -DCONFIG_MBO
+@@ -367,10 +394,14 @@ CFLAGS += -DCONFIG_MBO
OBJS += ../src/ap/mbo_ap.o
endif
@@ -203,7 +205,7 @@
LIBS += $(DRV_AP_LIBS)
ifdef CONFIG_L2_PACKET
-@@ -714,6 +746,7 @@ CFLAGS += -DCONFIG_TLSV12
+@@ -716,6 +747,7 @@ CFLAGS += -DCONFIG_TLSV12
endif
ifeq ($(CONFIG_TLS), wolfssl)
@@ -211,7 +213,7 @@
CONFIG_CRYPTO=wolfssl
ifdef TLS_FUNCS
OBJS += ../src/crypto/tls_wolfssl.o
-@@ -734,6 +767,7 @@ endif
+@@ -736,6 +768,7 @@ endif
endif
ifeq ($(CONFIG_TLS), openssl)
@@ -219,7 +221,7 @@
CFLAGS += -DCRYPTO_RSA_OAEP_SHA256
CONFIG_CRYPTO=openssl
ifdef TLS_FUNCS
-@@ -763,7 +797,39 @@ endif
+@@ -765,7 +798,39 @@ endif
CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\"
endif
@@ -259,7 +261,7 @@
ifndef CONFIG_CRYPTO
# default to libgcrypt
CONFIG_CRYPTO=gnutls
-@@ -794,6 +860,7 @@ endif
+@@ -796,6 +861,7 @@ endif
endif
ifeq ($(CONFIG_TLS), internal)
@@ -267,7 +269,7 @@
ifndef CONFIG_CRYPTO
CONFIG_CRYPTO=internal
endif
-@@ -872,6 +939,7 @@ endif
+@@ -874,6 +940,7 @@ endif
endif
ifeq ($(CONFIG_TLS), linux)
@@ -275,7 +277,7 @@
OBJS += ../src/crypto/crypto_linux.o
ifdef TLS_FUNCS
OBJS += ../src/crypto/crypto_internal-rsa.o
-@@ -942,9 +1010,11 @@ endif
+@@ -944,9 +1011,11 @@ endif
ifneq ($(CONFIG_TLS), openssl)
ifneq ($(CONFIG_TLS), wolfssl)
@@ -287,7 +289,7 @@
ifdef NEED_AES_EAX
AESOBJS += ../src/crypto/aes-eax.o
NEED_AES_CTR=y
-@@ -954,38 +1024,48 @@ AESOBJS += ../src/crypto/aes-siv.o
+@@ -956,38 +1025,48 @@ AESOBJS += ../src/crypto/aes-siv.o
NEED_AES_CTR=y
endif
ifdef NEED_AES_CTR
@@ -336,7 +338,7 @@
ifdef NEED_AES_DEC
ifdef CONFIG_INTERNAL_AES
AESOBJS += ../src/crypto/aes-internal-dec.o
-@@ -1000,12 +1080,16 @@ ifneq ($(CONFIG_TLS), openssl)
+@@ -1002,12 +1081,16 @@ ifneq ($(CONFIG_TLS), openssl)
ifneq ($(CONFIG_TLS), linux)
ifneq ($(CONFIG_TLS), gnutls)
ifneq ($(CONFIG_TLS), wolfssl)
@@ -353,7 +355,7 @@
ifdef CONFIG_INTERNAL_SHA1
SHA1OBJS += ../src/crypto/sha1-internal.o
ifdef NEED_FIPS186_2_PRF
-@@ -1014,16 +1098,22 @@ endif
+@@ -1016,16 +1099,22 @@ endif
endif
ifneq ($(CONFIG_TLS), openssl)
ifneq ($(CONFIG_TLS), wolfssl)
@@ -376,7 +378,7 @@
ifdef NEED_SHA1
OBJS += $(SHA1OBJS)
-@@ -1033,11 +1123,13 @@ ifneq ($(CONFIG_TLS), openssl)
+@@ -1035,11 +1124,13 @@ ifneq ($(CONFIG_TLS), openssl)
ifneq ($(CONFIG_TLS), linux)
ifneq ($(CONFIG_TLS), gnutls)
ifneq ($(CONFIG_TLS), wolfssl)
@@ -390,7 +392,7 @@
ifdef NEED_MD5
ifdef CONFIG_INTERNAL_MD5
-@@ -1076,56 +1168,81 @@ ifneq ($(CONFIG_TLS), openssl)
+@@ -1078,56 +1169,81 @@ ifneq ($(CONFIG_TLS), openssl)
ifneq ($(CONFIG_TLS), linux)
ifneq ($(CONFIG_TLS), gnutls)
ifneq ($(CONFIG_TLS), wolfssl)
@@ -472,7 +474,7 @@
ifdef CONFIG_INTERNAL_SHA384
CFLAGS += -DCONFIG_INTERNAL_SHA384
-@@ -1170,11 +1287,13 @@ HOBJS += $(SHA1OBJS)
+@@ -1172,11 +1288,13 @@ HOBJS += $(SHA1OBJS)
ifneq ($(CONFIG_TLS), openssl)
ifneq ($(CONFIG_TLS), linux)
ifneq ($(CONFIG_TLS), wolfssl)
@@ -486,7 +488,19 @@
ifdef CONFIG_RADIUS_SERVER
CFLAGS += -DRADIUS_SERVER
-@@ -1311,8 +1430,14 @@ install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL))
+@@ -1306,6 +1424,11 @@ ifdef CONFIG_NO_TKIP
+ CFLAGS += -DCONFIG_NO_TKIP
+ endif
+
++ifdef CONFIG_APUP
++CFLAGS += -DCONFIG_APUP
++OBJS += ../src/ap/apup.o
++endif
++
+ $(DESTDIR)$(BINDIR)/%: %
+ install -D $(<) $(@)
+
+@@ -1314,8 +1437,14 @@ install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL))
_OBJS_VAR := OBJS
include ../src/objs.mk
@@ -502,7 +516,7 @@
@$(E) " LD " $@
ifdef CONFIG_WPA_TRACE
-@@ -1323,7 +1448,7 @@ _OBJS_VAR := OBJS_c
+@@ -1326,7 +1455,7 @@ _OBJS_VAR := OBJS_c
include ../src/objs.mk
hostapd_cli: $(OBJS_c)
@@ -511,7 +525,7 @@
@$(E) " LD " $@
NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS)
-@@ -1347,7 +1472,9 @@ NOBJS += ../src/utils/trace.o
+@@ -1350,7 +1479,9 @@ NOBJS += ../src/utils/trace.o
endif
HOBJS += hlr_auc_gw.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).o ../src/utils/wpabuf.o ../src/crypto/milenage.o
@@ -521,7 +535,7 @@
ifdef CONFIG_INTERNAL_AES
HOBJS += ../src/crypto/aes-internal.o
HOBJS += ../src/crypto/aes-internal-enc.o
-@@ -1370,13 +1497,17 @@ SOBJS += ../src/common/sae.o
+@@ -1373,13 +1504,17 @@ SOBJS += ../src/common/sae.o
SOBJS += ../src/common/sae_pk.o
SOBJS += ../src/common/dragonfly.o
SOBJS += $(AESOBJS)
@@ -539,7 +553,7 @@
_OBJS_VAR := NOBJS
include ../src/objs.mk
-@@ -1385,6 +1516,12 @@ include ../src/objs.mk
+@@ -1388,6 +1523,12 @@ include ../src/objs.mk
_OBJS_VAR := SOBJS
include ../src/objs.mk
@@ -553,7 +567,7 @@
$(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
@$(E) " LD " $@
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index 261905368..0094db279 100644
+index a86621ed9..f3968ec95 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -1229,6 +1229,8 @@ static int hostapd_config_vht_capab(struct hostapd_config *conf,
@@ -565,25 +579,7 @@
return 0;
}
#endif /* CONFIG_IEEE80211AC */
-@@ -1678,6 +1680,8 @@ static int parse_anqp_elem(struct hostapd_bss_config *bss, char *buf, int line)
- return 0;
- }
-
-+#endif /* CONFIG_INTERWORKING */
-+
-
- static int parse_qos_map_set(struct hostapd_bss_config *bss,
- char *buf, int line)
-@@ -1719,8 +1723,6 @@ static int parse_qos_map_set(struct hostapd_bss_config *bss,
- return 0;
- }
-
--#endif /* CONFIG_INTERWORKING */
--
-
- #ifdef CONFIG_HS20
- static int hs20_parse_conn_capab(struct hostapd_bss_config *bss, char *buf,
-@@ -2630,8 +2632,12 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -2654,8 +2656,12 @@ static int hostapd_config_fill(struct hostapd_config *conf,
sizeof(conf->bss[0]->iface));
} else if (os_strcmp(buf, "bridge") == 0) {
os_strlcpy(bss->bridge, pos, sizeof(bss->bridge));
@@ -596,7 +592,7 @@
} else if (os_strcmp(buf, "vlan_bridge") == 0) {
os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge));
} else if (os_strcmp(buf, "wds_bridge") == 0) {
-@@ -2998,6 +3004,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -3043,6 +3049,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
} else if (os_strcmp(buf, "iapp_interface") == 0) {
wpa_printf(MSG_INFO, "DEPRECATED: iapp_interface not used");
#endif /* CONFIG_IAPP */
@@ -605,7 +601,7 @@
} else if (os_strcmp(buf, "own_ip_addr") == 0) {
if (hostapd_parse_ip_addr(pos, &bss->own_ip_addr)) {
wpa_printf(MSG_ERROR,
-@@ -3222,6 +3230,14 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -3270,6 +3278,14 @@ static int hostapd_config_fill(struct hostapd_config *conf,
line, bss->max_num_sta, MAX_STA_COUNT);
return 1;
}
@@ -620,7 +616,7 @@
} else if (os_strcmp(buf, "wpa") == 0) {
bss->wpa = atoi(pos);
} else if (os_strcmp(buf, "extended_key_id") == 0) {
-@@ -3373,6 +3389,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -3459,6 +3475,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
wpa_printf(MSG_INFO,
"Line %d: Obsolete peerkey parameter ignored", line);
#ifdef CONFIG_IEEE80211R_AP
@@ -629,7 +625,7 @@
} else if (os_strcmp(buf, "mobility_domain") == 0) {
if (os_strlen(pos) != 2 * MOBILITY_DOMAIN_ID_LEN ||
hexstr2bin(pos, bss->mobility_domain,
-@@ -3742,6 +3760,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -3828,6 +3846,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
#ifndef CONFIG_NO_VLAN
} else if (os_strcmp(buf, "dynamic_vlan") == 0) {
bss->ssid.dynamic_vlan = atoi(pos);
@@ -638,7 +634,7 @@
} else if (os_strcmp(buf, "per_sta_vif") == 0) {
bss->ssid.per_sta_vif = atoi(pos);
} else if (os_strcmp(buf, "vlan_file") == 0) {
-@@ -3839,6 +3859,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -3929,6 +3949,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
if (bss->ocv && !bss->ieee80211w)
bss->ieee80211w = 1;
#endif /* CONFIG_OCV */
@@ -649,7 +645,7 @@
} else if (os_strcmp(buf, "ieee80211n") == 0) {
conf->ieee80211n = atoi(pos);
} else if (os_strcmp(buf, "ht_capab") == 0) {
-@@ -3887,6 +3911,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -3979,6 +4003,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
} else if (os_strcmp(buf, "he_bss_color") == 0) {
conf->he_op.he_bss_color = atoi(pos) & 0x3f;
conf->he_op.he_bss_color_disabled = 0;
@@ -658,19 +654,23 @@
} else if (os_strcmp(buf, "he_bss_color_partial") == 0) {
conf->he_op.he_bss_color_partial = atoi(pos);
} else if (os_strcmp(buf, "he_default_pe_duration") == 0) {
-@@ -4520,10 +4546,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
- bss->gas_frag_limit = val;
- } else if (os_strcmp(buf, "gas_comeback_delay") == 0) {
- bss->gas_comeback_delay = atoi(pos);
-+#endif /* CONFIG_INTERWORKING */
- } else if (os_strcmp(buf, "qos_map_set") == 0) {
- if (parse_qos_map_set(bss, pos, line) < 0)
- return 1;
--#endif /* CONFIG_INTERWORKING */
- #ifdef CONFIG_RADIUS_TEST
- } else if (os_strcmp(buf, "dump_msk_file") == 0) {
- os_free(bss->dump_msk_file);
-@@ -5347,7 +5373,12 @@ struct hostapd_config * hostapd_config_read(const char *fname)
+@@ -5435,6 +5461,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+ bss->mld_indicate_disabled = atoi(pos);
+ #endif /* CONFIG_TESTING_OPTIONS */
+ #endif /* CONFIG_IEEE80211BE */
++#ifdef CONFIG_APUP
++ } else if (os_strcmp(buf, "apup") == 0) {
++ bss->apup = !!atoi(pos);
++ if (bss->apup)
++ bss->wds_sta = 1;
++ } else if (os_strcmp(buf, "apup_peer_ifname_prefix") == 0) {
++ os_strlcpy(bss->apup_peer_ifname_prefix,
++ pos, sizeof(bss->apup_peer_ifname_prefix));
++#endif // def CONFIG_APUP
+ } else {
+ wpa_printf(MSG_ERROR,
+ "Line %d: unknown configuration item '%s'",
+@@ -5460,7 +5495,12 @@ struct hostapd_config * hostapd_config_read(const char *fname)
int errors = 0;
size_t i;
@@ -685,10 +685,10 @@
wpa_printf(MSG_ERROR, "Could not open configuration file '%s' "
"for reading.", fname);
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 10cb186f1..f76226cf4 100644
+index a584d370e..1d5922fab 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -3876,6 +3876,7 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4005,6 +4005,7 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
reply_size);
} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
reply_len = hostapd_drv_status(hapd, reply, reply_size);
@@ -696,7 +696,7 @@
} else if (os_strcmp(buf, "MIB") == 0) {
reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
if (reply_len >= 0) {
-@@ -3917,6 +3918,7 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4046,6 +4047,7 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
reply_size);
@@ -704,7 +704,7 @@
} else if (os_strcmp(buf, "ATTACH") == 0) {
if (hostapd_ctrl_iface_attach(hapd, from, fromlen, NULL))
reply_len = -1;
-@@ -5464,6 +5466,7 @@ try_again:
+@@ -5994,6 +5996,7 @@ try_again:
return -1;
}
@@ -712,7 +712,7 @@
wpa_msg_register_cb(hostapd_ctrl_iface_msg_cb);
return 0;
-@@ -5565,6 +5568,7 @@ fail:
+@@ -6095,6 +6098,7 @@ fail:
os_free(fname);
interface->global_ctrl_sock = s;
@@ -756,10 +756,10 @@
# none = Empty template
#CONFIG_TLS=openssl
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index a9d326de8..a469b1f4d 100644
+index d69525502..ebf8addc1 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -401,7 +401,6 @@ static int hostapd_cli_cmd_disassociate(struct wpa_ctrl *ctrl, int argc,
+@@ -410,7 +410,6 @@ static int hostapd_cli_cmd_disassociate(struct wpa_ctrl *ctrl, int argc,
}
@@ -767,7 +767,7 @@
static int hostapd_cli_cmd_signature(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
-@@ -414,7 +413,6 @@ static int hostapd_cli_cmd_signature(struct wpa_ctrl *ctrl, int argc,
+@@ -423,7 +422,6 @@ static int hostapd_cli_cmd_signature(struct wpa_ctrl *ctrl, int argc,
os_snprintf(buf, sizeof(buf), "SIGNATURE %s", argv[0]);
return wpa_ctrl_command(ctrl, buf);
}
@@ -775,7 +775,7 @@
static int hostapd_cli_cmd_sa_query(struct wpa_ctrl *ctrl, int argc,
-@@ -431,7 +429,6 @@ static int hostapd_cli_cmd_sa_query(struct wpa_ctrl *ctrl, int argc,
+@@ -440,7 +438,6 @@ static int hostapd_cli_cmd_sa_query(struct wpa_ctrl *ctrl, int argc,
}
@@ -783,7 +783,7 @@
static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
-@@ -657,7 +654,6 @@ static int hostapd_cli_cmd_wps_config(struct wpa_ctrl *ctrl, int argc,
+@@ -666,7 +663,6 @@ static int hostapd_cli_cmd_wps_config(struct wpa_ctrl *ctrl, int argc,
ssid_hex, argv[1]);
return wpa_ctrl_command(ctrl, buf);
}
@@ -791,7 +791,7 @@
static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
-@@ -757,7 +753,7 @@ static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, const char *cmd,
+@@ -766,7 +762,7 @@ static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, const char *cmd,
}
buf[len] = '\0';
@@ -800,7 +800,7 @@
return -1;
if (print)
printf("%s", buf);
-@@ -1670,13 +1666,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1695,13 +1691,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
{ "disassociate", hostapd_cli_cmd_disassociate,
hostapd_complete_stations,
"<addr> = disassociate a station" },
@@ -814,7 +814,7 @@
{ "wps_pin", hostapd_cli_cmd_wps_pin, NULL,
"<uuid> <pin> [timeout] [addr] = add WPS Enrollee PIN" },
{ "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL,
-@@ -1701,7 +1694,6 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1726,7 +1719,6 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
"<SSID> <auth> <encr> <key> = configure AP" },
{ "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL,
"= show current WPS status" },
@@ -823,7 +823,7 @@
"= send Disassociation Imminent notification" },
{ "ess_disassoc", hostapd_cli_cmd_ess_disassoc, NULL,
diff --git a/hostapd/main.c b/hostapd/main.c
-index 524a10274..0ccd4a5d7 100644
+index aa1f69812..e790f18ce 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -31,7 +31,7 @@
@@ -843,7 +843,7 @@
#ifndef CONFIG_NO_HOSTAPD_LOGGER
static void hostapd_logger_cb(void *ctx, const u8 *addr, unsigned int module,
-@@ -690,6 +691,11 @@ fail:
+@@ -692,6 +693,11 @@ fail:
return -1;
}
@@ -855,7 +855,7 @@
#ifdef CONFIG_WPS
static int gen_uuid(const char *txt_addr)
-@@ -781,6 +787,11 @@ int main(int argc, char *argv[])
+@@ -784,6 +790,11 @@ int main(int argc, char *argv[])
if (os_program_init())
return -1;
@@ -867,7 +867,7 @@
os_memset(&interfaces, 0, sizeof(interfaces));
interfaces.reload_config = hostapd_reload_config;
interfaces.config_read_cb = hostapd_config_read;
-@@ -806,8 +817,10 @@ int main(int argc, char *argv[])
+@@ -813,8 +824,10 @@ int main(int argc, char *argv[])
return -1;
#endif /* CONFIG_DPP */
@@ -879,7 +879,7 @@
if (c < 0)
break;
switch (c) {
-@@ -844,6 +857,8 @@ int main(int argc, char *argv[])
+@@ -851,6 +864,8 @@ int main(int argc, char *argv[])
break;
#endif /* CONFIG_DEBUG_LINUX_TRACING */
case 'v':
@@ -888,7 +888,7 @@
show_version();
exit(1);
case 'g':
-@@ -1013,6 +1028,7 @@ int main(int argc, char *argv[])
+@@ -1020,6 +1035,7 @@ int main(int argc, char *argv[])
}
hostapd_global_ctrl_iface_init(&interfaces);
@@ -896,7 +896,7 @@
if (hostapd_global_run(&interfaces, daemonize, pid_file)) {
wpa_printf(MSG_ERROR, "Failed to start eloop");
-@@ -1022,6 +1038,7 @@ int main(int argc, char *argv[])
+@@ -1029,6 +1045,7 @@ int main(int argc, char *argv[])
ret = 0;
out:
@@ -905,10 +905,10 @@
/* Deinitialize all interfaces */
for (i = 0; i < interfaces.count; i++) {
diff --git a/src/ap/acs.c b/src/ap/acs.c
-index 28b0ba71c..4c4c750ab 100644
+index f5b36d327..25fec499a 100644
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
-@@ -467,17 +467,17 @@ static int acs_get_bw_center_chan(int freq, enum bw_type bw)
+@@ -471,17 +471,17 @@ static int acs_get_bw_center_chan(int freq, enum bw_type bw)
static int acs_survey_is_sufficient(struct freq_survey *survey)
{
if (!(survey->filled & SURVEY_HAS_NF)) {
@@ -928,7 +928,7 @@
}
if (!(survey->filled & SURVEY_HAS_CHAN_TIME_BUSY) &&
-@@ -485,7 +485,6 @@ static int acs_survey_is_sufficient(struct freq_survey *survey)
+@@ -489,7 +489,6 @@ static int acs_survey_is_sufficient(struct freq_survey *survey)
wpa_printf(MSG_INFO,
"ACS: Survey for freq %d is missing RX and busy time (at least one is required)",
survey->freq);
@@ -970,7 +970,7 @@
return sta_set_airtime_weight(hapd, sta, weight);
}
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 2330163c4..d10b00be9 100644
+index e6669e6a3..29a9ae7db 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -121,6 +121,7 @@ struct hostapd_ssid {
@@ -997,8 +997,44 @@
+ int dynamic_own_ip_addr;
char *nas_identifier;
struct hostapd_radius_servers *radius;
- int acct_interim_interval;
-@@ -1064,6 +1068,8 @@ struct hostapd_config {
+ int radius_require_message_authenticator;
+@@ -995,6 +999,35 @@ struct hostapd_bss_config {
+ bool mld_indicate_disabled;
+ #endif /* CONFIG_TESTING_OPTIONS */
+ #endif /* CONFIG_IEEE80211BE */
++
++#ifdef CONFIG_APUP
++ /**
++ * Access Point Micro Peering
++ * A simpler and more useful successor to Ad Hoc,
++ * Wireless Distribution System, 802.11s mesh mode, Multi-AP and EasyMesh.
++ *
++ * Almost plain APs communicate between them via 4-address mode, like in WDS
++ * but all of them are AP, so they can eventually communicate also with
++ * plain stations and more AP nodes in sight.
++ * Low hardware requirements, just AP mode support + 4-address mode, and no
++ * more unnecessary complications, like hardcoded bridging or routing
++ * algorithm in WiFi stack.
++ * For each AP in sight an interface is created, and then it can be used as
++ * convenient in each case, bridging, routing etc.
++ */
++ bool apup;
++
++ /**
++ * In 4-address mode each peer AP in sight is associated to its own
++ * interface so we have more flexibility in "user-space".
++ * Those interfaces could be simply bridged in a trivial topology (which
++ * happens automatically if wds_bridge is not an empty string), or feeded to
++ * a routing daemon.
++ *
++ * If not defined interface names are generated following the WDS convention.
++ */
++ char apup_peer_ifname_prefix[IFNAMSIZ + 1];
++#endif /* CONFIG_APUP */
+ };
+
+ /**
+@@ -1085,6 +1118,8 @@ struct hostapd_config {
unsigned int track_sta_max_num;
unsigned int track_sta_max_age;
@@ -1007,7 +1043,7 @@
char country[3]; /* first two octets: country code as described in
* ISO/IEC 3166-1. Third octet:
* ' ' (ascii 32): all environments
-@@ -1101,6 +1107,8 @@ struct hostapd_config {
+@@ -1122,6 +1157,8 @@ struct hostapd_config {
int ht_op_mode_fixed;
u16 ht_capab;
@@ -1017,11 +1053,42 @@
int secondary_channel;
int no_pri_sec_switch;
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 32722084d..527b2c984 100644
+index c47349110..7c9527cd3 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -387,8 +387,6 @@ int hostapd_set_wds_sta(struct hostapd_data *hapd, char *ifname_wds,
+@@ -385,13 +385,37 @@ int hostapd_set_wds_sta(struct hostapd_data *hapd, char *ifname_wds,
+ const u8 *addr, int aid, int val)
+ {
+ const char *bridge = NULL;
++ char ifName[IFNAMSIZ + 1];
++
++ int mRet = 0;
+
+ if (hapd->driver == NULL || hapd->driver->set_wds_sta == NULL)
return -1;
++
++#ifdef CONFIG_APUP
++ if (hapd->conf->apup && hapd->conf->apup_peer_ifname_prefix[0]) {
++ mRet = os_snprintf(
++ ifName, sizeof(ifName), "%s%d",
++ hapd->conf->apup_peer_ifname_prefix, aid);
++ }
++ else
++#endif // def CONFIG_APUP
++ mRet = os_snprintf(
++ ifName, sizeof(ifName), "%s.sta%d",
++ hapd->conf->iface, aid);
++
++ if (mRet >= (int) sizeof(ifName))
++ wpa_printf(MSG_WARNING,
++ "nl80211: WDS interface name was truncated");
++ else if (mRet < 0)
++ return mRet;
++
++ // Pass back to the caller the resulting interface name
++ if (ifname_wds)
++ os_strlcpy(ifname_wds, ifName, IFNAMSIZ + 1);
++
if (hapd->conf->wds_bridge[0])
bridge = hapd->conf->wds_bridge;
- else if (hapd->conf->bridge[0])
@@ -1029,21 +1096,21 @@
return hapd->driver->set_wds_sta(hapd->drv_priv, addr, aid, val,
bridge, ifname_wds);
}
-@@ -1031,7 +1029,8 @@ int hostapd_start_dfs_cac(struct hostapd_iface *iface,
- int hostapd_drv_set_qos_map(struct hostapd_data *hapd,
- const u8 *qos_map_set, u8 qos_map_set_len)
- {
-- if (!hapd->driver || !hapd->driver->set_qos_map || !hapd->drv_priv)
-+ if (!hapd->driver || !hapd->driver->set_qos_map || !hapd->drv_priv ||
-+ !(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_QOS_MAPPING))
- return 0;
- return hapd->driver->set_qos_map(hapd->drv_priv, qos_map_set,
- qos_map_set_len);
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index d7e79c840..f8a8725be 100644
+index d7e79c840..58ca046c6 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -371,12 +371,12 @@ static inline int hostapd_drv_br_port_set_attr(struct hostapd_data *hapd,
+@@ -35,6 +35,9 @@ int hostapd_set_drv_ieee8021x(struct hostapd_data *hapd, const char *ifname,
+ int enabled);
+ int hostapd_vlan_if_add(struct hostapd_data *hapd, const char *ifname);
+ int hostapd_vlan_if_remove(struct hostapd_data *hapd, const char *ifname);
++
++/** @param val as per nl80211 driver implementation, 1 means add 0 means remove
++ */
+ int hostapd_set_wds_sta(struct hostapd_data *hapd, char *ifname_wds,
+ const u8 *addr, int aid, int val);
+ int hostapd_sta_add(struct hostapd_data *hapd,
+@@ -371,12 +374,12 @@ static inline int hostapd_drv_br_port_set_attr(struct hostapd_data *hapd,
static inline int hostapd_drv_br_set_net_param(struct hostapd_data *hapd,
enum drv_br_net_param param,
@@ -1058,7 +1125,7 @@
}
static inline int hostapd_drv_vendor_cmd(struct hostapd_data *hapd,
-@@ -404,6 +404,23 @@ static inline int hostapd_drv_stop_ap(struct hostapd_data *hapd)
+@@ -404,6 +407,23 @@ static inline int hostapd_drv_stop_ap(struct hostapd_data *hapd)
return hapd->driver->stop_ap(hapd->drv_priv, link_id);
}
@@ -1082,11 +1149,215 @@
static inline int hostapd_drv_channel_info(struct hostapd_data *hapd,
struct wpa_channel_info *ci)
{
+diff --git a/src/ap/apup.c b/src/ap/apup.c
+new file mode 100644
+index 000000000..f736ddc8e
+--- /dev/null
++++ b/src/ap/apup.c
+@@ -0,0 +1,168 @@
++/*
++ * hostapd / APuP Access Point Micro Peering
++ *
++ * Copyright (C) 2023-2024 Gioacchino Mazzurco <gio@polymathes.cc>
++ *
++ * This software may be distributed under the terms of the BSD license.
++ * See README for more details.
++ */
++
++/* Be extremely careful altering include order, move just one in the wrong place
++ * and you will start getting a bunch of error of undefined bool, size_t etc. */
++
++#include "utils/includes.h"
++#include "utils/common.h"
++#include "utils/os.h"
++
++#include "apup.h"
++
++#include "drivers/driver.h"
++#include "wpa_auth.h"
++#include "ap_mlme.h"
++#include "ieee802_11.h"
++#include "ap_drv_ops.h"
++#include "sta_info.h"
++
++#ifdef UBUS_SUPPORT
++# include "ubus.h"
++#endif
++
++#ifdef UCODE_SUPPORT
++# include "ucode.h"
++#endif
++
++void apup_process_beacon(struct hostapd_data *hapd,
++ const struct ieee80211_mgmt *mgmt, size_t len,
++ const struct ieee802_11_elems *elems )
++{
++ if (!os_memcmp(hapd->own_addr, mgmt->bssid, ETH_ALEN))
++ {
++ wpa_printf(MSG_WARNING,
++ "apup_process_beacon(...) own beacon elems.ssid %.*s",
++ (int) elems->ssid_len, elems->ssid);
++ return;
++ }
++
++ if (elems->ssid_len != hapd->conf->ssid.ssid_len ||
++ os_memcmp(elems->ssid, hapd->conf->ssid.ssid, elems->ssid_len))
++ return;
++
++ struct sta_info* sta_ret = ap_get_sta(hapd, mgmt->bssid);
++ if (sta_ret)
++ return;
++
++ sta_ret = ap_sta_add(hapd, mgmt->bssid);
++
++ /* TODO: this has been added just to making compiler happy after breaking
++ * changes introduced in 11a607d121df512e010148bedcb4263a03329dc7 to support
++ * IEEE80211BE Multi Link Operation. Look at that commit with more time and
++ * understand what could be a proper implementation in this context too
++ */
++ const u8 *mld_link_addr = NULL;
++ bool mld_link_sta = false;
++
++ /* First add the station without more information */
++ int aRet = hostapd_sta_add(
++ hapd, mgmt->bssid, sta_ret->aid, 0,
++ NULL, 0, 0, NULL, NULL, NULL, 0, NULL, 0, NULL,
++ sta_ret->flags, 0, 0, 0,
++ 0, // 0 add, 1 set
++ mld_link_addr, mld_link_sta);
++
++ sta_ret->flags |= WLAN_STA_AUTH;
++ wpa_auth_sm_event(sta_ret->wpa_sm, WPA_AUTH);
++
++ /* TODO: Investigate if supporting WPA or other encryption method is
++ * possible */
++ sta_ret->auth_alg = WLAN_AUTH_OPEN;
++ mlme_authenticate_indication(hapd, sta_ret);
++
++ sta_ret->capability = le_to_host16(mgmt->u.beacon.capab_info);
++
++ if (sta_ret->capability & WLAN_CAPABILITY_SHORT_PREAMBLE)
++ sta_ret->flags |= WLAN_STA_SHORT_PREAMBLE;
++ else
++ sta_ret->flags &= ~WLAN_STA_SHORT_PREAMBLE;
++
++ hostapd_copy_supp_rates(hapd, sta_ret, elems);
++
++ /* Whithout this flag copy_sta_[v]ht_capab will disable [V]HT
++ * capabilities even if available */
++ if (elems->ht_capabilities || elems->vht_capabilities)
++ sta_ret->flags |= WLAN_STA_WMM;
++
++ copy_sta_ht_capab(hapd, sta_ret, elems->ht_capabilities);
++#ifdef CONFIG_IEEE80211AC
++ copy_sta_vht_capab(hapd, sta_ret, elems->vht_capabilities);
++ copy_sta_vht_oper(hapd, sta_ret, elems->vht_operation);
++ copy_sta_vendor_vht(hapd, sta_ret, elems->vendor_vht, elems->vendor_vht_len);
++#endif // def CONFIG_IEEE80211AC
++#ifdef CONFIG_IEEE80211AX
++ copy_sta_he_capab(hapd, sta_ret, IEEE80211_MODE_AP,
++ elems->he_capabilities, elems->he_capabilities_len);
++ copy_sta_he_6ghz_capab(hapd, sta_ret, elems->he_6ghz_band_cap);
++#endif // def CONFIG_IEEE80211AX
++#ifdef CONFIG_IEEE80211BE
++ copy_sta_eht_capab(hapd, sta_ret,
++ IEEE80211_MODE_AP, // TODO: Make sure is the right value
++ elems->he_capabilities, elems->he_capabilities_len,
++ elems->eht_capabilities, elems->eht_capabilities_len);
++#endif //def CONFIG_IEEE80211BE
++
++ update_ht_state(hapd, sta_ret);
++
++ if (hostapd_get_aid(hapd, sta_ret) < 0)
++ {
++ wpa_printf(MSG_INFO, "apup_process_beacon(...) No room for more AIDs");
++ return;
++ }
++
++ sta_ret->flags |= WLAN_STA_ASSOC_REQ_OK;
++
++ /* Make sure that the previously registered inactivity timer will not
++ * remove the STA immediately. */
++ sta_ret->timeout_next = STA_NULLFUNC;
++
++ sta_ret->flags |= WLAN_STA_AUTH | WLAN_STA_ASSOC;
++
++ /* Then set the paramethers */
++ int sRet = hostapd_sta_add(
++ hapd, mgmt->bssid, sta_ret->aid,
++ sta_ret->capability,
++ sta_ret->supported_rates, sta_ret->supported_rates_len,
++ 0, // u16 listen_interval TODO ?
++ sta_ret->ht_capabilities,
++ sta_ret->vht_capabilities,
++ sta_ret->he_capab, sta_ret->he_capab_len,
++ sta_ret->eht_capab, sta_ret->eht_capab_len,
++ sta_ret->he_6ghz_capab,
++ sta_ret->flags,
++ 0, // u8 qosinfo
++ sta_ret->vht_opmode,
++ 0, // int supp_p2p_ps
++ 1, // 0 add, 1 set
++ mld_link_addr, mld_link_sta);
++
++ ap_sta_set_authorized(hapd, sta_ret, 1);
++ hostapd_set_sta_flags(hapd, sta_ret);
++
++ char mIfname[IFNAMSIZ + 1];
++ os_memset(mIfname, 0, IFNAMSIZ + 1);
++
++ // last param 1 means add 0 means remove
++ int mRet = hostapd_set_wds_sta(
++ hapd, mIfname, mgmt->bssid, sta_ret->aid, 1);
++
++ wpa_printf(MSG_INFO,
++ "apup_process_beacon(...) Added APuP peer at %s with flags: %d,"
++ " capabilities %d",
++ mIfname, sta_ret->flags, sta_ret->capability);
++
++#ifdef UBUS_SUPPORT
++ hostapd_ubus_notify_apup_newpeer(hapd, mgmt->bssid, mIfname);
++#endif
++
++#ifdef UCODE_SUPPORT
++ hostapd_ucode_apup_newpeer(hapd, mIfname);
++#endif
++}
+diff --git a/src/ap/apup.h b/src/ap/apup.h
+new file mode 100644
+index 000000000..a14a283bb
+--- /dev/null
++++ b/src/ap/apup.h
+@@ -0,0 +1,24 @@
++/*
++ * hostapd / APuP Access Point Micro Peering
++ *
++ * Copyright (C) 2023-2024 Gioacchino Mazzurco <gio@polymathes.cc>
++ *
++ * This software may be distributed under the terms of the BSD license.
++ * See README for more details.
++ */
++
++/* Be extremely careful altering include order, move just one in the wrong place
++ * and you will start getting a bunch of error of undefined bool, size_t etc. */
++
++#include "utils/includes.h"
++#include "utils/common.h"
++
++#include "hostapd.h"
++#include "common/ieee802_11_defs.h"
++
++/** When beacons from other Access Point are received, if the SSID is matching
++ * add them as APuP peers (aka WDS STA to our own AP) the same happens on the
++ * peer when receiving our beacons */
++void apup_process_beacon(struct hostapd_data *hapd,
++ const struct ieee80211_mgmt *mgmt, size_t len,
++ const struct ieee802_11_elems *elems );
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
-index 4354dfae3..26453cb2c 100644
+index ddb99ca22..58b561661 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
-@@ -1343,6 +1343,12 @@ void handle_probe_req(struct hostapd_data *hapd,
+@@ -1439,6 +1439,12 @@ void handle_probe_req(struct hostapd_data *hapd,
int mld_id;
u16 links;
#endif /* CONFIG_IEEE80211BE */
@@ -1099,7 +1370,16 @@
if (hapd->iconf->rssi_ignore_probe_request && ssi_signal &&
ssi_signal < hapd->iconf->rssi_ignore_probe_request)
-@@ -1529,6 +1535,12 @@ void handle_probe_req(struct hostapd_data *hapd,
+@@ -1492,7 +1498,7 @@ void handle_probe_req(struct hostapd_data *hapd,
+ * is less likely to see them (Probe Request frame sent on a
+ * neighboring, but partially overlapping, channel).
+ */
+- if (elems.ds_params &&
++ if (elems.ds_params && 0 &&
+ hapd->iface->current_mode &&
+ (hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G ||
+ hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211B) &&
+@@ -1625,6 +1631,12 @@ void handle_probe_req(struct hostapd_data *hapd,
}
#endif /* CONFIG_P2P */
@@ -1112,7 +1392,7 @@
/* TODO: verify that supp_rates contains at least one matching rate
* with AP configuration */
-@@ -1547,7 +1559,7 @@ void handle_probe_req(struct hostapd_data *hapd,
+@@ -1643,7 +1655,7 @@ void handle_probe_req(struct hostapd_data *hapd,
if (hapd->conf->no_probe_resp_if_max_sta &&
is_multicast_ether_addr(mgmt->da) &&
is_multicast_ether_addr(mgmt->bssid) &&
@@ -1122,7 +1402,7 @@
wpa_printf(MSG_MSGDUMP, "%s: Ignore Probe Request from " MACSTR
" since no room for additional STA",
diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
-index 2cfef4bd4..cd7db4fc6 100644
+index d4d73de19..a1ddbda9f 100644
--- a/src/ap/ctrl_iface_ap.c
+++ b/src/ap/ctrl_iface_ap.c
@@ -26,6 +26,26 @@
@@ -1179,7 +1459,7 @@
static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd,
struct sta_info *sta,
char *buf, size_t buflen)
-@@ -539,6 +539,7 @@ int hostapd_ctrl_iface_sta_next(struct hostapd_data *hapd, const char *txtaddr,
+@@ -562,6 +562,7 @@ int hostapd_ctrl_iface_sta_next(struct hostapd_data *hapd, const char *txtaddr,
return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
}
@@ -1187,7 +1467,7 @@
#ifdef CONFIG_P2P_MANAGER
static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
-@@ -987,12 +988,12 @@ int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf,
+@@ -1010,12 +1011,12 @@ int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf,
return len;
len += ret;
}
@@ -1203,10 +1483,10 @@
ret = os_snprintf(buf + len, buflen - len, "supported_rates=");
if (os_snprintf_error(buflen - len, ret))
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
-index fc2e8d83c..d14fad136 100644
+index af9dc16f5..fe044297b 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -17,6 +17,7 @@
+@@ -18,6 +18,7 @@
#include "ap_drv_ops.h"
#include "drivers/driver.h"
#include "dfs.h"
@@ -1214,7 +1494,7 @@
enum dfs_channel_type {
-@@ -526,9 +527,14 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
+@@ -527,9 +528,14 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
int num_available_chandefs;
int chan_idx, chan_idx2;
int sec_chan_idx_80p80 = -1;
@@ -1229,7 +1509,7 @@
wpa_printf(MSG_DEBUG, "DFS: Selecting random channel");
*secondary_channel = 0;
*oper_centr_freq_seg0_idx = 0;
-@@ -548,8 +554,20 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
+@@ -549,8 +555,20 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
if (num_available_chandefs == 0)
return NULL;
@@ -1251,7 +1531,7 @@
chan_idx = _rand % num_available_chandefs;
wpa_printf(MSG_DEBUG, "DFS: Picked random entry from the list: %d/%d",
chan_idx, num_available_chandefs);
-@@ -1207,6 +1225,8 @@ int hostapd_dfs_pre_cac_expired(struct hostapd_iface *iface, int freq,
+@@ -1218,6 +1236,8 @@ int hostapd_dfs_pre_cac_expired(struct hostapd_iface *iface, int freq,
"freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d",
freq, ht_enabled, chan_offset, chan_width, cf1, cf2);
@@ -1261,10 +1541,10 @@
if (iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD)
return 0;
diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
-index dc21977ff..e8796f709 100644
+index c74e551c5..6e76f697a 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
-@@ -268,6 +268,10 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
+@@ -270,6 +270,10 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
struct hostapd_iface *iface = hapd->iface;
#endif /* CONFIG_OWE */
bool updated = false;
@@ -1275,7 +1555,7 @@
if (addr == NULL) {
/*
-@@ -412,6 +416,12 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
+@@ -414,6 +418,12 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
goto fail;
}
@@ -1288,9 +1568,9 @@
#ifdef CONFIG_P2P
if (elems.p2p) {
wpabuf_free(sta->p2p_ie);
-@@ -2342,8 +2352,8 @@ static void hostapd_eapol_tx_status(struct hostapd_data *hapd, const u8 *dst,
- ieee802_1x_eapol_tx_status(hapd, sta, data, len, ack);
- }
+@@ -2416,8 +2426,8 @@ static void hostapd_event_color_change(struct hostapd_data *hapd, bool success)
+ #endif /* CONFIG_IEEE80211AX */
+
-void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
- union wpa_event_data *data)
@@ -1299,7 +1579,7 @@
{
struct hostapd_data *hapd = ctx;
struct sta_info *sta;
-@@ -2675,7 +2685,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
+@@ -2776,7 +2786,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
}
@@ -1309,7 +1589,7 @@
{
struct hapd_interfaces *interfaces = ctx;
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index b899c9831..7959859b0 100644
+index 5a8cdc90e..8159194e1 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -247,6 +247,29 @@ static int hostapd_iface_conf_changed(struct hostapd_config *newconf,
@@ -1360,24 +1640,24 @@
accounting_deinit(hapd);
hostapd_deinit_wpa(hapd);
vlan_deinit(hapd);
+@@ -485,7 +512,7 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd)
+ struct hapd_interfaces *ifaces = hapd->iface->interfaces;
+ size_t i;
+
+- for (i = 0; i < ifaces->count; i++) {
++ for (i = 0; ifaces && i < ifaces->count; i++) {
+ struct hostapd_iface *iface = ifaces->iface[i];
+ size_t j;
+
@@ -685,6 +712,7 @@ static void sta_track_deinit(struct hostapd_iface *iface)
void hostapd_cleanup_iface_partial(struct hostapd_iface *iface)
{
wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface);
-+ eloop_cancel_timeout(channel_list_update_timeout, iface, NULL);
++ hostapd_ucode_free_iface(iface);
+ eloop_cancel_timeout(channel_list_update_timeout, iface, NULL);
#ifdef NEED_AP_MLME
hostapd_stop_setup_timers(iface);
- #endif /* NEED_AP_MLME */
-@@ -714,7 +742,7 @@ void hostapd_cleanup_iface_partial(struct hostapd_iface *iface)
- static void hostapd_cleanup_iface(struct hostapd_iface *iface)
- {
- wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface);
-- eloop_cancel_timeout(channel_list_update_timeout, iface, NULL);
-+ hostapd_ucode_free_iface(iface);
- eloop_cancel_timeout(hostapd_interface_setup_failure_handler, iface,
- NULL);
-
-@@ -1303,6 +1331,9 @@ static int hostapd_start_beacon(struct hostapd_data *hapd,
+@@ -1304,6 +1332,9 @@ static int hostapd_start_beacon(struct hostapd_data *hapd,
if (hapd->driver && hapd->driver->set_operstate)
hapd->driver->set_operstate(hapd->drv_priv, 1);
@@ -1387,7 +1667,15 @@
return 0;
}
-@@ -1324,8 +1355,7 @@ static int hostapd_start_beacon(struct hostapd_data *hapd,
+@@ -1336,6 +1367,7 @@ static int hostapd_bss_radius_init(struct hostapd_data *hapd)
+
+ os_memset(&das_conf, 0, sizeof(das_conf));
+ das_conf.port = conf->radius_das_port;
++ das_conf.nas_identifier = conf->nas_identifier;
+ das_conf.shared_secret = conf->radius_das_shared_secret;
+ das_conf.shared_secret_len =
+ conf->radius_das_shared_secret_len;
+@@ -1378,8 +1410,7 @@ static int hostapd_bss_radius_init(struct hostapd_data *hapd)
* initialized. Most of the modules that are initialized here will be
* deinitialized in hostapd_cleanup().
*/
@@ -1397,31 +1685,7 @@
{
struct hostapd_bss_config *conf = hapd->conf;
u8 ssid[SSID_MAX_LEN + 1];
-@@ -1552,6 +1582,7 @@ setup_mld:
-
- os_memset(&das_conf, 0, sizeof(das_conf));
- das_conf.port = conf->radius_das_port;
-+ das_conf.nas_identifier = conf->nas_identifier;
- das_conf.shared_secret = conf->radius_das_shared_secret;
- das_conf.shared_secret_len =
- conf->radius_das_shared_secret_len;
-@@ -1627,6 +1658,7 @@ setup_mld:
- wpa_printf(MSG_ERROR, "GAS server initialization failed");
- return -1;
- }
-+#endif /* CONFIG_INTERWORKING */
-
- if (conf->qos_map_set_len &&
- hostapd_drv_set_qos_map(hapd, conf->qos_map_set,
-@@ -1634,7 +1666,6 @@ setup_mld:
- wpa_printf(MSG_ERROR, "Failed to initialize QoS Map");
- return -1;
- }
--#endif /* CONFIG_INTERWORKING */
-
- if (conf->bss_load_update_period && bss_load_update_init(hapd)) {
- wpa_printf(MSG_ERROR, "BSS Load initialization failed");
-@@ -2447,6 +2478,7 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface,
+@@ -2510,6 +2541,7 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface,
if (err)
goto fail;
@@ -1429,7 +1693,7 @@
wpa_printf(MSG_DEBUG, "Completing interface initialization");
if (iface->freq) {
#ifdef NEED_AP_MLME
-@@ -2676,6 +2708,7 @@ dfs_offload:
+@@ -2739,6 +2771,7 @@ dfs_offload:
fail:
wpa_printf(MSG_ERROR, "Interface initialization failed");
@@ -1437,7 +1701,7 @@
if (iface->is_no_ir) {
hostapd_set_state(iface, HAPD_IFACE_NO_IR);
-@@ -2875,7 +2908,7 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
+@@ -2938,7 +2971,7 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
}
@@ -1446,7 +1710,7 @@
{
if (!hapd)
return;
-@@ -3395,6 +3428,7 @@ void hostapd_interface_deinit_free(struct hostapd_iface *iface)
+@@ -3471,6 +3504,7 @@ void hostapd_interface_deinit_free(struct hostapd_iface *iface)
(unsigned int) iface->conf->num_bss);
driver = iface->bss[0]->driver;
drv_priv = iface->bss[0]->drv_priv;
@@ -1454,7 +1718,7 @@
hostapd_interface_deinit(iface);
wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit",
__func__, driver, drv_priv);
-@@ -3926,7 +3960,8 @@ int hostapd_remove_iface(struct hapd_interfaces *interfaces, char *buf)
+@@ -4002,7 +4036,8 @@ int hostapd_remove_iface(struct hapd_interfaces *interfaces, char *buf)
hapd_iface = interfaces->iface[i];
if (hapd_iface == NULL)
return -1;
@@ -1464,7 +1728,7 @@
wpa_printf(MSG_INFO, "Remove interface '%s'", buf);
hapd_iface->driver_ap_teardown =
!!(hapd_iface->drv_flags &
-@@ -3972,6 +4007,8 @@ int hostapd_remove_iface(struct hapd_interfaces *interfaces, char *buf)
+@@ -4048,6 +4083,8 @@ int hostapd_remove_iface(struct hapd_interfaces *interfaces, char *buf)
void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
int reassoc)
{
@@ -1473,9 +1737,20 @@
if (hapd->tkip_countermeasures) {
hostapd_drv_sta_deauth(hapd, sta->addr,
WLAN_REASON_MICHAEL_MIC_FAILURE);
-@@ -3983,6 +4020,8 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
- sta->mld_assoc_link_id != hapd->mld_link_id)
- return;
+@@ -4055,10 +4092,16 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
+ }
+
+ #ifdef CONFIG_IEEE80211BE
+- if (ap_sta_is_mld(hapd, sta) &&
+- sta->mld_assoc_link_id != hapd->mld_link_id)
+- return;
++ if (ap_sta_is_mld(hapd, sta)) {
++ if (sta->mld_assoc_link_id == hapd->mld_link_id) {
++ mld_assoc_link_id = sta->mld_assoc_link_id;
++ } else {
++ return;
++ }
++ }
#endif /* CONFIG_IEEE80211BE */
+ if (mld_assoc_link_id != -2)
+ hostapd_prune_associations(hapd, sta->addr, mld_assoc_link_id);
@@ -1483,16 +1758,10 @@
ap_sta_clear_disconnect_timeouts(hapd, sta);
sta->post_csa_sa_query = 0;
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
-index 594866fbb..1e4113459 100644
+index 996977fdf..994e4681e 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
-@@ -13,11 +13,14 @@
- #include <sqlite3.h>
- #endif /* CONFIG_SQLITE */
-
-+#include "ap/sta_info.h"
- #include "common/defs.h"
- #include "common/dpp.h"
+@@ -18,6 +18,8 @@
#include "utils/list.h"
#include "ap_config.h"
#include "drivers/driver.h"
@@ -1501,7 +1770,7 @@
#define OCE_STA_CFON_ENABLED(hapd) \
((hapd->conf->oce & OCE_STA_CFON) && \
-@@ -51,6 +54,10 @@ struct hapd_interfaces {
+@@ -51,6 +53,10 @@ struct hapd_interfaces {
struct hostapd_config * (*config_read_cb)(const char *config_fname);
int (*ctrl_iface_init)(struct hostapd_data *hapd);
void (*ctrl_iface_deinit)(struct hostapd_data *hapd);
@@ -1512,7 +1781,7 @@
int (*for_each_interface)(struct hapd_interfaces *interfaces,
int (*cb)(struct hostapd_iface *iface,
void *ctx), void *ctx);
-@@ -167,6 +174,21 @@ struct hostapd_sae_commit_queue {
+@@ -169,6 +175,21 @@ struct hostapd_sae_commit_queue {
u8 msg[];
};
@@ -1534,7 +1803,7 @@
/**
* struct hostapd_data - hostapd per-BSS data structure
*/
-@@ -174,6 +196,8 @@ struct hostapd_data {
+@@ -176,6 +197,8 @@ struct hostapd_data {
struct hostapd_iface *iface;
struct hostapd_config *iconf;
struct hostapd_bss_config *conf;
@@ -1543,7 +1812,7 @@
int interface_added; /* virtual interface added for this BSS */
unsigned int started:1;
unsigned int disabled:1;
-@@ -181,6 +205,9 @@ struct hostapd_data {
+@@ -183,6 +206,9 @@ struct hostapd_data {
u8 own_addr[ETH_ALEN];
@@ -1553,7 +1822,7 @@
int num_sta; /* number of entries in sta_list */
struct sta_info *sta_list; /* STA info list head */
#define STA_HASH_SIZE 256
-@@ -523,6 +550,7 @@ struct hostapd_mld {
+@@ -535,6 +561,7 @@ struct hostapd_mld {
*/
struct hostapd_iface {
struct hapd_interfaces *interfaces;
@@ -1561,7 +1830,7 @@
void *owner;
char *config_fname;
struct hostapd_config *conf;
-@@ -745,6 +773,7 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
+@@ -786,6 +813,7 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
struct hostapd_bss_config *bss);
int hostapd_setup_interface(struct hostapd_iface *iface);
int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err);
@@ -1569,7 +1838,7 @@
void hostapd_interface_deinit(struct hostapd_iface *iface);
void hostapd_interface_free(struct hostapd_iface *iface);
struct hostapd_iface * hostapd_alloc_iface(void);
-@@ -753,6 +782,8 @@ struct hostapd_iface * hostapd_init(struct hapd_interfaces *interfaces,
+@@ -794,6 +822,8 @@ struct hostapd_iface * hostapd_init(struct hapd_interfaces *interfaces,
struct hostapd_iface *
hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy,
const char *config_fname, int debug);
@@ -1578,7 +1847,7 @@
void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
int reassoc);
void hostapd_interface_deinit_free(struct hostapd_iface *iface);
-@@ -780,6 +811,7 @@ void hostapd_cleanup_cs_params(struct hostapd_data *hapd);
+@@ -821,6 +851,7 @@ void hostapd_cleanup_cs_params(struct hostapd_data *hapd);
void hostapd_periodic_iface(struct hostapd_iface *iface);
int hostapd_owe_trans_get_info(struct hostapd_data *hapd);
void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx);
@@ -1586,9 +1855,9 @@
void hostapd_switch_color(struct hostapd_data *hapd, u64 bitmap);
void hostapd_cleanup_cca_params(struct hostapd_data *hapd);
-@@ -865,4 +897,14 @@ static inline bool hostapd_mld_is_first_bss(struct hostapd_data *hapd)
+@@ -908,6 +939,16 @@ static inline bool hostapd_mld_is_first_bss(struct hostapd_data *hapd)
- u16 hostapd_get_punct_bitmap(struct hostapd_data *hapd);
+ #endif /* CONFIG_IEEE80211BE */
+static inline bool ap_sta_is_mld(struct hostapd_data *hapd,
+ struct sta_info *sta)
@@ -1600,12 +1869,14 @@
+#endif /* CONFIG_IEEE80211BE */
+}
+
+ u16 hostapd_get_punct_bitmap(struct hostapd_data *hapd);
+
#endif /* HOSTAPD_H */
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
-index 222f3dc05..672e43a10 100644
+index 8aa0b3ab5..400c50988 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
-@@ -546,7 +546,8 @@ static int ieee80211n_check_40mhz(struct hostapd_iface *iface)
+@@ -553,7 +553,8 @@ static int ieee80211n_check_40mhz(struct hostapd_iface *iface)
int ret;
/* Check that HT40 is used and PRI / SEC switch is allowed */
@@ -1616,10 +1887,20 @@
hostapd_set_state(iface, HAPD_IFACE_HT_SCAN);
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index 179af5e28..bda61b998 100644
+index d8d82d737..39b1bb4c7 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
-@@ -2804,7 +2804,7 @@ static void handle_auth(struct hostapd_data *hapd,
+@@ -59,6 +59,9 @@
+ #include "nan_usd_ap.h"
+ #include "pasn/pasn_common.h"
+
++#ifdef CONFIG_APUP
++# include "apup.h"
++#endif // def CONFIG_APUP
+
+ #ifdef CONFIG_FILS
+ static struct wpabuf *
+@@ -2876,7 +2879,7 @@ static void handle_auth(struct hostapd_data *hapd,
u16 auth_alg, auth_transaction, status_code;
u16 resp = WLAN_STATUS_SUCCESS;
struct sta_info *sta = NULL;
@@ -1628,7 +1909,7 @@
u16 fc;
const u8 *challenge = NULL;
u8 resp_ies[2 + WLAN_AUTH_CHALLENGE_LEN];
-@@ -2815,6 +2815,11 @@ static void handle_auth(struct hostapd_data *hapd,
+@@ -2887,6 +2890,11 @@ static void handle_auth(struct hostapd_data *hapd,
#ifdef CONFIG_IEEE80211BE
bool mld_sta = false;
#endif /* CONFIG_IEEE80211BE */
@@ -1640,7 +1921,7 @@
if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) {
wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)",
-@@ -3008,6 +3013,13 @@ static void handle_auth(struct hostapd_data *hapd,
+@@ -3083,6 +3091,13 @@ static void handle_auth(struct hostapd_data *hapd,
resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
goto fail;
}
@@ -1654,23 +1935,27 @@
if (res == HOSTAPD_ACL_PENDING)
return;
-@@ -3042,15 +3054,6 @@ static void handle_auth(struct hostapd_data *hapd,
- seq_ctrl);
- return;
- }
--#ifdef CONFIG_MESH
-- if ((hapd->conf->mesh & MESH_ENABLED) &&
-- sta->plink_state == PLINK_BLOCKED) {
-- wpa_printf(MSG_DEBUG, "Mesh peer " MACSTR
-- " is blocked - drop Authentication frame",
-- MAC2STR(sa));
-- return;
-- }
--#endif /* CONFIG_MESH */
- #ifdef CONFIG_PASN
- if (auth_alg == WLAN_AUTH_PASN &&
- (sta->flags & WLAN_STA_ASSOC)) {
-@@ -4698,6 +4701,13 @@ static int add_associated_sta(struct hostapd_data *hapd,
+@@ -3555,8 +3570,8 @@ static u16 check_multi_ap(struct hostapd_data *hapd, struct sta_info *sta,
+ }
+
+
+-static u16 copy_supp_rates(struct hostapd_data *hapd, struct sta_info *sta,
+- struct ieee802_11_elems *elems)
++u16 hostapd_copy_supp_rates(struct hostapd_data *hapd, struct sta_info *sta,
++ const struct ieee802_11_elems *elems)
+ {
+ /* Supported rates not used in IEEE 802.11ad/DMG */
+ if (hapd->iface->current_mode &&
+@@ -3943,7 +3958,7 @@ static int __check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
+ elems->ext_capab_len);
+ if (resp != WLAN_STATUS_SUCCESS)
+ return resp;
+- resp = copy_supp_rates(hapd, sta, elems);
++ resp = hostapd_copy_supp_rates(hapd, sta, elems);
+ if (resp != WLAN_STATUS_SUCCESS)
+ return resp;
+
+@@ -4763,6 +4778,13 @@ static int add_associated_sta(struct hostapd_data *hapd,
* 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.
@@ -1684,7 +1969,7 @@
*/
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)",
-@@ -4711,7 +4721,8 @@ static int add_associated_sta(struct hostapd_data *hapd,
+@@ -4776,7 +4798,8 @@ static int add_associated_sta(struct hostapd_data *hapd,
(!(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) &&
@@ -1694,7 +1979,7 @@
hostapd_drv_sta_remove(hapd, sta->addr);
wpa_auth_sm_event(sta->wpa_sm, WPA_DRV_STA_REMOVED);
set = 0;
-@@ -5273,7 +5284,7 @@ static void handle_assoc(struct hostapd_data *hapd,
+@@ -5337,7 +5360,7 @@ static void handle_assoc(struct hostapd_data *hapd,
int resp = WLAN_STATUS_SUCCESS;
u16 reply_res = WLAN_STATUS_UNSPECIFIED_FAILURE;
const u8 *pos;
@@ -1703,7 +1988,7 @@
struct sta_info *sta;
u8 *tmp = NULL;
#ifdef CONFIG_FILS
-@@ -5515,6 +5526,11 @@ static void handle_assoc(struct hostapd_data *hapd,
+@@ -5579,6 +5602,11 @@ static void handle_assoc(struct hostapd_data *hapd,
left = res;
}
#endif /* CONFIG_FILS */
@@ -1715,9 +2000,9 @@
/* followed by SSID and Supported rates; and HT capabilities if 802.11n
* is used */
-@@ -5617,6 +5633,13 @@ static void handle_assoc(struct hostapd_data *hapd,
+@@ -5681,6 +5709,13 @@ static void handle_assoc(struct hostapd_data *hapd,
if (set_beacon)
- ieee802_11_set_beacons(hapd->iface);
+ ieee802_11_update_beacons(hapd->iface);
+ ubus_resp = hostapd_ubus_handle_event(hapd, &req);
+ if (ubus_resp) {
@@ -1729,7 +2014,7 @@
fail:
/*
-@@ -5848,6 +5871,7 @@ static void handle_disassoc(struct hostapd_data *hapd,
+@@ -5910,6 +5945,7 @@ static void handle_disassoc(struct hostapd_data *hapd,
(unsigned long) len);
return;
}
@@ -1737,7 +2022,7 @@
sta = ap_get_sta(hapd, mgmt->sa);
if (!sta) {
-@@ -5879,6 +5903,8 @@ static void handle_deauth(struct hostapd_data *hapd,
+@@ -5941,6 +5977,8 @@ static void handle_deauth(struct hostapd_data *hapd,
/* Clear the PTKSA cache entries for PASN */
ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE);
@@ -1746,6 +2031,31 @@
sta = ap_get_sta(hapd, mgmt->sa);
if (!sta) {
wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR
+@@ -5974,6 +6012,11 @@ static void handle_beacon(struct hostapd_data *hapd,
+ 0);
+
+ ap_list_process_beacon(hapd->iface, mgmt, &elems, fi);
++
++#ifdef CONFIG_APUP
++ if (hapd->conf->apup)
++ apup_process_beacon(hapd, mgmt, len, &elems);
++#endif // def CONFIG_APUP
+ }
+
+
+diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h
+index dd4995f3f..0e13d2940 100644
+--- a/src/ap/ieee802_11.h
++++ b/src/ap/ieee802_11.h
+@@ -108,6 +108,8 @@ int hostapd_process_ml_assoc_req_addr(struct hostapd_data *hapd,
+ const u8 *basic_mle, size_t basic_mle_len,
+ u8 *mld_addr);
+ int hostapd_get_aid(struct hostapd_data *hapd, struct sta_info *sta);
++u16 hostapd_copy_supp_rates(struct hostapd_data *hapd, struct sta_info *sta,
++ const struct ieee802_11_elems *elems);
+ u16 copy_sta_ht_capab(struct hostapd_data *hapd, struct sta_info *sta,
+ const u8 *ht_capab);
+ u16 copy_sta_vendor_vht(struct hostapd_data *hapd, struct sta_info *sta,
diff --git a/src/ap/ieee802_11_ht.c b/src/ap/ieee802_11_ht.c
index f90f1254e..7f0a00f95 100644
--- a/src/ap/ieee802_11_ht.c
@@ -1794,24 +2104,6 @@
wpa_printf(MSG_INFO, "HT: Forty MHz Intolerant is set by STA " MACSTR
" in Association Request", MAC2STR(sta->addr));
-diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c
-index a5716f037..85790c7ed 100644
---- a/src/ap/ieee802_11_shared.c
-+++ b/src/ap/ieee802_11_shared.c
-@@ -1138,13 +1138,11 @@ u8 * hostapd_eid_rsnxe(struct hostapd_data *hapd, u8 *eid, size_t len)
- u16 check_ext_capab(struct hostapd_data *hapd, struct sta_info *sta,
- const u8 *ext_capab_ie, size_t ext_capab_ie_len)
- {
--#ifdef CONFIG_INTERWORKING
- /* check for QoS Map support */
- if (ext_capab_ie_len >= 5) {
- if (ext_capab_ie[4] & 0x01)
- sta->qos_map_enabled = 1;
- }
--#endif /* CONFIG_INTERWORKING */
-
- if (ext_capab_ie_len > 0) {
- sta->ecsa_supported = !!(ext_capab_ie[0] & BIT(2));
diff --git a/src/ap/ieee802_11_vht.c b/src/ap/ieee802_11_vht.c
index 4dc325ce8..68880ab64 100644
--- a/src/ap/ieee802_11_vht.c
@@ -1869,7 +2161,7 @@
/*
* Convert 80+80 MHz channel width to new style as interop
diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c
-index 8e98b6521..8abebbf34 100644
+index f4103ac9a..7b5b45a2b 100644
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
@@ -600,6 +600,10 @@ int add_common_radius_attr(struct hostapd_data *hapd,
@@ -1883,7 +2175,7 @@
if (!hostapd_config_get_radius_attr(req_attr,
RADIUS_ATTR_NAS_IP_ADDRESS) &&
hapd->conf->own_ip_addr.af == AF_INET &&
-@@ -2845,6 +2849,7 @@ static const char * bool_txt(bool val)
+@@ -2848,6 +2852,7 @@ static const char * bool_txt(bool val)
return val ? "TRUE" : "FALSE";
}
@@ -1891,7 +2183,7 @@
int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
{
-@@ -3031,6 +3036,7 @@ int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,
+@@ -3034,6 +3039,7 @@ int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,
return len;
}
@@ -1899,20 +2191,8 @@
#ifdef CONFIG_HS20
static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx)
-diff --git a/src/ap/ndisc_snoop.c b/src/ap/ndisc_snoop.c
-index 788c12fdc..bc1eb6251 100644
---- a/src/ap/ndisc_snoop.c
-+++ b/src/ap/ndisc_snoop.c
-@@ -61,6 +61,7 @@ void sta_ip6addr_del(struct hostapd_data *hapd, struct sta_info *sta)
- dl_list_for_each_safe(ip6addr, prev, &sta->ip6addr, struct ip6addr,
- list) {
- hostapd_drv_br_delete_ip_neigh(hapd, 6, (u8 *) &ip6addr->addr);
-+ dl_list_del(&ip6addr->list);
- os_free(ip6addr);
- }
- }
diff --git a/src/ap/rrm.c b/src/ap/rrm.c
-index f2d5cd16e..8220590a0 100644
+index fbcddf3f9..b024499ac 100644
--- a/src/ap/rrm.c
+++ b/src/ap/rrm.c
@@ -89,6 +89,9 @@ static void hostapd_handle_beacon_report(struct hostapd_data *hapd,
@@ -1934,7 +2214,7 @@
hostapd_drv_send_action(hapd, hapd->iface->freq, 0, addr,
wpabuf_head(buf), wpabuf_len(buf));
wpabuf_free(buf);
-@@ -350,6 +355,9 @@ void hostapd_handle_radio_measurement(struct hostapd_data *hapd,
+@@ -397,15 +402,20 @@ void hostapd_handle_radio_measurement(struct hostapd_data *hapd,
mgmt->u.action.u.rrm.action, MAC2STR(mgmt->sa));
switch (mgmt->u.action.u.rrm.action) {
@@ -1944,11 +2224,22 @@
case WLAN_RRM_RADIO_MEASUREMENT_REPORT:
hostapd_handle_radio_msmt_report(hapd, buf, len);
break;
+ case WLAN_RRM_NEIGHBOR_REPORT_REQUEST:
+ hostapd_handle_nei_report_req(hapd, buf, len);
+ break;
++ /*
+ case WLAN_RRM_LINK_MEASUREMENT_REPORT:
+ hostapd_handle_link_mesr_report(hapd, buf, len);
+ break;
++ */
+ default:
+ wpa_printf(MSG_DEBUG, "RRM action %u is not supported",
+ mgmt->u.action.u.rrm.action);
diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
-index d483aa9d3..ee6e20538 100644
+index 13613dbab..51978f45f 100644
--- a/src/ap/sta_info.c
+++ b/src/ap/sta_info.c
-@@ -539,6 +539,7 @@ void ap_handle_timer(void *eloop_ctx, void *timeout_ctx)
+@@ -542,6 +542,7 @@ void ap_handle_timer(void *eloop_ctx, void *timeout_ctx)
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_INFO, "deauthenticated due to "
"local deauth request");
@@ -1956,7 +2247,7 @@
ap_free_sta(hapd, sta);
return;
}
-@@ -694,6 +695,7 @@ skip_poll:
+@@ -699,6 +700,7 @@ skip_poll:
mlme_deauthenticate_indication(
hapd, sta,
WLAN_REASON_PREV_AUTH_NOT_VALID);
@@ -1964,7 +2255,7 @@
ap_free_sta(hapd, sta);
break;
}
-@@ -1476,9 +1478,6 @@ bool ap_sta_set_authorized_flag(struct hostapd_data *hapd, struct sta_info *sta,
+@@ -1485,9 +1487,6 @@ bool ap_sta_set_authorized_flag(struct hostapd_data *hapd, struct sta_info *sta,
mld_assoc_link_id = -2;
}
#endif /* CONFIG_IEEE80211BE */
@@ -1974,7 +2265,7 @@
sta->flags |= WLAN_STA_AUTHORIZED;
} else {
sta->flags &= ~WLAN_STA_AUTHORIZED;
-@@ -1515,15 +1514,28 @@ void ap_sta_set_authorized_event(struct hostapd_data *hapd,
+@@ -1524,15 +1523,28 @@ void ap_sta_set_authorized_event(struct hostapd_data *hapd,
os_snprintf(buf, sizeof(buf), MACSTR, MAC2STR(sta->addr));
if (authorized) {
@@ -2003,7 +2294,7 @@
#ifdef CONFIG_P2P
if (wpa_auth_get_ip_addr(sta->wpa_sm, ip_addr_buf) == 0) {
os_snprintf(ip_addr, sizeof(ip_addr),
-@@ -1534,6 +1546,13 @@ void ap_sta_set_authorized_event(struct hostapd_data *hapd,
+@@ -1543,6 +1555,13 @@ void ap_sta_set_authorized_event(struct hostapd_data *hapd,
}
#endif /* CONFIG_P2P */
@@ -2017,7 +2308,7 @@
keyid = ap_sta_wpa_get_keyid(hapd, sta);
if (keyid) {
os_snprintf(keyid_buf, sizeof(keyid_buf),
-@@ -1552,17 +1571,19 @@ void ap_sta_set_authorized_event(struct hostapd_data *hapd,
+@@ -1561,17 +1580,19 @@ void ap_sta_set_authorized_event(struct hostapd_data *hapd,
dpp_pkhash, SHA256_MAC_LEN);
}
@@ -2042,7 +2333,7 @@
if (hapd->msg_ctx_parent &&
hapd->msg_ctx_parent != hapd->msg_ctx)
diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h
-index 153e4a000..38b80903d 100644
+index 84629358c..d03d18b48 100644
--- a/src/ap/sta_info.h
+++ b/src/ap/sta_info.h
@@ -17,7 +17,6 @@
@@ -2053,7 +2344,18 @@
/* STA flags */
#define WLAN_STA_AUTH BIT(0)
-@@ -323,6 +322,7 @@ struct sta_info {
+@@ -49,10 +48,6 @@
+ #define WLAN_STA_PENDING_DEAUTH_CB BIT(30)
+ #define WLAN_STA_NONERP BIT(31)
+
+-/* Maximum number of supported rates (from both Supported Rates and Extended
+- * Supported Rates IEs). */
+-#define WLAN_SUPP_RATES_MAX 32
+-
+ struct hostapd_data;
+
+ struct mbo_non_pref_chan_info {
+@@ -321,6 +316,7 @@ struct sta_info {
#endif /* CONFIG_TESTING_OPTIONS */
#ifdef CONFIG_AIRTIME_POLICY
unsigned int airtime_weight;
@@ -2061,7 +2363,7 @@
struct os_reltime backlogged_until;
#endif /* CONFIG_AIRTIME_POLICY */
-@@ -420,16 +420,6 @@ int ap_sta_re_add(struct hostapd_data *hapd, struct sta_info *sta);
+@@ -421,16 +417,6 @@ int ap_sta_re_add(struct hostapd_data *hapd, struct sta_info *sta);
void ap_free_sta_pasn(struct hostapd_data *hapd, struct sta_info *sta);
@@ -2078,6 +2380,85 @@
static inline void ap_sta_set_mld(struct sta_info *sta, bool mld)
{
#ifdef CONFIG_IEEE80211BE
+diff --git a/src/ap/ubus.c b/src/ap/ubus.c
+index 8689494bc..f21516fc3 100644
+--- a/src/ap/ubus.c
++++ b/src/ap/ubus.c
+@@ -2004,3 +2004,18 @@ int hostapd_ubus_notify_bss_transition_query(
+ 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
+diff --git a/src/ap/ubus.h b/src/ap/ubus.h
+index 22767d67e..1c65e4dcb 100644
+--- a/src/ap/ubus.h
++++ b/src/ap/ubus.h
+@@ -71,6 +71,11 @@ int hostapd_ubus_notify_bss_transition_query(
+ void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta,
+ const char *auth_alg);
+
++#ifdef CONFIG_APUP
++void hostapd_ubus_notify_apup_newpeer(
++ struct hostapd_data *hapd, const u8 *addr, const char *ifname);
++#endif // def CONFIG_APUP
++
+ #else
+
+ struct hostapd_ubus_bss {};
+diff --git a/src/ap/ucode.c b/src/ap/ucode.c
+index 68fb45088..3468615fd 100644
+--- a/src/ap/ucode.c
++++ b/src/ap/ucode.c
+@@ -815,3 +815,20 @@ void hostapd_ucode_free_bss(struct hostapd_data *hapd)
+ ucv_put(wpa_ucode_call(2));
+ ucv_gc(vm);
+ }
++
++#ifdef CONFIG_APUP
++void hostapd_ucode_apup_newpeer(struct hostapd_data *hapd, const char *ifname)
++{
++ uc_value_t *val;
++
++ if (wpa_ucode_call_prepare("apup_newpeer"))
++ return;
++
++ 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/src/ap/ucode.h b/src/ap/ucode.h
+index d00b78716..c9bdde651 100644
+--- a/src/ap/ucode.h
++++ b/src/ap/ucode.h
+@@ -27,6 +27,10 @@ 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);
+
++#ifdef CONFIG_APUP
++void hostapd_ucode_apup_newpeer(struct hostapd_data *hapd, const char *ifname);
++#endif // def CONFIG_APUP
++
+ #else
+
+ static inline int hostapd_ucode_init(struct hapd_interfaces *ifaces)
diff --git a/src/ap/vlan_full.c b/src/ap/vlan_full.c
index 19aa3c649..053d6338e 100644
--- a/src/ap/vlan_full.c
@@ -2228,10 +2609,10 @@
#ifdef CONFIG_IEEE80211BE
if (ap_sta_is_mld(hapd, sta)) {
diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
-index 7a07dcc4c..b23d75444 100644
+index 93f157d62..3a1d288dd 100644
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
-@@ -5865,6 +5865,7 @@ static const char * wpa_bool_txt(int val)
+@@ -6095,6 +6095,7 @@ static const char * wpa_bool_txt(int val)
return val ? "TRUE" : "FALSE";
}
@@ -2239,7 +2620,7 @@
#define RSN_SUITE "%02x-%02x-%02x-%d"
#define RSN_SUITE_ARG(s) \
-@@ -6017,7 +6018,7 @@ int wpa_get_mib_sta(struct wpa_state_machine *sm, char *buf, size_t buflen)
+@@ -6247,7 +6248,7 @@ int wpa_get_mib_sta(struct wpa_state_machine *sm, char *buf, size_t buflen)
return len;
}
@@ -2249,10 +2630,10 @@
void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth)
{
diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c
-index 1726c7201..5a9ec6975 100644
+index 13685b7c2..eaded9434 100644
--- a/src/ap/wpa_auth_glue.c
+++ b/src/ap/wpa_auth_glue.c
-@@ -275,6 +275,7 @@ static void hostapd_wpa_auth_psk_failure_report(void *ctx, const u8 *addr)
+@@ -328,6 +328,7 @@ static void hostapd_wpa_auth_psk_failure_report(void *ctx, const u8 *addr)
struct hostapd_data *hapd = ctx;
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR,
MAC2STR(addr));
@@ -2260,7 +2641,7 @@
}
-@@ -1812,8 +1813,12 @@ int hostapd_setup_wpa(struct hostapd_data *hapd)
+@@ -1811,8 +1812,12 @@ int hostapd_setup_wpa(struct hostapd_data *hapd)
wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt)) {
const char *ft_iface;
@@ -2368,6 +2749,21 @@
hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_PROXYARP, 0);
hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_HAIRPIN_MODE, 0);
hapd->x_snoop_initialized = false;
+diff --git a/src/common/defs.h b/src/common/defs.h
+index 8cca094e8..151b69170 100644
+--- a/src/common/defs.h
++++ b/src/common/defs.h
+@@ -63,6 +63,10 @@
+ WPA_KEY_MGMT_FT_FILS_SHA256 | \
+ WPA_KEY_MGMT_FT_FILS_SHA384)
+
++/* Maximum number of supported rates (from both Supported Rates and Extended
++ * Supported Rates IEs). */
++#define WLAN_SUPP_RATES_MAX 32
++
+ static inline int wpa_key_mgmt_wpa_ieee8021x(int akm)
+ {
+ return !!(akm & (WPA_KEY_MGMT_IEEE8021X |
diff --git a/src/common/dpp_crypto.c b/src/common/dpp_crypto.c
index f17f95a2c..39d39f429 100644
--- a/src/common/dpp_crypto.c
@@ -2409,10 +2805,10 @@
#undef VHT_CAP_CHECK
#undef VHT_CAP_CHECK_MAX
diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
-index 5b39a61e1..7a1da3252 100644
+index db9e90355..269b1cf97 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
-@@ -1397,6 +1397,8 @@ struct ieee80211_ampe_ie {
+@@ -1398,6 +1398,8 @@ struct ieee80211_ampe_ie {
#define VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB ((u32) BIT(26) | BIT(27))
#define VHT_CAP_RX_ANTENNA_PATTERN ((u32) BIT(28))
#define VHT_CAP_TX_ANTENNA_PATTERN ((u32) BIT(29))
@@ -2422,7 +2818,7 @@
#define VHT_OPMODE_CHANNEL_WIDTH_MASK ((u8) BIT(0) | BIT(1))
#define VHT_OPMODE_CHANNEL_RxNSS_MASK ((u8) BIT(4) | BIT(5) | \
diff --git a/src/common/sae.c b/src/common/sae.c
-index f1c164e13..05de737e5 100644
+index a65da6134..36f09e31b 100644
--- a/src/common/sae.c
+++ b/src/common/sae.c
@@ -1278,6 +1278,13 @@ void sae_deinit_pt(struct sae_pt *pt)
@@ -2439,69 +2835,11 @@
/* COMMIT-ELEMENT = inverse(scalar-op(mask, PWE)) */
if (!sae->tmp->own_commit_element_ecc) {
sae->tmp->own_commit_element_ecc =
-diff --git a/src/common/wpa_common.c b/src/common/wpa_common.c
-index 6ea3311ce..7a608c30e 100644
---- a/src/common/wpa_common.c
-+++ b/src/common/wpa_common.c
-@@ -2856,6 +2856,31 @@ u32 wpa_akm_to_suite(int akm)
- }
-
-
-+static void wpa_fixup_wpa_ie_rsn(u8 *assoc_ie, const u8 *wpa_msg_ie,
-+ size_t rsn_ie_len)
-+{
-+ int pos, count;
-+
-+ pos = sizeof(struct rsn_ie_hdr) + RSN_SELECTOR_LEN;
-+ if (rsn_ie_len < pos + 2)
-+ return;
-+
-+ count = WPA_GET_LE16(wpa_msg_ie + pos);
-+ pos += 2 + count * RSN_SELECTOR_LEN;
-+ if (rsn_ie_len < pos + 2)
-+ return;
-+
-+ count = WPA_GET_LE16(wpa_msg_ie + pos);
-+ pos += 2 + count * RSN_SELECTOR_LEN;
-+ if (rsn_ie_len < pos + 2)
-+ return;
-+
-+ if (!assoc_ie[pos] && !assoc_ie[pos + 1] &&
-+ (wpa_msg_ie[pos] || wpa_msg_ie[pos + 1]))
-+ memcpy(&assoc_ie[pos], &wpa_msg_ie[pos], 2);
-+}
-+
-+
- int wpa_compare_rsn_ie(int ft_initial_assoc,
- const u8 *ie1, size_t ie1len,
- const u8 *ie2, size_t ie2len)
-@@ -2863,8 +2888,19 @@ int wpa_compare_rsn_ie(int ft_initial_assoc,
- if (ie1 == NULL || ie2 == NULL)
- return -1;
-
-- if (ie1len == ie2len && os_memcmp(ie1, ie2, ie1len) == 0)
-- return 0; /* identical IEs */
-+ if (ie1len == ie2len) {
-+ u8 *ie_tmp;
-+
-+ if (os_memcmp(ie1, ie2, ie1len) == 0)
-+ return 0; /* identical IEs */
-+
-+ ie_tmp = alloca(ie1len);
-+ memcpy(ie_tmp, ie1, ie1len);
-+ wpa_fixup_wpa_ie_rsn(ie_tmp, ie2, ie1len);
-+
-+ if (os_memcmp(ie_tmp, ie2, ie1len) == 0)
-+ return 0; /* only mismatch in RSN capabilties */
-+ }
-
- #ifdef CONFIG_IEEE80211R
- if (ft_initial_assoc) {
diff --git a/src/common/wpa_ctrl.c b/src/common/wpa_ctrl.c
-index 7e197f094..791fdbf93 100644
+index d0c174c05..ba659fe0f 100644
--- a/src/common/wpa_ctrl.c
+++ b/src/common/wpa_ctrl.c
-@@ -135,7 +135,7 @@ try_again:
+@@ -142,7 +142,7 @@ try_again:
return NULL;
}
tries++;
@@ -2510,7 +2848,7 @@
/* Set client socket file permissions so that bind() creates the client
* socket with these permissions and there is no need to try to change
* them with chmod() after bind() which would have potential issues with
-@@ -147,7 +147,7 @@ try_again:
+@@ -154,7 +154,7 @@ try_again:
* operations to allow the response to go through. Those are using the
* no-deference-symlinks version to avoid races. */
fchmod(ctrl->s, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
@@ -2519,7 +2857,7 @@
if (bind(ctrl->s, (struct sockaddr *) &ctrl->local,
sizeof(ctrl->local)) < 0) {
if (errno == EADDRINUSE && tries < 2) {
-@@ -165,7 +165,11 @@ try_again:
+@@ -172,7 +172,11 @@ try_again:
return NULL;
}
@@ -7080,52 +7418,9 @@
test_ms_funcs())
ret = -1;
-diff --git a/src/crypto/crypto_wolfssl.c b/src/crypto/crypto_wolfssl.c
-index 269174321..a554fd8a8 100644
---- a/src/crypto/crypto_wolfssl.c
-+++ b/src/crypto/crypto_wolfssl.c
-@@ -1633,6 +1633,7 @@ struct crypto_ec {
- #ifdef CONFIG_DPP
- ecc_point *g; /* Only used in DPP for now */
- #endif /* CONFIG_DPP */
-+ WC_RNG rng;
- mp_int a;
- mp_int prime;
- mp_int order;
-@@ -1666,6 +1667,20 @@ struct crypto_ec * crypto_ec_init(int group)
- e->key = ecc_key_init();
- if (!e->key) {
- LOG_WOLF_ERROR_FUNC_NULL(ecc_key_init);
-+
-+ if (wc_ecc_init(e->key) != 0 ||
-+ wc_InitRng(e->rng) != 0 ||
-+ wc_ecc_set_rng(e->key, e->rng) != 0 ||
-+ wc_ecc_set_curve(e->key, 0, curve_id) != 0 ||
-+ mp_init(e->a) != MP_OKAY ||
-+ mp_init(e->prime) != MP_OKAY ||
-+ mp_init(e->order) != MP_OKAY ||
-+ mp_init(e->b) != MP_OKAY ||
-+ mp_read_radix(e->a, e->key.dp->Af, 16) != MP_OKAY ||
-+ mp_read_radix(e->b, e->key.dp->Bf, 16) != MP_OKAY ||
-+ mp_read_radix(e->prime, e->key.dp->prime, 16) != MP_OKAY ||
-+ mp_read_radix(e->order, e->key.dp->order, 16) != MP_OKAY ||
-+ mp_montgomery_setup(e->prime, e->mont_b) != MP_OKAY)
- goto done;
- }
-
-@@ -1764,6 +1779,9 @@ void crypto_ec_deinit(struct crypto_ec* e)
- #endif /* CONFIG_DPP */
- if (e->own_key)
- ecc_key_deinit(e->key);
-+
-+ wc_FreeRng(e->rng);
-+ wc_ecc_free(e->key);
- os_free(e);
- }
-
diff --git a/src/crypto/tls_mbedtls.c b/src/crypto/tls_mbedtls.c
new file mode 100644
-index 000000000..2580a3a27
+index 000000000..d83a3db73
--- /dev/null
+++ b/src/crypto/tls_mbedtls.c
@@ -0,0 +1,3313 @@
@@ -9206,7 +9501,7 @@
+{
+ #if !defined(MBEDTLS_USE_PSA_CRYPTO) /* XXX: (not extracted for PSA crypto) */
+ #if defined(MBEDTLS_SSL_PROTO_TLS1_3)
-+ if (tls_version == MBEDTLS_SSL_VERSION_TLS1_3)
++ if (mbedtls_ssl_get_version_number(ssl) == MBEDTLS_SSL_VERSION_TLS1_3)
+ return 0; /* (calculation not extracted) */
+ #endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
+
@@ -10443,20 +10738,20 @@
+ return 0;
+}
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index e672a1787..3e3e309f4 100644
+index 4331782d8..e1a447333 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -971,6 +971,9 @@ struct wpa_driver_associate_params {
+@@ -979,6 +979,9 @@ struct wpa_driver_associate_params {
* responsible for selecting with which BSS to associate. */
const u8 *bssid;
-+ unsigned char rates[32];
++ unsigned char rates[WLAN_SUPP_RATES_MAX];
+ int mcast_rate;
+
/**
* bssid_hint - BSSID of a proposed AP
*
-@@ -1873,6 +1876,7 @@ struct wpa_driver_mesh_join_params {
+@@ -1886,6 +1889,7 @@ struct wpa_driver_mesh_join_params {
#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
unsigned int flags;
bool handle_dfs;
@@ -10464,7 +10759,7 @@
};
struct wpa_driver_set_key_params {
-@@ -2340,6 +2344,9 @@ struct wpa_driver_capa {
+@@ -2357,6 +2361,9 @@ struct wpa_driver_capa {
/** Maximum number of iterations in a single scan plan */
u32 max_sched_scan_plan_iterations;
@@ -10474,7 +10769,7 @@
/** Whether sched_scan (offloaded scanning) is supported */
int sched_scan_supported;
-@@ -3861,6 +3868,25 @@ struct wpa_driver_ops {
+@@ -3887,6 +3894,25 @@ struct wpa_driver_ops {
int (*if_remove)(void *priv, enum wpa_driver_if_type type,
const char *ifname);
@@ -10500,7 +10795,16 @@
/**
* set_sta_vlan - Bind a station into a specific interface (AP only)
* @priv: Private driver interface data
-@@ -4265,7 +4291,7 @@ struct wpa_driver_ops {
+@@ -3989,7 +4015,7 @@ struct wpa_driver_ops {
+ * Returns: 0 on success, -1 on failure
+ */
+ int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val,
+- const char *bridge_ifname, char *ifname_wds);
++ const char *bridge_ifname, const char *ifname_wds);
+
+ /**
+ * send_action - Transmit an Action frame
+@@ -4291,7 +4317,7 @@ struct wpa_driver_ops {
* Returns: 0 on success, negative (<0) on failure
*/
int (*br_set_net_param)(void *priv, enum drv_br_net_param param,
@@ -10509,7 +10813,7 @@
/**
* get_wowlan - Get wake-on-wireless status
-@@ -6559,6 +6585,7 @@ union wpa_event_data {
+@@ -6588,6 +6614,7 @@ union wpa_event_data {
/**
* struct ch_switch
@@ -10517,7 +10821,7 @@
* @freq: Frequency of new channel in MHz
* @ht_enabled: Whether this is an HT channel
* @ch_offset: Secondary channel offset
-@@ -6569,6 +6596,7 @@ union wpa_event_data {
+@@ -6598,6 +6625,7 @@ union wpa_event_data {
* @punct_bitmap: Puncturing bitmap
*/
struct ch_switch {
@@ -10525,7 +10829,7 @@
int freq;
int ht_enabled;
int ch_offset;
-@@ -6816,8 +6844,8 @@ union wpa_event_data {
+@@ -6846,8 +6874,8 @@ union wpa_event_data {
* Driver wrapper code should call this function whenever an event is received
* from the driver.
*/
@@ -10536,7 +10840,7 @@
/**
* wpa_supplicant_event_global - Report a driver event for wpa_supplicant
-@@ -6829,7 +6857,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
+@@ -6859,7 +6887,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
* Same as wpa_supplicant_event(), but we search for the interface in
* wpa_global.
*/
@@ -10546,10 +10850,10 @@
/*
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 9ac621ae6..6778ad369 100644
+index 39f58ff83..a70eaae38 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -78,6 +78,16 @@ enum nlmsgerr_attrs {
+@@ -75,6 +75,16 @@ enum nlmsgerr_attrs {
#endif /* ANDROID */
@@ -10566,7 +10870,7 @@
static struct nl_sock * nl_create_handle(struct nl_cb *cb, const char *dbg)
{
-@@ -432,6 +442,11 @@ static int no_seq_check(struct nl_msg *msg, void *arg)
+@@ -429,6 +439,11 @@ static int no_seq_check(struct nl_msg *msg, void *arg)
return NL_OK;
}
@@ -10578,15 +10882,16 @@
static void nl80211_nlmsg_clear(struct nl_msg *msg)
{
-@@ -505,6 +520,7 @@ int send_and_recv(struct nl80211_global *global,
+@@ -502,6 +517,8 @@ int send_and_recv(struct nl80211_global *global,
if (!msg)
return -ENOMEM;
+ handle_nl_debug_hook(msg, 1);
++
err.err = -ENOMEM;
s_nl_cb = nl_socket_get_cb(nl_handle);
-@@ -539,6 +555,7 @@ int send_and_recv(struct nl80211_global *global,
+@@ -536,6 +553,7 @@ int send_and_recv(struct nl80211_global *global,
err.orig_msg = msg;
err.err_info = err_info;
@@ -10594,7 +10899,7 @@
nl_cb_err(cb, NL_CB_CUSTOM, error_handler, &err);
nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, finish_handler, &err.err);
if (ack_handler_custom) {
-@@ -942,6 +959,7 @@ nl80211_get_wiphy_data_ap(struct i802_bss *bss)
+@@ -939,6 +957,7 @@ nl80211_get_wiphy_data_ap(struct i802_bss *bss)
os_free(w);
return NULL;
}
@@ -10602,7 +10907,7 @@
nl_cb_set(w->nl_cb, NL_CB_SEQ_CHECK, NL_CB_CUSTOM,
no_seq_check, NULL);
nl_cb_set(w->nl_cb, NL_CB_VALID, NL_CB_CUSTOM,
-@@ -1356,7 +1374,7 @@ static void wpa_driver_nl80211_event_rtm_newlink(void *ctx,
+@@ -1353,7 +1372,7 @@ static void wpa_driver_nl80211_event_rtm_newlink(void *ctx,
}
wpa_printf(MSG_DEBUG, "nl80211: Interface down (%s/%s)",
namebuf, ifname);
@@ -10611,7 +10916,7 @@
wpa_printf(MSG_DEBUG,
"nl80211: Not the main interface (%s) - do not indicate interface down",
drv->first_bss->ifname);
-@@ -1392,7 +1410,7 @@ static void wpa_driver_nl80211_event_rtm_newlink(void *ctx,
+@@ -1389,7 +1408,7 @@ static void wpa_driver_nl80211_event_rtm_newlink(void *ctx,
}
wpa_printf(MSG_DEBUG, "nl80211: Interface up (%s/%s)",
namebuf, ifname);
@@ -10620,7 +10925,7 @@
wpa_printf(MSG_DEBUG,
"nl80211: Not the main interface (%s) - do not indicate interface up",
drv->first_bss->ifname);
-@@ -2038,6 +2056,7 @@ static int wpa_driver_nl80211_init_nl_global(struct nl80211_global *global)
+@@ -2035,6 +2054,7 @@ static int wpa_driver_nl80211_init_nl_global(struct nl80211_global *global)
genl_family_put(family);
nl_cache_free(cache);
@@ -10628,7 +10933,7 @@
nl_cb_set(global->nl_cb, NL_CB_SEQ_CHECK, NL_CB_CUSTOM,
no_seq_check, NULL);
nl_cb_set(global->nl_cb, NL_CB_VALID, NL_CB_CUSTOM,
-@@ -2208,6 +2227,7 @@ static int nl80211_init_bss(struct i802_bss *bss)
+@@ -2205,6 +2225,7 @@ static int nl80211_init_bss(struct i802_bss *bss)
if (!bss->nl_cb)
return -1;
@@ -10636,7 +10941,16 @@
nl_cb_set(bss->nl_cb, NL_CB_SEQ_CHECK, NL_CB_CUSTOM,
no_seq_check, NULL);
nl_cb_set(bss->nl_cb, NL_CB_VALID, NL_CB_CUSTOM,
-@@ -5485,7 +5505,7 @@ static int nl80211_set_channel(struct i802_bss *bss,
+@@ -3083,7 +3104,7 @@ static int wpa_driver_nl80211_del_beacon(struct i802_bss *bss,
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+ struct i802_link *link = nl80211_get_link(bss, link_id);
+
+- if (!link->beacon_set)
++ if (!link || !link->beacon_set)
+ return 0;
+
+ wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)",
+@@ -5494,7 +5515,7 @@ static int nl80211_set_channel(struct i802_bss *bss,
freq->he_enabled, freq->eht_enabled, freq->bandwidth,
freq->center_freq1, freq->center_freq2);
@@ -10645,72 +10959,44 @@
NL80211_CMD_SET_WIPHY);
if (!msg || nl80211_put_freq_params(msg, freq) < 0) {
nlmsg_free(msg);
-@@ -5858,26 +5878,29 @@ fail:
-
- static void rtnl_neigh_delete_fdb_entry(struct i802_bss *bss, const u8 *addr)
- {
--#ifdef CONFIG_LIBNL3_ROUTE
- struct wpa_driver_nl80211_data *drv = bss->drv;
-- struct rtnl_neigh *rn;
-- struct nl_addr *nl_addr;
-+ struct ndmsg nhdr = {
-+ .ndm_state = NUD_PERMANENT,
-+ .ndm_ifindex = bss->ifindex,
-+ .ndm_family = AF_BRIDGE,
-+ };
-+ struct nl_msg *msg;
- int err;
-
-- rn = rtnl_neigh_alloc();
-- if (!rn)
-+ msg = nlmsg_alloc_simple(RTM_DELNEIGH, NLM_F_CREATE);
-+ if (!msg)
- return;
-
-- rtnl_neigh_set_family(rn, AF_BRIDGE);
-- rtnl_neigh_set_ifindex(rn, bss->ifindex);
-- nl_addr = nl_addr_build(AF_BRIDGE, (void *) addr, ETH_ALEN);
-- if (!nl_addr) {
-- rtnl_neigh_put(rn);
-- return;
-- }
-- rtnl_neigh_set_lladdr(rn, nl_addr);
-+ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0)
-+ goto errout;
-
-- err = rtnl_neigh_delete(drv->rtnl_sk, rn, 0);
-+ if (nla_put(msg, NDA_LLADDR, ETH_ALEN, (void *)addr))
-+ goto errout;
-+
-+ if (nl_send_auto_complete(drv->rtnl_sk, msg) < 0)
-+ goto errout;
-+
-+ err = nl_wait_for_ack(drv->rtnl_sk);
- if (err < 0) {
- wpa_printf(MSG_DEBUG, "nl80211: bridge FDB entry delete for "
- MACSTR " ifindex=%d failed: %s", MAC2STR(addr),
-@@ -5887,9 +5910,8 @@ static void rtnl_neigh_delete_fdb_entry(struct i802_bss *bss, const u8 *addr)
- MACSTR, MAC2STR(addr));
- }
-
-- nl_addr_put(nl_addr);
-- rtnl_neigh_put(rn);
--#endif /* CONFIG_LIBNL3_ROUTE */
-+errout:
-+ nlmsg_free(msg);
- }
-
+@@ -6183,8 +6204,7 @@ static void nl80211_teardown_ap(struct i802_bss *bss)
+ nl80211_mgmt_unsubscribe(bss, "AP teardown");
-@@ -6178,6 +6200,8 @@ static void nl80211_teardown_ap(struct i802_bss *bss)
nl80211_put_wiphy_data_ap(bss);
- if (bss->flink)
- bss->flink->beacon_set = 0;
-+
+- if (bss->flink)
+- bss->flink->beacon_set = 0;
+ wpa_driver_nl80211_del_beacon_all(bss);
}
+@@ -8414,24 +8434,14 @@ static int have_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx,
+
+
-@@ -8566,6 +8590,7 @@ static void *i802_init(struct hostapd_data *hapd,
+ static int i802_set_wds_sta(void *priv, const u8 *addr, int aid, int val,
+- const char *bridge_ifname, char *ifname_wds)
++ const char *bridge_ifname, const char *ifname_wds)
+ {
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+- char name[IFNAMSIZ + 1];
++ const char *name = ifname_wds; // Kept to reduce changes to the minimum
+ union wpa_event_data event;
+ int ret;
+
+- ret = os_snprintf(name, sizeof(name), "%s.sta%d", bss->ifname, aid);
+- if (ret >= (int) sizeof(name))
+- wpa_printf(MSG_WARNING,
+- "nl80211: WDS interface name was truncated");
+- else if (ret < 0)
+- return ret;
+-
+- if (ifname_wds)
+- os_strlcpy(ifname_wds, name, IFNAMSIZ + 1);
+-
+ wpa_printf(MSG_DEBUG, "nl80211: Set WDS STA addr=" MACSTR
+ " aid=%d val=%d name=%s", MAC2STR(addr), aid, val, name);
+ if (val) {
+@@ -8574,6 +8584,7 @@ static void *i802_init(struct hostapd_data *hapd,
char master_ifname[IFNAMSIZ];
int ifindex, br_ifindex = 0;
int br_added = 0;
@@ -10718,11 +11004,10 @@
bss = wpa_driver_nl80211_drv_init(hapd, params->ifname,
params->global_priv, 1,
-@@ -8625,24 +8650,18 @@ static void *i802_init(struct hostapd_data *hapd,
+@@ -8633,21 +8644,17 @@ static void *i802_init(struct hostapd_data *hapd,
(params->num_bridge == 0 || !params->bridge[0]))
add_ifidx(drv, br_ifindex, drv->ifindex);
--#ifdef CONFIG_LIBNL3_ROUTE
- if (bss->added_if_into_bridge || bss->already_in_bridge) {
- int err;
-
@@ -10749,19 +11034,18 @@
+ nl_geterror(err));
+ goto failed;
}
--#endif /* CONFIG_LIBNL3_ROUTE */
if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) {
- wpa_printf(MSG_DEBUG,
-@@ -9000,6 +9019,7 @@ static int wpa_driver_nl80211_if_remove(struct i802_bss *bss,
- if (drv->first_bss->next) {
- drv->first_bss = drv->first_bss->next;
- drv->ctx = drv->first_bss->ctx;
-+ drv->ifindex = drv->first_bss->ifindex;
- os_free(bss);
- } else {
- wpa_printf(MSG_DEBUG, "nl80211: No second BSS to reassign context to");
-@@ -9009,6 +9029,50 @@ static int wpa_driver_nl80211_if_remove(struct i802_bss *bss,
+@@ -8998,8 +9005,6 @@ static int wpa_driver_nl80211_if_remove(struct i802_bss *bss,
+ wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context");
+ nl80211_teardown_ap(bss);
+ nl80211_remove_links(bss);
+- if (!bss->added_if && !drv->first_bss->next)
+- wpa_driver_nl80211_del_beacon_all(bss);
+ nl80211_destroy_bss(bss);
+ if (!bss->added_if)
+ i802_set_iface_flags(bss, 0);
+@@ -9016,6 +9021,50 @@ static int wpa_driver_nl80211_if_remove(struct i802_bss *bss,
return 0;
}
@@ -10812,7 +11096,7 @@
static int cookie_handler(struct nl_msg *msg, void *arg)
{
-@@ -10792,6 +10856,37 @@ static bool nl80211_is_drv_shared(void *priv, void *bss_ctx)
+@@ -10807,6 +10856,37 @@ static bool nl80211_is_drv_shared(void *priv, void *bss_ctx)
#endif /* CONFIG_IEEE80211BE */
@@ -10850,7 +11134,7 @@
static int driver_nl80211_send_mlme(void *priv, const u8 *data,
size_t data_len, int noack,
unsigned int freq,
-@@ -11294,6 +11389,10 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings)
+@@ -11309,6 +11389,10 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings)
if (ret)
goto error;
@@ -10861,7 +11145,7 @@
/* beacon_csa params */
beacon_csa = nla_nest_start(msg, NL80211_ATTR_CSA_IES);
if (!beacon_csa)
-@@ -11940,6 +12039,18 @@ static int nl80211_put_mesh_id(struct nl_msg *msg, const u8 *mesh_id,
+@@ -11983,6 +12067,18 @@ static int nl80211_put_mesh_id(struct nl_msg *msg, const u8 *mesh_id,
}
@@ -10880,7 +11164,7 @@
static int nl80211_put_mesh_config(struct nl_msg *msg,
struct wpa_driver_mesh_bss_params *params)
{
-@@ -12001,6 +12112,7 @@ static int nl80211_join_mesh(struct i802_bss *bss,
+@@ -12044,6 +12140,7 @@ static int nl80211_join_mesh(struct i802_bss *bss,
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) ||
@@ -10888,189 +11172,8 @@
nl80211_put_dtim_period(msg, params->dtim_period))
goto fail;
-@@ -12156,13 +12268,14 @@ static int wpa_driver_br_add_ip_neigh(void *priv, u8 version,
- const u8 *ipaddr, int prefixlen,
- const u8 *addr)
- {
--#ifdef CONFIG_LIBNL3_ROUTE
- struct i802_bss *bss = priv;
- struct wpa_driver_nl80211_data *drv = bss->drv;
-- struct rtnl_neigh *rn;
-- struct nl_addr *nl_ipaddr = NULL;
-- struct nl_addr *nl_lladdr = NULL;
-- int family, addrsize;
-+ struct ndmsg nhdr = {
-+ .ndm_state = NUD_PERMANENT,
-+ .ndm_ifindex = bss->br_ifindex,
-+ };
-+ struct nl_msg *msg;
-+ int addrsize;
- int res;
-
- if (!ipaddr || prefixlen == 0 || !addr)
-@@ -12181,85 +12294,66 @@ static int wpa_driver_br_add_ip_neigh(void *priv, u8 version,
- }
-
- if (version == 4) {
-- family = AF_INET;
-+ nhdr.ndm_family = AF_INET;
- addrsize = 4;
- } else if (version == 6) {
-- family = AF_INET6;
-+ nhdr.ndm_family = AF_INET6;
- addrsize = 16;
- } else {
- return -EINVAL;
- }
+@@ -12397,7 +12494,7 @@ static const char * drv_br_net_param_str(enum drv_br_net_param param)
-- rn = rtnl_neigh_alloc();
-- if (rn == NULL)
-+ msg = nlmsg_alloc_simple(RTM_NEWNEIGH, NLM_F_CREATE);
-+ if (!msg)
- return -ENOMEM;
-
-- /* set the destination ip address for neigh */
-- nl_ipaddr = nl_addr_build(family, (void *) ipaddr, addrsize);
-- if (nl_ipaddr == NULL) {
-- wpa_printf(MSG_DEBUG, "nl80211: nl_ipaddr build failed");
-- res = -ENOMEM;
-+ res = -ENOMEM;
-+ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0)
- goto errout;
-- }
-- nl_addr_set_prefixlen(nl_ipaddr, prefixlen);
-- res = rtnl_neigh_set_dst(rn, nl_ipaddr);
-- if (res) {
-- wpa_printf(MSG_DEBUG,
-- "nl80211: neigh set destination addr failed");
-+
-+ if (nla_put(msg, NDA_DST, addrsize, (void *)ipaddr))
- goto errout;
-- }
-
-- /* set the corresponding lladdr for neigh */
-- nl_lladdr = nl_addr_build(AF_BRIDGE, (u8 *) addr, ETH_ALEN);
-- if (nl_lladdr == NULL) {
-- wpa_printf(MSG_DEBUG, "nl80211: neigh set lladdr failed");
-- res = -ENOMEM;
-+ if (nla_put(msg, NDA_LLADDR, ETH_ALEN, (void *)addr))
- goto errout;
-- }
-- rtnl_neigh_set_lladdr(rn, nl_lladdr);
-
-- rtnl_neigh_set_ifindex(rn, bss->br_ifindex);
-- rtnl_neigh_set_state(rn, NUD_PERMANENT);
-+ res = nl_send_auto_complete(drv->rtnl_sk, msg);
-+ if (res < 0)
-+ goto errout;
-
-- res = rtnl_neigh_add(drv->rtnl_sk, rn, NLM_F_CREATE);
-+ res = nl_wait_for_ack(drv->rtnl_sk);
- if (res) {
- wpa_printf(MSG_DEBUG,
- "nl80211: Adding bridge ip neigh failed: %s",
- nl_geterror(res));
- }
- errout:
-- if (nl_lladdr)
-- nl_addr_put(nl_lladdr);
-- if (nl_ipaddr)
-- nl_addr_put(nl_ipaddr);
-- if (rn)
-- rtnl_neigh_put(rn);
-+ nlmsg_free(msg);
- return res;
--#else /* CONFIG_LIBNL3_ROUTE */
-- return -1;
--#endif /* CONFIG_LIBNL3_ROUTE */
- }
-
-
- static int wpa_driver_br_delete_ip_neigh(void *priv, u8 version,
- const u8 *ipaddr)
- {
--#ifdef CONFIG_LIBNL3_ROUTE
- struct i802_bss *bss = priv;
- struct wpa_driver_nl80211_data *drv = bss->drv;
-- struct rtnl_neigh *rn;
-- struct nl_addr *nl_ipaddr;
-- int family, addrsize;
-+ struct ndmsg nhdr = {
-+ .ndm_state = NUD_PERMANENT,
-+ .ndm_ifindex = bss->br_ifindex,
-+ };
-+ struct nl_msg *msg;
-+ int addrsize;
- int res;
-
- if (!ipaddr)
- return -EINVAL;
-
- if (version == 4) {
-- family = AF_INET;
-+ nhdr.ndm_family = AF_INET;
- addrsize = 4;
- } else if (version == 6) {
-- family = AF_INET6;
-+ nhdr.ndm_family = AF_INET6;
- addrsize = 16;
- } else {
- return -EINVAL;
-@@ -12277,41 +12371,30 @@ static int wpa_driver_br_delete_ip_neigh(void *priv, u8 version,
- return -1;
- }
-
-- rn = rtnl_neigh_alloc();
-- if (rn == NULL)
-+ msg = nlmsg_alloc_simple(RTM_DELNEIGH, NLM_F_CREATE);
-+ if (!msg)
- return -ENOMEM;
-
-- /* set the destination ip address for neigh */
-- nl_ipaddr = nl_addr_build(family, (void *) ipaddr, addrsize);
-- if (nl_ipaddr == NULL) {
-- wpa_printf(MSG_DEBUG, "nl80211: nl_ipaddr build failed");
-- res = -ENOMEM;
-+ res = -ENOMEM;
-+ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0)
- goto errout;
-- }
-- res = rtnl_neigh_set_dst(rn, nl_ipaddr);
-- if (res) {
-- wpa_printf(MSG_DEBUG,
-- "nl80211: neigh set destination addr failed");
-+
-+ if (nla_put(msg, NDA_DST, addrsize, (void *)ipaddr))
- goto errout;
-- }
-
-- rtnl_neigh_set_ifindex(rn, bss->br_ifindex);
-+ res = nl_send_auto_complete(drv->rtnl_sk, msg);
-+ if (res < 0)
-+ goto errout;
-
-- res = rtnl_neigh_delete(drv->rtnl_sk, rn, 0);
-+ res = nl_wait_for_ack(drv->rtnl_sk);
- if (res) {
- wpa_printf(MSG_DEBUG,
- "nl80211: Deleting bridge ip neigh failed: %s",
- nl_geterror(res));
- }
- errout:
-- if (nl_ipaddr)
-- nl_addr_put(nl_ipaddr);
-- if (rn)
-- rtnl_neigh_put(rn);
-+ nlmsg_free(msg);
- return res;
--#else /* CONFIG_LIBNL3_ROUTE */
-- return -1;
--#endif /* CONFIG_LIBNL3_ROUTE */
- }
-
-
-@@ -12389,7 +12472,7 @@ static const char * drv_br_net_param_str(enum drv_br_net_param param)
-
static int wpa_driver_br_set_net_param(void *priv, enum drv_br_net_param param,
- unsigned int val)
@@ -11078,7 +11181,7 @@
{
struct i802_bss *bss = priv;
char path[128];
-@@ -12415,8 +12498,11 @@ static int wpa_driver_br_set_net_param(void *priv, enum drv_br_net_param param,
+@@ -12423,8 +12520,11 @@ static int wpa_driver_br_set_net_param(void *priv, enum drv_br_net_param param,
return -EINVAL;
}
@@ -11091,7 +11194,7 @@
set_val:
if (linux_write_system_file(path, val))
-@@ -14019,6 +14105,8 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -14027,6 +14127,8 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.set_acl = wpa_driver_nl80211_set_acl,
.if_add = wpa_driver_nl80211_if_add,
.if_remove = driver_nl80211_if_remove,
@@ -11101,7 +11204,7 @@
.get_hw_feature_data = nl80211_get_hw_feature_data,
.sta_add = wpa_driver_nl80211_sta_add,
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index 65389d206..d6a887cef 100644
+index 26c1f4140..d5ba66b10 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -976,6 +976,10 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
@@ -11116,7 +11219,7 @@
capa->max_match_sets =
nla_get_u8(tb[NL80211_ATTR_MAX_MATCH_SETS]);
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
-index f5778cdaf..4a12d749c 100644
+index aee815e97..768c72905 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -1196,6 +1196,7 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv,
@@ -11136,7 +11239,7 @@
if (link)
data.ch_switch.link_id = nla_get_u8(link);
-@@ -3972,6 +3975,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
+@@ -3999,6 +4002,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
tb[NL80211_ATTR_CENTER_FREQ1],
tb[NL80211_ATTR_CENTER_FREQ2],
tb[NL80211_ATTR_PUNCT_BITMAP],
@@ -11144,7 +11247,7 @@
0);
break;
case NL80211_CMD_CH_SWITCH_NOTIFY:
-@@ -3984,6 +3988,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
+@@ -4011,6 +4015,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
tb[NL80211_ATTR_CENTER_FREQ1],
tb[NL80211_ATTR_CENTER_FREQ2],
tb[NL80211_ATTR_PUNCT_BITMAP],
@@ -11153,7 +11256,7 @@
break;
case NL80211_CMD_DISCONNECT:
diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c
-index 577f84fef..c352a88bc 100644
+index b055e684a..a8ea8f2cf 100644
--- a/src/drivers/driver_nl80211_scan.c
+++ b/src/drivers/driver_nl80211_scan.c
@@ -221,7 +221,7 @@ nl80211_scan_common(struct i802_bss *bss, u8 cmd,
@@ -11325,7 +11428,7 @@
struct radius_msg *msg,
RadiusType msg_type, const u8 *addr);
diff --git a/src/radius/radius_das.c b/src/radius/radius_das.c
-index aaa3fc267..327782f62 100644
+index 8d7c9b4c4..01913b08f 100644
--- a/src/radius/radius_das.c
+++ b/src/radius/radius_das.c
@@ -12,13 +12,26 @@
@@ -11356,7 +11459,7 @@
size_t shared_secret_len;
struct hostapd_ip_addr client_addr;
unsigned int time_window;
-@@ -378,56 +391,17 @@ fail:
+@@ -388,56 +401,17 @@ fail:
}
@@ -11419,7 +11522,7 @@
if (radius_msg_verify_das_req(msg, das->shared_secret,
das->shared_secret_len,
-@@ -494,9 +468,8 @@ static void radius_das_receive(int sock, void *eloop_ctx, void *sock_ctx)
+@@ -504,9 +478,8 @@ static void radius_das_receive(int sock, void *eloop_ctx, void *sock_ctx)
radius_msg_dump(reply);
rbuf = radius_msg_get_buf(reply);
@@ -11431,7 +11534,7 @@
if (res < 0) {
wpa_printf(MSG_ERROR, "DAS: sendto(to %s:%d): %s",
abuf, from_port, strerror(errno));
-@@ -508,6 +481,72 @@ fail:
+@@ -518,6 +491,72 @@ fail:
radius_msg_free(reply);
}
@@ -11504,7 +11607,7 @@
static int radius_das_open_socket(int port)
{
-@@ -533,6 +572,49 @@ static int radius_das_open_socket(int port)
+@@ -543,6 +582,49 @@ static int radius_das_open_socket(int port)
}
@@ -11554,7 +11657,7 @@
struct radius_das_data *
radius_das_init(struct radius_das_conf *conf)
{
-@@ -553,6 +635,8 @@ radius_das_init(struct radius_das_conf *conf)
+@@ -563,6 +645,8 @@ radius_das_init(struct radius_das_conf *conf)
das->ctx = conf->ctx;
das->disconnect = conf->disconnect;
das->coa = conf->coa;
@@ -11563,7 +11666,7 @@
os_memcpy(&das->client_addr, conf->client_addr,
sizeof(das->client_addr));
-@@ -565,19 +649,15 @@ radius_das_init(struct radius_das_conf *conf)
+@@ -575,19 +659,15 @@ radius_das_init(struct radius_das_conf *conf)
}
das->shared_secret_len = conf->shared_secret_len;
@@ -11586,7 +11689,7 @@
return das;
}
-@@ -588,11 +668,14 @@ void radius_das_deinit(struct radius_das_data *das)
+@@ -598,11 +678,14 @@ void radius_das_deinit(struct radius_das_data *das)
if (das == NULL)
return;
@@ -11617,7 +11720,7 @@
const struct hostapd_ip_addr *client_addr;
unsigned int time_window;
diff --git a/src/radius/radius_server.c b/src/radius/radius_server.c
-index e02c21540..57a47263e 100644
+index fa3691548..95a1cb994 100644
--- a/src/radius/radius_server.c
+++ b/src/radius/radius_server.c
@@ -63,6 +63,12 @@ struct radius_server_counters {
@@ -11696,7 +11799,7 @@
sess->macacl = tmp->macacl;
eap_user_free(tmp);
-@@ -1118,11 +1155,10 @@ radius_server_encapsulate_eap(struct radius_server_data *data,
+@@ -1123,11 +1160,10 @@ radius_server_encapsulate_eap(struct radius_server_data *data,
}
if (code == RADIUS_CODE_ACCESS_ACCEPT) {
@@ -11712,7 +11815,7 @@
wpa_printf(MSG_ERROR, "Could not add RADIUS attribute");
radius_msg_free(msg);
return NULL;
-@@ -1211,11 +1247,10 @@ radius_server_macacl(struct radius_server_data *data,
+@@ -1221,11 +1257,10 @@ radius_server_macacl(struct radius_server_data *data,
}
if (code == RADIUS_CODE_ACCESS_ACCEPT) {
@@ -11728,7 +11831,7 @@
wpa_printf(MSG_ERROR, "Could not add RADIUS attribute");
radius_msg_free(msg);
return NULL;
-@@ -2512,7 +2547,7 @@ static int radius_server_get_eap_user(void *ctx, const u8 *identity,
+@@ -2527,7 +2562,7 @@ static int radius_server_get_eap_user(void *ctx, const u8 *identity,
ret = data->get_eap_user(data->conf_ctx, identity, identity_len,
phase2, user);
if (ret == 0 && user) {
@@ -11738,10 +11841,10 @@
sess->macacl = user->macacl;
sess->t_c_timestamp = user->t_c_timestamp;
diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
-index 8956c4072..e669858d8 100644
+index 52a4c7442..ce1aa60a9 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
-@@ -3943,6 +3943,8 @@ static u32 wpa_key_mgmt_suite(struct wpa_sm *sm)
+@@ -4153,6 +4153,8 @@ static u32 wpa_key_mgmt_suite(struct wpa_sm *sm)
}
@@ -11750,7 +11853,7 @@
#define RSN_SUITE "%02x-%02x-%02x-%d"
#define RSN_SUITE_ARG(s) \
((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
-@@ -4024,6 +4026,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, char *buf, size_t buflen)
+@@ -4234,6 +4236,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, char *buf, size_t buflen)
return (int) len;
}
@@ -12191,25 +12294,28 @@
/**
* wpa_msg_global - Global printf for ctrl_iface monitors
diff --git a/tests/Makefile b/tests/Makefile
-index 8ec154bb3..58287f56f 100644
+index 8ec154bb3..25fdf9e00 100644
--- a/tests/Makefile
+++ b/tests/Makefile
-@@ -5,6 +5,14 @@ ALL=test-base64 test-md4 test-milenage \
- test-sha256 test-aes test-x509v3 test-list test-rc4 \
- test-bss
-
+@@ -1,10 +1,12 @@
+-ALL=test-base64 test-md4 test-milenage \
+- test-rsa-sig-ver \
+- test-sha1 \
+- test-https test-https_server \
+- test-sha256 test-aes test-x509v3 test-list test-rc4 \
+RUN_TESTS= \
+ test-list \
+ test-md4 test-rc4 test-sha1 test-sha256 \
+ test-milenage test-aes \
-+ test-crypto_module
-+
++ test-crypto_module \
+ test-bss
+
+ALL=$(RUN_TESTS) test-base64 test-https test-https_server
+
include ../src/build.rules
ifdef LIBFUZZER
-@@ -25,13 +33,27 @@ CFLAGS += -DCONFIG_IEEE80211R_AP
+@@ -25,13 +27,27 @@ CFLAGS += -DCONFIG_IEEE80211R_AP
CFLAGS += -DCONFIG_IEEE80211R
CFLAGS += -DCONFIG_TDLS
@@ -12239,7 +12345,7 @@
_OBJS_VAR := LLIBS
include ../src/objs.mk
-@@ -43,12 +65,43 @@ include ../src/objs.mk
+@@ -43,12 +59,43 @@ include ../src/objs.mk
LIBS = $(SLIBS) $(DLIBS)
LLIBS = -Wl,--start-group $(DLIBS) -Wl,--end-group $(SLIBS)
@@ -12283,11 +12389,18 @@
test-base64: $(call BUILDOBJ,test-base64.o) $(LIBS)
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
-@@ -149,10 +202,12 @@ run-tests: $(ALL)
- ./test-sha1
- ./test-sha256
- ./test-bss
-+
+@@ -141,18 +188,11 @@ test-bss: $(call BUILDOBJ,test-bss.o) $(WPA_OBJS) $(LIBS)
+ $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) $(WPA_CFLAGS) $(WPA_OBJS) $(LIBS)
+
+ run-tests: $(ALL)
+- ./test-aes
+- ./test-list
+- ./test-md4
+- ./test-milenage
+- ./test-rsa-sig-ver
+- ./test-sha1
+- ./test-sha256
+- ./test-bss
+ @set -ex; for i in $(RUN_TESTS); do ./$$i; done
@echo
@echo All tests completed successfully.
@@ -12300,7 +12413,7 @@
+
+.PHONY: run-tests clean-config_tls_internal
diff --git a/tests/hwsim/example-hostapd.config b/tests/hwsim/example-hostapd.config
-index 210b7fb86..608e20eed 100644
+index 210b7fb86..5f326da07 100644
--- a/tests/hwsim/example-hostapd.config
+++ b/tests/hwsim/example-hostapd.config
@@ -4,6 +4,7 @@ CONFIG_DRIVER_NONE=y
@@ -12325,17 +12438,8 @@
CONFIG_EAP_EKE=y
CONFIG_PKCS12=y
CONFIG_RADIUS_SERVER=y
-@@ -88,7 +84,7 @@ CFLAGS += -DCONFIG_RADIUS_TEST
- CONFIG_MODULE_TESTS=y
-
- CONFIG_SUITEB=y
--CONFIG_SUITEB192=y
-+CONFIG_SUITEB192=$(if $(filter openssl mbedtls,$(CONFIG_TLS)),y,)
-
- # AddressSanitizer (ASan) can be enabled by uncommenting the following lines.
- # This can be used as a more efficient memory error detector than valgrind
diff --git a/tests/hwsim/example-wpa_supplicant.config b/tests/hwsim/example-wpa_supplicant.config
-index 123f397e3..da0dde659 100644
+index 123f397e3..c69b1f9cd 100644
--- a/tests/hwsim/example-wpa_supplicant.config
+++ b/tests/hwsim/example-wpa_supplicant.config
@@ -2,6 +2,7 @@
@@ -12361,17 +12465,8 @@
CONFIG_USIM_SIMULATOR=y
CONFIG_SIM_SIMULATOR=y
-@@ -136,7 +131,7 @@ CONFIG_TESTING_OPTIONS=y
- CONFIG_MODULE_TESTS=y
-
- CONFIG_SUITEB=y
--CONFIG_SUITEB192=y
-+CONFIG_SUITEB192=$(if $(filter openssl mbedtls,$(CONFIG_TLS)),y,)
-
- # AddressSanitizer (ASan) can be enabled by uncommenting the following lines.
- # This can be used as a more efficient memory error detector than valgrind
diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py
-index a20140316..027a60b25 100644
+index f8e75b5fb..48e4dedcc 100644
--- a/tests/hwsim/test_ap_eap.py
+++ b/tests/hwsim/test_ap_eap.py
@@ -42,20 +42,42 @@ def check_eap_capa(dev, method):
@@ -12452,7 +12547,7 @@
raise HwsimSkip("ext_cert_check not supported with this TLS library: " + tls)
def check_ocsp_support(dev):
-@@ -91,10 +126,12 @@ def check_ocsp_support(dev):
+@@ -91,14 +126,18 @@ def check_ocsp_support(dev):
# raise HwsimSkip("OCSP not supported with this TLS library: " + tls)
#if tls.startswith("wolfSSL"):
# raise HwsimSkip("OCSP not supported with this TLS library: " + tls)
@@ -12466,7 +12561,13 @@
raise HwsimSkip("PKCS#5 v1.5 not supported with this TLS library: " + tls)
def check_tls13_support(dev):
-@@ -122,11 +159,15 @@ def check_pkcs12_support(dev):
+ tls = dev.request("GET tls_library")
++ if tls.startswith("mbed TLS"):
++ raise HwsimSkip("TLS v1.3 not supported")
+ ok = ['run=OpenSSL 1.1.1', 'run=OpenSSL 3.0', 'run=OpenSSL 3.1',
+ 'run=OpenSSL 3.2', 'run=OpenSSL 3.3', 'wolfSSL']
+ for s in ok:
+@@ -122,11 +161,15 @@ def check_pkcs12_support(dev):
# raise HwsimSkip("PKCS#12 not supported with this TLS library: " + tls)
if tls.startswith("wolfSSL"):
raise HwsimSkip("PKCS#12 not supported with this TLS library: " + tls)
@@ -12482,7 +12583,7 @@
def check_ec_support(dev):
tls = dev.request("GET tls_library")
-@@ -1741,7 +1782,7 @@ def test_ap_wpa2_eap_ttls_pap_subject_match(dev, apdev):
+@@ -1741,7 +1784,7 @@ def test_ap_wpa2_eap_ttls_pap_subject_match(dev, apdev):
eap_connect(dev[0], hapd, "TTLS", "pap user",
anonymous_identity="ttls", password="password",
ca_cert="auth_serv/ca.pem", phase2="auth=PAP",
@@ -12491,7 +12592,7 @@
altsubject_match="EMAIL:noone@example.com;DNS:server.w1.fi;URI:http://example.com/")
eap_reauth(dev[0], "TTLS")
-@@ -2976,6 +3017,7 @@ def test_ap_wpa2_eap_tls_neg_domain_match(dev, apdev):
+@@ -2976,6 +3019,7 @@ def test_ap_wpa2_eap_tls_neg_domain_match(dev, apdev):
def test_ap_wpa2_eap_tls_neg_subject_match(dev, apdev):
"""WPA2-Enterprise negative test - subject mismatch"""
@@ -12499,7 +12600,7 @@
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
hostapd.add_ap(apdev[0], params)
dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS",
-@@ -3036,6 +3078,7 @@ def test_ap_wpa2_eap_tls_neg_subject_match(dev, apdev):
+@@ -3036,6 +3080,7 @@ def test_ap_wpa2_eap_tls_neg_subject_match(dev, apdev):
def test_ap_wpa2_eap_tls_neg_altsubject_match(dev, apdev):
"""WPA2-Enterprise negative test - altsubject mismatch"""
@@ -12507,7 +12608,7 @@
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
hostapd.add_ap(apdev[0], params)
-@@ -3582,7 +3625,7 @@ def test_ap_wpa2_eap_ikev2_oom(dev, apdev):
+@@ -3582,7 +3627,7 @@ def test_ap_wpa2_eap_ikev2_oom(dev, apdev):
dev[0].request("REMOVE_NETWORK all")
tls = dev[0].request("GET tls_library")
@@ -12516,7 +12617,7 @@
tests = [(1, "os_get_random;dh_init")]
else:
tests = [(1, "crypto_dh_init;dh_init")]
-@@ -4896,7 +4939,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca(dev, apdev, params):
+@@ -4896,7 +4941,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca(dev, apdev, params):
params["private_key"] = "auth_serv/iCA-server/server.key"
hostapd.add_ap(apdev[0], params)
tls = dev[0].request("GET tls_library")
@@ -12525,7 +12626,7 @@
ca_cert = "auth_serv/iCA-user/ca-and-root.pem"
client_cert = "auth_serv/iCA-user/user_and_ica.pem"
else:
-@@ -4962,6 +5005,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca_ocsp_sha1(dev, apdev, params):
+@@ -4962,6 +5007,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca_ocsp_sha1(dev, apdev, params):
run_ap_wpa2_eap_tls_intermediate_ca_ocsp(dev, apdev, params, "-sha1")
def run_ap_wpa2_eap_tls_intermediate_ca_ocsp(dev, apdev, params, md):
@@ -12533,7 +12634,7 @@
params = int_eap_server_params()
params["ca_cert"] = "auth_serv/iCA-server/ca-and-root.pem"
params["server_cert"] = "auth_serv/iCA-server/server.pem"
-@@ -4971,7 +5015,7 @@ def run_ap_wpa2_eap_tls_intermediate_ca_ocsp(dev, apdev, params, md):
+@@ -4971,7 +5017,7 @@ def run_ap_wpa2_eap_tls_intermediate_ca_ocsp(dev, apdev, params, md):
try:
hostapd.add_ap(apdev[0], params)
tls = dev[0].request("GET tls_library")
@@ -12542,7 +12643,7 @@
ca_cert = "auth_serv/iCA-user/ca-and-root.pem"
client_cert = "auth_serv/iCA-user/user_and_ica.pem"
else:
-@@ -5007,7 +5051,7 @@ def run_ap_wpa2_eap_tls_intermediate_ca_ocsp_revoked(dev, apdev, params, md):
+@@ -5007,7 +5053,7 @@ def run_ap_wpa2_eap_tls_intermediate_ca_ocsp_revoked(dev, apdev, params, md):
try:
hostapd.add_ap(apdev[0], params)
tls = dev[0].request("GET tls_library")
@@ -12551,7 +12652,7 @@
ca_cert = "auth_serv/iCA-user/ca-and-root.pem"
client_cert = "auth_serv/iCA-user/user_and_ica.pem"
else:
-@@ -5057,7 +5101,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca_ocsp_multi_missing_resp(dev, apdev, par
+@@ -5057,7 +5103,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca_ocsp_multi_missing_resp(dev, apdev, par
try:
hostapd.add_ap(apdev[0], params)
tls = dev[0].request("GET tls_library")
@@ -12560,7 +12661,7 @@
ca_cert = "auth_serv/iCA-user/ca-and-root.pem"
client_cert = "auth_serv/iCA-user/user_and_ica.pem"
else:
-@@ -5124,7 +5168,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca_ocsp_multi(dev, apdev, params):
+@@ -5124,7 +5170,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca_ocsp_multi(dev, apdev, params):
hostapd.add_ap(apdev[0], params)
tls = dev[0].request("GET tls_library")
@@ -12569,7 +12670,7 @@
ca_cert = "auth_serv/iCA-user/ca-and-root.pem"
client_cert = "auth_serv/iCA-user/user_and_ica.pem"
else:
-@@ -5382,6 +5426,7 @@ def test_ap_wpa2_eap_ttls_server_cert_eku_client_server(dev, apdev):
+@@ -5382,6 +5428,7 @@ def test_ap_wpa2_eap_ttls_server_cert_eku_client_server(dev, apdev):
def test_ap_wpa2_eap_ttls_server_pkcs12(dev, apdev):
"""WPA2-Enterprise using EAP-TTLS and server PKCS#12 file"""
@@ -12577,7 +12678,7 @@
skip_with_fips(dev[0])
params = int_eap_server_params()
del params["server_cert"]
-@@ -5394,6 +5439,7 @@ def test_ap_wpa2_eap_ttls_server_pkcs12(dev, apdev):
+@@ -5394,6 +5441,7 @@ def test_ap_wpa2_eap_ttls_server_pkcs12(dev, apdev):
def test_ap_wpa2_eap_ttls_server_pkcs12_extra(dev, apdev):
"""EAP-TTLS and server PKCS#12 file with extra certs"""
@@ -12585,7 +12686,7 @@
skip_with_fips(dev[0])
params = int_eap_server_params()
del params["server_cert"]
-@@ -5416,6 +5462,7 @@ def test_ap_wpa2_eap_ttls_dh_params_server(dev, apdev):
+@@ -5416,6 +5464,7 @@ def test_ap_wpa2_eap_ttls_dh_params_server(dev, apdev):
def test_ap_wpa2_eap_ttls_dh_params_dsa_server(dev, apdev):
"""WPA2-Enterprise using EAP-TTLS and alternative server dhparams (DSA)"""
@@ -12593,7 +12694,7 @@
params = int_eap_server_params()
params["dh_file"] = "auth_serv/dsaparam.pem"
hapd = hostapd.add_ap(apdev[0], params)
-@@ -5727,8 +5774,8 @@ def test_ap_wpa2_eap_non_ascii_identity2(dev, apdev):
+@@ -5727,8 +5776,8 @@ def test_ap_wpa2_eap_non_ascii_identity2(dev, apdev):
def test_openssl_cipher_suite_config_wpas(dev, apdev):
"""OpenSSL cipher suite configuration on wpa_supplicant"""
tls = dev[0].request("GET tls_library")
@@ -12604,7 +12705,7 @@
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
hapd = hostapd.add_ap(apdev[0], params)
eap_connect(dev[0], hapd, "TTLS", "pap user",
-@@ -5754,14 +5801,14 @@ def test_openssl_cipher_suite_config_wpas(dev, apdev):
+@@ -5754,14 +5803,14 @@ def test_openssl_cipher_suite_config_wpas(dev, apdev):
def test_openssl_cipher_suite_config_hapd(dev, apdev):
"""OpenSSL cipher suite configuration on hostapd"""
tls = dev[0].request("GET tls_library")
@@ -12623,7 +12724,7 @@
eap_connect(dev[0], hapd, "TTLS", "pap user",
anonymous_identity="ttls", password="password",
ca_cert="auth_serv/ca.pem", phase2="auth=PAP")
-@@ -6207,14 +6254,26 @@ def test_ap_wpa2_eap_tls_versions(dev, apdev):
+@@ -6207,13 +6256,17 @@ def test_ap_wpa2_eap_tls_versions(dev, apdev):
check_tls_ver(dev[0], hapd,
"tls_disable_tlsv1_0=1 tls_disable_tlsv1_1=1",
"TLSv1.2")
@@ -12631,13 +12732,10 @@
+ elif tls.startswith("internal") or tls.startswith("mbed TLS"):
check_tls_ver(dev[0], hapd,
"tls_disable_tlsv1_0=1 tls_disable_tlsv1_1=1", "TLSv1.2")
-+<<<<<<< HEAD
- check_tls_ver(dev[1], hapd,
- "tls_disable_tlsv1_0=1 tls_disable_tlsv1_1=0 tls_disable_tlsv1_2=1", "TLSv1.1")
- check_tls_ver(dev[2], hapd,
- "tls_disable_tlsv1_0=0 tls_disable_tlsv1_1=1 tls_disable_tlsv1_2=1", "TLSv1")
- if "run=OpenSSL 1.1.1" in tls or "run=OpenSSL 3." in tls:
-+=======
+- check_tls_ver(dev[1], hapd,
+- "tls_disable_tlsv1_0=1 tls_disable_tlsv1_1=0 tls_disable_tlsv1_2=1", "TLSv1.1")
+- check_tls_ver(dev[2], hapd,
+- "tls_disable_tlsv1_0=0 tls_disable_tlsv1_1=1 tls_disable_tlsv1_2=1", "TLSv1")
+ if tls.startswith("mbed TLS"):
+ check_tls_ver(dev[2], hapd,
+ "tls_disable_tlsv1_0=0 tls_disable_tlsv1_1=1 tls_disable_tlsv1_2=1", "TLSv1.0")
@@ -12646,12 +12744,10 @@
+ "tls_disable_tlsv1_0=1 tls_disable_tlsv1_1=0 tls_disable_tlsv1_2=1", "TLSv1.1")
+ check_tls_ver(dev[2], hapd,
+ "tls_disable_tlsv1_0=0 tls_disable_tlsv1_1=1 tls_disable_tlsv1_2=1", "TLSv1")
-+ if "run=OpenSSL 1.1.1" in tls or "run=OpenSSL 3.0" in tls:
-+>>>>>>> 585bc9ada (hostapd: sync 2024-01-18 openwrt/trunk patch folder)
+ if "run=OpenSSL 1.1.1" in tls or "run=OpenSSL 3." in tls:
check_tls_ver(dev[0], hapd,
"tls_disable_tlsv1_0=1 tls_disable_tlsv1_1=1 tls_disable_tlsv1_2=1 tls_disable_tlsv1_3=0", "TLSv1.3")
-
-@@ -6235,6 +6294,11 @@ def test_ap_wpa2_eap_tls_versions_server(dev, apdev):
+@@ -6235,6 +6288,11 @@ def test_ap_wpa2_eap_tls_versions_server(dev, apdev):
tests = [("TLSv1", "[ENABLE-TLSv1.0][DISABLE-TLSv1.1][DISABLE-TLSv1.2][DISABLE-TLSv1.3]"),
("TLSv1.1", "[ENABLE-TLSv1.0][ENABLE-TLSv1.1][DISABLE-TLSv1.2][DISABLE-TLSv1.3]"),
("TLSv1.2", "[ENABLE-TLSv1.0][ENABLE-TLSv1.1][ENABLE-TLSv1.2][DISABLE-TLSv1.3]")]
@@ -12663,7 +12759,7 @@
for exp, flags in tests:
hapd.disable()
hapd.set("tls_flags", flags)
-@@ -7305,6 +7369,7 @@ def test_ap_wpa2_eap_assoc_rsn(dev, apdev):
+@@ -7305,6 +7363,7 @@ def test_ap_wpa2_eap_assoc_rsn(dev, apdev):
def test_eap_tls_ext_cert_check(dev, apdev):
"""EAP-TLS and external server certification validation"""
# With internal server certificate chain validation
@@ -12671,7 +12767,7 @@
id = dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TLS",
identity="tls user",
ca_cert="auth_serv/ca.pem",
-@@ -7317,6 +7382,7 @@ def test_eap_tls_ext_cert_check(dev, apdev):
+@@ -7317,6 +7376,7 @@ def test_eap_tls_ext_cert_check(dev, apdev):
def test_eap_ttls_ext_cert_check(dev, apdev):
"""EAP-TTLS and external server certification validation"""
# Without internal server certificate chain validation
@@ -12679,7 +12775,7 @@
id = dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS",
identity="pap user", anonymous_identity="ttls",
password="password", phase2="auth=PAP",
-@@ -7327,6 +7393,7 @@ def test_eap_ttls_ext_cert_check(dev, apdev):
+@@ -7327,6 +7387,7 @@ def test_eap_ttls_ext_cert_check(dev, apdev):
def test_eap_peap_ext_cert_check(dev, apdev):
"""EAP-PEAP and external server certification validation"""
# With internal server certificate chain validation
@@ -12687,7 +12783,7 @@
id = dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="PEAP",
identity="user", anonymous_identity="peap",
ca_cert="auth_serv/ca.pem",
-@@ -7337,6 +7404,7 @@ def test_eap_peap_ext_cert_check(dev, apdev):
+@@ -7337,6 +7398,7 @@ def test_eap_peap_ext_cert_check(dev, apdev):
def test_eap_fast_ext_cert_check(dev, apdev):
"""EAP-FAST and external server certification validation"""
@@ -12695,7 +12791,7 @@
check_eap_capa(dev[0], "FAST")
# With internal server certificate chain validation
dev[0].request("SET blob fast_pac_auth_ext ")
-@@ -7351,10 +7419,6 @@ def test_eap_fast_ext_cert_check(dev, apdev):
+@@ -7351,10 +7413,6 @@ def test_eap_fast_ext_cert_check(dev, apdev):
run_ext_cert_check(dev, apdev, id)
def run_ext_cert_check(dev, apdev, net_id):
@@ -12707,10 +12803,10 @@
hapd = hostapd.add_ap(apdev[0], params)
diff --git a/tests/hwsim/test_ap_ft.py b/tests/hwsim/test_ap_ft.py
-index 3d07d21f7..a708412de 100644
+index 13461f014..8ffb5042c 100644
--- a/tests/hwsim/test_ap_ft.py
+++ b/tests/hwsim/test_ap_ft.py
-@@ -2486,11 +2486,11 @@ def test_ap_ft_ap_oom5(dev, apdev):
+@@ -2494,11 +2494,11 @@ def test_ap_ft_ap_oom5(dev, apdev):
# This will fail to roam
dev[0].roam(bssid1, check_bssid=False)
@@ -12859,28 +12955,20 @@
with fail_test(dev[0], count, "hmac_sha256_kdf;eap_peer_erp_init"):
dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS",
diff --git a/tests/hwsim/test_fils.py b/tests/hwsim/test_fils.py
-index 5cdc28734..17110c5c2 100644
+index 6f857243a..de65c57a7 100644
--- a/tests/hwsim/test_fils.py
+++ b/tests/hwsim/test_fils.py
-@@ -1484,6 +1484,18 @@ def run_fils_sk_pfs(dev, apdev, group, params):
- check_erp_capa(dev[0])
- check_ec_group(dev[0], group)
-
-+ tls = dev[0].request("GET tls_library")
-+ if tls.startswith("mbed TLS"):
+@@ -1477,6 +1477,10 @@ def check_ec_group(dev, group):
+ tls = dev.request("GET tls_library")
+ if tls.startswith("wolfSSL"):
+ return
++ elif tls.startswith("mbed TLS"):
+ if int(group) == 27:
+ raise HwsimSkip("Brainpool EC group 27 not supported by mbed TLS")
-+ elif not tls.startswith("wolfSSL"):
-+ if int(group) in [25]:
-+ if not (tls.startswith("OpenSSL") and ("build=OpenSSL 1.0.2" in tls or "build=OpenSSL 1.1" in tls or "build=OpenSSL 3.0" in tls) and ("run=OpenSSL 1.0.2" in tls or "run=OpenSSL 1.1" in tls or "run=OpenSSL 3.0" in tls)):
-+ raise HwsimSkip("EC group not supported")
-+ if int(group) in [27, 28, 29, 30]:
-+ if not (tls.startswith("OpenSSL") and ("build=OpenSSL 1.0.2" in tls or "build=OpenSSL 1.1" in tls or "build=OpenSSL 3.0" in tls) and ("run=OpenSSL 1.0.2" in tls or "run=OpenSSL 1.1" in tls or "run=OpenSSL 3.0" in tls)):
-+ raise HwsimSkip("Brainpool EC group not supported")
-+
- start_erp_as(msk_dump=os.path.join(params['logdir'], "msk.lst"))
-
- bssid = apdev[0]['bssid']
++ return
+ if int(group) in [25]:
+ if not (tls.startswith("OpenSSL") and ("build=OpenSSL 1.0.2" in tls or "build=OpenSSL 1.1" in tls or "build=OpenSSL 3." in tls) and ("run=OpenSSL 1.0.2" in tls or "run=OpenSSL 1.1" in tls or "run=OpenSSL 3." in tls)):
+ raise HwsimSkip("EC group not supported")
diff --git a/tests/hwsim/test_pmksa_cache.py b/tests/hwsim/test_pmksa_cache.py
index 4a3b444ff..4f7f7f760 100644
--- a/tests/hwsim/test_pmksa_cache.py
@@ -12904,7 +12992,7 @@
def test_pmksa_cache_ctrl(dev, apdev):
"""PMKSA cache control interface operations"""
diff --git a/tests/hwsim/test_sae.py b/tests/hwsim/test_sae.py
-index aceb92751..6f9ee5669 100644
+index 679db0e2d..4ea9bd6a4 100644
--- a/tests/hwsim/test_sae.py
+++ b/tests/hwsim/test_sae.py
@@ -178,6 +178,11 @@ def test_sae_groups(dev, apdev):
@@ -12919,7 +13007,7 @@
heavy_groups = [14, 15, 16]
suitable_groups = [15, 16, 17, 18, 19, 20, 21]
groups = [str(g) for g in sae_groups]
-@@ -2194,6 +2199,8 @@ def run_sae_pwe_group(dev, apdev, group):
+@@ -2232,6 +2237,8 @@ def run_sae_pwe_group(dev, apdev, group):
logger.info("Add Brainpool EC groups since OpenSSL is new enough")
elif tls.startswith("wolfSSL"):
logger.info("Make sure Brainpool EC groups were enabled when compiling wolfSSL")
@@ -12929,7 +13017,7 @@
raise HwsimSkip("Brainpool curve not supported")
start_sae_pwe_ap(apdev[0], group, 2)
diff --git a/tests/hwsim/test_suite_b.py b/tests/hwsim/test_suite_b.py
-index d03a39dee..d703dee95 100644
+index ddd1c2ee7..a44f32955 100644
--- a/tests/hwsim/test_suite_b.py
+++ b/tests/hwsim/test_suite_b.py
@@ -27,6 +27,8 @@ def check_suite_b_tls_lib(dev, dhe=False, level128=False):
@@ -12950,7 +13038,7 @@
eap="TLS", identity="tls user",
ca_cert="auth_serv/rsa3072-ca.pem",
diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py
-index 44eb00444..fbe0fb794 100644
+index cf6d3211e..cbf136eaf 100644
--- a/tests/hwsim/test_wpas_ctrl.py
+++ b/tests/hwsim/test_wpas_ctrl.py
@@ -1856,7 +1856,7 @@ def _test_wpas_ctrl_oom(dev):
@@ -13101,7 +13189,7 @@
in = NULL;
if (need_more_data) {
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
-index dd13308f7..c65acab94 100644
+index 743c8acd6..c40e8d70d 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -10,6 +10,7 @@ ALL += dbus/fi.w1.wpa_supplicant1.service
@@ -13112,7 +13200,7 @@
include ../src/build.rules
ifdef CONFIG_BUILD_PASN_SO
-@@ -188,6 +189,25 @@ ifdef CONFIG_EAPOL_TEST
+@@ -190,6 +191,25 @@ ifdef CONFIG_EAPOL_TEST
CFLAGS += -Werror -DEAPOL_TEST
endif
@@ -13138,15 +13226,7 @@
ifdef CONFIG_CODE_COVERAGE
CFLAGS += -O0 -fprofile-arcs -ftest-coverage -U_FORTIFY_SOURCE
LIBS += -lgcov
-@@ -334,6 +354,7 @@ endif
- ifdef CONFIG_FILS
- CFLAGS += -DCONFIG_FILS
- NEED_SHA384=y
-+NEED_HMAC_SHA384_KDF=y
- NEED_AES_SIV=y
- ifdef CONFIG_FILS_SK_PFS
- CFLAGS += -DCONFIG_FILS_SK_PFS
-@@ -388,7 +409,9 @@ endif
+@@ -389,7 +409,9 @@ endif
ifdef CONFIG_IBSS_RSN
NEED_RSN_AUTHENTICATOR=y
CFLAGS += -DCONFIG_IBSS_RSN
@@ -13156,7 +13236,7 @@
OBJS += ibss_rsn.o
endif
-@@ -980,6 +1003,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
+@@ -981,6 +1003,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
LIBS += -ldl -rdynamic
endif
@@ -13167,7 +13247,7 @@
endif
ifdef CONFIG_AP
-@@ -987,9 +1014,11 @@ NEED_EAP_COMMON=y
+@@ -988,9 +1014,11 @@ NEED_EAP_COMMON=y
NEED_RSN_AUTHENTICATOR=y
CFLAGS += -DCONFIG_AP
OBJS += ap.o
@@ -13179,7 +13259,7 @@
OBJS += ../src/ap/hostapd.o
OBJS += ../src/ap/wpa_auth_glue.o
OBJS += ../src/ap/utils.o
-@@ -1029,7 +1058,16 @@ ifdef CONFIG_FILS
+@@ -1030,7 +1058,16 @@ ifdef CONFIG_FILS
OBJS += ../src/ap/fils_hlp.o
endif
ifdef CONFIG_CTRL_IFACE
@@ -13196,7 +13276,7 @@
endif
CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
-@@ -1080,6 +1118,12 @@ endif
+@@ -1081,6 +1118,12 @@ endif
ifdef CONFIG_HS20
OBJS += ../src/ap/hs20.o
endif
@@ -13209,7 +13289,7 @@
endif
ifdef CONFIG_MBO
-@@ -1089,7 +1133,9 @@ NEED_GAS=y
+@@ -1090,7 +1133,9 @@ NEED_GAS=y
endif
ifdef NEED_RSN_AUTHENTICATOR
@@ -13219,7 +13299,7 @@
NEED_AES_WRAP=y
OBJS += ../src/ap/wpa_auth.o
OBJS += ../src/ap/wpa_auth_ie.o
-@@ -1188,6 +1234,7 @@ TLS_FUNCS=y
+@@ -1189,6 +1234,7 @@ TLS_FUNCS=y
endif
ifeq ($(CONFIG_TLS), wolfssl)
@@ -13227,7 +13307,7 @@
ifdef TLS_FUNCS
CFLAGS += -DWOLFSSL_DER_LOAD
OBJS += ../src/crypto/tls_wolfssl.o
-@@ -1203,6 +1250,7 @@ LIBS_p += -lwolfssl -lm
+@@ -1204,6 +1250,7 @@ LIBS_p += -lwolfssl -lm
endif
ifeq ($(CONFIG_TLS), openssl)
@@ -13235,7 +13315,7 @@
CFLAGS += -DCRYPTO_RSA_OAEP_SHA256
ifdef TLS_FUNCS
CFLAGS += -DEAP_TLS_OPENSSL
-@@ -1229,7 +1277,28 @@ endif
+@@ -1230,7 +1277,28 @@ endif
CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\"
endif
@@ -13264,7 +13344,7 @@
ifndef CONFIG_CRYPTO
# default to libgcrypt
CONFIG_CRYPTO=gnutls
-@@ -1260,6 +1329,7 @@ endif
+@@ -1261,6 +1329,7 @@ endif
endif
ifeq ($(CONFIG_TLS), internal)
@@ -13272,7 +13352,7 @@
ifndef CONFIG_CRYPTO
CONFIG_CRYPTO=internal
endif
-@@ -1340,6 +1410,7 @@ endif
+@@ -1341,6 +1410,7 @@ endif
endif
ifeq ($(CONFIG_TLS), linux)
@@ -13280,7 +13360,7 @@
OBJS += ../src/crypto/crypto_linux.o
OBJS_p += ../src/crypto/crypto_linux.o
ifdef TLS_FUNCS
-@@ -1421,9 +1492,11 @@ endif
+@@ -1422,9 +1492,11 @@ endif
ifneq ($(CONFIG_TLS), openssl)
ifneq ($(CONFIG_TLS), wolfssl)
@@ -13292,7 +13372,7 @@
ifdef CONFIG_OPENSSL_INTERNAL_AES_WRAP
# Seems to be needed at least with BoringSSL
NEED_INTERNAL_AES_WRAP=y
-@@ -1437,9 +1510,11 @@ endif
+@@ -1438,9 +1510,11 @@ endif
ifdef NEED_INTERNAL_AES_WRAP
ifneq ($(CONFIG_TLS), linux)
@@ -13304,7 +13384,7 @@
ifdef NEED_AES_EAX
AESOBJS += ../src/crypto/aes-eax.o
NEED_AES_CTR=y
-@@ -1449,35 +1524,45 @@ AESOBJS += ../src/crypto/aes-siv.o
+@@ -1450,35 +1524,45 @@ AESOBJS += ../src/crypto/aes-siv.o
NEED_AES_CTR=y
endif
ifdef NEED_AES_CTR
@@ -13350,7 +13430,7 @@
ifdef NEED_AES_ENC
ifdef CONFIG_INTERNAL_AES
AESOBJS += ../src/crypto/aes-internal-enc.o
-@@ -1492,12 +1577,16 @@ ifneq ($(CONFIG_TLS), openssl)
+@@ -1493,12 +1577,16 @@ ifneq ($(CONFIG_TLS), openssl)
ifneq ($(CONFIG_TLS), linux)
ifneq ($(CONFIG_TLS), gnutls)
ifneq ($(CONFIG_TLS), wolfssl)
@@ -13367,7 +13447,7 @@
ifdef CONFIG_INTERNAL_SHA1
SHA1OBJS += ../src/crypto/sha1-internal.o
ifdef NEED_FIPS186_2_PRF
-@@ -1509,29 +1598,37 @@ CFLAGS += -DCONFIG_NO_PBKDF2
+@@ -1510,29 +1598,37 @@ CFLAGS += -DCONFIG_NO_PBKDF2
else
ifneq ($(CONFIG_TLS), openssl)
ifneq ($(CONFIG_TLS), wolfssl)
@@ -13405,7 +13485,7 @@
ifdef NEED_MD5
ifdef CONFIG_INTERNAL_MD5
MD5OBJS += ../src/crypto/md5-internal.o
-@@ -1586,12 +1683,17 @@ ifneq ($(CONFIG_TLS), openssl)
+@@ -1587,12 +1683,17 @@ ifneq ($(CONFIG_TLS), openssl)
ifneq ($(CONFIG_TLS), linux)
ifneq ($(CONFIG_TLS), gnutls)
ifneq ($(CONFIG_TLS), wolfssl)
@@ -13423,7 +13503,7 @@
ifdef CONFIG_INTERNAL_SHA256
SHA256OBJS += ../src/crypto/sha256-internal.o
endif
-@@ -1604,50 +1706,68 @@ CFLAGS += -DCONFIG_INTERNAL_SHA512
+@@ -1605,50 +1706,68 @@ CFLAGS += -DCONFIG_INTERNAL_SHA512
SHA256OBJS += ../src/crypto/sha512-internal.o
endif
ifdef NEED_TLS_PRF_SHA256
@@ -13492,7 +13572,7 @@
ifdef NEED_ASN1
OBJS += ../src/tls/asn1.o
-@@ -1822,10 +1942,12 @@ ifdef CONFIG_FIPS
+@@ -1823,10 +1942,12 @@ ifdef CONFIG_FIPS
CFLAGS += -DCONFIG_FIPS
ifneq ($(CONFIG_TLS), openssl)
ifneq ($(CONFIG_TLS), wolfssl)
@@ -13505,7 +13585,7 @@
OBJS += $(SHA1OBJS) $(DESOBJS)
-@@ -2003,32 +2125,38 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
+@@ -2004,32 +2125,38 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
_OBJS_VAR := OBJS
include ../src/objs.mk
@@ -13549,7 +13629,7 @@
@$(E) " LD " $@
LIBCTRL += ../src/common/wpa_ctrl.o
-@@ -2135,6 +2263,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK)
+@@ -2136,6 +2263,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK)
$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
@$(E) " sed" $<
@@ -13563,7 +13643,7 @@
mv -f $< $@
wpa_cli.exe: wpa_cli
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
-index 69a0e5ee1..43c39d7ce 100644
+index 69a0e5ee1..7e8c97c38 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -1520,7 +1520,7 @@ int wpas_ap_wps_nfc_report_handover(struct wpa_supplicant *wpa_s,
@@ -13575,7 +13655,7 @@
int ap_ctrl_iface_sta_first(struct wpa_supplicant *wpa_s,
char *buf, size_t buflen)
-@@ -1846,11 +1846,31 @@ int ap_switch_channel(struct wpa_supplicant *wpa_s,
+@@ -1846,17 +1846,37 @@ int ap_switch_channel(struct wpa_supplicant *wpa_s,
#ifdef CONFIG_CTRL_IFACE
@@ -13599,16 +13679,25 @@
struct csa_settings settings;
int ret = hostapd_parse_csa_settings(pos, &settings);
+- if (ret)
+- return ret;
+ if (!(wpa_s->ap_iface && wpa_s->ap_iface->bss[0]) &&
+ !(wpa_s->ifmsh && wpa_s->ifmsh->bss[0]))
+ return -1;
-+
+
+ settings.link_id = -1;
+
+- return ap_switch_channel(wpa_s, &settings);
+ ret = __ap_ctrl_iface_chanswitch(wpa_s->ap_iface, &settings);
- if (ret)
- return ret;
++ if (ret)
++ return ret;
++
++ return __ap_ctrl_iface_chanswitch(wpa_s->ifmsh, &settings);
+ }
+ #endif /* CONFIG_CTRL_IFACE */
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
-index 2c756136c..c3943355d 100644
+index b02b694a3..dc4b0636a 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -18,6 +18,7 @@
@@ -13735,7 +13824,7 @@
{ INT_RANGE(macsec_policy, 0, 1) },
{ INT_RANGE(macsec_integ_only, 0, 1) },
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
-index 1a2c0c9be..7a3ed6373 100644
+index fd8eafe2b..5ce616129 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -326,8 +326,13 @@ struct wpa_config * wpa_config_read(const char *name, struct wpa_config *cfgp,
@@ -13762,21 +13851,10 @@
INT(frequency);
INT(enable_edmg);
diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
-index e40650c27..de79972b6 100644
+index d64c30508..872bcc270 100644
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
-@@ -10,8 +10,10 @@
- #define CONFIG_SSID_H
-
- #include "common/defs.h"
-+#include "ap/sta_info.h"
- #include "utils/list.h"
- #include "eap_peer/eap_config.h"
-+#include "drivers/nl80211_copy.h"
-
-
- #define DEFAULT_EAP_WORKAROUND ((unsigned int) -1)
-@@ -879,6 +881,9 @@ struct wpa_ssid {
+@@ -879,6 +879,9 @@ struct wpa_ssid {
*/
void *parent_cred;
@@ -13786,7 +13864,7 @@
#ifdef CONFIG_MACSEC
/**
* macsec_policy - Determines the policy for MACsec secure session
-@@ -1035,6 +1040,8 @@ struct wpa_ssid {
+@@ -1035,6 +1038,8 @@ struct wpa_ssid {
*/
int no_auto_peer;
@@ -13796,7 +13874,7 @@
* mesh_rssi_threshold - Set mesh parameter mesh_rssi_threshold (dBm)
*
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
-index d0fda4cd9..ec45f29bb 100644
+index d245531cd..4777c3abe 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -2355,7 +2355,7 @@ static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s,
@@ -13808,7 +13886,7 @@
if (wpa_s->ap_iface) {
pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos,
end - pos,
-@@ -12542,6 +12542,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
+@@ -12561,6 +12561,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
reply_len = -1;
} else if (os_strncmp(buf, "NOTE ", 5) == 0) {
wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
@@ -13816,7 +13894,7 @@
} else if (os_strcmp(buf, "MIB") == 0) {
reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
if (reply_len >= 0) {
-@@ -12554,6 +12555,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
+@@ -12573,6 +12574,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
reply_size - reply_len);
#endif /* CONFIG_MACSEC */
}
@@ -13824,7 +13902,7 @@
} else if (os_strncmp(buf, "STATUS", 6) == 0) {
reply_len = wpa_supplicant_ctrl_iface_status(
wpa_s, buf + 6, reply, reply_size);
-@@ -13042,6 +13044,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
+@@ -13061,6 +13063,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
reply_len = wpa_supplicant_ctrl_iface_bss(
wpa_s, buf + 4, reply, reply_size);
#ifdef CONFIG_AP
@@ -13832,7 +13910,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) {
-@@ -13050,12 +13053,15 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
+@@ -13069,12 +13072,15 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
reply_size);
@@ -13848,7 +13926,7 @@
} else if (os_strncmp(buf, "CHAN_SWITCH ", 12) == 0) {
if (ap_ctrl_iface_chanswitch(wpa_s, buf + 12))
reply_len = -1;
-@@ -13214,7 +13220,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
+@@ -13233,7 +13239,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
if (wpas_ctrl_iface_coloc_intf_report(wpa_s, buf + 18))
reply_len = -1;
#endif /* CONFIG_WNM */
@@ -13857,7 +13935,7 @@
} else if (os_strncmp(buf, "DISASSOC_IMMINENT ", 18) == 0) {
if (ap_ctrl_iface_disassoc_imminent(wpa_s, buf + 18))
reply_len = -1;
-@@ -13224,7 +13230,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
+@@ -13243,7 +13249,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
} else if (os_strncmp(buf, "BSS_TM_REQ ", 11) == 0) {
if (ap_ctrl_iface_bss_tm_req(wpa_s, buf + 11))
reply_len = -1;
@@ -13898,7 +13976,7 @@
# none = Empty template
#CONFIG_TLS=openssl
diff --git a/wpa_supplicant/eapol_test.c b/wpa_supplicant/eapol_test.c
-index 95953de92..673c3cc11 100644
+index 0c17aaea4..3d35757bf 100644
--- a/wpa_supplicant/eapol_test.c
+++ b/wpa_supplicant/eapol_test.c
@@ -31,7 +31,12 @@
@@ -13914,7 +13992,7 @@
const struct wpa_driver_ops *const wpa_drivers[] = { NULL };
-@@ -1325,6 +1330,10 @@ static void usage(void)
+@@ -1328,6 +1333,10 @@ static void usage(void)
"option several times.\n");
}
@@ -13925,7 +14003,7 @@
int main(int argc, char *argv[])
{
-@@ -1348,6 +1357,8 @@ int main(int argc, char *argv[])
+@@ -1351,6 +1360,8 @@ int main(int argc, char *argv[])
if (os_program_init())
return -1;
@@ -13935,39 +14013,10 @@
os_memset(&eapol_test, 0, sizeof(eapol_test));
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
-index ca2794638..2a9342318 100644
+index bb0e95ba4..5c08d4a19 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
-@@ -2935,8 +2935,6 @@ void wnm_bss_keep_alive_deinit(struct wpa_supplicant *wpa_s)
- }
-
-
--#ifdef CONFIG_INTERWORKING
--
- static int wpas_qos_map_set(struct wpa_supplicant *wpa_s, const u8 *qos_map,
- size_t len)
- {
-@@ -2969,8 +2967,6 @@ static void interworking_process_assoc_resp(struct wpa_supplicant *wpa_s,
- }
- }
-
--#endif /* CONFIG_INTERWORKING */
--
-
- static void wpa_supplicant_set_4addr_mode(struct wpa_supplicant *wpa_s)
- {
-@@ -3349,10 +3345,8 @@ static int wpa_supplicant_event_associnfo(struct wpa_supplicant *wpa_s,
- wnm_process_assoc_resp(wpa_s, data->assoc_info.resp_ies,
- data->assoc_info.resp_ies_len);
- #endif /* CONFIG_WNM */
--#ifdef CONFIG_INTERWORKING
- interworking_process_assoc_resp(wpa_s, data->assoc_info.resp_ies,
- data->assoc_info.resp_ies_len);
--#endif /* CONFIG_INTERWORKING */
- if (wpa_s->hw_capab == CAPAB_VHT &&
- get_ie(data->assoc_info.resp_ies,
- data->assoc_info.resp_ies_len, WLAN_EID_VHT_CAP))
-@@ -5928,8 +5922,8 @@ static void wpas_link_reconfig(struct wpa_supplicant *wpa_s)
+@@ -6038,8 +6038,8 @@ static void wpas_link_reconfig(struct wpa_supplicant *wpa_s)
}
@@ -13978,7 +14027,7 @@
{
struct wpa_supplicant *wpa_s = ctx;
int resched;
-@@ -5964,6 +5958,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
+@@ -6074,6 +6074,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
event_to_string(event), event);
#endif /* CONFIG_NO_STDOUT_DEBUG */
@@ -13986,7 +14035,7 @@
switch (event) {
case EVENT_AUTH:
#ifdef CONFIG_FST
-@@ -6881,7 +6876,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
+@@ -6991,7 +6992,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
}
@@ -14063,7 +14112,7 @@
wpa_s->mesh_ht_enabled = !!params->freq.ht_enabled;
wpa_s->mesh_vht_enabled = !!params->freq.vht_enabled;
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
-index 60f85624f..67352a121 100644
+index af00e7910..b239410e8 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -26,6 +26,15 @@
@@ -14116,10 +14165,10 @@
os_memset(&global, 0, sizeof(global));
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
-index ab71e2f27..fea84fe49 100644
+index 1e77493ef..32b178560 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -1060,6 +1060,7 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
+@@ -1151,6 +1151,7 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
sme_sched_obss_scan(wpa_s, 0);
}
wpa_s->wpa_state = state;
@@ -14127,7 +14176,7 @@
#ifdef CONFIG_BGSCAN
if (state == WPA_COMPLETED && wpa_s->current_ssid != wpa_s->bgscan_ssid)
-@@ -2698,7 +2699,7 @@ static int drv_supports_vht(struct wpa_supplicant *wpa_s,
+@@ -2831,7 +2832,7 @@ static int drv_supports_vht(struct wpa_supplicant *wpa_s,
}
@@ -14136,7 +14185,7 @@
{
int i;
-@@ -2707,7 +2708,10 @@ static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode)
+@@ -2840,7 +2841,10 @@ static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode)
chan = hw_get_channel_chan(mode, i, NULL);
if (!chan ||
@@ -14148,7 +14197,7 @@
return false;
}
-@@ -2767,7 +2771,7 @@ static bool ibss_mesh_can_use_vht(struct wpa_supplicant *wpa_s,
+@@ -2900,7 +2904,7 @@ static bool ibss_mesh_can_use_vht(struct wpa_supplicant *wpa_s,
const struct wpa_ssid *ssid,
struct hostapd_hw_modes *mode)
{
@@ -14157,7 +14206,7 @@
return false;
if (!drv_supports_vht(wpa_s, ssid))
-@@ -2834,12 +2838,13 @@ static void ibss_mesh_select_40mhz(struct wpa_supplicant *wpa_s,
+@@ -2967,13 +2971,13 @@ static void ibss_mesh_select_40mhz(struct wpa_supplicant *wpa_s,
const struct wpa_ssid *ssid,
struct hostapd_hw_modes *mode,
struct hostapd_freq_params *freq,
@@ -14168,11 +14217,12 @@
int i, res;
unsigned int j;
static const int ht40plus[] = {
-+ 1, 2, 3, 4, 5, 6, 7,
- 36, 44, 52, 60, 100, 108, 116, 124, 132, 140,
+- 36, 44, 52, 60, 100, 108, 116, 124, 132, 140,
++ 1, 2, 3, 4, 5, 6, 7, 36, 44, 52, 60, 100, 108, 116, 124, 132, 140,
149, 157, 165, 173, 184, 192
};
-@@ -2858,8 +2863,11 @@ static void ibss_mesh_select_40mhz(struct wpa_supplicant *wpa_s,
+ int ht40 = -1;
+@@ -2991,8 +2995,11 @@ static void ibss_mesh_select_40mhz(struct wpa_supplicant *wpa_s,
return;
/* Check primary channel flags */
@@ -14185,7 +14235,7 @@
#ifdef CONFIG_HT_OVERRIDES
if (ssid->disable_ht40)
-@@ -2885,8 +2893,11 @@ static void ibss_mesh_select_40mhz(struct wpa_supplicant *wpa_s,
+@@ -3018,8 +3025,11 @@ static void ibss_mesh_select_40mhz(struct wpa_supplicant *wpa_s,
return;
/* Check secondary channel flags */
@@ -14198,7 +14248,7 @@
if (ht40 == -1) {
if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS))
-@@ -2941,7 +2952,7 @@ static bool ibss_mesh_select_80_160mhz(struct wpa_supplicant *wpa_s,
+@@ -3074,7 +3084,7 @@ static bool ibss_mesh_select_80_160mhz(struct wpa_supplicant *wpa_s,
const struct wpa_ssid *ssid,
struct hostapd_hw_modes *mode,
struct hostapd_freq_params *freq,
@@ -14207,7 +14257,7 @@
static const int bw80[] = {
5180, 5260, 5500, 5580, 5660, 5745, 5825,
5955, 6035, 6115, 6195, 6275, 6355, 6435,
-@@ -2986,7 +2997,7 @@ static bool ibss_mesh_select_80_160mhz(struct wpa_supplicant *wpa_s,
+@@ -3119,7 +3129,7 @@ static bool ibss_mesh_select_80_160mhz(struct wpa_supplicant *wpa_s,
goto skip_80mhz;
/* Use 40 MHz if channel not usable */
@@ -14216,7 +14266,7 @@
goto skip_80mhz;
chwidth = CONF_OPER_CHWIDTH_80MHZ;
-@@ -3000,7 +3011,7 @@ static bool ibss_mesh_select_80_160mhz(struct wpa_supplicant *wpa_s,
+@@ -3133,7 +3143,7 @@ static bool ibss_mesh_select_80_160mhz(struct wpa_supplicant *wpa_s,
if ((mode->he_capab[ieee80211_mode].phy_cap[
HE_PHYCAP_CHANNEL_WIDTH_SET_IDX] &
HE_PHYCAP_CHANNEL_WIDTH_SET_160MHZ_IN_5G) && is_6ghz &&
@@ -14225,7 +14275,7 @@
for (j = 0; j < ARRAY_SIZE(bw160); j++) {
if (freq->freq == bw160[j]) {
chwidth = CONF_OPER_CHWIDTH_160MHZ;
-@@ -3028,10 +3039,12 @@ static bool ibss_mesh_select_80_160mhz(struct wpa_supplicant *wpa_s,
+@@ -3161,10 +3171,12 @@ static bool ibss_mesh_select_80_160mhz(struct wpa_supplicant *wpa_s,
if (!chan)
continue;
@@ -14241,12 +14291,12 @@
/* Found a suitable second segment for 80+80 */
chwidth = CONF_OPER_CHWIDTH_80P80MHZ;
-@@ -3083,12 +3096,17 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
+@@ -3216,12 +3228,17 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
int ieee80211_mode = wpas_mode_to_ieee80211_mode(ssid->mode);
enum hostapd_hw_mode hw_mode;
struct hostapd_hw_modes *mode = NULL;
-- int i, obss_scan = 1;
-+ int i, obss_scan = !(ssid->noscan);
+- int obss_scan = 1;
++ int obss_scan = !(ssid->noscan);
u8 channel;
bool is_6ghz, is_24ghz;
+ bool dfs_enabled = wpa_s->conf->country[0] && (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
@@ -14260,7 +14310,7 @@
if (ssid->mode == WPAS_MODE_IBSS && !ssid->fixed_freq) {
struct wpa_bss *bss = ibss_find_existing_bss(wpa_s, ssid);
-@@ -3132,11 +3150,13 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
+@@ -3259,11 +3276,13 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
freq->he_enabled = ibss_mesh_can_use_he(wpa_s, ssid, mode,
ieee80211_mode);
freq->channel = channel;
@@ -14276,7 +14326,7 @@
freq->he_enabled = freq->vht_enabled = false;
}
-@@ -4240,6 +4260,12 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
+@@ -4449,6 +4468,12 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
params.beacon_int = ssid->beacon_int;
else
params.beacon_int = wpa_s->conf->beacon_int;
@@ -14289,7 +14339,7 @@
}
if (bss && ssid->enable_edmg)
-@@ -5861,7 +5887,7 @@ wpa_supplicant_alloc(struct wpa_supplicant *parent)
+@@ -6093,7 +6118,7 @@ wpa_supplicant_alloc(struct wpa_supplicant *parent)
if (wpa_s == NULL)
return NULL;
wpa_s->scan_req = INITIAL_SCAN_REQ;
@@ -14298,7 +14348,7 @@
wpa_s->new_connection = 1;
wpa_s->parent = parent ? parent : wpa_s;
wpa_s->p2pdev = wpa_s->parent;
-@@ -7576,7 +7602,6 @@ struct wpa_interface * wpa_supplicant_match_iface(struct wpa_global *global,
+@@ -7809,7 +7834,6 @@ struct wpa_interface * wpa_supplicant_match_iface(struct wpa_global *global,
return NULL;
}
@@ -14306,7 +14356,7 @@
/**
* wpa_supplicant_match_existing - Match existing interfaces
* @global: Pointer to global data from wpa_supplicant_init()
-@@ -7611,6 +7636,11 @@ static int wpa_supplicant_match_existing(struct wpa_global *global)
+@@ -7844,6 +7868,11 @@ static int wpa_supplicant_match_existing(struct wpa_global *global)
#endif /* CONFIG_MATCH_IFACE */
@@ -14318,7 +14368,7 @@
/**
* wpa_supplicant_add_iface - Add a new network interface
-@@ -7693,6 +7723,9 @@ struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
+@@ -7926,6 +7955,9 @@ struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
}
#endif /* CONFIG_P2P */
@@ -14328,7 +14378,7 @@
return wpa_s;
}
-@@ -7719,6 +7752,9 @@ int wpa_supplicant_remove_iface(struct wpa_global *global,
+@@ -7952,6 +7984,9 @@ int wpa_supplicant_remove_iface(struct wpa_global *global,
struct wpa_supplicant *parent = wpa_s->parent;
#endif /* CONFIG_MESH */
@@ -14338,7 +14388,7 @@
/* Remove interface from the global list of interfaces */
prev = global->ifaces;
if (prev == wpa_s) {
-@@ -7867,6 +7903,8 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params)
+@@ -8100,6 +8135,8 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params)
#ifndef CONFIG_NO_WPA_MSG
wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
#endif /* CONFIG_NO_WPA_MSG */
@@ -14347,7 +14397,7 @@
if (params->wpa_debug_file_path)
wpa_debug_open_file(params->wpa_debug_file_path);
-@@ -8025,6 +8063,7 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params)
+@@ -8258,6 +8295,7 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params)
eloop_register_timeout(WPA_SUPPLICANT_CLEANUP_INTERVAL, 0,
wpas_periodic, global, NULL);
@@ -14355,7 +14405,7 @@
return global;
}
-@@ -8097,6 +8136,8 @@ void wpa_supplicant_deinit(struct wpa_global *global)
+@@ -8330,6 +8368,8 @@ void wpa_supplicant_deinit(struct wpa_global *global)
wpas_notify_supplicant_deinitialized(global);
@@ -14365,7 +14415,7 @@
#ifdef CONFIG_AP
eap_server_unregister_methods();
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
-index 426d077d2..e0c0e5b0c 100644
+index 48ec95fa5..952a3bd5a 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -21,6 +21,8 @@
@@ -14396,7 +14446,7 @@
int matched;
#endif /* CONFIG_MATCH_IFACE */
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
-index 8cd355f6b..136b06583 100644
+index 7b9cf7f9e..03748f4bb 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -33,6 +33,7 @@
@@ -14438,5 +14488,5 @@
const char *ssid_hex;
const char *auth;
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0011-hostapd-MLO-move-mgmt-and-control-port-Tx-status-to-.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0011-hostapd-MLO-move-mgmt-and-control-port-Tx-status-to-.patch
deleted file mode 100644
index 1d9c2fd..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0011-hostapd-MLO-move-mgmt-and-control-port-Tx-status-to-.patch
+++ /dev/null
@@ -1,136 +0,0 @@
-From 0b72d2a8002e79886433ee85fd23661ec4d3d731 Mon Sep 17 00:00:00 2001
-From: Sriram R <quic_srirrama@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:41 +0530
-Subject: [PATCH 011/104] hostapd: MLO: move mgmt and control port Tx status to
- per BSS handling
-
-Currently management and control port transmit status is handled on drv's
-first BSS only. However to support multiple MLDs there is requirement to
-handle it in on a given BSS.
-
-Add changes to use the passed BSS instead of always going with drv's first
-BSS.
-
-Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/drivers/driver_nl80211_event.c | 25 +++++++++++++------------
- 1 file changed, 13 insertions(+), 12 deletions(-)
-
-diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
-index 1ca8b5bce..f5778cdaf 100644
---- a/src/drivers/driver_nl80211_event.c
-+++ b/src/drivers/driver_nl80211_event.c
-@@ -22,7 +22,7 @@
-
-
- static void
--nl80211_control_port_frame_tx_status(struct wpa_driver_nl80211_data *drv,
-+nl80211_control_port_frame_tx_status(struct i802_bss *bss,
- const u8 *frame, size_t len,
- struct nlattr *ack, struct nlattr *cookie);
-
-@@ -1374,12 +1374,13 @@ static void mlme_event_mgmt(struct i802_bss *bss,
- }
-
-
--static void mlme_event_mgmt_tx_status(struct wpa_driver_nl80211_data *drv,
-+static void mlme_event_mgmt_tx_status(struct i802_bss *bss,
- struct nlattr *cookie, const u8 *frame,
- size_t len, struct nlattr *ack)
- {
- union wpa_event_data event;
- const struct ieee80211_hdr *hdr = (const struct ieee80211_hdr *) frame;
-+ struct wpa_driver_nl80211_data *drv = bss->drv;
- u16 fc = le_to_host16(hdr->frame_control);
- u64 cookie_val = 0;
-
-@@ -1398,7 +1399,7 @@ static void mlme_event_mgmt_tx_status(struct wpa_driver_nl80211_data *drv,
- WPA_GET_BE16(frame + 2 * ETH_ALEN) == ETH_P_PAE) {
- wpa_printf(MSG_DEBUG,
- "nl80211: Work around misdelivered control port TX status for EAPOL");
-- nl80211_control_port_frame_tx_status(drv, frame, len, ack,
-+ nl80211_control_port_frame_tx_status(bss, frame, len, ack,
- cookie);
- return;
- }
-@@ -1434,7 +1435,7 @@ static void mlme_event_mgmt_tx_status(struct wpa_driver_nl80211_data *drv,
- event.tx_status.ack = ack != NULL;
- event.tx_status.link_id = cookie_val == drv->send_frame_cookie ?
- drv->send_frame_link_id : NL80211_DRV_LINK_ID_NA;
-- wpa_supplicant_event(drv->ctx, EVENT_TX_STATUS, &event);
-+ wpa_supplicant_event(bss->ctx, EVENT_TX_STATUS, &event);
- }
-
-
-@@ -1742,7 +1743,7 @@ static void mlme_event(struct i802_bss *bss,
- nla_len(frame), link_id);
- break;
- case NL80211_CMD_FRAME_TX_STATUS:
-- mlme_event_mgmt_tx_status(drv, cookie, nla_data(frame),
-+ mlme_event_mgmt_tx_status(bss, cookie, nla_data(frame),
- nla_len(frame), ack);
- break;
- case NL80211_CMD_UNPROT_DEAUTHENTICATE:
-@@ -3652,8 +3653,7 @@ static void nl80211_sta_opmode_change_event(struct wpa_driver_nl80211_data *drv,
- }
-
-
--static void nl80211_control_port_frame(struct wpa_driver_nl80211_data *drv,
-- struct nlattr **tb)
-+static void nl80211_control_port_frame(struct i802_bss *bss, struct nlattr **tb)
- {
- u8 *src_addr;
- u16 ethertype;
-@@ -3682,7 +3682,7 @@ static void nl80211_control_port_frame(struct wpa_driver_nl80211_data *drv,
- MAC2STR(src_addr));
- break;
- case ETH_P_PAE:
-- drv_event_eapol_rx2(drv->ctx, src_addr,
-+ drv_event_eapol_rx2(bss->ctx, src_addr,
- nla_data(tb[NL80211_ATTR_FRAME]),
- nla_len(tb[NL80211_ATTR_FRAME]),
- encrypted, link_id);
-@@ -3698,10 +3698,11 @@ static void nl80211_control_port_frame(struct wpa_driver_nl80211_data *drv,
-
-
- static void
--nl80211_control_port_frame_tx_status(struct wpa_driver_nl80211_data *drv,
-+nl80211_control_port_frame_tx_status(struct i802_bss *bss,
- const u8 *frame, size_t len,
- struct nlattr *ack, struct nlattr *cookie)
- {
-+ struct wpa_driver_nl80211_data *drv = bss->drv;
- union wpa_event_data event;
-
- if (!cookie || len < ETH_HLEN)
-@@ -3720,7 +3721,7 @@ nl80211_control_port_frame_tx_status(struct wpa_driver_nl80211_data *drv,
- nla_get_u64(cookie) == drv->eapol_tx_cookie ?
- drv->eapol_tx_link_id : NL80211_DRV_LINK_ID_NA;
-
-- wpa_supplicant_event(drv->ctx, EVENT_EAPOL_TX_STATUS, &event);
-+ wpa_supplicant_event(bss->ctx, EVENT_EAPOL_TX_STATUS, &event);
- }
-
-
-@@ -4065,7 +4066,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
- case NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS:
- if (!frame)
- break;
-- nl80211_control_port_frame_tx_status(drv,
-+ nl80211_control_port_frame_tx_status(bss,
- nla_data(frame),
- nla_len(frame),
- tb[NL80211_ATTR_ACK],
-@@ -4238,7 +4239,7 @@ int process_bss_event(struct nl_msg *msg, void *arg)
- nl80211_external_auth(bss->drv, tb);
- break;
- case NL80211_CMD_CONTROL_PORT_FRAME:
-- nl80211_control_port_frame(bss->drv, tb);
-+ nl80211_control_port_frame(bss, tb);
- break;
- default:
- wpa_printf(MSG_DEBUG, "nl80211: Ignored unknown event "
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0011-mtk-hostapd-sync-with-wireless-next.git-include-uapi.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0011-mtk-hostapd-sync-with-wireless-next.git-include-uapi.patch
new file mode 100644
index 0000000..ffd8333
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0011-mtk-hostapd-sync-with-wireless-next.git-include-uapi.patch
@@ -0,0 +1,1274 @@
+From 02fb89a020d0bab2eac528f3d49379b535ebeda2 Mon Sep 17 00:00:00 2001
+From: Shayne Chen <shayne.chen@mediatek.com>
+Date: Wed, 31 Jul 2024 10:42:08 +0800
+Subject: [PATCH 011/126] mtk: hostapd: sync with wireless-next.git
+ include/uapi/linux/nl80211.h
+
+This brings in nl80211 definitions as of 2024-07-11.
+
+Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
+---
+ src/drivers/driver_nl80211_event.c | 1 +
+ src/drivers/nl80211_copy.h | 537 ++++++++++++++++++++---------
+ 2 files changed, 370 insertions(+), 168 deletions(-)
+
+diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
+index 768c72905..1787dbd99 100644
+--- a/src/drivers/driver_nl80211_event.c
++++ b/src/drivers/driver_nl80211_event.c
+@@ -186,6 +186,7 @@ static const char * nl80211_command_to_string(enum nl80211_commands cmd)
+ C2S(NL80211_CMD_REMOVE_LINK_STA)
+ C2S(NL80211_CMD_SET_HW_TIMESTAMP)
+ C2S(NL80211_CMD_LINKS_REMOVED)
++ C2S(NL80211_CMD_SET_TID_TO_LINK_MAPPING)
+ C2S(__NL80211_CMD_AFTER_LAST)
+ }
+ #undef C2S
+diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h
+index dced2c49d..f97f5adc8 100644
+--- a/src/drivers/nl80211_copy.h
++++ b/src/drivers/nl80211_copy.h
+@@ -11,7 +11,7 @@
+ * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
+ * Copyright 2008 Colin McCabe <colin@cozybit.com>
+ * Copyright 2015-2017 Intel Deutschland GmbH
+- * Copyright (C) 2018-2023 Intel Corporation
++ * Copyright (C) 2018-2024 Intel Corporation
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+@@ -72,7 +72,7 @@
+ * For drivers supporting TDLS with external setup (WIPHY_FLAG_SUPPORTS_TDLS
+ * and WIPHY_FLAG_TDLS_EXTERNAL_SETUP), the station lifetime is as follows:
+ * - a setup station entry is added, not yet authorized, without any rate
+- * or capability information, this just exists to avoid race conditions
++ * or capability information; this just exists to avoid race conditions
+ * - when the TDLS setup is done, a single NL80211_CMD_SET_STATION is valid
+ * to add rate and capability information to the station and at the same
+ * time mark it authorized.
+@@ -87,7 +87,7 @@
+ * DOC: Frame transmission/registration support
+ *
+ * Frame transmission and registration support exists to allow userspace
+- * management entities such as wpa_supplicant react to management frames
++ * management entities such as wpa_supplicant to react to management frames
+ * that are not being handled by the kernel. This includes, for example,
+ * certain classes of action frames that cannot be handled in the kernel
+ * for various reasons.
+@@ -113,7 +113,7 @@
+ *
+ * Frame transmission allows userspace to send for example the required
+ * responses to action frames. It is subject to some sanity checking,
+- * but many frames can be transmitted. When a frame was transmitted, its
++ * but many frames can be transmitted. When a frame is transmitted, its
+ * status is indicated to the sending socket.
+ *
+ * For more technical details, see the corresponding command descriptions
+@@ -123,7 +123,7 @@
+ /**
+ * DOC: Virtual interface / concurrency capabilities
+ *
+- * Some devices are able to operate with virtual MACs, they can have
++ * Some devices are able to operate with virtual MACs; they can have
+ * more than one virtual interface. The capability handling for this
+ * is a bit complex though, as there may be a number of restrictions
+ * on the types of concurrency that are supported.
+@@ -135,7 +135,7 @@
+ * Once concurrency is desired, more attributes must be observed:
+ * To start with, since some interface types are purely managed in
+ * software, like the AP-VLAN type in mac80211 for example, there's
+- * an additional list of these, they can be added at any time and
++ * an additional list of these; they can be added at any time and
+ * are only restricted by some semantic restrictions (e.g. AP-VLAN
+ * cannot be added without a corresponding AP interface). This list
+ * is exported in the %NL80211_ATTR_SOFTWARE_IFTYPES attribute.
+@@ -164,7 +164,7 @@
+ * Packet coalesce feature helps to reduce number of received interrupts
+ * to host by buffering these packets in firmware/hardware for some
+ * predefined time. Received interrupt will be generated when one of the
+- * following events occur.
++ * following events occurs.
+ * a) Expiration of hardware timer whose expiration time is set to maximum
+ * coalescing delay of matching coalesce rule.
+ * b) Coalescing buffer in hardware reaches its limit.
+@@ -174,7 +174,7 @@
+ * rule.
+ * a) Maximum coalescing delay
+ * b) List of packet patterns which needs to be matched
+- * c) Condition for coalescence. pattern 'match' or 'no match'
++ * c) Condition for coalescence: pattern 'match' or 'no match'
+ * Multiple such rules can be created.
+ */
+
+@@ -213,7 +213,7 @@
+ /**
+ * DOC: FILS shared key authentication offload
+ *
+- * FILS shared key authentication offload can be advertized by drivers by
++ * FILS shared key authentication offload can be advertised by drivers by
+ * setting @NL80211_EXT_FEATURE_FILS_SK_OFFLOAD flag. The drivers that support
+ * FILS shared key authentication offload should be able to construct the
+ * authentication and association frames for FILS shared key authentication and
+@@ -239,7 +239,7 @@
+ * The PMKSA can be maintained in userspace persistently so that it can be used
+ * later after reboots or wifi turn off/on also.
+ *
+- * %NL80211_ATTR_FILS_CACHE_ID is the cache identifier advertized by a FILS
++ * %NL80211_ATTR_FILS_CACHE_ID is the cache identifier advertised by a FILS
+ * capable AP supporting PMK caching. It specifies the scope within which the
+ * PMKSAs are cached in an ESS. %NL80211_CMD_SET_PMKSA and
+ * %NL80211_CMD_DEL_PMKSA are enhanced to allow support for PMKSA caching based
+@@ -290,12 +290,12 @@
+ * If the configuration needs to be applied for specific peer then the MAC
+ * address of the peer needs to be passed in %NL80211_ATTR_MAC, otherwise the
+ * configuration will be applied for all the connected peers in the vif except
+- * any peers that have peer specific configuration for the TID by default; if
+- * the %NL80211_TID_CONFIG_ATTR_OVERRIDE flag is set, peer specific values
++ * any peers that have peer-specific configuration for the TID by default; if
++ * the %NL80211_TID_CONFIG_ATTR_OVERRIDE flag is set, peer-specific values
+ * will be overwritten.
+ *
+- * All this configuration is valid only for STA's current connection
+- * i.e. the configuration will be reset to default when the STA connects back
++ * All this configuration is valid only for STA's current connection,
++ * i.e., the configuration will be reset to default when the STA connects back
+ * after disconnection/roaming, and this configuration will be cleared when
+ * the interface goes down.
+ */
+@@ -413,8 +413,8 @@
+ * are like for %NL80211_CMD_SET_BEACON, and additionally parameters that
+ * do not change are used, these include %NL80211_ATTR_BEACON_INTERVAL,
+ * %NL80211_ATTR_DTIM_PERIOD, %NL80211_ATTR_SSID,
+- * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE,
+- * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS,
++ * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHER_SUITES_PAIRWISE,
++ * %NL80211_ATTR_CIPHER_SUITE_GROUP, %NL80211_ATTR_WPA_VERSIONS,
+ * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
+ * %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT,
+ * %NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS.
+@@ -438,23 +438,19 @@
+ * %NL80211_ATTR_REASON_CODE can optionally be used to specify which type
+ * of disconnection indication should be sent to the station
+ * (Deauthentication or Disassociation frame and reason code for that
+- * frame).
++ * frame). %NL80211_ATTR_MLO_LINK_ID can be used optionally to remove
++ * stations connected and using at least that link as one of its links.
+ *
+ * @NL80211_CMD_GET_MPATH: Get mesh path attributes for mesh path to
+- * destination %NL80211_ATTR_MAC on the interface identified by
+- * %NL80211_ATTR_IFINDEX.
++ * destination %NL80211_ATTR_MAC on the interface identified by
++ * %NL80211_ATTR_IFINDEX.
+ * @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to
+- * destination %NL80211_ATTR_MAC on the interface identified by
+- * %NL80211_ATTR_IFINDEX.
++ * destination %NL80211_ATTR_MAC on the interface identified by
++ * %NL80211_ATTR_IFINDEX.
+ * @NL80211_CMD_NEW_MPATH: Create a new mesh path for the destination given by
+ * %NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP.
+ * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by
+ * %NL80211_ATTR_MAC.
+- * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the
+- * interface identified by %NL80211_ATTR_IFINDEX.
+- * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC
+- * or, if no MAC address given, all mesh paths, on the interface identified
+- * by %NL80211_ATTR_IFINDEX.
+ * @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by
+ * %NL80211_ATTR_IFINDEX.
+ *
+@@ -475,15 +471,15 @@
+ * after being queried by the kernel. CRDA replies by sending a regulatory
+ * domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our
+ * current alpha2 if it found a match. It also provides
+- * NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each
+- * regulatory rule is a nested set of attributes given by
+- * %NL80211_ATTR_REG_RULE_FREQ_[START|END] and
+- * %NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by
+- * %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and
+- * %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP.
++ * NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each
++ * regulatory rule is a nested set of attributes given by
++ * %NL80211_ATTR_REG_RULE_FREQ_[START|END] and
++ * %NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by
++ * %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and
++ * %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP.
+ * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain
+- * to the specified ISO/IEC 3166-1 alpha2 country code. The core will
+- * store this as a valid request and then query userspace for it.
++ * to the specified ISO/IEC 3166-1 alpha2 country code. The core will
++ * store this as a valid request and then query userspace for it.
+ *
+ * @NL80211_CMD_GET_MESH_CONFIG: Get mesh networking properties for the
+ * interface identified by %NL80211_ATTR_IFINDEX
+@@ -521,7 +517,7 @@
+ * %NL80211_ATTR_SCHED_SCAN_PLANS. If %NL80211_ATTR_SCHED_SCAN_PLANS is
+ * not specified and only %NL80211_ATTR_SCHED_SCAN_INTERVAL is specified,
+ * scheduled scan will run in an infinite loop with the specified interval.
+- * These attributes are mutually exculsive,
++ * These attributes are mutually exclusive,
+ * i.e. NL80211_ATTR_SCHED_SCAN_INTERVAL must not be passed if
+ * NL80211_ATTR_SCHED_SCAN_PLANS is defined.
+ * If for some reason scheduled scan is aborted by the driver, all scan
+@@ -552,7 +548,7 @@
+ * %NL80211_CMD_STOP_SCHED_SCAN command is received or when the interface
+ * is brought down while a scheduled scan was running.
+ *
+- * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation
++ * @NL80211_CMD_GET_SURVEY: get survey results, e.g. channel occupation
+ * or noise level
+ * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to
+ * NL80211_CMD_GET_SURVEY and on the "scan" multicast group)
+@@ -563,40 +559,41 @@
+ * using %NL80211_ATTR_SSID, %NL80211_ATTR_FILS_CACHE_ID,
+ * %NL80211_ATTR_PMKID, and %NL80211_ATTR_PMK in case of FILS
+ * authentication where %NL80211_ATTR_FILS_CACHE_ID is the identifier
+- * advertized by a FILS capable AP identifying the scope of PMKSA in an
++ * advertised by a FILS capable AP identifying the scope of PMKSA in an
+ * ESS.
+ * @NL80211_CMD_DEL_PMKSA: Delete a PMKSA cache entry, using %NL80211_ATTR_MAC
+ * (for the BSSID) and %NL80211_ATTR_PMKID or using %NL80211_ATTR_SSID,
+ * %NL80211_ATTR_FILS_CACHE_ID, and %NL80211_ATTR_PMKID in case of FILS
+- * authentication.
++ * authentication. Additionally in case of SAE offload and OWE offloads
++ * PMKSA entry can be deleted using %NL80211_ATTR_SSID.
+ * @NL80211_CMD_FLUSH_PMKSA: Flush all PMKSA cache entries.
+ *
+ * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain
+- * has been changed and provides details of the request information
+- * that caused the change such as who initiated the regulatory request
+- * (%NL80211_ATTR_REG_INITIATOR), the wiphy_idx
+- * (%NL80211_ATTR_REG_ALPHA2) on which the request was made from if
+- * the initiator was %NL80211_REGDOM_SET_BY_COUNTRY_IE or
+- * %NL80211_REGDOM_SET_BY_DRIVER, the type of regulatory domain
+- * set (%NL80211_ATTR_REG_TYPE), if the type of regulatory domain is
+- * %NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on
+- * to (%NL80211_ATTR_REG_ALPHA2).
++ * has been changed and provides details of the request information
++ * that caused the change such as who initiated the regulatory request
++ * (%NL80211_ATTR_REG_INITIATOR), the wiphy_idx
++ * (%NL80211_ATTR_REG_ALPHA2) on which the request was made from if
++ * the initiator was %NL80211_REGDOM_SET_BY_COUNTRY_IE or
++ * %NL80211_REGDOM_SET_BY_DRIVER, the type of regulatory domain
++ * set (%NL80211_ATTR_REG_TYPE), if the type of regulatory domain is
++ * %NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on
++ * to (%NL80211_ATTR_REG_ALPHA2).
+ * @NL80211_CMD_REG_BEACON_HINT: indicates to userspace that an AP beacon
+- * has been found while world roaming thus enabling active scan or
+- * any mode of operation that initiates TX (beacons) on a channel
+- * where we would not have been able to do either before. As an example
+- * if you are world roaming (regulatory domain set to world or if your
+- * driver is using a custom world roaming regulatory domain) and while
+- * doing a passive scan on the 5 GHz band you find an AP there (if not
+- * on a DFS channel) you will now be able to actively scan for that AP
+- * or use AP mode on your card on that same channel. Note that this will
+- * never be used for channels 1-11 on the 2 GHz band as they are always
+- * enabled world wide. This beacon hint is only sent if your device had
+- * either disabled active scanning or beaconing on a channel. We send to
+- * userspace the wiphy on which we removed a restriction from
+- * (%NL80211_ATTR_WIPHY) and the channel on which this occurred
+- * before (%NL80211_ATTR_FREQ_BEFORE) and after (%NL80211_ATTR_FREQ_AFTER)
+- * the beacon hint was processed.
++ * has been found while world roaming thus enabling active scan or
++ * any mode of operation that initiates TX (beacons) on a channel
++ * where we would not have been able to do either before. As an example
++ * if you are world roaming (regulatory domain set to world or if your
++ * driver is using a custom world roaming regulatory domain) and while
++ * doing a passive scan on the 5 GHz band you find an AP there (if not
++ * on a DFS channel) you will now be able to actively scan for that AP
++ * or use AP mode on your card on that same channel. Note that this will
++ * never be used for channels 1-11 on the 2 GHz band as they are always
++ * enabled world wide. This beacon hint is only sent if your device had
++ * either disabled active scanning or beaconing on a channel. We send to
++ * userspace the wiphy on which we removed a restriction from
++ * (%NL80211_ATTR_WIPHY) and the channel on which this occurred
++ * before (%NL80211_ATTR_FREQ_BEFORE) and after (%NL80211_ATTR_FREQ_AFTER)
++ * the beacon hint was processed.
+ *
+ * @NL80211_CMD_AUTHENTICATE: authentication request and notification.
+ * This command is used both as a command (request to authenticate) and
+@@ -607,7 +604,7 @@
+ * BSSID in case of station mode). %NL80211_ATTR_SSID is used to specify
+ * the SSID (mainly for association, but is included in authentication
+ * request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ +
+- * %NL80211_ATTR_WIPHY_FREQ_OFFSET is used to specify the frequence of the
++ * %NL80211_ATTR_WIPHY_FREQ_OFFSET is used to specify the frequency of the
+ * channel in MHz. %NL80211_ATTR_AUTH_TYPE is used to specify the
+ * authentication type. %NL80211_ATTR_IE is used to define IEs
+ * (VendorSpecificInfo, but also including RSN IE and FT IEs) to be added
+@@ -816,7 +813,7 @@
+ * reached.
+ * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
+ * and the attributes determining channel width) the given interface
+- * (identifed by %NL80211_ATTR_IFINDEX) shall operate on.
++ * (identified by %NL80211_ATTR_IFINDEX) shall operate on.
+ * In case multiple channels are supported by the device, the mechanism
+ * with which it switches channels is implementation-defined.
+ * When a monitor interface is given, it can only switch channel while
+@@ -888,7 +885,7 @@
+ * inform userspace of the new replay counter.
+ *
+ * @NL80211_CMD_PMKSA_CANDIDATE: This is used as an event to inform userspace
+- * of PMKSA caching dandidates.
++ * of PMKSA caching candidates.
+ *
+ * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup).
+ * In addition, this can be used as an event to request userspace to take
+@@ -924,7 +921,7 @@
+ *
+ * @NL80211_CMD_PROBE_CLIENT: Probe an associated station on an AP interface
+ * by sending a null data frame to it and reporting when the frame is
+- * acknowleged. This is used to allow timing out inactive clients. Uses
++ * acknowledged. This is used to allow timing out inactive clients. Uses
+ * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_MAC. The command returns a
+ * direct reply with an %NL80211_ATTR_COOKIE that is later used to match
+ * up the event with the request. The event includes the same data and
+@@ -1118,7 +1115,7 @@
+ * current configuration is not changed. If it is present but
+ * set to zero, the configuration is changed to don't-care
+ * (i.e. the device can decide what to do).
+- * @NL80211_CMD_NAN_FUNC_MATCH: Notification sent when a match is reported.
++ * @NL80211_CMD_NAN_MATCH: Notification sent when a match is reported.
+ * This will contain a %NL80211_ATTR_NAN_MATCH nested attribute and
+ * %NL80211_ATTR_COOKIE.
+ *
+@@ -1135,11 +1132,15 @@
+ * @NL80211_CMD_DEL_PMK: For offloaded 4-Way handshake, delete the previously
+ * configured PMK for the authenticator address identified by
+ * %NL80211_ATTR_MAC.
+- * @NL80211_CMD_PORT_AUTHORIZED: An event that indicates an 802.1X FT roam was
+- * completed successfully. Drivers that support 4 way handshake offload
+- * should send this event after indicating 802.1X FT assocation with
+- * %NL80211_CMD_ROAM. If the 4 way handshake failed %NL80211_CMD_DISCONNECT
+- * should be indicated instead.
++ * @NL80211_CMD_PORT_AUTHORIZED: An event that indicates port is authorized and
++ * open for regular data traffic. For STA/P2P-client, this event is sent
++ * with AP MAC address and for AP/P2P-GO, the event carries the STA/P2P-
++ * client MAC address.
++ * Drivers that support 4 way handshake offload should send this event for
++ * STA/P2P-client after successful 4-way HS or after 802.1X FT following
++ * NL80211_CMD_CONNECT or NL80211_CMD_ROAM. Drivers using AP/P2P-GO 4-way
++ * handshake offload should send this event on successful completion of
++ * 4-way handshake with the peer (STA/P2P-client).
+ * @NL80211_CMD_CONTROL_PORT_FRAME: Control Port (e.g. PAE) frame TX request
+ * and RX notification. This command is used both as a request to transmit
+ * a control port frame and as a notification that a control port frame
+@@ -1323,6 +1324,11 @@
+ * Multi-Link reconfiguration. %NL80211_ATTR_MLO_LINKS is used to provide
+ * information about the removed STA MLD setup links.
+ *
++ * @NL80211_CMD_SET_TID_TO_LINK_MAPPING: Set the TID to Link Mapping for a
++ * non-AP MLD station. The %NL80211_ATTR_MLO_TTLM_DLINK and
++ * %NL80211_ATTR_MLO_TTLM_ULINK attributes are used to specify the
++ * TID to Link mapping for downlink/uplink traffic.
++ *
+ * @NL80211_CMD_MAX: highest used command number
+ * @__NL80211_CMD_AFTER_LAST: internal use
+ */
+@@ -1578,6 +1584,8 @@ enum nl80211_commands {
+
+ NL80211_CMD_LINKS_REMOVED,
+
++ NL80211_CMD_SET_TID_TO_LINK_MAPPING,
++
+ /* add new commands above here */
+
+ /* used to define NL80211_CMD_MAX below */
+@@ -1702,21 +1710,21 @@ enum nl80211_commands {
+ * (see &enum nl80211_plink_action).
+ * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path.
+ * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path
+- * info given for %NL80211_CMD_GET_MPATH, nested attribute described at
++ * info given for %NL80211_CMD_GET_MPATH, nested attribute described at
+ * &enum nl80211_mpath_info.
+ *
+ * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of
+ * &enum nl80211_mntr_flags.
+ *
+ * @NL80211_ATTR_REG_ALPHA2: an ISO-3166-alpha2 country code for which the
+- * current regulatory domain should be set to or is already set to.
+- * For example, 'CR', for Costa Rica. This attribute is used by the kernel
+- * to query the CRDA to retrieve one regulatory domain. This attribute can
+- * also be used by userspace to query the kernel for the currently set
+- * regulatory domain. We chose an alpha2 as that is also used by the
+- * IEEE-802.11 country information element to identify a country.
+- * Users can also simply ask the wireless core to set regulatory domain
+- * to a specific alpha2.
++ * current regulatory domain should be set to or is already set to.
++ * For example, 'CR', for Costa Rica. This attribute is used by the kernel
++ * to query the CRDA to retrieve one regulatory domain. This attribute can
++ * also be used by userspace to query the kernel for the currently set
++ * regulatory domain. We chose an alpha2 as that is also used by the
++ * IEEE-802.11 country information element to identify a country.
++ * Users can also simply ask the wireless core to set regulatory domain
++ * to a specific alpha2.
+ * @NL80211_ATTR_REG_RULES: a nested array of regulatory domain regulatory
+ * rules.
+ *
+@@ -1759,9 +1767,9 @@ enum nl80211_commands {
+ * @NL80211_ATTR_BSS: scan result BSS
+ *
+ * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain
+- * currently in effect. This could be any of the %NL80211_REGDOM_SET_BY_*
++ * currently in effect. This could be any of the %NL80211_REGDOM_SET_BY_*
+ * @NL80211_ATTR_REG_TYPE: indicates the type of the regulatory domain currently
+- * set. This can be one of the nl80211_reg_type (%NL80211_REGDOM_TYPE_*)
++ * set. This can be one of the nl80211_reg_type (%NL80211_REGDOM_TYPE_*)
+ *
+ * @NL80211_ATTR_SUPPORTED_COMMANDS: wiphy attribute that specifies
+ * an array of command numbers (i.e. a mapping index to command number)
+@@ -1780,15 +1788,15 @@ enum nl80211_commands {
+ * a u32
+ *
+ * @NL80211_ATTR_FREQ_BEFORE: A channel which has suffered a regulatory change
+- * due to considerations from a beacon hint. This attribute reflects
+- * the state of the channel _before_ the beacon hint processing. This
+- * attributes consists of a nested attribute containing
+- * NL80211_FREQUENCY_ATTR_*
++ * due to considerations from a beacon hint. This attribute reflects
++ * the state of the channel _before_ the beacon hint processing. This
++ * attributes consists of a nested attribute containing
++ * NL80211_FREQUENCY_ATTR_*
+ * @NL80211_ATTR_FREQ_AFTER: A channel which has suffered a regulatory change
+- * due to considerations from a beacon hint. This attribute reflects
+- * the state of the channel _after_ the beacon hint processing. This
+- * attributes consists of a nested attribute containing
+- * NL80211_FREQUENCY_ATTR_*
++ * due to considerations from a beacon hint. This attribute reflects
++ * the state of the channel _after_ the beacon hint processing. This
++ * attributes consists of a nested attribute containing
++ * NL80211_FREQUENCY_ATTR_*
+ *
+ * @NL80211_ATTR_CIPHER_SUITES: a set of u32 values indicating the supported
+ * cipher suites
+@@ -1835,7 +1843,7 @@ enum nl80211_commands {
+ * using %CMD_CONTROL_PORT_FRAME. If control port routing over NL80211 is
+ * to be used then userspace must also use the %NL80211_ATTR_SOCKET_OWNER
+ * flag. When used with %NL80211_ATTR_CONTROL_PORT_NO_PREAUTH, pre-auth
+- * frames are not forwared over the control port.
++ * frames are not forwarded over the control port.
+ *
+ * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
+ * We recommend using nested, driver-specific attributes within this.
+@@ -1849,12 +1857,6 @@ enum nl80211_commands {
+ * that protected APs should be used. This is also used with NEW_BEACON to
+ * indicate that the BSS is to use protection.
+ *
+- * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT, ASSOCIATE, and NEW_BEACON
+- * to indicate which unicast key ciphers will be used with the connection
+- * (an array of u32).
+- * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
+- * indicate which group key cipher will be used with the connection (a
+- * u32).
+ * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
+ * indicate which WPA version(s) the AP we want to associate with is using
+ * (a u32 with flags from &enum nl80211_wpa_versions).
+@@ -1885,6 +1887,7 @@ enum nl80211_commands {
+ * with %NL80211_KEY_* sub-attributes
+ *
+ * @NL80211_ATTR_PID: Process ID of a network namespace.
++ * @NL80211_ATTR_NETNS_FD: File descriptor of a network namespace.
+ *
+ * @NL80211_ATTR_GENERATION: Used to indicate consistent snapshots for
+ * dumps. This number increases whenever the object list being
+@@ -1939,6 +1942,7 @@ enum nl80211_commands {
+ *
+ * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
+ * acknowledged by the recipient.
++ * @NL80211_ATTR_ACK_SIGNAL: Station's ack signal strength (s32)
+ *
+ * @NL80211_ATTR_PS_STATE: powersave state, using &enum nl80211_ps_state values.
+ *
+@@ -1972,10 +1976,10 @@ enum nl80211_commands {
+ * bit. Depending on which antennas are selected in the bitmap, 802.11n
+ * drivers can derive which chainmasks to use (if all antennas belonging to
+ * a particular chain are disabled this chain should be disabled) and if
+- * a chain has diversity antennas wether diversity should be used or not.
++ * a chain has diversity antennas whether diversity should be used or not.
+ * HT capabilities (STBC, TX Beamforming, Antenna selection) can be
+ * derived from the available chains after applying the antenna mask.
+- * Non-802.11n drivers can derive wether to use diversity or not.
++ * Non-802.11n drivers can derive whether to use diversity or not.
+ * Drivers may reject configurations or RX/TX mask combinations they cannot
+ * support by returning -EINVAL.
+ *
+@@ -2048,6 +2052,10 @@ enum nl80211_commands {
+ * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported
+ * interface combinations. In each nested item, it contains attributes
+ * defined in &enum nl80211_if_combination_attrs.
++ * If the wiphy uses multiple radios (@NL80211_ATTR_WIPHY_RADIOS is set),
++ * this attribute contains the interface combinations of the first radio.
++ * See @NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS for the global wiphy
++ * combinations for the sum of all radios.
+ * @NL80211_ATTR_SOFTWARE_IFTYPES: Nested attribute (just like
+ * %NL80211_ATTR_SUPPORTED_IFTYPES) containing the interface types that
+ * are managed in software: interfaces of these types aren't subject to
+@@ -2136,6 +2144,9 @@ enum nl80211_commands {
+ * @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_DISABLE_EHT: Force EHT 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.
+@@ -2145,6 +2156,12 @@ enum nl80211_commands {
+ * All values are treated as suggestions and may be ignored
+ * by the driver as required. The actual values may be seen in
+ * the station debugfs ht_caps file.
++ * @NL80211_ATTR_VHT_CAPABILITY_MASK: Specify which bits of the
++ * ATTR_VHT_CAPABILITY to which attention should be paid.
++ * Currently, only mac80211 NICs support this feature.
++ * All values are treated as suggestions and may be ignored
++ * by the driver as required. The actual values may be seen in
++ * the station debugfs vht_caps file.
+ *
+ * @NL80211_ATTR_DFS_REGION: region for regulatory rules which this country
+ * abides to when initiating radiation on DFS channels. A country maps
+@@ -2403,7 +2420,7 @@ enum nl80211_commands {
+ * scheduled scan is started. Or the delay before a WoWLAN
+ * net-detect scan is started, counting from the moment the
+ * system is suspended. This value is a u32, in seconds.
+-
++ *
+ * @NL80211_ATTR_REG_INDOOR: flag attribute, if set indicates that the device
+ * is operating in an indoor environment.
+ *
+@@ -2545,7 +2562,7 @@ enum nl80211_commands {
+ * from successful FILS authentication and is used with
+ * %NL80211_CMD_CONNECT.
+ *
+- * @NL80211_ATTR_FILS_CACHE_ID: A 2-octet identifier advertized by a FILS AP
++ * @NL80211_ATTR_FILS_CACHE_ID: A 2-octet identifier advertised by a FILS AP
+ * identifying the scope of PMKSAs. This is used with
+ * @NL80211_CMD_SET_PMKSA and @NL80211_CMD_DEL_PMKSA.
+ *
+@@ -2826,6 +2843,31 @@ enum nl80211_commands {
+ * @NL80211_ATTR_MLO_LINK_DISABLED: Flag attribute indicating that the link is
+ * disabled.
+ *
++ * @NL80211_ATTR_BSS_DUMP_INCLUDE_USE_DATA: Include BSS usage data, i.e.
++ * include BSSes that can only be used in restricted scenarios and/or
++ * cannot be used at all.
++ *
++ * @NL80211_ATTR_MLO_TTLM_DLINK: Binary attribute specifying the downlink TID to
++ * link mapping. The length is 8 * sizeof(u16). For each TID the link
++ * mapping is as defined in section 9.4.2.314 (TID-To-Link Mapping element)
++ * in Draft P802.11be_D4.0.
++ * @NL80211_ATTR_MLO_TTLM_ULINK: Binary attribute specifying the uplink TID to
++ * link mapping. The length is 8 * sizeof(u16). For each TID the link
++ * mapping is as defined in section 9.4.2.314 (TID-To-Link Mapping element)
++ * in Draft P802.11be_D4.0.
++ *
++ * @NL80211_ATTR_ASSOC_SPP_AMSDU: flag attribute used with
++ * %NL80211_CMD_ASSOCIATE indicating the SPP A-MSDUs
++ * are used on this connection
++ *
++ * @NL80211_ATTR_WIPHY_RADIOS: Nested attribute describing physical radios
++ * belonging to this wiphy. See &enum nl80211_wiphy_radio_attrs.
++ *
++ * @NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS: Nested attribute listing the
++ * supported interface combinations for all radios combined. In each
++ * nested item, it contains attributes defined in
++ * &enum nl80211_if_combination_attrs.
++ *
+ * @NUM_NL80211_ATTR: total number of nl80211_attrs available
+ * @NL80211_ATTR_MAX: highest attribute number currently defined
+ * @__NL80211_ATTR_AFTER_LAST: internal use
+@@ -3364,6 +3406,16 @@ enum nl80211_attrs {
+
+ NL80211_ATTR_MLO_LINK_DISABLED,
+
++ NL80211_ATTR_BSS_DUMP_INCLUDE_USE_DATA,
++
++ NL80211_ATTR_MLO_TTLM_DLINK,
++ NL80211_ATTR_MLO_TTLM_ULINK,
++
++ NL80211_ATTR_ASSOC_SPP_AMSDU,
++
++ NL80211_ATTR_WIPHY_RADIOS,
++ NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS,
++
+ /* add attributes here, update the policy in nl80211.c */
+
+ __NL80211_ATTR_AFTER_LAST,
+@@ -3504,6 +3556,7 @@ enum nl80211_iftype {
+ * @NL80211_STA_FLAG_ASSOCIATED: station is associated; used with drivers
+ * that support %NL80211_FEATURE_FULL_AP_CLIENT_STATE to transition a
+ * previously added station into associated state
++ * @NL80211_STA_FLAG_SPP_AMSDU: station supports SPP A-MSDUs
+ * @NL80211_STA_FLAG_MAX: highest station flag number currently defined
+ * @__NL80211_STA_FLAG_AFTER_LAST: internal use
+ */
+@@ -3516,6 +3569,7 @@ enum nl80211_sta_flags {
+ NL80211_STA_FLAG_AUTHENTICATED,
+ NL80211_STA_FLAG_TDLS_PEER,
+ NL80211_STA_FLAG_ASSOCIATED,
++ NL80211_STA_FLAG_SPP_AMSDU,
+
+ /* keep last */
+ __NL80211_STA_FLAG_AFTER_LAST,
+@@ -3526,7 +3580,7 @@ enum nl80211_sta_flags {
+ * enum nl80211_sta_p2p_ps_status - station support of P2P PS
+ *
+ * @NL80211_P2P_PS_UNSUPPORTED: station doesn't support P2P PS mechanism
+- * @@NL80211_P2P_PS_SUPPORTED: station supports P2P PS mechanism
++ * @NL80211_P2P_PS_SUPPORTED: station supports P2P PS mechanism
+ * @NUM_NL80211_P2P_PS_STATUS: number of values
+ */
+ enum nl80211_sta_p2p_ps_status {
+@@ -3564,9 +3618,9 @@ enum nl80211_he_gi {
+
+ /**
+ * enum nl80211_he_ltf - HE long training field
+- * @NL80211_RATE_INFO_HE_1xLTF: 3.2 usec
+- * @NL80211_RATE_INFO_HE_2xLTF: 6.4 usec
+- * @NL80211_RATE_INFO_HE_4xLTF: 12.8 usec
++ * @NL80211_RATE_INFO_HE_1XLTF: 3.2 usec
++ * @NL80211_RATE_INFO_HE_2XLTF: 6.4 usec
++ * @NL80211_RATE_INFO_HE_4XLTF: 12.8 usec
+ */
+ enum nl80211_he_ltf {
+ NL80211_RATE_INFO_HE_1XLTF,
+@@ -3681,7 +3735,7 @@ enum nl80211_eht_ru_alloc {
+ * @NL80211_RATE_INFO_HE_GI: HE guard interval identifier
+ * (u8, see &enum nl80211_he_gi)
+ * @NL80211_RATE_INFO_HE_DCM: HE DCM value (u8, 0/1)
+- * @NL80211_RATE_INFO_RU_ALLOC: HE RU allocation, if not present then
++ * @NL80211_RATE_INFO_HE_RU_ALLOC: HE RU allocation, if not present then
+ * non-OFDMA was used (u8, see &enum nl80211_he_ru_alloc)
+ * @NL80211_RATE_INFO_320_MHZ_WIDTH: 320 MHz bitrate
+ * @NL80211_RATE_INFO_EHT_MCS: EHT MCS index (u8, 0-15)
+@@ -3784,7 +3838,7 @@ enum nl80211_sta_bss_param {
+ * (u64, to this station)
+ * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm)
+ * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute
+- * containing info as possible, see &enum nl80211_rate_info
++ * containing info as possible, see &enum nl80211_rate_info
+ * @NL80211_STA_INFO_RX_PACKETS: total received packet (MSDUs and MMPDUs)
+ * (u32, from this station)
+ * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (MSDUs and MMPDUs)
+@@ -3813,8 +3867,8 @@ enum nl80211_sta_bss_param {
+ * Contains a nested array of signal strength attributes (u8, dBm)
+ * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average
+ * Same format as NL80211_STA_INFO_CHAIN_SIGNAL.
+- * @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput considering also the
+- * 802.11 header (u32, kbps)
++ * @NL80211_STA_INFO_EXPECTED_THROUGHPUT: expected throughput considering also
++ * the 802.11 header (u32, kbps)
+ * @NL80211_STA_INFO_RX_DROP_MISC: RX packets dropped for unspecified reasons
+ * (u64)
+ * @NL80211_STA_INFO_BEACON_RX: number of beacons received from this peer (u64)
+@@ -4000,7 +4054,7 @@ enum nl80211_mpath_flags {
+ * @NL80211_MPATH_INFO_METRIC: metric (cost) of this mesh path
+ * @NL80211_MPATH_INFO_EXPTIME: expiration time for the path, in msec from now
+ * @NL80211_MPATH_INFO_FLAGS: mesh path flags, enumerated in
+- * &enum nl80211_mpath_flags;
++ * &enum nl80211_mpath_flags;
+ * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
+ * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries
+ * @NL80211_MPATH_INFO_HOP_COUNT: hop count to destination
+@@ -4140,7 +4194,7 @@ enum nl80211_band_attr {
+ * @NL80211_WMMR_CW_MAX: Maximum contention window slot.
+ * @NL80211_WMMR_AIFSN: Arbitration Inter Frame Space.
+ * @NL80211_WMMR_TXOP: Maximum allowed tx operation time.
+- * @nl80211_WMMR_MAX: highest possible wmm rule.
++ * @NL80211_WMMR_MAX: highest possible wmm rule.
+ * @__NL80211_WMMR_LAST: Internal use.
+ */
+ enum nl80211_wmm_rule {
+@@ -4162,15 +4216,16 @@ enum nl80211_wmm_rule {
+ * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
+ * regulatory domain.
+ * @NL80211_FREQUENCY_ATTR_NO_IR: no mechanisms that initiate radiation
+- * are permitted on this channel, this includes sending probe
+- * requests, or modes of operation that require beaconing.
++ * are permitted on this channel, this includes sending probe
++ * requests, or modes of operation that require beaconing.
++ * @__NL80211_FREQUENCY_ATTR_NO_IBSS: obsolete, same as _NO_IR
+ * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
+ * on this channel in current regulatory domain.
+ * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
+ * (100 * dBm).
+ * @NL80211_FREQUENCY_ATTR_DFS_STATE: current state for DFS
+ * (enum nl80211_dfs_state)
+- * @NL80211_FREQUENCY_ATTR_DFS_TIME: time in miliseconds for how long
++ * @NL80211_FREQUENCY_ATTR_DFS_TIME: time in milliseconds for how long
+ * this channel is in this DFS state.
+ * @NL80211_FREQUENCY_ATTR_NO_HT40_MINUS: HT40- isn't possible with this
+ * channel as the control channel
+@@ -4226,6 +4281,19 @@ enum nl80211_wmm_rule {
+ * in current regulatory domain.
+ * @NL80211_FREQUENCY_ATTR_PSD: Power spectral density (in dBm) that
+ * is allowed on this channel in current regulatory domain.
++ * @NL80211_FREQUENCY_ATTR_DFS_CONCURRENT: Operation on this channel is
++ * allowed for peer-to-peer or adhoc communication under the control
++ * of a DFS master which operates on the same channel (FCC-594280 D01
++ * Section B.3). Should be used together with %NL80211_RRF_DFS only.
++ * @NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT: Client connection to VLP AP
++ * not allowed using this channel
++ * @NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT: Client connection to AFC AP
++ * not allowed using this channel
++ * @NL80211_FREQUENCY_ATTR_CAN_MONITOR: This channel can be used in monitor
++ * mode despite other (regulatory) restrictions, even if the channel is
++ * otherwise completely disabled.
++ * @NL80211_FREQUENCY_ATTR_ALLOW_6GHZ_VLP_AP: This channel can be used for a
++ * very low power (VLP) AP, despite being NO_IR.
+ * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
+ * currently defined
+ * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
+@@ -4265,6 +4333,11 @@ enum nl80211_frequency_attr {
+ NL80211_FREQUENCY_ATTR_NO_320MHZ,
+ NL80211_FREQUENCY_ATTR_NO_EHT,
+ NL80211_FREQUENCY_ATTR_PSD,
++ NL80211_FREQUENCY_ATTR_DFS_CONCURRENT,
++ NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT,
++ NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT,
++ NL80211_FREQUENCY_ATTR_CAN_MONITOR,
++ NL80211_FREQUENCY_ATTR_ALLOW_6GHZ_VLP_AP,
+
+ /* keep last */
+ __NL80211_FREQUENCY_ATTR_AFTER_LAST,
+@@ -4277,6 +4350,10 @@ enum nl80211_frequency_attr {
+ #define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR
+ #define NL80211_FREQUENCY_ATTR_GO_CONCURRENT \
+ NL80211_FREQUENCY_ATTR_IR_CONCURRENT
++#define NL80211_FREQUENCY_ATTR_NO_UHB_VLP_CLIENT \
++ NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT
++#define NL80211_FREQUENCY_ATTR_NO_UHB_AFC_CLIENT \
++ NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT
+
+ /**
+ * enum nl80211_bitrate_attr - bitrate attributes
+@@ -4299,16 +4376,16 @@ enum nl80211_bitrate_attr {
+ };
+
+ /**
+- * enum nl80211_initiator - Indicates the initiator of a reg domain request
++ * enum nl80211_reg_initiator - Indicates the initiator of a reg domain request
+ * @NL80211_REGDOM_SET_BY_CORE: Core queried CRDA for a dynamic world
+- * regulatory domain.
++ * regulatory domain.
+ * @NL80211_REGDOM_SET_BY_USER: User asked the wireless core to set the
+- * regulatory domain.
++ * regulatory domain.
+ * @NL80211_REGDOM_SET_BY_DRIVER: a wireless drivers has hinted to the
+- * wireless core it thinks its knows the regulatory domain we should be in.
++ * wireless core it thinks its knows the regulatory domain we should be in.
+ * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an
+- * 802.11 country information element with regulatory information it
+- * thinks we should consider. cfg80211 only processes the country
++ * 802.11 country information element with regulatory information it
++ * thinks we should consider. cfg80211 only processes the country
+ * code from the IE, and relies on the regulatory domain information
+ * structure passed by userspace (CRDA) from our wireless-regdb.
+ * If a channel is enabled but the country code indicates it should
+@@ -4327,11 +4404,11 @@ enum nl80211_reg_initiator {
+ * to a specific country. When this is set you can count on the
+ * ISO / IEC 3166 alpha2 country code being valid.
+ * @NL80211_REGDOM_TYPE_WORLD: the regulatory set domain is the world regulatory
+- * domain.
++ * domain.
+ * @NL80211_REGDOM_TYPE_CUSTOM_WORLD: the regulatory domain set is a custom
+- * driver specific world regulatory domain. These do not apply system-wide
+- * and are only applicable to the individual devices which have requested
+- * them to be applied.
++ * driver specific world regulatory domain. These do not apply system-wide
++ * and are only applicable to the individual devices which have requested
++ * them to be applied.
+ * @NL80211_REGDOM_TYPE_INTERSECTION: the regulatory domain set is the product
+ * of an intersection between two regulatory domains -- the previously
+ * set regulatory domain on the system and the last accepted regulatory
+@@ -4348,21 +4425,21 @@ enum nl80211_reg_type {
+ * enum nl80211_reg_rule_attr - regulatory rule attributes
+ * @__NL80211_REG_RULE_ATTR_INVALID: attribute number 0 is reserved
+ * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional
+- * considerations for a given frequency range. These are the
+- * &enum nl80211_reg_rule_flags.
++ * considerations for a given frequency range. These are the
++ * &enum nl80211_reg_rule_flags.
+ * @NL80211_ATTR_FREQ_RANGE_START: starting frequencry for the regulatory
+- * rule in KHz. This is not a center of frequency but an actual regulatory
+- * band edge.
++ * rule in KHz. This is not a center of frequency but an actual regulatory
++ * band edge.
+ * @NL80211_ATTR_FREQ_RANGE_END: ending frequency for the regulatory rule
+- * in KHz. This is not a center a frequency but an actual regulatory
+- * band edge.
++ * in KHz. This is not a center a frequency but an actual regulatory
++ * band edge.
+ * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this
+ * frequency range, in KHz.
+ * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain
+- * for a given frequency range. The value is in mBi (100 * dBi).
+- * If you don't have one then don't send this.
++ * for a given frequency range. The value is in mBi (100 * dBi).
++ * If you don't have one then don't send this.
+ * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
+- * a given frequency range. The value is in mBm (100 * dBm).
++ * a given frequency range. The value is in mBm (100 * dBm).
+ * @NL80211_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds.
+ * If not present or 0 default CAC time will be used.
+ * @NL80211_ATTR_POWER_RULE_PSD: power spectral density (in dBm).
+@@ -4414,14 +4491,7 @@ enum nl80211_reg_rule_attr {
+ * value as specified by &struct nl80211_bss_select_rssi_adjust.
+ * @NL80211_SCHED_SCAN_MATCH_ATTR_BSSID: BSSID to be used for matching
+ * (this cannot be used together with SSID).
+- * @NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI: Nested attribute that carries the
+- * band specific minimum rssi thresholds for the bands defined in
+- * enum nl80211_band. The minimum rssi threshold value(s32) specific to a
+- * band shall be encapsulated in attribute with type value equals to one
+- * of the NL80211_BAND_* defined in enum nl80211_band. For example, the
+- * minimum rssi threshold value for 2.4GHZ band shall be encapsulated
+- * within an attribute of type NL80211_BAND_2GHZ. And one or more of such
+- * attributes will be nested within this attribute.
++ * @NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI: Obsolete
+ * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
+ * attribute number currently defined
+ * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
+@@ -4434,7 +4504,7 @@ enum nl80211_sched_scan_match_attr {
+ NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI,
+ NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST,
+ NL80211_SCHED_SCAN_MATCH_ATTR_BSSID,
+- NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI,
++ NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI, /* obsolete */
+
+ /* keep last */
+ __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
+@@ -4456,8 +4526,9 @@ enum nl80211_sched_scan_match_attr {
+ * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links
+ * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links
+ * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed,
+- * this includes probe requests or modes of operation that require
+- * beaconing.
++ * this includes probe requests or modes of operation that require
++ * beaconing.
++ * @__NL80211_RRF_NO_IBSS: obsolete, same as NO_IR
+ * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated
+ * base on contiguous rules and wider channels will be allowed to cross
+ * multiple contiguous/overlapping frequency ranges.
+@@ -4470,6 +4541,14 @@ enum nl80211_sched_scan_match_attr {
+ * @NL80211_RRF_NO_320MHZ: 320MHz operation not allowed
+ * @NL80211_RRF_NO_EHT: EHT operation not allowed
+ * @NL80211_RRF_PSD: Ruleset has power spectral density value
++ * @NL80211_RRF_DFS_CONCURRENT: Operation on this channel is allowed for
++ * peer-to-peer or adhoc communication under the control of a DFS master
++ * which operates on the same channel (FCC-594280 D01 Section B.3).
++ * Should be used together with %NL80211_RRF_DFS only.
++ * @NL80211_RRF_NO_6GHZ_VLP_CLIENT: Client connection to VLP AP not allowed
++ * @NL80211_RRF_NO_6GHZ_AFC_CLIENT: Client connection to AFC AP not allowed
++ * @NL80211_RRF_ALLOW_6GHZ_VLP_AP: Very low power (VLP) AP can be permitted
++ * despite NO_IR configuration.
+ */
+ enum nl80211_reg_rule_flags {
+ NL80211_RRF_NO_OFDM = 1<<0,
+@@ -4491,6 +4570,10 @@ enum nl80211_reg_rule_flags {
+ NL80211_RRF_NO_320MHZ = 1<<18,
+ NL80211_RRF_NO_EHT = 1<<19,
+ NL80211_RRF_PSD = 1<<20,
++ NL80211_RRF_DFS_CONCURRENT = 1<<21,
++ NL80211_RRF_NO_6GHZ_VLP_CLIENT = 1<<22,
++ NL80211_RRF_NO_6GHZ_AFC_CLIENT = 1<<23,
++ NL80211_RRF_ALLOW_6GHZ_VLP_AP = 1<<24,
+ };
+
+ #define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
+@@ -4499,6 +4582,8 @@ enum nl80211_reg_rule_flags {
+ #define NL80211_RRF_NO_HT40 (NL80211_RRF_NO_HT40MINUS |\
+ NL80211_RRF_NO_HT40PLUS)
+ #define NL80211_RRF_GO_CONCURRENT NL80211_RRF_IR_CONCURRENT
++#define NL80211_RRF_NO_UHB_VLP_CLIENT NL80211_RRF_NO_6GHZ_VLP_CLIENT
++#define NL80211_RRF_NO_UHB_AFC_CLIENT NL80211_RRF_NO_6GHZ_AFC_CLIENT
+
+ /* For backport compatibility with older userspace */
+ #define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS)
+@@ -4645,8 +4730,8 @@ enum nl80211_mntr_flags {
+ * alternate between Active and Doze states, but may not wake up
+ * for neighbor's beacons.
+ *
+- * @__NL80211_MESH_POWER_AFTER_LAST - internal use
+- * @NL80211_MESH_POWER_MAX - highest possible power save level
++ * @__NL80211_MESH_POWER_AFTER_LAST: internal use
++ * @NL80211_MESH_POWER_MAX: highest possible power save level
+ */
+
+ enum nl80211_mesh_power_mode {
+@@ -5027,6 +5112,36 @@ enum nl80211_bss_scan_width {
+ NL80211_BSS_CHAN_WIDTH_2,
+ };
+
++/**
++ * enum nl80211_bss_use_for - bitmap indicating possible BSS use
++ * @NL80211_BSS_USE_FOR_NORMAL: Use this BSS for normal "connection",
++ * including IBSS/MBSS depending on the type.
++ * @NL80211_BSS_USE_FOR_MLD_LINK: This BSS can be used as a link in an
++ * MLO connection. Note that for an MLO connection, all links including
++ * the assoc link must have this flag set, and the assoc link must
++ * additionally have %NL80211_BSS_USE_FOR_NORMAL set.
++ */
++enum nl80211_bss_use_for {
++ NL80211_BSS_USE_FOR_NORMAL = 1 << 0,
++ NL80211_BSS_USE_FOR_MLD_LINK = 1 << 1,
++};
++
++/**
++ * enum nl80211_bss_cannot_use_reasons - reason(s) connection to a
++ * BSS isn't possible
++ * @NL80211_BSS_CANNOT_USE_NSTR_NONPRIMARY: NSTR nonprimary links aren't
++ * supported by the device, and this BSS entry represents one.
++ * @NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH: STA is not supporting
++ * the AP power type (SP, VLP, AP) that the AP uses.
++ */
++enum nl80211_bss_cannot_use_reasons {
++ NL80211_BSS_CANNOT_USE_NSTR_NONPRIMARY = 1 << 0,
++ NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH = 1 << 1,
++};
++
++#define NL80211_BSS_CANNOT_USE_UHB_PWR_MISMATCH \
++ NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH
++
+ /**
+ * enum nl80211_bss - netlink attributes for a BSS
+ *
+@@ -5079,6 +5194,14 @@ enum nl80211_bss_scan_width {
+ * @NL80211_BSS_FREQUENCY_OFFSET: frequency offset in KHz
+ * @NL80211_BSS_MLO_LINK_ID: MLO link ID of the BSS (u8).
+ * @NL80211_BSS_MLD_ADDR: MLD address of this BSS if connected to it.
++ * @NL80211_BSS_USE_FOR: u32 bitmap attribute indicating what the BSS can be
++ * used for, see &enum nl80211_bss_use_for.
++ * @NL80211_BSS_CANNOT_USE_REASONS: Indicates the reason that this BSS cannot
++ * be used for all or some of the possible uses by the device reporting it,
++ * even though its presence was detected.
++ * This is a u64 attribute containing a bitmap of values from
++ * &enum nl80211_cannot_use_reasons, note that the attribute may be missing
++ * if no reasons are specified.
+ * @__NL80211_BSS_AFTER_LAST: internal
+ * @NL80211_BSS_MAX: highest BSS attribute
+ */
+@@ -5106,6 +5229,8 @@ enum nl80211_bss {
+ NL80211_BSS_FREQUENCY_OFFSET,
+ NL80211_BSS_MLO_LINK_ID,
+ NL80211_BSS_MLD_ADDR,
++ NL80211_BSS_USE_FOR,
++ NL80211_BSS_CANNOT_USE_REASONS,
+
+ /* keep last */
+ __NL80211_BSS_AFTER_LAST,
+@@ -5454,7 +5579,7 @@ enum nl80211_tx_rate_setting {
+ * (%NL80211_TID_CONFIG_ATTR_TIDS, %NL80211_TID_CONFIG_ATTR_OVERRIDE).
+ * @NL80211_TID_CONFIG_ATTR_PEER_SUPP: same as the previous per-vif one, but
+ * per peer instead.
+- * @NL80211_TID_CONFIG_ATTR_OVERRIDE: flag attribue, if set indicates
++ * @NL80211_TID_CONFIG_ATTR_OVERRIDE: flag attribute, if set indicates
+ * that the new configuration overrides all previous peer
+ * configurations, otherwise previous peer specific configurations
+ * should be left untouched.
+@@ -5626,7 +5751,7 @@ struct nl80211_pattern_support {
+ * "TCP connection wakeup" for more details. This is a nested attribute
+ * containing the exact information for establishing and keeping alive
+ * the TCP connection.
+- * @NL80211_WOWLAN_TRIG_TCP_WAKEUP_MATCH: For wakeup reporting only, the
++ * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH: For wakeup reporting only, the
+ * wakeup packet was received on the TCP connection
+ * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST: For wakeup reporting only, the
+ * TCP connection was lost or failed to be established
+@@ -5655,6 +5780,8 @@ struct nl80211_pattern_support {
+ * %NL80211_ATTR_SCAN_FREQUENCIES contains more than one
+ * frequency, it means that the match occurred in more than one
+ * channel.
++ * @NL80211_WOWLAN_TRIG_UNPROTECTED_DEAUTH_DISASSOC: For wakeup reporting only.
++ * Wake up happened due to unprotected deauth or disassoc frame in MFP.
+ * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers
+ * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number
+ *
+@@ -5682,6 +5809,7 @@ enum nl80211_wowlan_triggers {
+ NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS,
+ NL80211_WOWLAN_TRIG_NET_DETECT,
+ NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS,
++ NL80211_WOWLAN_TRIG_UNPROTECTED_DEAUTH_DISASSOC,
+
+ /* keep last */
+ NUM_NL80211_WOWLAN_TRIG,
+@@ -5837,7 +5965,7 @@ enum nl80211_attr_coalesce_rule {
+
+ /**
+ * enum nl80211_coalesce_condition - coalesce rule conditions
+- * @NL80211_COALESCE_CONDITION_MATCH: coalaesce Rx packets when patterns
++ * @NL80211_COALESCE_CONDITION_MATCH: coalesce Rx packets when patterns
+ * in a rule are matched.
+ * @NL80211_COALESCE_CONDITION_NO_MATCH: coalesce Rx packets when patterns
+ * in a rule are not matched.
+@@ -5936,7 +6064,7 @@ enum nl80211_if_combination_attrs {
+ * enum nl80211_plink_state - state of a mesh peer link finite state machine
+ *
+ * @NL80211_PLINK_LISTEN: initial state, considered the implicit
+- * state of non existent mesh peer links
++ * state of non-existent mesh peer links
+ * @NL80211_PLINK_OPN_SNT: mesh plink open frame has been sent to
+ * this mesh peer
+ * @NL80211_PLINK_OPN_RCVD: mesh plink open frame has been received
+@@ -5972,7 +6100,7 @@ enum nl80211_plink_state {
+ * @NL80211_PLINK_ACTION_BLOCK: block traffic from this mesh peer
+ * @NUM_NL80211_PLINK_ACTIONS: number of possible actions
+ */
+-enum plink_actions {
++enum nl80211_plink_action {
+ NL80211_PLINK_ACTION_NO_ACTION,
+ NL80211_PLINK_ACTION_OPEN,
+ NL80211_PLINK_ACTION_BLOCK,
+@@ -6229,7 +6357,7 @@ enum nl80211_feature_flags {
+ * request to use RRM (see %NL80211_ATTR_USE_RRM) with
+ * %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests, which will set
+ * the ASSOC_REQ_USE_RRM flag in the association request even if
+- * NL80211_FEATURE_QUIET is not advertized.
++ * NL80211_FEATURE_QUIET is not advertised.
+ * @NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER: This device supports MU-MIMO air
+ * sniffer which means that it can be configured to hear packets from
+ * certain groups which can be configured by the
+@@ -6241,13 +6369,15 @@ enum nl80211_feature_flags {
+ * the BSS that the interface that requested the scan is connected to
+ * (if available).
+ * @NL80211_EXT_FEATURE_BSS_PARENT_TSF: Per BSS, this driver reports the
+- * time the last beacon/probe was received. The time is the TSF of the
+- * BSS that the interface that requested the scan is connected to
+- * (if available).
++ * time the last beacon/probe was received. For a non-MLO connection, the
++ * time is the TSF of the BSS that the interface that requested the scan is
++ * connected to (if available). For an MLO connection, the time is the TSF
++ * of the BSS corresponding with link ID specified in the scan request (if
++ * specified).
+ * @NL80211_EXT_FEATURE_SET_SCAN_DWELL: This driver supports configuration of
+ * channel dwell time.
+ * @NL80211_EXT_FEATURE_BEACON_RATE_LEGACY: Driver supports beacon rate
+- * configuration (AP/mesh), supporting a legacy (non HT/VHT) rate.
++ * configuration (AP/mesh), supporting a legacy (non-HT/VHT) rate.
+ * @NL80211_EXT_FEATURE_BEACON_RATE_HT: Driver supports beacon rate
+ * configuration (AP/mesh) with HT rates.
+ * @NL80211_EXT_FEATURE_BEACON_RATE_VHT: Driver supports beacon rate
+@@ -6297,6 +6427,7 @@ enum nl80211_feature_flags {
+ * receiving control port frames over nl80211 instead of the netdevice.
+ * @NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT: This driver/device supports
+ * (average) ACK signal strength reporting.
++ * @NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT: Backward-compatible ID
+ * @NL80211_EXT_FEATURE_TXQS: Driver supports FQ-CoDel-enabled intermediate
+ * TXQs.
+ * @NL80211_EXT_FEATURE_SCAN_RANDOM_SN: Driver/device supports randomizing the
+@@ -6321,8 +6452,7 @@ enum nl80211_feature_flags {
+ * @NL80211_EXT_FEATURE_AP_PMKSA_CACHING: Driver/device supports PMKSA caching
+ * (set/del PMKSA operations) in AP mode.
+ *
+- * @NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD: Driver supports
+- * filtering of sched scan results using band specific RSSI thresholds.
++ * @NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD: Obsolete
+ *
+ * @NL80211_EXT_FEATURE_STA_TX_PWR: This driver supports controlling tx power
+ * to a station.
+@@ -6426,6 +6556,16 @@ enum nl80211_feature_flags {
+ * @NL80211_EXT_FEATURE_OWE_OFFLOAD_AP: Driver/Device wants to do OWE DH IE
+ * handling in AP mode.
+ *
++ * @NL80211_EXT_FEATURE_DFS_CONCURRENT: The device supports peer-to-peer or
++ * ad hoc operation on DFS channels under the control of a concurrent
++ * DFS master on the same channel as described in FCC-594280 D01
++ * (Section B.3). This, for example, allows P2P GO and P2P clients to
++ * operate on DFS channels as long as there's a concurrent BSS connection.
++ *
++ * @NL80211_EXT_FEATURE_SPP_AMSDU_SUPPORT: The driver has support for SPP
++ * (signaling and payload protected) A-MSDUs and this shall be advertised
++ * in the RSNXE.
++ *
+ * @NUM_NL80211_EXT_FEATURES: number of extended features.
+ * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
+ */
+@@ -6467,7 +6607,7 @@ enum nl80211_ext_feature_index {
+ NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER,
+ NL80211_EXT_FEATURE_AIRTIME_FAIRNESS,
+ NL80211_EXT_FEATURE_AP_PMKSA_CACHING,
+- NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD,
++ NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD, /* obsolete */
+ NL80211_EXT_FEATURE_EXT_KEY_ID,
+ NL80211_EXT_FEATURE_STA_TX_PWR,
+ NL80211_EXT_FEATURE_SAE_OFFLOAD,
+@@ -6499,6 +6639,8 @@ enum nl80211_ext_feature_index {
+ NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA,
+ NL80211_EXT_FEATURE_OWE_OFFLOAD,
+ NL80211_EXT_FEATURE_OWE_OFFLOAD_AP,
++ NL80211_EXT_FEATURE_DFS_CONCURRENT,
++ NL80211_EXT_FEATURE_SPP_AMSDU_SUPPORT,
+
+ /* add new features before the definition below */
+ NUM_NL80211_EXT_FEATURES,
+@@ -6583,7 +6725,7 @@ enum nl80211_timeout_reason {
+ * request parameters IE in the probe request
+ * @NL80211_SCAN_FLAG_ACCEPT_BCAST_PROBE_RESP: accept broadcast probe responses
+ * @NL80211_SCAN_FLAG_OCE_PROBE_REQ_HIGH_TX_RATE: send probe request frames at
+- * rate of at least 5.5M. In case non OCE AP is discovered in the channel,
++ * rate of at least 5.5M. In case non-OCE AP is discovered in the channel,
+ * only the first probe req in the channel will be sent in high rate.
+ * @NL80211_SCAN_FLAG_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION: allow probe request
+ * tx deferral (dot11FILSProbeDelay shall be set to 15ms)
+@@ -6619,7 +6761,7 @@ enum nl80211_timeout_reason {
+ * received on the 2.4/5 GHz channels to actively scan only the 6GHz
+ * channels on which APs are expected to be found. Note that when not set,
+ * the scan logic would scan all 6GHz channels, but since transmission of
+- * probe requests on non PSC channels is limited, it is highly likely that
++ * probe requests on non-PSC channels is limited, it is highly likely that
+ * these channels would passively be scanned. Also note that when the flag
+ * is set, in addition to the colocated APs, PSC channels would also be
+ * scanned if the user space has asked for it.
+@@ -6669,6 +6811,8 @@ enum nl80211_acl_policy {
+ * @NL80211_SMPS_STATIC: static SMPS (use a single antenna)
+ * @NL80211_SMPS_DYNAMIC: dynamic smps (start with a single antenna and
+ * turn on other antennas after CTS/RTS).
++ * @__NL80211_SMPS_AFTER_LAST: internal
++ * @NL80211_SMPS_MAX: highest used enumeration
+ */
+ enum nl80211_smps_mode {
+ NL80211_SMPS_OFF,
+@@ -6890,6 +7034,8 @@ enum nl80211_bss_select_attr {
+ * @NL80211_NAN_FUNC_PUBLISH: function is publish
+ * @NL80211_NAN_FUNC_SUBSCRIBE: function is subscribe
+ * @NL80211_NAN_FUNC_FOLLOW_UP: function is follow-up
++ * @__NL80211_NAN_FUNC_TYPE_AFTER_LAST: internal use
++ * @NL80211_NAN_FUNC_MAX_TYPE: internal use
+ */
+ enum nl80211_nan_function_type {
+ NL80211_NAN_FUNC_PUBLISH,
+@@ -6951,7 +7097,7 @@ enum nl80211_nan_func_term_reason {
+ * The instance ID for the follow up Service Discovery Frame. This is u8.
+ * @NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID: relevant if the function's type
+ * is follow up. This is a u8.
+- * The requestor instance ID for the follow up Service Discovery Frame.
++ * The requester instance ID for the follow up Service Discovery Frame.
+ * @NL80211_NAN_FUNC_FOLLOW_UP_DEST: the MAC address of the recipient of the
+ * follow up Service Discovery Frame. This is a binary attribute.
+ * @NL80211_NAN_FUNC_CLOSE_RANGE: is this function limited for devices in a
+@@ -7050,7 +7196,7 @@ enum nl80211_nan_match_attributes {
+ };
+
+ /**
+- * nl80211_external_auth_action - Action to perform with external
++ * enum nl80211_external_auth_action - Action to perform with external
+ * authentication request. Used by NL80211_ATTR_EXTERNAL_AUTH_ACTION.
+ * @NL80211_EXTERNAL_AUTH_START: Start the authentication.
+ * @NL80211_EXTERNAL_AUTH_ABORT: Abort the ongoing authentication.
+@@ -7068,7 +7214,7 @@ enum nl80211_external_auth_action {
+ * @NL80211_FTM_RESP_ATTR_LCI: The content of Measurement Report Element
+ * (9.4.2.22 in 802.11-2016) with type 8 - LCI (9.4.2.22.10),
+ * i.e. starting with the measurement token
+- * @NL80211_FTM_RESP_ATTR_CIVIC: The content of Measurement Report Element
++ * @NL80211_FTM_RESP_ATTR_CIVICLOC: The content of Measurement Report Element
+ * (9.4.2.22 in 802.11-2016) with type 11 - Civic (Section 9.4.2.22.13),
+ * i.e. starting with the measurement token
+ * @__NL80211_FTM_RESP_ATTR_LAST: Internal
+@@ -7341,7 +7487,7 @@ enum nl80211_peer_measurement_attrs {
+ * @NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED: flag attribute indicating if
+ * trigger based ranging measurement is supported
+ * @NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED: flag attribute indicating
+- * if non trigger based ranging measurement is supported
++ * if non-trigger-based ranging measurement is supported
+ *
+ * @NUM_NL80211_PMSR_FTM_CAPA_ATTR: internal
+ * @NL80211_PMSR_FTM_CAPA_ATTR_MAX: highest attribute number
+@@ -7395,7 +7541,7 @@ 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_NON_TRIGGER_BASED: request non trigger based
++ * @NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED: request non-trigger-based
+ * ranging measurement (flag)
+ * This attribute and %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED are
+ * mutually exclusive.
+@@ -7473,7 +7619,7 @@ enum nl80211_peer_measurement_ftm_failure_reasons {
+ * @NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS: number of FTM Request frames
+ * transmitted (u32, optional)
+ * @NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES: number of FTM Request frames
+- * that were acknowleged (u32, optional)
++ * that were acknowledged (u32, optional)
+ * @NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME: retry time received from the
+ * busy peer (u32, seconds)
+ * @NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP: actual number of bursts exponent
+@@ -7711,6 +7857,7 @@ enum nl80211_sae_pwe_mechanism {
+ *
+ * @NL80211_SAR_TYPE_POWER: power limitation specified in 0.25dBm unit
+ *
++ * @NUM_NL80211_SAR_TYPE: internal
+ */
+ enum nl80211_sar_type {
+ NL80211_SAR_TYPE_POWER,
+@@ -7724,6 +7871,8 @@ enum nl80211_sar_type {
+ /**
+ * enum nl80211_sar_attrs - Attributes for SAR spec
+ *
++ * @__NL80211_SAR_ATTR_INVALID: Invalid
++ *
+ * @NL80211_SAR_ATTR_TYPE: the SAR type as defined in &enum nl80211_sar_type.
+ *
+ * @NL80211_SAR_ATTR_SPECS: Nested array of SAR power
+@@ -7755,6 +7904,8 @@ enum nl80211_sar_attrs {
+ /**
+ * enum nl80211_sar_specs_attrs - Attributes for SAR power limit specs
+ *
++ * @__NL80211_SAR_ATTR_SPECS_INVALID: Invalid
++ *
+ * @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).
+@@ -7869,4 +8020,54 @@ enum nl80211_ap_settings_flags {
+ NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT = 1 << 1,
+ };
+
++/**
++ * enum nl80211_wiphy_radio_attrs - wiphy radio attributes
++ *
++ * @__NL80211_WIPHY_RADIO_ATTR_INVALID: Invalid
++ *
++ * @NL80211_WIPHY_RADIO_ATTR_INDEX: Index of this radio (u32)
++ * @NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE: Frequency range supported by this
++ * radio. Attribute may be present multiple times.
++ * @NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION: Supported interface
++ * combination for this radio. Attribute may be present multiple times
++ * and contains attributes defined in &enum nl80211_if_combination_attrs.
++ *
++ * @__NL80211_WIPHY_RADIO_ATTR_LAST: Internal
++ * @NL80211_WIPHY_RADIO_ATTR_MAX: Highest attribute
++ */
++enum nl80211_wiphy_radio_attrs {
++ __NL80211_WIPHY_RADIO_ATTR_INVALID,
++
++ NL80211_WIPHY_RADIO_ATTR_INDEX,
++ NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE,
++ NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION,
++
++ /* keep last */
++ __NL80211_WIPHY_RADIO_ATTR_LAST,
++ NL80211_WIPHY_RADIO_ATTR_MAX = __NL80211_WIPHY_RADIO_ATTR_LAST - 1,
++};
++
++/**
++ * enum nl80211_wiphy_radio_freq_range - wiphy radio frequency range
++ *
++ * @__NL80211_WIPHY_RADIO_FREQ_ATTR_INVALID: Invalid
++ *
++ * @NL80211_WIPHY_RADIO_FREQ_ATTR_START: Frequency range start (u32).
++ * The unit is kHz.
++ * @NL80211_WIPHY_RADIO_FREQ_ATTR_END: Frequency range end (u32).
++ * The unit is kHz.
++ *
++ * @__NL80211_WIPHY_RADIO_FREQ_ATTR_LAST: Internal
++ * @NL80211_WIPHY_RADIO_FREQ_ATTR_MAX: Highest attribute
++ */
++enum nl80211_wiphy_radio_freq_range {
++ __NL80211_WIPHY_RADIO_FREQ_ATTR_INVALID,
++
++ NL80211_WIPHY_RADIO_FREQ_ATTR_START,
++ NL80211_WIPHY_RADIO_FREQ_ATTR_END,
++
++ __NL80211_WIPHY_RADIO_FREQ_ATTR_LAST,
++ NL80211_WIPHY_RADIO_FREQ_ATTR_MAX = __NL80211_WIPHY_RADIO_FREQ_ATTR_LAST - 1,
++};
++
+ #endif /* __LINUX_NL80211_H */
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0012-hostapd-make-hostapd_eapol_tx_status-function-static.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0012-hostapd-make-hostapd_eapol_tx_status-function-static.patch
deleted file mode 100644
index 960569b..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0012-hostapd-make-hostapd_eapol_tx_status-function-static.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From ac474b8dc6eb9d6a7562a714c0bbdcda47a3d858 Mon Sep 17 00:00:00 2001
-From: Sriram R <quic_srirrama@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:42 +0530
-Subject: [PATCH 012/104] hostapd: make hostapd_eapol_tx_status() function
- static
-
-hostapd_eapol_tx_status() function is being used only at one place in
-drv_callbacks. However, it is defined in ieee802_11.c which does not
-suit there.
-
-Hence, being the function definition in drv_callbacks.c and make it static.
-
-No functionality changes.
-
-Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/ap/drv_callbacks.c | 25 +++++++++++++++++++++++++
- src/ap/ieee802_11.c | 28 ----------------------------
- src/ap/ieee802_11.h | 2 --
- 3 files changed, 25 insertions(+), 30 deletions(-)
-
-diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
-index 3b24aa4f4..12e6b3f36 100644
---- a/src/ap/drv_callbacks.c
-+++ b/src/ap/drv_callbacks.c
-@@ -2348,6 +2348,31 @@ err:
- }
- #endif /* CONFIG_OWE */
-
-+static void hostapd_eapol_tx_status(struct hostapd_data *hapd, const u8 *dst,
-+ const u8 *data, size_t len, int ack)
-+{
-+ struct sta_info *sta;
-+ struct hostapd_iface *iface = hapd->iface;
-+
-+ sta = ap_get_sta(hapd, dst);
-+ if (sta == NULL && iface->num_bss > 1) {
-+ size_t j;
-+ for (j = 0; j < iface->num_bss; j++) {
-+ hapd = iface->bss[j];
-+ sta = ap_get_sta(hapd, dst);
-+ if (sta)
-+ break;
-+ }
-+ }
-+ if (sta == NULL || !(sta->flags & WLAN_STA_ASSOC)) {
-+ wpa_printf(MSG_DEBUG, "Ignore TX status for Data frame to STA "
-+ MACSTR " that is not currently associated",
-+ MAC2STR(dst));
-+ return;
-+ }
-+
-+ ieee802_1x_eapol_tx_status(hapd, sta, data, len, ack);
-+}
-
- void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
- union wpa_event_data *data)
-diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index 26e3d8356..9f7e9afdd 100644
---- a/src/ap/ieee802_11.c
-+++ b/src/ap/ieee802_11.c
-@@ -6874,34 +6874,6 @@ void hostapd_tx_status(struct hostapd_data *hapd, const u8 *addr,
- ieee802_1x_tx_status(hapd, sta, buf, len, ack);
- }
-
--
--void hostapd_eapol_tx_status(struct hostapd_data *hapd, const u8 *dst,
-- const u8 *data, size_t len, int ack)
--{
-- struct sta_info *sta;
-- struct hostapd_iface *iface = hapd->iface;
--
-- sta = ap_get_sta(hapd, dst);
-- if (sta == NULL && iface->num_bss > 1) {
-- size_t j;
-- for (j = 0; j < iface->num_bss; j++) {
-- hapd = iface->bss[j];
-- sta = ap_get_sta(hapd, dst);
-- if (sta)
-- break;
-- }
-- }
-- if (sta == NULL || !(sta->flags & WLAN_STA_ASSOC)) {
-- wpa_printf(MSG_DEBUG, "Ignore TX status for Data frame to STA "
-- MACSTR " that is not currently associated",
-- MAC2STR(dst));
-- return;
-- }
--
-- ieee802_1x_eapol_tx_status(hapd, sta, data, len, ack);
--}
--
--
- void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr)
- {
- struct sta_info *sta;
-diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h
-index a35486d46..262e0ce14 100644
---- a/src/ap/ieee802_11.h
-+++ b/src/ap/ieee802_11.h
-@@ -132,8 +132,6 @@ int hostapd_get_he_twt_responder(struct hostapd_data *hapd,
- u8 * hostapd_eid_cca(struct hostapd_data *hapd, u8 *eid);
- void hostapd_tx_status(struct hostapd_data *hapd, const u8 *addr,
- const u8 *buf, size_t len, int ack);
--void hostapd_eapol_tx_status(struct hostapd_data *hapd, const u8 *dst,
-- const u8 *data, size_t len, int ack);
- void ieee802_11_rx_from_unknown(struct hostapd_data *hapd, const u8 *src,
- int wds);
- u8 * hostapd_eid_assoc_comeback_time(struct hostapd_data *hapd,
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0029-mtk-hostapd-Add-neighbor-report-and-BSS-Termination-.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0012-mtk-hostapd-Add-neighbor-report-and-BSS-Termination-.patch
similarity index 96%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0029-mtk-hostapd-Add-neighbor-report-and-BSS-Termination-.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0012-mtk-hostapd-Add-neighbor-report-and-BSS-Termination-.patch
index 2d4b438..800f08e 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0029-mtk-hostapd-Add-neighbor-report-and-BSS-Termination-.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0012-mtk-hostapd-Add-neighbor-report-and-BSS-Termination-.patch
@@ -1,7 +1,7 @@
-From 63eb73fe7fe0cb9e088b95cffe4b123885bf9ede Mon Sep 17 00:00:00 2001
+From 91b94ac0deb7a19c0d2288f264e0d9b1c4f3c2e1 Mon Sep 17 00:00:00 2001
From: "howard.hsu" <howard-yh.hsu@mediatek.com>
Date: Wed, 19 Jan 2022 19:18:07 +0800
-Subject: [PATCH 029/104] mtk: hostapd: Add neighbor report and BSS Termination
+Subject: [PATCH 012/126] mtk: hostapd: Add neighbor report and BSS Termination
for MBO certification
1. Add hostapd_neighbor_count() and hostapd_neighbor_insert_buffer ()
@@ -18,6 +18,7 @@
8. Add hostapd_neighbor_set_pref_by_non_pref_chan()
Revert set_send_disassoc_frame_timer
+
---
hostapd/ctrl_iface.c | 5 ++
src/ap/ap_config.c | 1 +
@@ -31,7 +32,7 @@
9 files changed, 221 insertions(+), 5 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index f76226cf4..4240319b7 100644
+index 1d5922fab..f2733687c 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -1300,6 +1300,11 @@ static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd)
@@ -47,10 +48,10 @@
ret = hostapd_set_iface(hapd->iconf, hapd->conf, cmd, value);
if (ret)
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
-index ca67aeb41..6c8b10291 100644
+index 9e34e029a..67661dfe0 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
-@@ -175,6 +175,7 @@ void hostapd_config_defaults_bss(struct hostapd_bss_config *bss)
+@@ -177,6 +177,7 @@ void hostapd_config_defaults_bss(struct hostapd_bss_config *bss)
bss->pasn_comeback_after = 10;
bss->pasn_noauth = 1;
#endif /* CONFIG_PASN */
@@ -59,10 +60,10 @@
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index d10b00be9..379dc22cf 100644
+index 29a9ae7db..25ac22e31 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -560,6 +560,7 @@ struct hostapd_bss_config {
+@@ -572,6 +572,7 @@ struct hostapd_bss_config {
int wnm_sleep_mode;
int wnm_sleep_mode_no_keys;
int bss_transition;
@@ -71,10 +72,10 @@
/* IEEE 802.11u - Interworking */
int interworking;
diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
-index cd7db4fc6..a2f89260c 100644
+index a1ddbda9f..50f993253 100644
--- a/src/ap/ctrl_iface_ap.c
+++ b/src/ap/ctrl_iface_ap.c
-@@ -1377,6 +1377,10 @@ int hostapd_ctrl_iface_bss_tm_req(struct hostapd_data *hapd,
+@@ -1400,6 +1400,10 @@ int hostapd_ctrl_iface_bss_tm_req(struct hostapd_data *hapd,
wpa_printf(MSG_DEBUG, "Invalid bss_term data");
return -1;
}
@@ -85,7 +86,7 @@
end++;
WPA_PUT_LE16(&bss_term_dur[10], atoi(end));
}
-@@ -1403,16 +1407,26 @@ int hostapd_ctrl_iface_bss_tm_req(struct hostapd_data *hapd,
+@@ -1426,16 +1430,26 @@ int hostapd_ctrl_iface_bss_tm_req(struct hostapd_data *hapd,
req_mode |= WNM_BSS_TM_REQ_ESS_DISASSOC_IMMINENT;
}
@@ -437,5 +438,5 @@
if (url) {
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0013-hostapd-MLO-handle-link_id-in-EAPOL-Tx-status-handle.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0013-hostapd-MLO-handle-link_id-in-EAPOL-Tx-status-handle.patch
deleted file mode 100644
index ab69545..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0013-hostapd-MLO-handle-link_id-in-EAPOL-Tx-status-handle.patch
+++ /dev/null
@@ -1,181 +0,0 @@
-From aa339ee77d60fe9314182cf0e60fa2da4da72b44 Mon Sep 17 00:00:00 2001
-From: Sriram R <quic_srirrama@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:43 +0530
-Subject: [PATCH 013/104] hostapd: MLO: handle link_id in EAPOL Tx status
- handler
-
-Add link id support in EAPOL Tx status handler so that event can be
-routed to appropriate link BSS.
-
-In order to support this, modify hostapd_find_by_sta() function to check
-each BSS's other parnter link BSS sta list as well.
-
-Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/ap/drv_callbacks.c | 108 +++++++++++++++--------------------------
- 1 file changed, 38 insertions(+), 70 deletions(-)
-
-diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
-index 12e6b3f36..064c7abae 100644
---- a/src/ap/drv_callbacks.c
-+++ b/src/ap/drv_callbacks.c
-@@ -1945,53 +1945,46 @@ static int hostapd_event_new_sta(struct hostapd_data *hapd, const u8 *addr)
-
-
- static struct hostapd_data * hostapd_find_by_sta(struct hostapd_iface *iface,
-- const u8 *src, bool rsn)
-+ const u8 *src, bool rsn,
-+ struct sta_info **sta_ret)
- {
-+ struct hostapd_data *hapd;
- struct sta_info *sta;
- unsigned int j;
-
-+ if (sta_ret)
-+ *sta_ret = NULL;
-+
- for (j = 0; j < iface->num_bss; j++) {
-- sta = ap_get_sta(iface->bss[j], src);
-+ hapd = iface->bss[j];
-+ sta = ap_get_sta(hapd, src);
- if (sta && (sta->flags & WLAN_STA_ASSOC) &&
-- (!rsn || sta->wpa_sm))
-- return iface->bss[j];
-- }
--
-- return NULL;
--}
--
--
-+ (!rsn || sta->wpa_sm)) {
-+ if (sta_ret)
-+ *sta_ret = sta;
-+ return hapd;
- #ifdef CONFIG_IEEE80211BE
--static bool search_mld_sta(struct hostapd_data **p_hapd, const u8 *src)
--{
-- struct hostapd_data *hapd = *p_hapd;
-- unsigned int i;
--
-- /* Search for STA on other MLO BSSs */
-- for (i = 0; i < hapd->iface->interfaces->count; i++) {
-- struct hostapd_iface *h =
-- hapd->iface->interfaces->iface[i];
-- struct hostapd_data *h_hapd = h->bss[0];
--
-- if (!hostapd_is_ml_partner(h_hapd, hapd))
-- continue;
-+ } else if (hapd->conf->mld_ap) {
-+ struct hostapd_data *p_hapd;
-
-- h_hapd = hostapd_find_by_sta(h, src, false);
-- if (h_hapd) {
-- struct sta_info *sta = ap_get_sta(h_hapd, src);
-+ for_each_mld_link(p_hapd, hapd) {
-+ if (p_hapd == hapd)
-+ continue;
-
-- if (sta && sta->mld_info.mld_sta &&
-- sta->mld_assoc_link_id != h_hapd->mld_link_id)
-- continue;
-- *p_hapd = h_hapd;
-- return true;
-+ sta = ap_get_sta(p_hapd, src);
-+ if (sta && (sta->flags & WLAN_STA_ASSOC) &&
-+ (!rsn || sta->wpa_sm)) {
-+ if (sta_ret)
-+ *sta_ret = sta;
-+ return p_hapd;
-+ }
-+ }
-+#endif /* CONFIG_IEEE80211BE */
- }
- }
-
-- return false;
-+ return NULL;
- }
--#endif /* CONFIG_IEEE80211BE */
--
-
- static void hostapd_event_eapol_rx(struct hostapd_data *hapd, const u8 *src,
- const u8 *data, size_t data_len,
-@@ -2001,28 +1994,10 @@ static void hostapd_event_eapol_rx(struct hostapd_data *hapd, const u8 *src,
- struct hostapd_data *orig_hapd = hapd;
-
- #ifdef CONFIG_IEEE80211BE
-- if (link_id != -1) {
-- struct hostapd_data *h_hapd;
--
-- hapd = switch_link_hapd(hapd, link_id);
-- h_hapd = hostapd_find_by_sta(hapd->iface, src, true);
-- if (!h_hapd)
-- h_hapd = hostapd_find_by_sta(orig_hapd->iface, src,
-- true);
-- if (!h_hapd)
-- h_hapd = hostapd_find_by_sta(hapd->iface, src, false);
-- if (!h_hapd)
-- h_hapd = hostapd_find_by_sta(orig_hapd->iface, src,
-- false);
-- if (h_hapd)
-- hapd = h_hapd;
-- } else if (hapd->conf->mld_ap) {
-- search_mld_sta(&hapd, src);
-- } else {
-- hapd = hostapd_find_by_sta(hapd->iface, src, false);
-- }
-+ hapd = switch_link_hapd(hapd, link_id);
-+ hapd = hostapd_find_by_sta(hapd->iface, src, true, NULL);
- #else /* CONFIG_IEEE80211BE */
-- hapd = hostapd_find_by_sta(hapd->iface, src, false);
-+ hapd = hostapd_find_by_sta(hapd->iface, src, false, NULL);
- #endif /* CONFIG_IEEE80211BE */
-
- if (!hapd) {
-@@ -2349,22 +2324,15 @@ err:
- #endif /* CONFIG_OWE */
-
- static void hostapd_eapol_tx_status(struct hostapd_data *hapd, const u8 *dst,
-- const u8 *data, size_t len, int ack)
-+ const u8 *data, size_t len, int ack,
-+ int link_id)
- {
- struct sta_info *sta;
-- struct hostapd_iface *iface = hapd->iface;
-
-- sta = ap_get_sta(hapd, dst);
-- if (sta == NULL && iface->num_bss > 1) {
-- size_t j;
-- for (j = 0; j < iface->num_bss; j++) {
-- hapd = iface->bss[j];
-- sta = ap_get_sta(hapd, dst);
-- if (sta)
-- break;
-- }
-- }
-- if (sta == NULL || !(sta->flags & WLAN_STA_ASSOC)) {
-+ hapd = switch_link_hapd(hapd, link_id);
-+ hapd = hostapd_find_by_sta(hapd->iface, dst, false, &sta);
-+
-+ if (sta == NULL) {
- wpa_printf(MSG_DEBUG, "Ignore TX status for Data frame to STA "
- MACSTR " that is not currently associated",
- MAC2STR(dst));
-@@ -2431,11 +2399,11 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
- }
- break;
- case EVENT_EAPOL_TX_STATUS:
-- hapd = switch_link_hapd(hapd, data->eapol_tx_status.link_id);
- hostapd_eapol_tx_status(hapd, data->eapol_tx_status.dst,
- data->eapol_tx_status.data,
- data->eapol_tx_status.data_len,
-- data->eapol_tx_status.ack);
-+ data->eapol_tx_status.ack,
-+ data->eapol_tx_status.link_id);
- break;
- case EVENT_DRIVER_CLIENT_POLL_OK:
- hostapd_client_poll_ok(hapd, data->client_poll.addr);
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0013-mtk-hostapd-print-some-sae-info-by-hostapd-ctrl.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0013-mtk-hostapd-print-some-sae-info-by-hostapd-ctrl.patch
new file mode 100644
index 0000000..fdc78e1
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0013-mtk-hostapd-print-some-sae-info-by-hostapd-ctrl.patch
@@ -0,0 +1,112 @@
+From e415e499c9ea0939f0c286c5c0422acbc3491756 Mon Sep 17 00:00:00 2001
+From: Shayne Chen <shayne.chen@mediatek.com>
+Date: Tue, 20 Sep 2022 19:33:45 +0800
+Subject: [PATCH 013/126] mtk: hostapd: print some sae info by hostapd ctrl
+
+root@OpenWrt:~# hostapd_cli -i phy0-ap0 pmksa
+Setup at link 0:
+Index / SPA / PMKID / PMK / expiration (in seconds) / opportunistic
+Setup at link 1:
+Index / SPA / PMKID / PMK / expiration (in seconds) / opportunistic
+0 02:0c:43:b2:01:1c b5706f5f53117e00fa46fcf94c225009 7505eb11319fa94add14d0fd091caadf9be2c642aa7363a96e1efa575e794420 43180 0
+Setup at link 2:
+Index / SPA / PMKID / PMK / expiration (in seconds) / opportunistic
+
+Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
+---
+ hostapd/ctrl_iface.c | 14 ++++++++++++++
+ src/ap/ctrl_iface_ap.c | 22 +++++++++++++++++++++-
+ src/ap/pmksa_cache_auth.c | 5 ++++-
+ 3 files changed, 39 insertions(+), 2 deletions(-)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index f2733687c..2d90d77c6 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -70,6 +70,7 @@
+ #include "fst/fst_ctrl_iface.h"
+ #include "config_file.h"
+ #include "ctrl_iface.h"
++#include "crypto/dh_groups.h"
+
+
+ #define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256
+@@ -1376,6 +1377,19 @@ static int hostapd_ctrl_iface_get(struct hostapd_data *hapd, char *cmd,
+ if (os_snprintf_error(buflen, res))
+ return -1;
+ return res;
++ } else if (os_strcmp(cmd, "sae_group_capability") == 0) {
++#ifdef CONFIG_SAE
++ /* see sae_set_group() */
++ res = os_snprintf(buf, buflen, "%s%s%s%s19 20 21",
++ dh_groups_get(15) ? "15 ": "",
++ dh_groups_get(16) ? "16 ": "",
++ dh_groups_get(17) ? "17 ": "",
++ dh_groups_get(18) ? "18 ": "");
++
++ if (os_snprintf_error(buflen, res))
++ return -1;
++ return res;
++#endif /* CONFIG_SAE */
+ }
+
+ return -1;
+diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
+index 50f993253..4d3c7e529 100644
+--- a/src/ap/ctrl_iface_ap.c
++++ b/src/ap/ctrl_iface_ap.c
+@@ -1157,7 +1157,27 @@ int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
+ int hostapd_ctrl_iface_pmksa_list(struct hostapd_data *hapd, char *buf,
+ size_t len)
+ {
+- return wpa_auth_pmksa_list(hapd->wpa_auth, buf, len);
++ char *pos = buf;
++ int ret, link_id;
++
++ if (!hapd->conf->mld_ap)
++ return wpa_auth_pmksa_list(hapd->wpa_auth, buf, len);
++
++ for (link_id = 0; link_id < MAX_NUM_MLD_LINKS; link_id++) {
++ struct hostapd_data *h = hostapd_mld_get_link_bss(hapd, link_id);
++
++ if (!h)
++ continue;
++
++ ret = os_snprintf(pos, len - (pos - buf), "Setup at link %u:\n", h->mld_link_id);
++ if (os_snprintf_error(len - (pos - buf), ret))
++ return pos - buf;
++ pos += ret;
++
++ pos += wpa_auth_pmksa_list(h->wpa_auth, pos, len - (pos - buf));
++ }
++
++ return pos - buf;
+ }
+
+
+diff --git a/src/ap/pmksa_cache_auth.c b/src/ap/pmksa_cache_auth.c
+index 2fce8383d..8a63cb682 100644
+--- a/src/ap/pmksa_cache_auth.c
++++ b/src/ap/pmksa_cache_auth.c
+@@ -658,7 +658,7 @@ int pmksa_cache_auth_list(struct rsn_pmksa_cache *pmksa, char *buf, size_t len)
+
+ os_get_reltime(&now);
+ ret = os_snprintf(pos, buf + len - pos,
+- "Index / SPA / PMKID / expiration (in seconds) / opportunistic\n");
++ "Index / SPA / PMKID / PMK / expiration (in seconds) / opportunistic\n");
+ if (os_snprintf_error(buf + len - pos, ret))
+ return pos - buf;
+ pos += ret;
+@@ -672,6 +672,9 @@ int pmksa_cache_auth_list(struct rsn_pmksa_cache *pmksa, char *buf, size_t len)
+ pos += ret;
+ pos += wpa_snprintf_hex(pos, buf + len - pos, entry->pmkid,
+ PMKID_LEN);
++ *pos++ = ' ';
++ pos += wpa_snprintf_hex(pos, buf + len - pos, entry->pmk,
++ entry->pmk_len);
+ ret = os_snprintf(pos, buf + len - pos, " %d %d\n",
+ (int) (entry->expiration - now.sec),
+ entry->opportunistic);
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0014-hostapd-MLO-update-all-partner-s-link-beacon.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0014-hostapd-MLO-update-all-partner-s-link-beacon.patch
deleted file mode 100644
index 0cec211..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0014-hostapd-MLO-update-all-partner-s-link-beacon.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From 4be307ebbc6b94b6a334855a9efe633d77ca98fe Mon Sep 17 00:00:00 2001
-From: Sriram R <quic_srirrama@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:44 +0530
-Subject: [PATCH 014/104] hostapd: MLO: update all partner's link beacon
-
-Whenever there is a beacon update of any one of the link, all its other
-partner's link beacon should be refreshed.
-
-Add changes to update all partner's link beacon.
-
-Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/ap/beacon.c | 27 +++++++++++++++++++--------
- 1 file changed, 19 insertions(+), 8 deletions(-)
-
-diff --git a/src/ap/beacon.c b/src/ap/beacon.c
-index 195c7bbd9..b780d98e4 100644
---- a/src/ap/beacon.c
-+++ b/src/ap/beacon.c
-@@ -2648,7 +2648,7 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
- struct hostapd_iface *iface = hapd->iface;
- int ret;
- size_t i, j;
-- bool is_6g;
-+ bool is_6g, hapd_mld = false;
-
- ret = __ieee802_11_set_beacon(hapd);
- if (ret != 0)
-@@ -2657,26 +2657,37 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
- if (!iface->interfaces || iface->interfaces->count <= 1)
- return 0;
-
-+#ifdef CONFIG_IEEE80211BE
-+ hapd_mld = hapd->conf->mld_ap;
-+#endif /* CONFIG_IEEE80211BE */
-+
- /* Update Beacon frames in case of 6 GHz colocation or AP MLD */
- is_6g = is_6ghz_op_class(iface->conf->op_class);
- for (j = 0; j < iface->interfaces->count; j++) {
- struct hostapd_iface *other;
-- bool mld_ap = false;
-+ bool other_iface_6g;
-
- other = iface->interfaces->iface[j];
- if (other == iface || !other || !other->conf)
- continue;
-
--#ifdef CONFIG_IEEE80211BE
-- if (hostapd_is_ml_partner(hapd, other->bss[0]))
-- mld_ap = true;
--#endif /* CONFIG_IEEE80211BE */
-+ other_iface_6g = is_6ghz_op_class(other->conf->op_class);
-
-- if (is_6g == is_6ghz_op_class(other->conf->op_class) &&
-- !mld_ap)
-+ if (is_6g == other_iface_6g && !hapd_mld)
- continue;
-
- for (i = 0; i < other->num_bss; i++) {
-+#ifdef CONFIG_IEEE80211BE
-+ bool mld_ap = false;
-+
-+ if (hapd_mld && other->bss[i]->conf->mld_ap &&
-+ hostapd_is_ml_partner(hapd, other->bss[i]))
-+ mld_ap = true;
-+
-+ if (is_6g == other_iface_6g && !mld_ap)
-+ continue;
-+#endif /* CONFIG_IEEE80211BE */
-+
- if (other->bss[i] && other->bss[i]->started)
- __ieee802_11_set_beacon(other->bss[i]);
- }
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0031-mtk-hostapd-add-support-for-runtime-set-in-band-disc.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0014-mtk-hostapd-add-support-for-runtime-set-in-band-disc.patch
similarity index 82%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0031-mtk-hostapd-add-support-for-runtime-set-in-band-disc.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0014-mtk-hostapd-add-support-for-runtime-set-in-band-disc.patch
index b149bda..97cf42b 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0031-mtk-hostapd-add-support-for-runtime-set-in-band-disc.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0014-mtk-hostapd-add-support-for-runtime-set-in-band-disc.patch
@@ -1,7 +1,7 @@
-From 5453bd56aa134865ecaab20bde482b6c389831cb Mon Sep 17 00:00:00 2001
+From 05ca0e1db230ecd668db4597ac1ef1d937459ea3 Mon Sep 17 00:00:00 2001
From: MeiChia Chiu <meichia.chiu@mediatek.com>
Date: Tue, 31 May 2022 21:15:54 +0800
-Subject: [PATCH 031/104] mtk: hostapd: add support for runtime set in-band
+Subject: [PATCH 014/126] mtk: hostapd: add support for runtime set in-band
discovery
Usage:
@@ -11,10 +11,8 @@
1: enable unsolicited probe response
2: enable FILS discovery
-Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
-
-The mac80211 layer already has a new variable "update",
-so the redundant variable "disable" has been removed.
+The mac80211 layer already has a new variable update,
+so the redundant variable disable has been removed.
Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
---
@@ -25,10 +23,10 @@
4 files changed, 94 insertions(+), 3 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 1f950bc46..fb9f09bb1 100644
+index 2d90d77c6..40244c5e7 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -772,6 +772,69 @@ static int hostapd_ctrl_iface_send_qos_map_conf(struct hostapd_data *hapd,
+@@ -773,6 +773,69 @@ static int hostapd_ctrl_iface_send_qos_map_conf(struct hostapd_data *hapd,
#endif /* CONFIG_INTERWORKING */
@@ -98,7 +96,7 @@
#ifdef CONFIG_WNM_AP
-@@ -4045,6 +4108,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4175,6 +4238,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
if (hostapd_ctrl_iface_coloc_intf_req(hapd, buf + 15))
reply_len = -1;
#endif /* CONFIG_WNM_AP */
@@ -109,10 +107,10 @@
reply_len = hostapd_ctrl_iface_get_config(hapd, reply,
reply_size);
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index a469b1f4d..1fb6d999e 100644
+index ebf8addc1..bb15bc751 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -655,6 +655,24 @@ static int hostapd_cli_cmd_wps_config(struct wpa_ctrl *ctrl, int argc,
+@@ -664,6 +664,24 @@ static int hostapd_cli_cmd_wps_config(struct wpa_ctrl *ctrl, int argc,
return wpa_ctrl_command(ctrl, buf);
}
@@ -137,7 +135,7 @@
static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
char *argv[])
-@@ -1851,6 +1869,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1883,6 +1901,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
{ "driver", hostapd_cli_cmd_driver, NULL,
"<driver sub command> [<hex formatted data>] = send driver command data" },
#endif /* ANDROID */
@@ -147,33 +145,33 @@
};
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
-index 26453cb2c..a5c46b067 100644
+index 58b561661..9bf73747f 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
-@@ -2055,6 +2055,8 @@ static u8 * hostapd_fils_discovery(struct hostapd_data *hapd,
+@@ -2164,6 +2164,8 @@ static u8 * hostapd_fils_discovery(struct hostapd_data *hapd,
struct wpa_driver_ap_params *params)
{
params->fd_max_int = hapd->conf->fils_discovery_max_int;
-+ params->unsol_bcast_probe_resp_interval =
++ params->ubpr.unsol_bcast_probe_resp_interval =
+ hapd->conf->unsol_bcast_probe_resp_interval;
if (is_6ghz_op_class(hapd->iconf->op_class) &&
params->fd_max_int > FD_MAX_INTERVAL_6GHZ)
params->fd_max_int = FD_MAX_INTERVAL_6GHZ;
-@@ -2063,7 +2065,8 @@ static u8 * hostapd_fils_discovery(struct hostapd_data *hapd,
+@@ -2172,7 +2174,8 @@ static u8 * hostapd_fils_discovery(struct hostapd_data *hapd,
if (params->fd_min_int > params->fd_max_int)
params->fd_min_int = params->fd_max_int;
- if (params->fd_max_int)
+ if (params->fd_max_int || (is_6ghz_op_class(hapd->iconf->op_class) &&
-+ !params->unsol_bcast_probe_resp_interval))
++ !params->ubpr.unsol_bcast_probe_resp_interval))
return hostapd_gen_fils_discovery(hapd,
¶ms->fd_frame_tmpl_len);
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 6778ad369..501d0e42e 100644
+index a70eaae38..2c68bf997 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -4780,7 +4780,6 @@ static int nl80211_fils_discovery(struct i802_bss *bss, struct nl_msg *msg,
+@@ -4790,7 +4790,6 @@ static int nl80211_fils_discovery(struct i802_bss *bss, struct nl_msg *msg,
nla_put(msg, NL80211_FILS_DISCOVERY_ATTR_TMPL,
params->fd_frame_tmpl_len, params->fd_frame_tmpl)))
return -1;
@@ -181,18 +179,18 @@
nla_nest_end(msg, attr);
return 0;
}
-@@ -5412,7 +5411,10 @@ static int wpa_driver_nl80211_set_ap(void *priv,
+@@ -5422,7 +5421,10 @@ static int wpa_driver_nl80211_set_ap(void *priv,
#endif /* CONFIG_SAE */
#ifdef CONFIG_FILS
- if (params->fd_max_int && nl80211_fils_discovery(bss, msg, params) < 0)
+ if ((params->fd_max_int ||
+ ((params->freq->freq > 5950 && params->freq->freq <= 7115) &&
-+ !(params->unsol_bcast_probe_resp_interval))) &&
++ !(params->ubpr.unsol_bcast_probe_resp_interval))) &&
+ nl80211_fils_discovery(bss, msg, params) < 0)
goto fail;
#endif /* CONFIG_FILS */
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0015-hostapd-MLO-skip-assoc-link-processing-in-ML-info.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0015-hostapd-MLO-skip-assoc-link-processing-in-ML-info.patch
deleted file mode 100644
index 3dd5690..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0015-hostapd-MLO-skip-assoc-link-processing-in-ML-info.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 6eeca68d65795783243d3634627b4ac8f79e3d15 Mon Sep 17 00:00:00 2001
-From: Aditya Kumar Singh <quic_adisi@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:45 +0530
-Subject: [PATCH 015/104] hostapd: MLO: skip assoc link processing in ML info
-
-Currently during processing ML info in association request, all links are
-iterated over. However, the assoc link info will not be present in the
-ML info hence following print is observed during ML association (assoc link
-is 1) -
-
-MLD: No link match for link_id=1
-
-Add changes to skip processing for the assoc link. No functionality
-changes.
-
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/ap/ieee802_11.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index 9f7e9afdd..39c63f29b 100644
---- a/src/ap/ieee802_11.c
-+++ b/src/ap/ieee802_11.c
-@@ -4586,7 +4586,7 @@ int hostapd_process_assoc_ml_info(struct hostapd_data *hapd,
- struct mld_link_info *link = &sta->mld_info.links[i];
- bool link_bss_found = false;
-
-- if (!link->valid)
-+ if (!link->valid || i == sta->mld_assoc_link_id)
- continue;
-
- for_each_mld_link(bss, hapd) {
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0032-mtk-hostapd-Add-mtk_vendor.h.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0015-mtk-hostapd-Add-mtk_vendor.h.patch
similarity index 97%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0032-mtk-hostapd-Add-mtk_vendor.h.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0015-mtk-hostapd-Add-mtk_vendor.h.patch
index e93390d..ef346f2 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0032-mtk-hostapd-Add-mtk_vendor.h.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0015-mtk-hostapd-Add-mtk_vendor.h.patch
@@ -1,7 +1,7 @@
-From 5be34a5e9682f4448e41322dc4f96d5d9a58240e Mon Sep 17 00:00:00 2001
+From e37c0f7888fefa1d8367209dd89dc18ab63c4711 Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Mon, 30 May 2022 15:04:57 +0800
-Subject: [PATCH 032/104] mtk: hostapd: Add mtk_vendor.h
+Subject: [PATCH 015/126] mtk: hostapd: Add mtk_vendor.h
---
src/common/mtk_vendor.h | 197 ++++++++++++++++++++++++++++++++++++++++
@@ -212,5 +212,5 @@
+};
+#endif /* MTK_VENDOR_H */
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0016-hostapd-MLO-Enhance-wpa-state-machine.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0016-hostapd-MLO-Enhance-wpa-state-machine.patch
deleted file mode 100644
index 0c17b68..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0016-hostapd-MLO-Enhance-wpa-state-machine.patch
+++ /dev/null
@@ -1,335 +0,0 @@
-From 11cfbaf42eaadf0fd7b50d13f0b7664c1675dc11 Mon Sep 17 00:00:00 2001
-From: Rameshkumar Sundaram <quic_ramess@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:46 +0530
-Subject: [PATCH 016/104] hostapd: MLO: Enhance wpa state machine
-
-Add required ML Specific members in wpa_authenticator and struct
-wpa_state_machine to maintain self and partner link information.
-
-Maintain state machine object in all associated link stations and
-destroy/remove references from the same whenever link stations are getting
-removed.
-
-Increase the wpa_group object reference count for all links in which ML
-station is getting associated and release the same whenever link stations
-are getting removed.
-
-Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/ap/ieee802_11.c | 9 ++--
- src/ap/sta_info.c | 35 ++++++++++++++-
- src/ap/wpa_auth.c | 101 +++++++++++++++++++++++++++++++++++++++++---
- src/ap/wpa_auth.h | 16 +++++++
- src/ap/wpa_auth_i.h | 8 ++++
- 5 files changed, 159 insertions(+), 10 deletions(-)
-
-diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index 39c63f29b..9d04bdf43 100644
---- a/src/ap/ieee802_11.c
-+++ b/src/ap/ieee802_11.c
-@@ -4467,6 +4467,8 @@ static int ieee80211_ml_process_link(struct hostapd_data *hapd,
- }
-
- sta->flags |= origin_sta->flags | WLAN_STA_ASSOC_REQ_OK;
-+ sta->mld_assoc_link_id = origin_sta->mld_assoc_link_id;
-+
- status = __check_assoc_ies(hapd, sta, NULL, 0, &elems, reassoc, true);
- if (status != WLAN_STATUS_SUCCESS) {
- wpa_printf(MSG_DEBUG, "MLD: link: Element check failed");
-@@ -4474,7 +4476,6 @@ static int ieee80211_ml_process_link(struct hostapd_data *hapd,
- }
-
- ap_sta_set_mld(sta, true);
-- sta->mld_assoc_link_id = origin_sta->mld_assoc_link_id;
-
- os_memcpy(&sta->mld_info, &origin_sta->mld_info, sizeof(sta->mld_info));
- for (i = 0; i < MAX_NUM_MLD_LINKS; i++) {
-@@ -4501,9 +4502,11 @@ static int ieee80211_ml_process_link(struct hostapd_data *hapd,
- ieee802_11_update_beacons(hapd->iface);
- }
-
-- /* RSN Authenticator should always be the one on the original station */
-+ /* Maintain state machine reference on all link STAs, this is needed
-+ * during Group rekey handling.
-+ */
- wpa_auth_sta_deinit(sta->wpa_sm);
-- sta->wpa_sm = NULL;
-+ sta->wpa_sm = origin_sta->wpa_sm;
-
- /*
- * Do not initialize the EAPOL state machine.
-diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
-index 2423ff189..d483aa9d3 100644
---- a/src/ap/sta_info.c
-+++ b/src/ap/sta_info.c
-@@ -199,6 +199,26 @@ static void __ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
- hostapd_drv_sta_remove(hapd, sta->addr);
- }
-
-+#ifdef CONFIG_IEEE80211BE
-+static void set_for_each_partner_link_sta(struct hostapd_data *hapd,
-+ struct sta_info *psta, void *data)
-+{
-+ struct sta_info *lsta;
-+ struct hostapd_data *lhapd;
-+
-+ if (!ap_sta_is_mld(hapd, psta))
-+ return;
-+
-+ for_each_mld_link(lhapd, hapd) {
-+ if (lhapd == hapd)
-+ continue;
-+
-+ lsta = ap_get_sta(lhapd, psta->addr);
-+ if (lsta)
-+ lsta->wpa_sm = data;
-+ }
-+}
-+#endif /* CONFIG_IEEE80211BE */
-
- void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
- {
-@@ -317,8 +337,17 @@ void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
-
- #ifdef CONFIG_IEEE80211BE
- if (!ap_sta_is_mld(hapd, sta) ||
-- hapd->mld_link_id == sta->mld_assoc_link_id)
-+ hapd->mld_link_id == sta->mld_assoc_link_id) {
- wpa_auth_sta_deinit(sta->wpa_sm);
-+ /* Remove refrences from partner links. */
-+ set_for_each_partner_link_sta(hapd, sta, NULL);
-+ }
-+
-+ /* Release group references in case non assoc link STA is removed
-+ * before assoc link STA
-+ */
-+ if (hostapd_sta_is_link_sta(hapd, sta))
-+ wpa_release_link_auth_ref(sta->wpa_sm, hapd->mld_link_id);
- #else
- wpa_auth_sta_deinit(sta->wpa_sm);
- #endif /* CONFIG_IEEE80211BE */
-@@ -903,8 +932,10 @@ static void ap_sta_disconnect_common(struct hostapd_data *hapd,
- ieee802_1x_free_station(hapd, sta);
- #ifdef CONFIG_IEEE80211BE
- if (!hapd->conf->mld_ap ||
-- hapd->mld_link_id == sta->mld_assoc_link_id)
-+ hapd->mld_link_id == sta->mld_assoc_link_id) {
- wpa_auth_sta_deinit(sta->wpa_sm);
-+ set_for_each_partner_link_sta(hapd, sta, NULL);
-+ }
- #else
- wpa_auth_sta_deinit(sta->wpa_sm);
- #endif /* CONFIG_IEEE80211BE */
-diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
-index 0d15c4209..8c1052c25 100644
---- a/src/ap/wpa_auth.c
-+++ b/src/ap/wpa_auth.c
-@@ -102,6 +102,59 @@ static const u8 * wpa_auth_get_spa(const struct wpa_state_machine *sm)
- return sm->addr;
- }
-
-+#ifdef CONFIG_IEEE80211BE
-+void wpa_release_link_auth_ref(struct wpa_state_machine *sm, int release_link_id)
-+{
-+ int link_id;
-+
-+ if (!sm || release_link_id >= MAX_NUM_MLD_LINKS)
-+ return;
-+
-+ for_each_sm_auth(sm, link_id)
-+ if (link_id == release_link_id) {
-+ wpa_group_put(sm->mld_links[link_id].wpa_auth,
-+ sm->mld_links[link_id].wpa_auth->group);
-+ sm->mld_links[link_id].wpa_auth = NULL;
-+ }
-+}
-+
-+static int wpa_get_link_sta_auth(struct wpa_authenticator *wpa_auth, void *data)
-+{
-+ struct wpa_get_link_auth_ctx *ctx = data;
-+
-+ if (os_memcmp(wpa_auth->addr, ctx->addr, ETH_ALEN) != 0)
-+ return 0;
-+ ctx->wpa_auth = wpa_auth;
-+ return 1;
-+}
-+
-+static int wpa_get_primary_wpa_auth_cb(struct wpa_authenticator *wpa_auth, void *data)
-+{
-+ struct wpa_get_link_auth_ctx *ctx = data;
-+
-+ if (!wpa_auth->is_ml || os_memcmp(wpa_auth->mld_addr, ctx->addr, ETH_ALEN) != 0 ||
-+ !wpa_auth->primary_auth)
-+ return 0;
-+
-+ ctx->wpa_auth = wpa_auth;
-+ return 1;
-+}
-+
-+static struct wpa_authenticator *
-+wpa_get_primary_wpa_auth(struct wpa_authenticator *wpa_auth)
-+{
-+ struct wpa_get_link_auth_ctx ctx;
-+
-+ if (!wpa_auth || !wpa_auth->is_ml || wpa_auth->primary_auth)
-+ return wpa_auth;
-+
-+ ctx.addr = wpa_auth->mld_addr;
-+ ctx.wpa_auth = NULL;
-+ wpa_auth_for_each_auth(wpa_auth, wpa_get_primary_wpa_auth_cb, &ctx);
-+
-+ return ctx.wpa_auth;
-+}
-+#endif /* CONFIG_IEEE80211BE */
-
- static inline int wpa_auth_mic_failure_report(
- struct wpa_authenticator *wpa_auth, const u8 *addr)
-@@ -798,6 +851,10 @@ void wpa_auth_sta_no_wpa(struct wpa_state_machine *sm)
-
- static void wpa_free_sta_sm(struct wpa_state_machine *sm)
- {
-+#ifdef CONFIG_IEEE80211BE
-+ int link_id;
-+#endif /* CONFIG_IEEE80211BE */
-+
- #ifdef CONFIG_P2P
- if (WPA_GET_BE32(sm->ip_addr)) {
- wpa_printf(MSG_DEBUG,
-@@ -821,6 +878,13 @@ static void wpa_free_sta_sm(struct wpa_state_machine *sm)
- os_free(sm->last_rx_eapol_key);
- os_free(sm->wpa_ie);
- os_free(sm->rsnxe);
-+#ifdef CONFIG_IEEE80211BE
-+ for_each_sm_auth(sm, link_id) {
-+ wpa_group_put(sm->mld_links[link_id].wpa_auth,
-+ sm->mld_links[link_id].wpa_auth->group);
-+ sm->mld_links[link_id].wpa_auth = NULL;
-+ }
-+#endif /* CONFIG_IEEE80211BE */
- wpa_group_put(sm->wpa_auth, sm->group);
- #ifdef CONFIG_DPP2
- wpabuf_clear_free(sm->dpp_z);
-@@ -831,7 +895,7 @@ static void wpa_free_sta_sm(struct wpa_state_machine *sm)
-
- void wpa_auth_sta_deinit(struct wpa_state_machine *sm)
- {
-- struct wpa_authenticator *wpa_auth;
-+ struct wpa_authenticator *wpa_auth, *primary_wpa_auth;
-
- if (!sm)
- return;
-@@ -840,10 +904,18 @@ void wpa_auth_sta_deinit(struct wpa_state_machine *sm)
- if (wpa_auth->conf.wpa_strict_rekey && sm->has_GTK) {
- wpa_auth_logger(wpa_auth, wpa_auth_get_spa(sm), LOGGER_DEBUG,
- "strict rekeying - force GTK rekey since STA is leaving");
-+
-+#ifdef CONFIG_IEEE80211BE
-+ if (wpa_auth->is_ml && !wpa_auth->primary_auth)
-+ primary_wpa_auth = wpa_get_primary_wpa_auth(wpa_auth);
-+ else
-+#endif /* CONFIG_IEEE80211BE */
-+ primary_wpa_auth = wpa_auth;
-+
- if (eloop_deplete_timeout(0, 500000, wpa_rekey_gtk,
-- wpa_auth, NULL) == -1)
-+ primary_wpa_auth, NULL) == -1)
- eloop_register_timeout(0, 500000, wpa_rekey_gtk,
-- wpa_auth, NULL);
-+ primary_wpa_auth, NULL);
- }
-
- eloop_cancel_timeout(wpa_send_eapol_timeout, wpa_auth, sm);
-@@ -6835,6 +6907,7 @@ void wpa_auth_set_ml_info(struct wpa_state_machine *sm, const u8 *mld_addr,
- for (i = 0, link_id = 0; link_id < MAX_NUM_MLD_LINKS; link_id++) {
- struct mld_link_info *link = &info->links[link_id];
- struct mld_link *sm_link = &sm->mld_links[link_id];
-+ struct wpa_get_link_auth_ctx ctx;
-
- sm_link->valid = link->valid;
- if (!link->valid)
-@@ -6849,10 +6922,28 @@ void wpa_auth_set_ml_info(struct wpa_state_machine *sm, const u8 *mld_addr,
- MAC2STR(sm_link->own_addr),
- MAC2STR(sm_link->peer_addr));
-
-- if (link_id != mld_assoc_link_id)
-+ ml_rsn_info.links[i++].link_id = link_id;
-+
-+ if (link_id != mld_assoc_link_id) {
- sm->n_mld_affiliated_links++;
-+ ctx.addr = link->local_addr;
-+ ctx.wpa_auth = NULL;
-+ wpa_auth_for_each_auth(sm->wpa_auth, wpa_get_link_sta_auth, &ctx);
-+
-+ if (ctx.wpa_auth) {
-+ sm_link->wpa_auth = ctx.wpa_auth;
-+ wpa_group_get(sm_link->wpa_auth,
-+ sm_link->wpa_auth->group);
-+ }
-+ } else {
-+ sm_link->wpa_auth = sm->wpa_auth;
-+ }
-
-- ml_rsn_info.links[i++].link_id = link_id;
-+ if (!sm_link->wpa_auth)
-+ wpa_printf(MSG_ERROR, "Unable to find authenticator object for "
-+ "ML STA " MACSTR " on link " MACSTR " link id %d",
-+ MAC2STR(sm->own_mld_addr), MAC2STR(sm_link->own_addr),
-+ link_id);
- }
-
- ml_rsn_info.n_mld_links = i;
-diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h
-index c74862307..1446872f3 100644
---- a/src/ap/wpa_auth.h
-+++ b/src/ap/wpa_auth.h
-@@ -647,4 +647,20 @@ void wpa_auth_ml_get_key_info(struct wpa_authenticator *a,
- struct wpa_auth_ml_link_key_info *info,
- bool mgmt_frame_prot, bool beacon_prot);
-
-+#ifdef CONFIG_IEEE80211BE
-+void wpa_release_link_auth_ref(struct wpa_state_machine *sm,
-+ int release_link_id);
-+
-+#define for_each_sm_auth(sm, link_id) \
-+ for (link_id = 0; link_id < MAX_NUM_MLD_LINKS; link_id++) \
-+ if (sm->mld_links[link_id].valid && \
-+ sm->mld_links[link_id].wpa_auth && \
-+ sm->wpa_auth != sm->mld_links[link_id].wpa_auth) \
-+
-+struct wpa_get_link_auth_ctx {
-+ u8 *addr;
-+ struct wpa_authenticator *wpa_auth;
-+};
-+#endif /* CONFIG_IEEE80211BE */
-+
- #endif /* WPA_AUTH_H */
-diff --git a/src/ap/wpa_auth_i.h b/src/ap/wpa_auth_i.h
-index 9ba830415..9ba90749d 100644
---- a/src/ap/wpa_auth_i.h
-+++ b/src/ap/wpa_auth_i.h
-@@ -186,6 +186,7 @@ struct wpa_state_machine {
- size_t rsne_len;
- const u8 *rsnxe;
- size_t rsnxe_len;
-+ struct wpa_authenticator *wpa_auth;
- } mld_links[MAX_NUM_MLD_LINKS];
- #endif /* CONFIG_IEEE80211BE */
- };
-@@ -262,6 +263,13 @@ struct wpa_authenticator {
- #ifdef CONFIG_P2P
- struct bitfield *ip_pool;
- #endif /* CONFIG_P2P */
-+
-+#ifdef CONFIG_IEEE80211BE
-+ bool is_ml;
-+ u8 mld_addr[ETH_ALEN];
-+ u8 link_id;
-+ bool primary_auth;
-+#endif /* CONFIG_IEEE80211BE */
- };
-
-
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0033-mtk-hostapd-Support-EDCCA-hostapd-configuration.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0016-mtk-hostapd-Support-EDCCA-hostapd-configuration.patch
similarity index 93%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0033-mtk-hostapd-Support-EDCCA-hostapd-configuration.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0016-mtk-hostapd-Support-EDCCA-hostapd-configuration.patch
index d7544bc..9fb8962 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0033-mtk-hostapd-Support-EDCCA-hostapd-configuration.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0016-mtk-hostapd-Support-EDCCA-hostapd-configuration.patch
@@ -1,9 +1,10 @@
-From 7b735e95647fe46cc5dcf7d859c8f9abbed5ae0d Mon Sep 17 00:00:00 2001
+From 75020e1c62dd8d16c872614861146d8cfc12f6df Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Mon, 30 May 2022 16:31:34 +0800
-Subject: [PATCH 033/104] mtk: hostapd: Support EDCCA hostapd configuration
+Subject: [PATCH 016/126] mtk: hostapd: Support EDCCA hostapd configuration
edcca_enable and edcca_compensation and implement edcca related handlers.
+
---
hostapd/config_file.c | 34 ++++++
hostapd/ctrl_iface.c | 124 +++++++++++++++++++++
@@ -20,13 +21,13 @@
12 files changed, 427 insertions(+), 6 deletions(-)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index 0094db279..f8c1eec0a 100644
+index f3968ec95..9f5ee48bf 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -5348,6 +5348,40 @@ static int hostapd_config_fill(struct hostapd_config *conf,
- bss->mld_indicate_disabled = atoi(pos);
- #endif /* CONFIG_TESTING_OPTIONS */
- #endif /* CONFIG_IEEE80211BE */
+@@ -5470,6 +5470,40 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+ os_strlcpy(bss->apup_peer_ifname_prefix,
+ pos, sizeof(bss->apup_peer_ifname_prefix));
+ #endif // def CONFIG_APUP
+ } else if (os_strcmp(buf, "edcca_threshold") == 0) {
+ if (hostapd_parse_intlist(&conf->edcca_threshold, pos) ||
+ conf->edcca_threshold[0] < EDCCA_MIN_CONFIG_THRES ||
@@ -65,10 +66,10 @@
wpa_printf(MSG_ERROR,
"Line %d: unknown configuration item '%s'",
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index fb9f09bb1..78a3380f2 100644
+index 40244c5e7..8a9fa3ec9 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -544,6 +544,19 @@ static const char * pbc_status_str(enum pbc_status status)
+@@ -545,6 +545,19 @@ static const char * pbc_status_str(enum pbc_status status)
}
@@ -88,7 +89,7 @@
static int hostapd_ctrl_iface_wps_get_status(struct hostapd_data *hapd,
char *buf, size_t buflen)
{
-@@ -3644,6 +3657,111 @@ static int hostapd_ctrl_iface_link_remove(struct hostapd_data *hapd, char *cmd,
+@@ -3774,6 +3787,111 @@ static int hostapd_ctrl_iface_link_remove(struct hostapd_data *hapd, char *cmd,
#endif /* CONFIG_TESTING_OPTIONS */
#endif /* CONFIG_IEEE80211BE */
@@ -200,7 +201,7 @@
#ifdef CONFIG_NAN_USD
-@@ -4531,6 +4649,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4669,6 +4787,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
reply_len = -1;
#endif /* CONFIG_TESTING_OPTIONS */
#endif /* CONFIG_IEEE80211BE */
@@ -214,10 +215,10 @@
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
-index 6c8b10291..965600577 100644
+index 67661dfe0..112954a89 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
-@@ -303,6 +303,9 @@ struct hostapd_config * hostapd_config_defaults(void)
+@@ -305,6 +305,9 @@ struct hostapd_config * hostapd_config_defaults(void)
conf->airtime_update_interval = AIRTIME_DEFAULT_UPDATE_INTERVAL;
#endif /* CONFIG_AIRTIME_POLICY */
@@ -227,7 +228,7 @@
hostapd_set_and_check_bw320_offset(conf, 0);
return conf;
-@@ -1034,6 +1037,7 @@ void hostapd_config_free(struct hostapd_config *conf)
+@@ -1046,6 +1049,7 @@ void hostapd_config_free(struct hostapd_config *conf)
#ifdef CONFIG_ACS
os_free(conf->acs_chan_bias);
#endif /* CONFIG_ACS */
@@ -236,10 +237,10 @@
wpabuf_free(conf->civic);
#ifdef CONFIG_AFC
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 379dc22cf..09718fada 100644
+index 25ac22e31..b9afe1f47 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1281,8 +1281,38 @@ struct hostapd_config {
+@@ -1334,8 +1334,38 @@ struct hostapd_config {
int min_power;
} afc;
#endif /* CONFIG_AFC */
@@ -279,10 +280,10 @@
static inline enum oper_chan_width
hostapd_get_oper_chwidth(struct hostapd_config *conf)
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 527b2c984..a6caf6a73 100644
+index 7c9527cd3..c7cacbd81 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1245,3 +1245,27 @@ int hostapd_drv_set_secure_ranging_ctx(struct hostapd_data *hapd,
+@@ -1274,3 +1274,27 @@ int hostapd_drv_set_secure_ranging_ctx(struct hostapd_data *hapd,
return hapd->driver->set_secure_ranging_ctx(hapd->drv_priv, ¶ms);
}
#endif /* CONFIG_PASN */
@@ -311,10 +312,10 @@
+ return hapd->driver->get_edcca(hapd->drv_priv, mode, value);
+}
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index f8a8725be..98836153f 100644
+index 58ca046c6..23a331914 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -149,6 +149,10 @@ int hostapd_drv_set_secure_ranging_ctx(struct hostapd_data *hapd,
+@@ -152,6 +152,10 @@ int hostapd_drv_set_secure_ranging_ctx(struct hostapd_data *hapd,
u8 ltf_keyseed_len,
const u8 *ltf_keyseed, u32 action);
@@ -326,10 +327,10 @@
#include "drivers/driver.h"
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index 7959859b0..6af31179e 100644
+index 8159194e1..972bb1763 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -2693,6 +2693,13 @@ dfs_offload:
+@@ -2756,6 +2756,13 @@ dfs_offload:
}
#endif /* CONFIG_MESH */
@@ -377,10 +378,10 @@
[MTK_VENDOR_ATTR_EDCCA_CTRL_MODE] = { .type = NLA_U8 },
[MTK_VENDOR_ATTR_EDCCA_CTRL_PRI20_VAL] = { .type = NLA_U8 },
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 3e3e309f4..ed5f5c013 100644
+index e1a447333..bf103516b 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5220,6 +5220,10 @@ struct wpa_driver_ops {
+@@ -5246,6 +5246,10 @@ struct wpa_driver_ops {
const u8 *match, size_t match_len,
bool multicast);
#endif /* CONFIG_TESTING_OPTIONS */
@@ -392,10 +393,10 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 501d0e42e..d59efe8b6 100644
+index 2c68bf997..606632aad 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -42,6 +42,8 @@
+@@ -39,6 +39,8 @@
#include "radiotap_iter.h"
#include "rfkill.h"
#include "driver_nl80211.h"
@@ -404,7 +405,7 @@
#ifndef NETLINK_CAP_ACK
-@@ -14079,6 +14081,174 @@ static int testing_nl80211_radio_disable(void *priv, int disabled)
+@@ -14101,6 +14103,174 @@ static int testing_nl80211_radio_disable(void *priv, int disabled)
#endif /* CONFIG_TESTING_OPTIONS */
@@ -579,7 +580,7 @@
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211",
-@@ -14240,4 +14410,8 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -14262,4 +14432,8 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.register_frame = testing_nl80211_register_frame,
.radio_disable = testing_nl80211_radio_disable,
#endif /* CONFIG_TESTING_OPTIONS */
@@ -601,7 +602,7 @@
u32 ignore_next_local_disconnect;
u32 ignore_next_local_deauth;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index d6a887cef..cd4d799a1 100644
+index d5ba66b10..465fd318d 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -18,6 +18,7 @@
@@ -626,5 +627,5 @@
wpa_printf(MSG_DEBUG, "nl80211: Supported vendor command: vendor_id=0x%x subcmd=%u",
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0017-hostapd-MLO-add-support-for-MLO-rekey.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0017-hostapd-MLO-add-support-for-MLO-rekey.patch
deleted file mode 100644
index 5895635..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0017-hostapd-MLO-add-support-for-MLO-rekey.patch
+++ /dev/null
@@ -1,799 +0,0 @@
-From 5e6164cb6143d55409c08ae9bfd859efa188e383 Mon Sep 17 00:00:00 2001
-From: Rameshkumar Sundaram <quic_ramess@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:47 +0530
-Subject: [PATCH 017/104] hostapd: MLO: add support for MLO rekey
-
-Currently wpa group rekey is not supported for ML Stations when non-assoc
-link initiates a group rekey, to support the same following changes have
-been made-
- * Calculate links specific MLO GTK/IGTK and BIGTK KDE lengths based on
- corresponding cipher and key instead of taking length of one link and
- multiplying it by no of associated links.
- * For MLD, Arm group key rekey timer on one of the links and whenever it
- fires do group key rekey for all links.
-
-Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
-Co-developed-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
-Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/ap/drv_callbacks.c | 2 +-
- src/ap/ieee802_11.c | 13 +-
- src/ap/wpa_auth.c | 310 +++++++++++++++---
- src/ap/wpa_auth.h | 9 +-
- src/ap/wpa_auth_glue.c | 22 ++
- src/ap/wpa_auth_i.h | 1 +
- src/ap/wpa_auth_ie.c | 12 +-
- src/common/wpa_common.h | 1 +
- tests/fuzzing/eapol-key-auth/eapol-key-auth.c | 2 +-
- wpa_supplicant/ibss_rsn.c | 2 +-
- 10 files changed, 317 insertions(+), 57 deletions(-)
-
-diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
-index 064c7abae..dc21977ff 100644
---- a/src/ap/drv_callbacks.c
-+++ b/src/ap/drv_callbacks.c
-@@ -528,7 +528,7 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
- elems.rsnxe ? elems.rsnxe - 2 : NULL,
- elems.rsnxe ? elems.rsnxe_len + 2 : 0,
- elems.mdie, elems.mdie_len,
-- elems.owe_dh, elems.owe_dh_len);
-+ elems.owe_dh, elems.owe_dh_len, NULL);
- reason = WLAN_REASON_INVALID_IE;
- status = WLAN_STATUS_INVALID_IE;
- switch (res) {
-diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index 9d04bdf43..7ee18f4ae 100644
---- a/src/ap/ieee802_11.c
-+++ b/src/ap/ieee802_11.c
-@@ -1887,7 +1887,7 @@ void handle_auth_fils(struct hostapd_data *hapd, struct sta_info *sta,
- elems.rsn_ie - 2, elems.rsn_ie_len + 2,
- elems.rsnxe ? elems.rsnxe - 2 : NULL,
- elems.rsnxe ? elems.rsnxe_len + 2 : 0,
-- elems.mdie, elems.mdie_len, NULL, 0);
-+ elems.mdie, elems.mdie_len, NULL, 0, NULL);
- resp = wpa_res_to_status_code(res);
- if (resp != WLAN_STATUS_SUCCESS)
- goto fail;
-@@ -3778,7 +3778,7 @@ u16 owe_process_rsn_ie(struct hostapd_data *hapd,
- rsn_ie_len += 2;
- res = wpa_validate_wpa_ie(hapd->wpa_auth, sta->wpa_sm,
- hapd->iface->freq, rsn_ie, rsn_ie_len,
-- NULL, 0, NULL, 0, owe_dh, owe_dh_len);
-+ NULL, 0, NULL, 0, owe_dh, owe_dh_len, NULL);
- status = wpa_res_to_status_code(res);
- if (status != WLAN_STATUS_SUCCESS)
- goto end;
-@@ -3867,6 +3867,8 @@ static int __check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
- const u8 *wpa_ie;
- size_t wpa_ie_len;
- const u8 *p2p_dev_addr = NULL;
-+ struct hostapd_data *assoc_hapd;
-+ struct sta_info *assoc_sta = NULL;
-
- resp = check_ssid(hapd, sta, elems->ssid, elems->ssid_len);
- if (resp != WLAN_STATUS_SUCCESS)
-@@ -4041,6 +4043,10 @@ static int __check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
- wpa_ie_len += 2;
-
- if (!sta->wpa_sm) {
-+ if (!link)
-+ assoc_sta = hostapd_ml_get_assoc_sta(hapd, sta,
-+ &assoc_hapd);
-+
- sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth,
- sta->addr,
- p2p_dev_addr);
-@@ -4076,7 +4082,8 @@ static int __check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
- elems->rsnxe ? elems->rsnxe_len + 2 :
- 0,
- elems->mdie, elems->mdie_len,
-- elems->owe_dh, elems->owe_dh_len);
-+ elems->owe_dh, elems->owe_dh_len,
-+ assoc_sta ? assoc_sta->wpa_sm : NULL);
- resp = wpa_res_to_status_code(res);
- if (resp != WLAN_STATUS_SUCCESS)
- return resp;
-diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
-index 8c1052c25..7a07dcc4c 100644
---- a/src/ap/wpa_auth.c
-+++ b/src/ap/wpa_auth.c
-@@ -71,6 +71,9 @@ static void wpa_group_put(struct wpa_authenticator *wpa_auth,
- struct wpa_group *group);
- static int ieee80211w_kde_len(struct wpa_state_machine *sm);
- static u8 * ieee80211w_kde_add(struct wpa_state_machine *sm, u8 *pos);
-+static void wpa_group_update_gtk(struct wpa_authenticator *wpa_auth,
-+ struct wpa_group *group);
-+
-
- static const u32 eapol_key_timeout_first = 100; /* ms */
- static const u32 eapol_key_timeout_subseq = 1000; /* ms */
-@@ -102,6 +105,22 @@ static const u8 * wpa_auth_get_spa(const struct wpa_state_machine *sm)
- return sm->addr;
- }
-
-+static void wpa_update_gkeydone(struct wpa_state_machine *sm, int update)
-+{
-+#ifdef CONFIG_IEEE80211BE
-+ int link_id;
-+#endif /* CONFIG_IEEE80211BE */
-+ if (!sm || !sm->wpa_auth)
-+ return;
-+
-+ sm->wpa_auth->group->GKeyDoneStations += update;
-+
-+#ifdef CONFIG_IEEE80211BE
-+ for_each_sm_auth(sm, link_id)
-+ sm->mld_links[link_id].wpa_auth->group->GKeyDoneStations += update;
-+#endif /* CONFIG_IEEE80211BE */
-+}
-+
- #ifdef CONFIG_IEEE80211BE
- void wpa_release_link_auth_ref(struct wpa_state_machine *sm, int release_link_id)
- {
-@@ -139,10 +158,12 @@ static int wpa_get_primary_wpa_auth_cb(struct wpa_authenticator *wpa_auth, void
- ctx->wpa_auth = wpa_auth;
- return 1;
- }
-+#endif /* CONFIG_IEEE80211BE */
-
- static struct wpa_authenticator *
- wpa_get_primary_wpa_auth(struct wpa_authenticator *wpa_auth)
- {
-+#ifdef CONFIG_IEEE80211BE
- struct wpa_get_link_auth_ctx ctx;
-
- if (!wpa_auth || !wpa_auth->is_ml || wpa_auth->primary_auth)
-@@ -153,8 +174,10 @@ wpa_get_primary_wpa_auth(struct wpa_authenticator *wpa_auth)
- wpa_auth_for_each_auth(wpa_auth, wpa_get_primary_wpa_auth_cb, &ctx);
-
- return ctx.wpa_auth;
--}
-+#else
-+ return wpa_auth;
- #endif /* CONFIG_IEEE80211BE */
-+}
-
- static inline int wpa_auth_mic_failure_report(
- struct wpa_authenticator *wpa_auth, const u8 *addr)
-@@ -420,15 +443,16 @@ static void wpa_rekey_gmk(void *eloop_ctx, void *timeout_ctx)
- }
- }
-
--
--static void wpa_rekey_gtk(void *eloop_ctx, void *timeout_ctx)
-+static void wpa_rekey_all_groups(struct wpa_authenticator *wpa_auth)
- {
-- struct wpa_authenticator *wpa_auth = eloop_ctx;
- struct wpa_group *group, *next;
-
- wpa_auth_logger(wpa_auth, NULL, LOGGER_DEBUG, "rekeying GTK");
- group = wpa_auth->group;
- while (group) {
-+ wpa_printf(MSG_DEBUG, "GTK rekey start for authenticator("
-+ MACSTR "), group vlan %d",
-+ MAC2STR(wpa_auth->addr), group->vlan_id);
- wpa_group_get(wpa_auth, group);
-
- group->GTKReKey = true;
-@@ -441,6 +465,80 @@ static void wpa_rekey_gtk(void *eloop_ctx, void *timeout_ctx)
- wpa_group_put(wpa_auth, group);
- group = next;
- }
-+}
-+
-+#ifdef CONFIG_IEEE80211BE
-+static void wpa_update_all_gtks(struct wpa_authenticator *wpa_auth)
-+{
-+ struct wpa_group *group, *next;
-+
-+ group = wpa_auth->group;
-+ while (group) {
-+ wpa_group_get(wpa_auth, group);
-+
-+ wpa_group_update_gtk(wpa_auth, group);
-+ next = group->next;
-+ wpa_group_put(wpa_auth, group);
-+ group = next;
-+ }
-+}
-+
-+static int wpa_update_all_gtks_cb(struct wpa_authenticator *wpa_auth, void *ctx)
-+{
-+ u8 *mld_addr = ctx;
-+
-+ if (os_memcmp(wpa_auth->mld_addr, mld_addr, ETH_ALEN) != 0)
-+ return 0;
-+
-+ wpa_update_all_gtks(wpa_auth);
-+ return 0;
-+}
-+
-+static int wpa_rekey_all_groups_cb(struct wpa_authenticator *wpa_auth,
-+ void *ctx)
-+{
-+ u8 *mld_addr = ctx;
-+
-+ if (os_memcmp(wpa_auth->mld_addr, mld_addr, ETH_ALEN) != 0)
-+ return 0;
-+
-+ wpa_rekey_all_groups(wpa_auth);
-+ return 0;
-+}
-+#endif /* CONFIG_IEEE80211BE */
-+
-+static void wpa_rekey_gtk(void *eloop_ctx, void *timeout_ctx)
-+{
-+ struct wpa_authenticator *wpa_auth = eloop_ctx;
-+
-+#ifdef CONFIG_IEEE80211BE
-+ if (wpa_auth->is_ml) {
-+ /* Non Primary ML authenticator eloop timer for group rekey is never
-+ * started and shouldn't fire too check and warn just in case
-+ */
-+ if (!wpa_auth->primary_auth) {
-+ wpa_printf(MSG_DEBUG,
-+ "WPA: Can't start GTK rekey on non-primary ML authenticator");
-+ return;
-+ }
-+ /*
-+ * Generate all the new I/BIG/GTKs
-+ */
-+ wpa_auth_for_each_auth(wpa_auth, wpa_update_all_gtks_cb,
-+ wpa_auth->mld_addr);
-+
-+ /*
-+ * Send all the generated I/BIG/GTKs to the respective
-+ * stations via G1 messages
-+ */
-+ wpa_auth_for_each_auth(wpa_auth, wpa_rekey_all_groups_cb,
-+ wpa_auth->mld_addr);
-+ } else {
-+ wpa_rekey_all_groups(wpa_auth);
-+ }
-+#else
-+ wpa_rekey_all_groups(wpa_auth);
-+#endif /* CONFIG_IEEE80211BE */
-
- if (wpa_auth->conf.wpa_group_rekey) {
- eloop_register_timeout(wpa_auth->conf.wpa_group_rekey,
-@@ -590,8 +688,19 @@ struct wpa_authenticator * wpa_init(const u8 *addr,
- wpa_auth = os_zalloc(sizeof(struct wpa_authenticator));
- if (!wpa_auth)
- return NULL;
-+
- os_memcpy(wpa_auth->addr, addr, ETH_ALEN);
- os_memcpy(&wpa_auth->conf, conf, sizeof(*conf));
-+
-+#ifdef CONFIG_IEEE80211BE
-+ if (conf->mld_addr) {
-+ wpa_auth->is_ml = true;
-+ wpa_auth->link_id = conf->link_id;
-+ wpa_auth->primary_auth = !conf->first_link_auth;
-+ os_memcpy(wpa_auth->mld_addr, conf->mld_addr, ETH_ALEN);
-+ }
-+#endif /* CONFIG_IEEE80211BE */
-+
- wpa_auth->cb = cb;
- wpa_auth->cb_ctx = cb_ctx;
-
-@@ -635,7 +744,15 @@ struct wpa_authenticator * wpa_init(const u8 *addr,
- wpa_rekey_gmk, wpa_auth, NULL);
- }
-
-+#ifdef CONFIG_IEEE80211BE
-+ /* For ML AP, run Group rekey timer only on one link(first) and whenever
-+ * it fires do rekey on all associated ML links at one shot.
-+ */
-+ if ((!wpa_auth->is_ml || !conf->first_link_auth) &&
-+ wpa_auth->conf.wpa_group_rekey) {
-+#else
- if (wpa_auth->conf.wpa_group_rekey) {
-+#endif /* CONFIG_IEEE80211BE */
- eloop_register_timeout(wpa_auth->conf.wpa_group_rekey, 0,
- wpa_rekey_gtk, wpa_auth, NULL);
- }
-@@ -699,6 +816,10 @@ void wpa_deinit(struct wpa_authenticator *wpa_auth)
- struct wpa_group *group, *prev;
-
- eloop_cancel_timeout(wpa_rekey_gmk, wpa_auth, NULL);
-+
-+ /* TODO: assign ML Primary authenticator to next link auth and
-+ * start rekey timer.
-+ */
- eloop_cancel_timeout(wpa_rekey_gtk, wpa_auth, NULL);
-
- pmksa_cache_auth_deinit(wpa_auth->pmksa);
-@@ -868,7 +989,7 @@ static void wpa_free_sta_sm(struct wpa_state_machine *sm)
- }
- #endif /* CONFIG_P2P */
- if (sm->GUpdateStationKeys) {
-- sm->group->GKeyDoneStations--;
-+ wpa_update_gkeydone(sm, -1);
- sm->GUpdateStationKeys = false;
- }
- #ifdef CONFIG_IEEE80211R_AP
-@@ -1669,12 +1790,14 @@ void wpa_receive(struct wpa_authenticator *wpa_auth,
- wpa_auth_logger(wpa_auth, wpa_auth_get_spa(sm),
- LOGGER_INFO,
- "received EAPOL-Key Request for GTK rekeying");
-- eloop_cancel_timeout(wpa_rekey_gtk, wpa_auth, NULL);
-+
-+ eloop_cancel_timeout(wpa_rekey_gtk,
-+ wpa_get_primary_wpa_auth(wpa_auth), NULL);
- if (wpa_auth_gtk_rekey_in_process(wpa_auth))
- wpa_auth_logger(wpa_auth, NULL, LOGGER_DEBUG,
- "skip new GTK rekey - already in process");
- else
-- wpa_rekey_gtk(wpa_auth, NULL);
-+ wpa_rekey_gtk(wpa_get_primary_wpa_auth(wpa_auth), NULL);
- }
- } else {
- /* Do not allow the same key replay counter to be reused. */
-@@ -2207,7 +2330,7 @@ int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event)
- * Reauthentication cancels the pending group key
- * update for this STA.
- */
-- sm->group->GKeyDoneStations--;
-+ wpa_update_gkeydone(sm, -1);
- sm->GUpdateStationKeys = false;
- sm->PtkGroupInit = true;
- }
-@@ -2284,7 +2407,7 @@ SM_STATE(WPA_PTK, INITIALIZE)
-
- sm->keycount = 0;
- if (sm->GUpdateStationKeys)
-- sm->group->GKeyDoneStations--;
-+ wpa_update_gkeydone(sm, -1);
- sm->GUpdateStationKeys = false;
- if (sm->wpa == WPA_VERSION_WPA)
- sm->PInitAKeys = false;
-@@ -4058,41 +4181,54 @@ static void wpa_auth_get_ml_key_info(struct wpa_authenticator *wpa_auth,
- wpa_auth->cb->get_ml_key_info(wpa_auth->cb_ctx, info);
- }
-
-+#define KDE_HDR_LEN (1 + 1 + RSN_SELECTOR_LEN)
-
- static size_t wpa_auth_ml_group_kdes_len(struct wpa_state_machine *sm)
- {
-- struct wpa_authenticator *wpa_auth = sm->wpa_auth;
-- struct wpa_group *gsm = sm->group;
-- size_t gtk_len = gsm->GTK_len;
-- size_t igtk_len;
-- size_t kde_len;
-- unsigned int n_links;
-+ struct wpa_authenticator *wpa_auth;
-+ size_t kde_len = 0;
-+ int link_id;
-
- if (sm->mld_assoc_link_id < 0)
- return 0;
-
-- n_links = sm->n_mld_affiliated_links + 1;
-+ for (link_id = 0; link_id < MAX_NUM_MLD_LINKS; link_id++) {
-+ if (!sm->mld_links[link_id].valid)
-+ continue;
-+
-+ wpa_auth = sm->mld_links[link_id].wpa_auth;
-+ if (!wpa_auth || !wpa_auth->group)
-+ continue;
-
-- /* MLO GTK KDE for each link */
-- kde_len = n_links * (2 + RSN_SELECTOR_LEN + 1 + 6 + gtk_len);
-+ /* MLO GTK KDE
-+ * Header + Key-idx and Link-id + PN
-+ */
-+ kde_len += (KDE_HDR_LEN + 1 + WPA_MLO_GTK_KDE_PN_LEN);
-+ kde_len += wpa_auth->group->GTK_len;
-
-- if (!sm->mgmt_frame_prot)
-- return kde_len;
-+ if (!sm->mgmt_frame_prot)
-+ continue;
-
-- /* MLO IGTK KDE for each link */
-- igtk_len = wpa_cipher_key_len(wpa_auth->conf.group_mgmt_cipher);
-- kde_len += n_links * (2 + RSN_SELECTOR_LEN + 2 + 6 + 1 + igtk_len);
-+ if (wpa_auth->conf.tx_bss_auth)
-+ wpa_auth = wpa_auth->conf.tx_bss_auth;
-
-- if (wpa_auth->conf.tx_bss_auth) {
-- wpa_auth = wpa_auth->conf.tx_bss_auth;
-- igtk_len = wpa_cipher_key_len(wpa_auth->conf.group_mgmt_cipher);
-- }
-+ /* MLO IGTK KDE
-+ * Header + Key-idx & IPN + Link-id
-+ */
-+ kde_len += (KDE_HDR_LEN + WPA_IGTK_KDE_PREFIX_LEN + 1);
-+ kde_len += wpa_cipher_key_len(wpa_auth->conf.group_mgmt_cipher);
-
-- if (!wpa_auth->conf.beacon_prot)
-- return kde_len;
-+ if (!wpa_auth->conf.beacon_prot)
-+ continue;
-+
-+ /* MLO BIGTK KDE
-+ * Header + Key-idx & IPN + Link-id
-+ */
-+ kde_len += (KDE_HDR_LEN + WPA_BIGTK_KDE_PREFIX_LEN + 1);
-+ kde_len += wpa_cipher_key_len(wpa_auth->conf.group_mgmt_cipher);
-+ }
-
-- /* MLO BIGTK KDE for each link */
-- kde_len += n_links * (2 + RSN_SELECTOR_LEN + 2 + 6 + 1 + igtk_len);
-+ wpa_printf(MSG_DEBUG, "MLO Group kdes len = %zu", kde_len);
-
- return kde_len;
- }
-@@ -4102,6 +4238,7 @@ static u8 * wpa_auth_ml_group_kdes(struct wpa_state_machine *sm, u8 *pos)
- {
- struct wpa_auth_ml_key_info ml_key_info;
- unsigned int i, link_id;
-+ u8 *start = pos;
-
- /* First fetch the key information from all the authenticators */
- os_memset(&ml_key_info, 0, sizeof(ml_key_info));
-@@ -4153,8 +4290,10 @@ static u8 * wpa_auth_ml_group_kdes(struct wpa_state_machine *sm, u8 *pos)
- i++;
- }
-
-- if (!sm->mgmt_frame_prot)
-+ if (!sm->mgmt_frame_prot) {
-+ wpa_printf(MSG_DEBUG, "RSN: MLO Group kde len = %ld", pos - start);
- return pos;
-+ }
-
- /* Add MLO IGTK KDEs */
- for (i = 0, link_id = 0; link_id < MAX_NUM_MLD_LINKS; link_id++) {
-@@ -4193,8 +4332,10 @@ static u8 * wpa_auth_ml_group_kdes(struct wpa_state_machine *sm, u8 *pos)
- i++;
- }
-
-- if (!sm->wpa_auth->conf.beacon_prot)
-+ if (!sm->wpa_auth->conf.beacon_prot) {
-+ wpa_printf(MSG_DEBUG, "RSN: MLO Group kde len = %ld", pos - start);
- return pos;
-+ }
-
- /* Add MLO BIGTK KDEs */
- for (i = 0, link_id = 0; link_id < MAX_NUM_MLD_LINKS; link_id++) {
-@@ -4234,6 +4375,7 @@ static u8 * wpa_auth_ml_group_kdes(struct wpa_state_machine *sm, u8 *pos)
- i++;
- }
-
-+ wpa_printf(MSG_DEBUG, "RSN: MLO Group kde len = %ld", pos - start);
- return pos;
- }
-
-@@ -4274,6 +4416,7 @@ static u8 * wpa_auth_ml_kdes(struct wpa_state_machine *sm, u8 *pos)
- {
- #ifdef CONFIG_IEEE80211BE
- u8 link_id;
-+ u8 *start = pos;
-
- if (sm->mld_assoc_link_id < 0)
- return pos;
-@@ -4324,6 +4467,7 @@ static u8 * wpa_auth_ml_kdes(struct wpa_state_machine *sm, u8 *pos)
- }
- }
-
-+ wpa_printf(MSG_DEBUG, "RSN: MLO Link kde len = %ld", pos - start);
- pos = wpa_auth_ml_group_kdes(sm, pos);
- #endif /* CONFIG_IEEE80211BE */
-
-@@ -5106,7 +5250,7 @@ SM_STATE(WPA_PTK_GROUP, REKEYESTABLISHED)
- #endif /* CONFIG_OCV */
-
- if (sm->GUpdateStationKeys)
-- sm->group->GKeyDoneStations--;
-+ wpa_update_gkeydone(sm, -1);
- sm->GUpdateStationKeys = false;
- sm->GTimeoutCtr = 0;
- /* FIX: MLME.SetProtection.Request(TA, Tx_Rx) */
-@@ -5121,7 +5265,7 @@ SM_STATE(WPA_PTK_GROUP, KEYERROR)
- {
- SM_ENTRY_MA(WPA_PTK_GROUP, KEYERROR, wpa_ptk_group);
- if (sm->GUpdateStationKeys)
-- sm->group->GKeyDoneStations--;
-+ wpa_update_gkeydone(sm, -1);
- sm->GUpdateStationKeys = false;
- sm->Disconnect = true;
- sm->disconnect_reason = WLAN_REASON_GROUP_KEY_UPDATE_TIMEOUT;
-@@ -5415,18 +5559,11 @@ int wpa_wnmsleep_bigtk_subelem(struct wpa_state_machine *sm, u8 *pos)
-
- #endif /* CONFIG_WNM_AP */
-
--
--static void wpa_group_setkeys(struct wpa_authenticator *wpa_auth,
-- struct wpa_group *group)
-+static void wpa_group_update_gtk(struct wpa_authenticator *wpa_auth,
-+ struct wpa_group *group)
- {
- int tmp;
-
-- wpa_printf(MSG_DEBUG,
-- "WPA: group state machine entering state SETKEYS (VLAN-ID %d)",
-- group->vlan_id);
-- group->changed = true;
-- group->wpa_group_state = WPA_GROUP_SETKEYS;
-- group->GTKReKey = false;
- tmp = group->GM;
- group->GM = group->GN;
- group->GN = tmp;
-@@ -5440,6 +5577,24 @@ static void wpa_group_setkeys(struct wpa_authenticator *wpa_auth,
- * counting the STAs that are marked with GUpdateStationKeys instead of
- * including all STAs that could be in not-yet-completed state. */
- wpa_gtk_update(wpa_auth, group);
-+}
-+
-+static void wpa_group_setkeys(struct wpa_authenticator *wpa_auth,
-+ struct wpa_group *group)
-+{
-+ wpa_printf(MSG_DEBUG,
-+ "WPA: group state machine entering state SETKEYS (VLAN-ID %d)",
-+ group->vlan_id);
-+ group->changed = true;
-+ group->wpa_group_state = WPA_GROUP_SETKEYS;
-+ group->GTKReKey = false;
-+
-+#ifdef CONFIG_IEEE80211BE
-+ if (wpa_auth->is_ml)
-+ goto skip_update;
-+#endif /* CONFIG_IEEE80211BE */
-+
-+ wpa_group_update_gtk(wpa_auth, group);
-
- if (group->GKeyDoneStations) {
- wpa_printf(MSG_DEBUG,
-@@ -5447,6 +5602,10 @@ static void wpa_group_setkeys(struct wpa_authenticator *wpa_auth,
- group->GKeyDoneStations);
- group->GKeyDoneStations = 0;
- }
-+
-+#ifdef CONFIG_IEEE80211BE
-+skip_update:
-+#endif /* CONFIG_IEEE80211BE */
- wpa_auth_for_each_sta(wpa_auth, wpa_group_update_sta, group);
- wpa_printf(MSG_DEBUG, "wpa_group_setkeys: GKeyDoneStations=%d",
- group->GKeyDoneStations);
-@@ -5564,6 +5723,57 @@ static void wpa_group_sm_step(struct wpa_authenticator *wpa_auth,
- }
- }
-
-+static void wpa_mark_group_change(struct wpa_state_machine *sm, bool change)
-+{
-+#ifdef CONFIG_IEEE80211BE
-+ int link_id;
-+#endif /* CONFIG_IEEE80211BE */
-+
-+ if (!sm || !sm->wpa_auth)
-+ return;
-+ sm->wpa_auth->group->changed = change;
-+
-+#ifdef CONFIG_IEEE80211BE
-+ for_each_sm_auth(sm, link_id)
-+ sm->mld_links[link_id].wpa_auth->group->changed = change;
-+#endif /* CONFIG_IEEE80211BE */
-+}
-+
-+static void wpa_group_sm_step_links(struct wpa_state_machine *sm)
-+{
-+#ifdef CONFIG_IEEE80211BE
-+ int link_id;
-+#endif /* CONFIG_IEEE80211BE */
-+
-+ if (!sm || !sm->wpa_auth)
-+ return;
-+ wpa_group_sm_step(sm->wpa_auth, sm->wpa_auth->group);
-+
-+#ifdef CONFIG_IEEE80211BE
-+ for_each_sm_auth(sm, link_id)
-+ wpa_group_sm_step(sm->mld_links[link_id].wpa_auth,
-+ sm->mld_links[link_id].wpa_auth->group);
-+#endif /* CONFIG_IEEE80211BE */
-+}
-+
-+static bool wpa_group_sm_changed(struct wpa_state_machine *sm)
-+{
-+#ifdef CONFIG_IEEE80211BE
-+ int link_id;
-+#endif /* CONFIG_IEEE80211BE */
-+ bool changed;
-+
-+ if (!sm || !sm->wpa_auth)
-+ return false;
-+ changed = sm->wpa_auth->group->changed;
-+
-+#ifdef CONFIG_IEEE80211BE
-+ for_each_sm_auth(sm, link_id)
-+ changed |= sm->mld_links[link_id].wpa_auth->group->changed;
-+#endif /* CONFIG_IEEE80211BE */
-+
-+ return changed;
-+}
-
- static int wpa_sm_step(struct wpa_state_machine *sm)
- {
-@@ -5584,7 +5794,7 @@ static int wpa_sm_step(struct wpa_state_machine *sm)
- break;
-
- sm->changed = false;
-- sm->wpa_auth->group->changed = false;
-+ wpa_mark_group_change(sm, false);
-
- SM_STEP_RUN(WPA_PTK);
- if (sm->pending_deinit)
-@@ -5592,8 +5802,8 @@ static int wpa_sm_step(struct wpa_state_machine *sm)
- SM_STEP_RUN(WPA_PTK_GROUP);
- if (sm->pending_deinit)
- break;
-- wpa_group_sm_step(sm->wpa_auth, sm->group);
-- } while (sm->changed || sm->wpa_auth->group->changed);
-+ wpa_group_sm_step_links(sm);
-+ } while (sm->changed || wpa_group_sm_changed(sm));
- sm->in_step_loop = 0;
-
- if (sm->pending_deinit) {
-@@ -6807,8 +7017,10 @@ int wpa_auth_rekey_gtk(struct wpa_authenticator *wpa_auth)
- {
- if (!wpa_auth)
- return -1;
-- eloop_cancel_timeout(wpa_rekey_gtk, wpa_auth, NULL);
-- return eloop_register_timeout(0, 0, wpa_rekey_gtk, wpa_auth, NULL);
-+ eloop_cancel_timeout(wpa_rekey_gtk,
-+ wpa_get_primary_wpa_auth(wpa_auth), NULL);
-+ return eloop_register_timeout(0, 0, wpa_rekey_gtk,
-+ wpa_get_primary_wpa_auth(wpa_auth), NULL);
- }
-
-
-diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h
-index 1446872f3..331d217b5 100644
---- a/src/ap/wpa_auth.h
-+++ b/src/ap/wpa_auth.h
-@@ -285,6 +285,12 @@ struct wpa_auth_config {
- * Set only in nontransmitted BSSs, i.e., is NULL for transmitted BSS
- * and in BSSs that are not part of a Multi-BSSID set. */
- struct wpa_authenticator *tx_bss_auth;
-+
-+#ifdef CONFIG_IEEE80211BE
-+ u8 *mld_addr;
-+ int link_id;
-+ struct wpa_authenticator *first_link_auth;
-+#endif /* CONFIG_IEEE80211BE */
- };
-
- typedef enum {
-@@ -429,7 +435,8 @@ wpa_validate_wpa_ie(struct wpa_authenticator *wpa_auth,
- const u8 *wpa_ie, size_t wpa_ie_len,
- const u8 *rsnxe, size_t rsnxe_len,
- const u8 *mdie, size_t mdie_len,
-- const u8 *owe_dh, size_t owe_dh_len);
-+ const u8 *owe_dh, size_t owe_dh_len,
-+ struct wpa_state_machine *assoc_sm);
- int wpa_validate_osen(struct wpa_authenticator *wpa_auth,
- struct wpa_state_machine *sm,
- const u8 *osen_ie, size_t osen_ie_len);
-diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c
-index d3cd44695..1726c7201 100644
---- a/src/ap/wpa_auth_glue.c
-+++ b/src/ap/wpa_auth_glue.c
-@@ -1713,6 +1713,7 @@ int hostapd_setup_wpa(struct hostapd_data *hapd)
-
- hostapd_wpa_auth_conf(hapd->conf, hapd->iconf, &_conf);
- _conf.msg_ctx = hapd->msg_ctx;
-+
- tx_bss = hostapd_mbssid_get_tx_bss(hapd);
- if (tx_bss != hapd)
- _conf.tx_bss_auth = tx_bss->wpa_auth;
-@@ -1753,6 +1754,27 @@ int hostapd_setup_wpa(struct hostapd_data *hapd)
- !!(hapd->iface->drv_flags2 &
- WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_AP);
-
-+#ifdef CONFIG_IEEE80211BE
-+ _conf.mld_addr = NULL;
-+ _conf.link_id = -1;
-+ _conf.first_link_auth = NULL;
-+
-+ if (hapd->conf->mld_ap) {
-+ struct hostapd_data *lhapd;
-+
-+ _conf.mld_addr = hapd->mld->mld_addr;
-+ _conf.link_id = hapd->mld_link_id;
-+
-+ for_each_mld_link(lhapd, hapd) {
-+ if (lhapd == hapd)
-+ continue;
-+
-+ if (lhapd->wpa_auth)
-+ _conf.first_link_auth = lhapd->wpa_auth;
-+ }
-+ }
-+#endif /* CONFIG_IEEE80211BE */
-+
- hapd->wpa_auth = wpa_init(hapd->own_addr, &_conf, &cb, hapd);
- if (hapd->wpa_auth == NULL) {
- wpa_printf(MSG_ERROR, "WPA initialization failed.");
-diff --git a/src/ap/wpa_auth_i.h b/src/ap/wpa_auth_i.h
-index 9ba90749d..29bb66733 100644
---- a/src/ap/wpa_auth_i.h
-+++ b/src/ap/wpa_auth_i.h
-@@ -176,6 +176,7 @@ struct wpa_state_machine {
- u8 peer_mld_addr[ETH_ALEN];
- s8 mld_assoc_link_id;
- u8 n_mld_affiliated_links;
-+ u16 valid_links;
-
- struct mld_link {
- bool valid;
-diff --git a/src/ap/wpa_auth_ie.c b/src/ap/wpa_auth_ie.c
-index a5f2861c9..bf2303e4f 100644
---- a/src/ap/wpa_auth_ie.c
-+++ b/src/ap/wpa_auth_ie.c
-@@ -608,7 +608,8 @@ wpa_validate_wpa_ie(struct wpa_authenticator *wpa_auth,
- const u8 *wpa_ie, size_t wpa_ie_len,
- const u8 *rsnxe, size_t rsnxe_len,
- const u8 *mdie, size_t mdie_len,
-- const u8 *owe_dh, size_t owe_dh_len)
-+ const u8 *owe_dh, size_t owe_dh_len,
-+ struct wpa_state_machine *assoc_sm)
- {
- struct wpa_auth_config *conf = &wpa_auth->conf;
- struct wpa_ie_data data;
-@@ -956,6 +957,15 @@ wpa_validate_wpa_ie(struct wpa_authenticator *wpa_auth,
- else
- sm->wpa = WPA_VERSION_WPA;
-
-+ if (assoc_sm) {
-+ /* For ML Association Link STA cannot choose a different
-+ * akm or pairwise cipher from assoc STA
-+ */
-+ if (sm->wpa_key_mgmt != assoc_sm->wpa_key_mgmt)
-+ return WPA_INVALID_AKMP;
-+ if (sm->pairwise != assoc_sm->pairwise)
-+ return WPA_INVALID_PAIRWISE;
-+ }
- #if defined(CONFIG_IEEE80211R_AP) && defined(CONFIG_FILS)
- if ((sm->wpa_key_mgmt == WPA_KEY_MGMT_FT_FILS_SHA256 ||
- sm->wpa_key_mgmt == WPA_KEY_MGMT_FT_FILS_SHA384) &&
-diff --git a/src/common/wpa_common.h b/src/common/wpa_common.h
-index 01efeea3a..24ceed600 100644
---- a/src/common/wpa_common.h
-+++ b/src/common/wpa_common.h
-@@ -24,6 +24,7 @@
- #define WPA_PASN_PMK_LEN 32
- #define WPA_PASN_MAX_MIC_LEN 24
- #define WPA_MAX_RSNXE_LEN 4
-+#define WPA_MLO_GTK_KDE_PN_LEN 6
-
- #define OWE_DH_GROUP 19
-
-diff --git a/tests/fuzzing/eapol-key-auth/eapol-key-auth.c b/tests/fuzzing/eapol-key-auth/eapol-key-auth.c
-index bb46422c6..17f69fd76 100644
---- a/tests/fuzzing/eapol-key-auth/eapol-key-auth.c
-+++ b/tests/fuzzing/eapol-key-auth/eapol-key-auth.c
-@@ -262,7 +262,7 @@ static int auth_init(struct wpa *wpa)
- }
-
- if (wpa_validate_wpa_ie(wpa->auth_group, wpa->auth, 2412, supp_ie,
-- supp_ie_len, NULL, 0, NULL, 0, NULL, 0) !=
-+ supp_ie_len, NULL, 0, NULL, 0, NULL, 0, NULL) !=
- WPA_IE_OK) {
- wpa_printf(MSG_DEBUG, "AUTH: wpa_validate_wpa_ie() failed");
- return -1;
-diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c
-index 554268a47..2d06f1a6a 100644
---- a/wpa_supplicant/ibss_rsn.c
-+++ b/wpa_supplicant/ibss_rsn.c
-@@ -484,7 +484,7 @@ static int ibss_rsn_auth_init(struct ibss_rsn *ibss_rsn,
- "\x00\x0f\xac\x04"
- "\x01\x00\x00\x0f\xac\x04"
- "\x01\x00\x00\x0f\xac\x02"
-- "\x00\x00", 22, NULL, 0, NULL, 0, NULL, 0) !=
-+ "\x00\x00", 22, NULL, 0, NULL, 0, NULL, 0, NULL) !=
- WPA_IE_OK) {
- wpa_printf(MSG_DEBUG, "AUTH: wpa_validate_wpa_ie() failed");
- return -1;
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0034-mtk-hostapd-Add-hostapd-MU-SET-GET-control.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0017-mtk-hostapd-Add-hostapd-MU-SET-GET-control.patch
similarity index 91%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0034-mtk-hostapd-Add-hostapd-MU-SET-GET-control.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0017-mtk-hostapd-Add-hostapd-MU-SET-GET-control.patch
index 3849fa4..34dcd0f 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0034-mtk-hostapd-Add-hostapd-MU-SET-GET-control.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0017-mtk-hostapd-Add-hostapd-MU-SET-GET-control.patch
@@ -1,7 +1,7 @@
-From fa905ce61f3cfecf94012fc2a11680e2615fc05d Mon Sep 17 00:00:00 2001
+From e45dc5872482e9db6cac8263a82832584095ecf3 Mon Sep 17 00:00:00 2001
From: TomLiu <tomml.liu@mediatek.com>
Date: Tue, 9 Aug 2022 10:23:44 -0700
-Subject: [PATCH 034/104] mtk: hostapd: Add hostapd MU SET/GET control
+Subject: [PATCH 017/126] mtk: hostapd: Add hostapd MU SET/GET control
---
hostapd/config_file.c | 9 +++
@@ -20,10 +20,10 @@
13 files changed, 255 insertions(+)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index f8c1eec0a..637c2df9f 100644
+index 9f5ee48bf..22da72c07 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -4159,6 +4159,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -4251,6 +4251,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
return 1;
}
conf->mbssid = mbssid;
@@ -40,10 +40,10 @@
} else if (os_strcmp(buf, "max_listen_interval") == 0) {
bss->max_listen_interval = atoi(pos);
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 78a3380f2..3a79a1284 100644
+index 8a9fa3ec9..d168c2fb5 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -4049,6 +4049,67 @@ fail:
+@@ -4179,6 +4179,67 @@ fail:
#endif /* CONFIG_NAN_USD */
@@ -111,7 +111,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
int reply_size,
-@@ -4655,6 +4716,11 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4793,6 +4854,11 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
} else if (os_strncmp(buf, "GET_EDCCA ", 10) == 0) {
reply_len = hostapd_ctrl_iface_get_edcca(hapd, buf+10, reply,
reply_size);
@@ -124,10 +124,10 @@
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index 1fb6d999e..da9dabd6f 100644
+index bb15bc751..f4dc1517e 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1442,6 +1442,20 @@ static int hostapd_cli_cmd_driver_flags2(struct wpa_ctrl *ctrl, int argc,
+@@ -1460,6 +1460,20 @@ static int hostapd_cli_cmd_driver_flags2(struct wpa_ctrl *ctrl, int argc,
}
@@ -148,7 +148,7 @@
#ifdef CONFIG_DPP
static int hostapd_cli_cmd_dpp_qr_code(struct wpa_ctrl *ctrl, int argc,
-@@ -1801,6 +1815,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1831,6 +1845,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
" = show supported driver flags"},
{ "driver_flags2", hostapd_cli_cmd_driver_flags2, NULL,
" = show supported driver flags2"},
@@ -160,10 +160,10 @@
{ "dpp_qr_code", hostapd_cli_cmd_dpp_qr_code, NULL,
"report a scanned DPP URI from a QR Code" },
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
-index 965600577..9b3ef0b5b 100644
+index 112954a89..45c391a65 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
-@@ -289,6 +289,7 @@ struct hostapd_config * hostapd_config_defaults(void)
+@@ -291,6 +291,7 @@ struct hostapd_config * hostapd_config_defaults(void)
conf->reg_def_cli_eirp_psd = -1;
conf->reg_sub_cli_eirp_psd = -1;
conf->reg_def_cli_eirp = -1;
@@ -172,10 +172,10 @@
/* The third octet of the country string uses an ASCII space character
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 09718fada..f7dbbbec3 100644
+index b9afe1f47..baf3b40f8 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1185,6 +1185,7 @@ struct hostapd_config {
+@@ -1235,6 +1235,7 @@ struct hostapd_config {
int reg_def_cli_eirp;
bool require_he;
@@ -184,10 +184,10 @@
/* VHT enable/disable config from CHAN_SWITCH */
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index a6caf6a73..897ed6af8 100644
+index c7cacbd81..56d923462 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1269,3 +1269,17 @@ int hostapd_drv_get_edcca(struct hostapd_data *hapd, const u8 mode, u8 *value)
+@@ -1298,3 +1298,17 @@ int hostapd_drv_get_edcca(struct hostapd_data *hapd, const u8 mode, u8 *value)
return 0;
return hapd->driver->get_edcca(hapd->drv_priv, mode, value);
}
@@ -206,10 +206,10 @@
+ return hapd->driver->mu_dump(hapd->drv_priv, mu_onoff);
+}
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index 98836153f..5ab20cc41 100644
+index 23a331914..47b23513f 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -153,6 +153,8 @@ int hostapd_drv_configure_edcca_enable(struct hostapd_data *hapd);
+@@ -156,6 +156,8 @@ int hostapd_drv_configure_edcca_enable(struct hostapd_data *hapd);
int hostapd_drv_configure_edcca_threshold(struct hostapd_data *hapd,
const int *threshold);
int hostapd_drv_get_edcca(struct hostapd_data *hapd, const u8 mode, u8 *value);
@@ -219,10 +219,10 @@
#include "drivers/driver.h"
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index 6af31179e..d29b51fc5 100644
+index 972bb1763..227474db5 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -2699,6 +2699,8 @@ dfs_offload:
+@@ -2762,6 +2762,8 @@ dfs_offload:
if (hostapd_drv_configure_edcca_threshold(hapd,
hapd->iconf->edcca_threshold) < 0)
goto fail;
@@ -265,7 +265,7 @@
#define ETH_ALEN 6
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index ed5f5c013..df7ce5ab9 100644
+index bf103516b..2217809db 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -176,6 +176,11 @@ struct hostapd_channel_data {
@@ -280,7 +280,7 @@
};
#define HE_MAC_CAPAB_0 0
-@@ -5224,6 +5229,14 @@ struct wpa_driver_ops {
+@@ -5250,6 +5255,14 @@ struct wpa_driver_ops {
const s8 edcca_compensation);
int (*configure_edcca_threshold)(void *priv, const int *threshold);
int (*get_edcca)(void *priv, const u8 mode, u8 *value);
@@ -296,10 +296,10 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index d59efe8b6..c234eb029 100644
+index 606632aad..2e011e3df 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -13917,6 +13917,114 @@ fail:
+@@ -13939,6 +13939,114 @@ fail:
}
@@ -414,7 +414,7 @@
#ifdef CONFIG_DPP
static int nl80211_dpp_listen(void *priv, bool enable)
{
-@@ -14396,6 +14504,8 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -14418,6 +14526,8 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.update_connect_params = nl80211_update_connection_params,
.send_external_auth_status = nl80211_send_external_auth_status,
.set_4addr_mode = nl80211_set_4addr_mode,
@@ -436,7 +436,7 @@
u32 ignore_next_local_disconnect;
u32 ignore_next_local_deauth;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index cd4d799a1..9c0a47971 100644
+index 465fd318d..0eda91d0f 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1144,6 +1144,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
@@ -450,5 +450,5 @@
}
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0018-hostapd-MLO-send-link-id-during-flushing-stations.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0018-hostapd-MLO-send-link-id-during-flushing-stations.patch
deleted file mode 100644
index ce4a844..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0018-hostapd-MLO-send-link-id-during-flushing-stations.patch
+++ /dev/null
@@ -1,156 +0,0 @@
-From 8ac142806112477fa012414a2bdea22239e474a4 Mon Sep 17 00:00:00 2001
-From: Aditya Kumar Singh <quic_adisi@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:48 +0530
-Subject: [PATCH 018/104] hostapd: MLO: send link id during flushing stations
-
-Currently, whenever a BSS is set up, it sends flush all stations via
-command - NL80211_CMD_DEL_STATION on its interface. However, in case
-of MLO, station could have been connected to other links by the time
-this link is coming up. Since there is no link id currently being
-passed, all those stations entries are also removed in the driver which is
-wrong.
-
-Hence add change to send link id along with the command during MLO so that
-the driver can use this link id and flush only those stations which are
-using the passed link id as one of its links.
-
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/ap/ap_drv_ops.c | 10 +++++++++-
- src/drivers/driver.h | 4 +++-
- src/drivers/driver_atheros.c | 2 +-
- src/drivers/driver_bsd.c | 2 +-
- src/drivers/driver_hostap.c | 2 +-
- src/drivers/driver_nl80211.c | 17 ++++++++++++++---
- 6 files changed, 29 insertions(+), 8 deletions(-)
-
-diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 0d493b837..32722084d 100644
---- a/src/ap/ap_drv_ops.c
-+++ b/src/ap/ap_drv_ops.c
-@@ -624,9 +624,17 @@ int hostapd_get_seqnum(const char *ifname, struct hostapd_data *hapd,
-
- int hostapd_flush(struct hostapd_data *hapd)
- {
-+ int link_id = -1;
-+
- if (hapd->driver == NULL || hapd->driver->flush == NULL)
- return 0;
-- return hapd->driver->flush(hapd->drv_priv);
-+
-+#ifdef CONFIG_IEEE80211BE
-+ if (hapd->conf && hapd->conf->mld_ap)
-+ link_id = hapd->mld_link_id;
-+#endif /* CONFIG_IEEE80211BE */
-+
-+ return hapd->driver->flush(hapd->drv_priv, link_id);
- }
-
-
-diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index a7455ef6e..e672a1787 100644
---- a/src/drivers/driver.h
-+++ b/src/drivers/driver.h
-@@ -3578,13 +3578,15 @@ struct wpa_driver_ops {
- /**
- * flush - Flush all association stations (AP only)
- * @priv: Private driver interface data
-+ * @link_id: In case of MLO, valid link_id on which all associated stations
-+ * will be flushed. -1 otherwise.
- * Returns: 0 on success, -1 on failure
- *
- * This function requests the driver to disassociate all associated
- * stations. This function does not need to be implemented if the
- * driver does not process association frames internally.
- */
-- int (*flush)(void *priv);
-+ int (*flush)(void *priv, int link_id);
-
- /**
- * set_generic_elem - Add IEs into Beacon/Probe Response frames (AP)
-diff --git a/src/drivers/driver_atheros.c b/src/drivers/driver_atheros.c
-index ae7f0e535..71863306a 100644
---- a/src/drivers/driver_atheros.c
-+++ b/src/drivers/driver_atheros.c
-@@ -632,7 +632,7 @@ atheros_get_seqnum(const char *ifname, void *priv, const u8 *addr, int idx,
-
-
- static int
--atheros_flush(void *priv)
-+atheros_flush(void *priv, int link_id)
- {
- u8 allsta[IEEE80211_ADDR_LEN];
- os_memset(allsta, 0xff, IEEE80211_ADDR_LEN);
-diff --git a/src/drivers/driver_bsd.c b/src/drivers/driver_bsd.c
-index 850637f0d..82d8a0186 100644
---- a/src/drivers/driver_bsd.c
-+++ b/src/drivers/driver_bsd.c
-@@ -946,7 +946,7 @@ bsd_get_seqnum(const char *ifname, void *priv, const u8 *addr, int idx,
-
-
- static int
--bsd_flush(void *priv)
-+bsd_flush(void *priv, int link_id)
- {
- u8 allsta[IEEE80211_ADDR_LEN];
-
-diff --git a/src/drivers/driver_hostap.c b/src/drivers/driver_hostap.c
-index d3520aacc..3aa5860bc 100644
---- a/src/drivers/driver_hostap.c
-+++ b/src/drivers/driver_hostap.c
-@@ -572,7 +572,7 @@ static int hostap_set_ssid(void *priv, const u8 *buf, int len)
- }
-
-
--static int hostap_flush(void *priv)
-+static int hostap_flush(void *priv, int link_id)
- {
- struct hostap_driver_data *drv = priv;
- struct prism2_hostapd_param param;
-diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index e5fa22b59..9ac621ae6 100644
---- a/src/drivers/driver_nl80211.c
-+++ b/src/drivers/driver_nl80211.c
-@@ -7729,25 +7729,36 @@ static int i802_set_frag(void *priv, int frag)
- }
-
-
--static int i802_flush(void *priv)
-+static int i802_flush(void *priv, int link_id)
- {
- struct i802_bss *bss = priv;
- struct nl_msg *msg;
- int res;
-
-- wpa_printf(MSG_DEBUG, "nl80211: flush -> DEL_STATION %s (all)",
-- bss->ifname);
-+ if (link_id == NL80211_DRV_LINK_ID_NA)
-+ wpa_printf(MSG_DEBUG, "nl80211: flush -> DEL_STATION %s (all)",
-+ bss->ifname);
-+ else
-+ wpa_printf(MSG_DEBUG, "nl80211: flush -> DEL_STATION %s (with link %d)",
-+ bss->ifname, link_id);
-
- /*
- * XXX: FIX! this needs to flush all VLANs too
- */
- msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_STATION);
-+ if (link_id >= 0 && (bss->valid_links & BIT(link_id)) &&
-+ nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id))
-+ goto fail;
-+
- res = send_and_recv_cmd(bss->drv, msg);
- if (res) {
- wpa_printf(MSG_DEBUG, "nl80211: Station flush failed: ret=%d "
- "(%s)", res, strerror(-res));
- }
- return res;
-+fail:
-+ nlmsg_free(msg);
-+ return -1;
- }
-
-
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0035-mtk-hostapd-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0018-mtk-hostapd-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
similarity index 88%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0035-mtk-hostapd-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0018-mtk-hostapd-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
index 596fdd3..5033c63 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0035-mtk-hostapd-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0018-mtk-hostapd-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
@@ -1,7 +1,7 @@
-From 588292b2fac44452523a27ece07b85fbd0f41c5d Mon Sep 17 00:00:00 2001
+From d6a05d4839676a55e440ea03420000dd2499b4c9 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Fri, 2 Sep 2022 01:03:23 +0800
-Subject: [PATCH 035/104] mtk: hostapd: Add three wire PTA ctrl hostapd vendor
+Subject: [PATCH 018/126] mtk: hostapd: Add three wire PTA ctrl hostapd vendor
command
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
@@ -20,10 +20,10 @@
11 files changed, 93 insertions(+)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index 637c2df9f..3d9923692 100644
+index 22da72c07..ebbd56734 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -5391,6 +5391,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -5513,6 +5513,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
return 1;
}
conf->edcca_compensation = (s8) val;
@@ -35,10 +35,10 @@
wpa_printf(MSG_ERROR,
"Line %d: unknown configuration item '%s'",
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
-index 9b3ef0b5b..79fd3a24b 100644
+index 45c391a65..cd520ebdc 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
-@@ -306,6 +306,7 @@ struct hostapd_config * hostapd_config_defaults(void)
+@@ -308,6 +308,7 @@ struct hostapd_config * hostapd_config_defaults(void)
conf->edcca_enable = EDCCA_MODE_AUTO;
conf->edcca_compensation = EDCCA_DEFAULT_COMPENSATION;
@@ -47,10 +47,10 @@
hostapd_set_and_check_bw320_offset(conf, 0);
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index f7dbbbec3..d1bbd238c 100644
+index baf3b40f8..3ab6cae2c 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1286,6 +1286,19 @@ struct hostapd_config {
+@@ -1339,6 +1339,19 @@ struct hostapd_config {
u8 edcca_enable;
s8 edcca_compensation;
int *edcca_threshold;
@@ -71,10 +71,10 @@
enum edcca_mode {
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 897ed6af8..587b8f37f 100644
+index 56d923462..fa6aa7085 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1283,3 +1283,14 @@ int hostapd_drv_mu_dump(struct hostapd_data *hapd, u8 *mu_onoff)
+@@ -1312,3 +1312,14 @@ int hostapd_drv_mu_dump(struct hostapd_data *hapd, u8 *mu_onoff)
return 0;
return hapd->driver->mu_dump(hapd->drv_priv, mu_onoff);
}
@@ -90,10 +90,10 @@
+ return hapd->driver->three_wire_ctrl(hapd->drv_priv, hapd->iconf->three_wire_enable);
+}
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index 5ab20cc41..7448e7954 100644
+index 47b23513f..008f56e76 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -155,6 +155,7 @@ int hostapd_drv_configure_edcca_threshold(struct hostapd_data *hapd,
+@@ -158,6 +158,7 @@ int hostapd_drv_configure_edcca_threshold(struct hostapd_data *hapd,
int hostapd_drv_get_edcca(struct hostapd_data *hapd, const u8 mode, u8 *value);
int hostapd_drv_mu_ctrl(struct hostapd_data *hapd);
int hostapd_drv_mu_dump(struct hostapd_data *hapd, u8 *mu_onoff);
@@ -102,10 +102,10 @@
#include "drivers/driver.h"
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index d29b51fc5..5ceb49962 100644
+index 227474db5..56a024bbf 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -2701,6 +2701,8 @@ dfs_offload:
+@@ -2764,6 +2764,8 @@ dfs_offload:
goto fail;
if (hostapd_drv_mu_ctrl(hapd) < 0)
goto fail;
@@ -149,10 +149,10 @@
MTK_VENDOR_ATTR_CSI_CTRL_UNSPEC,
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index df7ce5ab9..dec4336a4 100644
+index 2217809db..13e91d21d 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5237,6 +5237,14 @@ struct wpa_driver_ops {
+@@ -5263,6 +5263,14 @@ struct wpa_driver_ops {
*/
int (*mu_ctrl)(void *priv, u8 mu_onoff);
int (*mu_dump)(void *priv, u8 *mu_onoff);
@@ -168,10 +168,10 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index c234eb029..c9899e492 100644
+index 2e011e3df..f94fa19b0 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -14357,6 +14357,38 @@ static int nl80211_get_edcca(void *priv, const u8 mode, u8 *value)
+@@ -14379,6 +14379,38 @@ static int nl80211_get_edcca(void *priv, const u8 mode, u8 *value)
return ret;
}
@@ -210,7 +210,7 @@
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211",
-@@ -14524,4 +14556,5 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -14546,4 +14578,5 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.configure_edcca_enable = nl80211_configure_edcca_enable,
.configure_edcca_threshold = nl80211_configure_edcca_threshold,
.get_edcca = nl80211_get_edcca,
@@ -229,7 +229,7 @@
u32 ignore_next_local_disconnect;
u32 ignore_next_local_deauth;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index 9c0a47971..fddcf8349 100644
+index 0eda91d0f..433eecf56 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1147,6 +1147,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
@@ -243,5 +243,5 @@
}
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0019-hostapd-MLO-display-link-details-in-status-command.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0019-hostapd-MLO-display-link-details-in-status-command.patch
deleted file mode 100644
index 77f3ddd..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0019-hostapd-MLO-display-link-details-in-status-command.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 3d12a39b10565a10bec40b53cf6e69b60115a35f Mon Sep 17 00:00:00 2001
-From: Harshitha Prem <quic_hprem@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:49 +0530
-Subject: [PATCH 019/104] hostapd: MLO: display link details in status command
-
-Currently, link id and number of link details of a MLD AP interface is not
-displayed in status command of hostapd_cli.
-
-Add changes to display the link id and number of link details.
-
-The details would be seen as below for a MLD AP interface:
-
-$ hostapd_cli -i wlan0 status | grep link
-num_links=1
-link_id=0
-link_addr=AA:BB:CC:DD:EE:FF
-
-$ hostapd_cli -i wlan1 status | grep link
-num_links=2
-link_id=0
-link_addr=AA:BB:CC:DD:EE:FF
-partner_link_id=1
-partner_link_addr=AA:BB:CC:DD:EE:AA
-
-The above details would not be displayed for non-MLD AP interfaces.
-
-Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
-Co-developed-by: Manish Dharanenthiran <quic_mdharane@quicinc.com>
-Signed-off-by: Manish Dharanenthiran <quic_mdharane@quicinc.com>
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/ap/ctrl_iface_ap.c | 36 ++++++++++++++++++++++++++++++++++++
- 1 file changed, 36 insertions(+)
-
-diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
-index 272317774..2cfef4bd4 100644
---- a/src/ap/ctrl_iface_ap.c
-+++ b/src/ap/ctrl_iface_ap.c
-@@ -887,6 +887,42 @@ int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf,
- return len;
- len += ret;
- }
-+
-+ if (hapd->conf->mld_ap) {
-+ struct hostapd_data *link_bss;
-+
-+ ret = os_snprintf(buf + len, buflen - len,
-+ "num_links=%d\n",
-+ hapd->mld->num_links);
-+ if (os_snprintf_error(buflen - len, ret))
-+ return len;
-+ len += ret;
-+
-+ /* self bss */
-+ ret = os_snprintf(buf + len, buflen - len,
-+ "link_id=%d\n"
-+ "link_addr=" MACSTR "\n",
-+ hapd->mld_link_id,
-+ MAC2STR(hapd->own_addr));
-+ if (os_snprintf_error(buflen - len, ret))
-+ return len;
-+ len += ret;
-+
-+ /* partner bss */
-+ for_each_mld_link(link_bss, hapd) {
-+ if (link_bss == hapd)
-+ continue;
-+
-+ ret = os_snprintf(buf + len, buflen - len,
-+ "partner_link_id=%d\n"
-+ "partner_link_addr=" MACSTR "\n",
-+ link_bss->mld_link_id,
-+ MAC2STR(link_bss->own_addr));
-+ if (os_snprintf_error(buflen - len, ret))
-+ return len;
-+ len += ret;
-+ }
-+ }
- }
- #endif /* CONFIG_IEEE80211BE */
-
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0036-mtk-hostapd-Add-hostapd-iBF-control.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0019-mtk-hostapd-Add-hostapd-iBF-control.patch
similarity index 89%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0036-mtk-hostapd-Add-hostapd-iBF-control.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0019-mtk-hostapd-Add-hostapd-iBF-control.patch
index 56149a4..161d154 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0036-mtk-hostapd-Add-hostapd-iBF-control.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0019-mtk-hostapd-Add-hostapd-iBF-control.patch
@@ -1,7 +1,7 @@
-From 235a6041bde6ce30da6e631b901260dec5fadcda Mon Sep 17 00:00:00 2001
+From 63d5ec844ead699159dd047efc91717861efba41 Mon Sep 17 00:00:00 2001
From: mtk27835 <shurong.wen@mediatek.com>
Date: Wed, 7 Sep 2022 14:41:51 -0700
-Subject: [PATCH 036/104] mtk: hostapd: Add hostapd iBF control
+Subject: [PATCH 019/126] mtk: hostapd: Add hostapd iBF control
Signed-off-by: mtk27835 <shurong.wen@mediatek.com>
---
@@ -21,10 +21,10 @@
13 files changed, 224 insertions(+), 1 deletion(-)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index 3d9923692..247d68811 100644
+index ebbd56734..e437aa981 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -5395,6 +5395,9 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -5517,6 +5517,9 @@ static int hostapd_config_fill(struct hostapd_config *conf,
u8 en = atoi(pos);
conf->three_wire_enable = en;
@@ -35,10 +35,10 @@
wpa_printf(MSG_ERROR,
"Line %d: unknown configuration item '%s'",
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 3a79a1284..10bbce341 100644
+index d168c2fb5..3221c0fb1 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -4110,6 +4110,30 @@ hostapd_ctrl_iface_get_mu(struct hostapd_data *hapd, char *buf,
+@@ -4240,6 +4240,30 @@ hostapd_ctrl_iface_get_mu(struct hostapd_data *hapd, char *buf,
}
@@ -69,7 +69,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
int reply_size,
-@@ -4721,6 +4745,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4859,6 +4883,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
reply_size);
} else if (os_strncmp(buf, "GET_MU", 6) == 0) {
reply_len = hostapd_ctrl_iface_get_mu(hapd, reply, reply_size);
@@ -79,10 +79,10 @@
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index da9dabd6f..276ca578c 100644
+index f4dc1517e..ccbf863f6 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1666,6 +1666,13 @@ static int hostapd_cli_cmd_driver(struct wpa_ctrl *ctrl, int argc, char *argv[])
+@@ -1691,6 +1691,13 @@ static int hostapd_cli_cmd_driver(struct wpa_ctrl *ctrl, int argc, char *argv[])
#endif /* ANDROID */
@@ -96,7 +96,7 @@
struct hostapd_cli_cmd {
const char *cmd;
int (*handler)(struct wpa_ctrl *ctrl, int argc, char *argv[]);
-@@ -1889,6 +1896,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1921,6 +1928,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
#endif /* ANDROID */
{ "inband_discovery", hostapd_cli_cmd_inband_discovery, NULL,
"<tx type(0/1/2)> <interval> = runtime set inband discovery" },
@@ -106,10 +106,10 @@
};
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
-index 79fd3a24b..04e263167 100644
+index cd520ebdc..08b55d0eb 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
-@@ -307,6 +307,7 @@ struct hostapd_config * hostapd_config_defaults(void)
+@@ -309,6 +309,7 @@ struct hostapd_config * hostapd_config_defaults(void)
conf->edcca_enable = EDCCA_MODE_AUTO;
conf->edcca_compensation = EDCCA_DEFAULT_COMPENSATION;
conf->three_wire_enable = THREE_WIRE_MODE_DISABLE;
@@ -118,10 +118,10 @@
hostapd_set_and_check_bw320_offset(conf, 0);
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index d1bbd238c..5f084796d 100644
+index 3ab6cae2c..3f07147db 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1287,6 +1287,7 @@ struct hostapd_config {
+@@ -1340,6 +1340,7 @@ struct hostapd_config {
s8 edcca_compensation;
int *edcca_threshold;
u8 three_wire_enable;
@@ -129,7 +129,7 @@
};
enum three_wire_mode {
-@@ -1450,6 +1451,7 @@ hostapd_set_and_check_bw320_offset(struct hostapd_config *conf,
+@@ -1503,6 +1504,7 @@ hostapd_set_and_check_bw320_offset(struct hostapd_config *conf,
#endif /* CONFIG_IEEE80211BE */
}
@@ -138,10 +138,10 @@
int hostapd_mac_comp(const void *a, const void *b);
struct hostapd_config * hostapd_config_defaults(void);
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 587b8f37f..3cace58e5 100644
+index fa6aa7085..5172f06b9 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1294,3 +1294,17 @@ int hostapd_drv_three_wire_ctrl(struct hostapd_data *hapd)
+@@ -1323,3 +1323,17 @@ int hostapd_drv_three_wire_ctrl(struct hostapd_data *hapd)
}
return hapd->driver->three_wire_ctrl(hapd->drv_priv, hapd->iconf->three_wire_enable);
}
@@ -161,10 +161,10 @@
+}
\ No newline at end of file
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index 7448e7954..0886acb2d 100644
+index 008f56e76..3633e2ed5 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -156,6 +156,8 @@ int hostapd_drv_get_edcca(struct hostapd_data *hapd, const u8 mode, u8 *value);
+@@ -159,6 +159,8 @@ int hostapd_drv_get_edcca(struct hostapd_data *hapd, const u8 mode, u8 *value);
int hostapd_drv_mu_ctrl(struct hostapd_data *hapd);
int hostapd_drv_mu_dump(struct hostapd_data *hapd, u8 *mu_onoff);
int hostapd_drv_three_wire_ctrl(struct hostapd_data *hapd);
@@ -174,10 +174,10 @@
#include "drivers/driver.h"
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index 5ceb49962..1d941683f 100644
+index 56a024bbf..7503718c8 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -2703,6 +2703,8 @@ dfs_offload:
+@@ -2766,6 +2766,8 @@ dfs_offload:
goto fail;
if (hostapd_drv_three_wire_ctrl(hapd) < 0)
goto fail;
@@ -240,7 +240,7 @@
#define CSI_MAX_COUNT 256
#define ETH_ALEN 6
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index dec4336a4..f5cff646e 100644
+index 13e91d21d..97be9e8fb 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -181,6 +181,11 @@ struct hostapd_channel_data {
@@ -255,7 +255,7 @@
};
#define HE_MAC_CAPAB_0 0
-@@ -5245,6 +5250,20 @@ struct wpa_driver_ops {
+@@ -5271,6 +5276,20 @@ struct wpa_driver_ops {
*
*/
int (*three_wire_ctrl)(void *priv, u8 three_wire_enable);
@@ -277,10 +277,10 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index c9899e492..c17052f22 100644
+index f94fa19b0..c5c0d1b49 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -14390,6 +14390,112 @@ static int nl80211_enable_three_wire(void *priv, const u8 three_wire_enable)
+@@ -14412,6 +14412,112 @@ static int nl80211_enable_three_wire(void *priv, const u8 three_wire_enable)
return ret;
}
@@ -393,7 +393,7 @@
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211",
.desc = "Linux nl80211/cfg80211",
-@@ -14557,4 +14663,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -14579,4 +14685,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.configure_edcca_threshold = nl80211_configure_edcca_threshold,
.get_edcca = nl80211_get_edcca,
.three_wire_ctrl = nl80211_enable_three_wire,
@@ -413,7 +413,7 @@
u32 ignore_next_local_disconnect;
u32 ignore_next_local_deauth;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index fddcf8349..615af2eb2 100644
+index 433eecf56..670588dd2 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1150,6 +1150,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
@@ -427,5 +427,5 @@
}
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0020-hostapd-fix-RNR-building-for-co-location-and-MLO.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0020-hostapd-fix-RNR-building-for-co-location-and-MLO.patch
deleted file mode 100644
index 879adf1..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0020-hostapd-fix-RNR-building-for-co-location-and-MLO.patch
+++ /dev/null
@@ -1,748 +0,0 @@
-From 8affcd80f5143fa23d3f21427b6b9f11af35ef5d Mon Sep 17 00:00:00 2001
-From: Aditya Kumar Singh <quic_adisi@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:50 +0530
-Subject: [PATCH 020/104] hostapd: fix RNR building for co-location and MLO
-
-Currently with MLO changes, RNR formation for co-location or MLO
-was not working as expected. Hence make it work as per the
-expectation.
-
-For example, during co-location, if the BSS is also its ML partner
-then there is no need to include a separate TBTT for it.
-
-Also, during co-location, if the BSS is not its partner but it is
-ML capable, then the TBTT length should be 16 bytes and it should
-include the MLD Parameters for it in the RNR.
-
-During co-location, for a given Neighbor AP (operating on a given
-channel and op-class) if it has BSSes which are ML capable as well
-as BSSes which are not, then there should be two Neighbor AP Info
-present. One indicating TBTT length as 13 bytes and one indicating
-TBTT info length as 16 bytes.
-
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- src/ap/beacon.c | 12 +-
- src/ap/ieee802_11.c | 387 ++++++++++++++++++++++++++++++++------------
- src/ap/ieee802_11.h | 5 +-
- 3 files changed, 290 insertions(+), 114 deletions(-)
-
-diff --git a/src/ap/beacon.c b/src/ap/beacon.c
-index b780d98e4..4354dfae3 100644
---- a/src/ap/beacon.c
-+++ b/src/ap/beacon.c
-@@ -677,7 +677,7 @@ static size_t hostapd_probe_resp_elems_len(struct hostapd_data *hapd,
- params->known_bss,
- params->known_bss_len, NULL);
- if (!params->is_ml_sta_info)
-- buflen += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_PROBE_RESP);
-+ buflen += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_PROBE_RESP, true);
- buflen += hostapd_mbo_ie_len(hapd);
- buflen += hostapd_eid_owe_trans_len(hapd);
- buflen += hostapd_eid_dpp_cc_len(hapd);
-@@ -797,7 +797,7 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd,
- pos = hostapd_eid_wb_chsw_wrapper(hapd, pos);
-
- if (!params->is_ml_sta_info)
-- pos = hostapd_eid_rnr(hapd, pos, WLAN_FC_STYPE_PROBE_RESP);
-+ pos = hostapd_eid_rnr(hapd, pos, WLAN_FC_STYPE_PROBE_RESP, true);
- pos = hostapd_eid_fils_indic(hapd, pos, 0);
- pos = hostapd_get_rsnxe(hapd, pos, epos - pos);
-
-@@ -1946,7 +1946,7 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, size_t *len)
- total_len += 3;
- }
-
-- total_len += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_ACTION);
-+ total_len += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_ACTION, true);
-
- pos = hostapd_eid_fils_indic(hapd, buf, 0);
- buf_len = pos - buf;
-@@ -2020,7 +2020,7 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, size_t *len)
- /* Fill in the Length field value */
- *length_pos = pos - (length_pos + 1);
-
-- pos = hostapd_eid_rnr(hapd, pos, WLAN_FC_STYPE_ACTION);
-+ pos = hostapd_eid_rnr(hapd, pos, WLAN_FC_STYPE_ACTION, true);
-
- /* FILS Indication element */
- if (buf_len) {
-@@ -2126,7 +2126,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
- if (hapd->iconf->mbssid == ENHANCED_MBSSID_ENABLED &&
- hapd == hostapd_mbssid_get_tx_bss(hapd))
- tail_len += 5; /* Multiple BSSID Configuration element */
-- tail_len += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_BEACON);
-+ tail_len += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_BEACON, true);
- tail_len += hostapd_mbo_ie_len(hapd);
- tail_len += hostapd_eid_owe_trans_len(hapd);
- tail_len += hostapd_eid_dpp_cc_len(hapd);
-@@ -2262,7 +2262,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
-
- tailpos = hostapd_eid_wb_chsw_wrapper(hapd, tailpos);
-
-- tailpos = hostapd_eid_rnr(hapd, tailpos, WLAN_FC_STYPE_BEACON);
-+ tailpos = hostapd_eid_rnr(hapd, tailpos, WLAN_FC_STYPE_BEACON, true);
- tailpos = hostapd_eid_fils_indic(hapd, tailpos, 0);
- tailpos = hostapd_get_rsnxe(hapd, tailpos, tailend - tailpos);
- tailpos = hostapd_eid_mbssid_config(hapd, tailpos,
-diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index 7ee18f4ae..9a23c7240 100644
---- a/src/ap/ieee802_11.c
-+++ b/src/ap/ieee802_11.c
-@@ -7273,20 +7273,21 @@ static size_t
- hostapd_eid_rnr_iface_len(struct hostapd_data *hapd,
- struct hostapd_data *reporting_hapd,
- size_t *current_len,
-- struct mbssid_ie_profiles *skip_profiles)
-+ struct mbssid_ie_profiles *skip_profiles,
-+ bool mld_update)
- {
- size_t total_len = 0, len = *current_len;
-- int tbtt_count = 0;
-- size_t i, start = 0;
-- bool ap_mld = false;
-+ int tbtt_count, total_tbtt_count = 0;
-+ size_t i, start;
-+ u8 tbtt_info_len = mld_update ? RNR_TBTT_INFO_MLD_LEN : RNR_TBTT_INFO_LEN;
-
--#ifdef CONFIG_IEEE80211BE
-- ap_mld = !!hapd->conf->mld_ap;
--#endif /* CONFIG_IEEE80211BE */
-+repeat_rnr_len:
-+ start = 0;
-+ tbtt_count = 0;
-
- while (start < hapd->iface->num_bss) {
- if (!len ||
-- len + RNR_TBTT_HEADER_LEN + RNR_TBTT_INFO_LEN > 255 ||
-+ len + RNR_TBTT_HEADER_LEN + tbtt_info_len > 255 ||
- tbtt_count >= RNR_TBTT_INFO_COUNT_MAX) {
- len = RNR_HEADER_LEN;
- total_len += RNR_HEADER_LEN;
-@@ -7298,10 +7299,15 @@ hostapd_eid_rnr_iface_len(struct hostapd_data *hapd,
-
- for (i = start; i < hapd->iface->num_bss; i++) {
- struct hostapd_data *bss = hapd->iface->bss[i];
-+ bool ap_mld = false;
-
- if (!bss || !bss->conf || !bss->started)
- continue;
-
-+#ifdef CONFIG_IEEE80211BE
-+ ap_mld = !!bss->conf->mld_ap;
-+#endif /* CONFIG_IEEE80211BE */
-+
- if (bss == reporting_hapd ||
- bss->conf->ignore_broadcast_ssid)
- continue;
-@@ -7310,23 +7316,71 @@ hostapd_eid_rnr_iface_len(struct hostapd_data *hapd,
- i >= skip_profiles->start && i < skip_profiles->end)
- continue;
-
-- if (len + RNR_TBTT_INFO_LEN > 255 ||
-+ /* No need to report if length is for normal TBTT and the BSS
-+ * is a MLD. MLD TBTT will include this.
-+ */
-+ if (tbtt_info_len == RNR_TBTT_INFO_LEN && ap_mld)
-+ continue;
-+
-+ /* No need to report if length is for MLD TBTT and the BSS
-+ * is not MLD. Normal TBTT will include this.
-+ */
-+ if (tbtt_info_len == RNR_TBTT_INFO_MLD_LEN && !ap_mld)
-+ continue;
-+
-+#ifdef CONFIG_IEEE80211BE
-+ /* If building for co-location and they are ML partners,
-+ * no need to include since the ML RNR will carry this.
-+ */
-+ if (!mld_update && hostapd_is_ml_partner(reporting_hapd, bss))
-+ continue;
-+
-+ /* If building for ML RNR and they are not ML parnters,
-+ * don't include.
-+ */
-+ if (mld_update && !hostapd_is_ml_partner(reporting_hapd, bss))
-+ continue;
-+#endif /* CONFIG_IEEE80211BE */
-+
-+ if (len + tbtt_info_len > 255 ||
- tbtt_count >= RNR_TBTT_INFO_COUNT_MAX)
- break;
-
-- if (!ap_mld) {
-- len += RNR_TBTT_INFO_LEN;
-- total_len += RNR_TBTT_INFO_LEN;
-- } else {
-- len += RNR_TBTT_INFO_MLD_LEN;
-- total_len += RNR_TBTT_INFO_MLD_LEN;
-- }
-+ len += tbtt_info_len;
-+ total_len += tbtt_info_len;
- tbtt_count++;
- }
- start = i;
- }
-
-- if (!tbtt_count)
-+ total_tbtt_count += tbtt_count;
-+
-+ /* If building for co-location, re-build again but this time include
-+ * ML TBTTs.
-+ */
-+ if (!mld_update && tbtt_info_len == RNR_TBTT_INFO_LEN) {
-+ tbtt_info_len = RNR_TBTT_INFO_MLD_LEN;
-+
-+ /* If no TBTT was found, then adjust the len and total_len since
-+ * it would have incremented before we checked all bss.
-+ */
-+ if (!tbtt_count) {
-+ len -= RNR_TBTT_HEADER_LEN;
-+ total_len -= RNR_TBTT_HEADER_LEN;
-+ }
-+
-+ goto repeat_rnr_len;
-+ }
-+
-+ /* this is possible when it re-built and in that no suitable TBTT was
-+ * found. Adjust the length accordingly.
-+ */
-+ if (!tbtt_count && total_tbtt_count) {
-+ len -= RNR_TBTT_HEADER_LEN;
-+ total_len -= RNR_TBTT_HEADER_LEN;
-+ }
-+
-+ if (!total_tbtt_count)
- total_len = 0;
- else
- *current_len = len;
-@@ -7375,8 +7429,8 @@ static enum colocation_mode get_colocation_mode(struct hostapd_data *hapd)
- }
-
-
--static size_t hostapd_eid_rnr_multi_iface_len(struct hostapd_data *hapd,
-- size_t *current_len)
-+static size_t hostapd_eid_rnr_colocation_len(struct hostapd_data *hapd,
-+ size_t *current_len)
- {
- struct hostapd_iface *iface;
- size_t len = 0;
-@@ -7387,34 +7441,57 @@ static size_t hostapd_eid_rnr_multi_iface_len(struct hostapd_data *hapd,
-
- for (i = 0; i < hapd->iface->interfaces->count; i++) {
- iface = hapd->iface->interfaces->iface[i];
-- bool ap_mld = false;
--
--#ifdef CONFIG_IEEE80211BE
-- if (hostapd_is_ml_partner(hapd, iface->bss[0]))
-- ap_mld = true;
--#endif /* CONFIG_IEEE80211BE */
-
-- if (iface == hapd->iface ||
-- !(is_6ghz_op_class(iface->conf->op_class) || ap_mld))
-+ if (!iface || iface == hapd->iface ||
-+ !is_6ghz_op_class(iface->conf->op_class))
- continue;
-
- len += hostapd_eid_rnr_iface_len(iface->bss[0], hapd,
-- current_len, NULL);
-+ current_len, NULL, false);
- }
-
- return len;
- }
-
--
--size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type)
-+static size_t hostapd_eid_rnr_mlo_len(struct hostapd_data *hapd, u32 type,
-+ size_t *current_len)
- {
-- size_t total_len = 0, current_len = 0;
-- enum colocation_mode mode = get_colocation_mode(hapd);
-- bool ap_mld = false;
-+ size_t len = 0;
-
- #ifdef CONFIG_IEEE80211BE
-- ap_mld = !!hapd->conf->mld_ap;
-+ struct hostapd_iface *iface;
-+ size_t i;
-+
-+ if (!hapd->iface || !hapd->iface->interfaces)
-+ return 0;
-+
-+ if (!hapd->conf->mld_ap)
-+ return 0;
-+
-+ /* TODO allow for FILS/Action as well */
-+ if (type != WLAN_FC_STYPE_BEACON && type != WLAN_FC_STYPE_PROBE_RESP)
-+ return 0;
-+
-+ for (i = 0; i < hapd->iface->interfaces->count; i++) {
-+ iface = hapd->iface->interfaces->iface[i];
-+
-+ if (!iface || iface == hapd->iface)
-+ continue;
-+
-+ if (hapd->iface->freq == iface->freq)
-+ continue;
-+
-+ len += hostapd_eid_rnr_iface_len(iface->bss[0], hapd,
-+ current_len, NULL, true);
-+ }
- #endif /* CONFIG_IEEE80211BE */
-+ return len;
-+}
-+
-+size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type, bool include_mld_params)
-+{
-+ size_t total_len = 0, current_len = 0;
-+ enum colocation_mode mode = get_colocation_mode(hapd);
-
- switch (type) {
- case WLAN_FC_STYPE_BEACON:
-@@ -7423,29 +7500,35 @@ size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type)
- /* fallthrough */
-
- case WLAN_FC_STYPE_PROBE_RESP:
-- if (mode == COLOCATED_LOWER_BAND || ap_mld)
-+ if (mode == COLOCATED_LOWER_BAND)
- total_len +=
-- hostapd_eid_rnr_multi_iface_len(hapd,
-- ¤t_len);
-+ hostapd_eid_rnr_colocation_len(hapd,
-+ ¤t_len);
-
- if (hapd->conf->rnr && hapd->iface->num_bss > 1 &&
- !hapd->iconf->mbssid)
- total_len += hostapd_eid_rnr_iface_len(hapd, hapd,
- ¤t_len,
-- NULL);
-+ NULL, false);
- break;
-
- case WLAN_FC_STYPE_ACTION:
- if (hapd->iface->num_bss > 1 && mode == STANDALONE_6GHZ)
- total_len += hostapd_eid_rnr_iface_len(hapd, hapd,
- ¤t_len,
-- NULL);
-+ NULL, false);
- break;
-
- default:
- break;
- }
-
-+ /* For EMA Beacons, MLD neighbor repoting is added as part of mbssid rnr */
-+ if (include_mld_params &&
-+ (type != WLAN_FC_STYPE_BEACON ||
-+ hapd->iconf->mbssid != ENHANCED_MBSSID_ENABLED))
-+ total_len += hostapd_eid_rnr_mlo_len(hapd, type, ¤t_len);
-+
- return total_len;
- }
-
-@@ -7509,13 +7592,14 @@ static bool hostapd_eid_rnr_bss(struct hostapd_data *hapd,
- struct hostapd_data *reporting_hapd,
- struct mbssid_ie_profiles *skip_profiles,
- size_t i, u8 *tbtt_count, size_t *len,
-- u8 **pos)
-+ u8 **pos, u8 **tbtt_count_pos, u8 tbtt_info_len,
-+ u8 op_class, bool mld_update)
- {
- struct hostapd_iface *iface = hapd->iface;
- struct hostapd_data *bss = iface->bss[i];
- u8 bss_param = 0;
-- bool ap_mld = false;
- u8 *eid = *pos;
-+ bool ap_mld = false;
-
- #ifdef CONFIG_IEEE80211BE
- ap_mld = !!hapd->conf->mld_ap;
-@@ -7529,10 +7613,47 @@ static bool hostapd_eid_rnr_bss(struct hostapd_data *hapd,
- && i >= skip_profiles->start && i < skip_profiles->end)
- return false;
-
-+ /* No need to report if length is for normal TBTT and the BSS
-+ * is a MLD. MLD TBTT will include this.
-+ */
-+ if (tbtt_info_len == RNR_TBTT_INFO_LEN && ap_mld)
-+ return false;
-+
-+ /* No need to report if length is for MLD TBTT and the BSS
-+ * is not MLD. Normal TBTT will include this.
-+ */
-+ if (tbtt_info_len == RNR_TBTT_INFO_MLD_LEN && !ap_mld)
-+ return false;
-+
-+#ifdef CONFIG_IEEE80211BE
-+ /* If building for co-location and they are ML partners,
-+ * no need to include since the ML RNR will carry this.
-+ */
-+ if (!mld_update && hostapd_is_ml_partner(reporting_hapd, bss))
-+ return false;
-+
-+ /* If building for ML RNR and they are not ML parnters,
-+ * don't include.
-+ */
-+ if (mld_update && !hostapd_is_ml_partner(reporting_hapd, bss))
-+ return false;
-+#endif /* CONFIG_IEEE80211BE */
-+
- if (*len + RNR_TBTT_INFO_LEN > 255 ||
- *tbtt_count >= RNR_TBTT_INFO_COUNT_MAX)
- return true;
-
-+ if (!(*tbtt_count)) {
-+ /* Add Neighbor report header info only if there is at least
-+ * one tbtt info available
-+ */
-+ *tbtt_count_pos = eid++;
-+ *eid++ = tbtt_info_len;
-+ *eid++ = op_class;
-+ *eid++ = bss->iconf->channel;
-+ *len += RNR_TBTT_HEADER_LEN;
-+ }
-+
- *eid++ = RNR_NEIGHBOR_AP_OFFSET_UNKNOWN;
- os_memcpy(eid, bss->own_addr, ETH_ALEN);
- eid += ETH_ALEN;
-@@ -7556,29 +7677,36 @@ static bool hostapd_eid_rnr_bss(struct hostapd_data *hapd,
- *eid++ = bss_param;
- *eid++ = RNR_20_MHZ_PSD_MAX_TXPOWER;
-
-- if (!ap_mld) {
-- *len += RNR_TBTT_INFO_LEN;
-- } else {
- #ifdef CONFIG_IEEE80211BE
-- u8 param_ch = hapd->eht_mld_bss_param_change;
--
-- if (hostapd_is_ml_partner(bss, reporting_hapd))
-- *eid++ = 0;
-- else
-- *eid++ = hostapd_get_mld_id(hapd);
--
-- *eid++ = hapd->mld_link_id | ((param_ch & 0xF) << 4);
-- *eid = (param_ch >> 4) & 0xF;
-+ if (ap_mld) {
-+ u8 param_ch = bss->eht_mld_bss_param_change;
-+ bool is_partner;
-+
-+ /* If bss is not partner of the reporting_hapd then
-+ * a) MLD ID advertised shall be 255.
-+ * b) Link ID advertised shall be 15.
-+ * c) BPCC advertised shall be 255
-+ */
-+ is_partner = hostapd_is_ml_partner(bss, reporting_hapd);
-+ /* MLD ID */
-+ *eid++ = is_partner ? hostapd_get_mld_id(bss) : 0xFF;
-+ /* Link ID (Bit 3 to Bit 0)
-+ * BPCC (Bit 4 to Bit 7)
-+ */
-+ *eid++ = is_partner ?
-+ bss->mld_link_id | ((param_ch & 0xF) << 4) :
-+ (MAX_NUM_MLD_LINKS | 0xF0);
-+ /* BPCC (Bit 3 to Bit 0) */
-+ *eid = is_partner ? ((param_ch & 0xF0) >> 4) : 0x0F;
- #ifdef CONFIG_TESTING_OPTIONS
-- if (hapd->conf->mld_indicate_disabled)
-+ if (bss->conf->mld_indicate_disabled)
- *eid |= RNR_TBTT_INFO_MLD_PARAM2_LINK_DISABLED;
- #endif /* CONFIG_TESTING_OPTIONS */
- eid++;
--
-- *len += RNR_TBTT_INFO_MLD_LEN;
--#endif /* CONFIG_IEEE80211BE */
- }
-+#endif /* CONFIG_IEEE80211BE */
-
-+ *len += tbtt_info_len;
- (*tbtt_count)++;
- *pos = eid;
-
-@@ -7589,18 +7717,16 @@ static bool hostapd_eid_rnr_bss(struct hostapd_data *hapd,
- static u8 * hostapd_eid_rnr_iface(struct hostapd_data *hapd,
- struct hostapd_data *reporting_hapd,
- u8 *eid, size_t *current_len,
-- struct mbssid_ie_profiles *skip_profiles)
-+ struct mbssid_ie_profiles *skip_profiles,
-+ bool mld_update)
- {
- struct hostapd_iface *iface = hapd->iface;
-- size_t i, start = 0;
-+ size_t i, start;
- size_t len = *current_len;
-- u8 *tbtt_count_pos, *eid_start = eid, *size_offset = (eid - len) + 1;
-- u8 tbtt_count = 0, op_class, channel;
-- bool ap_mld = false;
--
--#ifdef CONFIG_IEEE80211BE
-- ap_mld = !!hapd->conf->mld_ap;
--#endif /* CONFIG_IEEE80211BE */
-+ u8 *eid_start = eid, *size_offset = (eid - len) + 1;
-+ u8 *tbtt_count_pos = size_offset + 1;
-+ u8 tbtt_count, total_tbtt_count = 0, op_class, channel;
-+ u8 tbtt_info_len = mld_update ? RNR_TBTT_INFO_MLD_LEN : RNR_TBTT_INFO_LEN;
-
- if (!(iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA) || !iface->freq)
- return eid;
-@@ -7612,9 +7738,12 @@ static u8 * hostapd_eid_rnr_iface(struct hostapd_data *hapd,
- NUM_HOSTAPD_MODES)
- return eid;
-
-+repeat_rnr:
-+ start = 0;
-+ tbtt_count = 0;
- while (start < iface->num_bss) {
- if (!len ||
-- len + RNR_TBTT_HEADER_LEN + RNR_TBTT_INFO_LEN > 255 ||
-+ len + RNR_TBTT_HEADER_LEN + tbtt_info_len > 255 ||
- tbtt_count >= RNR_TBTT_INFO_COUNT_MAX) {
- eid_start = eid;
- *eid++ = WLAN_EID_REDUCED_NEIGHBOR_REPORT;
-@@ -7623,34 +7752,42 @@ static u8 * hostapd_eid_rnr_iface(struct hostapd_data *hapd,
- tbtt_count = 0;
- }
-
-- tbtt_count_pos = eid++;
-- *eid++ = ap_mld ? RNR_TBTT_INFO_MLD_LEN : RNR_TBTT_INFO_LEN;
-- *eid++ = op_class;
-- *eid++ = hapd->iconf->channel;
-- len += RNR_TBTT_HEADER_LEN;
--
- for (i = start; i < iface->num_bss; i++) {
- if (hostapd_eid_rnr_bss(hapd, reporting_hapd,
- skip_profiles, i,
-- &tbtt_count, &len, &eid))
-+ &tbtt_count, &len, &eid,
-+ &tbtt_count_pos, tbtt_info_len,
-+ op_class, mld_update))
- break;
- }
-
- start = i;
-- *tbtt_count_pos = RNR_TBTT_INFO_COUNT(tbtt_count - 1);
-- *size_offset = (eid - size_offset) - 1;
-+
-+ if (tbtt_count) {
-+ *tbtt_count_pos = RNR_TBTT_INFO_COUNT(tbtt_count - 1);
-+ *size_offset = (eid - size_offset) - 1;
-+ }
-+ }
-+
-+ total_tbtt_count += tbtt_count;
-+
-+ /* If building for co-location, re-build again but this time include
-+ * ML TBTTs.
-+ */
-+ if (!mld_update && tbtt_info_len == RNR_TBTT_INFO_LEN) {
-+ tbtt_info_len = RNR_TBTT_INFO_MLD_LEN;
-+ goto repeat_rnr;
- }
-
-- if (tbtt_count == 0)
-+ if (!total_tbtt_count)
- return eid_start;
-
- *current_len = len;
- return eid;
- }
-
--
--static u8 * hostapd_eid_rnr_multi_iface(struct hostapd_data *hapd, u8 *eid,
-- size_t *current_len)
-+u8 *hostapd_eid_rnr_colocation(struct hostapd_data *hapd, u8 *eid,
-+ size_t *current_len)
- {
- struct hostapd_iface *iface;
- size_t i;
-@@ -7660,35 +7797,56 @@ static u8 * hostapd_eid_rnr_multi_iface(struct hostapd_data *hapd, u8 *eid,
-
- for (i = 0; i < hapd->iface->interfaces->count; i++) {
- iface = hapd->iface->interfaces->iface[i];
-- bool ap_mld = false;
-
--#ifdef CONFIG_IEEE80211BE
-- if (hostapd_is_ml_partner(hapd, iface->bss[0]))
-- ap_mld = true;
--#endif /* CONFIG_IEEE80211BE */
--
-- if (iface == hapd->iface ||
-- !(is_6ghz_op_class(iface->conf->op_class) || ap_mld))
-+ if (!iface || iface == hapd->iface ||
-+ !is_6ghz_op_class(iface->conf->op_class))
- continue;
-
- eid = hostapd_eid_rnr_iface(iface->bss[0], hapd, eid,
-- current_len, NULL);
-+ current_len, NULL, false);
- }
-
- return eid;
- }
-
-+u8 *hostapd_eid_rnr_mlo(struct hostapd_data *hapd, u32 type,
-+ u8 *eid, size_t *current_len)
-+{
-+#ifdef CONFIG_IEEE80211BE
-+ struct hostapd_iface *iface;
-+ size_t i;
-+
-+ if (!hapd->iface || !hapd->iface->interfaces)
-+ return eid;
-+
-+ if (!hapd->conf->mld_ap)
-+ return eid;
-+
-+ /* TODO allow for FILS/Action as well */
-+ if (type != WLAN_FC_STYPE_BEACON && type != WLAN_FC_STYPE_PROBE_RESP)
-+ return eid;
-+
-+ for (i = 0; i < hapd->iface->interfaces->count; i++) {
-+ iface = hapd->iface->interfaces->iface[i];
-+
-+ if (!iface || iface == hapd->iface)
-+ continue;
-+
-+ if (hapd->iface->freq == iface->freq)
-+ continue;
-
--u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type)
-+ eid = hostapd_eid_rnr_iface(iface->bss[0], hapd, eid,
-+ current_len, NULL, true);
-+ }
-+#endif /* CONFIG_IEEE80211BE */
-+ return eid;
-+}
-+
-+u8 *hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type, bool include_mld_params)
- {
- u8 *eid_start = eid;
- size_t current_len = 0;
- enum colocation_mode mode = get_colocation_mode(hapd);
-- bool ap_mld = false;
--
--#ifdef CONFIG_IEEE80211BE
-- ap_mld = !!hapd->conf->mld_ap;
--#endif /* CONFIG_IEEE80211BE */
-
- switch (type) {
- case WLAN_FC_STYPE_BEACON:
-@@ -7697,26 +7855,34 @@ u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type)
- /* fallthrough */
-
- case WLAN_FC_STYPE_PROBE_RESP:
-- if (mode == COLOCATED_LOWER_BAND || ap_mld)
-- eid = hostapd_eid_rnr_multi_iface(hapd, eid,
-- ¤t_len);
-+ if (mode == COLOCATED_LOWER_BAND)
-+ eid = hostapd_eid_rnr_colocation(hapd, eid,
-+ ¤t_len);
-
- if (hapd->conf->rnr && hapd->iface->num_bss > 1 &&
- !hapd->iconf->mbssid)
- eid = hostapd_eid_rnr_iface(hapd, hapd, eid,
-- ¤t_len, NULL);
-+ ¤t_len, NULL,
-+ false);
- break;
-
- case WLAN_FC_STYPE_ACTION:
- if (hapd->iface->num_bss > 1 && mode == STANDALONE_6GHZ)
- eid = hostapd_eid_rnr_iface(hapd, hapd, eid,
-- ¤t_len, NULL);
-+ ¤t_len, NULL,
-+ false);
- break;
-
- default:
- return eid_start;
- }
-
-+ /* For EMA Beacons, MLD neighbor repoting is added as part of mbssid rnr */
-+ if (include_mld_params &&
-+ (type != WLAN_FC_STYPE_BEACON ||
-+ hapd->iconf->mbssid != ENHANCED_MBSSID_ENABLED))
-+ eid = hostapd_eid_rnr_mlo(hapd, type, eid, ¤t_len);
-+
- if (eid == eid_start + 2)
- return eid_start;
-
-@@ -7815,6 +7981,11 @@ size_t hostapd_eid_mbssid_len(struct hostapd_data *hapd, u32 frame_type,
- size_t known_bss_len, size_t *rnr_len)
- {
- size_t len = 0, bss_index = 1;
-+ bool ap_mld = false;
-+
-+#ifdef CONFIG_IEEE80211BE
-+ ap_mld = !!hapd->conf->mld_ap;
-+#endif /* CONFIG_IEEE80211BE */
-
- if (!hapd->iconf->mbssid || hapd->iface->num_bss <= 1 ||
- (frame_type != WLAN_FC_STYPE_BEACON &&
-@@ -7847,12 +8018,12 @@ size_t hostapd_eid_mbssid_len(struct hostapd_data *hapd, u32 frame_type,
-
- *rnr_len += hostapd_eid_rnr_iface_len(
- hapd, hostapd_mbssid_get_tx_bss(hapd),
-- &rnr_cur_len, &skip_profiles);
-+ &rnr_cur_len, &skip_profiles, ap_mld);
- }
- }
-
- if (hapd->iconf->mbssid == ENHANCED_MBSSID_ENABLED && rnr_len)
-- *rnr_len += hostapd_eid_rnr_len(hapd, frame_type);
-+ *rnr_len += hostapd_eid_rnr_len(hapd, frame_type, false);
-
- return len;
- }
-@@ -7978,7 +8149,11 @@ u8 * hostapd_eid_mbssid(struct hostapd_data *hapd, u8 *eid, u8 *end,
- {
- size_t bss_index = 1, cur_len = 0;
- u8 elem_index = 0, *rnr_start_eid = rnr_eid;
-- bool add_rnr;
-+ bool add_rnr, ap_mld = false;
-+
-+#ifdef CONFIG_IEEE80211BE
-+ ap_mld = !!hapd->conf->mld_ap;
-+#endif /* CONFIG_IEEE80211BE */
-
- if (!hapd->iconf->mbssid || hapd->iface->num_bss <= 1 ||
- (frame_stype != WLAN_FC_STYPE_BEACON &&
-@@ -8023,7 +8198,7 @@ u8 * hostapd_eid_mbssid(struct hostapd_data *hapd, u8 *eid, u8 *end,
- cur_len = 0;
- rnr_eid = hostapd_eid_rnr_iface(
- hapd, hostapd_mbssid_get_tx_bss(hapd),
-- rnr_eid, &cur_len, &skip_profiles);
-+ rnr_eid, &cur_len, &skip_profiles, ap_mld);
- }
- }
-
-@@ -8035,8 +8210,8 @@ u8 * hostapd_eid_mbssid(struct hostapd_data *hapd, u8 *eid, u8 *end,
- if (hapd->conf->rnr)
- rnr_eid = hostapd_eid_nr_db(hapd, rnr_eid, &cur_len);
- if (get_colocation_mode(hapd) == COLOCATED_LOWER_BAND)
-- rnr_eid = hostapd_eid_rnr_multi_iface(hapd, rnr_eid,
-- &cur_len);
-+ rnr_eid = hostapd_eid_rnr_colocation(hapd, rnr_eid,
-+ &cur_len);
- }
-
- return eid;
-diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h
-index 262e0ce14..078f4baf9 100644
---- a/src/ap/ieee802_11.h
-+++ b/src/ap/ieee802_11.h
-@@ -225,8 +225,9 @@ void auth_sae_process_commit(void *eloop_ctx, void *user_ctx);
- u8 * hostapd_eid_rsnxe(struct hostapd_data *hapd, u8 *eid, size_t len);
- u16 check_ext_capab(struct hostapd_data *hapd, struct sta_info *sta,
- const u8 *ext_capab_ie, size_t ext_capab_ie_len);
--size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type);
--u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type);
-+size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type, bool include_mld_params);
-+u8 *hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type,
-+ bool include_mld_params);
- int ieee802_11_set_radius_info(struct hostapd_data *hapd, struct sta_info *sta,
- int res, struct radius_sta *info);
- size_t hostapd_eid_eht_capab_len(struct hostapd_data *hapd,
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0037-mtk-hostapd-Do-not-include-HE-capab-IE-if-associated.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0020-mtk-hostapd-Do-not-include-HE-capab-IE-if-associated.patch
similarity index 80%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0037-mtk-hostapd-Do-not-include-HE-capab-IE-if-associated.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0020-mtk-hostapd-Do-not-include-HE-capab-IE-if-associated.patch
index 03513eb..dbfad2e 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0037-mtk-hostapd-Do-not-include-HE-capab-IE-if-associated.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0020-mtk-hostapd-Do-not-include-HE-capab-IE-if-associated.patch
@@ -1,7 +1,7 @@
-From dce3106e1c43076ab410af89f817e15cee7959a3 Mon Sep 17 00:00:00 2001
+From 761a5a50507b7af032ba35a08d8b3fa0a3b8991a Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Thu, 22 Sep 2022 16:08:09 +0800
-Subject: [PATCH 037/104] mtk: hostapd: Do not include HE capab IE if
+Subject: [PATCH 020/126] mtk: hostapd: Do not include HE capab IE if
associated sta's HE capab IE is invalid
The parameter 'sta' passed to send_assoc_resp() might be NULL, so an
@@ -14,10 +14,10 @@
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index bda61b998..d972a25f1 100644
+index 39b1bb4c7..18d5b8f79 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
-@@ -4931,7 +4931,8 @@ static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
+@@ -5007,7 +5007,8 @@ static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
#endif /* CONFIG_IEEE80211AC */
#ifdef CONFIG_IEEE80211AX
@@ -28,5 +28,5 @@
p = hostapd_eid_he_operation(hapd, p);
p = hostapd_eid_cca(hapd, p);
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0038-mtk-hostapd-Add-DFS-detection-mode.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0021-mtk-hostapd-Add-DFS-detection-mode.patch
similarity index 84%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0038-mtk-hostapd-Add-DFS-detection-mode.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0021-mtk-hostapd-Add-DFS-detection-mode.patch
index c540b5e..b520988 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0038-mtk-hostapd-Add-DFS-detection-mode.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0021-mtk-hostapd-Add-DFS-detection-mode.patch
@@ -1,7 +1,7 @@
-From 9d180d46527a6a53824227c2b7c6e4e37bf3acfb Mon Sep 17 00:00:00 2001
+From 83fcf8b56d7886992d6dc474ca09400177304705 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Mon, 20 Feb 2023 14:55:49 +0800
-Subject: [PATCH 038/104] mtk: hostapd: Add DFS detection mode
+Subject: [PATCH 021/126] mtk: hostapd: Add DFS detection mode
Add DFS detection mode for testing radar detection rate.
If DFS detection mode is on, AP will not switch channels when receiving
@@ -17,10 +17,10 @@
4 files changed, 50 insertions(+)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index 247d68811..40ade89c0 100644
+index e437aa981..a5fa97a35 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -5398,6 +5398,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -5520,6 +5520,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
} else if (os_strcmp(buf, "ibf_enable") == 0) { /*ibf setting is per device*/
int val = atoi(pos);
conf->ibf_enable = !!val;
@@ -32,10 +32,10 @@
wpa_printf(MSG_ERROR,
"Line %d: unknown configuration item '%s'",
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 10bbce341..71a87459c 100644
+index 3221c0fb1..ef0ade6c9 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -4134,6 +4134,26 @@ hostapd_ctrl_iface_get_ibf(struct hostapd_data *hapd, char *buf,
+@@ -4264,6 +4264,26 @@ hostapd_ctrl_iface_get_ibf(struct hostapd_data *hapd, char *buf,
}
@@ -62,7 +62,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
int reply_size,
-@@ -4747,6 +4767,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4885,6 +4905,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
reply_len = hostapd_ctrl_iface_get_mu(hapd, reply, reply_size);
} else if (os_strncmp(buf, "GET_IBF", 7) == 0) {
reply_len = hostapd_ctrl_iface_get_ibf(hapd, reply, reply_size);
@@ -73,10 +73,10 @@
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 5f084796d..7607c63e1 100644
+index 3f07147db..f7027473e 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1288,6 +1288,7 @@ struct hostapd_config {
+@@ -1341,6 +1341,7 @@ struct hostapd_config {
int *edcca_threshold;
u8 three_wire_enable;
u8 ibf_enable;
@@ -84,7 +84,7 @@
};
enum three_wire_mode {
-@@ -1302,6 +1303,18 @@ enum three_wire_mode {
+@@ -1355,6 +1356,18 @@ enum three_wire_mode {
NUM_THREE_WIRE_MODE - 1
};
@@ -104,10 +104,10 @@
EDCCA_MODE_FORCE_DISABLE = 0,
EDCCA_MODE_AUTO = 1,
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
-index d14fad136..1df4de6b8 100644
+index fe044297b..49dc4d424 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -1336,6 +1336,11 @@ hostapd_dfs_background_start_channel_switch(struct hostapd_iface *iface,
+@@ -1347,6 +1347,11 @@ hostapd_dfs_background_start_channel_switch(struct hostapd_iface *iface,
__func__, iface->radar_background.cac_started ? "yes" : "no",
hostapd_csa_in_progress(iface) ? "yes" : "no");
@@ -119,7 +119,7 @@
/* Check if CSA in progress */
if (hostapd_csa_in_progress(iface))
return 0;
-@@ -1384,6 +1389,11 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
+@@ -1395,6 +1400,11 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
__func__, iface->cac_started ? "yes" : "no",
hostapd_csa_in_progress(iface) ? "yes" : "no");
@@ -132,5 +132,5 @@
if (hostapd_csa_in_progress(iface))
return 0;
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0021-tests-MLO-add-basic-cohosted-MLDs-functionality-test.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0021-tests-MLO-add-basic-cohosted-MLDs-functionality-test.patch
deleted file mode 100644
index a4eb061..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0021-tests-MLO-add-basic-cohosted-MLDs-functionality-test.patch
+++ /dev/null
@@ -1,271 +0,0 @@
-From c43241d046e8a6ae75549c23d470b94f16c74ca7 Mon Sep 17 00:00:00 2001
-From: Aditya Kumar Singh <quic_adisi@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:51 +0530
-Subject: [PATCH 021/104] tests: MLO: add basic cohosted MLDs functionality
- testing
-
-Add test case to test basic cohosted MLDs functionality. Add helper
-functions to create the configuration file, start hostapd instance.
-
-Client connectivty test case will be added via a subsequent change.
-
-eht_mld_cohosted_discovery: 2 co-hosted MLDs without non-MLD RNR. Basic
-bring up and beacon, MLD RNR, scan validation.
-
-eht_mld_cohosted_discovery_with_rnr: Same like eht_mld_cohosted_discovery
-but additionally non-MLD RNR (rnr=1) is also enabled. Validate the non-MLD
-RNR as well.
-
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- tests/hwsim/test_eht.py | 230 ++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 230 insertions(+)
-
-diff --git a/tests/hwsim/test_eht.py b/tests/hwsim/test_eht.py
-index a012fe4e7..732406219 100644
---- a/tests/hwsim/test_eht.py
-+++ b/tests/hwsim/test_eht.py
-@@ -15,6 +15,7 @@ from tshark import run_tshark
- from test_gas import hs20_ap_params
- from test_dpp import check_dpp_capab, wait_auth_success
- from test_rrm import build_beacon_request, run_req_beacon, BeaconReport
-+import os, subprocess, time, tempfile
-
- def eht_verify_wifi_version(dev):
- status = dev.get_status()
-@@ -1823,3 +1824,232 @@ def test_eht_mlo_csa(dev, apdev):
- traffic_test(wpas, hapd0)
-
- #TODO: CSA on non-first link
-+
-+def create_base_conf_file(iface, channel, prefix='hostapd-', hw_mode='g',
-+ op_class=None):
-+ # Create configuration file and add phy characteristics
-+ fd, fname = tempfile.mkstemp(dir='/tmp',
-+ prefix=prefix + iface + "-chan-" + str(channel) + "-")
-+ f = os.fdopen(fd, 'w')
-+
-+ f.write("driver=nl80211\n")
-+ f.write("hw_mode=" + str(hw_mode) + "\n")
-+ f.write("ieee80211n=1\n")
-+ if hw_mode == 'a' and \
-+ (op_class is None or \
-+ op_class not in [131, 132, 133, 134, 135, 136, 137]):
-+ f.write("ieee80211ac=1\n")
-+ f.write("ieee80211ax=1\n")
-+ f.write("ieee80211be=1\n")
-+ f.write("channel=" + str(channel) + "\n")
-+
-+ return f, fname
-+
-+def append_bss_conf_to_file(f, ifname, params, first=False):
-+ # Add BSS specific characteristics
-+ config = "bss"
-+
-+ if first:
-+ config = "interface"
-+
-+ f.write("\n" + config + "=%s\n" % ifname)
-+
-+ for k, v in list(params.items()):
-+ f.write("{}={}\n".format(k,v))
-+
-+ f.write("mld_ap=1\n")
-+
-+def dump_config(fname):
-+ with open(fname, 'r') as f:
-+ cfg = f.read()
-+ logger.debug("hostapd config: " + str(fname) + "\n" + cfg)
-+
-+def get_config(iface, count, ssid, passphrase, channel, bssid_regex,
-+ rnr=False, debug=False):
-+ f, fname = create_base_conf_file(iface, channel=channel)
-+ hapds = []
-+
-+ for i in range(count):
-+ if i == 0:
-+ ifname = iface
-+ else:
-+ ifname = iface + "-" + str(i)
-+
-+ set_ssid = ssid + str(i)
-+ set_passphrase = passphrase + str(i)
-+ params = hostapd.wpa2_params(ssid=set_ssid, passphrase=set_passphrase,
-+ wpa_key_mgmt="SAE", ieee80211w="2")
-+ params['sae_pwe'] = "2"
-+ params['group_mgmt_cipher'] = "AES-128-CMAC"
-+ params['beacon_prot'] = "1"
-+ params["ctrl_interface"] = "/var/run/hostapd/chan_" + str(channel)
-+ params["bssid"] = bssid_regex % (i + 1)
-+
-+ if rnr:
-+ params["rnr"]="1"
-+
-+ append_bss_conf_to_file(f, ifname, params, first=(i == 0))
-+
-+ hapds.append([ifname, params["ctrl_interface"], i])
-+
-+ f.close()
-+
-+ if debug:
-+ dump_config(fname)
-+
-+ return fname, hapds
-+
-+def start_ap(prefix, configs):
-+ pid = prefix + ".hostapd.pid"
-+ configs = configs.split()
-+
-+ cmd = ['../../hostapd/hostapd', '-ddKtB', '-P', pid, '-f',
-+ prefix + ".hostapd-log"]
-+
-+ cmd = cmd + configs
-+
-+ logger.info("Starting APs")
-+ res = subprocess.check_call(cmd)
-+ if res != 0:
-+ raise Exception("Could not start hostapd: %s" % str(res))
-+
-+ # Wait for hostapd to complete initialization and daemonize.
-+ time.sleep(2)
-+
-+ if not os.path.exists(pid):
-+ raise Exception("hostapd did not create PID file.")
-+
-+def get_mld_devs(hapd_iface, count, prefix, rnr=False):
-+ fname1, hapds1 = get_config(hapd_iface, count=count, ssid="mld-",
-+ passphrase="qwertyuiop-", channel=1,
-+ bssid_regex="02:00:00:00:07:%02x",
-+ rnr=rnr, debug=True)
-+ fname2, hapds2 = get_config(hapd_iface, count=count, ssid="mld-",
-+ passphrase="qwertyuiop-", channel=6,
-+ bssid_regex="02:00:00:00:08:%02x",
-+ rnr=rnr, debug=True)
-+
-+ start_ap(prefix, fname1 + " " + fname2)
-+
-+ hapd_mld1_link0 = hostapd.Hostapd(ifname=hapds1[0][0], ctrl=hapds1[0][1],
-+ bssidx=hapds1[0][2])
-+ hapd_mld1_link1 = hostapd.Hostapd(ifname=hapds2[0][0], ctrl=hapds2[0][1],
-+ bssidx=hapds2[0][2])
-+
-+ hapd_mld2_link0 = hostapd.Hostapd(ifname=hapds1[1][0], ctrl=hapds1[1][1],
-+ bssidx=hapds1[1][2])
-+ hapd_mld2_link1 = hostapd.Hostapd(ifname=hapds2[1][0], ctrl=hapds2[1][1],
-+ bssidx=hapds2[1][2])
-+
-+ if not hapd_mld1_link0.ping():
-+ raise Exception("Could not ping hostapd")
-+
-+ if not hapd_mld1_link1.ping():
-+ raise Exception("Could not ping hostapd")
-+
-+ if not hapd_mld2_link0.ping():
-+ raise Exception("Could not ping hostapd")
-+
-+ if not hapd_mld2_link1.ping():
-+ raise Exception("Could not ping hostapd")
-+
-+ os.remove(fname1)
-+ os.remove(fname2)
-+
-+ return [hapd_mld1_link0, hapd_mld1_link1, hapd_mld2_link0, hapd_mld2_link1]
-+
-+def stop_mld_devs(hapds, pid):
-+ pid = pid + ".hostapd.pid"
-+
-+ if "OK" not in hapds[0].request("TERMINATE"):
-+ raise Exception("Failed to terminate hostapd process")
-+
-+ ev = hapds[0].wait_event(["CTRL-EVENT-TERMINATING"], timeout=15)
-+ if ev is None:
-+ raise Exception("CTRL-EVENT-TERMINATING not seen")
-+
-+ time.sleep(0.5)
-+
-+ if os.path.exists(pid):
-+ raise Exception("PID file exits after process termination")
-+
-+def eht_parse_rnr(bss, rnr=False, exp_bssid=None):
-+ partner_rnr_pattern = re.compile(".*ap_info.*, mld ID=0, link ID=",
-+ re.MULTILINE)
-+ ml_pattern = re.compile(".*multi-link:.*, MLD addr=.*", re.MULTILINE)
-+
-+ if partner_rnr_pattern.search(bss) is None:
-+ raise Exception("RNR element not found for first link of first MLD")
-+
-+ if ml_pattern.search(bss) is None:
-+ raise Exception("ML element not found for first link of first MLD")
-+
-+ if not rnr:
-+ return
-+
-+ coloc_rnr_pattern = re.compile(".*ap_info.*, mld ID=255, link ID=..",
-+ re.MULTILINE)
-+
-+ if coloc_rnr_pattern.search(bss) is None:
-+ raise Exception("RNR element not found for co-located BSS")
-+
-+ line = coloc_rnr_pattern.search(bss).group()
-+ if line.count('bssid') > 1:
-+ raise Exception("More than one BSS found for co-located RNR")
-+
-+ # Get the BSSID carried in the RNR
-+ index = line.rindex('bssid')
-+ bssid = line[index+len('bssid')+1:].split(',')[0]
-+
-+ # Get the MLD ID carried in the RNR
-+ index = line.rindex('link ID')
-+ link_id = line[index+len('link ID')+1:].split(',')[0]
-+
-+ if link_id != "15":
-+ raise Exception("Unexpected link ID for co-located BSS which is not own partner")
-+
-+ if bssid != exp_bssid:
-+ raise Exception("Unexpected BSSID for co-located BSS")
-+
-+def eht_mld_cohosted_discovery(dev, apdev, params, rnr=False):
-+ with HWSimRadio(use_mlo=True, n_channels=2) as (hapd_radio, hapd_iface), \
-+ HWSimRadio(use_mlo=True) as (wpas_radio, wpas_iface):
-+
-+ wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
-+ wpas.interface_add(wpas_iface)
-+
-+ hapds = get_mld_devs(hapd_iface=hapd_iface, count=2, prefix=params['prefix'],
-+ rnr=rnr)
-+
-+ # Only scan link 0
-+ res = wpas.request("SCAN freq=2412")
-+ if "FAIL" in res:
-+ raise Exception("Failed to start scan")
-+
-+ ev = wpas.wait_event(["CTRL-EVENT-SCAN-STARTED"])
-+ if ev is None:
-+ raise Exception("Scan did not start")
-+
-+ ev = wpas.wait_event(["CTRL-EVENT-SCAN-RESULTS"])
-+ if ev is None:
-+ raise Exception("Scan did not complete")
-+
-+ logger.info("Scan done")
-+
-+ bss = wpas.request("BSS " + hapds[0].own_addr())
-+ logger.info("BSS 0_0: " + str(bss))
-+ eht_parse_rnr(bss, rnr, hapds[2].own_addr())
-+
-+ bss = wpas.request("BSS " + hapds[2].own_addr())
-+ logger.info("BSS 1_0: " + str(bss))
-+ eht_parse_rnr(bss, rnr, hapds[0].own_addr())
-+
-+ stop_mld_devs(hapds, params['prefix'])
-+
-+def test_eht_mld_cohosted_discovery(dev, apdev, params):
-+ """EHT 2 AP MLDs discovery"""
-+ eht_mld_cohosted_discovery(dev, apdev, params)
-+
-+def test_eht_mld_cohosted_discovery_with_rnr(dev, apdev, params):
-+ """EHT 2 AP MLDs discovery (with co-location RNR)"""
-+ eht_mld_cohosted_discovery(dev, apdev, params, rnr=True)
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0039-mtk-hostapd-Add-DFS-offchan-channel-switch.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0022-mtk-hostapd-Add-DFS-offchan-channel-switch.patch
similarity index 90%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0039-mtk-hostapd-Add-DFS-offchan-channel-switch.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0022-mtk-hostapd-Add-DFS-offchan-channel-switch.patch
index a37e541..6e13b02 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0039-mtk-hostapd-Add-DFS-offchan-channel-switch.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0022-mtk-hostapd-Add-DFS-offchan-channel-switch.patch
@@ -1,7 +1,7 @@
-From 7f0f977e36718a7a827f7d78e6ab578d53aa630b Mon Sep 17 00:00:00 2001
+From b74aa64e3cbacf537ac3e7a96f3295ebe0979c0c Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Mon, 20 Feb 2023 14:56:55 +0800
-Subject: [PATCH 039/104] mtk: hostapd: Add DFS offchan channel switch
+Subject: [PATCH 022/126] mtk: hostapd: Add DFS offchan channel switch
Add DFS background chain channel switch command for testing purpose.
This feature is implemented via hostapd_cli command.
@@ -16,10 +16,10 @@
3 files changed, 96 insertions(+), 16 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 71a87459c..68dcc7982 100644
+index ef0ade6c9..32d4997b2 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -4154,6 +4154,76 @@ hostapd_ctrl_iface_set_dfs_detect_mode(struct hostapd_data *hapd, char *value,
+@@ -4284,6 +4284,76 @@ hostapd_ctrl_iface_set_dfs_detect_mode(struct hostapd_data *hapd, char *value,
}
@@ -48,9 +48,9 @@
+ else
+ return -1;
+
-+ num_available_chandefs = dfs_find_channel(iface, NULL, 0, type);
++ num_available_chandefs = dfs_find_channel(iface, NULL, 0, 0, type);
+ for (i = 0; i < num_available_chandefs; i++) {
-+ dfs_find_channel(iface, &chan, i, type);
++ dfs_find_channel(iface, &chan, 0, i, type);
+ if (chan->chan == channel) {
+ chan_found = true;
+ break;
@@ -96,7 +96,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
int reply_size,
-@@ -4770,6 +4840,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4908,6 +4978,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
} else if (os_strncmp(buf, "DFS_DETECT_MODE ", 16) == 0) {
reply_len = hostapd_ctrl_iface_set_dfs_detect_mode(hapd, buf + 16,
reply, reply_size);
@@ -106,10 +106,10 @@
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
-index 1df4de6b8..ece27d070 100644
+index 49dc4d424..42cce2dce 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -19,13 +19,6 @@
+@@ -20,13 +20,6 @@
#include "dfs.h"
#include "crypto/crypto.h"
@@ -123,7 +123,7 @@
static struct hostapd_channel_data *
dfs_downgrade_bandwidth(struct hostapd_iface *iface, int *secondary_channel,
u8 *oper_centr_freq_seg0_idx,
-@@ -238,9 +231,9 @@ static int is_in_chanlist(struct hostapd_iface *iface,
+@@ -239,9 +232,9 @@ static int is_in_chanlist(struct hostapd_iface *iface,
* - hapd->vht/he_oper_centr_freq_seg0_idx
* - hapd->vht/he_oper_centr_freq_seg1_idx
*/
@@ -136,7 +136,7 @@
{
struct hostapd_hw_modes *mode;
struct hostapd_channel_data *chan;
-@@ -300,12 +293,12 @@ static int dfs_find_channel(struct hostapd_iface *iface,
+@@ -301,12 +294,12 @@ static int dfs_find_channel(struct hostapd_iface *iface,
}
@@ -188,5 +188,5 @@
#endif /* DFS_H */
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0022-tests-MLO-add-cohosted-MLDs-connectivity-testing.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0022-tests-MLO-add-cohosted-MLDs-connectivity-testing.patch
deleted file mode 100644
index af3c390..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0022-tests-MLO-add-cohosted-MLDs-connectivity-testing.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 29a075f5ea644abdfb9bd93f79b05c72bb9fb78c Mon Sep 17 00:00:00 2001
-From: Aditya Kumar Singh <quic_adisi@quicinc.com>
-Date: Thu, 28 Mar 2024 23:46:52 +0530
-Subject: [PATCH 022/104] tests: MLO: add cohosted MLDs connectivity testing
-
-Add test case 'eht_mld_cohosted_connectivity' which creates two 2 link AP
-MLDs and connect 2 links MLD client to each one of them and test data
-traffic.
-
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
----
- tests/hwsim/test_eht.py | 42 +++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 42 insertions(+)
-
-diff --git a/tests/hwsim/test_eht.py b/tests/hwsim/test_eht.py
-index 732406219..f09d31878 100644
---- a/tests/hwsim/test_eht.py
-+++ b/tests/hwsim/test_eht.py
-@@ -2053,3 +2053,45 @@ def test_eht_mld_cohosted_discovery(dev, apdev, params):
- def test_eht_mld_cohosted_discovery_with_rnr(dev, apdev, params):
- """EHT 2 AP MLDs discovery (with co-location RNR)"""
- eht_mld_cohosted_discovery(dev, apdev, params, rnr=True)
-+
-+def test_eht_mld_cohosted_connectivity(dev, apdev, params):
-+ """EHT 2 AP MLDs with 2 MLD clients connection"""
-+ with HWSimRadio(use_mlo=True, n_channels=2) as (hapd_radio, hapd_iface), \
-+ HWSimRadio(use_mlo=True) as (wpas_radio, wpas_iface), \
-+ HWSimRadio(use_mlo=True) as (wpas_radio1, wpas_iface1):
-+
-+ wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
-+ wpas.interface_add(wpas_iface)
-+
-+ wpas1 = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
-+ wpas1.interface_add(wpas_iface1)
-+
-+ hapds = get_mld_devs(hapd_iface=hapd_iface, count=2, prefix=params['prefix'],
-+ rnr=False)
-+
-+ passphrase = "qwertyuiop-"
-+ ssid = "mld-"
-+
-+ # Connect one client to first AP MLD and verify traffic on both links
-+ wpas.set("sae_pwe", "1")
-+ wpas.connect(ssid+"0", sae_password=passphrase+"0", scan_freq="2412",
-+ key_mgmt="SAE", ieee80211w="2")
-+
-+ eht_verify_status(wpas, hapds[0], 2412, 20, is_ht=True, mld=True,
-+ valid_links=3, active_links=3)
-+ eht_verify_wifi_version(wpas)
-+
-+ traffic_test(wpas, hapds[0])
-+ traffic_test(wpas, hapds[1])
-+
-+ # Connect another client to second AP MLD and verify traffic on both links
-+ wpas1.set("sae_pwe", "1")
-+ wpas1.connect(ssid+"1", sae_password=passphrase+"1", scan_freq="2437",
-+ key_mgmt="SAE", ieee80211w="2")
-+
-+ eht_verify_status(wpas1, hapds[3], 2437, 20, is_ht=True, mld=True,
-+ valid_links=3, active_links=3)
-+ eht_verify_wifi_version(wpas1)
-+
-+ traffic_test(wpas1, hapds[3])
-+ traffic_test(wpas1, hapds[2])
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0023-backport-hostapd-afcd-add-AFC-daemon-support.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0023-backport-hostapd-afcd-add-AFC-daemon-support.patch
deleted file mode 100644
index 9c4f7a4..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0023-backport-hostapd-afcd-add-AFC-daemon-support.patch
+++ /dev/null
@@ -1,372 +0,0 @@
-From 84123bd3df810acd8d463a31d519005cfd0cc8d0 Mon Sep 17 00:00:00 2001
-From: Evelyn Tsai <evelyn.tsai@mediatek.com>
-Date: Wed, 20 Mar 2024 07:13:01 +0800
-Subject: [PATCH 023/104] backport: hostapd: afcd: add AFC daemon support
-
-Introduce Automated Frequency Coordination Daemon (AFCD) support
-for UNII-5 and UNII-7 6GHz bands.
-AFCD will be used by hostapd AFC client in order to forward the AFC
-request to the AFC coordinator and decouple AFC connection management
-from hostapd.
-AFC is required for Standard Power Devices (SPDs) to determine a lists
-of channels and EIRP/PSD powers that are available in the 6GHz spectrum.
-AFCD is tested with AFC DUT Test Harness [0].
-
-[0] https://github.com/Wi-FiTestSuite/AFC-DUT/tree/main
-
-Tested-by: Allen Ye <allen.ye@mediatek.com>
-Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
----
- afc/.gitignore | 1 +
- afc/Makefile | 31 ++++++
- afc/afcd.c | 292 +++++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 324 insertions(+)
- create mode 100644 afc/.gitignore
- create mode 100644 afc/Makefile
- create mode 100644 afc/afcd.c
-
-diff --git a/afc/.gitignore b/afc/.gitignore
-new file mode 100644
-index 000000000..8d8cca905
---- /dev/null
-+++ b/afc/.gitignore
-@@ -0,0 +1 @@
-+afcd
-diff --git a/afc/Makefile b/afc/Makefile
-new file mode 100644
-index 000000000..a83bd01db
---- /dev/null
-+++ b/afc/Makefile
-@@ -0,0 +1,31 @@
-+ALL=afcd
-+
-+include ../src/build.rules
-+
-+CFLAGS += -I../src/utils
-+CFLAGS += -I../src
-+
-+OBJS=afcd.o
-+OBJS += ../src/utils/common.o
-+OBJS += ../src/utils/wpa_debug.o
-+OBJS += ../src/utils/wpabuf.o
-+
-+ifndef CONFIG_OS
-+ifdef CONFIG_NATIVE_WINDOWS
-+CONFIG_OS=win32
-+else
-+CONFIG_OS=unix
-+endif
-+endif
-+OBJS += ../src/utils/os_$(CONFIG_OS).o
-+
-+LIBS += -lcurl
-+
-+_OBJS_VAR := OBJS
-+include ../src/objs.mk
-+afcd: $(OBJS)
-+ $(Q)$(LDO) $(LDFLAGS) -o afcd $(OBJS) $(LIBS)
-+ @$(E) " LD " $@
-+
-+clean: common-clean
-+ rm -f core *~
-diff --git a/afc/afcd.c b/afc/afcd.c
-new file mode 100644
-index 000000000..f502846c5
---- /dev/null
-+++ b/afc/afcd.c
-@@ -0,0 +1,292 @@
-+/*
-+ * Automated Frequency Coordination Daemon
-+ * Copyright (c) 2024, Lorenzo Bianconi <lorenzo@kernel.org>
-+ *
-+ * This software may be distributed under the terms of the BSD license.
-+ * See README for more details.
-+ */
-+
-+#include <curl/curl.h>
-+#include <sys/un.h>
-+#include <sys/stat.h>
-+
-+#include "utils/includes.h"
-+#include "utils/common.h"
-+
-+#define CURL_TIMEOUT 60
-+#define AFCD_SOCK "afcd.sock"
-+
-+struct curl_ctx {
-+ char *buf;
-+ size_t buf_len;
-+};
-+
-+static volatile bool exiting;
-+
-+static char *path = "/var/run";
-+static char *bearer_token;
-+static char *url;
-+static int port = 443;
-+
-+
-+static size_t afcd_curl_cb_write(void *ptr, size_t size, size_t nmemb,
-+ void *userdata)
-+{
-+ struct curl_ctx *ctx = userdata;
-+ char *buf;
-+
-+ buf = os_realloc(ctx->buf, ctx->buf_len + size * nmemb + 1);
-+ if (!buf)
-+ return 0;
-+
-+ ctx->buf = buf;
-+ os_memcpy(buf + ctx->buf_len, ptr, size * nmemb);
-+ buf[ctx->buf_len + size * nmemb] = '\0';
-+ ctx->buf_len += size * nmemb;
-+
-+ return size * nmemb;
-+}
-+
-+
-+static int afcd_send_request(struct curl_ctx *ctx, unsigned char *request)
-+{
-+ struct curl_slist *headers = NULL;
-+ CURL *curl;
-+ int ret;
-+
-+ wpa_printf(MSG_DEBUG, "Sending AFC request to %s", url);
-+
-+ curl_global_init(CURL_GLOBAL_ALL);
-+ curl = curl_easy_init();
-+ if (!curl)
-+ return -ENOMEM;
-+
-+ headers = curl_slist_append(headers, "Accept: application/json");
-+ headers = curl_slist_append(headers,
-+ "Content-Type: application/json");
-+ headers = curl_slist_append(headers, "charset: utf-8");
-+
-+ curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
-+ curl_easy_setopt(curl, CURLOPT_URL, url);
-+ curl_easy_setopt(curl, CURLOPT_PORT, port);
-+ curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
-+ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,
-+ afcd_curl_cb_write);
-+ curl_easy_setopt(curl, CURLOPT_WRITEDATA, ctx);
-+ curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcrp/0.1");
-+ curl_easy_setopt(curl, CURLOPT_TIMEOUT, CURL_TIMEOUT);
-+ curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
-+ if (bearer_token)
-+ curl_easy_setopt(curl, CURLOPT_XOAUTH2_BEARER, bearer_token);
-+ curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BEARER);
-+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
-+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 1L);
-+ curl_easy_setopt(curl, CURLOPT_POSTFIELDS, request);
-+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYSTATUS, 1L);
-+
-+ ret = curl_easy_perform(curl);
-+ if (ret != CURLE_OK)
-+ wpa_printf(MSG_ERROR, "curl_easy_perform failed: %s",
-+ curl_easy_strerror(ret));
-+
-+ curl_easy_cleanup(curl);
-+ curl_global_cleanup();
-+
-+ return ret == CURLE_OK ? 0 : -EINVAL;
-+}
-+
-+
-+static void handle_term(int sig)
-+{
-+ wpa_printf(MSG_ERROR, "Received signal %d", sig);
-+ exiting = true;
-+}
-+
-+
-+static void usage(void)
-+{
-+ wpa_printf(MSG_ERROR,
-+ "%s:\n"
-+ "afcd -u<url> [-p<port>][-t<token>][-D<unix-sock dir>][-P<PID file>][-dB]",
-+ __func__);
-+}
-+
-+
-+#define BUFSIZE 8192
-+static int afcd_server_run(void)
-+{
-+ size_t len = os_strlen(path) + 1 + os_strlen(AFCD_SOCK);
-+ struct sockaddr_un addr = {
-+ .sun_family = AF_UNIX,
-+#ifdef __FreeBSD__
-+ .sun_len = sizeof(addr),
-+#endif /* __FreeBSD__ */
-+ };
-+ int sockfd, ret = 0;
-+ char *fname = NULL;
-+ unsigned char *buf;
-+ fd_set read_set;
-+
-+ if (len >= sizeof(addr.sun_path))
-+ return -EINVAL;
-+
-+ if (mkdir(path, S_IRWXU | S_IRWXG) < 0 && errno != EEXIST)
-+ return -EINVAL;
-+
-+ buf = os_malloc(BUFSIZE);
-+ if (!buf)
-+ return -ENOMEM;
-+
-+ fname = os_malloc(len + 1);
-+ if (!fname) {
-+ ret = -ENOMEM;
-+ goto free_buf;
-+ }
-+
-+ os_snprintf(fname, len + 1, "%s/%s", path, AFCD_SOCK);
-+ fname[len] = '\0';
-+ os_strlcpy(addr.sun_path, fname, sizeof(addr.sun_path));
-+
-+ sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
-+ if (sockfd < 0) {
-+ wpa_printf(MSG_ERROR, "Failed creating socket");
-+ ret = -errno;
-+ goto unlink;
-+ }
-+
-+ if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
-+ wpa_printf(MSG_ERROR, "Failed to bind socket");
-+ ret = -errno;
-+ goto close;
-+ }
-+
-+ if (listen(sockfd, 10) < 0) {
-+ wpa_printf(MSG_ERROR, "Failed to listen on socket");
-+ ret = -errno;
-+ goto close;
-+ }
-+
-+ FD_ZERO(&read_set);
-+ while (!exiting) {
-+ socklen_t addr_len = sizeof(addr);
-+ struct sockaddr_in6 c_addr;
-+ struct timeval timeout = {
-+ .tv_sec = 1,
-+ };
-+ struct curl_ctx ctx = {};
-+ int fd;
-+
-+ FD_SET(sockfd, &read_set);
-+ if (select(sockfd + 1, &read_set, NULL, NULL, &timeout) < 0) {
-+ if (errno != EINTR) {
-+ wpa_printf(MSG_ERROR,
-+ "Select failed on socket");
-+ ret = -errno;
-+ break;
-+ }
-+ continue;
-+ }
-+
-+ if (!FD_ISSET(sockfd, &read_set))
-+ continue;
-+
-+ fd = accept(sockfd, (struct sockaddr *)&c_addr,
-+ &addr_len);
-+ if (fd < 0) {
-+ if (errno != EINTR) {
-+ wpa_printf(MSG_ERROR,
-+ "Failed accepting connections");
-+ ret = -errno;
-+ break;
-+ }
-+ continue;
-+ }
-+
-+ os_memset(buf, 0, BUFSIZE);
-+ if (recv(fd, buf, BUFSIZE, 0) <= 0) {
-+ close(fd);
-+ continue;
-+ }
-+
-+ wpa_printf(MSG_DEBUG, "Received request: %s", buf);
-+ if (!afcd_send_request(&ctx, buf)) {
-+ wpa_printf(MSG_DEBUG, "Received reply: %s", ctx.buf);
-+ send(fd, ctx.buf, ctx.buf_len, MSG_NOSIGNAL);
-+ free(ctx.buf);
-+ }
-+ close(fd);
-+ }
-+close:
-+ close(sockfd);
-+unlink:
-+ unlink(fname);
-+ os_free(fname);
-+free_buf:
-+ os_free(buf);
-+
-+ return ret;
-+}
-+
-+
-+int main(int argc, char **argv)
-+{
-+ bool daemonize = false;
-+ char *pid_file = NULL;
-+
-+ if (os_program_init())
-+ return -1;
-+
-+ for (;;) {
-+ int c = getopt(argc, argv, "u:p:t:D:P:hdB");
-+
-+ if (c < 0)
-+ break;
-+
-+ switch (c) {
-+ case 'h':
-+ usage();
-+ return 0;
-+ case 'B':
-+ daemonize = true;
-+ break;
-+ case 'D':
-+ path = optarg;
-+ break;
-+ case 'P':
-+ os_free(pid_file);
-+ pid_file = os_rel2abs_path(optarg);
-+ break;
-+ case 'u':
-+ url = optarg;
-+ break;
-+ case 'p':
-+ port = atoi(optarg);
-+ break;
-+ case 'd':
-+ if (wpa_debug_level > 0)
-+ wpa_debug_level--;
-+ break;
-+ case 't':
-+ bearer_token = optarg;
-+ break;
-+ default:
-+ usage();
-+ return -EINVAL;
-+ }
-+ }
-+
-+ if (!url) {
-+ usage();
-+ return -EINVAL;
-+ }
-+
-+ if (daemonize && os_daemonize(pid_file)) {
-+ wpa_printf(MSG_ERROR, "daemon: %s", strerror(errno));
-+ return -EINVAL;
-+ }
-+
-+ signal(SIGTERM, handle_term);
-+ signal(SIGINT, handle_term);
-+
-+ return afcd_server_run();
-+}
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0040-mtk-hostapd-Add-amsdu-set-get-ctrl.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0023-mtk-hostapd-Add-amsdu-set-get-ctrl.patch
similarity index 89%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0040-mtk-hostapd-Add-amsdu-set-get-ctrl.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0023-mtk-hostapd-Add-amsdu-set-get-ctrl.patch
index ead86d5..46e779e 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0040-mtk-hostapd-Add-amsdu-set-get-ctrl.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0023-mtk-hostapd-Add-amsdu-set-get-ctrl.patch
@@ -1,7 +1,7 @@
-From 8291551130127914cbe3b5346fbd2edc89437df8 Mon Sep 17 00:00:00 2001
+From 7759dfbe3c937a1945c6df05a109853125dc6653 Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Fri, 16 Dec 2022 03:57:11 +0800
-Subject: [PATCH 040/104] mtk: hostapd: Add amsdu set get ctrl
+Subject: [PATCH 023/126] mtk: hostapd: Add amsdu set get ctrl
---
hostapd/config_file.c | 9 +++
@@ -20,10 +20,10 @@
13 files changed, 207 insertions(+), 1 deletion(-)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index 40ade89c0..7695ab196 100644
+index a5fa97a35..1f57b882f 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -5402,6 +5402,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -5524,6 +5524,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
u8 en = strtol(pos, NULL, 10);
conf->dfs_detect_mode = en;
@@ -40,10 +40,10 @@
wpa_printf(MSG_ERROR,
"Line %d: unknown configuration item '%s'",
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 68dcc7982..5f6278ecd 100644
+index 32d4997b2..7e5733278 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -4224,6 +4224,30 @@ hostapd_ctrl_iface_set_offchan_ctrl(struct hostapd_data *hapd, char *cmd,
+@@ -4354,6 +4354,30 @@ hostapd_ctrl_iface_set_offchan_ctrl(struct hostapd_data *hapd, char *cmd,
}
@@ -74,7 +74,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
int reply_size,
-@@ -4842,6 +4866,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4980,6 +5004,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
reply, reply_size);
} else if (os_strncmp(buf, "SET_OFFCHAN_CTRL", 16) == 0) {
reply_len = hostapd_ctrl_iface_set_offchan_ctrl(hapd, buf + 16, reply, reply_size);
@@ -84,10 +84,10 @@
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index 276ca578c..847f867ab 100644
+index ccbf863f6..d934bb0d4 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1673,6 +1673,13 @@ static int hostapd_cli_cmd_get_ibf(struct wpa_ctrl *ctrl, int argc,
+@@ -1698,6 +1698,13 @@ static int hostapd_cli_cmd_get_ibf(struct wpa_ctrl *ctrl, int argc,
}
@@ -101,7 +101,7 @@
struct hostapd_cli_cmd {
const char *cmd;
int (*handler)(struct wpa_ctrl *ctrl, int argc, char *argv[]);
-@@ -1898,6 +1905,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1930,6 +1937,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
"<tx type(0/1/2)> <interval> = runtime set inband discovery" },
{ "get_ibf", hostapd_cli_cmd_get_ibf, NULL,
" = show iBF state (enabled/disabled)"},
@@ -111,10 +111,10 @@
};
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
-index 04e263167..2420a251e 100644
+index 08b55d0eb..5dd7f7b2b 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
-@@ -308,6 +308,7 @@ struct hostapd_config * hostapd_config_defaults(void)
+@@ -310,6 +310,7 @@ struct hostapd_config * hostapd_config_defaults(void)
conf->edcca_compensation = EDCCA_DEFAULT_COMPENSATION;
conf->three_wire_enable = THREE_WIRE_MODE_DISABLE;
conf->ibf_enable = IBF_DEFAULT_ENABLE;
@@ -123,10 +123,10 @@
hostapd_set_and_check_bw320_offset(conf, 0);
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 7607c63e1..123e12c8f 100644
+index f7027473e..d0a692750 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1289,6 +1289,7 @@ struct hostapd_config {
+@@ -1342,6 +1342,7 @@ struct hostapd_config {
u8 three_wire_enable;
u8 ibf_enable;
u8 dfs_detect_mode;
@@ -135,10 +135,10 @@
enum three_wire_mode {
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 3cace58e5..23228a8d2 100644
+index 5172f06b9..2685c6f8a 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1307,4 +1307,18 @@ int hostapd_drv_ibf_dump(struct hostapd_data *hapd, u8 *ibf_enable)
+@@ -1336,4 +1336,18 @@ int hostapd_drv_ibf_dump(struct hostapd_data *hapd, u8 *ibf_enable)
if (!hapd->driver || !hapd->driver->ibf_dump)
return 0;
return hapd->driver->ibf_dump(hapd->drv_priv, ibf_enable);
@@ -159,10 +159,10 @@
}
\ No newline at end of file
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index 0886acb2d..f3a044557 100644
+index 3633e2ed5..68b26595f 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -158,6 +158,8 @@ int hostapd_drv_mu_dump(struct hostapd_data *hapd, u8 *mu_onoff);
+@@ -161,6 +161,8 @@ int hostapd_drv_mu_dump(struct hostapd_data *hapd, u8 *mu_onoff);
int hostapd_drv_three_wire_ctrl(struct hostapd_data *hapd);
int hostapd_drv_ibf_ctrl(struct hostapd_data *hapd);
int hostapd_drv_ibf_dump(struct hostapd_data *hapd, u8 *ibf_enable);
@@ -172,10 +172,10 @@
#include "drivers/driver.h"
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index 1d941683f..a5b683676 100644
+index 7503718c8..6ab3e6043 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -2705,6 +2705,8 @@ dfs_offload:
+@@ -2768,6 +2768,8 @@ dfs_offload:
goto fail;
if (hostapd_drv_ibf_ctrl(hapd) < 0)
goto fail;
@@ -220,10 +220,10 @@
MTK_VENDOR_ATTR_RFEATURE_CTRL_UNSPEC,
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index f5cff646e..6eeb9c22e 100644
+index 97be9e8fb..348cf9c88 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5264,6 +5264,15 @@ struct wpa_driver_ops {
+@@ -5290,6 +5290,15 @@ struct wpa_driver_ops {
*
*/
int (*ibf_dump)(void *priv, u8 *ibf_enable);
@@ -240,10 +240,10 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index c17052f22..eca2ff077 100644
+index c5c0d1b49..c2a0f1adb 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -14496,6 +14496,118 @@ fail:
+@@ -14518,6 +14518,118 @@ fail:
return -ENOBUFS;
}
@@ -362,7 +362,7 @@
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211",
.desc = "Linux nl80211/cfg80211",
-@@ -14665,4 +14777,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -14687,4 +14799,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.three_wire_ctrl = nl80211_enable_three_wire,
.ibf_ctrl = nl80211_ibf_enable,
.ibf_dump = nl80211_ibf_dump,
@@ -382,7 +382,7 @@
u32 ignore_next_local_disconnect;
u32 ignore_next_local_deauth;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index 615af2eb2..474d4e273 100644
+index 670588dd2..4e2afb7f2 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1153,6 +1153,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
@@ -396,5 +396,5 @@
}
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0041-mtk-hostapd-Add-he_ldpc-configuration.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0024-mtk-hostapd-Add-he_ldpc-configuration.patch
similarity index 84%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0041-mtk-hostapd-Add-he_ldpc-configuration.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0024-mtk-hostapd-Add-he_ldpc-configuration.patch
index 5dac957..43ba4db 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0041-mtk-hostapd-Add-he_ldpc-configuration.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0024-mtk-hostapd-Add-he_ldpc-configuration.patch
@@ -1,7 +1,7 @@
-From 0fa801d52f2e29c87aef757efc690aa5b2474f1b Mon Sep 17 00:00:00 2001
+From 305f9748549189ce802544c0923446ca6a53ae1b Mon Sep 17 00:00:00 2001
From: MeiChia Chiu <meichia.chiu@mediatek.com>
Date: Thu, 12 Jan 2023 15:18:19 +0800
-Subject: [PATCH 041/104] mtk: hostapd: Add he_ldpc configuration
+Subject: [PATCH 024/126] mtk: hostapd: Add he_ldpc configuration
---
hostapd/config_file.c | 2 ++
@@ -13,10 +13,10 @@
6 files changed, 19 insertions(+)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index 7695ab196..dadc8f108 100644
+index 1f57b882f..dc05738db 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -3908,6 +3908,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -4000,6 +4000,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
conf->he_phy_capab.he_su_beamformee = atoi(pos);
} else if (os_strcmp(buf, "he_mu_beamformer") == 0) {
conf->he_phy_capab.he_mu_beamformer = atoi(pos);
@@ -26,10 +26,10 @@
conf->he_op.he_bss_color = atoi(pos) & 0x3f;
conf->he_op.he_bss_color_disabled = 0;
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
-index 0d10998af..f988b17b2 100644
+index 56442c69d..118754800 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
-@@ -833,6 +833,11 @@ wmm_ac_vo_acm=0
+@@ -858,6 +858,11 @@ wmm_ac_vo_acm=0
# 1 = supported
#he_mu_beamformer=1
@@ -42,10 +42,10 @@
#he_bss_color=1
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
-index 2420a251e..ba1b2a7a3 100644
+index 5dd7f7b2b..3a12de3cd 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
-@@ -273,6 +273,7 @@ struct hostapd_config * hostapd_config_defaults(void)
+@@ -275,6 +275,7 @@ struct hostapd_config * hostapd_config_defaults(void)
#endif /* CONFIG_ACS */
#ifdef CONFIG_IEEE80211AX
@@ -54,10 +54,10 @@
HE_OPERATION_RTS_THRESHOLD_OFFSET;
/* Set default basic MCS/NSS set to single stream MCS 0-7 */
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 123e12c8f..d995b8d9c 100644
+index d0a692750..f90f4d554 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -985,6 +985,7 @@ struct hostapd_bss_config {
+@@ -1035,6 +1035,7 @@ struct hostapd_bss_config {
* struct he_phy_capabilities_info - HE PHY capabilities
*/
struct he_phy_capabilities_info {
@@ -84,10 +84,10 @@
cap->he_phy_capab_info[HE_PHYCAP_SU_BEAMFORMER_CAPAB_IDX] |=
HE_PHYCAP_SU_BEAMFORMER_CAPAB;
diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
-index 7a1da3252..a289c2d87 100644
+index 269b1cf97..c380d0c7e 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
-@@ -2452,6 +2452,9 @@ struct ieee80211_spatial_reuse {
+@@ -2461,6 +2461,9 @@ struct ieee80211_spatial_reuse {
#define HE_PHYCAP_CHANNEL_WIDTH_SET_160MHZ_IN_5G ((u8) BIT(3))
#define HE_PHYCAP_CHANNEL_WIDTH_SET_80PLUS80MHZ_IN_5G ((u8) BIT(4))
@@ -98,5 +98,5 @@
#define HE_PHYCAP_SU_BEAMFORMER_CAPAB ((u8) BIT(7))
#define HE_PHYCAP_SU_BEAMFORMEE_CAPAB_IDX 4
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0043-mtk-hostapd-6G-band-does-not-require-DFS.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0025-mtk-hostapd-6G-band-does-not-require-DFS.patch
similarity index 68%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0043-mtk-hostapd-6G-band-does-not-require-DFS.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0025-mtk-hostapd-6G-band-does-not-require-DFS.patch
index 304e444..2ba3b97 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0043-mtk-hostapd-6G-band-does-not-require-DFS.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0025-mtk-hostapd-6G-band-does-not-require-DFS.patch
@@ -1,17 +1,17 @@
-From 931c93d5d19249a0b4e4efbc5957f537578dfd81 Mon Sep 17 00:00:00 2001
+From ba80aca90cdfbc98b8a21489f0fc89114c94f2d1 Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Mon, 13 Feb 2023 11:03:53 +0800
-Subject: [PATCH 043/104] mtk: hostapd: 6G band does not require DFS
+Subject: [PATCH 025/126] mtk: hostapd: 6G band does not require DFS
---
src/ap/dfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
-index ece27d070..44f3a2cb1 100644
+index 42cce2dce..86598a18a 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -1525,6 +1525,7 @@ int hostapd_is_dfs_required(struct hostapd_iface *iface)
+@@ -1538,6 +1538,7 @@ int hostapd_is_dfs_required(struct hostapd_iface *iface)
if ((!(iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) &&
!iface->conf->ieee80211h) ||
!iface->current_mode ||
@@ -20,5 +20,5 @@
return 0;
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0044-mtk-hostapd-Fix-sending-wrong-VHT-operation-IE-in-CS.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0026-mtk-hostapd-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
similarity index 83%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0044-mtk-hostapd-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0026-mtk-hostapd-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
index 9a8d8ae..914e7ad 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0044-mtk-hostapd-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0026-mtk-hostapd-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
@@ -1,7 +1,7 @@
-From 79d4323faf5c14f9a4a8e0cf3219582210463206 Mon Sep 17 00:00:00 2001
+From 4fc496233d06ceb3c162fa4a474c9bf8bf2ae909 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Mon, 20 Feb 2023 11:01:18 +0800
-Subject: [PATCH 044/104] mtk: hostapd: Fix sending wrong VHT operation IE in
+Subject: [PATCH 026/126] mtk: hostapd: Fix sending wrong VHT operation IE in
CSA while using ZWDFS
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
@@ -10,10 +10,10 @@
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
-index 44f3a2cb1..c703d2fb8 100644
+index 86598a18a..aaaea0edc 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -1129,6 +1129,14 @@ static int
+@@ -1130,6 +1130,14 @@ static int
hostapd_dfs_start_channel_switch_background(struct hostapd_iface *iface)
{
u8 current_vht_oper_chwidth = hostapd_get_oper_chwidth(iface->conf);
@@ -28,7 +28,7 @@
iface->conf->channel = iface->radar_background.channel;
iface->freq = iface->radar_background.freq;
-@@ -1141,11 +1149,7 @@ hostapd_dfs_start_channel_switch_background(struct hostapd_iface *iface)
+@@ -1142,11 +1150,7 @@ hostapd_dfs_start_channel_switch_background(struct hostapd_iface *iface)
hostapd_dfs_update_background_chain(iface);
@@ -42,5 +42,5 @@
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0045-mtk-hostapd-Add-sta-assisted-DFS-state-update-mechan.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0027-mtk-hostapd-Add-sta-assisted-DFS-state-update-mechan.patch
similarity index 89%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0045-mtk-hostapd-Add-sta-assisted-DFS-state-update-mechan.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0027-mtk-hostapd-Add-sta-assisted-DFS-state-update-mechan.patch
index 5ef55c0..09ed283 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0045-mtk-hostapd-Add-sta-assisted-DFS-state-update-mechan.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0027-mtk-hostapd-Add-sta-assisted-DFS-state-update-mechan.patch
@@ -1,7 +1,7 @@
-From cc4ace547c0b0ebef084e9634f729267b6c89f08 Mon Sep 17 00:00:00 2001
+From a6e614017f8f6c007fa3ee2cf1543e6460097f10 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Mon, 20 Feb 2023 10:51:47 +0800
-Subject: [PATCH 045/104] mtk: hostapd: Add sta-assisted DFS state update
+Subject: [PATCH 027/126] mtk: hostapd: Add sta-assisted DFS state update
mechanism
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
@@ -16,10 +16,10 @@
7 files changed, 78 insertions(+)
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
-index c703d2fb8..3e036441b 100644
+index aaaea0edc..4f8ef8111 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -1522,6 +1522,26 @@ int hostapd_dfs_nop_finished(struct hostapd_iface *iface, int freq,
+@@ -1535,6 +1535,26 @@ int hostapd_dfs_nop_finished(struct hostapd_iface *iface, int freq,
}
@@ -61,10 +61,10 @@
int hostapd_is_dfs_chan_available(struct hostapd_iface *iface);
int hostapd_dfs_start_cac(struct hostapd_iface *iface, int freq,
diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
-index e8796f709..caa171474 100644
+index 6e76f697a..1d40943d6 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
-@@ -2226,6 +2226,24 @@ static void hostapd_event_dfs_cac_started(struct hostapd_data *hapd,
+@@ -2270,6 +2270,24 @@ static void hostapd_event_dfs_cac_started(struct hostapd_data *hapd,
radar->cf1, radar->cf2);
}
@@ -89,7 +89,7 @@
#endif /* NEED_AP_MLME */
-@@ -2592,6 +2610,16 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
+@@ -2687,6 +2705,16 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
hapd = switch_link_hapd(hapd, data->dfs_event.link_id);
hostapd_event_dfs_nop_finished(hapd, &data->dfs_event);
break;
@@ -107,7 +107,7 @@
/* channel list changed (regulatory?), update channel list */
/* TODO: check this. hostapd_get_hw_features() initializes
diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h
-index c5bb9abd7..88ad54d6f 100644
+index d1ce1dd29..4700c5487 100644
--- a/src/common/wpa_ctrl.h
+++ b/src/common/wpa_ctrl.h
@@ -383,6 +383,7 @@ extern "C" {
@@ -119,10 +119,10 @@
#define AP_CSA_FINISHED "AP-CSA-FINISHED "
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 6eeb9c22e..dbd0137ac 100644
+index 348cf9c88..cccc44147 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5900,6 +5900,20 @@ enum wpa_event_type {
+@@ -5926,6 +5926,20 @@ enum wpa_event_type {
* EVENT_LINK_RECONFIG - Notification that AP links removed
*/
EVENT_LINK_RECONFIG,
@@ -144,10 +144,10 @@
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
-index 4a12d749c..7889930a0 100644
+index 1787dbd99..8ba479861 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
-@@ -2529,6 +2529,12 @@ static void nl80211_radar_event(struct wpa_driver_nl80211_data *drv,
+@@ -2539,6 +2539,12 @@ static void nl80211_radar_event(struct wpa_driver_nl80211_data *drv,
case NL80211_RADAR_CAC_STARTED:
wpa_supplicant_event(drv->ctx, EVENT_DFS_CAC_STARTED, &data);
break;
@@ -161,10 +161,10 @@
wpa_printf(MSG_DEBUG, "nl80211: Unknown radar event %d "
"received", event_type);
diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h
-index dced2c49d..8917d565b 100644
+index f97f5adc8..622fa71fd 100644
--- a/src/drivers/nl80211_copy.h
+++ b/src/drivers/nl80211_copy.h
-@@ -6699,6 +6699,10 @@ enum nl80211_smps_mode {
+@@ -6843,6 +6843,10 @@ enum nl80211_smps_mode {
* applicable for ETSI dfs domain where pre-CAC is valid for ever.
* @NL80211_RADAR_CAC_STARTED: Channel Availability Check has been started,
* should be generated by HW if NL80211_EXT_FEATURE_DFS_OFFLOAD is enabled.
@@ -175,7 +175,7 @@
*/
enum nl80211_radar_event {
NL80211_RADAR_DETECTED,
-@@ -6707,6 +6711,8 @@ enum nl80211_radar_event {
+@@ -6851,6 +6855,8 @@ enum nl80211_radar_event {
NL80211_RADAR_NOP_FINISHED,
NL80211_RADAR_PRE_CAC_EXPIRED,
NL80211_RADAR_CAC_STARTED,
@@ -185,5 +185,5 @@
/**
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0046-mtk-hostapd-Mark-DFS-channel-as-available-for-CSA.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0028-mtk-hostapd-Mark-DFS-channel-as-available-for-CSA.patch
similarity index 76%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0046-mtk-hostapd-Mark-DFS-channel-as-available-for-CSA.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0028-mtk-hostapd-Mark-DFS-channel-as-available-for-CSA.patch
index 7d905c5..ed43435 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0046-mtk-hostapd-Mark-DFS-channel-as-available-for-CSA.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0028-mtk-hostapd-Mark-DFS-channel-as-available-for-CSA.patch
@@ -1,7 +1,7 @@
-From 21476005ab6b517c7765fec7c3d6c3383c5f44f4 Mon Sep 17 00:00:00 2001
+From 5fc587076c71f7a410dd59b467f156a0ed804b13 Mon Sep 17 00:00:00 2001
From: "himanshu.goyal" <himanshu.goyal@mediatek.com>
Date: Fri, 3 Mar 2023 12:45:42 +0800
-Subject: [PATCH 046/104] mtk: hostapd: Mark DFS channel as available for CSA.
+Subject: [PATCH 028/126] mtk: hostapd: Mark DFS channel as available for CSA.
---
hostapd/ctrl_iface.c | 10 ++++++++++
@@ -10,10 +10,10 @@
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 5f6278ecd..052588da4 100644
+index 7e5733278..815633c67 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -2776,6 +2776,16 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+@@ -2792,6 +2792,16 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
break;
}
@@ -31,23 +31,23 @@
dfs_range += hostapd_is_dfs_overlap(
iface, bandwidth, settings.freq_params.center_freq1);
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index 847f867ab..da9c0f931 100644
+index d934bb0d4..7ab980990 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1775,7 +1775,7 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1800,7 +1800,7 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
"<addr> = send QoS Map Configure frame" },
{ "chan_switch", hostapd_cli_cmd_chan_switch, NULL,
"<cs_count> <freq> [sec_channel_offset=] [center_freq1=]\n"
- " [center_freq2=] [bandwidth=] [blocktx] [ht|vht]\n"
+ " [center_freq2=] [bandwidth=] [blocktx] [ht|vht] [skip_cac]\n"
" = initiate channel switch announcement" },
- { "notify_cw_change", hostapd_cli_cmd_notify_cw_change, NULL,
- "<channel_width> = 0 - 20 MHz, 1 - 40 MHz, 2 - 80 MHz, 3 - 160 MHz" },
+ #ifdef CONFIG_IEEE80211AX
+ { "color_change", hostapd_cli_cmd_color_change, NULL,
diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
-index a2f89260c..b92311e32 100644
+index 4d3c7e529..20d426560 100644
--- a/src/ap/ctrl_iface_ap.c
+++ b/src/ap/ctrl_iface_ap.c
-@@ -1117,6 +1117,7 @@ int hostapd_parse_csa_settings(const char *pos,
+@@ -1140,6 +1140,7 @@ int hostapd_parse_csa_settings(const char *pos,
settings->freq_params.vht_enabled = !!os_strstr(pos, " vht");
settings->freq_params.he_enabled = !!os_strstr(pos, " he");
settings->freq_params.eht_enabled = !!os_strstr(pos, " eht");
@@ -56,5 +56,5 @@
#undef SET_CSA_SETTING
#undef SET_CSA_SETTING_EXT
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0047-mtk-hostapd-Add-available-color-bitmap.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0029-mtk-hostapd-Add-available-color-bitmap.patch
similarity index 92%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0047-mtk-hostapd-Add-available-color-bitmap.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0029-mtk-hostapd-Add-available-color-bitmap.patch
index 9f3c55b..a8adfdc 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0047-mtk-hostapd-Add-available-color-bitmap.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0029-mtk-hostapd-Add-available-color-bitmap.patch
@@ -1,7 +1,7 @@
-From 50ceb0f2eb9b542ab115ed79fd2d68d46e9e03a0 Mon Sep 17 00:00:00 2001
+From 75c1aefed4cda9d8bcb5e8e7f6f086af4a6ff58a Mon Sep 17 00:00:00 2001
From: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
Date: Thu, 26 Jan 2023 09:16:00 +0800
-Subject: [PATCH 047/104] mtk: hostapd: Add available color bitmap
+Subject: [PATCH 029/126] mtk: hostapd: Add available color bitmap
Signed-off-by: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
---
@@ -17,10 +17,10 @@
9 files changed, 323 insertions(+), 2 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 052588da4..7b83bdd4f 100644
+index 815633c67..b8a957468 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -4257,6 +4257,76 @@ hostapd_ctrl_iface_get_amsdu(struct hostapd_data *hapd, char *buf,
+@@ -4387,6 +4387,76 @@ hostapd_ctrl_iface_get_amsdu(struct hostapd_data *hapd, char *buf,
return ret;
}
@@ -97,7 +97,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
-@@ -4878,6 +4948,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -5016,6 +5086,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
reply_len = hostapd_ctrl_iface_set_offchan_ctrl(hapd, buf + 16, reply, reply_size);
} else if (os_strncmp(buf, "GET_AMSDU", 9) == 0) {
reply_len = hostapd_ctrl_iface_get_amsdu(hapd, reply, reply_size);
@@ -109,10 +109,10 @@
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index da9c0f931..865c11432 100644
+index 7ab980990..27d61b06d 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1658,6 +1658,20 @@ static int hostapd_cli_cmd_reload_rxkhs(struct wpa_ctrl *ctrl, int argc,
+@@ -1683,6 +1683,20 @@ static int hostapd_cli_cmd_reload_rxkhs(struct wpa_ctrl *ctrl, int argc,
#endif /* CONFIG_IEEE80211R_AP */
@@ -133,7 +133,7 @@
#ifdef ANDROID
static int hostapd_cli_cmd_driver(struct wpa_ctrl *ctrl, int argc, char *argv[])
{
-@@ -1897,6 +1911,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1929,6 +1943,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
{ "get_rxkhs", hostapd_cli_cmd_get_rxkhs, NULL,
"= get R0KHs and R1KHs" },
#endif /* CONFIG_IEEE80211R_AP */
@@ -145,10 +145,10 @@
{ "driver", hostapd_cli_cmd_driver, NULL,
"<driver sub command> [<hex formatted data>] = send driver command data" },
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 23228a8d2..cabcd47af 100644
+index 2685c6f8a..efa4e2b4d 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1321,4 +1321,12 @@ int hostapd_drv_amsdu_dump(struct hostapd_data *hapd, u8 *amsdu)
+@@ -1350,4 +1350,12 @@ int hostapd_drv_amsdu_dump(struct hostapd_data *hapd, u8 *amsdu)
if (!hapd->driver || !hapd->driver->amsdu_dump)
return 0;
return hapd->driver->amsdu_dump(hapd->drv_priv, amsdu);
@@ -164,10 +164,10 @@
+ return hapd->driver->get_aval_color_bmp(hapd->drv_priv, aval_color_bmp);
+}
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index f3a044557..9da2b0049 100644
+index 68b26595f..f57dff4aa 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -160,6 +160,8 @@ int hostapd_drv_ibf_ctrl(struct hostapd_data *hapd);
+@@ -163,6 +163,8 @@ int hostapd_drv_ibf_ctrl(struct hostapd_data *hapd);
int hostapd_drv_ibf_dump(struct hostapd_data *hapd, u8 *ibf_enable);
int hostapd_drv_amsdu_ctrl(struct hostapd_data *hapd);
int hostapd_drv_amsdu_dump(struct hostapd_data *hapd, u8 *amsdu);
@@ -177,7 +177,7 @@
#include "drivers/driver.h"
diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
-index ace993bc8..e27fe69b3 100644
+index 7b4d7c11a..03daeb72a 100644
--- a/src/common/mtk_vendor.h
+++ b/src/common/mtk_vendor.h
@@ -15,6 +15,7 @@ enum mtk_nl80211_vendor_subcmds {
@@ -188,7 +188,7 @@
};
enum mtk_vendor_attr_edcca_ctrl {
-@@ -256,6 +257,16 @@ ibf_dump_policy[NUM_MTK_VENDOR_ATTRS_IBF_DUMP] = {
+@@ -255,6 +256,16 @@ ibf_dump_policy[NUM_MTK_VENDOR_ATTRS_IBF_DUMP] = {
[MTK_VENDOR_ATTR_IBF_DUMP_ENABLE] = { .type = NLA_U8 },
};
@@ -206,10 +206,10 @@
#define CSI_MAX_COUNT 256
#define ETH_ALEN 6
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index dbd0137ac..6b6317bfa 100644
+index cccc44147..5d7eb5b4e 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5273,6 +5273,14 @@ struct wpa_driver_ops {
+@@ -5299,6 +5299,14 @@ struct wpa_driver_ops {
*/
int (*amsdu_ctrl)(void *priv, u8 amsdu);
int (*amsdu_dump)(void *priv, u8 *amsdu);
@@ -225,10 +225,10 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index eca2ff077..4c98e8ab3 100644
+index c2a0f1adb..73bf082f2 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -13153,7 +13153,6 @@ static void nl80211_parse_btm_candidate_info(struct candidate_list *candidate,
+@@ -13175,7 +13175,6 @@ static void nl80211_parse_btm_candidate_info(struct candidate_list *candidate,
num, MAC2STR(candidate->bssid), buf);
}
@@ -236,7 +236,7 @@
static int
nl80211_get_bss_transition_status_handler(struct nl_msg *msg, void *arg)
{
-@@ -14608,6 +14607,202 @@ fail:
+@@ -14630,6 +14629,202 @@ fail:
return -ENOBUFS;
}
@@ -439,7 +439,7 @@
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211",
.desc = "Linux nl80211/cfg80211",
-@@ -14779,4 +14974,5 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -14801,4 +14996,5 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.ibf_dump = nl80211_ibf_dump,
.amsdu_ctrl = nl80211_enable_amsdu,
.amsdu_dump = nl80211_dump_amsdu,
@@ -458,7 +458,7 @@
u32 ignore_next_local_disconnect;
u32 ignore_next_local_deauth;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index 474d4e273..a7df2d172 100644
+index 4e2afb7f2..919f5bdf6 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1156,6 +1156,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
@@ -472,5 +472,5 @@
}
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0048-mtk-hostapd-Fix-ZWDFS-issue-in-BW-160.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0030-mtk-hostapd-Fix-ZWDFS-issue-in-BW-160.patch
similarity index 88%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0048-mtk-hostapd-Fix-ZWDFS-issue-in-BW-160.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0030-mtk-hostapd-Fix-ZWDFS-issue-in-BW-160.patch
index e6f30ed..f78e796 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0048-mtk-hostapd-Fix-ZWDFS-issue-in-BW-160.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0030-mtk-hostapd-Fix-ZWDFS-issue-in-BW-160.patch
@@ -1,7 +1,7 @@
-From 1b8fc72bfd653ce3ef422e86617b1821948f4805 Mon Sep 17 00:00:00 2001
+From e0914bbc141ee65c28697d891b718d3c6f6dbb78 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Mon, 20 Mar 2023 16:08:30 +0800
-Subject: [PATCH 048/104] mtk: hostapd: Fix ZWDFS issue in BW 160
+Subject: [PATCH 030/126] mtk: hostapd: Fix ZWDFS issue in BW 160
When background radar is enabled and bandwidth is set to 160, AP will
fail to startup due to the lack of non-DFS channel.
@@ -14,10 +14,10 @@
1 file changed, 79 insertions(+), 19 deletions(-)
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
-index 3e036441b..f5794753e 100644
+index 4f8ef8111..9677b26ea 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -69,15 +69,22 @@ static int dfs_get_used_n_chans(struct hostapd_iface *iface, int *seg1)
+@@ -70,15 +70,22 @@ static int dfs_get_used_n_chans(struct hostapd_iface *iface, int *seg1)
static int dfs_channel_available(struct hostapd_channel_data *chan,
enum dfs_channel_type type)
{
@@ -44,7 +44,7 @@
}
/*
-@@ -86,16 +93,14 @@ static int dfs_channel_available(struct hostapd_channel_data *chan,
+@@ -87,16 +94,14 @@ static int dfs_channel_available(struct hostapd_channel_data *chan,
* channel for CSA, unless they are available for immediate use.
*/
if (type == DFS_AVAILABLE && (chan->flag & HOSTAPD_CHAN_RADAR) &&
@@ -67,7 +67,7 @@
return 1;
}
-@@ -167,7 +172,7 @@ static int dfs_chan_range_available(struct hostapd_hw_modes *mode,
+@@ -168,7 +173,7 @@ static int dfs_chan_range_available(struct hostapd_hw_modes *mode,
enum dfs_channel_type type)
{
struct hostapd_channel_data *first_chan, *chan;
@@ -76,7 +76,7 @@
u32 bw = num_chan_to_bw(num_chans);
if (first_chan_idx + num_chans > mode->num_channels) {
-@@ -203,14 +208,17 @@ static int dfs_chan_range_available(struct hostapd_hw_modes *mode,
+@@ -204,14 +209,17 @@ static int dfs_chan_range_available(struct hostapd_hw_modes *mode,
return 0;
}
@@ -96,7 +96,7 @@
}
-@@ -838,8 +846,12 @@ static unsigned int dfs_get_cac_time(struct hostapd_iface *iface,
+@@ -839,8 +847,12 @@ static unsigned int dfs_get_cac_time(struct hostapd_iface *iface,
*/
int hostapd_handle_dfs(struct hostapd_iface *iface)
{
@@ -110,7 +110,7 @@
if (is_6ghz_freq(iface->freq))
return 1;
-@@ -902,7 +914,7 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
+@@ -903,7 +915,7 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
/* Finally start CAC */
hostapd_set_state(iface, HAPD_IFACE_DFS);
wpa_printf(MSG_DEBUG, "DFS start CAC on %d MHz%s", iface->freq,
@@ -119,7 +119,7 @@
wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_CAC_START
"freq=%d chan=%d sec_chan=%d, width=%d, seg0=%d, seg1=%d, cac_time=%ds",
iface->freq,
-@@ -912,6 +924,16 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
+@@ -913,6 +925,16 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
hostapd_get_oper_centr_freq_seg1_idx(iface->conf),
iface->dfs_cac_ms / 1000);
@@ -136,7 +136,7 @@
res = hostapd_start_dfs_cac(
iface, iface->conf->hw_mode, iface->freq, iface->conf->channel,
iface->conf->ieee80211n, iface->conf->ieee80211ac,
-@@ -920,14 +942,14 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
+@@ -921,14 +943,14 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
hostapd_get_oper_chwidth(iface->conf),
hostapd_get_oper_centr_freq_seg0_idx(iface->conf),
hostapd_get_oper_centr_freq_seg1_idx(iface->conf),
@@ -153,7 +153,7 @@
/* Cache background radar parameters. */
iface->radar_background.channel = iface->conf->channel;
iface->radar_background.secondary_channel =
-@@ -948,6 +970,35 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
+@@ -949,6 +971,35 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
iface->radar_background.temp_ch = 1;
return 1;
@@ -189,7 +189,7 @@
}
return 0;
-@@ -1204,6 +1255,15 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
+@@ -1214,6 +1265,15 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
hostapd_setup_interface_complete(iface, 0);
iface->cac_started = 0;
}
@@ -206,5 +206,5 @@
} else if (hostapd_dfs_is_background_event(iface, freq)) {
iface->radar_background.cac_started = 0;
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0030-mtk-hostapd-print-sae-groups-by-hostapd-ctrl.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0030-mtk-hostapd-print-sae-groups-by-hostapd-ctrl.patch
deleted file mode 100644
index 56988b8..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0030-mtk-hostapd-print-sae-groups-by-hostapd-ctrl.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From d87f115b26430a4edd465d21be00ec61599c332e Mon Sep 17 00:00:00 2001
-From: Shayne Chen <shayne.chen@mediatek.com>
-Date: Tue, 20 Sep 2022 19:33:45 +0800
-Subject: [PATCH 030/104] mtk: hostapd: print sae groups by hostapd ctrl
-
----
- hostapd/ctrl_iface.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
-diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 4240319b7..1f950bc46 100644
---- a/hostapd/ctrl_iface.c
-+++ b/hostapd/ctrl_iface.c
-@@ -1376,6 +1376,19 @@ static int hostapd_ctrl_iface_get(struct hostapd_data *hapd, char *cmd,
- if (os_snprintf_error(buflen, res))
- return -1;
- return res;
-+ } else if (os_strcmp(cmd, "sae_group_capability") == 0) {
-+#ifdef CONFIG_SAE
-+ /* see sae_set_group() */
-+ res = os_snprintf(buf, buflen, "%s%s%s%s19 20 21",
-+ dh_groups_get(15) ? "15 ": "",
-+ dh_groups_get(16) ? "16 ": "",
-+ dh_groups_get(17) ? "17 ": "",
-+ dh_groups_get(18) ? "18 ": "");
-+
-+ if (os_snprintf_error(buflen, res))
-+ return -1;
-+ return res;
-+#endif /* CONFIG_SAE */
- }
-
- return -1;
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0049-mtk-hostapd-Add-vendor-for-CAPI-certification-comman.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0031-mtk-hostapd-Add-vendor-for-CAPI-certification-comman.patch
similarity index 77%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0049-mtk-hostapd-Add-vendor-for-CAPI-certification-comman.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0031-mtk-hostapd-Add-vendor-for-CAPI-certification-comman.patch
index 8b21535..9587c45 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0049-mtk-hostapd-Add-vendor-for-CAPI-certification-comman.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0031-mtk-hostapd-Add-vendor-for-CAPI-certification-comman.patch
@@ -1,33 +1,48 @@
-From b9b137827e9c0584682606bd5fe1cd9f50635819 Mon Sep 17 00:00:00 2001
+From 502598dedaa7d8fa86a06cf2d03d17d06798c224 Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
-Date: Fri, 17 Mar 2023 16:17:14 +0800
-Subject: [PATCH 049/104] mtk: hostapd: Add vendor for CAPI certification
+Date: Tue, 24 Jan 2023 19:06:44 +0800
+Subject: [PATCH 031/126] mtk: hostapd: Add vendor for CAPI certification
commands
+Support new hostapd_cli command as below:
+$ hostapd_cli -i <intf> raw ap_rfeatures trig_variant=<type>
+
+This will prepare nl80211 msg
+MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_VARIANT_TYPE and then send to driver
+via nl80211.
+
+Support new hostapd_cli command as below:
+$ hostapd_cli -i <intf> -l <link_id> raw ap_rfeatures coding_type=<type>
+
+This will prepare nl80211 msg
+MTK_VENDOR_ATTR_RFEATURE_CTRL_CODING_TYPE and then send it to driver
+via nl80211.
+
+Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
---
- hostapd/ctrl_iface.c | 99 +++++++++++++++++++++++++++++++
- src/ap/ap_drv_ops.c | 21 +++++++
- src/ap/ap_drv_ops.h | 3 +
- src/common/mtk_vendor.h | 33 +----------
- src/drivers/driver.h | 22 +++++++
- src/drivers/driver_nl80211.c | 55 +++++++++++++++++
- src/drivers/driver_nl80211.h | 1 +
- src/drivers/driver_nl80211_capa.c | 3 +
- 8 files changed, 206 insertions(+), 31 deletions(-)
+ hostapd/ctrl_iface.c | 103 ++++++++++++++++++++++++++++++
+ src/ap/ap_drv_ops.c | 28 ++++++++
+ src/ap/ap_drv_ops.h | 3 +
+ src/common/mtk_vendor.h | 37 ++---------
+ src/drivers/driver.h | 23 +++++++
+ src/drivers/driver_nl80211.c | 63 +++++++++++++++++-
+ src/drivers/driver_nl80211.h | 1 +
+ src/drivers/driver_nl80211_capa.c | 3 +
+ 8 files changed, 229 insertions(+), 32 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 7b83bdd4f..1154a2394 100644
+index b8a957468..6e7c03f81 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -71,6 +71,7 @@
- #include "config_file.h"
+@@ -72,6 +72,7 @@
#include "ctrl_iface.h"
+ #include "crypto/dh_groups.h"
+#include "common/mtk_vendor.h"
#define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256
-@@ -4327,6 +4328,100 @@ hostapd_ctrl_iface_get_aval_color_bmp(struct hostapd_data *hapd, char *buf,
+@@ -4457,6 +4458,104 @@ hostapd_ctrl_iface_get_aval_color_bmp(struct hostapd_data *hapd, char *buf,
return pos - buf;
}
@@ -108,6 +123,10 @@
+ goto trigtype;
+ } else if (os_strcmp(config, "ack_policy") == 0)
+ sub_cmd = MTK_VENDOR_ATTR_RFEATURE_CTRL_ACK_PLCY;
++ else if (os_strcmp(config, "trig_variant") == 0)
++ sub_cmd = MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_VARIANT_TYPE;
++ else if (os_strcmp(config, "coding_type") == 0)
++ sub_cmd = MTK_VENDOR_ATTR_RFEATURE_CTRL_CODING_TYPE;
+ else {
+ wpa_printf(MSG_ERROR,
+ "Unsupported parameter %s for ap_rfeatures", config);
@@ -128,7 +147,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
-@@ -4952,6 +5047,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -5090,6 +5189,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
reply_len = hostapd_ctrl_iface_get_bss_color(hapd, reply, reply_size);
} else if (os_strncmp(buf, "AVAL_COLOR_BMP", 14) == 0) {
reply_len = hostapd_ctrl_iface_get_aval_color_bmp(hapd, reply, reply_size);
@@ -140,10 +159,10 @@
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index cabcd47af..06d71f309 100644
+index efa4e2b4d..999cef7ad 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1330,3 +1330,24 @@ int hostapd_drv_get_aval_bss_color_bmp(struct hostapd_data *hapd, u64 *aval_colo
+@@ -1359,3 +1359,31 @@ int hostapd_drv_get_aval_bss_color_bmp(struct hostapd_data *hapd, u64 *aval_colo
return 0;
return hapd->driver->get_aval_color_bmp(hapd->drv_priv, aval_color_bmp);
}
@@ -157,9 +176,16 @@
+
+int hostapd_drv_ap_rfeatures(struct hostapd_data *hapd, u8 sub_vendor_id, int value)
+{
++ s8 link_id = -1;
++
+ if (!hapd->driver || !hapd->driver->ap_rfeatures)
+ return 0;
-+ return hapd->driver->ap_rfeatures(hapd->drv_priv, sub_vendor_id, value);
++
++ if (hapd->conf->mld_ap)
++ link_id = hapd->mld_link_id;
++
++ return hapd->driver->ap_rfeatures(hapd->drv_priv, sub_vendor_id, value,
++ link_id);
+}
+
+int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type)
@@ -169,10 +195,10 @@
+ return hapd->driver->ap_trigtype(hapd->drv_priv, enable, type);
+}
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index 9da2b0049..c58930217 100644
+index f57dff4aa..95b8dabbe 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -162,6 +162,9 @@ int hostapd_drv_amsdu_ctrl(struct hostapd_data *hapd);
+@@ -165,6 +165,9 @@ int hostapd_drv_amsdu_ctrl(struct hostapd_data *hapd);
int hostapd_drv_amsdu_dump(struct hostapd_data *hapd, u8 *amsdu);
int hostapd_drv_get_aval_bss_color_bmp(struct hostapd_data *hapd,
u64 *aval_color_bmp);
@@ -183,7 +209,7 @@
#include "drivers/driver.h"
diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
-index e27fe69b3..0b23c76ad 100644
+index 03daeb72a..aa9df4fc4 100644
--- a/src/common/mtk_vendor.h
+++ b/src/common/mtk_vendor.h
@@ -50,17 +50,6 @@ enum mtk_vendor_attr_edcca_dump {
@@ -215,16 +241,17 @@
enum mtk_vendor_attr_csi_ctrl {
MTK_VENDOR_ATTR_CSI_CTRL_UNSPEC,
-@@ -172,7 +157,7 @@ enum mtk_vendor_attr_wireless_ctrl {
+@@ -172,7 +157,8 @@ enum mtk_vendor_attr_wireless_ctrl {
MTK_VENDOR_ATTR_WIRELESS_CTRL_BA_BUFFER_SIZE,
MTK_VENDOR_ATTR_WIRELESS_CTRL_MIMO,
MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU,
- MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT,
+ MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT = 9,
- MTK_VENDOR_ATTR_WIRELESS_CTRL_RTS_SIGTA,
++ MTK_VENDOR_ATTR_WIRELESS_CTRL_RTS_SIGTA,
/* keep last */
-@@ -192,11 +177,6 @@ enum mtk_vendor_attr_wireless_dump {
+ NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL,
+@@ -191,11 +177,6 @@ enum mtk_vendor_attr_wireless_dump {
NUM_MTK_VENDOR_ATTRS_WIRELESS_DUMP - 1
};
@@ -236,15 +263,18 @@
enum mtk_vendor_attr_rfeature_ctrl {
MTK_VENDOR_ATTR_RFEATURE_CTRL_UNSPEC,
-@@ -206,6 +186,7 @@ enum mtk_vendor_attr_rfeature_ctrl {
+@@ -205,6 +186,10 @@ enum mtk_vendor_attr_rfeature_ctrl {
MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE_EN,
MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE,
MTK_VENDOR_ATTR_RFEATURE_CTRL_ACK_PLCY,
+ MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TXBF,
++ MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_VARIANT_TYPE,
++ MTK_VENDOR_ATTR_RFEATURE_CTRL_CODING_TYPE,
++ MTK_VENDOR_ATTR_RFEATURE_CTRL_LINK_ID,
/* keep last */
NUM_MTK_VENDOR_ATTRS_RFEATURE_CTRL,
-@@ -247,16 +228,6 @@ enum mtk_vendor_attr_ibf_dump {
+@@ -246,16 +231,6 @@ enum mtk_vendor_attr_ibf_dump {
NUM_MTK_VENDOR_ATTRS_IBF_DUMP - 1
};
@@ -262,10 +292,10 @@
MTK_VENDOR_ATTR_BSS_COLOR_CTRL_UNSPEC,
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 6b6317bfa..a25601c91 100644
+index 5d7eb5b4e..a0ce0aedd 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5281,6 +5281,28 @@ struct wpa_driver_ops {
+@@ -5307,6 +5307,29 @@ struct wpa_driver_ops {
*
*/
int (*get_aval_color_bmp)(void *priv, u64 *aval_color_bmp);
@@ -281,8 +311,9 @@
+ * ap_rfeatures - set ap rf features command
+ * @priv: Private driver interface data
+ * @value: value
++ * @link_id: MLD link id. -1 if this is an non-MLD AP.
+ */
-+ int (*ap_rfeatures)(void *priv, u8 mode, int value);
++ int (*ap_rfeatures)(void *priv, u8 mode, int value, s8 link_id);
+
+ /**
+ * ap_trigtype - set trigger type
@@ -295,10 +326,10 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 4c98e8ab3..86e5844cd 100644
+index 73bf082f2..7b743a1b8 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -91,6 +91,58 @@ static void handle_nl_debug_hook(struct nl_msg *msg, int tx)
+@@ -88,6 +88,61 @@ static void handle_nl_debug_hook(struct nl_msg *msg, int tx)
wpa_netlink_hook(tx, nlh, nlh->nlmsg_len);
}
@@ -340,6 +371,9 @@
+ [MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE] = { .type = NLA_U8 },
+ [MTK_VENDOR_ATTR_RFEATURE_CTRL_ACK_PLCY] = { .type = NLA_U8 },
+ [MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TXBF] = { .type = NLA_U8 },
++ [MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_VARIANT_TYPE] = { .type = NLA_U8 },
++ [MTK_VENDOR_ATTR_RFEATURE_CTRL_CODING_TYPE] = { .type = NLA_U8 },
++ [MTK_VENDOR_ATTR_RFEATURE_CTRL_LINK_ID] = { .type = NLA_U8 },
+};
+
+static const struct nla_policy
@@ -357,7 +391,26 @@
static struct nl_sock * nl_create_handle(struct nl_cb *cb, const char *dbg)
{
struct nl_sock *handle;
-@@ -14975,4 +15027,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -14737,7 +14792,7 @@ fail:
+ return -ENOBUFS;
+ }
+
+-static int nl80211_ap_rfeatures(void *priv, u8 sub_vendor_id, int value)
++static int nl80211_ap_rfeatures(void *priv, u8 sub_vendor_id, int value, s8 link_id)
+ {
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+@@ -14765,6 +14820,9 @@ static int nl80211_ap_rfeatures(void *priv, u8 sub_vendor_id, int value)
+
+ nla_put_u8(msg, sub_vendor_id, (u8) value);
+
++ if (link_id > -1)
++ nla_put_u8(msg, MTK_VENDOR_ATTR_RFEATURE_CTRL_LINK_ID, link_id);
++
+ nla_nest_end(msg, data);
+
+ ret = send_and_recv_cmd(drv, msg);
+@@ -14997,4 +15055,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.amsdu_ctrl = nl80211_enable_amsdu,
.amsdu_dump = nl80211_dump_amsdu,
.get_aval_color_bmp = nl80211_get_aval_color_bmp,
@@ -378,7 +431,7 @@
u32 ignore_next_local_disconnect;
u32 ignore_next_local_deauth;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index a7df2d172..6498eba6d 100644
+index 919f5bdf6..ad7f5003a 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1159,6 +1159,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
@@ -392,5 +445,5 @@
}
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0050-mtk-hostapd-Air-Monitor-support-in-hostapd-by-vendor.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0032-mtk-hostapd-Air-Monitor-support-in-hostapd-by-vendor.patch
similarity index 93%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0050-mtk-hostapd-Air-Monitor-support-in-hostapd-by-vendor.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0032-mtk-hostapd-Air-Monitor-support-in-hostapd-by-vendor.patch
index aecb14a..40542c0 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0050-mtk-hostapd-Air-Monitor-support-in-hostapd-by-vendor.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0032-mtk-hostapd-Air-Monitor-support-in-hostapd-by-vendor.patch
@@ -1,7 +1,7 @@
-From 994774c363a07fa90a7a21974b7b4a371b235673 Mon Sep 17 00:00:00 2001
+From 8d8d23a68c8e0b47457497d29a3834feb0748682 Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Fri, 12 May 2023 05:18:48 +0800
-Subject: [PATCH 050/104] mtk: hostapd: Air Monitor support in hostapd by
+Subject: [PATCH 032/126] mtk: hostapd: Air Monitor support in hostapd by
vendor
Signed-off-by: mtk23888 <dipanshu.mittal@mediatek.com>
@@ -18,10 +18,10 @@
9 files changed, 351 insertions(+)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 1154a2394..56722384b 100644
+index 6e7c03f81..03831a908 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -4370,6 +4370,44 @@ hostapd_ctrl_iface_ap_wireless(struct hostapd_data *hapd, char *cmd,
+@@ -4500,6 +4500,44 @@ hostapd_ctrl_iface_ap_wireless(struct hostapd_data *hapd, char *cmd,
if (hostapd_drv_ap_wireless(hapd, (u8) sub_cmd, atoi(value)) != 0)
return -1;
@@ -66,7 +66,7 @@
return os_snprintf(buf, buflen, "OK\n");
}
-@@ -4423,6 +4461,75 @@ exit:
+@@ -4557,6 +4595,75 @@ exit:
return os_snprintf(buf, buflen, "OK\n");
}
@@ -142,7 +142,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
int reply_size,
-@@ -5051,6 +5158,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -5193,6 +5300,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
reply_len = hostapd_ctrl_iface_ap_wireless(hapd, buf + 12, reply, reply_size);
} else if (os_strncmp(buf, "ap_rfeatures ", 13) == 0) {
reply_len = hostapd_ctrl_iface_ap_rfeatures(hapd, buf + 13, reply, reply_size);
@@ -156,10 +156,10 @@
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index 865c11432..12c580455 100644
+index 27d61b06d..dba805e8a 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1693,6 +1693,17 @@ static int hostapd_cli_cmd_get_amsdu(struct wpa_ctrl *ctrl, int argc,
+@@ -1718,6 +1718,17 @@ static int hostapd_cli_cmd_get_amsdu(struct wpa_ctrl *ctrl, int argc,
return hostapd_cli_cmd(ctrl, "GET_AMSDU", 0, NULL, NULL);
}
@@ -177,7 +177,7 @@
struct hostapd_cli_cmd {
const char *cmd;
-@@ -1925,6 +1936,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1957,6 +1968,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
" = show iBF state (enabled/disabled)"},
{ "get_amsdu", hostapd_cli_cmd_get_amsdu, NULL,
" = show AMSDU state"},
@@ -189,10 +189,10 @@
};
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 06d71f309..df652b12f 100644
+index 999cef7ad..5988bd11c 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1351,3 +1351,17 @@ int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type)
+@@ -1387,3 +1387,17 @@ int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type)
return 0;
return hapd->driver->ap_trigtype(hapd->drv_priv, enable, type);
}
@@ -211,10 +211,10 @@
+ return hapd->driver->amnt_dump(hapd->drv_priv, amnt_idx, amnt_dump_buf);
+}
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index c58930217..4805a2e84 100644
+index 95b8dabbe..d914fd967 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -166,6 +166,9 @@ int hostapd_drv_ap_wireless(struct hostapd_data *hapd, u8 sub_vendor_id, int val
+@@ -169,6 +169,9 @@ int hostapd_drv_ap_wireless(struct hostapd_data *hapd, u8 sub_vendor_id, int val
int hostapd_drv_ap_rfeatures(struct hostapd_data *hapd, u8 sub_vendor_id, int value);
int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type);
@@ -225,10 +225,10 @@
int hostapd_drv_wnm_oper(struct hostapd_data *hapd,
diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
-index 0b23c76ad..dd1ca2164 100644
+index aa9df4fc4..ee0c15eb3 100644
--- a/src/common/mtk_vendor.h
+++ b/src/common/mtk_vendor.h
-@@ -258,10 +258,18 @@ struct csi_data {
+@@ -261,10 +261,18 @@ struct csi_data {
u16 rx_idx;
};
@@ -248,10 +248,10 @@
+
#endif /* MTK_VENDOR_H */
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index a25601c91..dd9c33201 100644
+index a0ce0aedd..4bc0bbeae 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5303,6 +5303,22 @@ struct wpa_driver_ops {
+@@ -5330,6 +5330,22 @@ struct wpa_driver_ops {
* @type: trigger type
*/
int (*ap_trigtype)(void *priv, u8 enable, u8 type);
@@ -275,7 +275,7 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 86e5844cd..a2a6807f4 100644
+index 7b743a1b8..db8a6f8e4 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -143,6 +143,19 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
@@ -298,7 +298,7 @@
static struct nl_sock * nl_create_handle(struct nl_cb *cb, const char *dbg)
{
struct nl_sock *handle;
-@@ -14855,6 +14868,170 @@ fail:
+@@ -14883,6 +14896,170 @@ fail:
return -ENOBUFS;
}
@@ -469,7 +469,7 @@
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211",
.desc = "Linux nl80211/cfg80211",
-@@ -15030,4 +15207,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -15058,4 +15235,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.ap_wireless = nl80211_ap_wireless,
.ap_rfeatures = nl80211_ap_rfeatures,
.ap_trigtype = nl80211_ap_trigtype,
@@ -489,7 +489,7 @@
u32 ignore_next_local_disconnect;
u32 ignore_next_local_deauth;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index 6498eba6d..38e83e42b 100644
+index ad7f5003a..4a6ff0f28 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1158,6 +1158,8 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
@@ -502,5 +502,5 @@
case MTK_NL80211_VENDOR_SUBCMD_RFEATURE_CTRL:
drv->mtk_rfeatures_vendor_cmd_avail = 1;
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0051-mtk-hostapd-Add-muru-user-number-debug-command.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0033-mtk-hostapd-Add-muru-user-number-debug-command.patch
similarity index 86%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0051-mtk-hostapd-Add-muru-user-number-debug-command.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0033-mtk-hostapd-Add-muru-user-number-debug-command.patch
index 85e1f7a..0f5d6ef 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0051-mtk-hostapd-Add-muru-user-number-debug-command.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0033-mtk-hostapd-Add-muru-user-number-debug-command.patch
@@ -1,7 +1,7 @@
-From ccef6202191f2a17f84f021e6e2ade206b8c9cc1 Mon Sep 17 00:00:00 2001
+From f54048fe93acc757c0cb144077d4e4e3fb2ac9fc Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Fri, 12 May 2023 05:24:19 +0800
-Subject: [PATCH 051/104] mtk: hostapd: Add muru user number debug command
+Subject: [PATCH 033/126] mtk: hostapd: Add muru user number debug command
---
hostapd/ctrl_iface.c | 13 ++++++++++++-
@@ -14,10 +14,10 @@
7 files changed, 55 insertions(+), 15 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 56722384b..88475b321 100644
+index 03831a908..b78ee24c0 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -3673,6 +3673,8 @@ hostapd_ctrl_iface_set_edcca(struct hostapd_data *hapd, char *cmd,
+@@ -3803,6 +3803,8 @@ hostapd_ctrl_iface_set_edcca(struct hostapd_data *hapd, char *cmd,
char *buf, size_t buflen)
{
char *pos, *config, *value;
@@ -26,7 +26,7 @@
config = cmd;
pos = os_strchr(config, ' ');
if (pos == NULL)
-@@ -4065,6 +4067,8 @@ hostapd_ctrl_iface_set_mu(struct hostapd_data *hapd, char *cmd,
+@@ -4195,6 +4197,8 @@ hostapd_ctrl_iface_set_mu(struct hostapd_data *hapd, char *cmd,
char *buf, size_t buflen)
{
char *pos, *config, *value;
@@ -35,7 +35,7 @@
config = cmd;
pos = os_strchr(config, ' ');
if (pos == NULL)
-@@ -4082,13 +4086,20 @@ hostapd_ctrl_iface_set_mu(struct hostapd_data *hapd, char *cmd,
+@@ -4212,13 +4216,20 @@ hostapd_ctrl_iface_set_mu(struct hostapd_data *hapd, char *cmd,
return -1;
}
hapd->iconf->mu_onoff = (u8) mu;
@@ -58,10 +58,10 @@
} else {
return -1;
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index df652b12f..8878db380 100644
+index 5988bd11c..496fd4263 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1270,11 +1270,11 @@ int hostapd_drv_get_edcca(struct hostapd_data *hapd, const u8 mode, u8 *value)
+@@ -1299,11 +1299,11 @@ int hostapd_drv_get_edcca(struct hostapd_data *hapd, const u8 mode, u8 *value)
return hapd->driver->get_edcca(hapd->drv_priv, mode, value);
}
@@ -76,10 +76,10 @@
int hostapd_drv_mu_dump(struct hostapd_data *hapd, u8 *mu_onoff)
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index 4805a2e84..f77d07da0 100644
+index d914fd967..a949e168d 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -153,7 +153,7 @@ int hostapd_drv_configure_edcca_enable(struct hostapd_data *hapd);
+@@ -156,7 +156,7 @@ int hostapd_drv_configure_edcca_enable(struct hostapd_data *hapd);
int hostapd_drv_configure_edcca_threshold(struct hostapd_data *hapd,
const int *threshold);
int hostapd_drv_get_edcca(struct hostapd_data *hapd, const u8 mode, u8 *value);
@@ -89,7 +89,7 @@
int hostapd_drv_three_wire_ctrl(struct hostapd_data *hapd);
int hostapd_drv_ibf_ctrl(struct hostapd_data *hapd);
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index a5b683676..5fd46d53d 100644
+index 6ab3e6043..9e1ba6a21 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -58,6 +58,7 @@
@@ -100,7 +100,7 @@
static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason);
#ifdef CONFIG_WEP
-@@ -2699,7 +2700,7 @@ dfs_offload:
+@@ -2762,7 +2763,7 @@ dfs_offload:
if (hostapd_drv_configure_edcca_threshold(hapd,
hapd->iconf->edcca_threshold) < 0)
goto fail;
@@ -110,10 +110,10 @@
if (hostapd_drv_three_wire_ctrl(hapd) < 0)
goto fail;
diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
-index dd1ca2164..99371bf73 100644
+index ee0c15eb3..34238f098 100644
--- a/src/common/mtk_vendor.h
+++ b/src/common/mtk_vendor.h
-@@ -199,6 +199,8 @@ enum mtk_vendor_attr_mu_ctrl {
+@@ -202,6 +202,8 @@ enum mtk_vendor_attr_mu_ctrl {
MTK_VENDOR_ATTR_MU_CTRL_ONOFF,
MTK_VENDOR_ATTR_MU_CTRL_DUMP,
@@ -122,7 +122,7 @@
/* keep last */
NUM_MTK_VENDOR_ATTRS_MU_CTRL,
-@@ -272,4 +274,9 @@ struct amnt_resp_data {
+@@ -275,4 +277,9 @@ struct amnt_resp_data {
struct amnt_data resp_data[0];
};
@@ -133,10 +133,10 @@
+};
#endif /* MTK_VENDOR_H */
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index dd9c33201..3be4562e7 100644
+index 4bc0bbeae..c8910739e 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5236,11 +5236,11 @@ struct wpa_driver_ops {
+@@ -5262,11 +5262,11 @@ struct wpa_driver_ops {
int (*get_edcca)(void *priv, const u8 mode, u8 *value);
/**
@@ -151,10 +151,10 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index a2a6807f4..035a477e2 100644
+index db8a6f8e4..da1e6a8ed 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -13982,13 +13982,13 @@ fail:
+@@ -14007,13 +14007,13 @@ fail:
#ifdef CONFIG_IEEE80211AX
@@ -170,7 +170,7 @@
if (!drv->mtk_mu_vendor_cmd_avail) {
wpa_printf(MSG_INFO,
-@@ -13999,17 +13999,38 @@ static int nl80211_mu_onoff(void *priv, u8 mu_onoff)
+@@ -14024,17 +14024,38 @@ static int nl80211_mu_onoff(void *priv, u8 mu_onoff)
if (!(msg = nl80211_drv_msg(drv, 0, NL80211_CMD_VENDOR)) ||
nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_MTK) ||
nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD, MTK_NL80211_VENDOR_SUBCMD_MU_CTRL) ||
@@ -214,7 +214,7 @@
}
-@@ -15178,7 +15199,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -15206,7 +15227,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.update_connect_params = nl80211_update_connection_params,
.send_external_auth_status = nl80211_send_external_auth_status,
.set_4addr_mode = nl80211_set_4addr_mode,
@@ -224,5 +224,5 @@
#ifdef CONFIG_DPP
.dpp_listen = nl80211_dpp_listen,
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0052-mtk-hostapd-add-connac3-PHY-MURU-manual-mode-config-.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0034-mtk-hostapd-add-connac3-PHY-MURU-manual-mode-config-.patch
similarity index 91%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0052-mtk-hostapd-add-connac3-PHY-MURU-manual-mode-config-.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0034-mtk-hostapd-add-connac3-PHY-MURU-manual-mode-config-.patch
index 757c28b..69615ec 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0052-mtk-hostapd-add-connac3-PHY-MURU-manual-mode-config-.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0034-mtk-hostapd-add-connac3-PHY-MURU-manual-mode-config-.patch
@@ -1,7 +1,7 @@
-From e64468ed944634f41f7f305e7460b6a696b00127 Mon Sep 17 00:00:00 2001
+From f7ffccc3487fbc51786d4063b03e0e4a090253b0 Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Sat, 3 Jun 2023 17:12:15 +0800
-Subject: [PATCH 052/104] mtk: hostapd: add connac3 PHY MURU manual mode config
+Subject: [PATCH 034/126] mtk: hostapd: add connac3 PHY MURU manual mode config
support
This commit supports read the following two formats to set MU/RU manual
@@ -35,22 +35,28 @@
2. hostapd_ctrl_iface_set_mu() shall be modified.
3. A new code level configuration shall be defined to differentiate the
code flow that different generations will go through.
+
+Add support new argument global_comm_band for muru manual config
+command. This argument can be used to specify the band to apply manual
+config.
+
+Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
---
- hostapd/ctrl_iface.c | 237 +++++++++++++++++++++++++++++++----
+ hostapd/ctrl_iface.c | 240 +++++++++++++++++++++++++++++++----
src/ap/ap_config.h | 1 +
src/ap/ap_drv_ops.c | 4 +-
src/ap/ap_drv_ops.h | 2 +-
src/ap/hostapd.c | 2 +-
src/common/mtk_vendor.h | 166 +++++++++++++++++++++++-
src/drivers/driver.h | 2 +-
- src/drivers/driver_nl80211.c | 21 ++--
- 8 files changed, 391 insertions(+), 44 deletions(-)
+ src/drivers/driver_nl80211.c | 21 ++-
+ 8 files changed, 394 insertions(+), 44 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 88475b321..ed383df7d 100644
+index b78ee24c0..68b83bf6e 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -3775,7 +3775,6 @@ hostapd_ctrl_iface_get_edcca(struct hostapd_data *hapd, char *cmd, char *buf,
+@@ -3905,7 +3905,6 @@ hostapd_ctrl_iface_get_edcca(struct hostapd_data *hapd, char *cmd, char *buf,
}
}
@@ -58,7 +64,7 @@
#ifdef CONFIG_NAN_USD
static int hostapd_ctrl_nan_publish(struct hostapd_data *hapd, char *cmd,
-@@ -4062,21 +4061,61 @@ fail:
+@@ -4192,21 +4191,61 @@ fail:
#endif /* CONFIG_NAN_USD */
@@ -127,7 +133,7 @@
value = pos;
if (os_strcmp(config, "onoff") == 0) {
-@@ -4086,24 +4125,167 @@ hostapd_ctrl_iface_set_mu(struct hostapd_data *hapd, char *cmd,
+@@ -4216,24 +4255,170 @@ hostapd_ctrl_iface_set_mu(struct hostapd_data *hapd, char *cmd,
return -1;
}
hapd->iconf->mu_onoff = (u8) mu;
@@ -292,6 +298,9 @@
+ dl->ru[i] = host_to_le16(val[i]);
+ os_free(val);
+ muru->cfg_dl |= host_to_le32(MURU_FIXED_DL_TONE_PLAN);
++ } else if (os_strcmp(config, "global_comm_band") == 0) {
++ comm->band = (u8)atoi(value);
++ muru->cfg_comm |= host_to_le32(MURU_COMM_BAND);
} else {
- return -1;
+ wpa_printf(MSG_ERROR,
@@ -309,7 +318,7 @@
}
-@@ -5148,8 +5330,7 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -5290,8 +5475,7 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
reply_len = hostapd_ctrl_iface_get_edcca(hapd, buf+10, reply,
reply_size);
} else if (os_strncmp(buf, "SET_MU ", 7) == 0) {
@@ -319,7 +328,7 @@
} else if (os_strncmp(buf, "GET_MU", 6) == 0) {
reply_len = hostapd_ctrl_iface_get_mu(hapd, reply, reply_size);
} else if (os_strncmp(buf, "GET_IBF", 7) == 0) {
-@@ -5175,6 +5356,14 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -5317,6 +5501,14 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
} else if (os_strncmp(buf, "DUMP_AMNT", 9) == 0) {
reply_len = hostapd_ctrl_iface_dump_amnt(hapd, buf+10,
reply, reply_size);
@@ -335,10 +344,10 @@
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index d995b8d9c..3827a8fc8 100644
+index f90f4d554..0c51d2ab9 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1291,6 +1291,7 @@ struct hostapd_config {
+@@ -1344,6 +1344,7 @@ struct hostapd_config {
u8 ibf_enable;
u8 dfs_detect_mode;
u8 amsdu;
@@ -347,10 +356,10 @@
enum three_wire_mode {
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 8878db380..116bc4ceb 100644
+index 496fd4263..ccd0cb939 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1270,11 +1270,11 @@ int hostapd_drv_get_edcca(struct hostapd_data *hapd, const u8 mode, u8 *value)
+@@ -1299,11 +1299,11 @@ int hostapd_drv_get_edcca(struct hostapd_data *hapd, const u8 mode, u8 *value)
return hapd->driver->get_edcca(hapd->drv_priv, mode, value);
}
@@ -365,10 +374,10 @@
int hostapd_drv_mu_dump(struct hostapd_data *hapd, u8 *mu_onoff)
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index f77d07da0..84b41881a 100644
+index a949e168d..659154f56 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -153,7 +153,7 @@ int hostapd_drv_configure_edcca_enable(struct hostapd_data *hapd);
+@@ -156,7 +156,7 @@ int hostapd_drv_configure_edcca_enable(struct hostapd_data *hapd);
int hostapd_drv_configure_edcca_threshold(struct hostapd_data *hapd,
const int *threshold);
int hostapd_drv_get_edcca(struct hostapd_data *hapd, const u8 mode, u8 *value);
@@ -378,10 +387,10 @@
int hostapd_drv_three_wire_ctrl(struct hostapd_data *hapd);
int hostapd_drv_ibf_ctrl(struct hostapd_data *hapd);
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index 5fd46d53d..d1ee0764b 100644
+index 9e1ba6a21..f06687064 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -2700,7 +2700,7 @@ dfs_offload:
+@@ -2763,7 +2763,7 @@ dfs_offload:
if (hostapd_drv_configure_edcca_threshold(hapd,
hapd->iconf->edcca_threshold) < 0)
goto fail;
@@ -391,10 +400,10 @@
if (hostapd_drv_three_wire_ctrl(hapd) < 0)
goto fail;
diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
-index 99371bf73..e140de60b 100644
+index 34238f098..f0abcb6b1 100644
--- a/src/common/mtk_vendor.h
+++ b/src/common/mtk_vendor.h
-@@ -199,8 +199,11 @@ enum mtk_vendor_attr_mu_ctrl {
+@@ -202,8 +202,11 @@ enum mtk_vendor_attr_mu_ctrl {
MTK_VENDOR_ATTR_MU_CTRL_ONOFF,
MTK_VENDOR_ATTR_MU_CTRL_DUMP,
@@ -408,7 +417,7 @@
/* keep last */
NUM_MTK_VENDOR_ATTRS_MU_CTRL,
-@@ -275,8 +278,163 @@ struct amnt_resp_data {
+@@ -278,8 +281,163 @@ struct amnt_resp_data {
};
enum {
@@ -575,10 +584,10 @@
+
#endif /* MTK_VENDOR_H */
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 3be4562e7..1c0c38e24 100644
+index c8910739e..6fc79f659 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5240,7 +5240,7 @@ struct wpa_driver_ops {
+@@ -5266,7 +5266,7 @@ struct wpa_driver_ops {
* @priv: Private driver interface data
*
*/
@@ -588,10 +597,10 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 035a477e2..aeb755b11 100644
+index da1e6a8ed..8a8f8abe8 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -13982,12 +13982,13 @@ fail:
+@@ -14007,12 +14007,13 @@ fail:
#ifdef CONFIG_IEEE80211AX
@@ -606,7 +615,7 @@
int ret = -ENOBUFS;
if (!drv->mtk_mu_vendor_cmd_avail) {
-@@ -14004,17 +14005,16 @@ static int nl80211_mu_ctrl(void *priv, u8 mode, u8 val)
+@@ -14029,17 +14030,16 @@ static int nl80211_mu_ctrl(void *priv, u8 mode, u8 val)
switch (mode) {
case MU_CTRL_ONOFF:
@@ -631,7 +640,7 @@
ret = -EINVAL;
goto fail;
}
-@@ -14022,9 +14022,8 @@ static int nl80211_mu_ctrl(void *priv, u8 mode, u8 val)
+@@ -14047,9 +14047,8 @@ static int nl80211_mu_ctrl(void *priv, u8 mode, u8 val)
nla_nest_end(msg, data);
ret = send_and_recv_cmd(drv, msg);
@@ -643,5 +652,5 @@
fail:
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0053-mtk-hostapd-Add-HE-capabilities-check.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0035-mtk-hostapd-Add-HE-capabilities-check.patch
similarity index 80%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0053-mtk-hostapd-Add-HE-capabilities-check.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0035-mtk-hostapd-Add-HE-capabilities-check.patch
index c9fc8b7..780cce4 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0053-mtk-hostapd-Add-HE-capabilities-check.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0035-mtk-hostapd-Add-HE-capabilities-check.patch
@@ -1,20 +1,17 @@
-From 2dd00ec0a8231bd8c6893f9517875ad94022f9b2 Mon Sep 17 00:00:00 2001
+From 4e8197027a7b86f6cf5f1d2d9095e30281693319 Mon Sep 17 00:00:00 2001
From: MeiChia Chiu <meichia.chiu@mediatek.com>
Date: Fri, 9 Jun 2023 09:03:05 +0800
-Subject: [PATCH 053/104] mtk: hostapd: Add HE capabilities check
+Subject: [PATCH 035/126] mtk: hostapd: Add HE capabilities check
-Add HE capabilities check.
-Since "HE capabilities" check has been removed by driver,
-add the support for "HE capabilities" check in hostapd.
---
src/ap/hw_features.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
-index 672e43a10..a35c5974a 100644
+index 400c50988..2a2832cd4 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
-@@ -709,6 +709,32 @@ static int ieee80211ac_supported_vht_capab(struct hostapd_iface *iface)
+@@ -722,6 +722,32 @@ static int ieee80211ac_supported_vht_capab(struct hostapd_iface *iface)
#ifdef CONFIG_IEEE80211AX
static int ieee80211ax_supported_he_capab(struct hostapd_iface *iface)
{
@@ -48,5 +45,5 @@
}
#endif /* CONFIG_IEEE80211AX */
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0054-mtk-hostapd-Fix-background-channel-overlapping-opera.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0036-mtk-hostapd-Fix-background-channel-overlapping-opera.patch
similarity index 80%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0054-mtk-hostapd-Fix-background-channel-overlapping-opera.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0036-mtk-hostapd-Fix-background-channel-overlapping-opera.patch
index e14b996..a25e243 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0054-mtk-hostapd-Fix-background-channel-overlapping-opera.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0036-mtk-hostapd-Fix-background-channel-overlapping-opera.patch
@@ -1,7 +1,7 @@
-From cc4db7ad22853f72f43128f96e5d4edcb7c245a1 Mon Sep 17 00:00:00 2001
+From ce1043355ec94008f97f8ee1401a9a7a2050fb88 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Wed, 5 Jul 2023 10:44:15 +0800
-Subject: [PATCH 054/104] mtk: hostapd: Fix background channel overlapping
+Subject: [PATCH 036/126] mtk: hostapd: Fix background channel overlapping
operating channel issue
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
@@ -10,10 +10,10 @@
1 file changed, 18 insertions(+)
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
-index f5794753e..8be953287 100644
+index 9677b26ea..754c471f5 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -814,6 +814,20 @@ static int dfs_are_channels_overlapped(struct hostapd_iface *iface, int freq,
+@@ -815,6 +815,20 @@ static int dfs_are_channels_overlapped(struct hostapd_iface *iface, int freq,
}
@@ -34,7 +34,7 @@
static unsigned int dfs_get_cac_time(struct hostapd_iface *iface,
int start_chan_idx, int n_chans)
{
-@@ -1141,6 +1155,8 @@ static void hostapd_dfs_update_background_chain(struct hostapd_iface *iface)
+@@ -1142,6 +1156,8 @@ static void hostapd_dfs_update_background_chain(struct hostapd_iface *iface)
&oper_centr_freq_seg1_idx,
&channel_type);
if (!channel ||
@@ -43,7 +43,7 @@
hostapd_start_dfs_cac(iface, iface->conf->hw_mode,
channel->freq, channel->chan,
iface->conf->ieee80211n,
-@@ -1375,6 +1391,7 @@ static int hostapd_dfs_start_channel_switch_cac(struct hostapd_iface *iface)
+@@ -1386,6 +1402,7 @@ static int hostapd_dfs_start_channel_switch_cac(struct hostapd_iface *iface)
hostapd_set_oper_centr_freq_seg1_idx(iface->conf,
oper_centr_freq_seg1_idx);
err = 0;
@@ -51,7 +51,7 @@
hostapd_setup_interface_complete(iface, err);
return err;
-@@ -1502,6 +1519,7 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
+@@ -1513,6 +1530,7 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
hostapd_set_oper_centr_freq_seg1_idx(
iface->conf, oper_centr_freq_seg1_idx);
@@ -60,5 +60,5 @@
hostapd_enable_iface(iface);
return 0;
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0055-mtk-hostapd-Fix-hostapd_dfs_start_cac-log.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0037-mtk-hostapd-Fix-hostapd_dfs_start_cac-log.patch
similarity index 80%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0055-mtk-hostapd-Fix-hostapd_dfs_start_cac-log.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0037-mtk-hostapd-Fix-hostapd_dfs_start_cac-log.patch
index 4f42bfa..050e465 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0055-mtk-hostapd-Fix-hostapd_dfs_start_cac-log.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0037-mtk-hostapd-Fix-hostapd_dfs_start_cac-log.patch
@@ -1,7 +1,7 @@
-From 0232fabaf99094f319d03ab818cb0c847b6727c2 Mon Sep 17 00:00:00 2001
+From 2059027bdf239e4e5ce3382f1f286c3830059341 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Wed, 5 Jul 2023 10:47:20 +0800
-Subject: [PATCH 055/104] mtk: hostapd: Fix hostapd_dfs_start_cac log
+Subject: [PATCH 037/126] mtk: hostapd: Fix hostapd_dfs_start_cac log
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
@@ -9,10 +9,10 @@
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
-index 8be953287..7adaf81ac 100644
+index 754c471f5..66ccb0057 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -1664,9 +1664,11 @@ int hostapd_dfs_start_cac(struct hostapd_iface *iface, int freq,
+@@ -1685,9 +1685,11 @@ int hostapd_dfs_start_cac(struct hostapd_iface *iface, int freq,
/* TODO: How to check CAC time for ETSI weather channels? */
iface->dfs_cac_ms = 60000;
wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_CAC_START
@@ -27,5 +27,5 @@
hostapd_dfs_is_background_event(iface, freq) ?
" (background)" : "");
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0056-mtk-hostapd-Check-the-bridge-after-ioctl-SIOCBRADDIF.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0038-mtk-hostapd-Check-the-bridge-after-ioctl-SIOCBRADDIF.patch
similarity index 93%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0056-mtk-hostapd-Check-the-bridge-after-ioctl-SIOCBRADDIF.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0038-mtk-hostapd-Check-the-bridge-after-ioctl-SIOCBRADDIF.patch
index 6943e83..af4f9ac 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0056-mtk-hostapd-Check-the-bridge-after-ioctl-SIOCBRADDIF.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0038-mtk-hostapd-Check-the-bridge-after-ioctl-SIOCBRADDIF.patch
@@ -1,7 +1,7 @@
-From 942808028d207776f1a4dbe678166282fb272b37 Mon Sep 17 00:00:00 2001
+From 2f22f947b2719f96d44f3aca158f19228c4a7dee Mon Sep 17 00:00:00 2001
From: Michael Lee <michael-cy.lee@mediatek.com>
Date: Thu, 13 Jul 2023 13:14:26 +0800
-Subject: [PATCH 056/104] mtk: hostapd: Check the bridge after ioctl
+Subject: [PATCH 038/126] mtk: hostapd: Check the bridge after ioctl
SIOCBRADDIF failed
If ioctl returns EBUSY on command SIOCBRADDIF, the interface might
@@ -58,5 +58,5 @@
return 0;
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0057-mtk-hostapd-Update-parameter_set_count-in-MU-EDCA-IE.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0039-mtk-hostapd-Update-parameter_set_count-in-MU-EDCA-IE.patch
similarity index 86%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0057-mtk-hostapd-Update-parameter_set_count-in-MU-EDCA-IE.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0039-mtk-hostapd-Update-parameter_set_count-in-MU-EDCA-IE.patch
index 9a8f33f..42c9a65 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0057-mtk-hostapd-Update-parameter_set_count-in-MU-EDCA-IE.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0039-mtk-hostapd-Update-parameter_set_count-in-MU-EDCA-IE.patch
@@ -1,11 +1,12 @@
-From cd4001cf3751979177cefa215f438888397f5bcb Mon Sep 17 00:00:00 2001
+From c8bd35df569715a82cddb0df4a5f894fe535be84 Mon Sep 17 00:00:00 2001
From: MeiChia Chiu <meichia.chiu@mediatek.com>
Date: Fri, 14 Jul 2023 17:19:13 +0800
-Subject: [PATCH 057/104] mtk: hostapd: Update parameter_set_count in MU EDCA
+Subject: [PATCH 039/126] mtk: hostapd: Update parameter_set_count in MU EDCA
IE
without this patch, MU EDCA Parameter update count not equal to
WMM Parameter set count.
+
---
src/ap/ieee802_11_he.c | 3 +++
1 file changed, 3 insertions(+)
@@ -25,5 +26,5 @@
pos, sizeof(*edca));
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0058-mtk-hostapd-add-extension-IE-list-for-non-inherit-IE.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0040-mtk-hostapd-add-extension-IE-list-for-non-inherit-IE.patch
similarity index 81%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0058-mtk-hostapd-add-extension-IE-list-for-non-inherit-IE.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0040-mtk-hostapd-add-extension-IE-list-for-non-inherit-IE.patch
index 07e0656..86c4b44 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0058-mtk-hostapd-add-extension-IE-list-for-non-inherit-IE.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0040-mtk-hostapd-add-extension-IE-list-for-non-inherit-IE.patch
@@ -1,7 +1,7 @@
-From 43840874fe5c56d76612c953d0e31b771818c0d3 Mon Sep 17 00:00:00 2001
+From 30e4604148273074fee5daeff21a6a7029c19832 Mon Sep 17 00:00:00 2001
From: mtk20656 <chank.chen@mediatek.com>
Date: Mon, 24 Jul 2023 11:30:27 +0800
-Subject: [PATCH 058/104] mtk: hostapd: add extension IE list for non-inherit
+Subject: [PATCH 040/126] mtk: hostapd: add extension IE list for non-inherit
IE in mbssid
Certain clients do not scan all non tx profiles due to absence of
@@ -19,10 +19,10 @@
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
old mode 100644
new mode 100755
-index d972a25f1..e42d4e1cc
+index 18d5b8f79..258ab7943
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
-@@ -7999,7 +7999,7 @@ static size_t hostapd_eid_mbssid_elem_len(struct hostapd_data *hapd,
+@@ -8078,7 +8078,7 @@ static size_t hostapd_eid_mbssid_elem_len(struct hostapd_data *hapd,
else if (hapd->conf->xrates_supported)
ie_count++;
if (ie_count)
@@ -32,5 +32,5 @@
if (len + nontx_profile_len > 255)
break;
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0059-mtk-hostapd-add-back-ht-vht-cap-missing-field-before.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0041-mtk-hostapd-add-back-ht-vht-cap-missing-field-before.patch
similarity index 86%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0059-mtk-hostapd-add-back-ht-vht-cap-missing-field-before.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0041-mtk-hostapd-add-back-ht-vht-cap-missing-field-before.patch
index 690dcc0..d3daf72 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0059-mtk-hostapd-add-back-ht-vht-cap-missing-field-before.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0041-mtk-hostapd-add-back-ht-vht-cap-missing-field-before.patch
@@ -1,7 +1,7 @@
-From ab91679c1eeee2c48b871335756601df995e1a19 Mon Sep 17 00:00:00 2001
+From f8f314f2ce3c4e8e82cc98bbd404c18424b13dd7 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Tue, 8 Aug 2023 19:21:41 +0800
-Subject: [PATCH 059/104] mtk: hostapd: add back ht vht cap missing field
+Subject: [PATCH 041/126] mtk: hostapd: add back ht vht cap missing field
before dfs channel fallback
hostapd_event_ch_switch would set / clear ht_capab and vht_capab, based
@@ -22,10 +22,10 @@
1 file changed, 7 insertions(+)
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index d1ee0764b..db451387b 100644
+index f06687064..4549aecb2 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -4569,6 +4569,13 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface,
+@@ -4658,6 +4658,13 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface,
break;
}
@@ -40,5 +40,5 @@
iface->conf->channel = freq_params->channel;
iface->conf->secondary_channel = freq_params->sec_channel_offset;
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0060-mtk-hostapd-Add-support-for-gtk-rekeying-in-hostapd-.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0042-mtk-hostapd-Add-support-for-gtk-rekeying-in-hostapd-.patch
similarity index 78%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0060-mtk-hostapd-Add-support-for-gtk-rekeying-in-hostapd-.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0042-mtk-hostapd-Add-support-for-gtk-rekeying-in-hostapd-.patch
index ccbe766..1a28908 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0060-mtk-hostapd-Add-support-for-gtk-rekeying-in-hostapd-.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0042-mtk-hostapd-Add-support-for-gtk-rekeying-in-hostapd-.patch
@@ -1,7 +1,7 @@
-From 00c2dff4bf8d15c1c84321cef1892009aa32e9ed Mon Sep 17 00:00:00 2001
+From d29370b7ec78ba410d0877441206849e197b1609 Mon Sep 17 00:00:00 2001
From: mtk23510 <rudra.shahi@mediatek.com>
Date: Fri, 26 May 2023 14:52:35 +0800
-Subject: [PATCH 060/104] mtk: hostapd: Add support for gtk rekeying in hostapd
+Subject: [PATCH 042/126] mtk: hostapd: Add support for gtk rekeying in hostapd
cli
Signed-off-by: mtk23510 <rudra.shahi@mediatek.com>
@@ -10,10 +10,10 @@
1 file changed, 13 insertions(+)
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index 12c580455..e0b175386 100644
+index dba805e8a..e43d515d5 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1291,6 +1291,15 @@ static int hostapd_cli_cmd_stop_ap(struct wpa_ctrl *ctrl, int argc,
+@@ -1309,6 +1309,15 @@ static int hostapd_cli_cmd_stop_ap(struct wpa_ctrl *ctrl, int argc,
}
@@ -29,7 +29,7 @@
static int hostapd_cli_cmd_vendor(struct wpa_ctrl *ctrl, int argc, char *argv[])
{
char cmd[256];
-@@ -1831,6 +1840,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1861,6 +1870,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
"= update Beacon frame contents\n"},
{ "stop_ap", hostapd_cli_cmd_stop_ap, NULL,
"= stop AP\n"},
@@ -41,5 +41,5 @@
"= drop all ERP keys"},
{ "log_level", hostapd_cli_cmd_log_level, NULL,
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0042-mtk-hostapd-Add-vendor-command-attribute-for-RTS-BW-.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0042-mtk-hostapd-Add-vendor-command-attribute-for-RTS-BW-.patch
deleted file mode 100644
index 8676424..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0042-mtk-hostapd-Add-vendor-command-attribute-for-RTS-BW-.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From d342772023b344ce09a22eaeff4307e5bfe52d7c Mon Sep 17 00:00:00 2001
-From: "himanshu.goyal" <himanshu.goyal@mediatek.com>
-Date: Tue, 24 Jan 2023 19:06:44 +0800
-Subject: [PATCH 042/104] mtk: hostapd: Add vendor command attribute for RTS BW
- signaling.
-
-Signed-off-by: himanshu.goyal <himanshu.goyal@mediatek.com>
----
- src/common/mtk_vendor.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
-index 7b4d7c11a..ace993bc8 100644
---- a/src/common/mtk_vendor.h
-+++ b/src/common/mtk_vendor.h
-@@ -172,6 +172,7 @@ enum mtk_vendor_attr_wireless_ctrl {
- MTK_VENDOR_ATTR_WIRELESS_CTRL_MIMO,
- MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU,
- MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT,
-+ MTK_VENDOR_ATTR_WIRELESS_CTRL_RTS_SIGTA,
-
- /* keep last */
- NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL,
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0061-mtk-hostapd-Set-WMM-and-TX-queue-parameters-for-wpa_.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0043-mtk-hostapd-Set-WMM-and-TX-queue-parameters-for-wpa_.patch
similarity index 88%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0061-mtk-hostapd-Set-WMM-and-TX-queue-parameters-for-wpa_.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0043-mtk-hostapd-Set-WMM-and-TX-queue-parameters-for-wpa_.patch
index 65ba1f0..2a3c271 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0061-mtk-hostapd-Set-WMM-and-TX-queue-parameters-for-wpa_.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0043-mtk-hostapd-Set-WMM-and-TX-queue-parameters-for-wpa_.patch
@@ -1,7 +1,7 @@
-From 2dc6e435eef405ae0cfb69a89c1c8ec7d2852635 Mon Sep 17 00:00:00 2001
+From 8d8843872efa3b2a694e85b3125435fc6a1abc09 Mon Sep 17 00:00:00 2001
From: Michael Lee <michael-cy.lee@mediatek.com>
Date: Tue, 11 Jul 2023 14:17:43 +0800
-Subject: [PATCH 061/104] mtk: hostapd: Set WMM and TX queue parameters for
+Subject: [PATCH 043/126] mtk: hostapd: Set WMM and TX queue parameters for
wpa_supplicant
Since most of the time, wpa_supplicant will be used to setup an STA
@@ -14,10 +14,10 @@
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
-index c3943355d..7bb57e2ab 100644
+index dc4b0636a..d2c05e352 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
-@@ -4720,19 +4720,19 @@ struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
+@@ -4722,19 +4722,19 @@ struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
const struct hostapd_wmm_ac_params ac_bk =
{ aCWmin, aCWmax, 7, 0, 0 }; /* background traffic */
const struct hostapd_wmm_ac_params ac_be =
@@ -44,5 +44,5 @@
#undef ecw2cw
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0062-mtk-hostapd-Set-STA-TX-queue-parameters-configuratio.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0044-mtk-hostapd-Set-STA-TX-queue-parameters-configuratio.patch
similarity index 89%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0062-mtk-hostapd-Set-STA-TX-queue-parameters-configuratio.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0044-mtk-hostapd-Set-STA-TX-queue-parameters-configuratio.patch
index 502da4c..4d071a4 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0062-mtk-hostapd-Set-STA-TX-queue-parameters-configuratio.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0044-mtk-hostapd-Set-STA-TX-queue-parameters-configuratio.patch
@@ -1,7 +1,7 @@
-From eaf45cd7a14dac2d5d601653792d2bc101118585 Mon Sep 17 00:00:00 2001
+From 9aa3ee6838af657f932ed1e7e70420ecfae8452e Mon Sep 17 00:00:00 2001
From: Michael Lee <michael-cy.lee@mediatek.com>
Date: Fri, 7 Jul 2023 17:16:11 +0800
-Subject: [PATCH 062/104] mtk: hostapd: Set STA TX queue parameters
+Subject: [PATCH 044/126] mtk: hostapd: Set STA TX queue parameters
configuration after association
This patch adds the way for wpa_supplicant to set driver's TX queue
@@ -40,10 +40,10 @@
const u8 *data, size_t data_len, int noack,
unsigned int freq, unsigned int wait)
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
-index 2a9342318..8fd2f2049 100644
+index 5c08d4a19..68f4d2dbe 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
-@@ -4070,6 +4070,20 @@ out:
+@@ -4187,6 +4187,20 @@ out:
return wpa_sm_set_mlo_params(wpa_s->wpa, &wpa_mlo);
}
@@ -64,7 +64,7 @@
static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
union wpa_event_data *data)
-@@ -4399,6 +4413,8 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
+@@ -4516,6 +4530,8 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
if (wpa_s->current_ssid && wpa_s->current_ssid->enable_4addr_mode)
wpa_supplicant_set_4addr_mode(wpa_s);
@@ -74,5 +74,5 @@
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0063-mtk-hostapd-avoid-color-switch-when-beacon-is-not-se.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0045-mtk-hostapd-avoid-color-switch-when-beacon-is-not-se.patch
similarity index 69%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0063-mtk-hostapd-avoid-color-switch-when-beacon-is-not-se.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0045-mtk-hostapd-avoid-color-switch-when-beacon-is-not-se.patch
index e1384d9..41a4af7 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0063-mtk-hostapd-avoid-color-switch-when-beacon-is-not-se.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0045-mtk-hostapd-avoid-color-switch-when-beacon-is-not-se.patch
@@ -1,7 +1,7 @@
-From 7449e88f54fb5e16296399c43c9f758535123cde Mon Sep 17 00:00:00 2001
+From 7d38f0de94d325b00fecb4cd2888d0a0695446c2 Mon Sep 17 00:00:00 2001
From: Michael-CY Lee <michael-cy.lee@mediatek.com>
Date: Fri, 1 Sep 2023 15:31:24 +0800
-Subject: [PATCH 063/104] mtk: hostapd: avoid color switch when beacon is not
+Subject: [PATCH 045/126] mtk: hostapd: avoid color switch when beacon is not
set
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
@@ -10,10 +10,10 @@
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index db451387b..0d4b79b48 100644
+index 4549aecb2..7da5c3afa 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -4707,7 +4707,7 @@ void hostapd_switch_color(struct hostapd_data *hapd, u64 bitmap)
+@@ -4815,7 +4815,7 @@ void hostapd_switch_color(struct hostapd_data *hapd, u64 bitmap)
{
struct os_reltime now;
@@ -23,5 +23,5 @@
if (os_get_reltime(&now))
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0064-mtk-hostapd-6g-bss-connect-do-not-consider-ht-operat.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0046-mtk-hostapd-6g-bss-connect-do-not-consider-ht-operat.patch
similarity index 75%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0064-mtk-hostapd-6g-bss-connect-do-not-consider-ht-operat.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0046-mtk-hostapd-6g-bss-connect-do-not-consider-ht-operat.patch
index 7d6be8a..c2a8853 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0064-mtk-hostapd-6g-bss-connect-do-not-consider-ht-operat.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0046-mtk-hostapd-6g-bss-connect-do-not-consider-ht-operat.patch
@@ -1,7 +1,7 @@
-From 8e01f276c2d7be41f3521026c92d8f1bd833865f Mon Sep 17 00:00:00 2001
+From 1d5789bf2fb508516d7a650bf282a12f39eccda3 Mon Sep 17 00:00:00 2001
From: mtk20656 <chank.chen@mediatek.com>
Date: Wed, 13 Sep 2023 19:29:51 +0800
-Subject: [PATCH 064/104] mtk: hostapd: 6g bss connect do not consider ht
+Subject: [PATCH 046/126] mtk: hostapd: 6g bss connect do not consider ht
operation
Signed-off-by: mtk20656 <chank.chen@mediatek.com>
@@ -13,10 +13,10 @@
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
old mode 100755
new mode 100644
-index e42d4e1cc..923cbebcc
+index 258ab7943..ee698fa4a
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
-@@ -5591,7 +5591,7 @@ static void handle_assoc(struct hostapd_data *hapd,
+@@ -5667,7 +5667,7 @@ static void handle_assoc(struct hostapd_data *hapd,
set_beacon = true;
}
@@ -26,5 +26,5 @@
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0065-mtk-hostapd-Add-ACS-chanlist-info-in-get_config.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0047-mtk-hostapd-Add-ACS-chanlist-info-in-get_config.patch
similarity index 88%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0065-mtk-hostapd-Add-ACS-chanlist-info-in-get_config.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0047-mtk-hostapd-Add-ACS-chanlist-info-in-get_config.patch
index d87fef0..510b699 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0065-mtk-hostapd-Add-ACS-chanlist-info-in-get_config.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0047-mtk-hostapd-Add-ACS-chanlist-info-in-get_config.patch
@@ -1,7 +1,7 @@
-From 9639b495a347cdd2aadbe2bc2d336b4398518d29 Mon Sep 17 00:00:00 2001
+From df41420a192985b4a8c535968dbbf0ee07cc8c73 Mon Sep 17 00:00:00 2001
From: "fancy.liu" <fancy.liu@mediatek.com>
Date: Sun, 8 Oct 2023 11:50:06 +0800
-Subject: [PATCH 065/104] mtk: hostapd: Add ACS chanlist info in get_config
+Subject: [PATCH 047/126] mtk: hostapd: Add ACS chanlist info in get_config
This patch is used to add ACS chanlist info displaying
for upper layer application obtaining.
@@ -15,10 +15,10 @@
1 file changed, 59 insertions(+)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index ed383df7d..581acc260 100644
+index 68b83bf6e..53924b265 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -1058,6 +1058,7 @@ static int hostapd_ctrl_iface_get_config(struct hostapd_data *hapd,
+@@ -1059,6 +1059,7 @@ static int hostapd_ctrl_iface_get_config(struct hostapd_data *hapd,
{
int ret;
char *pos, *end;
@@ -26,7 +26,7 @@
pos = buf;
end = buf + buflen;
-@@ -1237,6 +1238,64 @@ static int hostapd_ctrl_iface_get_config(struct hostapd_data *hapd,
+@@ -1238,6 +1239,64 @@ static int hostapd_ctrl_iface_get_config(struct hostapd_data *hapd,
pos += ret;
}
@@ -92,5 +92,5 @@
}
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0066-mtk-hostapd-Fix-RSNXE-Interop-issue-with-STA.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0048-mtk-hostapd-Fix-RSNXE-Interop-issue-with-STA.patch
similarity index 80%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0066-mtk-hostapd-Fix-RSNXE-Interop-issue-with-STA.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0048-mtk-hostapd-Fix-RSNXE-Interop-issue-with-STA.patch
index 3f59e13..b7753e8 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0066-mtk-hostapd-Fix-RSNXE-Interop-issue-with-STA.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0048-mtk-hostapd-Fix-RSNXE-Interop-issue-with-STA.patch
@@ -1,17 +1,17 @@
-From b463e82d0eec8674e430a7e837c569be4c9fe2c2 Mon Sep 17 00:00:00 2001
+From 1d4221d2dd26e3324617c390ccb117f59b894dde Mon Sep 17 00:00:00 2001
From: mtk25255 <rohit.kamat@mediatek.com>
Date: Thu, 12 Oct 2023 14:29:23 +0800
-Subject: [PATCH 066/104] mtk: hostapd: Fix RSNXE Interop issue with STA
+Subject: [PATCH 048/126] mtk: hostapd: Fix RSNXE Interop issue with STA
---
src/ap/ieee802_11.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index 923cbebcc..ce3874901 100644
+index ee698fa4a..4581ae1d4 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
-@@ -5294,6 +5294,7 @@ static void handle_assoc(struct hostapd_data *hapd,
+@@ -5370,6 +5370,7 @@ static void handle_assoc(struct hostapd_data *hapd,
int omit_rsnxe = 0;
bool set_beacon = false;
bool mld_addrs_not_translated = false;
@@ -19,7 +19,7 @@
if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) :
sizeof(mgmt->u.assoc_req))) {
-@@ -5539,7 +5540,17 @@ static void handle_assoc(struct hostapd_data *hapd,
+@@ -5615,7 +5616,17 @@ static void handle_assoc(struct hostapd_data *hapd,
if (resp != WLAN_STATUS_SUCCESS)
goto fail;
omit_rsnxe = !get_ie(pos, left, WLAN_EID_RSNX);
@@ -39,5 +39,5 @@
hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_INFO, "No room for more AIDs");
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0067-mtk-hostapd-update-eht-operation-element.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0049-mtk-hostapd-update-eht-operation-element.patch
similarity index 82%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0067-mtk-hostapd-update-eht-operation-element.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0049-mtk-hostapd-update-eht-operation-element.patch
index 8764aa7..d99e601 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0067-mtk-hostapd-update-eht-operation-element.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0049-mtk-hostapd-update-eht-operation-element.patch
@@ -1,14 +1,14 @@
-From a6db9becf71712107500adf239b89f4f8523d3f3 Mon Sep 17 00:00:00 2001
+From 97f988afe8673579444a9ae90c2db48a6d7527e7 Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Wed, 10 May 2023 13:11:34 +0800
-Subject: [PATCH 067/104] mtk: hostapd: update eht operation element
+Subject: [PATCH 049/126] mtk: hostapd: update eht operation element
---
src/ap/ieee802_11_eht.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
-index 353a4116e..e13662a59 100644
+index b935ee889..a04eb23e0 100644
--- a/src/ap/ieee802_11_eht.c
+++ b/src/ap/ieee802_11_eht.c
@@ -237,9 +237,9 @@ u8 * hostapd_eid_eht_operation(struct hostapd_data *hapd, u8 *eid)
@@ -25,5 +25,5 @@
if (!eht_oper_info_present)
return pos + elen;
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0068-mtk-hostapd-ucode-add-support-for-ucode-to-parse-BW3.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0050-mtk-hostapd-add-support-for-ucode-to-parse-BW320MHz-.patch
similarity index 76%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0068-mtk-hostapd-ucode-add-support-for-ucode-to-parse-BW3.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0050-mtk-hostapd-add-support-for-ucode-to-parse-BW320MHz-.patch
index f383d62..89795f5 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0068-mtk-hostapd-ucode-add-support-for-ucode-to-parse-BW3.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0050-mtk-hostapd-add-support-for-ucode-to-parse-BW320MHz-.patch
@@ -1,8 +1,8 @@
-From f5256a36cd00b54955decd53961ece85dd5f11f9 Mon Sep 17 00:00:00 2001
+From 4ee7e5918d767afcef2797f4bffe000c5c811229 Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Wed, 30 Aug 2023 04:23:37 +0800
-Subject: [PATCH 068/104] mtk: hostapd: ucode: add support for ucode to parse
- BW320MHz info
+Subject: [PATCH 050/126] mtk: hostapd: add support for ucode to parse BW320MHz
+ info
---
src/utils/ucode.c | 4 ++++
@@ -24,5 +24,5 @@
return NULL;
}
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0069-mtk-hostapd-synchronize-bandwidth-in-AP-STA-support.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0051-mtk-hostapd-synchronize-bandwidth-in-AP-STA-support.patch
similarity index 93%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0069-mtk-hostapd-synchronize-bandwidth-in-AP-STA-support.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0051-mtk-hostapd-synchronize-bandwidth-in-AP-STA-support.patch
index 4ca6761..09e28f0 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0069-mtk-hostapd-synchronize-bandwidth-in-AP-STA-support.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0051-mtk-hostapd-synchronize-bandwidth-in-AP-STA-support.patch
@@ -1,7 +1,7 @@
-From d7a803942f27759fe0e27c4550d70e44fb83c897 Mon Sep 17 00:00:00 2001
+From 5070c33b7eb059d1c78ff0c02bb56b16e01431f8 Mon Sep 17 00:00:00 2001
From: Michael-CY Lee <michael-cy.lee@mediatek.com>
Date: Mon, 11 Sep 2023 10:16:35 +0800
-Subject: [PATCH 069/104] mtk: hostapd: synchronize bandwidth in AP/STA support
+Subject: [PATCH 051/126] mtk: hostapd: synchronize bandwidth in AP/STA support
Signed-off-by: Michael Lee <michael-cy.lee@mediatek.com>
---
@@ -11,10 +11,10 @@
3 files changed, 117 insertions(+), 18 deletions(-)
diff --git a/src/ap/ucode.c b/src/ap/ucode.c
-index 16d1b5153..98b2a3bf2 100644
+index 3468615fd..8c3212f6f 100644
--- a/src/ap/ucode.c
+++ b/src/ap/ucode.c
-@@ -489,6 +489,9 @@ uc_hostapd_iface_stop(uc_vm_t *vm, size_t nargs)
+@@ -493,6 +493,9 @@ uc_hostapd_iface_stop(uc_vm_t *vm, size_t nargs)
struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface");
int i;
@@ -24,7 +24,7 @@
if (!iface)
return NULL;
-@@ -515,6 +518,9 @@ uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs)
+@@ -519,6 +522,9 @@ uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs)
uint64_t intval;
int i;
@@ -34,7 +34,7 @@
if (!iface)
return NULL;
-@@ -537,7 +543,13 @@ uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs)
+@@ -541,7 +547,13 @@ uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs)
UPDATE_VAL(op_class, "op_class");
UPDATE_VAL(hw_mode, "hw_mode");
UPDATE_VAL(channel, "channel");
@@ -49,7 +49,7 @@
if (!changed &&
(iface->bss[0]->beacon_set_done ||
iface->state == HAPD_IFACE_DFS))
-@@ -583,6 +595,18 @@ out:
+@@ -587,6 +599,18 @@ out:
return ucv_boolean_new(true);
}
@@ -68,7 +68,7 @@
for (i = 0; i < iface->num_bss; i++) {
struct hostapd_data *hapd = iface->bss[i];
int ret;
-@@ -617,6 +641,7 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
+@@ -621,6 +645,7 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
uint64_t intval;
int i, ret = 0;
@@ -76,7 +76,7 @@
if (!iface || ucv_type(info) != UC_OBJECT)
return NULL;
-@@ -636,7 +661,8 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
+@@ -640,7 +665,8 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
if (errno)
intval = hostapd_get_oper_chwidth(conf);
if (intval)
@@ -86,7 +86,7 @@
else
csa.freq_params.bandwidth = csa.freq_params.sec_channel_offset ? 40 : 20;
-@@ -647,6 +673,17 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
+@@ -651,6 +677,17 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
if ((intval = ucv_int64_get(ucv_object_get(info, "center_freq2", NULL))) && !errno)
csa.freq_params.center_freq2 = intval;
@@ -275,5 +275,5 @@
#ifdef CONFIG_MESH
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0070-mtk-hostapd-Add-support-for-updating-background-chan.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0052-mtk-hostapd-Add-support-for-updating-background-chan.patch
similarity index 87%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0070-mtk-hostapd-Add-support-for-updating-background-chan.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0052-mtk-hostapd-Add-support-for-updating-background-chan.patch
index d1800fe..84d8057 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0070-mtk-hostapd-Add-support-for-updating-background-chan.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0052-mtk-hostapd-Add-support-for-updating-background-chan.patch
@@ -1,25 +1,25 @@
-From 0455150c89b046a3ebd81134527ff4cae5025f3d Mon Sep 17 00:00:00 2001
+From 4bce62337a31d599b1102e782de689552af5549c Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Wed, 5 Jul 2023 10:25:01 +0800
-Subject: [PATCH 070/104] mtk: hostapd: Add support for updating background
+Subject: [PATCH 052/126] mtk: hostapd: Add support for updating background
channel by driver
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
src/ap/dfs.c | 107 ++++++++++++++++++++++++++++-
src/ap/dfs.h | 3 +
- src/ap/drv_callbacks.c | 22 ++++++
+ src/ap/drv_callbacks.c | 24 +++++++
src/ap/hostapd.h | 5 ++
src/drivers/driver.h | 12 ++++
src/drivers/driver_nl80211_event.c | 6 ++
src/drivers/nl80211_copy.h | 6 ++
- 7 files changed, 160 insertions(+), 1 deletion(-)
+ 7 files changed, 162 insertions(+), 1 deletion(-)
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
-index 7adaf81ac..e39f3c180 100644
+index 66ccb0057..72bb469a6 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -816,11 +816,14 @@ static int dfs_are_channels_overlapped(struct hostapd_iface *iface, int freq,
+@@ -817,11 +817,14 @@ static int dfs_are_channels_overlapped(struct hostapd_iface *iface, int freq,
static void dfs_check_background_overlapped(struct hostapd_iface *iface)
{
@@ -35,7 +35,7 @@
if (dfs_are_channels_overlapped(iface, iface->radar_background.freq,
width, iface->radar_background.centr_freq_seg0_idx,
iface->radar_background.centr_freq_seg1_idx))
-@@ -985,6 +988,15 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
+@@ -986,6 +989,15 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
iface->radar_background.temp_ch = 1;
return 1;
} else if (dfs_use_radar_background(iface)) {
@@ -51,7 +51,7 @@
if (iface->dfs_domain == HOSTAPD_DFS_REGION_ETSI)
channel_type = DFS_ANY_CHANNEL;
-@@ -1125,6 +1137,8 @@ static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface,
+@@ -1126,6 +1138,8 @@ static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface,
* ch_switch_notify event is received */
wpa_printf(MSG_DEBUG, "DFS waiting channel switch event");
@@ -60,7 +60,7 @@
return 0;
}
-@@ -1176,6 +1190,9 @@ static void hostapd_dfs_update_background_chain(struct hostapd_iface *iface)
+@@ -1177,6 +1191,9 @@ static void hostapd_dfs_update_background_chain(struct hostapd_iface *iface)
iface->radar_background.secondary_channel = sec;
iface->radar_background.centr_freq_seg0_idx = oper_centr_freq_seg0_idx;
iface->radar_background.centr_freq_seg1_idx = oper_centr_freq_seg1_idx;
@@ -70,7 +70,7 @@
wpa_printf(MSG_DEBUG,
"%s: setting background chain to chan %d (%d MHz)",
-@@ -1198,6 +1215,10 @@ hostapd_dfs_start_channel_switch_background(struct hostapd_iface *iface)
+@@ -1199,6 +1216,10 @@ hostapd_dfs_start_channel_switch_background(struct hostapd_iface *iface)
u8 current_vht_oper_chwidth = hostapd_get_oper_chwidth(iface->conf);
int ret;
@@ -81,7 +81,7 @@
ret = hostapd_dfs_request_channel_switch(iface, iface->radar_background.channel,
iface->radar_background.freq,
iface->radar_background.secondary_channel,
-@@ -1220,6 +1241,52 @@ hostapd_dfs_start_channel_switch_background(struct hostapd_iface *iface)
+@@ -1221,6 +1242,52 @@ hostapd_dfs_start_channel_switch_background(struct hostapd_iface *iface)
}
@@ -134,7 +134,7 @@
int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
int ht_enabled, int chan_offset, int chan_width,
int cf1, int cf2)
-@@ -1253,6 +1320,10 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
+@@ -1263,6 +1330,10 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
return 0;
iface->radar_background.temp_ch = 0;
@@ -145,7 +145,7 @@
return hostapd_dfs_start_channel_switch_background(iface);
}
-@@ -1283,6 +1354,8 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
+@@ -1293,6 +1364,8 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
}
} else if (hostapd_dfs_is_background_event(iface, freq)) {
iface->radar_background.cac_started = 0;
@@ -154,7 +154,7 @@
hostapd_dfs_update_background_chain(iface);
}
-@@ -1415,6 +1488,9 @@ hostapd_dfs_background_start_channel_switch(struct hostapd_iface *iface,
+@@ -1426,6 +1499,9 @@ hostapd_dfs_background_start_channel_switch(struct hostapd_iface *iface,
iface->conf->dfs_detect_mode == DFS_DETECT_MODE_ALL_ENABLE)
return 0;
@@ -164,7 +164,7 @@
/* Check if CSA in progress */
if (hostapd_csa_in_progress(iface))
return 0;
-@@ -1649,6 +1725,35 @@ int hostapd_is_dfs_required(struct hostapd_iface *iface)
+@@ -1662,6 +1738,35 @@ int hostapd_is_dfs_required(struct hostapd_iface *iface)
}
@@ -215,10 +215,10 @@
int ht_enabled, int chan_offset, int chan_width,
int cf1, int cf2, u32 state);
diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
-index caa171474..2d946afd6 100644
+index 1d40943d6..1fa27bf80 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
-@@ -2226,6 +2226,18 @@ static void hostapd_event_dfs_cac_started(struct hostapd_data *hapd,
+@@ -2270,6 +2270,18 @@ static void hostapd_event_dfs_cac_started(struct hostapd_data *hapd,
radar->cf1, radar->cf2);
}
@@ -237,28 +237,30 @@
static void hostapd_event_dfs_sta_cac_skipped(struct hostapd_data *hapd,
struct dfs_event *radar)
{
-@@ -2610,6 +2622,16 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
+@@ -2705,6 +2717,18 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
hapd = switch_link_hapd(hapd, data->dfs_event.link_id);
hostapd_event_dfs_nop_finished(hapd, &data->dfs_event);
break;
+ case EVENT_DFS_BACKGROUND_CHAN_UPDATE:
+ if (!data)
+ break;
++ hapd = switch_link_hapd(hapd, data->dfs_event.link_id);
+ hostapd_event_dfs_background_chan_update(hapd, &data->dfs_event, false);
+ break;
+ case EVENT_DFS_BACKGROUND_CHAN_EXPAND:
+ if (!data)
+ break;
++ hapd = switch_link_hapd(hapd, data->dfs_event.link_id);
+ hostapd_event_dfs_background_chan_update(hapd, &data->dfs_event, true);
+ break;
case EVENT_DFS_STA_CAC_SKIPPED:
if (!data)
break;
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
-index 1e4113459..5b37be87b 100644
+index 994e4681e..574a5ba1d 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
-@@ -640,6 +640,11 @@ struct hostapd_iface {
+@@ -654,6 +654,11 @@ struct hostapd_iface {
unsigned int temp_ch:1;
/* CAC started on radar offchain */
unsigned int cac_started:1;
@@ -271,10 +273,10 @@
u16 hw_flags;
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 1c0c38e24..4e3dc9bdb 100644
+index 6fc79f659..8457f4703 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5960,6 +5960,18 @@ enum wpa_event_type {
+@@ -5987,6 +5987,18 @@ enum wpa_event_type {
* The channel in the notification is now marked as usable.
*/
EVENT_DFS_STA_CAC_EXPIRED,
@@ -294,10 +296,10 @@
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
-index 7889930a0..6631285bf 100644
+index 8ba479861..35ee939b7 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
-@@ -2529,6 +2529,12 @@ static void nl80211_radar_event(struct wpa_driver_nl80211_data *drv,
+@@ -2539,6 +2539,12 @@ static void nl80211_radar_event(struct wpa_driver_nl80211_data *drv,
case NL80211_RADAR_CAC_STARTED:
wpa_supplicant_event(drv->ctx, EVENT_DFS_CAC_STARTED, &data);
break;
@@ -311,10 +313,10 @@
wpa_supplicant_event(drv->ctx, EVENT_DFS_STA_CAC_SKIPPED, &data);
break;
diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h
-index 8917d565b..c56954306 100644
+index 622fa71fd..d425c797c 100644
--- a/src/drivers/nl80211_copy.h
+++ b/src/drivers/nl80211_copy.h
-@@ -6699,6 +6699,10 @@ enum nl80211_smps_mode {
+@@ -6843,6 +6843,10 @@ enum nl80211_smps_mode {
* applicable for ETSI dfs domain where pre-CAC is valid for ever.
* @NL80211_RADAR_CAC_STARTED: Channel Availability Check has been started,
* should be generated by HW if NL80211_EXT_FEATURE_DFS_OFFLOAD is enabled.
@@ -325,7 +327,7 @@
* @NL80211_RADAR_STA_CAC_SKIPPED: STA set the DFS state to available
* when receiving CSA/assoc resp
* @NL80211_RADAR_STA_CAC_EXPIRED: STA set the DFS state to usable
-@@ -6711,6 +6715,8 @@ enum nl80211_radar_event {
+@@ -6855,6 +6859,8 @@ enum nl80211_radar_event {
NL80211_RADAR_NOP_FINISHED,
NL80211_RADAR_PRE_CAC_EXPIRED,
NL80211_RADAR_CAC_STARTED,
@@ -335,5 +337,5 @@
NL80211_RADAR_STA_CAC_EXPIRED,
};
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0071-mtk-hostapd-add-zwdfs-mode-ctrl-for-eagle-efem-hwits.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0053-mtk-hostapd-add-zwdfs-mode-ctrl-for-eagle-efem.patch
similarity index 87%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0071-mtk-hostapd-add-zwdfs-mode-ctrl-for-eagle-efem-hwits.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0053-mtk-hostapd-add-zwdfs-mode-ctrl-for-eagle-efem.patch
index c2760d9..5c5547a 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0071-mtk-hostapd-add-zwdfs-mode-ctrl-for-eagle-efem-hwits.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0053-mtk-hostapd-add-zwdfs-mode-ctrl-for-eagle-efem.patch
@@ -1,8 +1,7 @@
-From 5b2e33617bfafa8c6776e80b13c8747f0021a804 Mon Sep 17 00:00:00 2001
+From fe8560c4ccea682bb471816a1e5200ef7f3cde60 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Wed, 2 Aug 2023 19:00:34 +0800
-Subject: [PATCH 071/104] mtk: hostapd: add zwdfs mode ctrl for eagle efem
- hwits
+Subject: [PATCH 053/126] mtk: hostapd: add zwdfs mode ctrl for eagle efem
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
@@ -20,10 +19,10 @@
11 files changed, 116 insertions(+)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index dadc8f108..9467a1128 100644
+index dc05738db..b941ec5fa 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -3576,6 +3576,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -3662,6 +3662,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
conf->acs_exclude_6ghz_non_psc = atoi(pos);
} else if (os_strcmp(buf, "enable_background_radar") == 0) {
conf->enable_background_radar = atoi(pos);
@@ -33,10 +32,10 @@
int val = atoi(pos);
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 581acc260..9b072d1b2 100644
+index 53924b265..61d69902d 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -4782,6 +4782,33 @@ hostapd_ctrl_iface_dump_amnt(struct hostapd_data *hapd, char *cmd,
+@@ -4919,6 +4919,33 @@ hostapd_ctrl_iface_dump_amnt(struct hostapd_data *hapd, char *cmd,
return pos - buf;
}
@@ -70,7 +69,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
int reply_size,
-@@ -5423,6 +5450,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -5568,6 +5595,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
if (pos)
*pos = ' ';
reply_len = hostapd_ctrl_iface_set_mu(hapd, buf + 23, reply, reply_size);
@@ -81,10 +80,10 @@
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 3827a8fc8..0b07be516 100644
+index 0c51d2ab9..cffde344f 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1051,6 +1051,7 @@ struct hostapd_config {
+@@ -1101,6 +1101,7 @@ struct hostapd_config {
bool hw_mode_set;
int acs_exclude_6ghz_non_psc;
int enable_background_radar;
@@ -92,7 +91,7 @@
enum {
LONG_PREAMBLE = 0,
SHORT_PREAMBLE = 1
-@@ -1306,6 +1307,11 @@ enum three_wire_mode {
+@@ -1359,6 +1360,11 @@ enum three_wire_mode {
NUM_THREE_WIRE_MODE - 1
};
@@ -105,10 +104,10 @@
DFS_DETECT_MODE_DISABLE,
DFS_DETECT_MODE_AP_ENABLE,
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 116bc4ceb..2028e70fb 100644
+index ccd0cb939..6f8f329b0 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1365,3 +1365,17 @@ int hostapd_drv_amnt_dump(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_dump_
+@@ -1401,3 +1401,17 @@ int hostapd_drv_amnt_dump(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_dump_
return 0;
return hapd->driver->amnt_dump(hapd->drv_priv, amnt_idx, amnt_dump_buf);
}
@@ -127,10 +126,10 @@
+ hapd->iconf->background_radar_mode);
+}
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index 84b41881a..f0e618bcc 100644
+index 659154f56..53075ea94 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -168,6 +168,7 @@ int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type);
+@@ -171,6 +171,7 @@ int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type);
int hostapd_drv_amnt_set(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_sta_mac);
int hostapd_drv_amnt_dump(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_dump_buf);
@@ -139,10 +138,10 @@
#include "drivers/driver.h"
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
-index e39f3c180..b12290556 100644
+index 72bb469a6..db26f6536 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -985,6 +985,9 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
+@@ -986,6 +986,9 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
if (res < 0)
return res;
@@ -152,7 +151,7 @@
iface->radar_background.temp_ch = 1;
return 1;
} else if (dfs_use_radar_background(iface)) {
-@@ -1025,6 +1028,9 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
+@@ -1026,6 +1029,9 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
iface->radar_background.secondary_channel = sec;
iface->radar_background.centr_freq_seg0_idx = cf1;
iface->radar_background.centr_freq_seg1_idx = cf2;
@@ -163,7 +162,7 @@
return 0;
diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
-index e140de60b..5bc1e0444 100644
+index f0abcb6b1..3fb4c38f3 100644
--- a/src/common/mtk_vendor.h
+++ b/src/common/mtk_vendor.h
@@ -16,6 +16,7 @@ enum mtk_nl80211_vendor_subcmds {
@@ -174,7 +173,7 @@
};
enum mtk_vendor_attr_edcca_ctrl {
-@@ -244,6 +245,17 @@ enum mtk_vendor_attr_bss_color_ctrl {
+@@ -247,6 +248,17 @@ enum mtk_vendor_attr_bss_color_ctrl {
NUM_MTK_VENDOR_ATTRS_BSS_COLOR_CTRL - 1
};
@@ -193,10 +192,10 @@
#define ETH_ALEN 6
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 4e3dc9bdb..863748d4f 100644
+index 8457f4703..35c02937d 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5319,6 +5319,13 @@ struct wpa_driver_ops {
+@@ -5346,6 +5346,13 @@ struct wpa_driver_ops {
* @amnt_dump_buf: Buffer to print
*/
int (*amnt_dump)(void *priv, u8 amnt_idx, u8 *amnt_dump_buf);
@@ -211,10 +210,10 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index aeb755b11..e3f00b6d6 100644
+index 8a8f8abe8..2d2b47456 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -15052,6 +15052,39 @@ fail:
+@@ -15080,6 +15080,39 @@ fail:
return -ENOBUFS;
}
@@ -254,7 +253,7 @@
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211",
.desc = "Linux nl80211/cfg80211",
-@@ -15229,4 +15262,5 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -15257,4 +15290,5 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.ap_trigtype = nl80211_ap_trigtype,
.amnt_set = nl80211_amnt_set,
.amnt_dump = nl80211_amnt_dump,
@@ -273,7 +272,7 @@
u32 ignore_next_local_disconnect;
u32 ignore_next_local_deauth;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index 38e83e42b..9bc98aae7 100644
+index 4a6ff0f28..fd8c7b0ad 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1164,6 +1164,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
@@ -287,5 +286,5 @@
}
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0072-mtk-hostapd-add-support-enable-disable-preamble-punc.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0054-mtk-hostapd-add-support-enable-disable-preamble-punc.patch
similarity index 87%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0072-mtk-hostapd-add-support-enable-disable-preamble-punc.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0054-mtk-hostapd-add-support-enable-disable-preamble-punc.patch
index 4959fb4..a26dcf8 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0072-mtk-hostapd-add-support-enable-disable-preamble-punc.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0054-mtk-hostapd-add-support-enable-disable-preamble-punc.patch
@@ -1,13 +1,13 @@
-From 51377e7c81b4164be42de4a5c4c48ba53a638afe Mon Sep 17 00:00:00 2001
+From d57c8c29e6c88c609ff3c3770f5d6f0eed151761 Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Thu, 21 Sep 2023 10:29:46 +0800
-Subject: [PATCH 072/104] mtk: hostapd: add support enable/disable preamble
+Subject: [PATCH 054/126] mtk: hostapd: add support enable/disable preamble
puncture from mtk vendor command
This commit supports two ways to enable/disable preamble puncture
feature.
-1. Add new hostapd configuration "pp_mode". The possible value could be
+1. Add new hostapd configuration pp_mode. The possible value could be
1 to 3. When the value is 0, it means that the firmware will turn off
the pp algorithm. When the value is 1, it means that the firmware will
enable the pp algorithm, allowing the algorithm to determine whether pp
@@ -16,7 +16,7 @@
current implementation, the default configuration is 0.
2. $ hostapd_cli -i <intf_name> raw set_pp mode val
-The argument "val" could be 0 for PP feature disabled or 1 to configure
+The argument val could be 0 for PP feature disabled or 1 to configure
PP feature as auto mode.
This commit also let user check whether pp feature is enabled by
@@ -40,10 +40,10 @@
12 files changed, 162 insertions(+)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index 9467a1128..050ef290e 100644
+index b941ec5fa..fe92540c4 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -5333,6 +5333,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -5446,6 +5446,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
} else if (os_strcmp(buf, "punct_bitmap") == 0) {
if (get_u16(pos, line, &conf->punct_bitmap))
return 1;
@@ -52,7 +52,7 @@
} else if (os_strcmp(buf, "punct_acs_threshold") == 0) {
int val = atoi(pos);
-@@ -5415,6 +5417,16 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -5537,6 +5539,16 @@ static int hostapd_config_fill(struct hostapd_config *conf,
return 1;
}
conf->amsdu = val;
@@ -70,10 +70,10 @@
wpa_printf(MSG_ERROR,
"Line %d: unknown configuration item '%s'",
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 9b072d1b2..c9b53c64e 100644
+index 61d69902d..be47bd492 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -4809,6 +4809,59 @@ hostapd_ctrl_iface_set_background_radar_mode(struct hostapd_data *hapd, char *cm
+@@ -4946,6 +4946,59 @@ hostapd_ctrl_iface_set_background_radar_mode(struct hostapd_data *hapd, char *cm
return os_snprintf(buf, buflen, "OK\n");
}
@@ -133,7 +133,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
int reply_size,
-@@ -5442,6 +5495,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -5587,6 +5640,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
} else if (os_strncmp(buf, "DUMP_AMNT", 9) == 0) {
reply_len = hostapd_ctrl_iface_dump_amnt(hapd, buf+10,
reply, reply_size);
@@ -147,10 +147,10 @@
// Replace first ':' with a single space ' '
char *pos = buf + 23;
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
-index ba1b2a7a3..056c38f73 100644
+index 3a12de3cd..8b98d6170 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
-@@ -310,6 +310,7 @@ struct hostapd_config * hostapd_config_defaults(void)
+@@ -312,6 +312,7 @@ struct hostapd_config * hostapd_config_defaults(void)
conf->three_wire_enable = THREE_WIRE_MODE_DISABLE;
conf->ibf_enable = IBF_DEFAULT_ENABLE;
conf->amsdu = 1;
@@ -159,10 +159,10 @@
hostapd_set_and_check_bw320_offset(conf, 0);
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 0b07be516..40edcdaa7 100644
+index cffde344f..a8002fd1a 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1293,6 +1293,7 @@ struct hostapd_config {
+@@ -1346,6 +1346,7 @@ struct hostapd_config {
u8 dfs_detect_mode;
u8 amsdu;
void *muru_config;
@@ -170,7 +170,7 @@
};
enum three_wire_mode {
-@@ -1345,6 +1346,12 @@ enum mtk_vendor_attr_edcca_ctrl_mode {
+@@ -1398,6 +1399,12 @@ enum mtk_vendor_attr_edcca_ctrl_mode {
EDCCA_CTRL_NUM,
};
@@ -184,10 +184,10 @@
#define EDCCA_MIN_COMPENSATION -126
#define EDCCA_MAX_COMPENSATION 126
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 2028e70fb..c71cfe1bd 100644
+index 6f8f329b0..dc772ea31 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1379,3 +1379,12 @@ int hostapd_drv_background_radar_mode(struct hostapd_data *hapd)
+@@ -1415,3 +1415,12 @@ int hostapd_drv_background_radar_mode(struct hostapd_data *hapd)
return hapd->driver->background_radar_mode(hapd->drv_priv,
hapd->iconf->background_radar_mode);
}
@@ -201,10 +201,10 @@
+ hapd->iconf->pp_mode);
+}
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index f0e618bcc..ef61001e5 100644
+index 53075ea94..9a477a40e 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -169,6 +169,7 @@ int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type);
+@@ -172,6 +172,7 @@ int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type);
int hostapd_drv_amnt_set(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_sta_mac);
int hostapd_drv_amnt_dump(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_dump_buf);
int hostapd_drv_background_radar_mode(struct hostapd_data *hapd);
@@ -213,10 +213,10 @@
#include "drivers/driver.h"
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index 0d4b79b48..cdbf81e38 100644
+index 7da5c3afa..7ebdf4eb0 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -2708,6 +2708,8 @@ dfs_offload:
+@@ -2771,6 +2771,8 @@ dfs_offload:
goto fail;
if (hostapd_drv_amsdu_ctrl(hapd) < 0)
goto fail;
@@ -226,7 +226,7 @@
wpa_printf(MSG_DEBUG, "%s: Setup of interface done.",
iface->bss[0]->conf->iface);
diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
-index 5bc1e0444..6275c141d 100644
+index 3fb4c38f3..0a96c842e 100644
--- a/src/common/mtk_vendor.h
+++ b/src/common/mtk_vendor.h
@@ -17,6 +17,7 @@ enum mtk_nl80211_vendor_subcmds {
@@ -237,7 +237,7 @@
};
enum mtk_vendor_attr_edcca_ctrl {
-@@ -256,6 +257,17 @@ enum mtk_vendor_attr_background_radar_ctrl {
+@@ -259,6 +260,17 @@ enum mtk_vendor_attr_background_radar_ctrl {
NUM_MTK_VENDOR_ATTRS_BACKGROUND_RADAR_CTRL - 1
};
@@ -256,10 +256,10 @@
#define ETH_ALEN 6
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 863748d4f..be0e89ba3 100644
+index 35c02937d..ab93405fb 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5326,6 +5326,12 @@ struct wpa_driver_ops {
+@@ -5353,6 +5353,12 @@ struct wpa_driver_ops {
* @background_radar_mode: background radar mode
*/
int (*background_radar_mode)(void *priv, u8 background_radar_mode);
@@ -273,7 +273,7 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index e3f00b6d6..b47ab07ea 100644
+index 2d2b47456..a1e2ee091 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -156,6 +156,11 @@ amnt_dump_policy[NUM_MTK_VENDOR_ATTRS_AMNT_DUMP] = {
@@ -288,7 +288,7 @@
static struct nl_sock * nl_create_handle(struct nl_cb *cb, const char *dbg)
{
struct nl_sock *handle;
-@@ -15085,6 +15090,49 @@ static int nl80211_background_radar_mode(void *priv, const u8 background_radar_m
+@@ -15113,6 +15118,49 @@ static int nl80211_background_radar_mode(void *priv, const u8 background_radar_m
return ret;
}
@@ -338,7 +338,7 @@
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211",
.desc = "Linux nl80211/cfg80211",
-@@ -15263,4 +15311,5 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -15291,4 +15339,5 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.amnt_set = nl80211_amnt_set,
.amnt_dump = nl80211_amnt_dump,
.background_radar_mode = nl80211_background_radar_mode,
@@ -357,7 +357,7 @@
u32 ignore_next_local_disconnect;
u32 ignore_next_local_deauth;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index 9bc98aae7..ba3c0817b 100644
+index fd8c7b0ad..d082b83d5 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1167,6 +1167,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
@@ -371,5 +371,5 @@
}
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0073-mtk-hostapd-add-no_beacon-vendor-command-for-cert.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0055-mtk-hostapd-add-no_beacon-vendor-command-for-cert.patch
similarity index 87%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0073-mtk-hostapd-add-no_beacon-vendor-command-for-cert.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0055-mtk-hostapd-add-no_beacon-vendor-command-for-cert.patch
index 31d1951..09e54c8 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0073-mtk-hostapd-add-no_beacon-vendor-command-for-cert.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0055-mtk-hostapd-add-no_beacon-vendor-command-for-cert.patch
@@ -1,7 +1,7 @@
-From a7adff7d782e329e9f8b1063f78616757f944d51 Mon Sep 17 00:00:00 2001
+From fb2f823022007f3b72042a38a35a3829fecf9d9f Mon Sep 17 00:00:00 2001
From: MeiChia Chiu <meichia.chiu@mediatek.com>
Date: Wed, 22 Nov 2023 21:41:34 +0800
-Subject: [PATCH 073/104] mtk: hostapd: add no_beacon vendor command for cert
+Subject: [PATCH 055/126] mtk: hostapd: add no_beacon vendor command for cert
Add the vendor command to disable/enable beacon
@@ -25,10 +25,10 @@
9 files changed, 94 insertions(+)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index c9b53c64e..0fded7ed4 100644
+index be47bd492..8187cfb3c 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -4862,6 +4862,24 @@ hostapd_ctrl_iface_get_pp(struct hostapd_data *hapd, char *cmd, char *buf,
+@@ -4999,6 +4999,24 @@ hostapd_ctrl_iface_get_pp(struct hostapd_data *hapd, char *cmd, char *buf,
}
}
@@ -53,7 +53,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
int reply_size,
-@@ -5512,6 +5530,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -5657,6 +5675,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
} else if (os_strncmp(buf, "SET_BACKGROUND_RADAR_MODE", 25) == 0) {
reply_len = hostapd_ctrl_iface_set_background_radar_mode(hapd, buf + 25,
reply, reply_size);
@@ -64,10 +64,10 @@
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index e0b175386..7e4485cb8 100644
+index e43d515d5..9a6a742c1 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1464,6 +1464,11 @@ static int hostapd_cli_cmd_get_mu(struct wpa_ctrl *ctrl, int argc,
+@@ -1482,6 +1482,11 @@ static int hostapd_cli_cmd_get_mu(struct wpa_ctrl *ctrl, int argc,
return hostapd_cli_cmd(ctrl, "GET_MU", 0, NULL, NULL);
}
@@ -79,7 +79,7 @@
#ifdef CONFIG_DPP
-@@ -1871,6 +1876,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1901,6 +1906,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
"<value> [0-15] bitmap- UL MU-MIMO(bit3), DL MU-MIMO(bit2), UL OFDMA(bit1), DL OFDMA(bit0)"},
{ "get_mu", hostapd_cli_cmd_get_mu, NULL,
" = show mu onoff value in 0-15 bitmap"},
@@ -89,10 +89,10 @@
{ "dpp_qr_code", hostapd_cli_cmd_dpp_qr_code, NULL,
"report a scanned DPP URI from a QR Code" },
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index c71cfe1bd..d6bd157d8 100644
+index dc772ea31..d4be02b77 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1388,3 +1388,11 @@ int hostapd_drv_pp_mode_set(struct hostapd_data *hapd)
+@@ -1424,3 +1424,11 @@ int hostapd_drv_pp_mode_set(struct hostapd_data *hapd)
return hapd->driver->pp_mode_set(hapd->drv_priv,
hapd->iconf->pp_mode);
}
@@ -105,10 +105,10 @@
+}
+
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index ef61001e5..78e5c8d5a 100644
+index 9a477a40e..2ee4ebd04 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -170,6 +170,7 @@ int hostapd_drv_amnt_set(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_sta_ma
+@@ -173,6 +173,7 @@ int hostapd_drv_amnt_set(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_sta_ma
int hostapd_drv_amnt_dump(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_dump_buf);
int hostapd_drv_background_radar_mode(struct hostapd_data *hapd);
int hostapd_drv_pp_mode_set(struct hostapd_data *hapd);
@@ -117,7 +117,7 @@
#include "drivers/driver.h"
diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
-index 6275c141d..5531802b8 100644
+index 0a96c842e..261994b8a 100644
--- a/src/common/mtk_vendor.h
+++ b/src/common/mtk_vendor.h
@@ -18,6 +18,7 @@ enum mtk_nl80211_vendor_subcmds {
@@ -128,7 +128,7 @@
};
enum mtk_vendor_attr_edcca_ctrl {
-@@ -268,6 +269,17 @@ enum mtk_vendor_attr_pp_ctrl {
+@@ -271,6 +272,17 @@ enum mtk_vendor_attr_pp_ctrl {
NUM_MTK_VENDOR_ATTRS_PP_CTRL - 1
};
@@ -147,10 +147,10 @@
#define ETH_ALEN 6
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index be0e89ba3..332a51c55 100644
+index ab93405fb..b24caae8a 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5243,6 +5243,13 @@ struct wpa_driver_ops {
+@@ -5269,6 +5269,13 @@ struct wpa_driver_ops {
int (*mu_ctrl)(void *priv, u8 mode, void *config);
int (*mu_dump)(void *priv, u8 *mu_onoff);
@@ -165,10 +165,10 @@
* three_wire_ctrl - set three_wire_ctrl mode
* @priv: Private driver interface data
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index b47ab07ea..e588e7538 100644
+index a1e2ee091..10e5c837b 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -14111,6 +14111,39 @@ static int nl80211_mu_dump(void *priv, u8 *mu_onoff)
+@@ -14136,6 +14136,39 @@ static int nl80211_mu_dump(void *priv, u8 *mu_onoff)
return ret;
}
@@ -208,7 +208,7 @@
#endif /* CONFIG_IEEE80211AX */
-@@ -15281,6 +15314,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -15309,6 +15342,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.set_4addr_mode = nl80211_set_4addr_mode,
.mu_ctrl = nl80211_mu_ctrl,
.mu_dump = nl80211_mu_dump,
@@ -229,7 +229,7 @@
u32 ignore_next_local_disconnect;
u32 ignore_next_local_deauth;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index ba3c0817b..f3e3d52e2 100644
+index d082b83d5..30f89b687 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1170,6 +1170,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
@@ -243,5 +243,5 @@
}
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0074-mtk-hostapd-WPS-added-change-to-configure-AP-PIN-loc.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0056-mtk-hostapd-WPS-added-change-to-configure-AP-PIN-loc.patch
similarity index 86%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0074-mtk-hostapd-WPS-added-change-to-configure-AP-PIN-loc.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0056-mtk-hostapd-WPS-added-change-to-configure-AP-PIN-loc.patch
index 06ee95c..b3dc7f1 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0074-mtk-hostapd-WPS-added-change-to-configure-AP-PIN-loc.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0056-mtk-hostapd-WPS-added-change-to-configure-AP-PIN-loc.patch
@@ -1,7 +1,7 @@
-From 817f2a256b166e07d7b0abcee789976b47224429 Mon Sep 17 00:00:00 2001
+From c384a286a5d163d324b1901b1c446df1c6dfdbe2 Mon Sep 17 00:00:00 2001
From: "amlendu.mishra" <amlendu.mishra@mediatek.com>
Date: Wed, 13 Dec 2023 18:13:01 +0530
-Subject: [PATCH 074/104] mtk: hostapd: WPS added change to configure AP PIN
+Subject: [PATCH 056/126] mtk: hostapd: WPS added change to configure AP PIN
lock timout
added config paramter ap_pin_lockout_time to configure
@@ -15,10 +15,10 @@
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index 050ef290e..7bc19479d 100644
+index fe92540c4..7ab2c6827 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -4191,6 +4191,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -4283,6 +4283,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
bss->wps_independent = atoi(pos);
} else if (os_strcmp(buf, "ap_setup_locked") == 0) {
bss->ap_setup_locked = atoi(pos);
@@ -28,10 +28,10 @@
if (uuid_str2bin(pos, bss->uuid)) {
wpa_printf(MSG_ERROR, "Line %d: invalid UUID", line);
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 40edcdaa7..7f48c71f5 100644
+index a8002fd1a..b66f79d31 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -493,6 +493,7 @@ struct hostapd_bss_config {
+@@ -505,6 +505,7 @@ struct hostapd_bss_config {
#ifdef CONFIG_WPS
int wps_independent;
int ap_setup_locked;
@@ -60,5 +60,5 @@
hapd->ap_pin_lockout_time *= 2;
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0075-hostapd-mtk-ACS-remove-chan-freq-list-check-when-sca.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0057-mtk-hostapd-remove-chan-freq-list-check-when-scan-re.patch
similarity index 69%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0075-hostapd-mtk-ACS-remove-chan-freq-list-check-when-sca.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0057-mtk-hostapd-remove-chan-freq-list-check-when-scan-re.patch
index 6a9f126..f66edfe 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0075-hostapd-mtk-ACS-remove-chan-freq-list-check-when-sca.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0057-mtk-hostapd-remove-chan-freq-list-check-when-scan-re.patch
@@ -1,8 +1,8 @@
-From 76d8a7f29b56075df3ad756f65374b2b238c2120 Mon Sep 17 00:00:00 2001
+From 43f030f950401ccd573e7bc07080107f74f214bd Mon Sep 17 00:00:00 2001
From: Michael-CY Lee <michael-cy.lee@mediatek.com>
Date: Tue, 23 Jan 2024 10:52:57 +0800
-Subject: [PATCH 075/104] hostapd: mtk: ACS: remove chan/freq list check when
- scan request and factor calculation
+Subject: [PATCH 057/126] mtk: hostapd: remove chan/freq list check when scan
+ request and factor calculation
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
---
@@ -10,10 +10,10 @@
1 file changed, 12 deletions(-)
diff --git a/src/ap/acs.c b/src/ap/acs.c
-index 4c4c750ab..cb4db7147 100644
+index 25fec499a..f7e7f15d2 100644
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
-@@ -595,12 +595,6 @@ static void acs_survey_mode_interference_factor(
+@@ -599,12 +599,6 @@ static void acs_survey_mode_interference_factor(
iface->conf->acs_exclude_dfs)
continue;
@@ -26,7 +26,7 @@
if (chan->max_tx_power < iface->conf->min_tx_power)
continue;
-@@ -1358,12 +1352,6 @@ static int * acs_request_scan_add_freqs(struct hostapd_iface *iface,
+@@ -1370,12 +1364,6 @@ static int * acs_request_scan_add_freqs(struct hostapd_iface *iface,
iface->conf->acs_exclude_dfs))
continue;
@@ -40,5 +40,5 @@
continue;
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0076-mtk-hostapd-Fix-chan_switch-to-usable-DFS-channel-fa.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0058-mtk-hostapd-Fix-chan_switch-to-usable-DFS-channel-fa.patch
similarity index 72%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0076-mtk-hostapd-Fix-chan_switch-to-usable-DFS-channel-fa.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0058-mtk-hostapd-Fix-chan_switch-to-usable-DFS-channel-fa.patch
index d4e52f8..22e91c7 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0076-mtk-hostapd-Fix-chan_switch-to-usable-DFS-channel-fa.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0058-mtk-hostapd-Fix-chan_switch-to-usable-DFS-channel-fa.patch
@@ -1,7 +1,7 @@
-From 29b7ebf83cad69c48012eb5a03eb01a2a9fbfcab Mon Sep 17 00:00:00 2001
+From 03ace053c9dfcbfafec764a894292180f5587c42 Mon Sep 17 00:00:00 2001
From: "fancy.liu" <fancy.liu@mediatek.com>
Date: Wed, 1 Nov 2023 19:58:05 +0800
-Subject: [PATCH 076/104] mtk: hostapd: Fix chan_switch to usable DFS channel
+Subject: [PATCH 058/126] mtk: hostapd: Fix chan_switch to usable DFS channel
fail due to ACS
Step and issue:
@@ -13,7 +13,7 @@
When need do DFS-CAC, hostapd will do intf disable, then set the new
channel into running config settings, and finally enable intf;
In the test case, new DFS channel is set to runnint config settings, but
-another param "acs" is still 1 (enable), caused the ACS running when
+another param acs is still 1 (enable), caused the ACS running when
intf enabled.
Solution:
@@ -26,10 +26,10 @@
1 file changed, 3 insertions(+)
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index cdbf81e38..636655ea1 100644
+index 7ebdf4eb0..97bc4808e 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -4580,6 +4580,9 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface,
+@@ -4669,6 +4669,9 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface,
iface->freq = freq_params->freq;
iface->conf->channel = freq_params->channel;
@@ -37,8 +37,8 @@
+ iface->conf->acs = 0;
+
iface->conf->secondary_channel = freq_params->sec_channel_offset;
- hostapd_set_oper_centr_freq_seg0_idx(iface->conf, seg0_idx);
- hostapd_set_oper_centr_freq_seg1_idx(iface->conf, seg1_idx);
+ if (ieee80211_freq_to_channel_ext(freq_params->freq,
+ freq_params->sec_channel_offset, bw,
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0079-mtk-hostapd-initialize-i802_bss-s-flink-freq-with-if.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0059-mtk-hostapd-initialize-i802_bss-s-flink-freq-with-if.patch
similarity index 85%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0079-mtk-hostapd-initialize-i802_bss-s-flink-freq-with-if.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0059-mtk-hostapd-initialize-i802_bss-s-flink-freq-with-if.patch
index a28db10..0be5c0e 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0079-mtk-hostapd-initialize-i802_bss-s-flink-freq-with-if.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0059-mtk-hostapd-initialize-i802_bss-s-flink-freq-with-if.patch
@@ -1,7 +1,7 @@
-From 26c23f7dc1fe47e22ceab581b7abed089148c68f Mon Sep 17 00:00:00 2001
+From c3f080cfa523b13726b223411cc1bf574000883b Mon Sep 17 00:00:00 2001
From: Bo Jiao <Bo.Jiao@mediatek.com>
Date: Thu, 19 Oct 2023 13:38:11 +0800
-Subject: [PATCH 079/104] mtk: hostapd: initialize i802_bss's flink->freq with
+Subject: [PATCH 059/126] mtk: hostapd: initialize i802_bss's flink->freq with
iface freq.
Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
@@ -15,10 +15,10 @@
6 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index d6bd157d8..b7896c110 100644
+index d4be02b77..011bb37f8 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -368,7 +368,7 @@ int hostapd_vlan_if_add(struct hostapd_data *hapd, const char *ifname)
+@@ -371,7 +371,7 @@ int hostapd_vlan_if_add(struct hostapd_data *hapd, const char *ifname)
char force_ifname[IFNAMSIZ];
u8 if_addr[ETH_ALEN];
return hostapd_if_add(hapd, WPA_IF_AP_VLAN, ifname, hapd->own_addr,
@@ -27,7 +27,7 @@
}
-@@ -560,13 +560,13 @@ int hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len)
+@@ -589,13 +589,13 @@ int hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len)
int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type,
const char *ifname, const u8 *addr, void *bss_ctx,
void **drv_priv, char *force_ifname, u8 *if_addr,
@@ -44,10 +44,10 @@
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index 78e5c8d5a..5830705a3 100644
+index 2ee4ebd04..8c783610c 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -58,7 +58,7 @@ int hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len);
+@@ -61,7 +61,7 @@ int hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len);
int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type,
const char *ifname, const u8 *addr, void *bss_ctx,
void **drv_priv, char *force_ifname, u8 *if_addr,
@@ -57,10 +57,10 @@
const char *ifname);
int hostapd_if_link_remove(struct hostapd_data *hapd,
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index 636655ea1..e4fc1f85a 100644
+index 97bc4808e..f64f17ee6 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -1433,7 +1433,7 @@ int hostapd_setup_bss(struct hostapd_data *hapd, int first, bool start_beacon)
+@@ -1487,7 +1487,7 @@ int hostapd_setup_bss(struct hostapd_data *hapd, int first, bool start_beacon)
conf->iface, addr, hapd,
&hapd->drv_priv, force_ifname, if_addr,
conf->bridge[0] ? conf->bridge : NULL,
@@ -70,10 +70,10 @@
MACSTR ")", MAC2STR(hapd->own_addr));
hapd->interface_added = 0;
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 332a51c55..2940650df 100644
+index b24caae8a..8f5d260aa 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -3866,7 +3866,7 @@ struct wpa_driver_ops {
+@@ -3892,7 +3892,7 @@ struct wpa_driver_ops {
int (*if_add)(void *priv, enum wpa_driver_if_type type,
const char *ifname, const u8 *addr, void *bss_ctx,
void **drv_priv, char *force_ifname, u8 *if_addr,
@@ -83,10 +83,10 @@
/**
* if_remove - Remove a virtual interface
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index e588e7538..3d69c9c49 100644
+index 10e5c837b..7cb65a2bc 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -8872,7 +8872,7 @@ static int wpa_driver_nl80211_if_add(void *priv, enum wpa_driver_if_type type,
+@@ -8869,7 +8869,7 @@ static int wpa_driver_nl80211_if_add(void *priv, enum wpa_driver_if_type type,
void *bss_ctx, void **drv_priv,
char *force_ifname, u8 *if_addr,
const char *bridge, int use_existing,
@@ -95,7 +95,7 @@
{
enum nl80211_iftype nlmode;
struct i802_bss *bss = priv;
-@@ -8992,7 +8992,7 @@ static int wpa_driver_nl80211_if_add(void *priv, enum wpa_driver_if_type type,
+@@ -8989,7 +8989,7 @@ static int wpa_driver_nl80211_if_add(void *priv, enum wpa_driver_if_type type,
new_bss->valid_links = 0;
os_memcpy(new_bss->flink->addr, new_bss->addr, ETH_ALEN);
@@ -118,5 +118,5 @@
}
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0060-mtk-hostapd-fix-mld_assoc_link_id.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0060-mtk-hostapd-fix-mld_assoc_link_id.patch
new file mode 100644
index 0000000..79883e2
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0060-mtk-hostapd-fix-mld_assoc_link_id.patch
@@ -0,0 +1,31 @@
+From 69f830f234d58e4bcbdafe70d28c366e87a65c66 Mon Sep 17 00:00:00 2001
+From: Shayne Chen <shayne.chen@mediatek.com>
+Date: Mon, 29 Jan 2024 11:24:28 +0800
+Subject: [PATCH 060/126] mtk: hostapd: fix mld_assoc_link_id
+
+Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
+---
+ src/ap/hostapd.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index f64f17ee6..eefd4c5d3 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -4111,11 +4111,9 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
+
+ #ifdef CONFIG_IEEE80211BE
+ if (ap_sta_is_mld(hapd, sta)) {
+- if (sta->mld_assoc_link_id == hapd->mld_link_id) {
+- mld_assoc_link_id = sta->mld_assoc_link_id;
+- } else {
++ if (sta->mld_assoc_link_id != hapd->mld_link_id)
+ return;
+- }
++ mld_assoc_link_id = sta->mld_assoc_link_id;
+ }
+ #endif /* CONFIG_IEEE80211BE */
+ if (mld_assoc_link_id != -2)
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0081-mtk-wpa_s-correctly-get-assoc-frequency.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0061-mtk-wpa_supplicant-correctly-get-assoc-frequency.patch
similarity index 71%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0081-mtk-wpa_s-correctly-get-assoc-frequency.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0061-mtk-wpa_supplicant-correctly-get-assoc-frequency.patch
index 7bdb4fe..8877145 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0081-mtk-wpa_s-correctly-get-assoc-frequency.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0061-mtk-wpa_supplicant-correctly-get-assoc-frequency.patch
@@ -1,7 +1,7 @@
-From 3dbd0105364c15225a18098eeaae58119490918d Mon Sep 17 00:00:00 2001
+From 98c59e85209339abc85968b1e1d1de66d48bc88a Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Thu, 19 Oct 2023 10:48:11 +0800
-Subject: [PATCH 081/104] mtk: wpa_s: correctly get assoc frequency
+Subject: [PATCH 061/126] mtk: wpa_supplicant: correctly get assoc frequency
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
---
@@ -9,10 +9,10 @@
1 file changed, 1 insertion(+)
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
-index 6631285bf..90084356d 100644
+index 35ee939b7..73582aeb0 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
-@@ -328,6 +328,7 @@ static void mlme_event_assoc(struct wpa_driver_nl80211_data *drv,
+@@ -329,6 +329,7 @@ static void mlme_event_assoc(struct wpa_driver_nl80211_data *drv,
wpa_ssid_txt(drv->ssid, drv->ssid_len));
}
@@ -21,5 +21,5 @@
drv->first_bss->flink->freq = drv->assoc_freq;
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0082-mtk-wpa_s-force-MLD-STA-to-use-SAE-H2E-during-authen.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0062-mtk-wpa_supplicant-force-MLD-STA-to-use-SAE-H2E-duri.patch
similarity index 74%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0082-mtk-wpa_s-force-MLD-STA-to-use-SAE-H2E-during-authen.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0062-mtk-wpa_supplicant-force-MLD-STA-to-use-SAE-H2E-duri.patch
index 8ddecc9..4f6a065 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0082-mtk-wpa_s-force-MLD-STA-to-use-SAE-H2E-during-authen.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0062-mtk-wpa_supplicant-force-MLD-STA-to-use-SAE-H2E-duri.patch
@@ -1,8 +1,8 @@
-From 50e36560d14dbb6bf38b46dcfc58f9414e56b283 Mon Sep 17 00:00:00 2001
+From 63810009871c9dc527fc3a40c3f873bfbf560f7d Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Thu, 19 Oct 2023 10:51:55 +0800
-Subject: [PATCH 082/104] mtk: wpa_s: force MLD STA to use SAE H2E during
- authentication
+Subject: [PATCH 062/126] mtk: wpa_supplicant: force MLD STA to use SAE H2E
+ during authentication
Otherwise the MLD STA setup will fail with hostapd MLD AP.
@@ -12,10 +12,10 @@
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
-index f08184f98..e1183722f 100644
+index 443b0b667..afdccf54f 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
-@@ -199,7 +199,7 @@ static struct wpabuf * sme_auth_build_sae_commit(struct wpa_supplicant *wpa_s,
+@@ -204,7 +204,7 @@ static struct wpabuf * sme_auth_build_sae_commit(struct wpa_supplicant *wpa_s,
if (wpa_key_mgmt_sae_ext_key(key_mgmt) &&
wpa_s->conf->sae_pwe != SAE_PWE_FORCE_HUNT_AND_PECK)
use_pt = 1;
@@ -25,5 +25,5 @@
use_pt = 1;
#ifdef CONFIG_SAE_PK
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0083-mtk-hostapd-extend-ap_get_sta-to-find-the-correct-st.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0063-mtk-hostapd-extend-ap_get_sta-to-find-the-correct-st.patch
similarity index 84%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0083-mtk-hostapd-extend-ap_get_sta-to-find-the-correct-st.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0063-mtk-hostapd-extend-ap_get_sta-to-find-the-correct-st.patch
index b3144cb..93aafb3 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0083-mtk-hostapd-extend-ap_get_sta-to-find-the-correct-st.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0063-mtk-hostapd-extend-ap_get_sta-to-find-the-correct-st.patch
@@ -1,7 +1,7 @@
-From fb3820ff9fff1b15c13d4a799fbef8932fda7a1b Mon Sep 17 00:00:00 2001
+From 5378549cd55834d56c7364268f7849f30e780756 Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Mon, 11 Dec 2023 17:02:05 +0800
-Subject: [PATCH 083/104] mtk: hostapd: extend ap_get_sta() to find the correct
+Subject: [PATCH 063/126] mtk: hostapd: extend ap_get_sta() to find the correct
sta
There're still some mld address tranlation issues that need to be dealt
@@ -16,10 +16,10 @@
3 files changed, 18 insertions(+)
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index ce3874901..0f357d786 100644
+index 4581ae1d4..b87fae929 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
-@@ -3116,6 +3116,7 @@ static void handle_auth(struct hostapd_data *hapd,
+@@ -3194,6 +3194,7 @@ static void handle_auth(struct hostapd_data *hapd,
mgmt->sa, ETH_ALEN);
os_memcpy(sta->mld_info.links[link_id].local_addr,
hapd->own_addr, ETH_ALEN);
@@ -28,7 +28,7 @@
}
#endif /* CONFIG_IEEE80211BE */
diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
-index ee6e20538..e9fa0ed6e 100644
+index 51978f45f..d4f4eb913 100644
--- a/src/ap/sta_info.c
+++ b/src/ap/sta_info.c
@@ -73,6 +73,22 @@ struct sta_info * ap_get_sta(struct hostapd_data *hapd, const u8 *sta)
@@ -55,10 +55,10 @@
}
diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h
-index 38b80903d..cd89db6c8 100644
+index d03d18b48..6b88799e2 100644
--- a/src/ap/sta_info.h
+++ b/src/ap/sta_info.h
-@@ -102,6 +102,7 @@ struct sta_info {
+@@ -96,6 +96,7 @@ struct sta_info {
struct sta_info *next; /* next entry in sta list */
struct sta_info *hnext; /* next entry in hash table list */
u8 addr[6];
@@ -67,5 +67,5 @@
struct dl_list ip6addr; /* list head for struct ip6addr */
u16 aid; /* STA's unique AID (1 .. 2007) or 0 if not yet assigned */
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0084-mtk-hostapd-update-cookie-only-when-noack-is-unset.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0064-mtk-hostapd-update-cookie-only-when-noack-is-unset.patch
similarity index 79%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0084-mtk-hostapd-update-cookie-only-when-noack-is-unset.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0064-mtk-hostapd-update-cookie-only-when-noack-is-unset.patch
index 650da0e..60e5325 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0084-mtk-hostapd-update-cookie-only-when-noack-is-unset.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0064-mtk-hostapd-update-cookie-only-when-noack-is-unset.patch
@@ -1,7 +1,7 @@
-From 665bc7cb59b4383aab615fff82fa601c468a4634 Mon Sep 17 00:00:00 2001
+From 016e41e3031fe6c2d5c12f29f47616f7a1b7dabf Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Mon, 18 Dec 2023 18:53:35 +0800
-Subject: [PATCH 084/104] mtk: hostapd: update cookie only when noack is unset
+Subject: [PATCH 064/126] mtk: hostapd: update cookie only when noack is unset
This can prevent cookie unmatched problems during setup.
@@ -11,10 +11,10 @@
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 3d69c9c49..6d300c0c8 100644
+index 7cb65a2bc..4b404f0bb 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -4472,7 +4472,7 @@ send_frame_cmd:
+@@ -4485,7 +4485,7 @@ send_frame_cmd:
res = nl80211_send_frame_cmd(bss, freq, wait_time, data, data_len,
use_cookie, no_cck, noack, offchanok,
csa_offs, csa_offs_len, link_id);
@@ -23,7 +23,7 @@
drv->send_frame_link_id = link_id;
return res;
-@@ -9205,8 +9205,8 @@ static int nl80211_send_frame_cmd(struct i802_bss *bss,
+@@ -9200,8 +9200,8 @@ static int nl80211_send_frame_cmd(struct i802_bss *bss,
"cookie 0x%llx", no_ack ? " (no ACK)" : "",
(long long unsigned int) cookie);
@@ -35,5 +35,5 @@
if (!wait) {
/* There is no need to store this cookie since there
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0085-mtk-wpa_s-fix-bss-selection-when-setting-mld_connect.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0065-mtk-wpa_supplicant-fix-bss-selection-when-setting-ml.patch
similarity index 75%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0085-mtk-wpa_s-fix-bss-selection-when-setting-mld_connect.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0065-mtk-wpa_supplicant-fix-bss-selection-when-setting-ml.patch
index 820e085..1a77564 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0085-mtk-wpa_s-fix-bss-selection-when-setting-mld_connect.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0065-mtk-wpa_supplicant-fix-bss-selection-when-setting-ml.patch
@@ -1,7 +1,7 @@
-From e2e07813d1e05a72aa649614ad942036b387aaf1 Mon Sep 17 00:00:00 2001
+From a52f67542afdb1c61bd26ea4a8368620114e4747 Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Fri, 29 Dec 2023 15:04:27 +0800
-Subject: [PATCH 085/104] mtk: wpa_s: fix bss selection when setting
+Subject: [PATCH 065/126] mtk: wpa_supplicant: fix bss selection when setting
mld_connect_band_pref
Without this patch, when setting mld_connect_band_pref as 5g, wrong bss
@@ -13,10 +13,10 @@
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
-index e1183722f..5b69812b5 100644
+index afdccf54f..abef26f16 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
-@@ -437,8 +437,11 @@ static struct wpa_bss * wpas_ml_connect_pref(struct wpa_supplicant *wpa_s,
+@@ -443,8 +443,11 @@ static struct wpa_bss * wpas_ml_connect_pref(struct wpa_supplicant *wpa_s,
}
for_each_link(wpa_s->valid_links, i) {
@@ -30,5 +30,5 @@
if (wpa_s->links[i].freq >= low && wpa_s->links[i].freq <= high)
goto found;
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0086-mtk-hostapd-add-mld_primary-option.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0066-mtk-hostapd-add-mld_primary-option.patch
similarity index 76%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0086-mtk-hostapd-add-mld_primary-option.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0066-mtk-hostapd-add-mld_primary-option.patch
index 4fa5b6f..87fe7ac 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0086-mtk-hostapd-add-mld_primary-option.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0066-mtk-hostapd-add-mld_primary-option.patch
@@ -1,7 +1,7 @@
-From bcb603194f7df4fd3060ed6a13a2e4da2715d959 Mon Sep 17 00:00:00 2001
+From cba099045780e4befb6d08db29e12549f5d8a83b Mon Sep 17 00:00:00 2001
From: Michael-CY Lee <michael-cy.lee@mediatek.com>
Date: Tue, 26 Dec 2023 08:05:41 +0800
-Subject: [PATCH 086/104] mtk: hostapd: add mld_primary option
+Subject: [PATCH 066/126] mtk: hostapd: add mld_primary option
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
---
@@ -10,10 +10,10 @@
2 files changed, 5 insertions(+)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index 7bc19479d..e9caa45f3 100644
+index 7ab2c6827..014ca4d3c 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -5349,6 +5349,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -5462,6 +5462,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
conf->punct_acs_threshold = val;
} else if (os_strcmp(buf, "mld_ap") == 0) {
bss->mld_ap = !!atoi(pos);
@@ -23,10 +23,10 @@
if (hwaddr_aton(pos, bss->mld_addr)) {
wpa_printf(MSG_ERROR, "Line %d: Invalid mld_addr",
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 7f48c71f5..1f686550e 100644
+index b66f79d31..413505c59 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -966,6 +966,9 @@ struct hostapd_bss_config {
+@@ -987,6 +987,9 @@ struct hostapd_bss_config {
/* The AP is part of an AP MLD */
u8 mld_ap;
@@ -37,5 +37,5 @@
u8 mld_id;
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0087-mtk-wpa_supplicant-add-mld_allowed_phy-configuration.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0067-mtk-wpa_supplicant-add-mld_allowed_phy-configuration.patch
similarity index 81%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0087-mtk-wpa_supplicant-add-mld_allowed_phy-configuration.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0067-mtk-wpa_supplicant-add-mld_allowed_phy-configuration.patch
index ac847f5..64611ae 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0087-mtk-wpa_supplicant-add-mld_allowed_phy-configuration.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0067-mtk-wpa_supplicant-add-mld_allowed_phy-configuration.patch
@@ -1,7 +1,7 @@
-From d6e854c62cd825756cc1b46c8b006855cf9e057e Mon Sep 17 00:00:00 2001
+From 68d893f8fd726074299c7040ae69d6ce8b4aca99 Mon Sep 17 00:00:00 2001
From: Michael-CY Lee <michael-cy.lee@mediatek.com>
Date: Wed, 6 Mar 2024 15:01:33 +0800
-Subject: [PATCH 087/104] mtk: wpa_supplicant: add 'mld_allowed_phy'
+Subject: [PATCH 067/126] mtk: wpa_supplicant: add 'mld_allowed_phy'
configuration option for MLD STA
A new configuration option named 'mld_allowed_phy' is added for MLD STA.
@@ -18,10 +18,10 @@
4 files changed, 22 insertions(+)
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
-index 7bb57e2ab..d3c75ee94 100644
+index d2c05e352..d989afdd4 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
-@@ -5680,6 +5680,7 @@ static const struct global_parse_data global_fields[] = {
+@@ -5683,6 +5683,7 @@ static const struct global_parse_data global_fields[] = {
#endif /* CONFIG_PASN */
#ifdef CONFIG_TESTING_OPTIONS
{ INT_RANGE(mld_force_single_link, 0, 1), 0 },
@@ -30,10 +30,10 @@
{ FUNC(mld_connect_bssid_pref), 0 },
#endif /* CONFIG_TESTING_OPTIONS */
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
-index 8981305c2..c0164fa76 100644
+index d74b5c455..27ffa3034 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
-@@ -1800,6 +1800,7 @@ struct wpa_config {
+@@ -1813,6 +1813,7 @@ struct wpa_config {
u8 mld_connect_bssid_pref[ETH_ALEN];
int mld_force_single_link;
@@ -42,10 +42,10 @@
};
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
-index 7a3ed6373..875d00bb4 100644
+index 5ce616129..591766a85 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
-@@ -1622,6 +1622,8 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
+@@ -1626,6 +1626,8 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
#ifdef CONFIG_TESTING_OPTIONS
if (config->mld_force_single_link)
fprintf(f, "mld_force_single_link=1\n");
@@ -55,10 +55,10 @@
fprintf(f, "mld_connect_band_pref=%d\n",
config->mld_connect_band_pref);
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
-index 5b69812b5..ef258fadc 100644
+index abef26f16..e8a6a30e8 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
-@@ -517,6 +517,16 @@ out:
+@@ -523,6 +523,16 @@ static int wpas_sme_ml_auth(struct wpa_supplicant *wpa_s,
}
@@ -73,9 +73,9 @@
+
+
static void wpas_sme_set_mlo_links(struct wpa_supplicant *wpa_s,
- struct wpa_bss *bss)
+ struct wpa_bss *bss, struct wpa_ssid *ssid)
{
-@@ -528,6 +538,11 @@ static void wpas_sme_set_mlo_links(struct wpa_supplicant *wpa_s,
+@@ -534,6 +544,11 @@ static void wpas_sme_set_mlo_links(struct wpa_supplicant *wpa_s,
for_each_link(bss->valid_links, i) {
const u8 *bssid = bss->mld_links[i].bssid;
@@ -87,7 +87,7 @@
wpa_s->valid_links |= BIT(i);
os_memcpy(wpa_s->links[i].bssid, bssid, ETH_ALEN);
wpa_s->links[i].freq = bss->mld_links[i].freq;
-@@ -577,6 +592,9 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
+@@ -587,6 +602,9 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
if ((wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_MLO) &&
!wpa_bss_parse_basic_ml_element(wpa_s, bss, wpa_s->ap_mld_addr,
NULL, ssid, NULL) &&
@@ -96,7 +96,7 @@
+#endif /* CONFIG_TESTING_OPTIONS */
bss->valid_links) {
wpa_printf(MSG_DEBUG, "MLD: In authentication");
- wpas_sme_set_mlo_links(wpa_s, bss);
+ wpas_sme_set_mlo_links(wpa_s, bss, ssid);
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0088-mtk-hostapd-support-band_idx-option-for-set_mu-get_m.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0068-mtk-hostapd-support-band_idx-option-for-set_mu-get_m.patch
similarity index 79%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0088-mtk-hostapd-support-band_idx-option-for-set_mu-get_m.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0068-mtk-hostapd-support-band_idx-option-for-set_mu-get_m.patch
index 1ba9e75..055820b 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0088-mtk-hostapd-support-band_idx-option-for-set_mu-get_m.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0068-mtk-hostapd-support-band_idx-option-for-set_mu-get_m.patch
@@ -1,7 +1,7 @@
-From a5b5d12eac0a1a4c53de67adc5793dbee87cb769 Mon Sep 17 00:00:00 2001
+From fcb02b75b95acf9efafa46fd3766f48e6799aeb5 Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Thu, 29 Feb 2024 19:55:34 +0800
-Subject: [PATCH 088/104] mtk: hostapd: support band_idx option for
+Subject: [PATCH 068/126] mtk: hostapd: support band_idx option for
set_mu/get_mu vendor command
Support band_idx for set_mu and get_mu vendor command. The usage shows
@@ -9,23 +9,27 @@
1. get_mu: $ hostapd_cli -i <intf> get_mu <band_idx>
2. set_mu: $ hostapd_cli -i <intf> set_mu <mu_onff>:<band_idx>
+Also, make 'band_idx' a mandatory configuration option.
+
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
---
hostapd/config_file.c | 9 +++++
hostapd/ctrl_iface.c | 78 ++++++++++++++++++++++++++++--------
hostapd/hostapd_cli.c | 2 +-
+ src/ap/ap_config.c | 6 +++
src/ap/ap_config.h | 1 +
src/ap/ap_drv_ops.c | 2 +-
src/common/mtk_vendor.h | 1 +
src/drivers/driver.h | 2 +-
src/drivers/driver_nl80211.c | 15 +++----
- 8 files changed, 82 insertions(+), 28 deletions(-)
+ 9 files changed, 88 insertions(+), 28 deletions(-)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index e9caa45f3..ef9bafb28 100644
+index 014ca4d3c..50d63e259 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -5431,6 +5431,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -5553,6 +5553,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
return 1;
}
conf->pp_mode = (u8) val;
@@ -42,10 +46,10 @@
wpa_printf(MSG_ERROR,
"Line %d: unknown configuration item '%s'",
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 0fded7ed4..c5540f5fd 100644
+index 8187cfb3c..76fd25d8b 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -4178,17 +4178,42 @@ hostapd_ctrl_iface_set_mu(struct hostapd_data *hapd, char *cmd,
+@@ -4308,17 +4308,42 @@ hostapd_ctrl_iface_set_mu(struct hostapd_data *hapd, char *cmd,
value = pos;
if (os_strcmp(config, "onoff") == 0) {
@@ -96,7 +100,7 @@
}
if (hapd->iconf->muru_config == NULL)
-@@ -4200,6 +4225,7 @@ hostapd_ctrl_iface_set_mu(struct hostapd_data *hapd, char *cmd,
+@@ -4330,6 +4355,7 @@ hostapd_ctrl_iface_set_mu(struct hostapd_data *hapd, char *cmd,
comm = &muru->comm;
if (os_strncmp(config, "update", 6) == 0) {
@@ -104,7 +108,7 @@
ret = hostapd_drv_mu_ctrl(hapd, MU_CTRL_UPDATE);
os_free(hapd->iconf->muru_config);
-@@ -4342,15 +4368,14 @@ hostapd_ctrl_iface_set_mu(struct hostapd_data *hapd, char *cmd,
+@@ -4475,15 +4501,14 @@ hostapd_ctrl_iface_set_mu(struct hostapd_data *hapd, char *cmd,
para_fail:
os_free(val);
@@ -123,7 +127,7 @@
{
u8 mu_onoff;
char *pos, *end;
-@@ -4358,14 +4383,35 @@ hostapd_ctrl_iface_get_mu(struct hostapd_data *hapd, char *buf,
+@@ -4491,14 +4516,35 @@ hostapd_ctrl_iface_get_mu(struct hostapd_data *hapd, char *buf,
pos = buf;
end = buf + buflen;
@@ -161,7 +165,7 @@
} else {
wpa_printf(MSG_INFO, "ctrl iface failed to call");
return -1;
-@@ -5488,8 +5534,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -5633,8 +5679,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
reply_size);
} else if (os_strncmp(buf, "SET_MU ", 7) == 0) {
reply_len = hostapd_ctrl_iface_set_mu(hapd, buf + 7, reply, reply_size);
@@ -173,10 +177,10 @@
reply_len = hostapd_ctrl_iface_get_ibf(hapd, reply, reply_size);
} else if (os_strncmp(buf, "DFS_DETECT_MODE ", 16) == 0) {
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index 7e4485cb8..100896c34 100644
+index 9a6a742c1..a98f76eee 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1461,7 +1461,7 @@ static int hostapd_cli_cmd_set_mu(struct wpa_ctrl *ctrl, int argc,
+@@ -1479,7 +1479,7 @@ static int hostapd_cli_cmd_set_mu(struct wpa_ctrl *ctrl, int argc,
static int hostapd_cli_cmd_get_mu(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
@@ -185,11 +189,35 @@
}
static int hostapd_cli_cmd_disable_beacon(struct wpa_ctrl *ctrl, int argc,
+diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
+index 8b98d6170..95100b25c 100644
+--- a/src/ap/ap_config.c
++++ b/src/ap/ap_config.c
+@@ -313,6 +313,7 @@ struct hostapd_config * hostapd_config_defaults(void)
+ conf->ibf_enable = IBF_DEFAULT_ENABLE;
+ conf->amsdu = 1;
+ conf->pp_mode = PP_DISABLE;
++ conf->band_idx = 255;
+
+ hostapd_set_and_check_bw320_offset(conf, 0);
+
+@@ -1631,6 +1632,11 @@ int hostapd_config_check(struct hostapd_config *conf, int full_config)
+ return -1;
+ }
+
++ if (full_config && conf->band_idx == 255) {
++ wpa_printf(MSG_ERROR, "band_idx is required");
++ return -1;
++ }
++
+ for (i = 0; i < conf->num_bss; i++) {
+ if (hostapd_config_check_bss(conf->bss[i], conf, full_config))
+ return -1;
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 1f686550e..3bd8df9ce 100644
+index 413505c59..c61e67403 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1298,6 +1298,7 @@ struct hostapd_config {
+@@ -1351,6 +1351,7 @@ struct hostapd_config {
u8 amsdu;
void *muru_config;
u8 pp_mode;
@@ -198,10 +226,10 @@
enum three_wire_mode {
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index b7896c110..ac7ef00cd 100644
+index 011bb37f8..48c2801da 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1281,7 +1281,7 @@ int hostapd_drv_mu_dump(struct hostapd_data *hapd, u8 *mu_onoff)
+@@ -1310,7 +1310,7 @@ int hostapd_drv_mu_dump(struct hostapd_data *hapd, u8 *mu_onoff)
{
if (!hapd->driver || !hapd->driver->mu_dump)
return 0;
@@ -211,10 +239,10 @@
int hostapd_drv_three_wire_ctrl(struct hostapd_data *hapd)
diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
-index 5531802b8..1e4c3670e 100644
+index 261994b8a..9b054ef43 100644
--- a/src/common/mtk_vendor.h
+++ b/src/common/mtk_vendor.h
-@@ -207,6 +207,7 @@ enum mtk_vendor_attr_mu_ctrl {
+@@ -210,6 +210,7 @@ enum mtk_vendor_attr_mu_ctrl {
* above data structure.
*/
MTK_VENDOR_ATTR_MU_CTRL_STRUCT,
@@ -223,10 +251,10 @@
/* keep last */
NUM_MTK_VENDOR_ATTRS_MU_CTRL,
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 2940650df..10ae48729 100644
+index 8f5d260aa..47f4f56c0 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5241,7 +5241,7 @@ struct wpa_driver_ops {
+@@ -5267,7 +5267,7 @@ struct wpa_driver_ops {
*
*/
int (*mu_ctrl)(void *priv, u8 mode, void *config);
@@ -236,10 +264,10 @@
/**
* beacon_ctrl - ctrl on off for beacon
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 6d300c0c8..17aaa16a8 100644
+index 4b404f0bb..f6080f160 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -14010,7 +14010,8 @@ static int nl80211_mu_ctrl(void *priv, u8 mode, void *config)
+@@ -14035,7 +14035,8 @@ static int nl80211_mu_ctrl(void *priv, u8 mode, void *config)
switch (mode) {
case MU_CTRL_ONOFF:
@@ -249,7 +277,7 @@
goto fail;
break;
case MU_CTRL_UPDATE:
-@@ -14074,7 +14075,7 @@ static int mu_dump_handler(struct nl_msg *msg, void *arg)
+@@ -14099,7 +14100,7 @@ static int mu_dump_handler(struct nl_msg *msg, void *arg)
return 0;
}
@@ -258,7 +286,7 @@
{
struct i802_bss *bss = priv;
struct wpa_driver_nl80211_data *drv = bss->drv;
-@@ -14090,17 +14091,13 @@ static int nl80211_mu_dump(void *priv, u8 *mu_onoff)
+@@ -14115,17 +14116,13 @@ static int nl80211_mu_dump(void *priv, u8 *mu_onoff)
if (!(msg = nl80211_drv_msg(drv, NLM_F_DUMP, NL80211_CMD_VENDOR)) ||
nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_MTK) ||
@@ -280,5 +308,5 @@
ret = send_and_recv_resp(drv, msg, mu_dump_handler, mu_onoff);
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0089-mtk-hostapd-Handle-DFS-radar-detection-in-MLO.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0069-mtk-hostapd-Handle-DFS-radar-detection-in-MLO.patch
similarity index 68%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0089-mtk-hostapd-Handle-DFS-radar-detection-in-MLO.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0069-mtk-hostapd-Handle-DFS-radar-detection-in-MLO.patch
index cbf05f5..8cdcaf5 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0089-mtk-hostapd-Handle-DFS-radar-detection-in-MLO.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0069-mtk-hostapd-Handle-DFS-radar-detection-in-MLO.patch
@@ -1,7 +1,7 @@
-From a0cbcd04400458bf7f4f4086beecbf8db6800c36 Mon Sep 17 00:00:00 2001
+From 8df808e1c82be7ce9b00937bb14a2536824f16d2 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Fri, 19 Jan 2024 14:11:05 +0800
-Subject: [PATCH 089/104] mtk: hostapd: Handle DFS radar detection in MLO
+Subject: [PATCH 069/126] mtk: hostapd: Handle DFS radar detection in MLO
To handle DFS CAC in MLO, we add the following changes:
1. Add link id info to radar detect cmd for the kernel to use the correct link.
@@ -9,25 +9,29 @@
3. Only flush the old stations for the first BSS; otherwise, after DFS CAC
stations would be flushed again.
-Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
-
Add background radar handling
+The logic has changed here, so rebase it.
+Avoid flushing old stations for non-first BSS so that the stations
+can remain connected when non-first BSS is added via link add or it
+completes CAC.
+Also, handle the case when the first BSS requires CAC.
+
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
src/ap/ap_drv_ops.c | 9 +++++++++
- src/ap/hostapd.c | 3 +++
+ src/ap/hostapd.c | 11 ++++++++++-
src/ap/ieee802_11.c | 3 +++
src/drivers/driver_nl80211.c | 18 ++++++++++++++++++
src/drivers/driver_nl80211.h | 1 +
src/drivers/driver_nl80211_event.c | 3 ++-
- 6 files changed, 36 insertions(+), 1 deletion(-)
+ 6 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index ac7ef00cd..9357ce7b6 100644
+index 48c2801da..f51d5be8e 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1012,6 +1012,15 @@ int hostapd_start_dfs_cac(struct hostapd_iface *iface,
+@@ -1041,6 +1041,15 @@ int hostapd_start_dfs_cac(struct hostapd_iface *iface,
return -1;
}
data.radar_background = radar_background;
@@ -44,24 +48,34 @@
res = hapd->driver->start_dfs_cac(hapd->drv_priv, &data);
if (!res) {
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index f8b05de45..8e3f0b281 100644
+index eefd4c5d3..93c164177 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -1371,6 +1371,9 @@ int hostapd_setup_bss(struct hostapd_data *hapd, int first, bool start_beacon)
- if (!hostapd_mld_is_first_bss(hapd))
+@@ -1420,9 +1420,18 @@ int hostapd_setup_bss(struct hostapd_data *hapd, int first, bool start_beacon)
+ u8 if_addr[ETH_ALEN];
+ int flush_old_stations = 1;
+
+- if (!hostapd_mld_is_first_bss(hapd))
++ if (!hostapd_mld_is_first_bss(hapd)) {
++ /* Only flush old stations when setting up the first BSS for the MLD. */
++ flush_old_stations = 0;
wpa_printf(MSG_DEBUG,
"MLD: %s: Setting non-first BSS", __func__);
-+ else
-+ /* Only flush old stations when setting up first BSS for MLD. */
++ } else if (hapd->conf->mld_ap &&
++ hapd->iface->state == HAPD_IFACE_DFS) {
++ /* Also, avoid flushing old STA when the first BSS of the MLD requires CAC. */
+ flush_old_stations = 0;
++ wpa_printf(MSG_DEBUG,
++ "MLD: %s: Setting first BSS after CAC complete", __func__);
++ }
wpa_printf(MSG_DEBUG, "%s(hapd=%p (%s), first=%d)",
__func__, hapd, conf->iface, first);
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index 0f357d786..fe0a5bce4 100644
+index b87fae929..c6676b754 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
-@@ -7852,6 +7852,9 @@ u8 *hostapd_eid_rnr_colocation(struct hostapd_data *hapd, u8 *eid,
+@@ -7910,6 +7910,9 @@ u8 * hostapd_eid_rnr_colocation(struct hostapd_data *hapd, u8 *eid,
!is_6ghz_op_class(iface->conf->op_class))
continue;
@@ -72,10 +86,10 @@
current_len, NULL, false);
}
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 17aaa16a8..ad73b4ac1 100644
+index f6080f160..dec358fba 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -10589,6 +10589,24 @@ static int nl80211_start_radar_detection(void *priv,
+@@ -10587,6 +10587,24 @@ static int nl80211_start_radar_detection(void *priv,
return -1;
}
@@ -113,10 +127,10 @@
u8 addr[ETH_ALEN];
void *ctx;
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
-index 90084356d..03bad4bb3 100644
+index 73582aeb0..7f5a3d892 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
-@@ -1631,7 +1631,8 @@ nl80211_get_link_id_by_freq(struct i802_bss *bss, unsigned int freq)
+@@ -1638,7 +1638,8 @@ nl80211_get_link_id_by_freq(struct i802_bss *bss, unsigned int freq)
unsigned int i;
for_each_link(bss->valid_links, i) {
@@ -127,5 +141,5 @@
}
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0070-mtk-hostapd-add-wds-mlo-support.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0070-mtk-hostapd-add-wds-mlo-support.patch
new file mode 100644
index 0000000..293384f
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0070-mtk-hostapd-add-wds-mlo-support.patch
@@ -0,0 +1,203 @@
+From 89cea0c904dfce8fca45a3d721f2871c32402e05 Mon Sep 17 00:00:00 2001
+From: Peter Chiu <chui-hao.chiu@mediatek.com>
+Date: Tue, 16 Jan 2024 16:22:17 +0800
+Subject: [PATCH 070/126] mtk: hostapd: add wds mlo support
+
+1. Add mld_assoc_sta to get the primary sta_info.
+2. Find hapd according to mld address.
+
+The latest get_hapd_bssid return hapd only if link id is matched.
+However,the hostapd_rx_from_unknown_sta does not have link
+information so it cannot get hapd.
+
+Modify get_hapd_bssid to ignore link id when link id is -1.
+
+Without this patch, wds mode cannot work and the AP would not be
+aware that station is using 4 address.
+
+Transmit correct hapd by i802_bss->ctx to EVENT_RX_FROM_UNKNOWN handler.
+Without this patch, AP cannot setup AP_VLAN interface in mlo + legacy case.
+In mlo + legacy case, if wds null is sent to legacy AP, it cannot get correct
+hapd according drv->ctx because drv->ctx and legacy AP's hapd may not under
+the same hostapd_iface.
+
+Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
+---
+ src/ap/drv_callbacks.c | 7 ++++---
+ src/ap/ieee802_11.c | 8 ++++++++
+ src/ap/sta_info.c | 6 +++++-
+ src/ap/sta_info.h | 1 +
+ src/drivers/driver.h | 3 +++
+ src/drivers/driver_nl80211.c | 14 ++++++++++++++
+ src/drivers/driver_nl80211_event.c | 2 +-
+ 7 files changed, 36 insertions(+), 5 deletions(-)
+
+diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
+index 1fa27bf80..1107fd70e 100644
+--- a/src/ap/drv_callbacks.c
++++ b/src/ap/drv_callbacks.c
+@@ -1798,6 +1798,7 @@ switch_link_scan(struct hostapd_data *hapd, u64 scan_cookie)
+ static struct hostapd_data * get_hapd_bssid(struct hostapd_iface *iface,
+ const u8 *bssid, int link_id)
+ {
++ struct hostapd_data *ret = NULL;
+ size_t i;
+
+ if (bssid == NULL)
+@@ -1820,7 +1821,7 @@ static struct hostapd_data * get_hapd_bssid(struct hostapd_iface *iface,
+ if (ether_addr_equal(bssid, hapd->own_addr) ||
+ (hapd->conf->mld_ap &&
+ ether_addr_equal(bssid, hapd->mld->mld_addr) &&
+- link_id == hapd->mld_link_id))
++ (link_id == hapd->mld_link_id || link_id == -1)))
+ return hapd;
+
+ if (!hapd->conf->mld_ap)
+@@ -1832,13 +1833,13 @@ static struct hostapd_data * get_hapd_bssid(struct hostapd_iface *iface,
+
+ if (ether_addr_equal(bssid, p_hapd->own_addr) ||
+ (ether_addr_equal(bssid, p_hapd->mld->mld_addr) &&
+- link_id == p_hapd->mld_link_id))
++ (link_id == p_hapd->mld_link_id || link_id == -1)))
+ return p_hapd;
+ }
+ #endif /* CONFIG_IEEE80211BE */
+ }
+
+- return NULL;
++ return ret;
+ }
+
+
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index c6676b754..d26b50031 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -3183,6 +3183,7 @@ static void handle_auth(struct hostapd_data *hapd,
+
+ ap_sta_set_mld(sta, true);
+ sta->mld_assoc_link_id = link_id;
++ sta->mld_assoc_sta = sta;
+
+ /*
+ * Set the MLD address as the station address and the
+@@ -4572,6 +4573,7 @@ static int ieee80211_ml_process_link(struct hostapd_data *hapd,
+
+ sta->flags |= origin_sta->flags | WLAN_STA_ASSOC_REQ_OK;
+ sta->mld_assoc_link_id = origin_sta->mld_assoc_link_id;
++ sta->mld_assoc_sta = origin_sta;
+
+ status = __check_assoc_ies(hapd, sta, NULL, 0, &elems, reassoc, true);
+ if (status != WLAN_STATUS_SUCCESS) {
+@@ -7037,6 +7039,12 @@ void ieee802_11_rx_from_unknown(struct hostapd_data *hapd, const u8 *src,
+ struct sta_info *sta;
+
+ sta = ap_get_sta(hapd, src);
++
++#ifdef CONFIG_IEEE80211BE
++ if (sta && sta->mld_info.mld_sta)
++ sta = sta->mld_assoc_sta;
++#endif
++
+ if (sta &&
+ ((sta->flags & WLAN_STA_ASSOC) ||
+ ((sta->flags & WLAN_STA_ASSOC_REQ_OK) && wds))) {
+diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
+index d4f4eb913..ea34d347f 100644
+--- a/src/ap/sta_info.c
++++ b/src/ap/sta_info.c
+@@ -74,6 +74,7 @@ struct sta_info * ap_get_sta(struct hostapd_data *hapd, const u8 *sta)
+ while (s != NULL && os_memcmp(s->addr, sta, 6) != 0)
+ s = s->hnext;
+
++#ifdef CONFIG_IEEE80211BE
+ if (hapd->conf->mld_ap && !s) {
+ u8 link_id;
+
+@@ -84,10 +85,13 @@ struct sta_info * ap_get_sta(struct hostapd_data *hapd, const u8 *sta)
+ continue;
+
+ for (s = h->sta_list; s; s = s->next)
+- if (!os_memcmp(s->setup_link_addr, sta, 6))
++ if ((!os_memcmp(s->setup_link_addr, sta, 6) ||
++ !os_memcmp(s->addr, sta, 6)) &&
++ s->flags & WLAN_STA_ASSOC)
+ return s;
+ }
+ }
++#endif
+
+ return s;
+ }
+diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h
+index 6b88799e2..67b97671a 100644
+--- a/src/ap/sta_info.h
++++ b/src/ap/sta_info.h
+@@ -328,6 +328,7 @@ struct sta_info {
+ #ifdef CONFIG_IEEE80211BE
+ struct mld_info mld_info;
+ u8 mld_assoc_link_id;
++ struct sta_info *mld_assoc_sta;
+ #endif /* CONFIG_IEEE80211BE */
+
+ u16 max_idle_period; /* if nonzero, the granted BSS max idle period in
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index 47f4f56c0..ec00c36e4 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -5366,6 +5366,9 @@ struct wpa_driver_ops {
+ * @pp_mode: Value is defined in enum pp_mode
+ */
+ int (*pp_mode_set)(void *priv, const u8 pp_mode);
++#ifdef CONFIG_IEEE80211BE
++ int (*get_mld_addr)(void *priv, u8 *addr);
++#endif
+ };
+
+ /**
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index dec358fba..8f7215d62 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -15209,6 +15209,17 @@ fail:
+ return -ENOBUFS;
+ }
+
++#ifdef CONFIG_IEEE80211BE
++static int nl80211_get_mld_addr(void *priv, u8 *addr)
++{
++ struct i802_bss *bss = priv;
++
++ os_memcpy(addr, bss->addr, ETH_ALEN);
++
++ return 0;
++}
++#endif
++
+ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+ .name = "nl80211",
+ .desc = "Linux nl80211/cfg80211",
+@@ -15389,4 +15400,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+ .amnt_dump = nl80211_amnt_dump,
+ .background_radar_mode = nl80211_background_radar_mode,
+ .pp_mode_set = nl80211_pp_mode_set,
++#ifdef CONFIG_IEEE80211BE
++ .get_mld_addr = nl80211_get_mld_addr,
++#endif
+ };
+diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
+index 7f5a3d892..07af6be77 100644
+--- a/src/drivers/driver_nl80211_event.c
++++ b/src/drivers/driver_nl80211_event.c
+@@ -2575,7 +2575,7 @@ static void nl80211_spurious_frame(struct i802_bss *bss, struct nlattr **tb,
+ event.rx_from_unknown.addr = nla_data(tb[NL80211_ATTR_MAC]);
+ event.rx_from_unknown.wds = wds;
+
+- wpa_supplicant_event(drv->ctx, EVENT_RX_FROM_UNKNOWN, &event);
++ wpa_supplicant_event(bss->ctx, EVENT_RX_FROM_UNKNOWN, &event);
+ }
+
+
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0093-mtk-hostapd-prevent-getting-non-MLD-STA-for-other-li.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0071-mtk-hostapd-prevent-getting-non-MLD-STA-for-other-li.patch
similarity index 81%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0093-mtk-hostapd-prevent-getting-non-MLD-STA-for-other-li.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0071-mtk-hostapd-prevent-getting-non-MLD-STA-for-other-li.patch
index 0cff032..c62de68 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0093-mtk-hostapd-prevent-getting-non-MLD-STA-for-other-li.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0071-mtk-hostapd-prevent-getting-non-MLD-STA-for-other-li.patch
@@ -1,7 +1,7 @@
-From ce0ccc758fc8a5076ce3476f627b00019cf90ab1 Mon Sep 17 00:00:00 2001
+From f4907a96f2e0494b03c7447ae2f5aac20dab61f8 Mon Sep 17 00:00:00 2001
From: Michael-CY Lee <michael-cy.lee@mediatek.com>
Date: Fri, 1 Mar 2024 16:59:53 +0800
-Subject: [PATCH 093/104] mtk: hostapd: prevent getting non-MLD STA for other
+Subject: [PATCH 071/126] mtk: hostapd: prevent getting non-MLD STA for other
links
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
@@ -10,7 +10,7 @@
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
-index 2b8307a27..9a8510980 100644
+index ea34d347f..44d98d5e0 100644
--- a/src/ap/sta_info.c
+++ b/src/ap/sta_info.c
@@ -87,7 +87,8 @@ struct sta_info * ap_get_sta(struct hostapd_data *hapd, const u8 *sta)
@@ -24,5 +24,5 @@
}
}
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0094-mtk-hostapd-AP-MLD-specify-link-id-for-unicast-DEAUT.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0072-mtk-hostapd-specify-link-id-for-unicast-DEAUTH.patch
similarity index 78%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0094-mtk-hostapd-AP-MLD-specify-link-id-for-unicast-DEAUT.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0072-mtk-hostapd-specify-link-id-for-unicast-DEAUTH.patch
index c276024..1deaede 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0094-mtk-hostapd-AP-MLD-specify-link-id-for-unicast-DEAUT.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0072-mtk-hostapd-specify-link-id-for-unicast-DEAUTH.patch
@@ -1,8 +1,7 @@
-From 8c4eb9b740a9f2ae57e048edbbc4aad1d62734f2 Mon Sep 17 00:00:00 2001
+From f9b54baaa5037a174963b2dc255a16e60a9cade8 Mon Sep 17 00:00:00 2001
From: Michael-CY Lee <michael-cy.lee@mediatek.com>
Date: Tue, 27 Feb 2024 15:04:35 +0800
-Subject: [PATCH 094/104] mtk: hostapd: AP MLD: specify link id for unicast
- DEAUTH
+Subject: [PATCH 072/126] mtk: hostapd: specify link id for unicast DEAUTH
When deauthenticating the STA, hostapd should specifies the setup link
of the target STA so that the TX status of the DEAUTH can be forwarded
@@ -17,10 +16,10 @@
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 9357ce7b6..2c535f24a 100644
+index f51d5be8e..34c2ff211 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -867,7 +867,11 @@ int hostapd_drv_sta_deauth(struct hostapd_data *hapd,
+@@ -896,7 +896,11 @@ int hostapd_drv_sta_deauth(struct hostapd_data *hapd,
if (hapd->conf->mld_ap) {
struct sta_info *sta = ap_get_sta(hapd, addr);
@@ -34,5 +33,5 @@
own_addr = hapd->mld->mld_addr;
}
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0095-mtk-hostapd-using-MLD-addr-as-SA-BSSID-for-broadcast.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0073-mtk-hostapd-using-MLD-addr-as-SA-BSSID-for-broadcast.patch
similarity index 74%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0095-mtk-hostapd-using-MLD-addr-as-SA-BSSID-for-broadcast.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0073-mtk-hostapd-using-MLD-addr-as-SA-BSSID-for-broadcast.patch
index e31a05c..0dd558d 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0095-mtk-hostapd-using-MLD-addr-as-SA-BSSID-for-broadcast.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0073-mtk-hostapd-using-MLD-addr-as-SA-BSSID-for-broadcast.patch
@@ -1,7 +1,7 @@
-From 161c066295847f1c1828f641e789565fe4bacd11 Mon Sep 17 00:00:00 2001
+From 2c8d9fc4050a47913a4e77fc6fad3118a59a2e01 Mon Sep 17 00:00:00 2001
From: Michael-CY Lee <michael-cy.lee@mediatek.com>
Date: Thu, 14 Mar 2024 14:31:28 +0800
-Subject: [PATCH 095/104] mtk: hostapd: using MLD addr as SA/BSSID for
+Subject: [PATCH 073/126] mtk: hostapd: using MLD addr as SA/BSSID for
broadcast DEAUTH
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
@@ -10,10 +10,10 @@
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 2c535f24a..3c1609656 100644
+index 34c2ff211..c7635cae6 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -872,7 +872,7 @@ int hostapd_drv_sta_deauth(struct hostapd_data *hapd,
+@@ -901,7 +901,7 @@ int hostapd_drv_sta_deauth(struct hostapd_data *hapd,
else
link_id = hapd->mld_link_id;
@@ -22,7 +22,7 @@
own_addr = hapd->mld->mld_addr;
}
#endif /* CONFIG_IEEE80211BE */
-@@ -893,7 +893,7 @@ int hostapd_drv_sta_disassoc(struct hostapd_data *hapd,
+@@ -922,7 +922,7 @@ int hostapd_drv_sta_disassoc(struct hostapd_data *hapd,
if (hapd->conf->mld_ap) {
struct sta_info *sta = ap_get_sta(hapd, addr);
@@ -32,5 +32,5 @@
}
#endif /* CONFIG_IEEE80211BE */
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0096-mtk-hostapd-support-vht-bfee-sts-can-be-up-to-0x4.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0074-mtk-hostapd-support-vht-bfee-sts-can-be-up-to-0x4.patch
similarity index 86%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0096-mtk-hostapd-support-vht-bfee-sts-can-be-up-to-0x4.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0074-mtk-hostapd-support-vht-bfee-sts-can-be-up-to-0x4.patch
index f311581..ce90a5d 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0096-mtk-hostapd-support-vht-bfee-sts-can-be-up-to-0x4.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0074-mtk-hostapd-support-vht-bfee-sts-can-be-up-to-0x4.patch
@@ -1,7 +1,7 @@
-From eb9916b7e0226793f14616dc98fda76c4d8337bf Mon Sep 17 00:00:00 2001
+From 7e0e24bc6487a6664b6fa209758d00773ed38a8d Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Tue, 27 Feb 2024 15:32:06 +0800
-Subject: [PATCH 096/104] mtk: hostapd: support vht bfee sts can be up to 0x4
+Subject: [PATCH 074/126] mtk: hostapd: support vht bfee sts can be up to 0x4
Without this commit, the maximum vht bfee sts can only be 0x3. This commit
support to read BF-ANTENNA-5 to set vht bfee sts capability as 4.
@@ -12,7 +12,7 @@
1 file changed, 3 insertions(+)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index ef9bafb28..b9a062193 100644
+index 50d63e259..c1bc344dd 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -1190,6 +1190,9 @@ static int hostapd_config_vht_capab(struct hostapd_config *conf,
@@ -26,5 +26,5 @@
(conf->vht_capab & VHT_CAP_SU_BEAMFORMER_CAPABLE))
conf->vht_capab |= (1 << VHT_CAP_SOUNDING_DIMENSION_OFFSET);
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0097-mtk-hostapd-fix-issue-that-tx-status-handle-with-unm.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0075-mtk-hostapd-fix-issue-that-tx-status-handle-with-unm.patch
similarity index 81%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0097-mtk-hostapd-fix-issue-that-tx-status-handle-with-unm.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0075-mtk-hostapd-fix-issue-that-tx-status-handle-with-unm.patch
index 1afcf3e..f6297dc 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0097-mtk-hostapd-fix-issue-that-tx-status-handle-with-unm.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0075-mtk-hostapd-fix-issue-that-tx-status-handle-with-unm.patch
@@ -1,7 +1,7 @@
-From c1e7c5e556cd372594a789091d2ab65a9d8dd56f Mon Sep 17 00:00:00 2001
+From e9192ac36cdeb2a3d2bfd979161c0016c19e1a5c Mon Sep 17 00:00:00 2001
From: Bo Jiao <Bo.Jiao@mediatek.com>
Date: Thu, 19 Oct 2023 14:08:50 +0800
-Subject: [PATCH 097/104] mtk: hostapd: fix issue that tx status handle with
+Subject: [PATCH 075/126] mtk: hostapd: fix issue that tx status handle with
unmatch hostapd_data.
Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
@@ -11,10 +11,10 @@
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index 688393422..2dd763e63 100644
+index d26b50031..fbe3f582f 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
-@@ -6536,11 +6536,20 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
+@@ -6614,11 +6614,20 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
#ifdef CONFIG_IEEE80211BE
if (ap_sta_is_mld(hapd, sta) &&
hapd->mld_link_id != sta->mld_assoc_link_id) {
@@ -37,10 +37,10 @@
#endif /* CONFIG_IEEE80211BE */
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
-index 03bad4bb3..885fc4c9e 100644
+index 07af6be77..635401564 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
-@@ -1374,7 +1374,7 @@ static void mlme_event_mgmt(struct i802_bss *bss,
+@@ -1381,7 +1381,7 @@ static void mlme_event_mgmt(struct i802_bss *bss,
event.rx_mgmt.ctx = bss->ctx;
event.rx_mgmt.link_id = link_id;
@@ -50,5 +50,5 @@
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0098-mtk-hostapd-add-connac3-csi-control-interface.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0076-mtk-hostapd-add-connac3-csi-control-interface.patch
similarity index 89%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0098-mtk-hostapd-add-connac3-csi-control-interface.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0076-mtk-hostapd-add-connac3-csi-control-interface.patch
index 9c4c4e5..f276767 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0098-mtk-hostapd-add-connac3-csi-control-interface.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0076-mtk-hostapd-add-connac3-csi-control-interface.patch
@@ -1,7 +1,7 @@
-From c125d2615df25bd9a5a4801abfbcc91f21482e02 Mon Sep 17 00:00:00 2001
+From b0f18aac90c7144db84f880aedb5aeaba3f37305 Mon Sep 17 00:00:00 2001
From: mtk20656 <chank.chen@mediatek.com>
Date: Tue, 6 Feb 2024 15:46:05 +0800
-Subject: [PATCH 098/104] mtk: hostapd: add connac3 csi control interface
+Subject: [PATCH 076/126] mtk: hostapd: add connac3 csi control interface
1. add hostapd_cli interface
2. add csi set/dump flow
@@ -13,18 +13,18 @@
hostapd/hostapd_cli.c | 16 ++
src/ap/ap_drv_ops.c | 13 ++
src/ap/ap_drv_ops.h | 2 +
- src/common/mtk_vendor.h | 31 +++-
- src/drivers/driver.h | 16 ++
- src/drivers/driver_nl80211.c | 235 ++++++++++++++++++++++++++++++
+ src/common/mtk_vendor.h | 33 ++++-
+ src/drivers/driver.h | 18 +++
+ src/drivers/driver_nl80211.c | 239 ++++++++++++++++++++++++++++++
src/drivers/driver_nl80211.h | 1 +
src/drivers/driver_nl80211_capa.c | 3 +
- 9 files changed, 503 insertions(+), 7 deletions(-)
+ 9 files changed, 511 insertions(+), 7 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index f0c990314..b5f6431bf 100644
+index 76fd25d8b..9bd8a46b3 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -4925,6 +4925,193 @@ hostapd_ctrl_iface_disable_beacon(struct hostapd_data *hapd, char *value,
+@@ -5063,6 +5063,193 @@ hostapd_ctrl_iface_disable_beacon(struct hostapd_data *hapd, char *value,
}
@@ -218,7 +218,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
int reply_size,
-@@ -5578,6 +5765,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -5724,6 +5911,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
} else if (os_strncmp(buf, "NO_BEACON ", 10) == 0) {
reply_len = hostapd_ctrl_iface_disable_beacon(hapd, buf + 10, reply,
reply_size);
@@ -232,10 +232,10 @@
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index acfa3b1d1..81b74d6de 100644
+index a98f76eee..f54fa9997 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1719,6 +1719,18 @@ static int hostapd_cli_cmd_dump_amnt(struct wpa_ctrl *ctrl, int argc,
+@@ -1744,6 +1744,18 @@ static int hostapd_cli_cmd_dump_amnt(struct wpa_ctrl *ctrl, int argc,
return hostapd_cli_cmd(ctrl, "DUMP_AMNT", 1, argc, argv);
}
@@ -254,7 +254,7 @@
struct hostapd_cli_cmd {
const char *cmd;
int (*handler)(struct wpa_ctrl *ctrl, int argc, char *argv[]);
-@@ -1960,6 +1972,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1992,6 +2004,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
" = Set Station index and mac to monitor"},
{ "dump_amnt", hostapd_cli_cmd_dump_amnt, NULL,
" = Dump RSSI of monitoring Station"},
@@ -266,10 +266,10 @@
};
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 3c1609656..cb782fa31 100644
+index c7635cae6..a26a3f45d 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1409,3 +1409,16 @@ int hostapd_drv_beacon_ctrl(struct hostapd_data *hapd, u8 beacon_mode)
+@@ -1445,3 +1445,16 @@ int hostapd_drv_beacon_ctrl(struct hostapd_data *hapd, u8 beacon_mode)
return hapd->driver->beacon_ctrl(hapd->drv_priv, beacon_mode);
}
@@ -277,20 +277,20 @@
+{
+ if (!hapd->driver || !hapd->driver->csi_set)
+ return 0;
-+ return hapd->driver->csi_set(hapd->drv_priv, mode, cfg, v1, v2, mac);
++ return hapd->driver->csi_set(hapd->drv_priv, hapd->iconf->band_idx, mode, cfg, v1, v2, mac);
+}
+
+int hostapd_drv_csi_dump(struct hostapd_data *hapd, void *dump_buf)
+{
+ if (!hapd->driver || !hapd->driver->csi_dump)
+ return 0;
-+ return hapd->driver->csi_dump(hapd->drv_priv, dump_buf);
++ return hapd->driver->csi_dump(hapd->drv_priv, hapd->iconf->band_idx, dump_buf);
+}
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index 5830705a3..7abc58377 100644
+index 8c783610c..9f2e86a9b 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -171,6 +171,8 @@ int hostapd_drv_amnt_dump(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_dump_
+@@ -174,6 +174,8 @@ int hostapd_drv_amnt_dump(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_dump_
int hostapd_drv_background_radar_mode(struct hostapd_data *hapd);
int hostapd_drv_pp_mode_set(struct hostapd_data *hapd);
int hostapd_drv_beacon_ctrl(struct hostapd_data *hapd, u8 beacon_mode);
@@ -300,10 +300,10 @@
#include "drivers/driver.h"
diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
-index 1e4c3670e..c290e72a7 100644
+index 9b054ef43..ce3a2ad9a 100644
--- a/src/common/mtk_vendor.h
+++ b/src/common/mtk_vendor.h
-@@ -73,7 +73,6 @@ enum mtk_vendor_attr_csi_ctrl {
+@@ -73,12 +73,13 @@ enum mtk_vendor_attr_csi_ctrl {
MTK_VENDOR_ATTR_CSI_CTRL_CFG_VAL1,
MTK_VENDOR_ATTR_CSI_CTRL_CFG_VAL2,
MTK_VENDOR_ATTR_CSI_CTRL_MAC_ADDR,
@@ -311,7 +311,14 @@
MTK_VENDOR_ATTR_CSI_CTRL_DUMP_NUM,
-@@ -96,6 +95,7 @@ enum mtk_vendor_attr_csi_data {
+ MTK_VENDOR_ATTR_CSI_CTRL_DATA,
+
++ MTK_VENDOR_ATTR_CSI_CTRL_BAND_IDX,
++
+ /* keep last */
+ NUM_MTK_VENDOR_ATTRS_CSI_CTRL,
+ MTK_VENDOR_ATTR_CSI_CTRL_MAX =
+@@ -96,6 +97,7 @@ enum mtk_vendor_attr_csi_data {
MTK_VENDOR_ATTR_CSI_DATA_BW,
MTK_VENDOR_ATTR_CSI_DATA_CH_IDX,
MTK_VENDOR_ATTR_CSI_DATA_TA,
@@ -319,7 +326,7 @@
MTK_VENDOR_ATTR_CSI_DATA_I,
MTK_VENDOR_ATTR_CSI_DATA_Q,
MTK_VENDOR_ATTR_CSI_DATA_INFO,
-@@ -106,7 +106,7 @@ enum mtk_vendor_attr_csi_data {
+@@ -106,7 +108,7 @@ enum mtk_vendor_attr_csi_data {
MTK_VENDOR_ATTR_CSI_DATA_TX_ANT,
MTK_VENDOR_ATTR_CSI_DATA_RX_ANT,
MTK_VENDOR_ATTR_CSI_DATA_MODE,
@@ -328,7 +335,7 @@
/* keep last */
NUM_MTK_VENDOR_ATTRS_CSI_DATA,
-@@ -281,23 +281,40 @@ enum mtk_vendor_attr_beacon_ctrl {
+@@ -284,23 +286,40 @@ enum mtk_vendor_attr_beacon_ctrl {
NUM_MTK_VENDOR_ATTRS_BEACON_CTRL - 1
};
@@ -375,41 +382,44 @@
#define AIR_MONITOR_MAX_ENTRY 16
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index ba61f5842..7efb5e342 100644
+index ec00c36e4..48cb93cfd 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5342,6 +5342,22 @@ struct wpa_driver_ops {
+@@ -5369,6 +5369,24 @@ struct wpa_driver_ops {
#ifdef CONFIG_IEEE80211BE
int (*get_mld_addr)(void *priv, u8 *addr);
#endif
+ /**
+ * csi_set - Set csi related mode and parameter
+ * @priv: Private driver interface data
++ * @band_idx: band idx
+ * @mode: Csi mode parameter
+ * @cfg: Csi config parameter
+ * @v1: Value1
+ * @v2: Value2
+ * @mac: Station mac for station filter
+ */
-+ int (*csi_set)(void *priv, u8 mode, u8 cfg, u8 v1, u32 v2, u8 *mac);
++ int (*csi_set)(void *priv, u8 band_idx, u8 mode, u8 cfg, u8 v1, u32 v2, u8 *mac);
+ /**
+ * csi_dump - Dump csi data to json file
+ * @priv: Private driver interface data
++ * @band_idx: band idx
+ * @dump_buf: Dump_struct that store csi data and related info
+ */
-+ int (*csi_dump)(void *priv, void *dump_buf);
++ int (*csi_dump)(void *priv, u8 band_idx, void *dump_buf);
};
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index df4a7ec41..39b45ef4b 100644
+index 8f7215d62..afb068091 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -161,6 +161,35 @@ pp_ctrl_policy[NUM_MTK_VENDOR_ATTRS_PP_CTRL] = {
+@@ -161,6 +161,36 @@ pp_ctrl_policy[NUM_MTK_VENDOR_ATTRS_PP_CTRL] = {
[MTK_VENDOR_ATTR_PP_MODE] = { .type = NLA_U8 },
};
+static struct nla_policy csi_ctrl_policy[NUM_MTK_VENDOR_ATTRS_CSI_CTRL] = {
++ [MTK_VENDOR_ATTR_CSI_CTRL_BAND_IDX] = { .type = NLA_U8 },
+ [MTK_VENDOR_ATTR_CSI_CTRL_CFG] = { .type = NLA_NESTED },
+ [MTK_VENDOR_ATTR_CSI_CTRL_CFG_MODE] = { .type = NLA_U8 },
+ [MTK_VENDOR_ATTR_CSI_CTRL_CFG_TYPE] = { .type = NLA_U8 },
@@ -441,12 +451,12 @@
static struct nl_sock * nl_create_handle(struct nl_cb *cb, const char *dbg)
{
struct nl_sock *handle;
-@@ -15192,6 +15221,210 @@ static int nl80211_get_mld_addr(void *priv, u8 *addr)
+@@ -15220,6 +15250,213 @@ static int nl80211_get_mld_addr(void *priv, u8 *addr)
}
#endif
+static int
-+nl80211_csi_set(void *priv, u8 mode, u8 cfg, u8 v1, u32 v2, u8 *mac)
++nl80211_csi_set(void *priv, u8 band_idx, u8 mode, u8 cfg, u8 v1, u32 v2, u8 *mac)
+{
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
@@ -474,6 +484,8 @@
+ if (!data)
+ goto fail;
+
++ nla_put_u8(msg, MTK_VENDOR_ATTR_CSI_CTRL_BAND_IDX, band_idx);
++
+ tb1 = nla_nest_start(msg, MTK_VENDOR_ATTR_CSI_CTRL_CFG | NLA_F_NESTED);
+ if (!tb1)
+ goto fail;
@@ -598,7 +610,7 @@
+}
+
+static int
-+nl80211_csi_dump(void *priv, void *dump_buf)
++nl80211_csi_dump(void *priv, u8 band_idx, void *dump_buf)
+{
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
@@ -635,6 +647,7 @@
+ if (!data)
+ goto fail;
+
++ nla_put_u8(msg, MTK_VENDOR_ATTR_CSI_CTRL_BAND_IDX, band_idx);
+ nla_put_u16(msg, MTK_VENDOR_ATTR_CSI_CTRL_DUMP_NUM, CSI_DUMP_PER_NUM);
+
+ nla_nest_end(msg, data);
@@ -652,7 +665,7 @@
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211",
.desc = "Linux nl80211/cfg80211",
-@@ -15375,4 +15608,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -15403,4 +15640,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
#ifdef CONFIG_IEEE80211BE
.get_mld_addr = nl80211_get_mld_addr,
#endif
@@ -672,7 +685,7 @@
u32 ignore_next_local_disconnect;
u32 ignore_next_local_deauth;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index f3e3d52e2..8688b849f 100644
+index 30f89b687..5a53700d1 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1173,6 +1173,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
@@ -686,5 +699,5 @@
}
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0077-Revert-ACS-upstream-changes.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0077-Revert-ACS-upstream-changes.patch
deleted file mode 100644
index 16f32cf..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0077-Revert-ACS-upstream-changes.patch
+++ /dev/null
@@ -1,398 +0,0 @@
-From 5a471a9025d9bf2a871339f5306e5c9050357703 Mon Sep 17 00:00:00 2001
-From: Michael-CY Lee <michael-cy.lee@mediatek.com>
-Date: Mon, 29 Jan 2024 10:26:53 +0800
-Subject: [PATCH 077/104] Revert ACS upstream changes
-
-- 348c047af ACS: More consistent checking of the best channel pointer
-- 98f3bd26d ACS: Extend the 320 MHz support
-- 733de8568 ACS: Fix not selecting the best channel in the segment
-- dc57ede01 tests: Full validation of ACS selecting HT40- channel
-- 4881accbb ACS: Add HT40- support in the 2.4 GHz band
-- 29f38ebcf ACS: Check whether iface->current_mode is NULL before use
-- 6f014c0d0 ACS: Add 320 MHz support for EHT
-
-Note that "e6f2494c3 hostapd: Add eht_bw320_offset configuration option"
-is not reverted due to conflict.
----
- src/ap/acs.c | 160 +++++++++----------------------------
- tests/hwsim/test_ap_acs.py | 19 ++---
- 2 files changed, 41 insertions(+), 138 deletions(-)
-
-diff --git a/src/ap/acs.c b/src/ap/acs.c
-index cb4db7147..cfa4a7d27 100644
---- a/src/ap/acs.c
-+++ b/src/ap/acs.c
-@@ -245,8 +245,6 @@ enum bw_type {
- ACS_BW40,
- ACS_BW80,
- ACS_BW160,
-- ACS_BW320_1,
-- ACS_BW320_2,
- };
-
- struct bw_item {
-@@ -288,20 +286,10 @@ static const struct bw_item bw_160[] = {
- { 6435, 6575, 111 }, { 6595, 6735, 143 },
- { 6755, 6895, 175 }, { 6915, 7055, 207 }, { -1, -1, -1 }
- };
--static const struct bw_item bw_320_1[] = {
-- { 5955, 6255, 31 }, { 6275, 6575, 95 }, { 6595, 6895, 159 },
-- { -1, -1, -1 }
--};
--static const struct bw_item bw_320_2[] = {
-- { 6115, 6415, 63 }, { 6435, 6735, 127 }, { 6755, 7055, 191 },
-- { -1, -1, -1 }
--};
- static const struct bw_item *bw_desc[] = {
- [ACS_BW40] = bw_40,
- [ACS_BW80] = bw_80,
- [ACS_BW160] = bw_160,
-- [ACS_BW320_1] = bw_320_1,
-- [ACS_BW320_2] = bw_320_2,
- };
-
-
-@@ -773,42 +761,6 @@ static void acs_update_puncturing_bitmap(struct hostapd_iface *iface,
- #endif /* CONFIG_IEEE80211BE */
-
-
--static bool
--acs_usable_bw320_chan(struct hostapd_iface *iface,
-- struct hostapd_channel_data *chan, int *bw320_offset)
--{
-- const char *bw320_str[] = { "320 MHz", "320 MHz-1", "320 MHz-2" };
-- int conf_bw320_offset = hostapd_get_bw320_offset(iface->conf);
--
-- *bw320_offset = 0;
-- switch (conf_bw320_offset) {
-- case 1:
-- if (acs_usable_bw_chan(chan, ACS_BW320_1))
-- *bw320_offset = 1;
-- break;
-- case 2:
-- if (acs_usable_bw_chan(chan, ACS_BW320_2))
-- *bw320_offset = 2;
-- break;
-- case 0:
-- default:
-- conf_bw320_offset = 0;
-- if (acs_usable_bw_chan(chan, ACS_BW320_1))
-- *bw320_offset = 1;
-- else if (acs_usable_bw_chan(chan, ACS_BW320_2))
-- *bw320_offset = 2;
-- break;
-- }
--
-- if (!*bw320_offset)
-- wpa_printf(MSG_DEBUG,
-- "ACS: Channel %d: not allowed as primary channel for %s bandwidth",
-- chan->chan, bw320_str[conf_bw320_offset]);
--
-- return *bw320_offset != 0;
--}
--
--
- static void
- acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- struct hostapd_hw_modes *mode,
-@@ -820,18 +772,14 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- struct hostapd_channel_data *chan, *adj_chan = NULL, *best;
- long double factor;
- int i, j;
-- int bw320_offset = 0, ideal_bw320_offset = 0;
- unsigned int k;
-- int secondary_channel = 1, freq_offset;
--
-- if (is_24ghz_mode(mode->mode))
-- secondary_channel = iface->conf->secondary_channel;
-
- for (i = 0; i < mode->num_channels; i++) {
-- double total_weight = 0;
-+ double total_weight;
- struct acs_bias *bias, tmp_bias;
-+ bool update_best = true;
-
-- chan = &mode->channels[i];
-+ best = chan = &mode->channels[i];
-
- /* Since in the current ACS implementation the first channel is
- * always a primary channel, skip channels not available as
-@@ -863,7 +811,7 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- iface->conf->country[2] == 0x4f)
- continue;
-
-- if (!chan_bw_allowed(chan, bw, secondary_channel != -1, 1)) {
-+ if (!chan_bw_allowed(chan, bw, 1, 1)) {
- wpa_printf(MSG_DEBUG,
- "ACS: Channel %d: BW %u is not supported",
- chan->chan, bw);
-@@ -884,8 +832,7 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- }
-
- if (mode->mode == HOSTAPD_MODE_IEEE80211A &&
-- (iface->conf->ieee80211ac || iface->conf->ieee80211ax ||
-- iface->conf->ieee80211be)) {
-+ (iface->conf->ieee80211ac || iface->conf->ieee80211ax)) {
- if (hostapd_get_oper_chwidth(iface->conf) ==
- CONF_OPER_CHWIDTH_80MHZ &&
- !acs_usable_bw_chan(chan, ACS_BW80)) {
-@@ -905,25 +852,13 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- }
- }
-
-- if (mode->mode == HOSTAPD_MODE_IEEE80211A &&
-- iface->conf->ieee80211be) {
-- if (hostapd_get_oper_chwidth(iface->conf) ==
-- CONF_OPER_CHWIDTH_320MHZ &&
-- !acs_usable_bw320_chan(iface, chan, &bw320_offset))
-- continue;
-- }
--
- factor = 0;
-- best = NULL;
-- if (acs_usable_chan(chan)) {
-+ if (acs_usable_chan(chan))
- factor = chan->interference_factor;
-- total_weight = 1;
-- best = chan;
-- }
-+ total_weight = 1;
-
- for (j = 1; j < n_chans; j++) {
-- adj_chan = acs_find_chan(iface, chan->freq +
-- j * secondary_channel * 20);
-+ adj_chan = acs_find_chan(iface, chan->freq + (j * 20));
- if (!adj_chan)
- break;
-
-@@ -934,14 +869,16 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- break;
- }
-
-- if (!acs_usable_chan(adj_chan))
-- continue;
--
-- factor += adj_chan->interference_factor;
-- total_weight += 1;
-+ if (acs_usable_chan(adj_chan)) {
-+ factor += adj_chan->interference_factor;
-+ total_weight += 1;
-+ } else {
-+ update_best = false;
-+ }
-
- /* find the best channel in this segment */
-- if (!best || adj_chan->interference_factor <
-+ if (update_best &&
-+ adj_chan->interference_factor <
- best->interference_factor)
- best = adj_chan;
- }
-@@ -954,9 +891,8 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
-
- /* If the AP is in the 5 GHz or 6 GHz band, lets prefer a less
- * crowded primary channel if one was found in the segment */
-- if (iface->current_mode &&
-- iface->current_mode->mode == HOSTAPD_MODE_IEEE80211A &&
-- best && chan != best) {
-+ if (iface->current_mode->mode == HOSTAPD_MODE_IEEE80211A &&
-+ chan != best) {
- wpa_printf(MSG_DEBUG,
- "ACS: promoting channel %d over %d (less interference %Lg/%Lg)",
- best->chan, chan->chan,
-@@ -969,9 +905,8 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- * channel interference factor. */
- if (is_24ghz_mode(mode->mode)) {
- for (j = 0; j < n_chans; j++) {
-- freq_offset = j * 20 * secondary_channel;
- adj_chan = acs_find_chan(iface, chan->freq +
-- freq_offset - 5);
-+ (j * 20) - 5);
- if (adj_chan && acs_usable_chan(adj_chan)) {
- factor += ACS_ADJ_WEIGHT *
- adj_chan->interference_factor;
-@@ -979,7 +914,7 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- }
-
- adj_chan = acs_find_chan(iface, chan->freq +
-- freq_offset - 10);
-+ (j * 20) - 10);
- if (adj_chan && acs_usable_chan(adj_chan)) {
- factor += ACS_NEXT_ADJ_WEIGHT *
- adj_chan->interference_factor;
-@@ -987,7 +922,7 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- }
-
- adj_chan = acs_find_chan(iface, chan->freq +
-- freq_offset + 5);
-+ (j * 20) + 5);
- if (adj_chan && acs_usable_chan(adj_chan)) {
- factor += ACS_ADJ_WEIGHT *
- adj_chan->interference_factor;
-@@ -995,7 +930,7 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- }
-
- adj_chan = acs_find_chan(iface, chan->freq +
-- freq_offset + 10);
-+ (j * 20) + 10);
- if (adj_chan && acs_usable_chan(adj_chan)) {
- factor += ACS_NEXT_ADJ_WEIGHT *
- adj_chan->interference_factor;
-@@ -1004,9 +939,6 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- }
- }
-
-- if (total_weight == 0)
-- continue;
--
- factor /= total_weight;
-
- bias = NULL;
-@@ -1044,7 +976,6 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
-
- *ideal_factor = factor;
- *ideal_chan = chan;
-- ideal_bw320_offset = bw320_offset;
-
- #ifdef CONFIG_IEEE80211BE
- if (iface->conf->ieee80211be)
-@@ -1055,13 +986,9 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- }
-
- /* This channel would at least be usable */
-- if (!(*rand_chan)) {
-+ if (!(*rand_chan))
- *rand_chan = chan;
-- ideal_bw320_offset = bw320_offset;
-- }
- }
--
-- hostapd_set_and_check_bw320_offset(iface->conf, ideal_bw320_offset);
- }
-
-
-@@ -1088,12 +1015,19 @@ acs_find_ideal_chan(struct hostapd_iface *iface)
- goto bw_selected;
- }
-
-+ /* TODO: HT40- support */
-+
-+ if (iface->conf->ieee80211n &&
-+ iface->conf->secondary_channel == -1) {
-+ wpa_printf(MSG_ERROR, "ACS: HT40- is not supported yet. Please try HT40+");
-+ return NULL;
-+ }
-+
- if (iface->conf->ieee80211n &&
- iface->conf->secondary_channel)
- n_chans = 2;
-
-- if (iface->conf->ieee80211ac || iface->conf->ieee80211ax ||
-- iface->conf->ieee80211be) {
-+ if (iface->conf->ieee80211ac || iface->conf->ieee80211ax) {
- switch (hostapd_get_oper_chwidth(iface->conf)) {
- case CONF_OPER_CHWIDTH_80MHZ:
- n_chans = 4;
-@@ -1101,9 +1035,6 @@ acs_find_ideal_chan(struct hostapd_iface *iface)
- case CONF_OPER_CHWIDTH_160MHZ:
- n_chans = 8;
- break;
-- case CONF_OPER_CHWIDTH_320MHZ:
-- n_chans = 16;
-- break;
- default:
- break;
- }
-@@ -1153,8 +1084,7 @@ static void acs_adjust_secondary(struct hostapd_iface *iface)
- acs_find_mode(iface, iface->freq) != HOSTAPD_MODE_IEEE80211A)
- return;
-
-- wpa_printf(MSG_DEBUG,
-- "ACS: Adjusting HT/VHT/HE/EHT secondary frequency");
-+ wpa_printf(MSG_DEBUG, "ACS: Adjusting HT/VHT/HE secondary frequency");
-
- for (i = 0; bw_desc[ACS_BW40][i].first != -1; i++) {
- if (iface->freq == bw_desc[ACS_BW40][i].first)
-@@ -1169,7 +1099,7 @@ static void acs_adjust_center_freq(struct hostapd_iface *iface)
- {
- int center;
-
-- wpa_printf(MSG_DEBUG, "ACS: Adjusting center frequency");
-+ wpa_printf(MSG_DEBUG, "ACS: Adjusting VHT center frequency");
-
- switch (hostapd_get_oper_chwidth(iface->conf)) {
- case CONF_OPER_CHWIDTH_USE_HT:
-@@ -1187,29 +1117,12 @@ static void acs_adjust_center_freq(struct hostapd_iface *iface)
- break;
- case CONF_OPER_CHWIDTH_160MHZ:
- center = acs_get_bw_center_chan(iface->freq, ACS_BW160);
-- break;
-- case CONF_OPER_CHWIDTH_320MHZ:
-- switch (hostapd_get_bw320_offset(iface->conf)) {
-- case 1:
-- center = acs_get_bw_center_chan(iface->freq,
-- ACS_BW320_1);
-- break;
-- case 2:
-- center = acs_get_bw_center_chan(iface->freq,
-- ACS_BW320_2);
-- break;
-- default:
-- wpa_printf(MSG_INFO,
-- "ACS: BW320 offset is not selected");
-- return;
-- }
--
- break;
- default:
- /* TODO: How can this be calculated? Adjust
- * acs_find_ideal_chan() */
- wpa_printf(MSG_INFO,
-- "ACS: Only VHT20/40/80/160/320 is supported now");
-+ "ACS: Only VHT20/40/80/160 is supported now");
- return;
- }
-
-@@ -1272,8 +1185,7 @@ static void acs_study(struct hostapd_iface *iface)
- iface->conf->punct_bitmap = ideal_chan->punct_bitmap;
- #endif /* CONFIG_IEEE80211BE */
-
-- if (iface->conf->ieee80211ac || iface->conf->ieee80211ax ||
-- iface->conf->ieee80211be) {
-+ if (iface->conf->ieee80211ac || iface->conf->ieee80211ax) {
- acs_adjust_secondary(iface);
- acs_adjust_center_freq(iface);
- }
-diff --git a/tests/hwsim/test_ap_acs.py b/tests/hwsim/test_ap_acs.py
-index 001a5d4fd..e1359b6eb 100644
---- a/tests/hwsim/test_ap_acs.py
-+++ b/tests/hwsim/test_ap_acs.py
-@@ -205,20 +205,11 @@ def test_ap_acs_40mhz_minus(dev, apdev):
- params['acs_num_scans'] = '1'
- params['chanlist'] = '1 11'
- hapd = hostapd.add_ap(apdev[0], params, wait_enabled=False)
-- wait_acs(hapd)
--
-- freq = hapd.get_status_field("freq")
-- if int(freq) < 2400:
-- raise Exception("Unexpected frequency")
-- sec = hapd.get_status_field("secondary_channel")
-- if int(sec) != -1:
-- raise Exception("Unexpected secondary_channel: " + sec)
--
-- dev[0].connect("test-acs", psk="12345678", scan_freq=freq)
-- sig = dev[0].request("SIGNAL_POLL").splitlines()
-- logger.info("SIGNAL_POLL: " + str(sig))
-- if "WIDTH=40 MHz" not in sig:
-- raise Exception("Station did not report 40 MHz bandwidth")
-+ ev = hapd.wait_event(["AP-ENABLED", "AP-DISABLED"], timeout=10)
-+ if not ev:
-+ raise Exception("ACS start timed out")
-+ # HT40- is not currently supported in hostapd ACS, so do not try to connect
-+ # or verify that this operation succeeded.
-
- def test_ap_acs_5ghz(dev, apdev):
- """Automatic channel selection on 5 GHz"""
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0101-mtk-hostapd-MLD-hostapd-add-support-for-basic-MLD-Ex.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0077-mtk-hostapd-add-support-for-basic-MLD-Extender.patch
similarity index 82%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0101-mtk-hostapd-MLD-hostapd-add-support-for-basic-MLD-Ex.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0077-mtk-hostapd-add-support-for-basic-MLD-Extender.patch
index 08814ed..12d2f11 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0101-mtk-hostapd-MLD-hostapd-add-support-for-basic-MLD-Ex.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0077-mtk-hostapd-add-support-for-basic-MLD-Extender.patch
@@ -1,8 +1,7 @@
-From 0cc6f925c0a97da331f41462a07c4ae4b6698409 Mon Sep 17 00:00:00 2001
+From 0a10a7b41777ea926967d603bd4e14f9bca43bca Mon Sep 17 00:00:00 2001
From: Michael-CY Lee <michael-cy.lee@mediatek.com>
Date: Tue, 2 Apr 2024 15:36:29 +0800
-Subject: [PATCH 101/104] mtk: hostapd: MLD: hostapd: add support for basic MLD
- Extender
+Subject: [PATCH 077/126] mtk: hostapd: add support for basic MLD Extender
Add basic MLD Extender support, including
1. Extender STA stops all Extender AP's links before scaning.
@@ -12,28 +11,48 @@
Advanced support includes BW cynchronization and channel switch.
+Add a check for band_idx, if the iface has different band_idx from the
+one wpa_s provided, this iface is not the target.
+
+Also add a log for switching iface.
+
+Legacy AP interfaces that sharing the same hostapd_iface with the target
+hapd should also be disabled.
+
+If parsing 'band_idx' fails, iface starting only works for current
+iface.
+
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
---
- src/ap/ucode.c | 52 ++++++++++++++++++++++++++++++++++++++----
- src/utils/ucode.c | 4 +++-
- wpa_supplicant/ucode.c | 45 +++++++++++++++++++++++++++++-------
- 3 files changed, 88 insertions(+), 13 deletions(-)
+ src/ap/ucode.c | 60 ++++++++++++++++++++++++++++++++++++++----
+ src/utils/ucode.c | 4 ++-
+ wpa_supplicant/ucode.c | 45 +++++++++++++++++++++++++------
+ 3 files changed, 95 insertions(+), 14 deletions(-)
diff --git a/src/ap/ucode.c b/src/ap/ucode.c
-index 98b2a3bf2..2642e87c7 100644
+index 8c3212f6f..68f76dbe5 100644
--- a/src/ap/ucode.c
+++ b/src/ap/ucode.c
-@@ -487,14 +487,16 @@ static uc_value_t *
+@@ -9,6 +9,7 @@
+ #include "ap_drv_ops.h"
+ #include "dfs.h"
+ #include "acs.h"
++#include "ieee802_11.h"
+ #include <libubox/uloop.h>
+
+ static uc_resource_type_t *global_type, *bss_type, *iface_type;
+@@ -491,14 +492,16 @@ static uc_value_t *
uc_hostapd_iface_stop(uc_vm_t *vm, size_t nargs)
{
struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface");
+- int i;
+-
+- wpa_printf(MSG_INFO, "ucode: mtk: stop iface for %s in state %s\n",
+- iface->phy, hostapd_state_text(iface->state));
+ struct hostapd_data *first_hapd;
+ struct hostapd_bss_config *conf;
- int i;
++ int i, j;
-- wpa_printf(MSG_INFO, "ucode: mtk: stop iface for %s in state %s\n",
-- iface->phy, hostapd_state_text(iface->state));
--
if (!iface)
return NULL;
@@ -43,7 +62,7 @@
if (iface->state != HAPD_IFACE_ENABLED)
uc_hostapd_disable_iface(iface);
-@@ -505,6 +507,32 @@ uc_hostapd_iface_stop(uc_vm_t *vm, size_t nargs)
+@@ -509,6 +512,34 @@ uc_hostapd_iface_stop(uc_vm_t *vm, size_t nargs)
hapd->beacon_set_done = 0;
}
@@ -67,8 +86,10 @@
+ }
+
+ if (hostapd_is_ml_partner(first_hapd, h_hapd)) {
-+ hostapd_drv_stop_ap(h_hapd);
-+ h_hapd->beacon_set_done = 0;
++ for (j = 0; j < h->num_bss; j++) {
++ hostapd_drv_stop_ap(h->bss[j]);
++ h->bss[j]->beacon_set_done = 0;
++ }
+ }
+ }
+#endif /* CONFIG_IEEE80211BE */
@@ -76,7 +97,7 @@
return NULL;
}
-@@ -512,11 +540,12 @@ static uc_value_t *
+@@ -516,11 +547,12 @@ static uc_value_t *
uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs)
{
struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface");
@@ -90,23 +111,26 @@
wpa_printf(MSG_INFO, "ucode: mtk: start iface for %s in state %s\n",
iface->phy, hostapd_state_text(iface->state));
-@@ -532,6 +561,21 @@ uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs)
+@@ -536,6 +568,24 @@ uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs)
if (ucv_type(info) != UC_OBJECT)
return NULL;
+ intval = ucv_int64_get(ucv_object_get(info, "band_idx", NULL));
-+ if (!errno)
-+ band_idx = intval;
++ band_idx = errno ? iface->conf->band_idx : intval;
+
+#ifdef CONFIG_IEEE80211BE
+ if (hostapd_is_mld_ap(iface->bss[0])) {
+ for_each_mld_link(tmp_hapd, iface->bss[0]) {
+ if (band_idx == tmp_hapd->iconf->band_idx) {
++ wpa_printf(MSG_INFO, "ucode: mtk: MLD: switch to iface with band_idx %d \n", band_idx);
+ iface = tmp_hapd->iface;
+ break;
+ }
+ }
+ }
++
++ if (band_idx != iface->bss[0]->iconf->band_idx)
++ return NULL;
+#endif /* CONFIG_IEEE80211BE */
+
#define UPDATE_VAL(field, name) \
@@ -243,5 +267,5 @@
uc_value_t *data, *proto;
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0078-mtk-hostapd-ACS-Add-EHT320-and-HT40-support-fix-issu.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0078-mtk-hostapd-ACS-Add-EHT320-and-HT40-support-fix-issu.patch
deleted file mode 100644
index 3f267b0..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0078-mtk-hostapd-ACS-Add-EHT320-and-HT40-support-fix-issu.patch
+++ /dev/null
@@ -1,379 +0,0 @@
-From 12fe53a7919abb791658bcc7a74b8131f0362300 Mon Sep 17 00:00:00 2001
-From: "fancy.liu" <fancy.liu@mediatek.com>
-Date: Thu, 28 Sep 2023 18:03:08 +0800
-Subject: [PATCH 078/104] mtk: hostapd: ACS: Add EHT320 and HT40- support, fix
- issue
-
-1. Add 6G EHT320 support;
-2. Add 2.4G HT40- support;
-3. Fix issue: selected best channel is out of channels;
-
-Signed-off-by: fancy.liu <fancy.liu@mediatek.com>
----
- src/ap/acs.c | 191 +++++++++++++++++++++++++++++++++------------------
- 1 file changed, 124 insertions(+), 67 deletions(-)
-
-diff --git a/src/ap/acs.c b/src/ap/acs.c
-index cfa4a7d27..1fa8b8e64 100644
---- a/src/ap/acs.c
-+++ b/src/ap/acs.c
-@@ -245,6 +245,7 @@ enum bw_type {
- ACS_BW40,
- ACS_BW80,
- ACS_BW160,
-+ ACS_BW320,
- };
-
- struct bw_item {
-@@ -286,10 +287,16 @@ static const struct bw_item bw_160[] = {
- { 6435, 6575, 111 }, { 6595, 6735, 143 },
- { 6755, 6895, 175 }, { 6915, 7055, 207 }, { -1, -1, -1 }
- };
-+static const struct bw_item bw_320[] = {
-+ { 5955, 6255, 31 }, { 6115, 6415, 63 }, { 6275, 6575, 95 },
-+ { 6435, 6735, 127 }, { 6595, 6895, 159 }, { 6755, 7055, 191 },
-+ { -1, -1, -1 }
-+};
- static const struct bw_item *bw_desc[] = {
- [ACS_BW40] = bw_40,
- [ACS_BW80] = bw_80,
- [ACS_BW160] = bw_160,
-+ [ACS_BW320] = bw_320,
- };
-
-
-@@ -769,10 +776,19 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- struct hostapd_channel_data **ideal_chan,
- long double *ideal_factor)
- {
-- struct hostapd_channel_data *chan, *adj_chan = NULL, *best;
-+ struct hostapd_channel_data *chan, *adj_chan = NULL, *tmp_chan = NULL, *best;
- long double factor;
- int i, j;
- unsigned int k;
-+ int ht40_plus = 1, sec_ch_factor = 1;
-+
-+ if (is_24ghz_mode(mode->mode)) {
-+ ht40_plus = (iface->conf->secondary_channel == -1) ? 0 : 1;
-+ sec_ch_factor = (iface->conf->secondary_channel == -1) ? -1 : 1;
-+ }
-+
-+ wpa_printf(MSG_INFO, "%s:%d, bw(%u), n_chans(%d), num_channels(%d), sec_ch(%d)",
-+ __func__, __LINE__, bw, n_chans, mode->num_channels, iface->conf->secondary_channel);
-
- for (i = 0; i < mode->num_channels; i++) {
- double total_weight;
-@@ -780,6 +796,9 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- bool update_best = true;
-
- best = chan = &mode->channels[i];
-+ wpa_printf(MSG_INFO,
-+ "ACS: Channel[%d] %d: interference_factor %Lg",
-+ i, chan->chan, chan->interference_factor);
-
- /* Since in the current ACS implementation the first channel is
- * always a primary channel, skip channels not available as
-@@ -811,7 +830,7 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- iface->conf->country[2] == 0x4f)
- continue;
-
-- if (!chan_bw_allowed(chan, bw, 1, 1)) {
-+ if (!chan_bw_allowed(chan, bw, ht40_plus, 1)) {
- wpa_printf(MSG_DEBUG,
- "ACS: Channel %d: BW %u is not supported",
- chan->chan, bw);
-@@ -832,7 +851,8 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- }
-
- if (mode->mode == HOSTAPD_MODE_IEEE80211A &&
-- (iface->conf->ieee80211ac || iface->conf->ieee80211ax)) {
-+ (iface->conf->ieee80211ac || iface->conf->ieee80211ax ||
-+ iface->conf->ieee80211be)) {
- if (hostapd_get_oper_chwidth(iface->conf) ==
- CONF_OPER_CHWIDTH_80MHZ &&
- !acs_usable_bw_chan(chan, ACS_BW80)) {
-@@ -850,63 +870,86 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- chan->chan);
- continue;
- }
-- }
-
-- factor = 0;
-- if (acs_usable_chan(chan))
-- factor = chan->interference_factor;
-- total_weight = 1;
--
-- for (j = 1; j < n_chans; j++) {
-- adj_chan = acs_find_chan(iface, chan->freq + (j * 20));
-- if (!adj_chan)
-- break;
--
-- if (!chan_bw_allowed(adj_chan, bw, 1, 0)) {
-+ if (iface->conf->ieee80211be &&
-+ hostapd_get_oper_chwidth(iface->conf) ==
-+ CONF_OPER_CHWIDTH_320MHZ &&
-+ !acs_usable_bw_chan(chan, ACS_BW320)) {
- wpa_printf(MSG_DEBUG,
-- "ACS: PRI Channel %d: secondary channel %d BW %u is not supported",
-- chan->chan, adj_chan->chan, bw);
-- break;
-+ "ACS: Channel %d: not allowed as primary channel for 320 MHz bandwidth",
-+ chan->chan);
-+ continue;
- }
-+ }
-
-- if (acs_usable_chan(adj_chan)) {
-- factor += adj_chan->interference_factor;
-+ factor = 0;
-+ total_weight = 0;
-+
-+ if (!is_24ghz_mode(mode->mode)) {
-+ /* If the AP is in the 5 GHz or 6 GHz band, lets prefer a less
-+ * crowded primary channel if one was found in the segment */
-+ if (acs_usable_chan(chan)) {
-+ factor += chan->interference_factor;
- total_weight += 1;
-- } else {
-- update_best = false;
- }
-
-- /* find the best channel in this segment */
-- if (update_best &&
-- adj_chan->interference_factor <
-- best->interference_factor)
-- best = adj_chan;
-- }
-+ for (j = 1; j < n_chans; j++) {
-+ adj_chan = acs_find_chan(iface, chan->freq + j * 20);
-+ if (!adj_chan)
-+ break;
-
-- if (j != n_chans) {
-- wpa_printf(MSG_DEBUG, "ACS: Channel %d: not enough bandwidth",
-- chan->chan);
-- continue;
-- }
-+ if (!is_in_chanlist(iface, adj_chan) || !is_in_freqlist(iface, adj_chan))
-+ break;
-
-- /* If the AP is in the 5 GHz or 6 GHz band, lets prefer a less
-- * crowded primary channel if one was found in the segment */
-- if (iface->current_mode->mode == HOSTAPD_MODE_IEEE80211A &&
-- chan != best) {
-- wpa_printf(MSG_DEBUG,
-- "ACS: promoting channel %d over %d (less interference %Lg/%Lg)",
-- best->chan, chan->chan,
-- chan->interference_factor,
-- best->interference_factor);
-- chan = best;
-- }
-+ if (!chan_bw_allowed(adj_chan, bw, 1, 0)) {
-+ wpa_printf(MSG_DEBUG,
-+ "ACS: PRI Channel %d: secondary channel %d BW %u is not supported",
-+ chan->chan, adj_chan->chan, bw);
-+ break;
-+ }
-+
-+ update_best = true;
-+ if (acs_usable_chan(adj_chan)) {
-+ factor += adj_chan->interference_factor;
-+ total_weight += 1;
-+ } else {
-+ update_best = false;
-+ }
-
-- /* 2.4 GHz has overlapping 20 MHz channels. Include adjacent
-- * channel interference factor. */
-- if (is_24ghz_mode(mode->mode)) {
-+ /* find the best channel in this segment */
-+ if (update_best &&
-+ adj_chan->interference_factor < best->interference_factor)
-+ best = adj_chan;
-+ }
-+
-+ if (j != n_chans) {
-+ wpa_printf(MSG_DEBUG, "ACS: Channel %d: not enough bandwidth",
-+ chan->chan);
-+ continue;
-+ }
-+
-+ if (chan != best) {
-+ wpa_printf(MSG_INFO,
-+ "ACS: promoting channel %d over %d (less interference %Lg/%Lg)",
-+ best->chan, chan->chan,
-+ chan->interference_factor,
-+ best->interference_factor);
-+ chan = best;
-+ }
-+ } else {
- for (j = 0; j < n_chans; j++) {
-+ /* Will set primary_channel / secondary_channel(40M case) weight to 1 */
-+ tmp_chan = acs_find_chan(iface, chan->freq +
-+ (j * sec_ch_factor * 20));
-+ if (tmp_chan && acs_usable_chan(tmp_chan)) {
-+ factor += tmp_chan->interference_factor;
-+ total_weight += 1;
-+ }
-+
-+ /* 2.4 GHz has overlapping 20 MHz channels. Include adjacent channel
-+ interference factor, separately for primary/secondary channel. */
- adj_chan = acs_find_chan(iface, chan->freq +
-- (j * 20) - 5);
-+ (j * sec_ch_factor * 20) - 5);
- if (adj_chan && acs_usable_chan(adj_chan)) {
- factor += ACS_ADJ_WEIGHT *
- adj_chan->interference_factor;
-@@ -914,7 +957,7 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- }
-
- adj_chan = acs_find_chan(iface, chan->freq +
-- (j * 20) - 10);
-+ (j * sec_ch_factor * 20) - 10);
- if (adj_chan && acs_usable_chan(adj_chan)) {
- factor += ACS_NEXT_ADJ_WEIGHT *
- adj_chan->interference_factor;
-@@ -922,7 +965,7 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- }
-
- adj_chan = acs_find_chan(iface, chan->freq +
-- (j * 20) + 5);
-+ (j * sec_ch_factor * 20) + 5);
- if (adj_chan && acs_usable_chan(adj_chan)) {
- factor += ACS_ADJ_WEIGHT *
- adj_chan->interference_factor;
-@@ -930,7 +973,7 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- }
-
- adj_chan = acs_find_chan(iface, chan->freq +
-- (j * 20) + 10);
-+ (j * sec_ch_factor * 20) + 10);
- if (adj_chan && acs_usable_chan(adj_chan)) {
- factor += ACS_NEXT_ADJ_WEIGHT *
- adj_chan->interference_factor;
-@@ -939,7 +982,8 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
- }
- }
-
-- factor /= total_weight;
-+ if (total_weight)
-+ factor /= total_weight;
-
- bias = NULL;
- if (iface->conf->acs_chan_bias) {
-@@ -958,11 +1002,11 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
-
- if (bias) {
- factor *= bias->bias;
-- wpa_printf(MSG_DEBUG,
-+ wpa_printf(MSG_INFO,
- "ACS: * channel %d: total interference = %Lg (%f bias)",
- chan->chan, factor, bias->bias);
- } else {
-- wpa_printf(MSG_DEBUG,
-+ wpa_printf(MSG_INFO,
- "ACS: * channel %d: total interference = %Lg",
- chan->chan, factor);
- }
-@@ -1015,19 +1059,12 @@ acs_find_ideal_chan(struct hostapd_iface *iface)
- goto bw_selected;
- }
-
-- /* TODO: HT40- support */
--
-- if (iface->conf->ieee80211n &&
-- iface->conf->secondary_channel == -1) {
-- wpa_printf(MSG_ERROR, "ACS: HT40- is not supported yet. Please try HT40+");
-- return NULL;
-- }
--
- if (iface->conf->ieee80211n &&
- iface->conf->secondary_channel)
- n_chans = 2;
-
-- if (iface->conf->ieee80211ac || iface->conf->ieee80211ax) {
-+ if (iface->conf->ieee80211ac || iface->conf->ieee80211ax ||
-+ iface->conf->ieee80211be) {
- switch (hostapd_get_oper_chwidth(iface->conf)) {
- case CONF_OPER_CHWIDTH_80MHZ:
- n_chans = 4;
-@@ -1037,6 +1074,7 @@ acs_find_ideal_chan(struct hostapd_iface *iface)
- break;
- default:
- break;
-+ /* 320 is supported only in 6GHz 11be mode */
- }
- }
-
-@@ -1057,7 +1095,7 @@ bw_selected:
- }
-
- if (ideal_chan) {
-- wpa_printf(MSG_DEBUG, "ACS: Ideal channel is %d (%d MHz) with total interference factor of %Lg",
-+ wpa_printf(MSG_INFO, "ACS: Ideal channel is %d (%d MHz) with total interference factor of %Lg",
- ideal_chan->chan, ideal_chan->freq, ideal_factor);
-
- #ifdef CONFIG_IEEE80211BE
-@@ -1072,6 +1110,21 @@ bw_selected:
- return rand_chan;
- }
-
-+static int acs_get_center_freq_320mhz(int channel)
-+{
-+ if (channel >= 1 && channel <= 45)
-+ return 31;
-+ else if (channel >= 49 && channel <= 77)
-+ return 63;
-+ else if (channel >= 81 && channel <= 109)
-+ return 95;
-+ else if (channel >= 113 && channel <= 141)
-+ return 127;
-+ else if (channel >= 145 && channel <= 173)
-+ return 159;
-+ else
-+ return 191;
-+}
-
- static void acs_adjust_secondary(struct hostapd_iface *iface)
- {
-@@ -1099,7 +1152,7 @@ static void acs_adjust_center_freq(struct hostapd_iface *iface)
- {
- int center;
-
-- wpa_printf(MSG_DEBUG, "ACS: Adjusting VHT center frequency");
-+ wpa_printf(MSG_DEBUG, "ACS: Adjusting center frequency");
-
- switch (hostapd_get_oper_chwidth(iface->conf)) {
- case CONF_OPER_CHWIDTH_USE_HT:
-@@ -1115,6 +1168,9 @@ static void acs_adjust_center_freq(struct hostapd_iface *iface)
- case CONF_OPER_CHWIDTH_80MHZ:
- center = acs_get_bw_center_chan(iface->freq, ACS_BW80);
- break;
-+ case CONF_OPER_CHWIDTH_320MHZ:
-+ center = acs_get_center_freq_320mhz(iface->conf->channel);
-+ break;
- case CONF_OPER_CHWIDTH_160MHZ:
- center = acs_get_bw_center_chan(iface->freq, ACS_BW160);
- break;
-@@ -1122,7 +1178,7 @@ static void acs_adjust_center_freq(struct hostapd_iface *iface)
- /* TODO: How can this be calculated? Adjust
- * acs_find_ideal_chan() */
- wpa_printf(MSG_INFO,
-- "ACS: Only VHT20/40/80/160 is supported now");
-+ "ACS: Only VHT20/40/80/160 EHT320 is supported now");
- return;
- }
-
-@@ -1185,7 +1241,8 @@ static void acs_study(struct hostapd_iface *iface)
- iface->conf->punct_bitmap = ideal_chan->punct_bitmap;
- #endif /* CONFIG_IEEE80211BE */
-
-- if (iface->conf->ieee80211ac || iface->conf->ieee80211ax) {
-+ if (iface->conf->ieee80211ac || iface->conf->ieee80211ax ||
-+ iface->conf->ieee80211be) {
- acs_adjust_secondary(iface);
- acs_adjust_center_freq(iface);
- }
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0102-mtk-hostapd-Refactor-static-PP-and-mld-support.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0078-mtk-hostapd-Refactor-static-PP-and-mld-support.patch
similarity index 85%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/0102-mtk-hostapd-Refactor-static-PP-and-mld-support.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/0078-mtk-hostapd-Refactor-static-PP-and-mld-support.patch
index c958591..c20f618 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0102-mtk-hostapd-Refactor-static-PP-and-mld-support.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0078-mtk-hostapd-Refactor-static-PP-and-mld-support.patch
@@ -1,7 +1,7 @@
-From 80b2cbbd80700d1fa04d97aae5b8a083a4b4f2ba Mon Sep 17 00:00:00 2001
+From a6baff35c3303204be7df2a0ec001e31e428a6c3 Mon Sep 17 00:00:00 2001
From: Allen Ye <allen.ye@mediatek.com>
Date: Tue, 2 Apr 2024 16:51:07 +0800
-Subject: [PATCH 102/104] mtk: hostapd: Refactor static PP and mld support
+Subject: [PATCH 078/126] mtk: hostapd: Refactor static PP and mld support
Add band_idx attribute in pp cmd for vendor cmd under mld setting.
@@ -20,10 +20,10 @@
11 files changed, 87 insertions(+), 32 deletions(-)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index b9a062193..2add62ca9 100644
+index c1bc344dd..44615c564 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -5339,7 +5339,7 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -5452,7 +5452,7 @@ static int hostapd_config_fill(struct hostapd_config *conf,
if (get_u16(pos, line, &conf->punct_bitmap))
return 1;
conf->punct_bitmap = atoi(pos);
@@ -32,7 +32,7 @@
} else if (os_strcmp(buf, "punct_acs_threshold") == 0) {
int val = atoi(pos);
-@@ -5427,8 +5427,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -5549,8 +5549,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
} else if (os_strcmp(buf, "pp_mode") == 0) {
int val = atoi(pos);
@@ -44,10 +44,10 @@
line);
return 1;
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index b5f6431bf..6d4ce8acb 100644
+index 9bd8a46b3..e19502d1d 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -4854,27 +4854,57 @@ hostapd_ctrl_iface_set_background_radar_mode(struct hostapd_data *hapd, char *cm
+@@ -4992,27 +4992,57 @@ hostapd_ctrl_iface_set_background_radar_mode(struct hostapd_data *hapd, char *cm
return os_snprintf(buf, buflen, "OK\n");
}
@@ -114,7 +114,7 @@
return -1;
}
hapd->iconf->pp_mode = (u8) val;
-@@ -4882,7 +4912,8 @@ hostapd_ctrl_iface_set_pp(struct hostapd_data *hapd, char *cmd, char *buf,
+@@ -5020,7 +5050,8 @@ hostapd_ctrl_iface_set_pp(struct hostapd_data *hapd, char *cmd, char *buf,
return -1;
} else {
wpa_printf(MSG_ERROR,
@@ -124,7 +124,7 @@
return -1;
}
return os_snprintf(buf, buflen, "OK\n");
-@@ -4892,19 +4923,17 @@ static int
+@@ -5030,19 +5061,17 @@ static int
hostapd_ctrl_iface_get_pp(struct hostapd_data *hapd, char *cmd, char *buf,
size_t buflen)
{
@@ -153,10 +153,10 @@
static int
diff --git a/hostapd/ctrl_iface.h b/hostapd/ctrl_iface.h
-index 3341a66bd..82a64b880 100644
+index ec5a95be7..753761c22 100644
--- a/hostapd/ctrl_iface.h
+++ b/hostapd/ctrl_iface.h
-@@ -35,5 +35,6 @@ hostapd_global_ctrl_iface_deinit(struct hapd_interfaces *interface)
+@@ -39,5 +39,6 @@ hostapd_global_ctrl_iface_deinit(struct hapd_interfaces *interface)
{
}
#endif /* CONFIG_NO_CTRL_IFACE */
@@ -165,10 +165,10 @@
+hostapd_get_hapd_by_band_idx(struct hostapd_data *hapd, u8 band_idx);
#endif /* CTRL_IFACE_H */
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index 81b74d6de..4bf70d183 100644
+index f54fa9997..4e94db21d 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1730,6 +1730,17 @@ static int hostapd_cli_cmd_dump_csi(struct wpa_ctrl *ctrl, int argc,
+@@ -1755,6 +1755,17 @@ static int hostapd_cli_cmd_dump_csi(struct wpa_ctrl *ctrl, int argc,
{
return hostapd_cli_cmd(ctrl, "DUMP_CSI", 1, argc, argv);
}
@@ -186,7 +186,7 @@
struct hostapd_cli_cmd {
const char *cmd;
-@@ -1976,6 +1987,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -2008,6 +2019,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
" = Set csi configuaration"},
{ "dump_csi", hostapd_cli_cmd_dump_csi, NULL,
" = Dump csi data to a json file"},
@@ -198,10 +198,10 @@
};
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 3bd8df9ce..5192c1f07 100644
+index c61e67403..417b1d630 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1353,8 +1353,8 @@ enum mtk_vendor_attr_edcca_ctrl_mode {
+@@ -1406,8 +1406,8 @@ enum mtk_vendor_attr_edcca_ctrl_mode {
enum pp_mode {
PP_DISABLE = 0,
@@ -213,10 +213,10 @@
#define EDCCA_DEFAULT_COMPENSATION -6
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index cb782fa31..a76148eba 100644
+index a26a3f45d..fb09a3290 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1396,10 +1396,13 @@ int hostapd_drv_background_radar_mode(struct hostapd_data *hapd)
+@@ -1432,10 +1432,13 @@ int hostapd_drv_background_radar_mode(struct hostapd_data *hapd)
int hostapd_drv_pp_mode_set(struct hostapd_data *hapd)
{
if (!hapd->driver || !hapd->driver->pp_mode_set ||
@@ -233,10 +233,10 @@
int hostapd_drv_beacon_ctrl(struct hostapd_data *hapd, u8 beacon_mode)
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
-index b12290556..9bbeab1d6 100644
+index db26f6536..fc7699973 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -1080,6 +1080,7 @@ static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface,
+@@ -1081,6 +1081,7 @@ static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface,
os_memset(&csa_settings, 0, sizeof(csa_settings));
csa_settings.cs_count = 5;
csa_settings.block_tx = 1;
@@ -244,7 +244,7 @@
csa_settings.link_id = -1;
#ifdef CONFIG_IEEE80211BE
if (iface->bss[0]->conf->mld_ap)
-@@ -1644,6 +1645,8 @@ int hostapd_dfs_radar_detected(struct hostapd_iface *iface, int freq,
+@@ -1657,6 +1658,8 @@ int hostapd_dfs_radar_detected(struct hostapd_iface *iface, int freq,
return 0;
}
@@ -254,10 +254,10 @@
/* Radar detected while operating, switch the channel. */
return hostapd_dfs_start_channel_switch(iface);
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index 8e3f0b281..3d3359291 100644
+index 93c164177..f5e11d43d 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -2697,6 +2697,8 @@ dfs_offload:
+@@ -2766,6 +2766,8 @@ dfs_offload:
}
#endif /* CONFIG_MESH */
@@ -266,7 +266,7 @@
if (hostapd_drv_configure_edcca_enable(hapd) < 0)
goto fail;
-@@ -2711,8 +2713,6 @@ dfs_offload:
+@@ -2780,8 +2782,6 @@ dfs_offload:
goto fail;
if (hostapd_drv_amsdu_ctrl(hapd) < 0)
goto fail;
@@ -276,10 +276,10 @@
wpa_printf(MSG_DEBUG, "%s: Setup of interface done.",
iface->bss[0]->conf->iface);
diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
-index c290e72a7..09805b6fb 100644
+index ce3a2ad9a..be516e017 100644
--- a/src/common/mtk_vendor.h
+++ b/src/common/mtk_vendor.h
-@@ -263,6 +263,7 @@ enum mtk_vendor_attr_pp_ctrl {
+@@ -268,6 +268,7 @@ enum mtk_vendor_attr_pp_ctrl {
MTK_VENDOR_ATTR_PP_CTRL_UNSPEC,
MTK_VENDOR_ATTR_PP_MODE,
@@ -288,10 +288,10 @@
/* keep last */
NUM_MTK_VENDOR_ATTRS_PP_CTRL,
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 7efb5e342..539771729 100644
+index 48cb93cfd..b75580374 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5337,8 +5337,9 @@ struct wpa_driver_ops {
+@@ -5364,8 +5364,9 @@ struct wpa_driver_ops {
* pp_mode_set - Set preamble puncture operation mode
* @priv: Private driver interface data
* @pp_mode: Value is defined in enum pp_mode
@@ -303,7 +303,7 @@
int (*get_mld_addr)(void *priv, u8 *addr);
#endif
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 39b45ef4b..6ec2c32df 100644
+index afb068091..8b64c3983 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -159,6 +159,7 @@ amnt_dump_policy[NUM_MTK_VENDOR_ATTRS_AMNT_DUMP] = {
@@ -314,7 +314,7 @@
};
static struct nla_policy csi_ctrl_policy[NUM_MTK_VENDOR_ATTRS_CSI_CTRL] = {
-@@ -15167,7 +15168,7 @@ static int nl80211_background_radar_mode(void *priv, const u8 background_radar_m
+@@ -15196,7 +15197,7 @@ static int nl80211_background_radar_mode(void *priv, const u8 background_radar_m
return ret;
}
@@ -323,7 +323,7 @@
{
struct i802_bss *bss = priv;
struct wpa_driver_nl80211_data *drv = bss->drv;
-@@ -15194,6 +15195,7 @@ static int nl80211_pp_mode_set(void *priv, const u8 pp_mode)
+@@ -15223,6 +15224,7 @@ static int nl80211_pp_mode_set(void *priv, const u8 pp_mode)
if (!data)
goto fail;
@@ -332,5 +332,5 @@
nla_nest_end(msg, data);
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0079-mtk-hostapd-make-sure-all-links-are-set-before-enabl.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0079-mtk-hostapd-make-sure-all-links-are-set-before-enabl.patch
new file mode 100644
index 0000000..afc66a5
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0079-mtk-hostapd-make-sure-all-links-are-set-before-enabl.patch
@@ -0,0 +1,183 @@
+From 288062b9de2d669b809ae7b0035ca4680c358192 Mon Sep 17 00:00:00 2001
+From: Shayne Chen <shayne.chen@mediatek.com>
+Date: Thu, 11 Apr 2024 18:16:38 +0800
+Subject: [PATCH 079/126] mtk: hostapd: make sure all links are set before
+ enabling beacon
+
+NL80211_CMD_NEW_BEACON will first be set, but we've modified mac80211 to
+disable this beacon. After that, hostapd will block
+NL80211_CMD_SET_BEACON until all links are setting up.
+(use NL80211_CMD_START_AP event to check if all expected links are enabled)
+
+Update: in wpa_driver_nl80211_set_ap(), send_and_recv() is used, implies
+that hostapd should already sync with driver, so don't need to use
+NL80211_CMD_START_AP event.
+
+This can make sure that the first beacon of each link includes the
+correct RNR and per-STA profile.
+
+Note that in NL80211_CMD_NEW_BEACON, we also set beacon interval to 0,
+which helps to bypass some mac80211 beacon active checks, e.g., during ACS.
+
+Add is_mld_finished check for ucode need.
+This function returns ture only if all links fromt all MLD APs are
+ready.
+
+Only after hostapd sets beacon for all links that hapd->mld->started is
+set to true. However, if the interface is about to do CAC,
+hapd->mld->started will be false until the CAC is done.
+
+For ucode, it only have to ckeck whether all link is added. Instead of
+checking hapd->mld->started, this commits check the link one by one, and
+return false if there are links unadded.
+
+Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ hostapd/config_file.c | 2 ++
+ src/ap/ap_config.h | 2 ++
+ src/ap/beacon.c | 10 ++++++++++
+ src/ap/hostapd.c | 14 ++++++++++++++
+ src/ap/hostapd.h | 1 +
+ src/ap/ucode.c | 27 +++++++++++++++++++++++++++
+ 6 files changed, 56 insertions(+)
+
+diff --git a/hostapd/config_file.c b/hostapd/config_file.c
+index 44615c564..206055b75 100644
+--- a/hostapd/config_file.c
++++ b/hostapd/config_file.c
+@@ -5467,6 +5467,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+ bss->mld_ap = !!atoi(pos);
+ } else if (os_strcmp(buf, "mld_primary") == 0) {
+ bss->mld_primary = !!atoi(pos);
++ } else if (os_strcmp(buf, "mld_allowed_links") == 0) {
++ bss->mld_allowed_links = atoi(pos);
+ } else if (os_strcmp(buf, "mld_addr") == 0) {
+ if (hwaddr_aton(pos, bss->mld_addr)) {
+ wpa_printf(MSG_ERROR, "Line %d: Invalid mld_addr",
+diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
+index 417b1d630..15b66ca30 100644
+--- a/src/ap/ap_config.h
++++ b/src/ap/ap_config.h
+@@ -989,6 +989,8 @@ struct hostapd_bss_config {
+
+ /* The AP is the primary AP of an AP MLD */
+ u8 mld_primary;
++ /* Allowed link bitmap of the AP MLD to which the AP is affiliated */
++ u16 mld_allowed_links;
+
+ /* The MLD ID to which the AP MLD is affiliated with */
+ u8 mld_id;
+diff --git a/src/ap/beacon.c b/src/ap/beacon.c
+index 9bf73747f..88e35acc2 100644
+--- a/src/ap/beacon.c
++++ b/src/ap/beacon.c
+@@ -2276,6 +2276,12 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
+ os_memcpy(head->bssid, hapd->own_addr, ETH_ALEN);
+ head->u.beacon.beacon_int =
+ host_to_le16(hapd->iconf->beacon_int);
++ /* if MLD AP hasn't finished setting up all links, also set beacon interval
++ * to 0. This allows mac80211 to bypass some beacon active checks, for
++ * example, when doing ACS
++ */
++ if (hapd->conf->mld_ap && !hapd->mld->started)
++ head->u.beacon.beacon_int = host_to_le16(0);
+
+ /* hardware or low-level driver will setup seq_ctrl and timestamp */
+ capab_info = hostapd_own_capab_info(hapd);
+@@ -2677,6 +2683,10 @@ static int __ieee802_11_set_beacon(struct hostapd_data *hapd)
+ int res, ret = -1, i;
+ struct hostapd_hw_modes *mode;
+
++ /* skip setting beacon if other links are not started yet */
++ if (hapd->conf->mld_ap && !hapd->mld->started && hapd->beacon_set_done)
++ return 0;
++
+ if (!hapd->drv_priv) {
+ wpa_printf(MSG_ERROR, "Interface is disabled");
+ return -1;
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index f5e11d43d..fe41f1821 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -1315,6 +1315,20 @@ static int hostapd_start_beacon(struct hostapd_data *hapd,
+ if (!conf->start_disabled && ieee802_11_set_beacon(hapd) < 0)
+ return -1;
+
++ if (hapd->conf->mld_ap && !hapd->mld->started) {
++ struct hostapd_data *p_hapd;
++ u16 valid_links = 0;
++
++ for_each_mld_link(p_hapd, hapd)
++ valid_links |= BIT(p_hapd->mld_link_id);
++
++ if (valid_links == hapd->conf->mld_allowed_links ||
++ !hapd->conf->mld_allowed_links) {
++ hapd->mld->started = 1;
++ ieee802_11_set_beacon(hapd);
++ }
++ }
++
+ if (flush_old_stations && !conf->start_disabled &&
+ conf->broadcast_deauth) {
+ u8 addr[ETH_ALEN];
+diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
+index 574a5ba1d..4db67096b 100644
+--- a/src/ap/hostapd.h
++++ b/src/ap/hostapd.h
+@@ -544,6 +544,7 @@ struct hostapd_mld {
+ * freed when num_links is 0.
+ */
+ u8 refcount;
++ bool started;
+
+ struct hostapd_data *fbss;
+ struct dl_list links; /* List head of all affiliated links */
+diff --git a/src/ap/ucode.c b/src/ap/ucode.c
+index 68f76dbe5..da1c4c1ac 100644
+--- a/src/ap/ucode.c
++++ b/src/ap/ucode.c
+@@ -744,6 +744,32 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
+ return ucv_boolean_new(!ret);
+ }
+
++static uc_value_t *
++uc_hostapd_iface_is_mld_finished(uc_vm_t *vm, size_t nargs)
++{
++ struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface");
++ bool finished = true;
++ int i;
++
++ for (i = 0; i < iface->num_bss; i++) {
++ if (iface->bss[i]->conf->mld_ap) {
++ struct hostapd_data *p_hapd;
++ u16 valid_links = 0;
++
++ for_each_mld_link(p_hapd, iface->bss[i])
++ valid_links |= BIT(p_hapd->mld_link_id);
++
++ if (iface->bss[i]->conf->mld_allowed_links > 0 &&
++ valid_links != iface->bss[i]->conf->mld_allowed_links) {
++ finished = false;
++ break;
++ }
++ }
++ }
++
++ return ucv_boolean_new(finished);
++}
++
+ static uc_value_t *
+ uc_hostapd_bss_rename(uc_vm_t *vm, size_t nargs)
+ {
+@@ -816,6 +842,7 @@ int hostapd_ucode_init(struct hapd_interfaces *ifaces)
+ { "stop", uc_hostapd_iface_stop },
+ { "start", uc_hostapd_iface_start },
+ { "switch_channel", uc_hostapd_iface_switch_channel },
++ { "is_mld_finished", uc_hostapd_iface_is_mld_finished },
+ };
+ uc_value_t *data, *proto;
+
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0080-mtk-hostapd-add-hidden-SSID-support.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0080-mtk-hostapd-add-hidden-SSID-support.patch
new file mode 100644
index 0000000..6399fc1
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0080-mtk-hostapd-add-hidden-SSID-support.patch
@@ -0,0 +1,67 @@
+From dd7f4e849efee36586e0b39f9f1e54a1a2000a49 Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Wed, 24 Apr 2024 17:44:40 +0800
+Subject: [PATCH 080/126] mtk: hostapd: add hidden SSID support
+
+Add hidden SSID support for MLD AP. Now the parnter link's information is
+included in RNR even if the link is hidden.
+Note that the hidden links' information appear in both beacon and probe
+response.
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ src/ap/ieee802_11.c | 17 ++++++++++++++---
+ 1 file changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index fbe3f582f..37a2c5ab8 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -7483,16 +7483,21 @@ repeat_rnr_len:
+ for (i = start; i < hapd->iface->num_bss; i++) {
+ struct hostapd_data *bss = hapd->iface->bss[i];
+ bool ap_mld = false;
++ bool ignore_broadcast_ssid;
+
+ if (!bss || !bss->conf || !bss->started)
+ continue;
+
++ ignore_broadcast_ssid = bss->conf->ignore_broadcast_ssid;
+ #ifdef CONFIG_IEEE80211BE
+ ap_mld = bss->conf->mld_ap;
++ /* FIXME How to exclude the hidden link in beacon? */
++ ignore_broadcast_ssid &=
++ !hostapd_is_ml_partner(bss, reporting_hapd);
+ #endif /* CONFIG_IEEE80211BE */
+
+ if (bss == reporting_hapd ||
+- bss->conf->ignore_broadcast_ssid)
++ ignore_broadcast_ssid)
+ continue;
+
+ if (hostapd_skip_rnr(i, skip_profiles, ap_mld,
+@@ -7751,13 +7756,19 @@ static bool hostapd_eid_rnr_bss(struct hostapd_data *hapd,
+ u8 bss_param = 0;
+ bool ap_mld = false;
+ u8 *eid = *pos;
++ bool ignore_broadcast_ssid;
+
++ if (!bss || !bss->conf || !bss->started)
++ return false;
++
++ ignore_broadcast_ssid = bss->conf->ignore_broadcast_ssid;
+ #ifdef CONFIG_IEEE80211BE
+ ap_mld = !!hapd->conf->mld_ap;
++ /* FIXME How to exclude the hidden link in beacon? */
++ ignore_broadcast_ssid &= !hostapd_is_ml_partner(bss, reporting_hapd);
+ #endif /* CONFIG_IEEE80211BE */
+
+- if (!bss || !bss->conf || !bss->started ||
+- bss == reporting_hapd || bss->conf->ignore_broadcast_ssid)
++ if (bss == reporting_hapd || ignore_broadcast_ssid)
+ return false;
+
+ if (hostapd_skip_rnr(i, skip_profiles, ap_mld, tbtt_info_len,
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0080-mtk-hostapd-fix-mld_assoc_link_id.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0080-mtk-hostapd-fix-mld_assoc_link_id.patch
deleted file mode 100644
index 42c06e4..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0080-mtk-hostapd-fix-mld_assoc_link_id.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From d06dd0d45977ce098df718a29ffbc765896a2758 Mon Sep 17 00:00:00 2001
-From: Shayne Chen <shayne.chen@mediatek.com>
-Date: Mon, 29 Jan 2024 11:24:28 +0800
-Subject: [PATCH 080/104] mtk: hostapd: fix mld_assoc_link_id
-
-Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
----
- src/ap/hostapd.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index e4fc1f85a..f8b05de45 100644
---- a/src/ap/hostapd.c
-+++ b/src/ap/hostapd.c
-@@ -4034,11 +4034,13 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
- }
-
- #ifdef CONFIG_IEEE80211BE
-- if (ap_sta_is_mld(hapd, sta) &&
-- sta->mld_assoc_link_id != hapd->mld_link_id)
-- return;
-+ if (ap_sta_is_mld(hapd, sta)) {
-+ if (sta->mld_assoc_link_id != hapd->mld_link_id)
-+ return;
-+ mld_assoc_link_id = sta->mld_assoc_link_id;
-+ }
- #endif /* CONFIG_IEEE80211BE */
-- if (mld_assoc_link_id != -2)
-+ if (mld_assoc_link_id != -2)
- hostapd_prune_associations(hapd, sta->addr, mld_assoc_link_id);
-
- ap_sta_clear_disconnect_timeouts(hapd, sta);
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0081-mtk-hostapd-do-not-roam-within-the-same-MLD.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0081-mtk-hostapd-do-not-roam-within-the-same-MLD.patch
new file mode 100644
index 0000000..9519c2f
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0081-mtk-hostapd-do-not-roam-within-the-same-MLD.patch
@@ -0,0 +1,31 @@
+From 1d64b54fc9ea3e53a6369e609a9b4e83e800a1e4 Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Fri, 26 Apr 2024 08:36:57 +0800
+Subject: [PATCH 081/126] mtk: hostapd: do not roam within the same MLD
+
+If STA scaned and selected a different links from the same MLD AP, the
+check by wpa_s would make it to roam within ESS, which is unnecessary
+for a non-AP MLD.
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ wpa_supplicant/events.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
+index 68f4d2dbe..83b1dcc21 100644
+--- a/wpa_supplicant/events.c
++++ b/wpa_supplicant/events.c
+@@ -2395,6 +2395,9 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s,
+ if (current_bss == selected)
+ return 0;
+
++ if (wpa_s->valid_links && ether_addr_equal(selected->mld_addr, wpa_s->bssid))
++ return 0; /* same AP MLD but different links */
++
+ if (selected->last_update_idx > current_bss->last_update_idx)
+ return 1; /* current BSS not seen in the last scan */
+
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0082-mtk-hostapd-update-op_class-in-channel-switch-fallba.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0082-mtk-hostapd-update-op_class-in-channel-switch-fallba.patch
new file mode 100644
index 0000000..b7812cd
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0082-mtk-hostapd-update-op_class-in-channel-switch-fallba.patch
@@ -0,0 +1,34 @@
+From 80eac0c00795cccd43db3c972a6c903dda55f4b0 Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Mon, 29 Apr 2024 10:52:31 +0800
+Subject: [PATCH 082/126] mtk: hostapd: update op_class in channel switch
+ fallback
+
+Switching to a DFS channel includes an AP interface teardown and setup.
+An op_class update is necessary for passing the channel information
+check during setup.
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ src/ap/hostapd.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index fe41f1821..2c9e54b23 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -4710,6 +4710,10 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface,
+ iface->conf->ieee80211ac = freq_params->vht_enabled;
+ iface->conf->ieee80211ax = freq_params->he_enabled;
+ iface->conf->ieee80211be = freq_params->eht_enabled;
++ if (ieee80211_freq_to_channel_ext(iface->freq, iface->conf->secondary_channel,
++ hostapd_get_oper_chwidth(iface->conf),
++ &op_class, &chan) != NUM_HOSTAPD_MODES)
++ iface->conf->op_class = op_class;
+
+ /*
+ * cs_params must not be cleared earlier because the freq_params
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0083-mtk-hostapd-always-do-ML-probe-request-before-authen.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0083-mtk-hostapd-always-do-ML-probe-request-before-authen.patch
new file mode 100644
index 0000000..0327d5e
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0083-mtk-hostapd-always-do-ML-probe-request-before-authen.patch
@@ -0,0 +1,41 @@
+From 13f84bce5e02c21e0915b5f4d46a02133237e847 Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Mon, 6 May 2024 18:20:52 +0800
+Subject: [PATCH 083/126] mtk: hostapd: always do ML probe request before
+ authentication
+
+The scan result might contain old information of an AP MLD, so a ML
+probe might be necessary to update the scan result before the
+authentication.
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ wpa_supplicant/events.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
+index 83b1dcc21..7b91ce988 100644
+--- a/wpa_supplicant/events.c
++++ b/wpa_supplicant/events.c
+@@ -1925,15 +1925,16 @@ static int wpa_supplicant_connect_ml_missing(struct wpa_supplicant *wpa_s,
+
+ if (wpa_bss_parse_basic_ml_element(wpa_s, selected, NULL,
+ &missing_links, ssid,
+- &ap_mld_id) ||
+- !missing_links)
++ &ap_mld_id))
+ return 0;
+
+ removed_links = wpa_bss_parse_reconf_ml_element(wpa_s, selected);
+ missing_links &= ~removed_links;
+
++ /* FIXME Always do ML probe for the sake of stability.
+ if (!missing_links)
+ return 0;
++ */
+
+ wpa_dbg(wpa_s, MSG_DEBUG,
+ "MLD: Doing an ML probe for missing links 0x%04x",
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0084-mtk-hostapd-prevent-responding-to-mgmt-while-AP-MLD-.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0084-mtk-hostapd-prevent-responding-to-mgmt-while-AP-MLD-.patch
new file mode 100644
index 0000000..82b31c7
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0084-mtk-hostapd-prevent-responding-to-mgmt-while-AP-MLD-.patch
@@ -0,0 +1,36 @@
+From 1e54da693f94da15372d3e397c362a20fb5b1af1 Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Mon, 6 May 2024 18:14:35 +0800
+Subject: [PATCH 084/126] mtk: hostapd: prevent responding to mgmt while AP MLD
+ is initializing
+
+While AP MLD is initializing, it might include incomplete information
+inside its response of mgmt.
+Therefore this commit prevents responding to mgmt while AP MLD is initializing
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ src/ap/ieee802_11.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index 37a2c5ab8..1365bc822 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -6305,6 +6305,13 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len,
+ if (len < 24)
+ return 0;
+
++#ifdef CONFIG_IEEE80211BE
++ if (hapd->conf->mld_ap && !hapd->mld->started) {
++ wpa_printf(MSG_DEBUG, "MGMT: Drop the frame - MLD not ready");
++ return 1;
++ }
++#endif /* CONFIG_IEEE80211BE */
++
+ if (fi && fi->freq)
+ freq = fi->freq;
+ else
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0085-mtk-hostapd-add-critical-update-support.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0085-mtk-hostapd-add-critical-update-support.patch
new file mode 100644
index 0000000..f34a8ad
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0085-mtk-hostapd-add-critical-update-support.patch
@@ -0,0 +1,945 @@
+From d46df816cadde59bde528c08db281923874152cc Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Tue, 23 Apr 2024 16:03:19 +0800
+Subject: [PATCH 085/126] mtk: hostapd: add critical update support
+
+Add critical update support
+modification: wmm configuration
+inclusion: channel switch
+(affiliated link's per-STA profile CSA/eCSA countdown &
+ channel switch wrapper is included)
+Note that max channel switch time IE is not implemented
+in hostapd yet.
+
+1.Add max channel switch time IE
+Note that fw will find the MCST IE on its own,
+so there is no need to send the offset of the MCST IE to the kernel.
+The MCST's value is currently hardcoded to 500 TUs, since the WFA test plan
+restricts it to not exceeding 500 TUs (APUT 4.22.1).
+2. Add critical update support for radar triggered channel switch
+
+According to the test plan of APUT 4.44, the CSA after beacon should also
+include the CU flag and increase BPCC due to operation IE modification.
+Additionally, avoid setting beacons in hostapd_event_ch_switch after CSA
+is finished since it would conflict with the CSA after beacon.
+
+Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ hostapd/ctrl_iface.c | 88 +++++++++++++++++++
+ hostapd/hostapd_cli.c | 8 ++
+ hostapd/main.c | 4 +-
+ src/ap/beacon.c | 161 ++++++++++++++++++++++++++++++++++-
+ src/ap/beacon.h | 37 ++++++++
+ src/ap/dfs.c | 12 +++
+ src/ap/drv_callbacks.c | 1 -
+ src/ap/hostapd.c | 85 +++++++++++++++++-
+ src/ap/hostapd.h | 5 ++
+ src/ap/ieee802_11.c | 15 ++++
+ src/ap/ieee802_11_eht.c | 7 +-
+ src/ap/sta_info.h | 6 ++
+ src/ap/ucode.c | 9 +-
+ src/common/ieee802_11_defs.h | 1 +
+ src/drivers/driver.h | 1 +
+ src/drivers/driver_nl80211.c | 53 +++++++-----
+ src/drivers/nl80211_copy.h | 8 ++
+ 17 files changed, 470 insertions(+), 31 deletions(-)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index e19502d1d..ebe9053cf 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -2911,6 +2911,18 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+ ret = err;
+ num_err++;
+ }
++
++#ifdef CONFIG_IEEE80211BE
++ if (iface->bss[i]->conf->mld_ap)
++ hostapd_update_aff_link_beacon(iface->bss[i], settings.cs_count);
++
++ /*
++ * Currently, no FW notification event for clearing CU flag after DTIM period.
++ * Also, another CU or set beacon is not allowed during CSA period.
++ * Therefore, just clear it manually here for workaround.
++ */
++ iface->bss[i]->eht_mld_bss_critical_update = 0;
++#endif /* CONFIG_IEEE80211BE */
+ }
+
+ return (iface->num_bss == num_err) ? ret : 0;
+@@ -5279,6 +5291,79 @@ hostapd_ctrl_iface_dump_csi(struct hostapd_data *hapd, char *cmd,
+ return 0;
+ }
+
++static int
++hostapd_ctrl_iface_wmm(struct hostapd_data *hapd, char *cmd, char *buf,
++ size_t buflen)
++{
++ char *pos = cmd, *ac, *token, *context = NULL;
++ struct hostapd_wmm_ac_params *acp;
++ int num;
++
++ if (!hapd->conf->mld_ap)
++ return -1;
++
++ ac = pos;
++ pos = os_strchr(pos, ' ');
++ if (pos)
++ *pos++ = '\0';
++
++ if (os_strncmp(ac, "BE", 2) == 0) {
++ num = 0;
++ } else if (os_strncmp(ac, "BK", 2) == 0) {
++ num = 1;
++ } else if (os_strncmp(ac, "VI", 2) == 0) {
++ num = 2;
++ } else if (os_strncmp(ac, "VO", 2) == 0) {
++ num = 3;
++ } else {
++ wpa_printf(MSG_ERROR, "Unknown AC name '%s'", ac);
++ return -1;
++ }
++
++ acp = &hapd->iconf->wmm_ac_params[num];
++
++ /* if only ac is provied, show wmm params */
++ if (!pos)
++ return os_snprintf(buf, buflen,
++ "link=%d ac=%s cwmin=%d cwmax=%d aifs=%d txop_limit=%d\n",
++ hapd->mld_link_id, ac, acp->cwmin, acp->cwmax, acp->aifs, acp->txop_limit);
++
++ while ((token = str_token(pos, " ", &context))) {
++ if (os_strncmp(token, "cwmin=", 6) == 0) {
++ acp->cwmin = atoi(token + 6);
++ continue;
++ }
++
++ if (os_strncmp(token, "cwmax=", 6) == 0) {
++ acp->cwmax = atoi(token + 6);
++ continue;
++ }
++
++ if (os_strncmp(token, "aifs=", 5) == 0) {
++ acp->aifs = atoi(token + 5);
++ continue;
++ }
++
++ if (os_strncmp(token, "txop_limit=", 11) == 0) {
++ acp->txop_limit = atoi(token + 11);
++ continue;
++ }
++
++ wpa_printf(MSG_ERROR, "CTRL: Invalid WMM parameter: %s", token);
++ return -1;
++ }
++
++ if (acp->cwmin > acp->cwmax)
++ return -1;
++
++ ieee802_11_set_bss_critical_update(hapd, BSS_CRIT_UPDATE_EVENT_EDCA);
++
++ if (ieee802_11_set_beacon(hapd))
++ return -1;
++
++ return os_snprintf(buf, buflen, "OK\n");
++}
++
+ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+ char *buf, char *reply,
+ int reply_size,
+@@ -5946,6 +6031,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+ } else if (os_strncmp(buf, "DUMP_CSI ", 8) == 0) {
+ reply_len = hostapd_ctrl_iface_dump_csi(hapd, buf + 9,
+ reply, reply_size);
++ } else if (os_strncmp(buf, "WMM", 3) == 0) {
++ reply_len = hostapd_ctrl_iface_wmm(hapd, buf + 4,
++ reply, reply_size);
+ } else {
+ os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
+ reply_len = 16;
+diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
+index 4e94db21d..e578c5b7e 100644
+--- a/hostapd/hostapd_cli.c
++++ b/hostapd/hostapd_cli.c
+@@ -1767,6 +1767,12 @@ static int hostapd_cli_cmd_get_pp(struct wpa_ctrl *ctrl, int argc,
+ return hostapd_cli_cmd(ctrl, "get_pp", 1, argc, argv);
+ }
+
++static int hostapd_cli_cmd_wmm(struct wpa_ctrl *ctrl, int argc,
++ char *argv[])
++{
++ return hostapd_cli_cmd(ctrl, "WMM", 1, argc, argv);
++}
++
+ struct hostapd_cli_cmd {
+ const char *cmd;
+ int (*handler)(struct wpa_ctrl *ctrl, int argc, char *argv[]);
+@@ -2023,6 +2029,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+ " = Set preamble puncture mode"},
+ { "get_pp", hostapd_cli_cmd_get_pp, NULL,
+ " = Get preamble puncture status"},
++ { "wmm", hostapd_cli_cmd_wmm, NULL,
++ " = <ac> [cwmin=] [cwmax=] [aifs=] [txop_limit=]"},
+ { NULL, NULL, NULL, NULL }
+ };
+
+diff --git a/hostapd/main.c b/hostapd/main.c
+index e790f18ce..8ecec6c1a 100644
+--- a/hostapd/main.c
++++ b/hostapd/main.c
+@@ -330,8 +330,8 @@ setup_mld:
+ return -1;
+ }
+
+- /* Initialize the BSS parameter change to 1 */
+- hapd->eht_mld_bss_param_change = 1;
++ /* Initialize the BSS parameter change to 0 */
++ hapd->eht_mld_bss_param_change = 0;
+
+ wpa_printf(MSG_DEBUG,
+ "MLD: Set link_id=%u, mld_addr=" MACSTR
+diff --git a/src/ap/beacon.c b/src/ap/beacon.c
+index 88e35acc2..9b5c4fc1e 100644
+--- a/src/ap/beacon.c
++++ b/src/ap/beacon.c
+@@ -514,6 +514,23 @@ static u8 * hostapd_eid_ecsa(struct hostapd_data *hapd, u8 *eid)
+ }
+
+
++static u8 * hostapd_eid_max_chsw_time(struct hostapd_data *hapd, u8 *eid)
++{
++ u32 max_chsw_time = 800;
++
++ if (!hapd->cs_freq_params.channel)
++ return eid;
++
++ *eid++ = WLAN_EID_EXTENSION;
++ *eid++ = 4;
++ *eid++ = WLAN_EID_EXT_MAX_CHANNEL_SWITCH_TIME;
++ WPA_PUT_LE24(eid, max_chsw_time);
++ eid += 3;
++
++ return eid;
++}
++
++
+ static u8 * hostapd_eid_supported_op_classes(struct hostapd_data *hapd, u8 *eid)
+ {
+ u8 op_class, channel;
+@@ -878,6 +895,7 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd,
+ #endif /* CONFIG_IEEE80211AX */
+
+ pos = hostapd_eid_wb_chsw_wrapper(hapd, pos);
++ pos = hostapd_eid_max_chsw_time(hapd, pos);
+
+ if (!params->is_ml_sta_info)
+ pos = hostapd_eid_rnr(hapd, pos, WLAN_FC_STYPE_PROBE_RESP,
+@@ -2185,6 +2203,63 @@ static u8 * hostapd_fils_discovery(struct hostapd_data *hapd,
+ #endif /* CONFIG_FILS */
+
+
++static void hostapd_fill_bcn_sta_profile(struct hostapd_data *hapd,
++ struct mld_info *info)
++{
++ struct hostapd_data *h;
++
++ if (!info)
++ return;
++
++ os_memset(info, 0, sizeof(*info));
++
++ for_each_mld_link(h, hapd) {
++ unsigned int link_id = h->mld_link_id;
++ struct mld_link_info *link = &info->links[link_id];
++ u8 *epos, *csa_pos, buf[EHT_ML_MAX_STA_PROF_LEN];
++
++ if (!h->started || h == hapd ||
++ h->eht_mld_bss_critical_update != BSS_CRIT_UPDATE_ALL)
++ continue;
++
++ link->valid = true;
++ os_memcpy(link->local_addr, h->own_addr, ETH_ALEN);
++
++ /* Build per-STA profile */
++ epos = buf;
++ /* Capabilities */
++ WPA_PUT_LE16(epos, hostapd_own_capab_info(h));
++ epos += 2;
++
++ /* CSA IE */
++ csa_pos = hostapd_eid_csa(h, epos);
++ if (csa_pos != epos)
++ link->sta_prof_csa_offset = csa_pos - 1 - buf;
++ epos = csa_pos;
++
++ /* eCSA IE */
++ csa_pos = hostapd_eid_ecsa(h, epos);
++ if (csa_pos != epos)
++ link->sta_prof_ecsa_offset = csa_pos - 1 - buf;
++ epos = csa_pos;
++
++ /* channel switch wrapper */
++ epos = hostapd_eid_wb_chsw_wrapper(h, epos);
++
++ /* max channel switch time */
++ epos = hostapd_eid_max_chsw_time(h, epos);
++
++ link->resp_sta_profile_len = epos - buf;
++ link->resp_sta_profile = os_memdup(buf, link->resp_sta_profile_len);
++
++ /* TODO:
++ * 1. add other IEs
++ * 2. handle per-STA profile inheritance
++ * 3. handle csa offset if fragmentation is required
++ */
++ }
++}
++
+ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
+ struct wpa_driver_ap_params *params)
+ {
+@@ -2394,6 +2469,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
+ #endif /* CONFIG_IEEE80211AX */
+
+ tailpos = hostapd_eid_wb_chsw_wrapper(hapd, tailpos);
++ tailpos = hostapd_eid_max_chsw_time(hapd, tailpos);
+
+ tailpos = hostapd_eid_rnr(hapd, tailpos, WLAN_FC_STYPE_BEACON, true);
+ tailpos = hostapd_eid_fils_indic(hapd, tailpos, 0);
+@@ -2423,9 +2499,30 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
+
+ #ifdef CONFIG_IEEE80211BE
+ if (hapd->iconf->ieee80211be && !hapd->conf->disable_11be) {
+- if (hapd->conf->mld_ap)
+- tailpos = hostapd_eid_eht_ml_beacon(hapd, NULL,
++ if (hapd->conf->mld_ap) {
++ struct hostapd_data *h;
++ struct mld_info info;
++ struct mld_link_info *link;
++ u32 base;
++ u8 link_id, *ml_pos = tailpos;
++
++ hostapd_fill_bcn_sta_profile(hapd, &info);
++ tailpos = hostapd_eid_eht_ml_beacon(hapd, &info,
+ tailpos, false);
++
++ for_each_mld_link(h, hapd) {
++ link_id = h->mld_link_id;
++ link = &info.links[link_id];
++ base = ml_pos - tail + link->sta_prof_offset;
++ if (link->sta_prof_csa_offset)
++ hapd->cs_c_off_sta_prof[link_id] =
++ base + link->sta_prof_csa_offset;
++ if (link->sta_prof_ecsa_offset)
++ hapd->cs_c_off_ecsa_sta_prof[link_id] =
++ base + link->sta_prof_ecsa_offset;
++ }
++ ap_sta_free_sta_profile(&info);
++ }
+ tailpos = hostapd_eid_eht_capab(hapd, tailpos,
+ IEEE80211_MODE_AP);
+ tailpos = hostapd_eid_eht_operation(hapd, tailpos);
+@@ -2803,7 +2900,8 @@ void ieee802_11_set_beacon_per_bss_only(struct hostapd_data *hapd)
+ int ieee802_11_set_beacon(struct hostapd_data *hapd)
+ {
+ struct hostapd_iface *iface = hapd->iface;
+- int ret;
++ struct hostapd_data *h;
++ int ret, link_id;
+ size_t i, j;
+ bool is_6g, hapd_mld = false;
+
+@@ -2846,6 +2944,17 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
+ }
+ }
+
++#ifdef CONFIG_IEEE80211BE
++ /* clear critical update flag for UPDATE_SINGLE type, for other types,
++ * we should get some notified events from driver
++ */
++ if (hapd->conf->mld_ap) {
++ for_each_mld_link(h, hapd)
++ if (h->eht_mld_bss_critical_update == BSS_CRIT_UPDATE_SINGLE)
++ h->eht_mld_bss_critical_update = 0;
++ }
++#endif /* CONFIG_IEEE80211BE */
++
+ return 0;
+ }
+
+@@ -2880,4 +2989,50 @@ int ieee802_11_update_beacons(struct hostapd_iface *iface)
+ return ret;
+ }
+
++
++int ieee802_11_set_bss_critical_update(struct hostapd_data *hapd,
++ enum bss_crit_update_event event)
++{
++ if (!hapd->conf->mld_ap)
++ return 0;
++
++ switch (event) {
++ case BSS_CRIT_UPDATE_EVENT_CSA:
++ case BSS_CRIT_UPDATE_EVENT_ECSA:
++ case BSS_CRIT_UPDATE_EVENT_QUIET:
++ case BSS_CRIT_UPDATE_EVENT_WBCS:
++ case BSS_CRIT_UPDATE_EVENT_CS_WRAP:
++ case BSS_CRIT_UPDATE_EVENT_OP_MODE_NOTIF:
++ case BSS_CRIT_UPDATE_EVENT_QUIET_CH:
++ case BSS_CRIT_UPDATE_EVENT_CCA:
++ case BSS_CRIT_UPDATE_EVENT_BCAST_TWT:
++ case BSS_CRIT_UPDATE_EVENT_BCAST_TWT_PARAM_SET:
++ case BSS_CRIT_UPDATE_EVENT_IDX_ADJUST_FACTOR:
++ case BSS_CRIT_UPDATE_EVENT_TPE:
++ hapd->eht_mld_bss_param_change += 1;
++ hapd->eht_mld_bss_critical_update = BSS_CRIT_UPDATE_ALL;
++ return 0;
++ case BSS_CRIT_UPDATE_EVENT_EDCA:
++ case BSS_CRIT_UPDATE_EVENT_DSSS:
++ case BSS_CRIT_UPDATE_EVENT_HT_OPERATION:
++ case BSS_CRIT_UPDATE_EVENT_VHT_OPERATION:
++ case BSS_CRIT_UPDATE_EVENT_HE_OPERATION:
++ case BSS_CRIT_UPDATE_EVENT_MU_EDCA:
++ case BSS_CRIT_UPDATE_EVENT_SR:
++ case BSS_CRIT_UPDATE_EVENT_UORA:
++ case BSS_CRIT_UPDATE_EVENT_EHT_OPERATION:
++ hapd->eht_mld_bss_param_change += 1;
++ hapd->eht_mld_bss_critical_update = BSS_CRIT_UPDATE_SINGLE;
++ return 0;
++ case BSS_CRIT_UPDATE_EVENT_RECONFIG:
++ case BSS_CRIT_UPDATE_EVENT_ADD_LINK:
++ case BSS_CRIT_UPDATE_EVENT_ATTLM:
++ hapd->eht_mld_bss_critical_update = BSS_CRIT_UPDATE_FLAG;
++ return 0;
++ default:
++ hapd->eht_mld_bss_critical_update = BSS_CRIT_UPDATE_NONE;
++ return -1;
++ }
++}
++
+ #endif /* CONFIG_NATIVE_WINDOWS */
+diff --git a/src/ap/beacon.h b/src/ap/beacon.h
+index e381542a8..809393902 100644
+--- a/src/ap/beacon.h
++++ b/src/ap/beacon.h
+@@ -12,12 +12,49 @@
+
+ struct ieee80211_mgmt;
+
++enum bss_crit_update_event {
++ BSS_CRIT_UPDATE_EVENT_CSA,
++ BSS_CRIT_UPDATE_EVENT_ECSA,
++ BSS_CRIT_UPDATE_EVENT_EDCA,
++ BSS_CRIT_UPDATE_EVENT_QUIET,
++ BSS_CRIT_UPDATE_EVENT_DSSS,
++ BSS_CRIT_UPDATE_EVENT_HT_OPERATION,
++ BSS_CRIT_UPDATE_EVENT_WBCS,
++ BSS_CRIT_UPDATE_EVENT_CS_WRAP,
++ BSS_CRIT_UPDATE_EVENT_OP_MODE_NOTIF,
++ BSS_CRIT_UPDATE_EVENT_QUIET_CH,
++ BSS_CRIT_UPDATE_EVENT_VHT_OPERATION,
++ BSS_CRIT_UPDATE_EVENT_HE_OPERATION,
++ BSS_CRIT_UPDATE_EVENT_BCAST_TWT,
++ BSS_CRIT_UPDATE_EVENT_BCAST_TWT_PARAM_SET,
++ BSS_CRIT_UPDATE_EVENT_CCA,
++ BSS_CRIT_UPDATE_EVENT_MU_EDCA,
++ BSS_CRIT_UPDATE_EVENT_SR,
++ BSS_CRIT_UPDATE_EVENT_UORA,
++ BSS_CRIT_UPDATE_EVENT_IDX_ADJUST_FACTOR,
++ BSS_CRIT_UPDATE_EVENT_EHT_OPERATION,
++ BSS_CRIT_UPDATE_EVENT_TPE,
++ BSS_CRIT_UPDATE_EVENT_CH_CHANGED,
++ BSS_CRIT_UPDATE_EVENT_RECONFIG,
++ BSS_CRIT_UPDATE_EVENT_ADD_LINK,
++ BSS_CRIT_UPDATE_EVENT_ATTLM
++};
++
++enum {
++ BSS_CRIT_UPDATE_NONE,
++ BSS_CRIT_UPDATE_SINGLE,
++ BSS_CRIT_UPDATE_ALL,
++ BSS_CRIT_UPDATE_FLAG
++};
++
+ void handle_probe_req(struct hostapd_data *hapd,
+ const struct ieee80211_mgmt *mgmt, size_t len,
+ int ssi_signal);
+ void ieee802_11_set_beacon_per_bss_only(struct hostapd_data *hapd);
+ int ieee802_11_set_beacon(struct hostapd_data *hapd);
+ int ieee802_11_set_beacons(struct hostapd_iface *iface);
++int ieee802_11_set_bss_critical_update(struct hostapd_data *hapd,
++ enum bss_crit_update_event event);
+ int ieee802_11_update_beacons(struct hostapd_iface *iface);
+ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
+ struct wpa_driver_ap_params *params);
+diff --git a/src/ap/dfs.c b/src/ap/dfs.c
+index fc7699973..697e6364c 100644
+--- a/src/ap/dfs.c
++++ b/src/ap/dfs.c
+@@ -1120,6 +1120,18 @@ static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface,
+ err = hostapd_switch_channel(iface->bss[i], &csa_settings);
+ if (err)
+ num_err++;
++
++#ifdef CONFIG_IEEE80211BE
++ if (iface->bss[i]->conf->mld_ap)
++ hostapd_update_aff_link_beacon(iface->bss[i], csa_settings.cs_count);
++
++ /*
++ * Currently, no FW notification event for clearing CU flag after DTIM period.
++ * Also, another CU or set beacon is not allowed during CSA period.
++ * Therefore, just clear it manually here for workaround.
++ */
++ iface->bss[i]->eht_mld_bss_critical_update = 0;
++#endif /* CONFIG_IEEE80211BE */
+ }
+
+ if (num_err == iface->num_bss) {
+diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
+index 1107fd70e..705acfb67 100644
+--- a/src/ap/drv_callbacks.c
++++ b/src/ap/drv_callbacks.c
+@@ -1314,7 +1314,6 @@ void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht,
+ if (hapd->csa_in_progress &&
+ freq == hapd->cs_freq_params.freq) {
+ hostapd_cleanup_cs_params(hapd);
+- ieee802_11_set_beacon(hapd);
+
+ wpa_msg(hapd->msg_ctx, MSG_INFO, AP_CSA_FINISHED
+ "freq=%d dfs=%d", freq, is_dfs);
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index 2c9e54b23..f03a6242f 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -4524,6 +4524,9 @@ static int hostapd_fill_csa_settings(struct hostapd_data *hapd,
+ old_punct_bitmap = iface->conf->punct_bitmap;
+ iface->conf->punct_bitmap = settings->punct_bitmap;
+ #endif /* CONFIG_IEEE80211BE */
++
++ /* Another CU in the new channel due to OP element modification */
++ ieee802_11_set_bss_critical_update(hapd, BSS_CRIT_UPDATE_EVENT_EHT_OPERATION);
+ ret = hostapd_build_beacon_data(hapd, &settings->beacon_after);
+
+ /* change back the configuration */
+@@ -4541,20 +4544,32 @@ static int hostapd_fill_csa_settings(struct hostapd_data *hapd,
+ hapd->cs_count = settings->cs_count;
+ hapd->cs_block_tx = settings->block_tx;
+
++#ifdef CONFIG_IEEE80211BE
++ /* Restore BPCC to build the CSA beacon */
++ hapd->eht_mld_bss_param_change--;
++ hapd->eht_mld_bss_critical_update = BSS_CRIT_UPDATE_ALL;
++#endif /* CONFIG_IEEE80211BE */
++
+ ret = hostapd_build_beacon_data(hapd, &settings->beacon_csa);
+ if (ret) {
+ free_beacon_data(&settings->beacon_after);
+ return ret;
+ }
+
++ /* Change back to the final BPCC and CU flag */
++ ieee802_11_set_bss_critical_update(hapd, BSS_CRIT_UPDATE_EVENT_EHT_OPERATION);
++
+ settings->counter_offset_beacon[0] = hapd->cs_c_off_beacon;
+ settings->counter_offset_presp[0] = hapd->cs_c_off_proberesp;
+ settings->counter_offset_beacon[1] = hapd->cs_c_off_ecsa_beacon;
+ settings->counter_offset_presp[1] = hapd->cs_c_off_ecsa_proberesp;
+ settings->link_id = -1;
++ settings->freq_params.link_id = -1;
+ #ifdef CONFIG_IEEE80211BE
+- if (hapd->conf->mld_ap)
++ if (hapd->conf->mld_ap) {
+ settings->link_id = hapd->mld_link_id;
++ settings->freq_params.link_id = hapd->mld_link_id;
++ }
+ #endif /* CONFIG_IEEE80211BE */
+
+ #ifdef CONFIG_IEEE80211AX
+@@ -4616,6 +4631,8 @@ int hostapd_switch_channel(struct hostapd_data *hapd,
+ return -1;
+ }
+
++ ieee802_11_set_bss_critical_update(hapd, BSS_CRIT_UPDATE_EVENT_CSA);
++
+ ret = hostapd_fill_csa_settings(hapd, settings);
+ if (ret)
+ return ret;
+@@ -4637,6 +4654,72 @@ int hostapd_switch_channel(struct hostapd_data *hapd,
+ return 0;
+ }
+
++int hostapd_update_aff_link_beacon(struct hostapd_data *hapd, u8 cs_count)
++{
++ struct hostapd_data *h;
++ unsigned int cs_link_id = hapd->mld_link_id;
++ int cs_channel = hapd->cs_freq_params.channel;
++
++ /* TODO: add beacon offload driver flag */
++ for_each_mld_link(h, hapd) {
++ struct hostapd_config *conf = h->iconf;
++ struct hostapd_hw_modes *mode = h->iface->current_mode;
++ struct csa_settings settings = {};
++ unsigned int link_id = h->mld_link_id;
++ int ret;
++
++ if (!h->started || h == hapd)
++ continue;
++
++ hostapd_set_freq_params(&settings.freq_params, conf->hw_mode,
++ hostapd_hw_get_freq(h, conf->channel),
++ conf->channel, conf->enable_edmg,
++ conf->edmg_channel, conf->ieee80211n,
++ conf->ieee80211ac, conf->ieee80211ax,
++ conf->ieee80211be, conf->secondary_channel,
++ hostapd_get_oper_chwidth(conf),
++ hostapd_get_oper_centr_freq_seg0_idx(conf),
++ hostapd_get_oper_centr_freq_seg1_idx(conf),
++ conf->vht_capab,
++ mode ? &mode->he_capab[IEEE80211_MODE_AP] : NULL,
++ mode ? &mode->eht_capab[IEEE80211_MODE_AP] : NULL,
++ hostapd_get_punct_bitmap(h));
++ hapd->cs_freq_params.channel = 0;
++ ret = hostapd_build_beacon_data(h, &settings.beacon_after);
++ if (ret)
++ return ret;
++
++ hapd->cs_freq_params.channel = cs_channel;
++ /* Restore BPCC to build the RNR for the CS link */
++ hapd->eht_mld_bss_param_change--;
++ hapd->eht_mld_bss_critical_update = BSS_CRIT_UPDATE_ALL;
++ ret = hostapd_build_beacon_data(h, &settings.beacon_csa);
++ if (ret) {
++ free_beacon_data(&settings.beacon_after);
++ return ret;
++ }
++
++ /* Change back to the final BPCC and CU flag */
++ ieee802_11_set_bss_critical_update(hapd, BSS_CRIT_UPDATE_EVENT_EHT_OPERATION);
++
++ settings.counter_offset_sta_prof[cs_link_id][0] =
++ h->cs_c_off_sta_prof[cs_link_id];
++ settings.counter_offset_sta_prof[cs_link_id][1] =
++ h->cs_c_off_ecsa_sta_prof[cs_link_id];
++ settings.link_id = cs_link_id;
++ settings.freq_params.link_id = link_id;
++ settings.cs_count = cs_count;
++ settings.punct_bitmap = conf->punct_bitmap;
++ ret = hostapd_drv_switch_channel(h, &settings);
++ free_beacon_data(&settings.beacon_csa);
++ free_beacon_data(&settings.beacon_after);
++ if (ret)
++ return ret;
++ }
++
++ return 0;
++}
++
+
+ void
+ hostapd_switch_channel_fallback(struct hostapd_iface *iface,
+diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
+index 4db67096b..99d5a01d6 100644
+--- a/src/ap/hostapd.h
++++ b/src/ap/hostapd.h
+@@ -342,6 +342,9 @@ struct hostapd_data {
+ unsigned int cs_c_off_ecsa_beacon;
+ unsigned int cs_c_off_ecsa_proberesp;
+
++ unsigned int cs_c_off_sta_prof[MAX_NUM_MLD_LINKS];
++ unsigned int cs_c_off_ecsa_sta_prof[MAX_NUM_MLD_LINKS];
++
+ #ifdef CONFIG_IEEE80211AX
+ bool cca_in_progress;
+ u8 cca_count;
+@@ -501,6 +504,7 @@ struct hostapd_data {
+
+ #ifdef CONFIG_IEEE80211BE
+ u8 eht_mld_bss_param_change;
++ u8 eht_mld_bss_critical_update;
+ struct hostapd_mld *mld;
+ struct dl_list link;
+ u8 mld_link_id;
+@@ -850,6 +854,7 @@ void hostapd_chan_switch_config(struct hostapd_data *hapd,
+ struct hostapd_freq_params *freq_params);
+ int hostapd_switch_channel(struct hostapd_data *hapd,
+ struct csa_settings *settings);
++int hostapd_update_aff_link_beacon(struct hostapd_data *hapd, u8 cs_count);
+ void
+ hostapd_switch_channel_fallback(struct hostapd_iface *iface,
+ const struct hostapd_freq_params *freq_params);
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index 1365bc822..bb508fe79 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -282,6 +282,7 @@ u8 * hostapd_eid_rm_enabled_capab(struct hostapd_data *hapd, u8 *eid,
+
+ u16 hostapd_own_capab_info(struct hostapd_data *hapd)
+ {
++ struct hostapd_data *h;
+ int capab = WLAN_CAPABILITY_ESS;
+ int privacy = 0;
+ int dfs;
+@@ -342,6 +343,18 @@ u16 hostapd_own_capab_info(struct hostapd_data *hapd)
+ }
+ }
+
++#ifdef CONFIG_IEEE80211BE
++ if (hapd->conf->mld_ap) {
++ for_each_mld_link(h, hapd) {
++ if (h->eht_mld_bss_critical_update) {
++ capab |= WLAN_CAPABILITY_PBCC;
++ break;
++ }
++ }
++ }
++#endif /* CONFIG_IEEE80211BE */
++
++
+ return capab;
+ }
+
+@@ -7838,6 +7851,8 @@ static bool hostapd_eid_rnr_bss(struct hostapd_data *hapd,
+ (MAX_NUM_MLD_LINKS | 0xF0);
+ /* BPCC (Bit 3 to Bit 0) */
+ *eid = is_partner ? ((param_ch & 0xF0) >> 4) : 0x0F;
++ if (bss->eht_mld_bss_critical_update == BSS_CRIT_UPDATE_ALL)
++ *eid |= RNR_TBTT_INFO_MLD_PARAM2_ALL_UPDATE_INC;
+ #ifdef CONFIG_TESTING_OPTIONS
+ if (bss->conf->mld_indicate_disabled)
+ *eid |= RNR_TBTT_INFO_MLD_PARAM2_LINK_DISABLED;
+diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
+index a04eb23e0..2b5c06d6d 100644
+--- a/src/ap/ieee802_11_eht.c
++++ b/src/ap/ieee802_11_eht.c
+@@ -495,7 +495,7 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd,
+ wpabuf_put_u8(buf, hapd->mld_link_id);
+
+ /* Currently hard code the BSS Parameters Change Count to 0x1 */
+- wpabuf_put_u8(buf, 0x1);
++ wpabuf_put_u8(buf, hapd->eht_mld_bss_param_change);
+
+ wpa_printf(MSG_DEBUG, "MLD: EML Capabilities=0x%x",
+ hapd->iface->mld_eml_capa);
+@@ -593,11 +593,14 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd,
+ wpabuf_put_u8(buf, link_bss->conf->dtim_period);
+
+ /* BSS Parameters Change Count */
+- wpabuf_put_u8(buf, hapd->eht_mld_bss_param_change);
++ wpabuf_put_u8(buf, link_bss->eht_mld_bss_param_change);
+
+ if (!link->resp_sta_profile)
+ continue;
+
++#define EXT_EID_TAG_LEN 3
++ link->sta_prof_offset = wpabuf_len(buf) + EXT_EID_TAG_LEN;
++
+ /* Fragment the sub element if needed */
+ if (total_len <= 255) {
+ wpabuf_put_data(buf, link->resp_sta_profile,
+diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h
+index 67b97671a..60b33f049 100644
+--- a/src/ap/sta_info.h
++++ b/src/ap/sta_info.h
+@@ -89,6 +89,12 @@ struct mld_info {
+ u16 status;
+ u16 resp_sta_profile_len;
+ u8 *resp_sta_profile;
++
++ u32 sta_prof_csa_offset;
++ u32 sta_prof_ecsa_offset;
++ u32 sta_prof_offset;
++
++ const u8 *rsne, *rsnxe;
+ } links[MAX_NUM_MLD_LINKS];
+ };
+
+diff --git a/src/ap/ucode.c b/src/ap/ucode.c
+index da1c4c1ac..a72193282 100644
+--- a/src/ap/ucode.c
++++ b/src/ap/ucode.c
+@@ -738,9 +738,16 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
+ wpa_printf(MSG_INFO, " * center_freq2 is %d\n",
+ csa.freq_params.center_freq2);
+
+- for (i = 0; i < iface->num_bss; i++)
++ for (i = 0; i < iface->num_bss; i++) {
+ ret = hostapd_switch_channel(iface->bss[i], &csa);
+
++ if (iface->bss[i]->conf->mld_ap)
++ hostapd_update_aff_link_beacon(iface->bss[i], csa.cs_count);
++
++ /* FIXME: remove this line after CU event merged */
++ iface->bss[i]->eht_mld_bss_critical_update = 0;
++ }
++
+ return ucv_boolean_new(!ret);
+ }
+
+diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
+index c380d0c7e..efb584c66 100644
+--- a/src/common/ieee802_11_defs.h
++++ b/src/common/ieee802_11_defs.h
+@@ -504,6 +504,7 @@
+ #define WLAN_EID_EXT_HE_MU_EDCA_PARAMS 38
+ #define WLAN_EID_EXT_SPATIAL_REUSE 39
+ #define WLAN_EID_EXT_COLOR_CHANGE_ANNOUNCEMENT 42
++#define WLAN_EID_EXT_MAX_CHANNEL_SWITCH_TIME 52
+ #define WLAN_EID_EXT_OCV_OCI 54
+ #define WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION 55
+ #define WLAN_EID_EXT_NON_INHERITANCE 56
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index b75580374..924a1baba 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -2763,6 +2763,7 @@ struct csa_settings {
+
+ u16 counter_offset_beacon[2];
+ u16 counter_offset_presp[2];
++ u16 counter_offset_sta_prof[MAX_NUM_MLD_LINKS][2];
+
+ u16 punct_bitmap;
+ int link_id;
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index 8b64c3983..555c97bf7 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -11417,9 +11417,10 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings)
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+ struct nlattr *beacon_csa;
+- int ret = -ENOBUFS;
+- int csa_off_len = 0;
+- int i;
++ int i, csa_off_len = 0, ret = -ENOBUFS;
++ unsigned int cs_link_id = settings->link_id;
++ u16 *counter_offset_beacon = settings->counter_offset_beacon;
++ u16 *counter_offset_presp = settings->counter_offset_presp;
+
+ wpa_printf(MSG_DEBUG,
+ "nl80211: Channel switch request (cs_count=%u block_tx=%u freq=%d channel=%d sec_channel_offset=%d width=%d cf1=%d cf2=%d puncturing_bitmap=0x%04x link_id=%d%s%s%s)",
+@@ -11431,7 +11432,7 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings)
+ settings->freq_params.center_freq1,
+ settings->freq_params.center_freq2,
+ settings->punct_bitmap,
+- settings->link_id,
++ settings->freq_params.link_id,
+ settings->freq_params.ht_enabled ? " ht" : "",
+ settings->freq_params.vht_enabled ? " vht" : "",
+ settings->freq_params.he_enabled ? " he" : "");
+@@ -11451,18 +11452,19 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings)
+ * counters match. This implementation assumes that there are only two
+ * counters.
+ */
+- if (settings->counter_offset_beacon[0] &&
+- !settings->counter_offset_beacon[1]) {
++ if (cs_link_id != settings->freq_params.link_id) {
++ counter_offset_beacon = settings->counter_offset_sta_prof[cs_link_id];
++ counter_offset_presp = NULL;
++ }
++
++ if (counter_offset_beacon[0] && !counter_offset_beacon[1]) {
+ csa_off_len = 1;
+- } else if (settings->counter_offset_beacon[1] &&
+- !settings->counter_offset_beacon[0]) {
++ } else if (counter_offset_beacon[1] && !counter_offset_beacon[0]) {
+ csa_off_len = 1;
+- settings->counter_offset_beacon[0] =
+- settings->counter_offset_beacon[1];
+- settings->counter_offset_presp[0] =
+- settings->counter_offset_presp[1];
+- } else if (settings->counter_offset_beacon[1] &&
+- settings->counter_offset_beacon[0]) {
++ counter_offset_beacon[0] = counter_offset_beacon[1];
++ if (counter_offset_presp)
++ counter_offset_presp[0] = counter_offset_presp[1];
++ } else if (counter_offset_beacon[1] && counter_offset_beacon[0]) {
+ csa_off_len = 2;
+ } else {
+ wpa_printf(MSG_ERROR, "nl80211: No CSA counters provided");
+@@ -11481,14 +11483,18 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings)
+ return -EINVAL;
+
+ for (i = 0; i < csa_off_len; i++) {
+- u16 csa_c_off_bcn = settings->counter_offset_beacon[i];
+- u16 csa_c_off_presp = settings->counter_offset_presp[i];
++ u16 csa_c_off_bcn = counter_offset_beacon[i];
++ u16 csa_c_off_presp;
+
+ if ((settings->beacon_csa.tail_len <= csa_c_off_bcn) ||
+ (settings->beacon_csa.tail[csa_c_off_bcn] !=
+ settings->cs_count))
+ return -EINVAL;
+
++ if (!counter_offset_presp)
++ continue;
++
++ csa_c_off_presp = counter_offset_presp[i];
+ if (settings->beacon_csa.probe_resp &&
+ ((settings->beacon_csa.probe_resp_len <=
+ csa_c_off_presp) ||
+@@ -11506,8 +11512,8 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings)
+ (settings->punct_bitmap &&
+ nla_put_u32(msg, NL80211_ATTR_PUNCT_BITMAP,
+ settings->punct_bitmap)) ||
+- (settings->link_id != NL80211_DRV_LINK_ID_NA &&
+- nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, settings->link_id)))
++ (settings->freq_params.link_id != NL80211_DRV_LINK_ID_NA &&
++ nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, settings->freq_params.link_id)))
+ goto error;
+
+ /* beacon_after params */
+@@ -11528,9 +11534,14 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings)
+ if (ret)
+ goto error;
+
+- if (nla_put(msg, NL80211_ATTR_CSA_C_OFF_BEACON,
+- csa_off_len * sizeof(u16),
+- settings->counter_offset_beacon) ||
++ if ((cs_link_id == settings->freq_params.link_id &&
++ nla_put(msg, NL80211_ATTR_CSA_C_OFF_BEACON,
++ csa_off_len * sizeof(u16),
++ settings->counter_offset_beacon)) ||
++ (cs_link_id != settings->freq_params.link_id &&
++ nla_put(msg, NL80211_ATTR_CSA_C_OFF_STA_PROF,
++ csa_off_len * sizeof(u16),
++ settings->counter_offset_sta_prof[cs_link_id])) ||
+ (settings->beacon_csa.probe_resp &&
+ nla_put(msg, NL80211_ATTR_CSA_C_OFF_PRESP,
+ csa_off_len * sizeof(u16),
+diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h
+index d425c797c..13837297c 100644
+--- a/src/drivers/nl80211_copy.h
++++ b/src/drivers/nl80211_copy.h
+@@ -2868,6 +2868,10 @@ enum nl80211_commands {
+ * nested item, it contains attributes defined in
+ * &enum nl80211_if_combination_attrs.
+ *
++ * @NL80211_ATTR_CNTDWN_OFFS_STA_PROF: An array of offsets (u16) to the channel
++ * switch or color change counters in the per-STA profile corresponding to
++ * the affected AP.
++ *
+ * @NUM_NL80211_ATTR: total number of nl80211_attrs available
+ * @NL80211_ATTR_MAX: highest attribute number currently defined
+ * @__NL80211_ATTR_AFTER_LAST: internal use
+@@ -3418,6 +3422,9 @@ enum nl80211_attrs {
+
+ /* add attributes here, update the policy in nl80211.c */
+
++ /* MTK internal */
++ NL80211_ATTR_CNTDWN_OFFS_STA_PROF,
++
+ __NL80211_ATTR_AFTER_LAST,
+ NUM_NL80211_ATTR = __NL80211_ATTR_AFTER_LAST,
+ NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
+@@ -3430,6 +3437,7 @@ enum nl80211_attrs {
+ #define NL80211_ATTR_SAE_DATA NL80211_ATTR_AUTH_DATA
+ #define NL80211_ATTR_CSA_C_OFF_BEACON NL80211_ATTR_CNTDWN_OFFS_BEACON
+ #define NL80211_ATTR_CSA_C_OFF_PRESP NL80211_ATTR_CNTDWN_OFFS_PRESP
++#define NL80211_ATTR_CSA_C_OFF_STA_PROF NL80211_ATTR_CNTDWN_OFFS_STA_PROF
+
+ /*
+ * Allow user space programs to use #ifdef on new attributes by defining them
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0086-mtk-hostapd-add-support-for-emlsr.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0086-mtk-hostapd-add-support-for-emlsr.patch
new file mode 100644
index 0000000..0cf1d0b
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0086-mtk-hostapd-add-support-for-emlsr.patch
@@ -0,0 +1,733 @@
+From 093ac6b9d2f9c79b137f327af1eb0236ba71064a Mon Sep 17 00:00:00 2001
+From: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
+Date: Thu, 9 May 2024 15:41:18 +0800
+Subject: [PATCH 086/126] mtk: hostapd: add support for emlsr
+
+1. Processing the EML capability IE in the association request,
+and sending the value of EML field to the kernel.
+
+2. Processing the EML Operating Mode Notification frame,
+and sending the EML Operating Mode Notification frame if eml_resp is
+true.
+
+Command Usage:
+eml_resp -
+hostapd_cli -i <interface> eml_resp <enable>
+
+Processing the EML capability IE in the association request,
+and sending the value of EML field to the kernel.
+
+The original flow send the mcu command to the firmware using the WCID of
+the primary link. Therefore, a is passed in the hostapd layer
+to ensure that the EML OMN is processed and sent to the firmware using
+the WCID of the receiving link.
+
+Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
+---
+ hostapd/config_file.c | 4 +
+ hostapd/ctrl_iface.c | 36 +++++++++
+ hostapd/hostapd.conf | 10 +++
+ hostapd/hostapd_cli.c | 8 ++
+ src/ap/ap_config.h | 2 +
+ src/ap/ap_drv_ops.c | 20 ++++-
+ src/ap/ap_drv_ops.h | 4 +-
+ src/ap/apup.c | 4 +-
+ src/ap/ieee802_11.c | 8 +-
+ src/ap/ieee802_11.h | 4 +-
+ src/ap/ieee802_11_eht.c | 124 ++++++++++++++++++++++++++++--
+ src/ap/sta_info.c | 2 +-
+ src/common/ieee802_11_defs.h | 34 ++++++++
+ src/common/mtk_vendor.h | 15 ++++
+ src/drivers/driver.h | 12 +++
+ src/drivers/driver_nl80211.c | 53 +++++++++++++
+ src/drivers/driver_nl80211.h | 1 +
+ src/drivers/driver_nl80211_capa.c | 3 +
+ 18 files changed, 331 insertions(+), 13 deletions(-)
+
+diff --git a/hostapd/config_file.c b/hostapd/config_file.c
+index 206055b75..38273a4f2 100644
+--- a/hostapd/config_file.c
++++ b/hostapd/config_file.c
+@@ -5477,6 +5477,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+ }
+ } else if (os_strcmp(buf, "eht_bw320_offset") == 0) {
+ conf->eht_bw320_offset = atoi(pos);
++ } else if (os_strcmp(buf, "eml_disable") == 0) {
++ conf->eml_disable = atoi(pos);
++ } else if (os_strcmp(buf, "eml_resp") == 0) {
++ conf->eml_resp = atoi(pos);
+ #ifdef CONFIG_TESTING_OPTIONS
+ } else if (os_strcmp(buf, "eht_oper_puncturing_override") == 0) {
+ if (get_u16(pos, line, &bss->eht_oper_puncturing_override))
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index ebe9053cf..d9775e13e 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -5104,6 +5104,40 @@ hostapd_ctrl_iface_disable_beacon(struct hostapd_data *hapd, char *value,
+
+ }
+
++static int
++hostapd_ctrl_iface_set_eml_resp(struct hostapd_data *hapd, char *value,
++ char *buf, size_t buflen)
++{
++ struct hostapd_data *link;
++ int cnt = 0;
++ u16 *val;
++
++ if (!hostapd_is_mld_ap(hapd))
++ return -1;
++
++ cnt = hostapd_parse_argument_helper(value, &val);
++ if (cnt == -1)
++ goto fail;
++ if (cnt != 1 || val[0] < 0)
++ goto para_fail;
++
++ for_each_mld_link(link, hapd) {
++ link->iconf->eml_resp = val[0];
++ wpa_printf(MSG_ERROR, "Link:%d, Response EML:%d\n",
++ link->iconf->band_idx, link->iconf->eml_resp);
++ }
++
++ os_free(val);
++
++ return os_snprintf(buf, buflen, "OK\n");
++
++para_fail:
++ os_free(val);
++ wpa_printf(MSG_ERROR, "Input number or value is incorrect\n");
++fail:
++ return os_snprintf(buf, buflen, "FAIL\n");
++}
++
+ static int
+ hostapd_ctrl_iface_set_csi(struct hostapd_data *hapd, char *cmd,
+ char *buf, size_t buflen)
+@@ -6034,6 +6068,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+ } else if (os_strncmp(buf, "WMM", 3) == 0) {
+ reply_len = hostapd_ctrl_iface_wmm(hapd, buf + 4,
+ reply, reply_size);
++ } else if (os_strncmp(buf, "EML_RESP ", 9) == 0) {
++ reply_len = hostapd_ctrl_iface_set_eml_resp(hapd, buf + 9, reply, reply_size);
+ } else {
+ os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
+ reply_len = 16;
+diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
+index 118754800..d0830eecd 100644
+--- a/hostapd/hostapd.conf
++++ b/hostapd/hostapd.conf
+@@ -1149,6 +1149,16 @@ wmm_ac_vo_acm=0
+ # will be used as the AP MLD MAC address.
+ #mld_addr=02:03:04:05:06:07
+
++# EML Capabilities
++# 0 = Enable EML capabilities in Multi-Link Control subfield
++# 1 = Disable EML capabilitites in Multi-Link Control subfield
++#eml_disable=0
++
++# EML Operating Mode Notification frame
++# 0 = AP does not send EML Operating Mode Notification frame to the station
++# 1 = AP sends EML Operating Mode Notification frame to the station
++#eml_resp=1
++
+ ##### IEEE 802.1X-2004 related configuration ##################################
+
+ # Require IEEE 802.1X authorization
+diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
+index e578c5b7e..54fda5c45 100644
+--- a/hostapd/hostapd_cli.c
++++ b/hostapd/hostapd_cli.c
+@@ -1488,6 +1488,12 @@ static int hostapd_cli_cmd_disable_beacon(struct wpa_ctrl *ctrl, int argc,
+ return hostapd_cli_cmd(ctrl, "NO_BEACON", 1, argc, argv);
+ }
+
++static int hostapd_cli_cmd_set_eml_resp(struct wpa_ctrl *ctrl, int argc,
++ char *argv[])
++{
++ return hostapd_cli_cmd(ctrl, "EML_RESP", 1, argc, argv);
++}
++
+ #ifdef CONFIG_DPP
+
+ static int hostapd_cli_cmd_dpp_qr_code(struct wpa_ctrl *ctrl, int argc,
+@@ -1937,6 +1943,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+ " = show mu onoff value in 0-15 bitmap"},
+ { "no_beacon", hostapd_cli_cmd_disable_beacon, NULL,
+ "<value> 0: Enable beacon, 1: Disable beacon"},
++ { "eml_resp", hostapd_cli_cmd_set_eml_resp, NULL,
++ "<value> 0: AP does not send EML Operating Mode Notification frame, 1: AP sends EML OMN frame"},
+ #ifdef CONFIG_DPP
+ { "dpp_qr_code", hostapd_cli_cmd_dpp_qr_code, NULL,
+ "report a scanned DPP URI from a QR Code" },
+diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
+index 15b66ca30..9c3a28cf4 100644
+--- a/src/ap/ap_config.h
++++ b/src/ap/ap_config.h
+@@ -1281,6 +1281,8 @@ struct hostapd_config {
+ u8 punct_acs_threshold;
+ u8 eht_default_pe_duration;
+ u8 eht_bw320_offset;
++ u8 eml_disable;
++ u8 eml_resp;
+ #endif /* CONFIG_IEEE80211BE */
+
+ /* EHT enable/disable config from CHAN_SWITCH */
+diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
+index fb09a3290..2d2198a44 100644
+--- a/src/ap/ap_drv_ops.c
++++ b/src/ap/ap_drv_ops.c
+@@ -496,7 +496,8 @@ int hostapd_sta_add(struct hostapd_data *hapd,
+ size_t eht_capab_len,
+ const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab,
+ u32 flags, u8 qosinfo, u8 vht_opmode, int supp_p2p_ps,
+- int set, const u8 *link_addr, bool mld_link_sta)
++ int set, const u8 *link_addr, bool mld_link_sta,
++ u16 eml_capa)
+ {
+ struct hostapd_sta_add_params params;
+
+@@ -536,6 +537,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
+ params.mld_link_id = hapd->mld_link_id;
+ params.mld_link_addr = link_addr;
+ params.mld_link_sta = mld_link_sta;
++ params.eml_capa = eml_capa;
+ }
+ #endif /* CONFIG_IEEE80211BE */
+
+@@ -1448,6 +1450,22 @@ int hostapd_drv_beacon_ctrl(struct hostapd_data *hapd, u8 beacon_mode)
+ return hapd->driver->beacon_ctrl(hapd->drv_priv, beacon_mode);
+ }
+
++int hostapd_drv_set_eml_omn(struct hostapd_data *hapd, u8 *mac,
++ struct eml_omn_element *omn_ie)
++{
++ u8 link_id;
++
++ if (!hapd->driver || !hapd->driver->set_eml_omn)
++ return 0;
++
++ if (!hapd->conf->mld_ap)
++ return 0;
++
++ link_id = hapd->mld_link_id;
++
++ return hapd->driver->set_eml_omn(hapd->drv_priv, link_id, mac, omn_ie);
++}
++
+ int hostapd_drv_csi_set(struct hostapd_data *hapd, u8 mode, u8 cfg, u8 v1, u32 v2, u8 *mac)
+ {
+ if (!hapd->driver || !hapd->driver->csi_set)
+diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
+index 9f2e86a9b..ca2efab82 100644
+--- a/src/ap/ap_drv_ops.h
++++ b/src/ap/ap_drv_ops.h
+@@ -52,7 +52,8 @@ int hostapd_sta_add(struct hostapd_data *hapd,
+ size_t eht_capab_len,
+ const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab,
+ u32 flags, u8 qosinfo, u8 vht_opmode, int supp_p2p_ps,
+- int set, const u8 *link_addr, bool mld_link_sta);
++ int set, const u8 *link_addr, bool mld_link_sta,
++ u16 eml_capa);
+ int hostapd_set_privacy(struct hostapd_data *hapd, int enabled);
+ int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
+ size_t elem_len);
+@@ -174,6 +175,7 @@ int hostapd_drv_amnt_dump(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_dump_
+ int hostapd_drv_background_radar_mode(struct hostapd_data *hapd);
+ int hostapd_drv_pp_mode_set(struct hostapd_data *hapd);
+ int hostapd_drv_beacon_ctrl(struct hostapd_data *hapd, u8 beacon_mode);
++int hostapd_drv_set_eml_omn(struct hostapd_data *hapd, u8 *mac, struct eml_omn_element *omn_ie);
+ int hostapd_drv_csi_set(struct hostapd_data *hapd, u8 mode, u8 cfg, u8 v1, u32 v2, u8 *mac);
+ int hostapd_drv_csi_dump(struct hostapd_data *hapd, void *dump_buf);
+
+diff --git a/src/ap/apup.c b/src/ap/apup.c
+index f736ddc8e..cb0264e9e 100644
+--- a/src/ap/apup.c
++++ b/src/ap/apup.c
+@@ -67,7 +67,7 @@ void apup_process_beacon(struct hostapd_data *hapd,
+ NULL, 0, 0, NULL, NULL, NULL, 0, NULL, 0, NULL,
+ sta_ret->flags, 0, 0, 0,
+ 0, // 0 add, 1 set
+- mld_link_addr, mld_link_sta);
++ mld_link_addr, mld_link_sta, 0);
+
+ sta_ret->flags |= WLAN_STA_AUTH;
+ wpa_auth_sm_event(sta_ret->wpa_sm, WPA_AUTH);
+@@ -141,7 +141,7 @@ void apup_process_beacon(struct hostapd_data *hapd,
+ sta_ret->vht_opmode,
+ 0, // int supp_p2p_ps
+ 1, // 0 add, 1 set
+- mld_link_addr, mld_link_sta);
++ mld_link_addr, mld_link_sta, 0);
+
+ ap_sta_set_authorized(hapd, sta_ret, 1);
+ hostapd_set_sta_flags(hapd, sta_ret);
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index bb508fe79..09f033e13 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -4763,6 +4763,7 @@ static int add_associated_sta(struct hostapd_data *hapd,
+ int set = 1;
+ const u8 *mld_link_addr = NULL;
+ bool mld_link_sta = false;
++ u16 eml_capa = 0;
+
+ #ifdef CONFIG_IEEE80211BE
+ if (ap_sta_is_mld(hapd, sta)) {
+@@ -4773,6 +4774,8 @@ static int add_associated_sta(struct hostapd_data *hapd,
+
+ if (hapd->mld_link_id != sta->mld_assoc_link_id)
+ set = 0;
++
++ eml_capa = sta->mld_info.common_info.eml_capa;
+ }
+ #endif /* CONFIG_IEEE80211BE */
+
+@@ -4861,7 +4864,7 @@ static int add_associated_sta(struct hostapd_data *hapd,
+ sta->he_6ghz_capab,
+ sta->flags | WLAN_STA_ASSOC, sta->qosinfo,
+ sta->vht_opmode, sta->p2p_ie ? 1 : 0,
+- set, mld_link_addr, mld_link_sta)) {
++ set, mld_link_addr, mld_link_sta, eml_capa)) {
+ hostapd_logger(hapd, sta->addr,
+ HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_NOTICE,
+ "Could not %s STA to kernel driver",
+@@ -6214,6 +6217,9 @@ static int handle_action(struct hostapd_data *hapd,
+ if (hapd->public_action_cb || hapd->public_action_cb2)
+ return 1;
+ break;
++ case WLAN_ACTION_PROTECTED_EHT:
++ ieee802_11_rx_prot_eht(hapd, mgmt, len);
++ return 1;
+ case WLAN_ACTION_VENDOR_SPECIFIC:
+ if (hapd->vendor_action_cb) {
+ if (hapd->vendor_action_cb(hapd->vendor_action_cb_ctx,
+diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h
+index 0e13d2940..18f97890b 100644
+--- a/src/ap/ieee802_11.h
++++ b/src/ap/ieee802_11.h
+@@ -265,5 +265,7 @@ int hostapd_process_assoc_ml_info(struct hostapd_data *hapd,
+ const u8 *ies, size_t ies_len,
+ bool reassoc, int tx_link_status,
+ bool offload);
+-
++void ieee802_11_rx_prot_eht(struct hostapd_data *hapd,
++ const struct ieee80211_mgmt *mgmt,
++ size_t len);
+ #endif /* IEEE802_11_H */
+diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
+index 2b5c06d6d..59ada2f86 100644
+--- a/src/ap/ieee802_11_eht.c
++++ b/src/ap/ieee802_11_eht.c
+@@ -465,9 +465,11 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd,
+ control = MULTI_LINK_CONTROL_TYPE_BASIC |
+ BASIC_MULTI_LINK_CTRL_PRES_LINK_ID |
+ BASIC_MULTI_LINK_CTRL_PRES_BSS_PARAM_CH_COUNT |
+- BASIC_MULTI_LINK_CTRL_PRES_EML_CAPA |
+ BASIC_MULTI_LINK_CTRL_PRES_MLD_CAPA;
+
++ if (!hapd->iconf->eml_disable)
++ control |= BASIC_MULTI_LINK_CTRL_PRES_EML_CAPA;
++
+ /*
+ * Set the basic Multi-Link common information. Hard code the common
+ * info length to 13 based on the length of the present fields:
+@@ -478,6 +480,9 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd,
+ #define EHT_ML_COMMON_INFO_LEN 13
+ common_info_len = EHT_ML_COMMON_INFO_LEN;
+
++ if (hapd->iconf->eml_disable)
++ common_info_len -= 2; /* EML Capabilities (2) */
++
+ if (include_mld_id) {
+ /* AP MLD ID */
+ control |= BASIC_MULTI_LINK_CTRL_PRES_AP_MLD_ID;
+@@ -497,9 +502,11 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd,
+ /* Currently hard code the BSS Parameters Change Count to 0x1 */
+ wpabuf_put_u8(buf, hapd->eht_mld_bss_param_change);
+
+- wpa_printf(MSG_DEBUG, "MLD: EML Capabilities=0x%x",
+- hapd->iface->mld_eml_capa);
+- wpabuf_put_le16(buf, hapd->iface->mld_eml_capa);
++ if (!hapd->iconf->eml_disable) {
++ wpa_printf(MSG_DEBUG, "MLD: EML Capabilities=0x%x",
++ hapd->iface->mld_eml_capa);
++ wpabuf_put_le16(buf, hapd->iface->mld_eml_capa);
++ }
+
+ mld_cap = hapd->iface->mld_mld_capa;
+ max_simul_links = mld_cap & EHT_ML_MLD_CAPA_MAX_NUM_SIM_LINKS_MASK;
+@@ -744,12 +751,16 @@ static u8 * hostapd_eid_eht_reconf_ml(struct hostapd_data *hapd, u8 *eid)
+
+
+ static size_t hostapd_eid_eht_ml_len(struct mld_info *info,
+- bool include_mld_id)
++ bool include_mld_id,
++ u8 eml_disable)
+ {
+ size_t len = 0;
+ size_t eht_ml_len = 2 + EHT_ML_COMMON_INFO_LEN;
+ u8 link_id;
+
++ if (eml_disable)
++ eht_ml_len -= 2; /* EML Capabilities (2) */
++
+ if (include_mld_id)
+ eht_ml_len++;
+
+@@ -811,7 +822,8 @@ size_t hostapd_eid_eht_ml_beacon_len(struct hostapd_data *hapd,
+ struct mld_info *info,
+ bool include_mld_id)
+ {
+- return hostapd_eid_eht_ml_len(info, include_mld_id);
++ return hostapd_eid_eht_ml_len(info, include_mld_id,
++ hapd->iconf->eml_disable);
+ }
+
+
+@@ -1406,3 +1418,103 @@ out:
+
+ return WLAN_STATUS_SUCCESS;
+ }
++
++static void ieee802_11_send_eml_omn(struct hostapd_data *hapd,
++ const u8 *addr,
++ struct eml_omn_element *omn_ie,
++ size_t len)
++{
++ struct wpabuf *buf;
++
++ buf = wpabuf_alloc(2 + len);
++ if (!buf)
++ return;
++
++ wpabuf_put_u8(buf, WLAN_ACTION_PROTECTED_EHT);
++ wpabuf_put_u8(buf, WLAN_PROTECTED_EHT_ACTION_EML_OMN);
++ wpabuf_put_data(buf, omn_ie, len);
++
++ hostapd_drv_send_action(hapd, hapd->iface->freq, 0, addr,
++ wpabuf_head(buf), wpabuf_len(buf));
++
++ wpabuf_free(buf);
++}
++
++static void ieee802_11_rx_eml_omn(struct hostapd_data *hapd,
++ const u8 *addr, const u8 *frm,
++ size_t len)
++{
++ struct eml_omn_element *omn_ie;
++
++ if (hapd->iconf->eml_disable) {
++ wpa_printf(MSG_ERROR,
++ "Ignore EML Operating Mode Notification from "
++ MACSTR
++ " since EML Capabilities is disabled",
++ MAC2STR(addr));
++ return;
++ }
++
++ /* EML Operating Mode Notification IE */
++ omn_ie = os_zalloc(sizeof(struct eml_omn_element));
++ if (omn_ie == NULL)
++ return;
++
++ os_memcpy(omn_ie, frm, len);
++
++ if (omn_ie->control & EHT_EML_OMN_CONTROL_EMLMR_MODE) {
++ wpa_printf(MSG_ERROR,
++ "EML: Ignore EML Operating Mode Fotification from "
++ MACSTR
++ " since doesn't support EMLMR",
++ MAC2STR(addr));
++ goto out;
++ }
++
++ hostapd_drv_set_eml_omn(hapd, addr, omn_ie);
++
++ omn_ie->control &= ~(EHT_EML_OMN_CONTROL_EMLSR_PARA_UPDATE_COUNT |
++ EHT_EML_OMN_CONTROL_INDEV_COEX_ACTIVITIES);
++
++ if (hapd->iconf->eml_resp) {
++ ieee802_11_send_eml_omn(hapd, addr, omn_ie, len);
++ wpa_printf(MSG_ERROR, "EML: AP send EML Operating Mode Fotification to "
++ MACSTR,
++ MAC2STR(addr));
++ }
++out:
++ os_free(omn_ie);
++ return;
++}
++
++void ieee802_11_rx_prot_eht(struct hostapd_data *hapd,
++ const struct ieee80211_mgmt *mgmt,
++ size_t len)
++{
++ u8 action;
++ const u8 *payload;
++ size_t plen;
++
++ if (!hapd->conf->mld_ap)
++ return;
++
++ if (len < IEEE80211_HDRLEN + 2)
++ return;
++
++ payload = mgmt->u.action.u.eht_prot.variable;
++ action = mgmt->u.action.u.eht_prot.action;
++ plen = len - IEEE80211_HDRLEN - 2;
++
++ switch (action) {
++ case WLAN_PROTECTED_EHT_ACTION_EML_OMN:
++ ieee802_11_rx_eml_omn(hapd, mgmt->sa, payload, plen);
++ return;
++ }
++
++ wpa_printf(MSG_ERROR, "EHT: Unsupported Protected EHT Action %u from " MACSTR,
++ action, MAC2STR(mgmt->sa));
++
++ return;
++
++}
++
+diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
+index 44d98d5e0..58e66f555 100644
+--- a/src/ap/sta_info.c
++++ b/src/ap/sta_info.c
+@@ -1901,7 +1901,7 @@ int ap_sta_re_add(struct hostapd_data *hapd, struct sta_info *sta)
+ sta->supported_rates_len,
+ 0, NULL, NULL, NULL, 0, NULL, 0, NULL,
+ sta->flags, 0, 0, 0, 0,
+- mld_link_addr, mld_link_sta)) {
++ mld_link_addr, mld_link_sta, 0)) {
+ hostapd_logger(hapd, sta->addr,
+ HOSTAPD_MODULE_IEEE80211,
+ HOSTAPD_LEVEL_NOTICE,
+diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
+index efb584c66..fb481b8b2 100644
+--- a/src/common/ieee802_11_defs.h
++++ b/src/common/ieee802_11_defs.h
+@@ -775,6 +775,36 @@
+ #define WLAN_PROT_FTM 2
+ #define WLAN_PROT_FTM_REPORT 3
+
++/* Protected EHT action codes */
++#define WLAN_PROTECTED_EHT_ACTION_EML_OMN 6
++
++/* EML Operating Mode Notification frame */
++#define EHT_EML_OMN_CONTROL_EMLSR_MODE 0x1
++#define EHT_EML_OMN_CONTROL_EMLMR_MODE 0x2
++#define EHT_EML_OMN_CONTROL_EMLSR_PARA_UPDATE_COUNT 0x4
++#define EHT_EML_OMN_CONTROL_INDEV_COEX_ACTIVITIES 0x8
++
++/* EMLSR Parameter Update field */
++#define EHT_EML_OMN_EMLSR_PADDING_DELAY_MASK 0x07
++#define EHT_EML_OMN_EMLSR_TRANSITION_DELAY_MASK 0x38
++
++struct eml_omn_element {
++ u8 dialog_token;
++ u8 control;
++ le16 bitmap;
++ union {
++ struct {
++ u8 emlsr_para_update;
++ } STRUCT_PACKED emlsr_info;
++ struct {
++ u8 mcs_map_count_control;
++ u8 mcs_map_bw80[3];
++ u8 mcs_map_bw160[3];
++ u8 mcs_map_bw320[3];
++ } STRUCT_PACKED emlmr_info;
++ } u;
++} STRUCT_PACKED;
++
+ /* Radio Measurement capabilities (from RM Enabled Capabilities element)
+ * IEEE Std 802.11-2020, 9.4.2.44, Table 9-179 */
+ /* byte 1 (out of 5) */
+@@ -1161,6 +1191,10 @@ struct ieee80211_mgmt {
+ u8 dialog_token;
+ u8 variable[];
+ } STRUCT_PACKED rrm;
++ struct {
++ u8 action;
++ u8 variable[];
++ } STRUCT_PACKED eht_prot;
+ } u;
+ } STRUCT_PACKED action;
+ } u;
+diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
+index be516e017..c6de8862b 100644
+--- a/src/common/mtk_vendor.h
++++ b/src/common/mtk_vendor.h
+@@ -19,6 +19,7 @@ enum mtk_nl80211_vendor_subcmds {
+ MTK_NL80211_VENDOR_SUBCMD_BACKGROUND_RADAR_CTRL = 0xcb,
+ MTK_NL80211_VENDOR_SUBCMD_PP_CTRL = 0xcc,
+ MTK_NL80211_VENDOR_SUBCMD_BEACON_CTRL = 0xcd,
++ MTK_NL80211_VENDOR_SUBCMD_EML_CTRL = 0xd3,
+ };
+
+ enum mtk_vendor_attr_edcca_ctrl {
+@@ -287,6 +288,20 @@ enum mtk_vendor_attr_beacon_ctrl {
+ NUM_MTK_VENDOR_ATTRS_BEACON_CTRL - 1
+ };
+
++enum mtk_vendor_attr_eml_ctrl {
++
++ MTK_VENDOR_ATTR_EML_CTRL_UNSPEC,
++
++ MTK_VENDOR_ATTR_EML_LINK_ID,
++ MTK_VENDOR_ATTR_EML_STA_ADDR,
++ MTK_VENDOR_ATTR_EML_CTRL_STRUCT,
++
++ /* keep last */
++ NUM_MTK_VENDOR_ATTRS_EML_CTRL,
++ MTK_VENDOR_ATTR_EML_CTRL_MAX =
++ NUM_MTK_VENDOR_ATTRS_EML_CTRL -1
++};
++
+ #define CSI_BW20_DATA_COUNT 64
+ #define CSI_BW40_DATA_COUNT 128
+ #define CSI_BW80_DATA_COUNT 256
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index 924a1baba..e7e62c5ad 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -2575,6 +2575,7 @@ struct hostapd_sta_add_params {
+ bool mld_link_sta;
+ s8 mld_link_id;
+ const u8 *mld_link_addr;
++ u16 eml_capa;
+ };
+
+ struct mac_address {
+@@ -5277,6 +5278,17 @@ struct wpa_driver_ops {
+ */
+ int (*beacon_ctrl)(void *priv, u8 beacon_mode);
+
++ /**
++ * set eml omn - Send the EML Operating Mode
++ * Notification content to driver
++ * @priv: Private driver interface data
++ * @link_id: MLD link id
++ * @addr: MLD STA address
++ * @omn_ie: EML OMN content sent by the MLD STA
++ */
++ int (*set_eml_omn)(void *priv, u8 link_id,
++ u8 *addr, struct eml_omn_element *omn_ie);
++
+ /**
+ * three_wire_ctrl - set three_wire_ctrl mode
+ * @priv: Private driver interface data
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index 555c97bf7..9451714a7 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -2893,6 +2893,9 @@ static int nl80211_action_subscribe_ap(struct i802_bss *bss)
+ if (nl80211_register_action_frame(bss, (u8 *) "\x12", 1) < 0)
+ ret = -1;
+ #endif /* CONFIG_FST */
++ /* Protected EHT */
++ if (nl80211_register_action_frame(bss, (u8 *) "\x25", 1) < 0)
++ ret = -1;
+ /* Vendor-specific */
+ if (nl80211_register_action_frame(bss, (u8 *) "\x7f", 1) < 0)
+ ret = -1;
+@@ -5981,6 +5984,14 @@ static int wpa_driver_nl80211_sta_add(void *priv,
+ goto fail;
+ }
+
++ if (params->eml_capa) {
++ wpa_printf(MSG_DEBUG, " * eml_capa=%u",
++ params->eml_capa);
++ if (nla_put_u16(msg, NL80211_ATTR_EML_CAPABILITY,
++ params->eml_capa))
++ goto fail;
++ }
++
+ ret = send_and_recv_cmd(drv, msg);
+ msg = NULL;
+ if (ret)
+@@ -15261,6 +15272,47 @@ static int nl80211_get_mld_addr(void *priv, u8 *addr)
+
+ return 0;
+ }
++
++static int nl80211_set_eml_omn(void *priv, u8 link_id, u8 *addr,
++ struct eml_omn_element *omn_ie)
++{
++ struct i802_bss *bss = priv;
++ struct wpa_driver_nl80211_data *drv = bss->drv;
++ struct nl_msg *msg;
++ struct nlattr *data;
++ int ret = -ENOBUFS;
++
++ if (!drv->mtk_eml_vendor_cmd_avail) {
++ wpa_printf(MSG_ERROR,
++ "nl80211: Driver does not support setting EML control");
++ return 0;
++ }
++
++ if (!(msg = nl80211_drv_msg(drv, 0, NL80211_CMD_VENDOR)) ||
++ nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_MTK) ||
++ nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
++ MTK_NL80211_VENDOR_SUBCMD_EML_CTRL) ||
++ !(data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA)) ||
++ nla_put_u8(msg, MTK_VENDOR_ATTR_EML_LINK_ID, link_id) ||
++ nla_put(msg, MTK_VENDOR_ATTR_EML_STA_ADDR, ETH_ALEN, addr) ||
++ nla_put(msg, MTK_VENDOR_ATTR_EML_CTRL_STRUCT,
++ sizeof(struct eml_omn_element), omn_ie))
++ goto fail;
++
++
++ nla_nest_end(msg, data);
++ ret = send_and_recv_cmd(drv, msg);
++
++ if (ret)
++ wpa_printf(MSG_ERROR, "Failed to set EML OMN ctrl. ret = %d (%s)",
++ ret, strerror(-ret));
++
++ return ret;
++
++fail:
++ nlmsg_free(msg);
++ return ret;
++}
+ #endif
+
+ static int
+@@ -15619,6 +15671,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+ .mu_ctrl = nl80211_mu_ctrl,
+ .mu_dump = nl80211_mu_dump,
+ .beacon_ctrl = nl80211_beacon_ctrl,
++ .set_eml_omn = nl80211_set_eml_omn,
+ #ifdef CONFIG_DPP
+ .dpp_listen = nl80211_dpp_listen,
+ #endif /* CONFIG_DPP */
+diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
+index b710b50cd..2cc40e0dc 100644
+--- a/src/drivers/driver_nl80211.h
++++ b/src/drivers/driver_nl80211.h
+@@ -213,6 +213,7 @@ struct wpa_driver_nl80211_data {
+ unsigned int mtk_pp_vendor_cmd_avail:1;
+ unsigned int mtk_beacon_ctrl_vendor_cmd_avail:1;
+ unsigned int mtk_csi_vendor_cmd_avail:1;
++ unsigned int mtk_eml_vendor_cmd_avail:1;
+
+ u32 ignore_next_local_disconnect;
+ u32 ignore_next_local_deauth;
+diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
+index 5a53700d1..c1327a679 100644
+--- a/src/drivers/driver_nl80211_capa.c
++++ b/src/drivers/driver_nl80211_capa.c
+@@ -1176,6 +1176,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
+ case MTK_NL80211_VENDOR_SUBCMD_CSI_CTRL:
+ drv->mtk_csi_vendor_cmd_avail = 1;
+ break;
++ case MTK_NL80211_VENDOR_SUBCMD_EML_CTRL:
++ drv->mtk_eml_vendor_cmd_avail = 1;
++ break;
+ }
+ }
+
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0087-mtk-hostapd-Fix-Operating-Mode-Notification-issue-in.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0087-mtk-hostapd-Fix-Operating-Mode-Notification-issue-in.patch
new file mode 100644
index 0000000..e637185
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0087-mtk-hostapd-Fix-Operating-Mode-Notification-issue-in.patch
@@ -0,0 +1,36 @@
+From 9b059de49d2c441ec3b83c82de3c4c6e0078f4f7 Mon Sep 17 00:00:00 2001
+From: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
+Date: Wed, 15 May 2024 15:23:55 +0800
+Subject: [PATCH 087/126] mtk: hostapd: Fix Operating Mode Notification issue
+ in 2GHz
+
+If this patch is not applied, since the driver enables the
+Operating Mode Notification feature, hostapd will enable the OMN bit
+in the Extended Capabilities Element when constructing beacon.
+However, this is not allowed on frequency bands that do not support
+ieee80211ac, hence add this patch to fix this issue.
+
+Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
+---
+ src/ap/ieee802_11_shared.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c
+index 3dd3a6a77..58283eae9 100644
+--- a/src/ap/ieee802_11_shared.c
++++ b/src/ap/ieee802_11_shared.c
+@@ -510,6 +510,11 @@ u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid,
+ *pos &= ~0x08;
+ if (i == 2 && !hapd->iconf->mbssid)
+ *pos &= ~0x40;
++
++ /* Clear bits 62 (Operating Mode Notification)
++ * if ieee80211ac is not enabled (mainly 2.4G and 6G) */
++ if (i == 7 && !hapd->iconf->ieee80211ac)
++ *pos &= ~0x40;
+ }
+
+ while (len > 0 && eid[1 + len] == 0) {
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0088-mtk-hostapd-add-mlo-probe-client-support.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0088-mtk-hostapd-add-mlo-probe-client-support.patch
new file mode 100644
index 0000000..8cf4e0a
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0088-mtk-hostapd-add-mlo-probe-client-support.patch
@@ -0,0 +1,76 @@
+From 2b760a3738dbc5d0c9fa71a1f73bba2265453f46 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Fri, 10 May 2024 17:52:41 +0800
+Subject: [PATCH 088/126] mtk: hostapd: add mlo probe client support
+
+Add mld-level probe client support
+Only register one eloop ap_handle_timeout per mld
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ hostapd/ctrl_iface.c | 12 ++++++++++++
+ src/ap/sta_info.c | 18 +++++++++++++++++-
+ 2 files changed, 29 insertions(+), 1 deletion(-)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index d9775e13e..2038a3712 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -1469,6 +1469,18 @@ static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd)
+ hapd->conf->transition_disable);
+ }
+
++#ifdef CONFIG_IEEE80211BE
++ /* workaround before hostapd cli support per link configuration */
++ if (hapd->conf->mld_ap) {
++ struct hostapd_data *h;
++
++ for_each_mld_link(h, hapd) {
++ if (os_strcasecmp(cmd, "ap_max_inactivity") == 0)
++ h->conf->ap_max_inactivity = hapd->conf->ap_max_inactivity;
++ }
++ }
++#endif /* CONFIG_IEEE80211BE */
++
+ #ifdef CONFIG_TESTING_OPTIONS
+ if (os_strcmp(cmd, "ft_rsnxe_used") == 0)
+ wpa_auth_set_ft_rsnxe_used(hapd->wpa_auth,
+diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
+index 58e66f555..bc729137d 100644
+--- a/src/ap/sta_info.c
++++ b/src/ap/sta_info.c
+@@ -819,6 +819,7 @@ struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr)
+ struct sta_info *sta;
+ int i;
+ int max_inactivity = hapd->conf->ap_max_inactivity;
++ bool registered = false;
+
+ sta = ap_get_sta(hapd, addr);
+ if (sta)
+@@ -855,7 +856,22 @@ struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr)
+ if (sta->max_idle_period)
+ max_inactivity = (sta->max_idle_period * 1024 + 999) / 1000;
+
+- if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_INACTIVITY_TIMER)) {
++#ifdef CONFIG_IEEE80211BE
++ if (hapd->conf->mld_ap) {
++ struct hostapd_data *h;
++ struct sta_info *s;
++
++ for_each_mld_link(h, hapd) {
++ s = ap_get_sta(h, addr);
++ if (s && eloop_is_timeout_registered(ap_handle_timer, h, s)) {
++ registered = true;
++ break;
++ }
++ }
++ }
++#endif /* CONFIG_IEEE80211BE */
++
++ if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_INACTIVITY_TIMER) && !registered) {
+ wpa_printf(MSG_DEBUG, "%s: register ap_handle_timer timeout "
+ "for " MACSTR " (%d seconds - ap_max_inactivity)",
+ __func__, MAC2STR(addr),
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0089-mtk-hostapd-add-support-for-channel-switch.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0089-mtk-hostapd-add-support-for-channel-switch.patch
new file mode 100644
index 0000000..209c997
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0089-mtk-hostapd-add-support-for-channel-switch.patch
@@ -0,0 +1,134 @@
+From 6a5460e02c6d6303146a43ffd3ee10ae5e1fb2a1 Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Thu, 16 May 2024 15:59:30 +0800
+Subject: [PATCH 089/126] mtk: hostapd: add support for channel switch
+
+For extender channel switch, a 'band_idx' is necessary so that
+Extender STA can tell Extender AP exactly which band is doing
+a channel switch.
+
+The original flow fails on parsing a 0 band_idx. Updated flow can
+avoid the problem and also a default 'band_idx' is assigned for an
+error parsing.
+
+Another error handling is also added for the case that the iface with
+target 'band_idx' is not found.
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ src/ap/ucode.c | 20 +++++++++++++++++++-
+ wpa_supplicant/ucode.c | 31 ++++++++++++++++++++++++++++---
+ 2 files changed, 47 insertions(+), 4 deletions(-)
+
+diff --git a/src/ap/ucode.c b/src/ap/ucode.c
+index a72193282..a69caa6cf 100644
+--- a/src/ap/ucode.c
++++ b/src/ap/ucode.c
+@@ -693,7 +693,7 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
+ struct hostapd_config *conf;
+ struct csa_settings csa = {};
+ uint64_t intval;
+- int i, ret = 0;
++ int i, ret = 0, band_idx;
+
+ wpa_printf(MSG_INFO, "ucode: mtk: channel switch for %s\n", iface->phy);
+ if (!iface || ucv_type(info) != UC_OBJECT)
+@@ -727,6 +727,9 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
+ if ((intval = ucv_int64_get(ucv_object_get(info, "center_freq2", NULL))) && !errno)
+ csa.freq_params.center_freq2 = intval;
+
++ intval = ucv_int64_get(ucv_object_get(info, "band_idx", NULL));
++ band_idx = errno ? iface->conf->band_idx : intval;
++
+ wpa_printf(MSG_INFO, "ucode: mtk: switch channel information:\n");
+ wpa_printf(MSG_INFO, " * freq is %d\n", csa.freq_params.freq);
+ wpa_printf(MSG_INFO, " * bandwidth is %d\n",
+@@ -737,6 +740,21 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
+ csa.freq_params.center_freq1);
+ wpa_printf(MSG_INFO, " * center_freq2 is %d\n",
+ csa.freq_params.center_freq2);
++ wpa_printf(MSG_INFO, " * band_idx is %d\n",
++ band_idx);
++
++#ifdef CONFIG_IEEE80211BE
++ for (i = 0; i < iface->interfaces->count; i++) {
++ if (band_idx == iface->interfaces->iface[i]->conf->band_idx) {
++ iface = iface->interfaces->iface[i];
++ wpa_printf(MSG_INFO, "ucode: mtk: MLD: switch to iface with band_idx %d \n", band_idx);
++ break;
++ }
++ }
++
++ if (band_idx != iface->bss[0]->iconf->band_idx)
++ return NULL;
++#endif /* CONFIG_IEEE80211BE */
+
+ for (i = 0; i < iface->num_bss; i++) {
+ ret = hostapd_switch_channel(iface->bss[i], &csa);
+diff --git a/wpa_supplicant/ucode.c b/wpa_supplicant/ucode.c
+index ac0639a90..050bed6ae 100644
+--- a/wpa_supplicant/ucode.c
++++ b/wpa_supplicant/ucode.c
+@@ -99,9 +99,10 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d
+ const char *state;
+ uc_value_t *val;
+ enum oper_chan_width ch_width;
+- int center_freq1, bw320_offset = 1;
++ int control_freq, center_freq1, bw320_offset = 1, band_idx;
+
+- if (event != EVENT_CH_SWITCH_STARTED)
++ if (event != EVENT_CH_SWITCH_STARTED &&
++ event != EVENT_LINK_CH_SWITCH_STARTED)
+ return;
+
+ val = wpa_ucode_registry_get(iface_registry, wpa_s->ucode.idx);
+@@ -117,7 +118,13 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d
+ val = ucv_object_new(vm);
+ uc_value_push(ucv_get(val));
+
+- if (event == EVENT_CH_SWITCH_STARTED) {
++ if (event == EVENT_CH_SWITCH_STARTED ||
++ event == EVENT_LINK_CH_SWITCH_STARTED) {
++ enum hostapd_hw_mode hw_mode;
++ int is_24ghz;
++ u8 channel;
++
++ control_freq = data->ch_switch.freq;
+ center_freq1 = data->ch_switch.cf1;
+
+ switch (data->ch_switch.ch_width) {
+@@ -147,6 +154,23 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d
+ center_freq1 == 6905)
+ bw320_offset = 2;
+
++ hw_mode = ieee80211_freq_to_chan(control_freq, &channel);
++ is_24ghz = hw_mode == HOSTAPD_MODE_IEEE80211G ||
++ hw_mode == HOSTAPD_MODE_IEEE80211B;
++ /*
++ * Assume that the mapping between band and band_idx is
++ * 2 GHz band: band_idx 0
++ * 5 GHz band: band_idx 1
++ * 6 GHz band: band_idx 2
++ * */
++ if (is_24ghz)
++ band_idx = 0;
++ else if (IS_5GHZ(control_freq))
++ band_idx = 1;
++ else if (is_6ghz_freq(control_freq))
++ band_idx = 2;
++
++
+ ucv_object_add(val, "csa_count", ucv_int64_new(data->ch_switch.count));
+ ucv_object_add(val, "frequency", ucv_int64_new(data->ch_switch.freq));
+ ucv_object_add(val, "sec_chan_offset", ucv_int64_new(data->ch_switch.ch_offset));
+@@ -154,6 +178,7 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d
+ ucv_object_add(val, "center_freq2", ucv_int64_new(data->ch_switch.cf2));
+ ucv_object_add(val, "ch_width", ucv_int64_new(ch_width));
+ ucv_object_add(val, "bw320_offset", ucv_int64_new(bw320_offset));
++ ucv_object_add(val, "band_idx", ucv_int64_new(band_idx));
+ }
+
+ ucv_put(wpa_ucode_call(4));
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0090-mtk-hostapd-add-link-id-to-hostapd-cli-chan-switch.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0090-mtk-hostapd-add-link-id-to-hostapd-cli-chan-switch.patch
deleted file mode 100644
index 129f54b..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0090-mtk-hostapd-add-link-id-to-hostapd-cli-chan-switch.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From d71c29484010bcb0bda82eb529689d0748bd653e Mon Sep 17 00:00:00 2001
-From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
-Date: Wed, 31 Jan 2024 10:39:08 +0800
-Subject: [PATCH 090/104] mtk: hostapd: add link id to hostapd cli chan switch
-
-temporary workaround for mlo channel switch
-
-Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
----
- hostapd/ctrl_iface.c | 3 +--
- hostapd/hostapd_cli.c | 2 +-
- src/ap/ctrl_iface_ap.c | 2 ++
- 3 files changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index c5540f5fd..f0c990314 100644
---- a/hostapd/ctrl_iface.c
-+++ b/hostapd/ctrl_iface.c
-@@ -2801,10 +2801,9 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
- if (ret)
- return ret;
-
-- settings.link_id = -1;
- #ifdef CONFIG_IEEE80211BE
- if (iface->num_bss && iface->bss[0]->conf->mld_ap)
-- settings.link_id = iface->bss[0]->mld_link_id;
-+ iface = iface->interfaces->iface[settings.link_id];
- #endif /* CONFIG_IEEE80211BE */
-
- ret = hostapd_ctrl_check_freq_params(&settings.freq_params,
-diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index 100896c34..acfa3b1d1 100644
---- a/hostapd/hostapd_cli.c
-+++ b/hostapd/hostapd_cli.c
-@@ -1195,7 +1195,7 @@ static int hostapd_cli_cmd_chan_switch(struct wpa_ctrl *ctrl,
- printf("Invalid chan_switch command: needs at least two "
- "arguments (count and freq)\n"
- "usage: <cs_count> <freq> [sec_channel_offset=] "
-- "[center_freq1=] [center_freq2=] [bandwidth=] "
-+ "[center_freq1=] [center_freq2=] [bandwidth=] [link_id=] "
- "[blocktx] [ht|vht|he|eht]\n");
- return -1;
- }
-diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
-index b92311e32..ca4e3e7a4 100644
---- a/src/ap/ctrl_iface_ap.c
-+++ b/src/ap/ctrl_iface_ap.c
-@@ -1108,6 +1108,8 @@ int hostapd_parse_csa_settings(const char *pos,
- } \
- } while (0)
-
-+ SET_CSA_SETTING(link_id);
-+ settings->link_id = settings->freq_params.link_id;
- SET_CSA_SETTING(center_freq1);
- SET_CSA_SETTING(center_freq2);
- SET_CSA_SETTING(bandwidth);
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0090-mtk-hostapd-extend-MLO-information-getting.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0090-mtk-hostapd-extend-MLO-information-getting.patch
new file mode 100644
index 0000000..a73671f
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0090-mtk-hostapd-extend-MLO-information-getting.patch
@@ -0,0 +1,105 @@
+From e3acb288c0e30eef9b734b62045f505c1392aab3 Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Fri, 17 May 2024 16:36:19 +0800
+Subject: [PATCH 090/126] mtk: hostapd: extend MLO information getting
+
+Extend MLO information getting, including center frequency & bandwidth,
+from the driver. These informations are helpful for Extender STA to
+synchronize channel informations to Extender AP.
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ src/drivers/driver.h | 3 ++-
+ src/drivers/driver_nl80211.c | 24 ++++++++++++++++++++++--
+ wpa_supplicant/events.c | 3 +++
+ wpa_supplicant/wpa_supplicant_i.h | 3 ++-
+ 4 files changed, 29 insertions(+), 4 deletions(-)
+
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index e7e62c5ad..eed99dac8 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -3058,8 +3058,9 @@ struct driver_sta_mlo_info {
+ struct {
+ u8 addr[ETH_ALEN];
+ u8 bssid[ETH_ALEN];
+- unsigned int freq;
++ unsigned int freq, center_freq1, center_freq2;
+ struct t2lm_mapping t2lmap;
++ enum chan_width width;
+ } links[MAX_NUM_MLD_LINKS];
+ };
+
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index 9451714a7..b3ae50d15 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -1171,6 +1171,27 @@ static int wpa_driver_nl80211_get_ssid(void *priv, u8 *ssid)
+ }
+
+
++static void get_link_channel_info(struct nlattr **link_data, u8 link_id,
++ struct driver_sta_mlo_info *info)
++{
++ info->links[link_id].freq =
++ nla_get_u32(link_data[NL80211_ATTR_WIPHY_FREQ]);
++
++ if (link_data[NL80211_ATTR_CHANNEL_WIDTH]) {
++ info->links[link_id].width =
++ convert2width(nla_get_u32(link_data[NL80211_ATTR_CHANNEL_WIDTH]));
++
++ if (link_data[NL80211_ATTR_CENTER_FREQ1])
++ info->links[link_id].center_freq1 =
++ nla_get_u32(link_data[NL80211_ATTR_CENTER_FREQ1]);
++
++ if (link_data[NL80211_ATTR_CENTER_FREQ2])
++ info->links[link_id].center_freq2 =
++ nla_get_u32(link_data[NL80211_ATTR_CENTER_FREQ2]);
++ }
++}
++
++
+ static int get_mlo_info(struct nl_msg *msg, void *arg)
+ {
+ struct nlattr *tb[NL80211_ATTR_MAX + 1];
+@@ -1208,8 +1229,7 @@ static int get_mlo_info(struct nl_msg *msg, void *arg)
+ os_memcpy(info->links[link_id].addr,
+ nla_data(link_data[NL80211_ATTR_MAC]), ETH_ALEN);
+ if (link_data[NL80211_ATTR_WIPHY_FREQ])
+- info->links[link_id].freq =
+- nla_get_u32(link_data[NL80211_ATTR_WIPHY_FREQ]);
++ get_link_channel_info(link_data, link_id, info);
+ }
+
+ return NL_SKIP;
+diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
+index 7b91ce988..cd838c6cf 100644
+--- a/wpa_supplicant/events.c
++++ b/wpa_supplicant/events.c
+@@ -4122,6 +4122,9 @@ static int wpa_drv_get_mlo_info(struct wpa_supplicant *wpa_s)
+ os_memcpy(wpa_s->links[i].addr, mlo.links[i].addr, ETH_ALEN);
+ os_memcpy(wpa_s->links[i].bssid, mlo.links[i].bssid, ETH_ALEN);
+ wpa_s->links[i].freq = mlo.links[i].freq;
++ wpa_s->links[i].center_freq1 = mlo.links[i].center_freq1;
++ wpa_s->links[i].center_freq2 = mlo.links[i].center_freq2;
++ wpa_s->links[i].width = mlo.links[i].width;
+ wpa_supplicant_update_link_bss(wpa_s, i, mlo.links[i].bssid);
+ }
+
+diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
+index 952a3bd5a..d2835cc68 100644
+--- a/wpa_supplicant/wpa_supplicant_i.h
++++ b/wpa_supplicant/wpa_supplicant_i.h
+@@ -740,7 +740,8 @@ struct wpa_supplicant {
+ struct {
+ u8 addr[ETH_ALEN];
+ u8 bssid[ETH_ALEN];
+- unsigned int freq;
++ unsigned int freq, center_freq1, center_freq2;
++ enum chan_width width;
+ struct wpa_bss *bss;
+ bool disabled;
+ } links[MAX_NUM_MLD_LINKS];
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0091-mtk-hostapd-refactor-the-operating-channel-width-nam.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0091-mtk-hostapd-refactor-the-operating-channel-width-nam.patch
new file mode 100644
index 0000000..d4a6433
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0091-mtk-hostapd-refactor-the-operating-channel-width-nam.patch
@@ -0,0 +1,105 @@
+From 7f0f9705e413d6a879b03e1989b7691e031ea2a0 Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Fri, 17 May 2024 17:02:08 +0800
+Subject: [PATCH 091/126] mtk: hostapd: refactor the operating channel width
+ naming
+
+There are many data structures about channel width in hostapd. This
+commit re-names the one which is used to describe the operating
+channel width so that following commits can use other channel width
+variables.
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ wpa_supplicant/ucode.c | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/wpa_supplicant/ucode.c b/wpa_supplicant/ucode.c
+index 050bed6ae..bc5cf2ab9 100644
+--- a/wpa_supplicant/ucode.c
++++ b/wpa_supplicant/ucode.c
+@@ -98,7 +98,7 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d
+ {
+ const char *state;
+ uc_value_t *val;
+- enum oper_chan_width ch_width;
++ enum oper_chan_width oper_chwidth;
+ int control_freq, center_freq1, bw320_offset = 1, band_idx;
+
+ if (event != EVENT_CH_SWITCH_STARTED &&
+@@ -129,27 +129,27 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d
+
+ switch (data->ch_switch.ch_width) {
+ case CHAN_WIDTH_80:
+- ch_width = CONF_OPER_CHWIDTH_80MHZ;
++ oper_chwidth = CONF_OPER_CHWIDTH_80MHZ;
+ break;
+ case CHAN_WIDTH_80P80:
+- ch_width = CONF_OPER_CHWIDTH_80P80MHZ;
++ oper_chwidth = CONF_OPER_CHWIDTH_80P80MHZ;
+ break;
+ case CHAN_WIDTH_160:
+- ch_width = CONF_OPER_CHWIDTH_160MHZ;
++ oper_chwidth = CONF_OPER_CHWIDTH_160MHZ;
+ break;
+ case CHAN_WIDTH_320:
+- ch_width = CONF_OPER_CHWIDTH_320MHZ;
++ oper_chwidth = CONF_OPER_CHWIDTH_320MHZ;
+ break;
+ case CHAN_WIDTH_20_NOHT:
+ case CHAN_WIDTH_20:
+ case CHAN_WIDTH_40:
+ default:
+- ch_width = CONF_OPER_CHWIDTH_USE_HT;
++ oper_chwidth = CONF_OPER_CHWIDTH_USE_HT;
+ break;
+ }
+
+ /* Check bandwidth 320 MHz-2 */
+- if (ch_width == CONF_OPER_CHWIDTH_320MHZ &&
++ if (oper_chwidth == CONF_OPER_CHWIDTH_320MHZ &&
+ (center_freq1 == 6265) || center_freq1 == 6585 ||
+ center_freq1 == 6905)
+ bw320_offset = 2;
+@@ -176,7 +176,7 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d
+ ucv_object_add(val, "sec_chan_offset", ucv_int64_new(data->ch_switch.ch_offset));
+ ucv_object_add(val, "center_freq1", ucv_int64_new(center_freq1));
+ ucv_object_add(val, "center_freq2", ucv_int64_new(data->ch_switch.cf2));
+- ucv_object_add(val, "ch_width", ucv_int64_new(ch_width));
++ ucv_object_add(val, "ch_width", ucv_int64_new(oper_chwidth));
+ ucv_object_add(val, "bw320_offset", ucv_int64_new(bw320_offset));
+ ucv_object_add(val, "band_idx", ucv_int64_new(band_idx));
+ }
+@@ -274,7 +274,7 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
+ uc_value_t *ret, *val, *link_obj = uc_fn_arg(0);
+ struct wpa_channel_info ci;
+ u8 op_class, channel;
+- enum oper_chan_width ch_width = CONF_OPER_CHWIDTH_USE_HT;
++ enum oper_chan_width oper_chwidth = CONF_OPER_CHWIDTH_USE_HT;
+ int center_freq1, bw320_offset = 1, is_24ghz, band_idx;
+ enum hostapd_hw_mode hw_mode;
+ int link_id = ucv_int64_get(link_obj);
+@@ -319,9 +319,9 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
+
+ if (!ieee80211_chaninfo_to_channel(ci.frequency, ci.chanwidth,
+ sec_chan, &op_class, &channel))
+- ch_width = op_class_to_ch_width(op_class);
++ oper_chwidth = op_class_to_ch_width(op_class);
+
+- if (ch_width == CONF_OPER_CHWIDTH_320MHZ &&
++ if (oper_chwidth == CONF_OPER_CHWIDTH_320MHZ &&
+ (center_freq1 == 6265) || center_freq1 == 6585 ||
+ center_freq1 == 6905) {
+ /* Bandwidth 320 MHz-2 */
+@@ -330,7 +330,7 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
+
+ ucv_object_add(ret, "sec_chan_offset", ucv_int64_new(sec_chan));
+ ucv_object_add(ret, "frequency", ucv_int64_new(bss->freq));
+- ucv_object_add(ret, "ch_width", ucv_int64_new(ch_width));
++ ucv_object_add(ret, "ch_width", ucv_int64_new(oper_chwidth));
+ ucv_object_add(ret, "bw320_offset", ucv_int64_new(bw320_offset));
+ ucv_object_add(ret, "band_idx", ucv_int64_new(band_idx));
+ }
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0091-mtk-wifi-hostapd-add-wds-mlo-support.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0091-mtk-wifi-hostapd-add-wds-mlo-support.patch
deleted file mode 100644
index 4ee23cd..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0091-mtk-wifi-hostapd-add-wds-mlo-support.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From 11e9653a0df41e119ff5acad3ffcbd2825690413 Mon Sep 17 00:00:00 2001
-From: Peter Chiu <chui-hao.chiu@mediatek.com>
-Date: Tue, 16 Jan 2024 16:22:17 +0800
-Subject: [PATCH 091/104] mtk: wifi: hostapd: add wds mlo support
-
-1. Add mld_assoc_sta to get the primary sta_info.
-2. Find hapd according to mld address.
-
-Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
----
- src/ap/drv_callbacks.c | 3 ++-
- src/ap/ieee802_11.c | 8 ++++++++
- src/ap/sta_info.c | 6 +++++-
- src/ap/sta_info.h | 1 +
- src/drivers/driver.h | 3 +++
- src/drivers/driver_nl80211.c | 14 ++++++++++++++
- 6 files changed, 33 insertions(+), 2 deletions(-)
-
-diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
-index 2d946afd6..27c7555a1 100644
---- a/src/ap/drv_callbacks.c
-+++ b/src/ap/drv_callbacks.c
-@@ -1762,6 +1762,7 @@ switch_link_hapd(struct hostapd_data *hapd, int link_id)
- static struct hostapd_data * get_hapd_bssid(struct hostapd_iface *iface,
- const u8 *bssid, int link_id)
- {
-+ struct hostapd_data *ret = NULL;
- size_t i;
-
- if (bssid == NULL)
-@@ -1797,7 +1798,7 @@ static struct hostapd_data * get_hapd_bssid(struct hostapd_iface *iface,
- #endif /*CONFIG_IEEE80211BE */
- }
-
-- return NULL;
-+ return ret;
- }
-
-
-diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index fe0a5bce4..688393422 100644
---- a/src/ap/ieee802_11.c
-+++ b/src/ap/ieee802_11.c
-@@ -3105,6 +3105,7 @@ static void handle_auth(struct hostapd_data *hapd,
-
- ap_sta_set_mld(sta, true);
- sta->mld_assoc_link_id = link_id;
-+ sta->mld_assoc_sta = sta;
-
- /*
- * Set the MLD address as the station address and the
-@@ -4479,6 +4480,7 @@ static int ieee80211_ml_process_link(struct hostapd_data *hapd,
-
- sta->flags |= origin_sta->flags | WLAN_STA_ASSOC_REQ_OK;
- sta->mld_assoc_link_id = origin_sta->mld_assoc_link_id;
-+ sta->mld_assoc_sta = origin_sta;
-
- status = __check_assoc_ies(hapd, sta, NULL, 0, &elems, reassoc, true);
- if (status != WLAN_STATUS_SUCCESS) {
-@@ -6957,6 +6959,12 @@ void ieee802_11_rx_from_unknown(struct hostapd_data *hapd, const u8 *src,
- struct sta_info *sta;
-
- sta = ap_get_sta(hapd, src);
-+
-+#ifdef CONFIG_IEEE80211BE
-+ if (sta && sta->mld_info.mld_sta)
-+ sta = sta->mld_assoc_sta;
-+#endif
-+
- if (sta &&
- ((sta->flags & WLAN_STA_ASSOC) ||
- ((sta->flags & WLAN_STA_ASSOC_REQ_OK) && wds))) {
-diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
-index e9fa0ed6e..2b8307a27 100644
---- a/src/ap/sta_info.c
-+++ b/src/ap/sta_info.c
-@@ -74,6 +74,7 @@ struct sta_info * ap_get_sta(struct hostapd_data *hapd, const u8 *sta)
- while (s != NULL && os_memcmp(s->addr, sta, 6) != 0)
- s = s->hnext;
-
-+#ifdef CONFIG_IEEE80211BE
- if (hapd->conf->mld_ap && !s) {
- u8 link_id;
-
-@@ -84,10 +85,13 @@ struct sta_info * ap_get_sta(struct hostapd_data *hapd, const u8 *sta)
- continue;
-
- for (s = h->sta_list; s; s = s->next)
-- if (!os_memcmp(s->setup_link_addr, sta, 6))
-+ if ((!os_memcmp(s->setup_link_addr, sta, 6) ||
-+ !os_memcmp(s->addr, sta, 6)) &&
-+ s->flags & WLAN_STA_ASSOC)
- return s;
- }
- }
-+#endif
-
- return s;
- }
-diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h
-index cd89db6c8..8e500ec9a 100644
---- a/src/ap/sta_info.h
-+++ b/src/ap/sta_info.h
-@@ -334,6 +334,7 @@ struct sta_info {
- #ifdef CONFIG_IEEE80211BE
- struct mld_info mld_info;
- u8 mld_assoc_link_id;
-+ struct sta_info *mld_assoc_sta;
- #endif /* CONFIG_IEEE80211BE */
- };
-
-diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 10ae48729..ba61f5842 100644
---- a/src/drivers/driver.h
-+++ b/src/drivers/driver.h
-@@ -5339,6 +5339,9 @@ struct wpa_driver_ops {
- * @pp_mode: Value is defined in enum pp_mode
- */
- int (*pp_mode_set)(void *priv, const u8 pp_mode);
-+#ifdef CONFIG_IEEE80211BE
-+ int (*get_mld_addr)(void *priv, u8 *addr);
-+#endif
- };
-
- /**
-diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index ad73b4ac1..df4a7ec41 100644
---- a/src/drivers/driver_nl80211.c
-+++ b/src/drivers/driver_nl80211.c
-@@ -15181,6 +15181,17 @@ fail:
- return -ENOBUFS;
- }
-
-+#ifdef CONFIG_IEEE80211BE
-+static int nl80211_get_mld_addr(void *priv, u8 *addr)
-+{
-+ struct i802_bss *bss = priv;
-+
-+ os_memcpy(addr, bss->addr, ETH_ALEN);
-+
-+ return 0;
-+}
-+#endif
-+
- const struct wpa_driver_ops wpa_driver_nl80211_ops = {
- .name = "nl80211",
- .desc = "Linux nl80211/cfg80211",
-@@ -15361,4 +15372,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
- .amnt_dump = nl80211_amnt_dump,
- .background_radar_mode = nl80211_background_radar_mode,
- .pp_mode_set = nl80211_pp_mode_set,
-+#ifdef CONFIG_IEEE80211BE
-+ .get_mld_addr = nl80211_get_mld_addr,
-+#endif
- };
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0092-mtk-hostapd-refactor-legacy-STA-getting-operating-ch.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0092-mtk-hostapd-refactor-legacy-STA-getting-operating-ch.patch
new file mode 100644
index 0000000..ecd524f
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0092-mtk-hostapd-refactor-legacy-STA-getting-operating-ch.patch
@@ -0,0 +1,63 @@
+From b81e4dd857867be4af9bff4b698aec0edc333b34 Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Fri, 17 May 2024 17:05:54 +0800
+Subject: [PATCH 092/126] mtk: hostapd: refactor legacy STA getting operating
+ channel information
+
+The refactor is for following MLO extension.
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ wpa_supplicant/ucode.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/wpa_supplicant/ucode.c b/wpa_supplicant/ucode.c
+index bc5cf2ab9..d4b2160b6 100644
+--- a/wpa_supplicant/ucode.c
++++ b/wpa_supplicant/ucode.c
+@@ -274,10 +274,12 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
+ uc_value_t *ret, *val, *link_obj = uc_fn_arg(0);
+ struct wpa_channel_info ci;
+ u8 op_class, channel;
++ enum chan_width chwidth;
+ enum oper_chan_width oper_chwidth = CONF_OPER_CHWIDTH_USE_HT;
+ int center_freq1, bw320_offset = 1, is_24ghz, band_idx;
+ enum hostapd_hw_mode hw_mode;
+ int link_id = ucv_int64_get(link_obj);
++ u32 freq;
+
+ if (!wpa_s)
+ return NULL;
+@@ -308,7 +310,9 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
+ band_idx = 2;
+
+ wpa_drv_channel_info(wpa_s, &ci);
++ freq = ci.frequency;
+ center_freq1 = ci.center_frq1;
++ chwidth=ci.chanwidth;
+
+ if (bss->freq != center_freq1) {
+ if (is_24ghz)
+@@ -317,8 +321,8 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
+ sec_chan = (bss->freq / 20) & 1 ? 1 : -1;
+ }
+
+- if (!ieee80211_chaninfo_to_channel(ci.frequency, ci.chanwidth,
+- sec_chan, &op_class, &channel))
++ if (!ieee80211_chaninfo_to_channel(freq, chwidth, sec_chan,
++ &op_class, &channel))
+ oper_chwidth = op_class_to_ch_width(op_class);
+
+ if (oper_chwidth == CONF_OPER_CHWIDTH_320MHZ &&
+@@ -329,7 +333,7 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
+ }
+
+ ucv_object_add(ret, "sec_chan_offset", ucv_int64_new(sec_chan));
+- ucv_object_add(ret, "frequency", ucv_int64_new(bss->freq));
++ ucv_object_add(ret, "frequency", ucv_int64_new(freq));
+ ucv_object_add(ret, "ch_width", ucv_int64_new(oper_chwidth));
+ ucv_object_add(ret, "bw320_offset", ucv_int64_new(bw320_offset));
+ ucv_object_add(ret, "band_idx", ucv_int64_new(band_idx));
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0093-mtk-hostapd-get-link-channel-information-and-synchro.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0093-mtk-hostapd-get-link-channel-information-and-synchro.patch
new file mode 100644
index 0000000..15283a0
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0093-mtk-hostapd-get-link-channel-information-and-synchro.patch
@@ -0,0 +1,83 @@
+From 0946b9ece456bc11e4ef620063e7b0078d3d73aa Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Fri, 17 May 2024 17:21:06 +0800
+Subject: [PATCH 093/126] mtk: hostapd: get link channel information and
+ synchronize to AP
+
+'wpa_s->valid_links' is used to determine the connection is MLO or not,
+and different ways are used to retrieve operating channel information.
+
+Refactor center frequency calculation part in the function
+uc_wpa_freq_info.
+1. It does not have to set seg0 for 2GHz.
+2. The original center frequency calculation is wrong for 2G. Also, center
+ frequency 1 of BW 20/40 MHz can be derived from control frequency &
+ secondary channel offset.
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ src/ap/ucode.c | 2 +-
+ src/utils/ucode.c | 8 +++++---
+ wpa_supplicant/ucode.c | 14 ++++++++++----
+ 3 files changed, 16 insertions(+), 8 deletions(-)
+
+diff --git a/src/ap/ucode.c b/src/ap/ucode.c
+index a69caa6cf..8c05404f5 100644
+--- a/src/ap/ucode.c
++++ b/src/ap/ucode.c
+@@ -657,7 +657,7 @@ out:
+ wpa_printf(MSG_INFO, " * seg0: %d\n",
+ hostapd_get_oper_centr_freq_seg0_idx(conf));
+ wpa_printf(MSG_INFO, " * seg1: %d\n",
+- hostapd_get_oper_centr_freq_seg0_idx(conf));
++ hostapd_get_oper_centr_freq_seg1_idx(conf));
+ wpa_printf(MSG_INFO, " * oper_chwidth: %d\n",
+ hostapd_get_oper_chwidth(conf));
+
+diff --git a/src/utils/ucode.c b/src/utils/ucode.c
+index 81d472f6b..8bbbbbeff 100644
+--- a/src/utils/ucode.c
++++ b/src/utils/ucode.c
+@@ -186,9 +186,11 @@ uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs)
+ ucv_object_add(ret, "oper_chwidth", ucv_int64_new(chanwidth));
+ ucv_object_add(ret, "band_idx", ucv_int64_new(band_idx));
+
+- if (chanwidth == CONF_OPER_CHWIDTH_USE_HT && !sec_channel) {
+- ucv_object_add(ret, "center_seg0_idx", ucv_int64_new(channel));
+- ucv_object_add(ret, "center_freq1", ucv_int64_new(freq_val));
++ if (chanwidth == CONF_OPER_CHWIDTH_USE_HT) {
++ center_idx = freq_val < 3000 ? 0 : channel;
++ ucv_object_add(ret, "center_seg0_idx", ucv_int64_new(center_idx));
++ ucv_object_add(ret, "center_freq1",
++ ucv_int64_new(freq_val + sec_channel * 10));
+ return ret;
+ }
+
+diff --git a/wpa_supplicant/ucode.c b/wpa_supplicant/ucode.c
+index d4b2160b6..450780737 100644
+--- a/wpa_supplicant/ucode.c
++++ b/wpa_supplicant/ucode.c
+@@ -309,10 +309,16 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
+ else if (is_6ghz_freq(bss->freq))
+ band_idx = 2;
+
+- wpa_drv_channel_info(wpa_s, &ci);
+- freq = ci.frequency;
+- center_freq1 = ci.center_frq1;
+- chwidth=ci.chanwidth;
++ if (wpa_s->valid_links) {
++ freq = wpa_s->links[link_id].freq;
++ center_freq1 = wpa_s->links[link_id].center_freq1;
++ chwidth = wpa_s->links[link_id].width;
++ } else {
++ wpa_drv_channel_info(wpa_s, &ci);
++ freq = ci.frequency;
++ center_freq1 = ci.center_frq1;
++ chwidth=ci.chanwidth;
++ }
+
+ if (bss->freq != center_freq1) {
+ if (is_24ghz)
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0094-mtk-hostapd-adjust-Basic-EHT-MCS-and-Nss-Set-in-EHT-.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0094-mtk-hostapd-adjust-Basic-EHT-MCS-and-Nss-Set-in-EHT-.patch
new file mode 100644
index 0000000..6f0544b
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0094-mtk-hostapd-adjust-Basic-EHT-MCS-and-Nss-Set-in-EHT-.patch
@@ -0,0 +1,38 @@
+From 8cb7f55db558b56cc687e4d3407210935a2a4c78 Mon Sep 17 00:00:00 2001
+From: Howard Hsu <howard-yh.hsu@mediatek.com>
+Date: Mon, 20 May 2024 14:59:45 +0800
+Subject: [PATCH 094/126] mtk: hostapd: adjust Basic EHT-MCS and Nss Set in EHT
+ Oper IE
+
+Adjust basic EHT-MCS and Nss set in EHT Operation IE. Only set Rx/Tx Max
+Nss that supports EHT-MCS 0-7 to 1, and the other field shall be set to
+0 (0x11). Without this commit, Intel BE200L in WiFi7 R1 Lab will not send
+auth to ap. The reason why we only set EHT-MCS 0-7 as 1 is we align the IE
+value with other testbed ap.
+
+Please note that this patch is for WiFi7 cert Intel BE200L connection
+issue. hostapd shall support configure this IE by hostapd configuration,
+just like he_basic_mcs_nss_set in HE operation IE.
+
+Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
+---
+ src/ap/ieee802_11_eht.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
+index 59ada2f86..7c328799a 100644
+--- a/src/ap/ieee802_11_eht.c
++++ b/src/ap/ieee802_11_eht.c
+@@ -237,9 +237,6 @@ u8 * hostapd_eid_eht_operation(struct hostapd_data *hapd, u8 *eid)
+
+ /* TODO: Fill in appropriate EHT-MCS max Nss information */
+ oper->basic_eht_mcs_nss_set[0] = 0x11;
+- oper->basic_eht_mcs_nss_set[1] = 0x11;
+- oper->basic_eht_mcs_nss_set[2] = 0x11;
+- oper->basic_eht_mcs_nss_set[3] = 0x11;
+
+ if (!eht_oper_info_present)
+ return pos + elen;
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0095-mtk-hostapd-fix-using-wrong-link-id-in-nl80211_set_c.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0095-mtk-hostapd-fix-using-wrong-link-id-in-nl80211_set_c.patch
new file mode 100644
index 0000000..e5d058a
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0095-mtk-hostapd-fix-using-wrong-link-id-in-nl80211_set_c.patch
@@ -0,0 +1,35 @@
+From eaa5c322744016e6e5ecb45e095fec2bd77af0a5 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Fri, 24 May 2024 11:01:10 +0800
+Subject: [PATCH 095/126] mtk: hostapd: fix using wrong link id in
+ nl80211_set_channel during set beacon
+
+param.freq->link_id is used in nl80211_set_channel but it is not set in __ieee802_11_set_beacon.
+nl80211_set_channel will return EBUSY after channel switch.
+This error occurs repeatedly especially when the bandwidth is changed.
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ src/ap/beacon.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/ap/beacon.c b/src/ap/beacon.c
+index 9b5c4fc1e..59db8be8d 100644
+--- a/src/ap/beacon.c
++++ b/src/ap/beacon.c
+@@ -2866,6 +2866,12 @@ static int __ieee802_11_set_beacon(struct hostapd_data *hapd)
+ params.freq = &freq;
+ }
+
++ params.freq->link_id = -1;
++#ifdef CONFIG_IEEE80211BE
++ if (hapd->conf->mld_ap)
++ params.freq->link_id = hapd->mld_link_id;
++#endif /* CONFIG_IEEE80211BE */
++
+ for (i = 0; i < hapd->iface->num_hw_features; i++) {
+ mode = &hapd->iface->hw_features[i];
+
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0096-mtk-hostapd-Remove-BPCC-and-ML-ie-in-per-sta-profile.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0096-mtk-hostapd-Remove-BPCC-and-ML-ie-in-per-sta-profile.patch
new file mode 100644
index 0000000..6133ae8
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0096-mtk-hostapd-Remove-BPCC-and-ML-ie-in-per-sta-profile.patch
@@ -0,0 +1,104 @@
+From 7c009a478fec002ec626163eff2c686b14bc9aa5 Mon Sep 17 00:00:00 2001
+From: Allen Ye <allen.ye@mediatek.com>
+Date: Thu, 23 May 2024 11:07:25 +0800
+Subject: [PATCH 096/126] mtk: hostapd: Remove BPCC and ML ie in per-sta
+ profile of ML probe response
+
+wifi7 cert testplan request DUT do not bring BPCC in STA info of
+per-sta profile of ML probe response.
+The standard defined not bring ML ie in per-sta profile.
+
+Signed-off-by: Allen Ye <allen.ye@mediatek.com>
+---
+ src/ap/beacon.c | 2 +-
+ src/ap/ieee802_11_eht.c | 21 +++++++++++----------
+ 2 files changed, 12 insertions(+), 11 deletions(-)
+
+diff --git a/src/ap/beacon.c b/src/ap/beacon.c
+index 59db8be8d..1ffe2fb56 100644
+--- a/src/ap/beacon.c
++++ b/src/ap/beacon.c
+@@ -929,7 +929,7 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd,
+ struct hostapd_data *ml_elem_ap =
+ params->mld_ap ? params->mld_ap : hapd;
+
+- if (ml_elem_ap->conf->mld_ap)
++ if (!params->is_ml_sta_info && ml_elem_ap->conf->mld_ap)
+ pos = hostapd_eid_eht_ml_beacon(
+ ml_elem_ap, params->mld_info,
+ pos, !!params->mld_ap);
+diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
+index 7c328799a..02e85194c 100644
+--- a/src/ap/ieee802_11_eht.c
++++ b/src/ap/ieee802_11_eht.c
+@@ -545,8 +545,8 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd,
+ * beacon interval (2) + TSF offset (8) + DTIM info (2) + BSS
+ * parameters change counter (1) + station profile length.
+ */
+-#define EHT_ML_STA_INFO_LEN 22
+- size_t total_len = EHT_ML_STA_INFO_LEN +
++ size_t sta_info_len = include_mld_id ? 21 : 22;
++ size_t total_len = sta_info_len +
+ link->resp_sta_profile_len;
+
+ /* Skip the local one */
+@@ -574,14 +574,16 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd,
+ EHT_PER_STA_CTRL_COMPLETE_PROFILE_MSK |
+ EHT_PER_STA_CTRL_TSF_OFFSET_PRESENT_MSK |
+ EHT_PER_STA_CTRL_BEACON_INTERVAL_PRESENT_MSK |
+- EHT_PER_STA_CTRL_DTIM_INFO_PRESENT_MSK |
+- EHT_PER_STA_CTRL_BSS_PARAM_CNT_PRESENT_MSK;
++ EHT_PER_STA_CTRL_DTIM_INFO_PRESENT_MSK;
++
++ if (!include_mld_id)
++ control |= EHT_PER_STA_CTRL_BSS_PARAM_CNT_PRESENT_MSK;
+ wpabuf_put_le16(buf, control);
+
+ /* STA Info */
+
+ /* STA Info Length */
+- wpabuf_put_u8(buf, EHT_ML_STA_INFO_LEN - 2);
++ wpabuf_put_u8(buf, sta_info_len - 2);
+ wpabuf_put_data(buf, link->local_addr, ETH_ALEN);
+ wpabuf_put_le16(buf, link_bss->iconf->beacon_int);
+
+@@ -597,7 +599,8 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd,
+ wpabuf_put_u8(buf, link_bss->conf->dtim_period);
+
+ /* BSS Parameters Change Count */
+- wpabuf_put_u8(buf, link_bss->eht_mld_bss_param_change);
++ if (!include_mld_id)
++ wpabuf_put_u8(buf, link_bss->eht_mld_bss_param_change);
+
+ if (!link->resp_sta_profile)
+ continue;
+@@ -613,8 +616,7 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd,
+ ptr = link->resp_sta_profile;
+ len = link->resp_sta_profile_len;
+
+- slice_len = 255 - EHT_ML_STA_INFO_LEN;
+-
++ slice_len = 255 - sta_info_len;
+ wpabuf_put_data(buf, ptr, slice_len);
+ len -= slice_len;
+ ptr += slice_len;
+@@ -764,7 +766,7 @@ static size_t hostapd_eid_eht_ml_len(struct mld_info *info,
+ for (link_id = 0; info && link_id < ARRAY_SIZE(info->links);
+ link_id++) {
+ struct mld_link_info *link;
+- size_t sta_len = EHT_ML_STA_INFO_LEN;
++ size_t sta_len = include_mld_id ? 21 : 22;
+
+ link = &info->links[link_id];
+ if (!link->valid)
+@@ -789,7 +791,6 @@ static size_t hostapd_eid_eht_ml_len(struct mld_info *info,
+ return len;
+ }
+ #undef EHT_ML_COMMON_INFO_LEN
+-#undef EHT_ML_STA_INFO_LEN
+
+
+ u8 * hostapd_eid_eht_ml_beacon(struct hostapd_data *hapd,
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0097-mtk-hostapd-add-channel-switch-band-sanity-check.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0097-mtk-hostapd-add-channel-switch-band-sanity-check.patch
new file mode 100644
index 0000000..7ea83ec
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0097-mtk-hostapd-add-channel-switch-band-sanity-check.patch
@@ -0,0 +1,40 @@
+From 0710501eee6f7a2c06fc8f0c5d3e4db8fddc349d Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Thu, 30 May 2024 11:24:54 +0800
+Subject: [PATCH 097/126] mtk: hostapd: add channel switch band sanity check
+
+Add band sanity check in case user selecting the wrong freq or link id
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ hostapd/ctrl_iface.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index 2038a3712..14a0483bf 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -2816,6 +2816,7 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+ char *pos)
+ {
+ #ifdef NEED_AP_MLME
++ struct hostapd_hw_modes *mode = iface->current_mode;
+ struct csa_settings settings;
+ int ret;
+ int dfs_range = 0;
+@@ -2835,6 +2836,12 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+ settings.link_id = iface->bss[0]->mld_link_id;
+ #endif /* CONFIG_IEEE80211BE */
+
++ if (!mode ||
++ !is_same_band(mode->channels->freq, settings.freq_params.freq)) {
++ wpa_printf(MSG_ERROR, "Invalid band for current mode");
++ return -1;
++ }
++
+ ret = hostapd_ctrl_check_freq_params(&settings.freq_params,
+ settings.punct_bitmap);
+ if (ret) {
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0098-mtk-hostapd-Fix-the-issue-with-the-presence-of-MLD_I.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0098-mtk-hostapd-Fix-the-issue-with-the-presence-of-MLD_I.patch
new file mode 100644
index 0000000..e35a423
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0098-mtk-hostapd-Fix-the-issue-with-the-presence-of-MLD_I.patch
@@ -0,0 +1,51 @@
+From 933e864265735dd4b668f13cced18e18b789b41c Mon Sep 17 00:00:00 2001
+From: "MeiChia.Chiu" <MeiChia.Chiu@mediatek.com>
+Date: Mon, 3 Jun 2024 14:29:24 +0800
+Subject: [PATCH 098/126] mtk: hostapd: Fix the issue with the presence of
+ MLD_ID in the probe response
+
+The probe response carries the MLD_ID value only
+when mld_id is not 0 (e.g., NonTxBSS).
+
+Signed-off-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
+Signed-off-by: Money Wang <money.wang@mediatek.com>
+Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
+---
+ src/ap/ieee802_11_eht.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
+index 02e85194c..8fc239f36 100644
+--- a/src/ap/ieee802_11_eht.c
++++ b/src/ap/ieee802_11_eht.c
+@@ -480,7 +480,7 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd,
+ if (hapd->iconf->eml_disable)
+ common_info_len -= 2; /* EML Capabilities (2) */
+
+- if (include_mld_id) {
++ if (include_mld_id && hostapd_get_mld_id(hapd)) {
+ /* AP MLD ID */
+ control |= BASIC_MULTI_LINK_CTRL_PRES_AP_MLD_ID;
+ common_info_len++;
+@@ -526,7 +526,7 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd,
+ mld_cap);
+ wpabuf_put_le16(buf, mld_cap);
+
+- if (include_mld_id) {
++ if (include_mld_id && hostapd_get_mld_id(hapd)) {
+ wpa_printf(MSG_DEBUG, "MLD: AP MLD ID=0x%x",
+ hostapd_get_mld_id(hapd));
+ wpabuf_put_u8(buf, hostapd_get_mld_id(hapd));
+@@ -820,7 +820,8 @@ size_t hostapd_eid_eht_ml_beacon_len(struct hostapd_data *hapd,
+ struct mld_info *info,
+ bool include_mld_id)
+ {
+- return hostapd_eid_eht_ml_len(info, include_mld_id,
++ return hostapd_eid_eht_ml_len(info,
++ include_mld_id && hostapd_get_mld_id(hapd),
+ hapd->iconf->eml_disable);
+ }
+
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0099-fixup-mtk-wifi-hostapd-add-wds-mlo-support.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0099-fixup-mtk-wifi-hostapd-add-wds-mlo-support.patch
deleted file mode 100644
index c27e065..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0099-fixup-mtk-wifi-hostapd-add-wds-mlo-support.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From a5c0e5c09398a247236d73078a4f86a960a97e34 Mon Sep 17 00:00:00 2001
-From: Peter Chiu <chui-hao.chiu@mediatek.com>
-Date: Mon, 8 Apr 2024 16:27:51 +0800
-Subject: [PATCH 099/104] fixup! mtk: wifi: hostapd: add wds mlo support
-
-The latest get_hapd_bssid return hapd only if link id is matched.
-However,the hostapd_rx_from_unknown_sta does not have link
-information so it cannot get hapd.
-
-Modify get_hapd_bssid to ignore link id when link id is -1.
-
-Without this patch, wds mode cannot work and the AP would not be
-aware that station is using 4 address.
-
-Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
----
- src/ap/drv_callbacks.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
-index 27c7555a1..82973c5e4 100644
---- a/src/ap/drv_callbacks.c
-+++ b/src/ap/drv_callbacks.c
-@@ -1779,7 +1779,7 @@ static struct hostapd_data * get_hapd_bssid(struct hostapd_iface *iface,
- if (ether_addr_equal(bssid, hapd->own_addr) ||
- (hapd->conf->mld_ap &&
- ether_addr_equal(bssid, hapd->mld->mld_addr) &&
-- link_id == hapd->mld_link_id)) {
-+ (link_id == hapd->mld_link_id || link_id == -1))) {
- return hapd;
- } else if (hapd->conf->mld_ap) {
- for_each_mld_link(p_hapd, hapd) {
-@@ -1788,7 +1788,7 @@ static struct hostapd_data * get_hapd_bssid(struct hostapd_iface *iface,
-
- if (ether_addr_equal(bssid, p_hapd->own_addr) ||
- (ether_addr_equal(bssid, p_hapd->mld->mld_addr) &&
-- link_id == p_hapd->mld_link_id))
-+ (link_id == p_hapd->mld_link_id || link_id == -1)))
- return p_hapd;
- }
- }
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0099-mtk-hostapd-add-support-for-DFS-channel-switching-wi.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0099-mtk-hostapd-add-support-for-DFS-channel-switching-wi.patch
new file mode 100644
index 0000000..3274297
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0099-mtk-hostapd-add-support-for-DFS-channel-switching-wi.patch
@@ -0,0 +1,539 @@
+From 6805573a7891d68ef5d71c6dcf362ffbd2119240 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Wed, 15 Nov 2023 15:06:00 +0800
+Subject: [PATCH 099/126] mtk: hostapd: add support for DFS channel switching
+ with csa sent
+
+Add support for DFS channel switch
+
+When searching for a DFS channel for a background radar channel switch,
+we should not base the selection on the cap of the original channel.
+Otherwise, the selected channel may become invalid when the bandwidth is changed.
+For example, iface->conf->secondary_channel is set to 0 when operating on BW 20.
+Therefore, if the user tries to switch from BW 20 to BW 80, the pre-selected channel
+for BW 80 will not be checked by dfs_is_chan_allowed in dfs_find_channel.
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ hostapd/ctrl_iface.c | 105 +++++++++++++++---------
+ src/ap/beacon.c | 5 ++
+ src/ap/ctrl_iface_ap.c | 5 +-
+ src/ap/dfs.c | 182 +++++++++++++++++++++++++++++++++++------
+ src/ap/dfs.h | 11 ++-
+ src/ap/ieee802_11.c | 5 ++
+ 6 files changed, 243 insertions(+), 70 deletions(-)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index 14a0483bf..3943cb3aa 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -2817,12 +2817,12 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+ {
+ #ifdef NEED_AP_MLME
+ struct hostapd_hw_modes *mode = iface->current_mode;
+- struct csa_settings settings;
++ struct csa_settings settings, background_settings;
+ int ret;
+- int dfs_range = 0;
++ int freq, state;
++ int bandwidth, oper_chwidth;
++ bool background_radar, bw_changed, cac_required = false;
+ unsigned int i;
+- int bandwidth;
+- u8 chan;
+ unsigned int num_err = 0;
+ int err = 0;
+
+@@ -2853,21 +2853,28 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+ switch (settings.freq_params.bandwidth) {
+ case 40:
+ bandwidth = CHAN_WIDTH_40;
++ oper_chwidth = CONF_OPER_CHWIDTH_USE_HT;
+ break;
+ case 80:
+- if (settings.freq_params.center_freq2)
++ if (settings.freq_params.center_freq2) {
+ bandwidth = CHAN_WIDTH_80P80;
+- else
++ oper_chwidth = CONF_OPER_CHWIDTH_80P80MHZ;
++ } else {
+ bandwidth = CHAN_WIDTH_80;
++ oper_chwidth = CONF_OPER_CHWIDTH_80MHZ;
++ }
+ break;
+ case 160:
+ bandwidth = CHAN_WIDTH_160;
++ oper_chwidth = CONF_OPER_CHWIDTH_160MHZ;
+ break;
+ case 320:
+ bandwidth = CHAN_WIDTH_320;
++ oper_chwidth = CONF_OPER_CHWIDTH_320MHZ;
+ break;
+ default:
+ bandwidth = CHAN_WIDTH_20;
++ oper_chwidth = CONF_OPER_CHWIDTH_USE_HT;
+ break;
+ }
+
+@@ -2882,41 +2889,29 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+ }
+
+ if (settings.freq_params.center_freq1)
+- dfs_range += hostapd_is_dfs_overlap(
+- iface, bandwidth, settings.freq_params.center_freq1);
++ freq = settings.freq_params.center_freq1;
+ else
+- dfs_range += hostapd_is_dfs_overlap(
+- iface, bandwidth, settings.freq_params.freq);
+-
+- if (settings.freq_params.center_freq2)
+- dfs_range += hostapd_is_dfs_overlap(
+- iface, bandwidth, settings.freq_params.center_freq2);
+-
+- if (dfs_range) {
+- ret = ieee80211_freq_to_chan(settings.freq_params.freq, &chan);
+- if (ret == NUM_HOSTAPD_MODES) {
+- wpa_printf(MSG_ERROR,
+- "Failed to get channel for (freq=%d, sec_channel_offset=%d, bw=%d)",
+- settings.freq_params.freq,
+- settings.freq_params.sec_channel_offset,
+- settings.freq_params.bandwidth);
+- return -1;
+- }
+-
+- settings.freq_params.channel = chan;
+-
+- wpa_printf(MSG_DEBUG,
+- "DFS/CAC to (channel=%u, freq=%d, sec_channel_offset=%d, bw=%d, center_freq1=%d)",
+- settings.freq_params.channel,
+- settings.freq_params.freq,
+- settings.freq_params.sec_channel_offset,
+- settings.freq_params.bandwidth,
+- settings.freq_params.center_freq1);
+-
+- /* Perform CAC and switch channel */
+- iface->is_ch_switch_dfs = true;
+- hostapd_switch_channel_fallback(iface, &settings.freq_params);
+- return 0;
++ freq = settings.freq_params.freq;
++
++ bw_changed = oper_chwidth != hostapd_get_oper_chwidth(iface->conf);
++ state = hostapd_dfs_get_target_state(iface, bandwidth, freq,
++ settings.freq_params.center_freq2);
++ switch (state) {
++ case HOSTAPD_CHAN_DFS_USABLE:
++ cac_required = true;
++ /* fallthrough */
++ case HOSTAPD_CHAN_DFS_AVAILABLE:
++ background_radar = hostapd_dfs_handle_csa(iface, &settings,
++ &background_settings,
++ cac_required,
++ bw_changed);
++ break;
++ case HOSTAPD_CHAN_DFS_UNAVAILABLE:
++ wpa_printf(MSG_INFO,
++ "chanswitch: target channel is UNAVAILABLE, so stop switching");
++ return -1;
++ default:
++ break;
+ }
+
+ for (i = 0; i < iface->num_bss; i++) {
+@@ -2944,6 +2939,36 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+ #endif /* CONFIG_IEEE80211BE */
+ }
+
++ if (background_radar) {
++ u8 seg0 = 0, seg1 = 0;
++
++ ieee80211_freq_to_chan(background_settings.freq_params.center_freq1, &seg0);
++ ieee80211_freq_to_chan(background_settings.freq_params.center_freq2, &seg1);
++ ret = hostapd_start_dfs_cac(iface, iface->conf->hw_mode,
++ background_settings.freq_params.freq,
++ background_settings.freq_params.channel,
++ background_settings.freq_params.ht_enabled,
++ background_settings.freq_params.vht_enabled,
++ background_settings.freq_params.he_enabled,
++ background_settings.freq_params.eht_enabled,
++ background_settings.freq_params.sec_channel_offset,
++ oper_chwidth, seg0, seg1, true);
++ if (ret) {
++ wpa_printf(MSG_ERROR, "Background radar start dfs cac failed, %d",
++ ret);
++ iface->radar_background.channel = -1;
++ return -1;
++ }
++
++ /* Cache background radar parameters. */
++ iface->radar_background.channel = background_settings.freq_params.channel;
++ iface->radar_background.secondary_channel =
++ background_settings.freq_params.sec_channel_offset;
++ iface->radar_background.freq = background_settings.freq_params.freq;
++ iface->radar_background.centr_freq_seg0_idx = seg0;
++ iface->radar_background.centr_freq_seg1_idx = seg1;
++ }
++
+ return (iface->num_bss == num_err) ? ret : 0;
+ #else /* NEED_AP_MLME */
+ return -1;
+diff --git a/src/ap/beacon.c b/src/ap/beacon.c
+index 1ffe2fb56..36f4feb3a 100644
+--- a/src/ap/beacon.c
++++ b/src/ap/beacon.c
+@@ -2794,6 +2794,11 @@ static int __ieee802_11_set_beacon(struct hostapd_data *hapd)
+ return -1;
+ }
+
++ if (iface->cac_started) {
++ wpa_printf(MSG_DEBUG, "Ignore set beacons during CAC period");
++ return 0;
++ }
++
+ hapd->beacon_set_done = 1;
+
+ if (ieee802_11_build_ap_params(hapd, ¶ms) < 0)
+diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
+index 20d426560..b0ee00b90 100644
+--- a/src/ap/ctrl_iface_ap.c
++++ b/src/ap/ctrl_iface_ap.c
+@@ -1099,6 +1099,7 @@ int hostapd_parse_csa_settings(const char *pos,
+ struct csa_settings *settings)
+ {
+ char *end;
++ int ret;
+
+ os_memset(settings, 0, sizeof(*settings));
+ settings->cs_count = strtol(pos, &end, 10);
+@@ -1108,7 +1109,9 @@ int hostapd_parse_csa_settings(const char *pos,
+ }
+
+ settings->freq_params.freq = atoi(end);
+- if (settings->freq_params.freq == 0) {
++ ret = ieee80211_freq_to_chan(settings->freq_params.freq,
++ (u8 *)&settings->freq_params.channel);
++ if (ret == NUM_HOSTAPD_MODES) {
+ wpa_printf(MSG_ERROR, "chanswitch: invalid freq provided");
+ return -1;
+ }
+diff --git a/src/ap/dfs.c b/src/ap/dfs.c
+index 697e6364c..5e9a2a4ce 100644
+--- a/src/ap/dfs.c
++++ b/src/ap/dfs.c
+@@ -242,22 +242,22 @@ static int is_in_chanlist(struct hostapd_iface *iface,
+ */
+ int dfs_find_channel(struct hostapd_iface *iface,
+ struct hostapd_channel_data **ret_chan,
+- int idx, enum dfs_channel_type type)
++ int n_chans, int idx, enum dfs_channel_type type)
+ {
+ struct hostapd_hw_modes *mode;
+ struct hostapd_channel_data *chan;
+- int i, channel_idx = 0, n_chans, n_chans1;
++ int i, channel_idx = 0, n_chans1;
+
+ mode = iface->current_mode;
+- n_chans = dfs_get_used_n_chans(iface, &n_chans1);
++ if (!n_chans)
++ n_chans = dfs_get_used_n_chans(iface, &n_chans1);
+
+ wpa_printf(MSG_DEBUG, "DFS new chan checking %d channels", n_chans);
+ for (i = 0; i < mode->num_channels; i++) {
+ chan = &mode->channels[i];
+
+ /* Skip HT40/VHT incompatible channels */
+- if (iface->conf->ieee80211n &&
+- iface->conf->secondary_channel &&
++ if (iface->conf->ieee80211n && n_chans > 1 &&
+ (!dfs_is_chan_allowed(chan, n_chans) ||
+ !(chan->allowed_bw & HOSTAPD_CHAN_WIDTH_40P))) {
+ wpa_printf(MSG_DEBUG,
+@@ -550,7 +550,7 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
+ return NULL;
+
+ /* Get the count first */
+- num_available_chandefs = dfs_find_channel(iface, NULL, 0, type);
++ num_available_chandefs = dfs_find_channel(iface, NULL, 0, 0, type);
+ wpa_printf(MSG_DEBUG, "DFS: num_available_chandefs=%d",
+ num_available_chandefs);
+ if (num_available_chandefs == 0)
+@@ -573,7 +573,7 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
+ chan_idx = _rand % num_available_chandefs;
+ wpa_printf(MSG_DEBUG, "DFS: Picked random entry from the list: %d/%d",
+ chan_idx, num_available_chandefs);
+- dfs_find_channel(iface, &chan, chan_idx, type);
++ dfs_find_channel(iface, &chan, 0, chan_idx, type);
+ if (!chan) {
+ wpa_printf(MSG_DEBUG, "DFS: no random channel found");
+ return NULL;
+@@ -603,7 +603,7 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
+ for (i = 0; i < num_available_chandefs - 1; i++) {
+ /* start from chan_idx + 1, end when chan_idx - 1 */
+ chan_idx2 = (chan_idx + 1 + i) % num_available_chandefs;
+- dfs_find_channel(iface, &chan2, chan_idx2, type);
++ dfs_find_channel(iface, &chan2, 0, chan_idx2, type);
+ if (chan2 && abs(chan2->chan - chan->chan) > 12) {
+ /* two channels are not adjacent */
+ sec_chan_idx_80p80 = chan2->chan;
+@@ -1367,10 +1367,10 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
+ * another radio.
+ */
+ if (iface->state != HAPD_IFACE_ENABLED &&
+- hostapd_is_dfs_chan_available(iface)) {
++ hostapd_is_dfs_chan_available(iface))
+ hostapd_setup_interface_complete(iface, 0);
+- iface->cac_started = 0;
+- }
++
++ iface->cac_started = 0;
+
+ /*
+ * When background radar is enabled but the CAC completion
+@@ -1386,6 +1386,13 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
+ iface->radar_background.temp_ch = 0;
+ iface->radar_background.expand_ch = 0;
+ hostapd_dfs_update_background_chain(iface);
++ } else if (iface->state == HAPD_IFACE_ENABLED) {
++ int i;
++
++ iface->cac_started = 0;
++ /* Clear all CSA flags once channel switch to DFS channel fails */
++ for (i = 0; i < iface->num_bss; i++)
++ iface->bss[i]->csa_in_progress = 0;
+ }
+
+ iface->radar_detected = false;
+@@ -1410,6 +1417,9 @@ int hostapd_dfs_pre_cac_expired(struct hostapd_iface *iface, int freq,
+ set_dfs_state(iface, freq, ht_enabled, chan_offset, chan_width,
+ cf1, cf2, HOSTAPD_CHAN_DFS_USABLE);
+
++ if (dfs_use_radar_background(iface) && iface->radar_background.channel == -1)
++ hostapd_dfs_update_background_chain(iface);
++
+ return 0;
+ }
+
+@@ -1798,7 +1808,8 @@ int hostapd_dfs_start_cac(struct hostapd_iface *iface, int freq,
+ /* This is called when the driver indicates that an offloaded
+ * DFS has started CAC. radar_detected might be set for previous
+ * DFS channel. Clear it for this new CAC process. */
+- hostapd_set_state(iface, HAPD_IFACE_DFS);
++ if (iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD)
++ hostapd_set_state(iface, HAPD_IFACE_DFS);
+ iface->cac_started = 1;
+
+ /* Clear radar_detected in case it is for the previous
+@@ -1866,14 +1877,15 @@ int hostapd_handle_dfs_offload(struct hostapd_iface *iface)
+ }
+
+
+-int hostapd_is_dfs_overlap(struct hostapd_iface *iface, enum chan_width width,
+- int center_freq)
++int hostapd_dfs_get_target_state(struct hostapd_iface *iface, enum chan_width width,
++ int center_freq, int center_freq2)
+ {
+ struct hostapd_channel_data *chan;
+ struct hostapd_hw_modes *mode = iface->current_mode;
+- int half_width;
+- int res = 0;
++ int half_width, chan_state, state = 0;
++ int upper, lower;
+ int i;
++ bool in_range;
+
+ if (!iface->conf->ieee80211h || !mode ||
+ mode->mode != HOSTAPD_MODE_IEEE80211A)
+@@ -1906,18 +1918,136 @@ int hostapd_is_dfs_overlap(struct hostapd_iface *iface, enum chan_width width,
+ if (!(chan->flag & HOSTAPD_CHAN_RADAR))
+ continue;
+
+- if ((chan->flag & HOSTAPD_CHAN_DFS_MASK) ==
+- HOSTAPD_CHAN_DFS_AVAILABLE)
+- continue;
++ upper = chan->freq + half_width;
++ lower = chan->freq - half_width;
++ in_range = (lower < center_freq && center_freq < upper) ||
++ (center_freq2 && (lower < center_freq2 && center_freq2 < upper));
++ if (in_range) {
++ chan_state = chan->flag & HOSTAPD_CHAN_DFS_MASK;
++ switch (chan_state) {
++ case HOSTAPD_CHAN_DFS_USABLE:
++ state = HOSTAPD_CHAN_DFS_USABLE;
++ break;
++ case HOSTAPD_CHAN_DFS_AVAILABLE:
++ if (state != HOSTAPD_CHAN_DFS_USABLE)
++ state = HOSTAPD_CHAN_DFS_AVAILABLE;
++ break;
++ case HOSTAPD_CHAN_DFS_UNKNOWN:
++ wpa_printf(MSG_WARNING, "chan %d DFS state: UNKNOWN",
++ chan->freq);
++ /* fallthrough */
++ case HOSTAPD_CHAN_DFS_UNAVAILABLE:
++ default:
++ return HOSTAPD_CHAN_DFS_UNAVAILABLE;
++ }
++ }
++ }
+
+- if (center_freq - chan->freq < half_width &&
+- chan->freq - center_freq < half_width)
+- res++;
++ wpa_printf(MSG_DEBUG, "freq range (%d, %d) has DFS state %d",
++ center_freq - half_width, center_freq + half_width, state);
++
++ return state;
++}
++
++
++static struct hostapd_channel_data *
++dfs_get_csa_channel(struct hostapd_iface *iface,
++ int n_chans, int cur_center,
++ enum dfs_channel_type type)
++{
++ struct hostapd_channel_data *chan;
++ int avail_chan_num;
++ u32 _rand, idx;
++
++ if (os_get_random((u8 *)&_rand, sizeof(_rand)) < 0)
++ return NULL;
++
++ avail_chan_num = dfs_find_channel(iface, NULL, n_chans, 0, type);
++ if (!avail_chan_num)
++ return NULL;
++
++ idx = _rand % avail_chan_num;
++ dfs_find_channel(iface, &chan, n_chans, idx, type);
++ if (cur_center == chan->freq + (n_chans - 1) * 10) {
++ if (avail_chan_num == 1)
++ return NULL;
++
++ /* Get the next channel if the found channel is same as current channel */
++ idx = (idx + 1) % avail_chan_num;
++ dfs_find_channel(iface, &chan, n_chans, idx, type);
+ }
+
+- wpa_printf(MSG_DEBUG, "DFS CAC required: (%d, %d): in range: %s",
+- center_freq - half_width, center_freq + half_width,
+- res ? "yes" : "no");
++ return chan;
++}
++
+
+- return res;
++/*
++ * DFS handler for CSA
++ * 1 - update background radar with the filled setting
++ * 0 - background radar is not enabled / background radar remain at the same channel /
++ * disable background radar
++ */
++int hostapd_dfs_handle_csa(struct hostapd_iface *iface,
++ struct csa_settings *settings,
++ struct csa_settings *background_settings,
++ bool cac_required, bool bw_changed)
++{
++ struct hostapd_channel_data *chan;
++ struct hostapd_freq_params *freq_params = &settings->freq_params;
++ int center = settings->freq_params.center_freq1;
++ int background_center = 5000 + iface->radar_background.centr_freq_seg0_idx * 5;
++ int n_chans = settings->freq_params.bandwidth / 20;
++ bool update_background = false;
++
++ if (!dfs_use_radar_background(iface)) {
++ settings->cs_count = 5;
++ settings->block_tx = cac_required;
++ return 0;
++ }
++
++ if (!cac_required) {
++ if (!bw_changed && center != background_center)
++ return 0;
++ /* Update background radar due to bw change or channel overlapping */
++ update_background = true;
++ } else {
++ /*
++ * Get available channel for main channel if background radar
++ * is ready (no CAC in progress).
++ * If no available channel exists or background radar is not ready,
++ * then perform the CAC of the target channel on the main channel.
++ * Also, select an usable channel for background radar if no
++ * available channel exists.
++ */
++ if (!iface->radar_background.cac_started) {
++ iface->radar_background.temp_ch = 1;
++ chan = dfs_get_csa_channel(iface, n_chans, 0, DFS_AVAILABLE);
++ if (!chan)
++ update_background = true;
++ } else {
++ iface->radar_background.temp_ch = 0;
++ return 0;
++ }
++ }
++
++ if (update_background) {
++ chan = dfs_get_csa_channel(iface, n_chans, center, DFS_NO_CAC_YET);
++ if (!chan)
++ goto bkg_disable;
++ freq_params = &background_settings->freq_params;
++ iface->radar_background.temp_ch = 0;
++ }
++
++ memcpy(background_settings, settings, sizeof(*settings));
++ freq_params->freq = chan->freq;
++ freq_params->channel = chan->chan;
++ freq_params->sec_channel_offset = 1;
++ freq_params->center_freq1 = chan->freq + (n_chans - 1) * 10;
++ freq_params->center_freq2 = 0;
++
++ return 1;
++
++bkg_disable:
++ iface->radar_background.channel = -1;
++ return 0;
+ }
+diff --git a/src/ap/dfs.h b/src/ap/dfs.h
+index a1a2be5ec..adb09deaf 100644
+--- a/src/ap/dfs.h
++++ b/src/ap/dfs.h
+@@ -42,16 +42,21 @@ int hostapd_dfs_start_cac(struct hostapd_iface *iface, int freq,
+ int ht_enabled, int chan_offset, int chan_width,
+ int cf1, int cf2);
+ int hostapd_handle_dfs_offload(struct hostapd_iface *iface);
+-int hostapd_is_dfs_overlap(struct hostapd_iface *iface, enum chan_width width,
+- int center_freq);
++int hostapd_dfs_get_target_state(struct hostapd_iface *iface, enum chan_width width,
++ int center_freq, int center_freq2);
+ int dfs_find_channel(struct hostapd_iface *iface,
+ struct hostapd_channel_data **ret_chan,
+- int idx, enum dfs_channel_type type);
++ int n_chans, int idx, enum dfs_channel_type type);
+ void dfs_adjust_center_freq(struct hostapd_iface *iface,
+ struct hostapd_channel_data *chan,
+ int secondary_channel,
+ int sec_chan_idx_80p80,
+ u8 *oper_centr_freq_seg0_idx,
+ u8 *oper_centr_freq_seg1_idx);
++int hostapd_dfs_handle_csa(struct hostapd_iface *iface,
++ struct csa_settings *settings,
++ struct csa_settings *background_settings,
++ bool cac_required, bool bw_changed);
++
+
+ #endif /* DFS_H */
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index 09f033e13..7dac7a896 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -6382,6 +6382,11 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len,
+ return 1;
+ }
+
++ if (hapd->iface->cac_started) {
++ wpa_printf(MSG_DEBUG, "MGMT: Ignore management frame during CAC");
++ return 1;
++ }
++
+ if (stype == WLAN_FC_STYPE_PROBE_REQ) {
+ handle_probe_req(hapd, mgmt, len, ssi_signal);
+ return 1;
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0100-Revert-AP-MLD-Add-MLO-Link-KDE-for-each-affiliated-l.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0100-Revert-AP-MLD-Add-MLO-Link-KDE-for-each-affiliated-l.patch
new file mode 100644
index 0000000..9fcefe2
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0100-Revert-AP-MLD-Add-MLO-Link-KDE-for-each-affiliated-l.patch
@@ -0,0 +1,49 @@
+From b5bf8726bf81b90d628dd398579309fef5b6651b Mon Sep 17 00:00:00 2001
+From: Howard Hsu <howard-yh.hsu@mediatek.com>
+Date: Thu, 6 Jun 2024 22:11:45 +0800
+Subject: [PATCH 100/126] Revert "AP MLD: Add MLO Link KDE for each affiliated
+ link in EAPOL-Key 3/4"
+
+This reverts commit df59880042cd8d9b4bdd2dce6de0a6e233be1b64.
+
+Please noted that this commit is a workaround for MTK STA IoT issue within WiFi7 R1 certification.
+
+Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
+
+---
+ src/ap/wpa_auth.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
+index 3a1d288dd..6cb5a4be7 100644
+--- a/src/ap/wpa_auth.c
++++ b/src/ap/wpa_auth.c
+@@ -4484,6 +4484,12 @@ static size_t wpa_auth_ml_kdes_len(struct wpa_state_machine *sm)
+ struct wpa_authenticator *wpa_auth;
+ const u8 *ie;
+
++ /* FIXME: This is a temporary workaround for MTK
++ * sta IoT issue in WiFi7 cert.
++ */
++ if (!sm->mld_links[link_id].valid)
++ continue;
++
+ wpa_auth = wpa_get_link_auth(sm->wpa_auth, link_id);
+ if (!wpa_auth)
+ continue;
+@@ -4548,6 +4554,12 @@ static u8 * wpa_auth_ml_kdes(struct wpa_state_machine *sm, u8 *pos)
+ const u8 *rsne, *rsnxe, *rsnoe, *rsno2e, *rsnxoe;
+ size_t rsne_len, rsnxe_len, rsnoe_len, rsno2e_len, rsnxoe_len;
+
++ /* FIXME: This is a temporary workaround for MTK
++ * sta IoT issue in WiFi7 cert.
++ */
++ if (!sm->mld_links[link_id].valid)
++ continue;
++
+ wpa_auth = wpa_get_link_auth(sm->wpa_auth, link_id);
+ if (!wpa_auth)
+ continue;
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0100-mtk-hostapd-MLD-find-partner-links-by-BSSID-and-SSID.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0100-mtk-hostapd-MLD-find-partner-links-by-BSSID-and-SSID.patch
deleted file mode 100644
index 7e2c70b..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0100-mtk-hostapd-MLD-find-partner-links-by-BSSID-and-SSID.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From 30cfdaf10a5b3bb2a173a096b2c708c4a18d55bc Mon Sep 17 00:00:00 2001
-From: Michael-CY Lee <michael-cy.lee@mediatek.com>
-Date: Mon, 8 Apr 2024 14:34:36 +0800
-Subject: [PATCH 100/104] mtk: hostapd: MLD: find partner links by BSSID and
- SSID
-
-Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
----
- wpa_supplicant/bss.c | 8 ++++++--
- wpa_supplicant/sme.c | 14 ++++++++------
- 2 files changed, 14 insertions(+), 8 deletions(-)
-
-diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
-index 289035310..ae0e61bc3 100644
---- a/wpa_supplicant/bss.c
-+++ b/wpa_supplicant/bss.c
-@@ -1529,8 +1529,12 @@ wpa_bss_parse_ml_rnr_ap_info(struct wpa_supplicant *wpa_s,
- wpa_printf(MSG_DEBUG,
- "MLD: Reported link not part of MLD");
- } else if (!(BIT(link_id) & *seen)) {
-- struct wpa_bss *neigh_bss =
-- wpa_bss_get_bssid(wpa_s, pos + 1);
-+ struct wpa_bss *neigh_bss;
-+
-+ if (ssid)
-+ neigh_bss = wpa_bss_get(wpa_s, pos + 1, ssid->ssid, ssid->ssid_len);
-+ else
-+ neigh_bss = wpa_bss_get_bssid(wpa_s, pos + 1);
-
- *seen |= BIT(link_id);
- wpa_printf(MSG_DEBUG, "MLD: mld ID=%u, link ID=%u",
-diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
-index ef258fadc..0b4b8e3ce 100644
---- a/wpa_supplicant/sme.c
-+++ b/wpa_supplicant/sme.c
-@@ -390,7 +390,8 @@ static void wpas_ml_handle_removed_links(struct wpa_supplicant *wpa_s,
-
- #ifdef CONFIG_TESTING_OPTIONS
- static struct wpa_bss * wpas_ml_connect_pref(struct wpa_supplicant *wpa_s,
-- struct wpa_bss *bss)
-+ struct wpa_bss *bss,
-+ struct wpa_ssid *ssid)
- {
- unsigned int low, high, i;
-
-@@ -459,7 +460,7 @@ found:
- MAC2STR(wpa_s->links[i].bssid));
-
- /* Get the BSS entry and do the switch */
-- bss = wpa_bss_get_bssid(wpa_s, wpa_s->links[i].bssid);
-+ bss = wpa_bss_get(wpa_s, wpa_s->links[i].bssid, ssid->ssid, ssid->ssid_len);
- wpa_s->mlo_assoc_link_id = i;
-
- return bss;
-@@ -528,7 +529,7 @@ static bool check_mld_allowed_phy(struct wpa_supplicant *wpa_s, int freq)
-
-
- static void wpas_sme_set_mlo_links(struct wpa_supplicant *wpa_s,
-- struct wpa_bss *bss)
-+ struct wpa_bss *bss, struct wpa_ssid *ssid)
- {
- u8 i;
-
-@@ -551,7 +552,8 @@ static void wpas_sme_set_mlo_links(struct wpa_supplicant *wpa_s,
- if (bss->mld_link_id == i)
- wpa_s->links[i].bss = bss;
- else
-- wpa_s->links[i].bss = wpa_bss_get_bssid(wpa_s, bssid);
-+ wpa_s->links[i].bss = wpa_bss_get(wpa_s, bssid, ssid->ssid,
-+ ssid->ssid_len);
- }
- }
-
-@@ -597,10 +599,10 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
- #endif /* CONFIG_TESTING_OPTIONS */
- bss->valid_links) {
- wpa_printf(MSG_DEBUG, "MLD: In authentication");
-- wpas_sme_set_mlo_links(wpa_s, bss);
-+ wpas_sme_set_mlo_links(wpa_s, bss, ssid);
-
- #ifdef CONFIG_TESTING_OPTIONS
-- bss = wpas_ml_connect_pref(wpa_s, bss);
-+ bss = wpas_ml_connect_pref(wpa_s, bss, ssid);
-
- if (wpa_s->conf->mld_force_single_link) {
- wpa_printf(MSG_DEBUG, "MLD: Force single link");
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0101-mtk-hostapd-Temporary-non-inheritance-IE-solution.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0101-mtk-hostapd-Temporary-non-inheritance-IE-solution.patch
new file mode 100644
index 0000000..2759e8e
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0101-mtk-hostapd-Temporary-non-inheritance-IE-solution.patch
@@ -0,0 +1,213 @@
+From 097f4b42d450ba1ae1f9acbb52cbae5f061d2ded Mon Sep 17 00:00:00 2001
+From: Allen Ye <allen.ye@mediatek.com>
+Date: Mon, 20 May 2024 17:29:36 +0800
+Subject: [PATCH 101/126] mtk: hostapd: Temporary non-inheritance IE solution
+
+Remove MBSSID IE and FILS indication IE in per-STA profile
+The patch append non-inheritance IE in per-STA profile of a ML IE.
+To add new IE in non-inheritance IE, just append the tag to IE list.
+
+Fix the EHT-4.6.1_RUN1_ITER2 (2G+5G) BRCM assoc issue.
+Without this patch, if the AP is an AP MLD 2G+5G (with 5G as the Setup link), the BRCM station will only connect to the AP using one link (i.e., the per-station profile count in the Association request is 0).
+
+Note: Regardless of whether this patch is applied, EHT-4.6.1_RUN1_ITER1 (2G+5G, with 2G as the setup link) can pass.
+
+Signed-off-by: Allen Ye <allen.ye@mediatek.com>
+Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
+---
+ src/ap/beacon.c | 28 +++++++++++------
+ src/ap/ieee802_11.c | 2 ++
+ src/ap/ieee802_11.h | 2 ++
+ src/ap/ieee802_11_eht.c | 68 ++++++++++++++++++++++++++++++++++++++++-
+ 4 files changed, 90 insertions(+), 10 deletions(-)
+
+diff --git a/src/ap/beacon.c b/src/ap/beacon.c
+index 36f4feb3a..50d45d532 100644
+--- a/src/ap/beacon.c
++++ b/src/ap/beacon.c
+@@ -766,15 +766,20 @@ static size_t hostapd_probe_resp_elems_len(struct hostapd_data *hapd,
+ buflen += hostapd_eid_eht_ml_beacon_len(
+ ml_elem_ap, params->mld_info, !!params->mld_ap);
+ }
++ /* non-inheritance element */
++ if (params->is_ml_sta_info)
++ buflen += hostapd_eid_non_inheritance_len(hapd);
+ }
+ #endif /* CONFIG_IEEE80211BE */
+
+- buflen += hostapd_eid_mbssid_len(hapd, WLAN_FC_STYPE_PROBE_RESP, NULL,
+- params->known_bss,
+- params->known_bss_len, NULL);
+- if (!params->is_ml_sta_info)
++ if (!params->is_ml_sta_info) {
++ buflen += hostapd_eid_mbssid_len(hapd, WLAN_FC_STYPE_PROBE_RESP, NULL,
++ params->known_bss,
++ params->known_bss_len, NULL);
+ buflen += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_PROBE_RESP,
+ true);
++ }
++
+ buflen += hostapd_mbo_ie_len(hapd);
+ buflen += hostapd_eid_owe_trans_len(hapd);
+ buflen += hostapd_eid_dpp_cc_len(hapd);
+@@ -835,9 +840,10 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd,
+
+ pos = hostapd_get_rsne(hapd, pos, epos - pos);
+ pos = hostapd_eid_bss_load(hapd, pos, epos - pos);
+- pos = hostapd_eid_mbssid(hapd, pos, epos, WLAN_FC_STYPE_PROBE_RESP, 0,
+- NULL, params->known_bss, params->known_bss_len,
+- NULL, NULL, NULL, 0);
++ if (!params->is_ml_sta_info)
++ pos = hostapd_eid_mbssid(hapd, pos, epos, WLAN_FC_STYPE_PROBE_RESP, 0,
++ NULL, params->known_bss, params->known_bss_len,
++ NULL, NULL, NULL, 0);
+ pos = hostapd_eid_rm_enabled_capab(hapd, pos, epos - pos);
+ pos = hostapd_get_mde(hapd, pos, epos - pos);
+
+@@ -897,10 +903,11 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd,
+ pos = hostapd_eid_wb_chsw_wrapper(hapd, pos);
+ pos = hostapd_eid_max_chsw_time(hapd, pos);
+
+- if (!params->is_ml_sta_info)
++ if (!params->is_ml_sta_info) {
+ pos = hostapd_eid_rnr(hapd, pos, WLAN_FC_STYPE_PROBE_RESP,
+ true);
+- pos = hostapd_eid_fils_indic(hapd, pos, 0);
++ pos = hostapd_eid_fils_indic(hapd, pos, 0);
++ }
+ pos = hostapd_get_rsnxe(hapd, pos, epos - pos);
+
+ #ifdef CONFIG_IEEE80211AX
+@@ -999,6 +1006,9 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd,
+ }
+ #endif /* CONFIG_TESTING_OPTIONS */
+
++ if (params->is_ml_sta_info)
++ pos = hostapd_eid_non_inheritance(hapd, pos);
++
+ return pos;
+ }
+
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index 7dac7a896..fd954b6f5 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -4520,6 +4520,8 @@ static void ieee80211_ml_build_assoc_resp(struct hostapd_data *hapd,
+ p = hostapd_eid_mbo(hapd, p, buf + buflen - p);
+ p = hostapd_eid_wmm(hapd, p);
+
++ p = hostapd_eid_non_inheritance(hapd, p);
++
+ if (hapd->conf->assocresp_elements &&
+ (size_t) (buf + buflen - p) >=
+ wpabuf_len(hapd->conf->assocresp_elements)) {
+diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h
+index 18f97890b..2d9adb910 100644
+--- a/src/ap/ieee802_11.h
++++ b/src/ap/ieee802_11.h
+@@ -239,6 +239,7 @@ size_t hostapd_eid_eht_capab_len(struct hostapd_data *hapd,
+ enum ieee80211_op_mode opmode);
+ u8 * hostapd_eid_eht_capab(struct hostapd_data *hapd, u8 *eid,
+ enum ieee80211_op_mode opmode);
++u8 * hostapd_eid_non_inheritance(struct hostapd_data *hapd, u8 *eid);
+ u8 * hostapd_eid_eht_operation(struct hostapd_data *hapd, u8 *eid);
+ u16 copy_sta_eht_capab(struct hostapd_data *hapd, struct sta_info *sta,
+ enum ieee80211_op_mode opmode,
+@@ -252,6 +253,7 @@ u8 * hostapd_eid_mbssid(struct hostapd_data *hapd, u8 *eid, u8 *end,
+ u8 **elem_offset,
+ const u8 *known_bss, size_t known_bss_len, u8 *rnr_eid,
+ u8 *rnr_count, u8 **rnr_offset, size_t rnr_len);
++size_t hostapd_eid_non_inheritance_len(struct hostapd_data *hapd);
+ bool hostapd_is_mld_ap(struct hostapd_data *hapd);
+ const char * sae_get_password(struct hostapd_data *hapd,
+ struct sta_info *sta, const char *rx_id,
+diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
+index 8fc239f36..63713bc39 100644
+--- a/src/ap/ieee802_11_eht.c
++++ b/src/ap/ieee802_11_eht.c
+@@ -131,7 +131,6 @@ size_t hostapd_eid_eht_capab_len(struct hostapd_data *hapd,
+ return len;
+ }
+
+-
+ u8 * hostapd_eid_eht_capab(struct hostapd_data *hapd, u8 *eid,
+ enum ieee80211_op_mode opmode)
+ {
+@@ -284,7 +283,74 @@ u8 * hostapd_eid_eht_operation(struct hostapd_data *hapd, u8 *eid)
+ return pos + elen;
+ }
+
++u8 mlo_non_inherit_list_6ghz[] = {
++ WLAN_EID_AP_CHANNEL_REPORT,
++ WLAN_EID_HT_CAP,
++ WLAN_EID_HT_OPERATION,
++ WLAN_EID_VHT_CAP,
++ WLAN_EID_VHT_OPERATION,
++};
++
++u8 mlo_non_inherit_list_6ghz_ext[] = {
++};
++
++u8 mlo_non_inherit_list_2_5ghz[] = {
++ WLAN_EID_VHT_CAP,
++ WLAN_EID_VHT_OPERATION,
++ WLAN_EID_TRANSMIT_POWER_ENVELOPE,
++};
++
++u8 mlo_non_inherit_list_2_5ghz_ext[] = {
++ WLAN_EID_EXT_HE_6GHZ_BAND_CAP,
++};
++
++size_t hostapd_eid_non_inheritance_len(struct hostapd_data *hapd)
++{
++ size_t len = 4;
+
++ if (is_6ghz_op_class(hapd->iconf->op_class)) {
++ len += sizeof(mlo_non_inherit_list_6ghz);
++ len += sizeof(mlo_non_inherit_list_6ghz_ext);
++ } else {
++ len += sizeof(mlo_non_inherit_list_2_5ghz);
++ len += sizeof(mlo_non_inherit_list_2_5ghz_ext);
++ }
++
++ return len;
++}
++
++u8 * hostapd_eid_non_inheritance(struct hostapd_data *hapd, u8 *eid)
++{
++ u8 *pos = eid, *len_pos;
++ int i;
++
++ *pos++ = WLAN_EID_EXTENSION;
++ len_pos = pos++;
++ *pos++ = WLAN_EID_EXT_NON_INHERITANCE;
++ if (is_6ghz_op_class(hapd->iconf->op_class)) {
++ /* Element ID list */
++ *pos++ = sizeof(mlo_non_inherit_list_6ghz);
++ for (i = 0; i < sizeof(mlo_non_inherit_list_6ghz); i++)
++ *pos++ = mlo_non_inherit_list_6ghz[i];
++
++ /* Element ID Extension list */
++ *pos++ = sizeof(mlo_non_inherit_list_6ghz_ext);
++ for (i = 0; i < sizeof(mlo_non_inherit_list_6ghz_ext); i++)
++ *pos++ = mlo_non_inherit_list_6ghz_ext[i];
++ } else {
++ /* Element ID list */
++ *pos++ = sizeof(mlo_non_inherit_list_2_5ghz);
++ for (i = 0; i < sizeof(mlo_non_inherit_list_2_5ghz); i++)
++ *pos++ = mlo_non_inherit_list_2_5ghz[i];
++
++ /* Element ID Extension list */
++ *pos++ = sizeof(mlo_non_inherit_list_2_5ghz_ext);
++ for (i = 0; i < sizeof(mlo_non_inherit_list_2_5ghz_ext); i++)
++ *pos++ = mlo_non_inherit_list_2_5ghz_ext[i];
++ }
++ *len_pos = pos - (eid + 2);
++ return pos;
++}
+ static bool check_valid_eht_mcs_nss(struct hostapd_data *hapd, const u8 *ap_mcs,
+ const u8 *sta_mcs, u8 mcs_count, u8 map_len)
+ {
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0102-mtk-hostapd-Fix-multiple-link-connect-get-pmkid-fail.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0102-mtk-hostapd-Fix-multiple-link-connect-get-pmkid-fail.patch
new file mode 100644
index 0000000..b3d973d
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0102-mtk-hostapd-Fix-multiple-link-connect-get-pmkid-fail.patch
@@ -0,0 +1,50 @@
+From b43473e506400cc142f3d464c621714014ca196c Mon Sep 17 00:00:00 2001
+From: Allen Ye <allen.ye@mediatek.com>
+Date: Thu, 6 Jun 2024 17:41:56 +0800
+Subject: [PATCH 102/126] mtk: hostapd: Fix multiple link connect get pmkid
+ failed
+
+Store pmkid in each link when receive STA auth.
+
+Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
+Signed-off-by: Allen Ye <allen.ye@mediatek.com>
+---
+ src/ap/ieee802_11.c | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index fd954b6f5..ff0f24aaa 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -945,6 +945,7 @@ static void sae_sme_send_external_auth_status(struct hostapd_data *hapd,
+
+ void sae_accept_sta(struct hostapd_data *hapd, struct sta_info *sta)
+ {
++ struct hostapd_data *link;
+ #ifndef CONFIG_NO_VLAN
+ struct vlan_description vlan_desc;
+
+@@ -986,9 +987,17 @@ void sae_accept_sta(struct hostapd_data *hapd, struct sta_info *sta)
+ crypto_bignum_deinit(sta->sae->peer_commit_scalar_accepted, 0);
+ sta->sae->peer_commit_scalar_accepted = sta->sae->peer_commit_scalar;
+ sta->sae->peer_commit_scalar = NULL;
+- wpa_auth_pmksa_add_sae(hapd->wpa_auth, sta->addr,
+- sta->sae->pmk, sta->sae->pmk_len,
+- sta->sae->pmkid, sta->sae->akmp);
++ if (hostapd_is_mld_ap(hapd)) {
++ for_each_mld_link(link, hapd) {
++ wpa_auth_pmksa_add_sae(link->wpa_auth, sta->addr,
++ sta->sae->pmk, sta->sae->pmk_len,
++ sta->sae->pmkid, sta->sae->akmp);
++ }
++ } else {
++ wpa_auth_pmksa_add_sae(hapd->wpa_auth, sta->addr,
++ sta->sae->pmk, sta->sae->pmk_len,
++ sta->sae->pmkid, sta->sae->akmp);
++ }
+ sae_sme_send_external_auth_status(hapd, sta, WLAN_STATUS_SUCCESS);
+ }
+
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0103-mtk-hostapd-ensure-only-a-scan-callback-is-called-on.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0103-mtk-hostapd-ensure-only-a-scan-callback-is-called-on.patch
new file mode 100644
index 0000000..7b12f21
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0103-mtk-hostapd-ensure-only-a-scan-callback-is-called-on.patch
@@ -0,0 +1,49 @@
+From 6297062e6c302d2de6888580c2f396da47c95908 Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Tue, 4 Jun 2024 08:24:32 +0800
+Subject: [PATCH 103/126] mtk: hostapd: ensure only a scan callback is called
+ on each scan result event
+
+Every scan callback is assigned along with a scan request to driver.
+Therefore on each scan result event, there should be only one scan
+callback to be handled.
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ src/ap/drv_callbacks.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
+index 705acfb67..1b91232f2 100644
+--- a/src/ap/drv_callbacks.c
++++ b/src/ap/drv_callbacks.c
+@@ -2493,10 +2493,12 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
+ hapd = switch_link_scan(hapd,
+ data->scan_info.scan_cookie);
+ #endif /* NEED_AP_MLME */
+- if (hapd->iface->scan_cb)
++ if (hapd->iface->scan_cb) {
+ hapd->iface->scan_cb(hapd->iface);
++ break;
++ }
+ #ifdef CONFIG_IEEE80211BE
+- if (!hapd->iface->scan_cb && hapd->conf->mld_ap) {
++ if (hapd->conf->mld_ap) {
+ /* Other links may be waiting for HT scan result */
+ unsigned int i;
+
+@@ -2506,8 +2508,10 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
+ struct hostapd_data *h_hapd = h->bss[0];
+
+ if (hostapd_is_ml_partner(hapd, h_hapd) &&
+- h_hapd->iface->scan_cb)
++ h_hapd->iface->scan_cb) {
+ h_hapd->iface->scan_cb(h_hapd->iface);
++ break;
++ }
+ }
+ }
+ #endif /* CONFIG_IEEE80211BE */
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0103-mtk-hostapd-make-sure-all-links-are-set-before-enabl.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0103-mtk-hostapd-make-sure-all-links-are-set-before-enabl.patch
deleted file mode 100644
index cca2e9a..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0103-mtk-hostapd-make-sure-all-links-are-set-before-enabl.patch
+++ /dev/null
@@ -1,124 +0,0 @@
-From ec7d47b2566da59c52d995f5e404a1c00e746fe5 Mon Sep 17 00:00:00 2001
-From: Shayne Chen <shayne.chen@mediatek.com>
-Date: Thu, 11 Apr 2024 18:16:38 +0800
-Subject: [PATCH 103/104] mtk: hostapd: make sure all links are set before
- enabling beacon
-
-NL80211_CMD_NEW_BEACON will first be set, but we've modified mac80211 to
-disable this beacon. After that, hostapd will block
-NL80211_CMD_SET_BEACON until all links are setting up.
-(use NL80211_CMD_START_AP event to check if all expected links are enabled)
-
-Update: in wpa_driver_nl80211_set_ap(), send_and_recv() is used, implies
-that hostapd should already sync with driver, so don't need to use
-NL80211_CMD_START_AP event.
-
-This can make sure that the first beacon of each link includes the
-correct RNR and per-STA profile.
-
-Note that in NL80211_CMD_NEW_BEACON, we also set beacon interval to 0,
-which helps to bypass some mac80211 beacon active checks, e.g., during ACS.
-
-Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
----
- hostapd/config_file.c | 2 ++
- src/ap/ap_config.h | 2 ++
- src/ap/beacon.c | 10 ++++++++++
- src/ap/hostapd.c | 14 ++++++++++++++
- src/ap/hostapd.h | 1 +
- 5 files changed, 29 insertions(+)
-
-diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index 2add62ca9..8abe1bc46 100644
---- a/hostapd/config_file.c
-+++ b/hostapd/config_file.c
-@@ -5354,6 +5354,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
- bss->mld_ap = !!atoi(pos);
- } else if (os_strcmp(buf, "mld_primary") == 0) {
- bss->mld_primary = !!atoi(pos);
-+ } else if (os_strcmp(buf, "mld_allowed_links") == 0) {
-+ bss->mld_allowed_links = atoi(pos);
- } else if (os_strcmp(buf, "mld_addr") == 0) {
- if (hwaddr_aton(pos, bss->mld_addr)) {
- wpa_printf(MSG_ERROR, "Line %d: Invalid mld_addr",
-diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 5192c1f07..0ea5a04e2 100644
---- a/src/ap/ap_config.h
-+++ b/src/ap/ap_config.h
-@@ -968,6 +968,8 @@ struct hostapd_bss_config {
-
- /* The AP is the primary AP of an AP MLD */
- u8 mld_primary;
-+ /* Allowed link bitmap of the AP MLD to which the AP is affiliated */
-+ u16 mld_allowed_links;
-
- /* The MLD ID to which the AP MLD is affiliated with */
- u8 mld_id;
-diff --git a/src/ap/beacon.c b/src/ap/beacon.c
-index a5c46b067..a5c9dd87e 100644
---- a/src/ap/beacon.c
-+++ b/src/ap/beacon.c
-@@ -2164,6 +2164,12 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
- os_memcpy(head->bssid, hapd->own_addr, ETH_ALEN);
- head->u.beacon.beacon_int =
- host_to_le16(hapd->iconf->beacon_int);
-+ /* if MLD AP hasn't finished setting up all links, also set beacon interval
-+ * to 0. This allows mac80211 to bypass some beacon active checks, for
-+ * example, when doing ACS
-+ */
-+ if (hapd->conf->mld_ap && !hapd->mld->started)
-+ head->u.beacon.beacon_int = host_to_le16(0);
-
- /* hardware or low-level driver will setup seq_ctrl and timestamp */
- capab_info = hostapd_own_capab_info(hapd);
-@@ -2553,6 +2559,10 @@ static int __ieee802_11_set_beacon(struct hostapd_data *hapd)
- int res, ret = -1, i;
- struct hostapd_hw_modes *mode;
-
-+ /* skip setting beacon if other links are not started yet */
-+ if (hapd->conf->mld_ap && !hapd->mld->started && hapd->beacon_set_done)
-+ return 0;
-+
- if (!hapd->drv_priv) {
- wpa_printf(MSG_ERROR, "Interface is disabled");
- return -1;
-diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index 3d3359291..c31e0badd 100644
---- a/src/ap/hostapd.c
-+++ b/src/ap/hostapd.c
-@@ -1314,6 +1314,20 @@ static int hostapd_start_beacon(struct hostapd_data *hapd,
- if (!conf->start_disabled && ieee802_11_set_beacon(hapd) < 0)
- return -1;
-
-+ if (hapd->conf->mld_ap && !hapd->mld->started) {
-+ struct hostapd_data *p_hapd;
-+ u16 valid_links = 0;
-+
-+ for_each_mld_link(p_hapd, hapd)
-+ valid_links |= BIT(p_hapd->mld_link_id);
-+
-+ if (valid_links == hapd->conf->mld_allowed_links ||
-+ !hapd->conf->mld_allowed_links) {
-+ hapd->mld->started = 1;
-+ ieee802_11_set_beacon(hapd);
-+ }
-+ }
-+
- if (flush_old_stations && !conf->start_disabled &&
- conf->broadcast_deauth) {
- u8 addr[ETH_ALEN];
-diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
-index 5b37be87b..83636649f 100644
---- a/src/ap/hostapd.h
-+++ b/src/ap/hostapd.h
-@@ -537,6 +537,7 @@ struct hostapd_mld {
- * freed when num_links is 0.
- */
- u8 refcount;
-+ bool started;
-
- struct hostapd_data *fbss;
- struct dl_list links; /* List head of all affiliated links */
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0104-mtk-hostapd-add-support-for-get_survey-to-specify-li.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0104-mtk-hostapd-add-support-for-get_survey-to-specify-li.patch
new file mode 100644
index 0000000..6ee64b4
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0104-mtk-hostapd-add-support-for-get_survey-to-specify-li.patch
@@ -0,0 +1,111 @@
+From b424816d5509a5d2137c5e674ca39e03c74d3bdd Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Tue, 4 Jun 2024 08:26:04 +0800
+Subject: [PATCH 104/126] mtk: hostapd: add support for get_survey to specify
+ link id
+
+Specifying the link id when request get_survey is useful for passing
+the event to correcy hapd.
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ src/ap/ap_drv_ops.h | 8 +++++++-
+ src/ap/drv_callbacks.c | 1 +
+ src/drivers/driver.h | 5 ++++-
+ src/drivers/driver_nl80211.c | 4 +++-
+ 4 files changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
+index ca2efab82..e74284b96 100644
+--- a/src/ap/ap_drv_ops.h
++++ b/src/ap/ap_drv_ops.h
+@@ -316,11 +316,17 @@ static inline void hostapd_drv_poll_client(struct hostapd_data *hapd,
+ static inline int hostapd_drv_get_survey(struct hostapd_data *hapd,
+ unsigned int freq)
+ {
++ int link_id = -1;
++
+ if (hapd->driver == NULL)
+ return -1;
+ if (!hapd->driver->get_survey)
+ return -1;
+- return hapd->driver->get_survey(hapd->drv_priv, freq);
++#ifdef CONFIG_IEEE80211BE
++ if (hapd->conf->mld_ap)
++ link_id = hapd->mld_link_id;
++#endif /* CONFIG_IEEE80211BE */
++ return hapd->driver->get_survey(hapd->drv_priv, freq, link_id);
+ }
+
+ static inline int hostapd_get_country(struct hostapd_data *hapd, char *alpha2)
+diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
+index 1b91232f2..0e7cfd285 100644
+--- a/src/ap/drv_callbacks.c
++++ b/src/ap/drv_callbacks.c
+@@ -2685,6 +2685,7 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
+ data->connect_failed_reason.code);
+ break;
+ case EVENT_SURVEY:
++ hapd = switch_link_hapd(hapd, data->survey_results.link_id);
+ hostapd_event_get_survey(hapd->iface, &data->survey_results);
+ break;
+ #ifdef NEED_AP_MLME
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index eed99dac8..d5d00db9d 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -4642,6 +4642,7 @@ struct wpa_driver_ops {
+ * @priv: Private driver interface data
+ * @freq: If set, survey data for the specified frequency is only
+ * being requested. If not set, all survey data is requested.
++ * @link_id: The link ID that requests the get_survey.
+ * Returns: 0 on success, -1 on failure
+ *
+ * Use this to retrieve:
+@@ -4660,7 +4661,7 @@ struct wpa_driver_ops {
+ * for each survey. The min_nf of the channel is updated for each
+ * survey.
+ */
+- int (*get_survey)(void *priv, unsigned int freq);
++ int (*get_survey)(void *priv, unsigned int freq, int link_id);
+
+ /**
+ * status - Get driver interface status information
+@@ -6851,10 +6852,12 @@ union wpa_event_data {
+ * @freq_filter: Requested frequency survey filter, 0 if request
+ * was for all survey data
+ * @survey_list: Linked list of survey data (struct freq_survey)
++ * @link_id: Link ID of the MLO link
+ */
+ struct survey_results {
+ unsigned int freq_filter;
+ struct dl_list survey_list; /* struct freq_survey */
++ int link_id;
+ } survey_results;
+
+ /**
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index b3ae50d15..3683f6034 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -10432,7 +10432,8 @@ static int survey_handler(struct nl_msg *msg, void *arg)
+ }
+
+
+-static int wpa_driver_nl80211_get_survey(void *priv, unsigned int freq)
++static int wpa_driver_nl80211_get_survey(void *priv, unsigned int freq,
++ int link_id)
+ {
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+@@ -10450,6 +10451,7 @@ static int wpa_driver_nl80211_get_survey(void *priv, unsigned int freq)
+ if (!msg)
+ return -ENOBUFS;
+
++ data.survey_results.link_id = link_id;
+ if (freq)
+ data.survey_results.freq_filter = freq;
+
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0104-mtk-hostapd-ucode-add-is_mld_finished-check.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0104-mtk-hostapd-ucode-add-is_mld_finished-check.patch
deleted file mode 100644
index e1c0274..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0104-mtk-hostapd-ucode-add-is_mld_finished-check.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 7b4363892397c667e65fae9e036c83ac039e308d Mon Sep 17 00:00:00 2001
-From: Michael-CY Lee <michael-cy.lee@mediatek.com>
-Date: Wed, 17 Apr 2024 13:17:59 +0800
-Subject: [PATCH 104/104] mtk: hostapd: ucode: add is_mld_finished check
-
-Add is_mld_finished check for ucode need.
-This function returns ture only if all links fromt all MLD APs are
-ready.
-
-Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
----
- src/ap/ucode.c | 18 ++++++++++++++++++
- 1 file changed, 18 insertions(+)
-
-diff --git a/src/ap/ucode.c b/src/ap/ucode.c
-index 2642e87c7..9f9cc2022 100644
---- a/src/ap/ucode.c
-+++ b/src/ap/ucode.c
-@@ -734,6 +734,23 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
- return ucv_boolean_new(!ret);
- }
-
-+static uc_value_t *
-+uc_hostapd_iface_is_mld_finished(uc_vm_t *vm, size_t nargs)
-+{
-+ struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface");
-+ bool finished = true;
-+ int i;
-+
-+ for (i = 0; i < iface->num_bss; i++) {
-+ if (iface->bss[i]->conf->mld_ap && !iface->bss[i]->mld->started) {
-+ finished = false;
-+ break;
-+ }
-+ }
-+
-+ return ucv_boolean_new(finished);
-+}
-+
- static uc_value_t *
- uc_hostapd_bss_rename(uc_vm_t *vm, size_t nargs)
- {
-@@ -806,6 +823,7 @@ int hostapd_ucode_init(struct hapd_interfaces *ifaces)
- { "stop", uc_hostapd_iface_stop },
- { "start", uc_hostapd_iface_start },
- { "switch_channel", uc_hostapd_iface_switch_channel },
-+ { "is_mld_finished", uc_hostapd_iface_is_mld_finished },
- };
- uc_value_t *data, *proto;
-
---
-2.39.2
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0105-mtk-hostapd-free-station-when-hapd-deinit.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0105-mtk-hostapd-free-station-when-hapd-deinit.patch
deleted file mode 100644
index 81b2015..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0105-mtk-hostapd-free-station-when-hapd-deinit.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 95dcf88b68837221ad937fe7c675b169c8034384 Mon Sep 17 00:00:00 2001
-From: Peter Chiu <chui-hao.chiu@mediatek.com>
-Date: Mon, 22 Apr 2024 08:40:18 +0800
-Subject: [PATCH] mtk: hostapd: free station when hapd deinit
-
-Free all stations in the same MLD when a bss is deinit.
-Without this patch, the AP_VLAN interface may be free after
-stop ap and leads to kernel crash.
-
-Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
----
- src/ap/hostapd.c | 14 ++++++++++++++
- 1 file changed, 14 insertions(+)
-
-diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index c31e0badd..62943c561 100644
---- a/src/ap/hostapd.c
-+++ b/src/ap/hostapd.c
-@@ -842,7 +842,21 @@ static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason)
-
- void hostapd_bss_deinit_no_free(struct hostapd_data *hapd)
- {
-+#ifdef CONFIG_IEEE80211BE
-+ struct hostapd_data *link;
-+
-+ /* FIXME: free all stations to remvoe AP_VLAN interface. Allocate */
-+ /* per-link structures for AP_VLAN in mac80211 and only remove single */
-+ /* link here. */
-+ if (hostapd_is_mld_ap(hapd)) {
-+ for_each_mld_link(link, hapd)
-+ hostapd_free_stas(link);
-+ } else {
-+ hostapd_free_stas(hapd);
-+ }
-+#else
- hostapd_free_stas(hapd);
-+#endif
- hostapd_flush_old_stations(hapd, WLAN_REASON_DEAUTH_LEAVING);
- #ifdef CONFIG_WEP
- hostapd_clear_wep(hapd);
---
-2.18.0
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0105-mtk-hostapd-sequentially-conduct-multiple-setup-ACS.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0105-mtk-hostapd-sequentially-conduct-multiple-setup-ACS.patch
new file mode 100644
index 0000000..77a06b3
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0105-mtk-hostapd-sequentially-conduct-multiple-setup-ACS.patch
@@ -0,0 +1,84 @@
+From 93ff9ff205e52c9dd5ac582261c5476ff87198ad Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Tue, 4 Jun 2024 08:31:29 +0800
+Subject: [PATCH 105/126] mtk: hostapd: sequentially conduct multiple setup ACS
+
+In the single-wiphy architecture, only one scan request is allowed at
+the same time (no matter the AP is legacy or MLD). However, if multiple
+AP interfaces need setup ACS, multiple scan requests are sent to the
+driver and only one can be accept. Other failed requests lead to
+interface setup failure.
+
+A sequentially conducting for multiple ACS is needed to prevent such a
+failure. It is realized by
+ 1. A BSS (link) postpones its ACS initializaion if it detects another
+ active ACS.
+ 2. Once the ACS is finished, the BSS (link) starts the ACS initizlization
+ for one of those BSSes (links) waiting for it.
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ src/ap/hostapd.c | 18 ++++++++++++++++++
+ src/ap/hw_features.c | 10 ++++++++++
+ 2 files changed, 28 insertions(+)
+
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index f03a6242f..63d89e614 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -2860,6 +2860,24 @@ int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err)
+ unsigned int i;
+ int not_ready_in_sync_ifaces = 0;
+
++ if (iface->state == HAPD_IFACE_ACS) {
++ int i;
++
++ for (i = 0; i < interfaces->count; i++) {
++ if (!interfaces->iface[i]->freq) {
++ /* FIXME problems remained
++ * 1. the return value of acs_init() is
++ * not check
++ * 2. if it fails the setup, next acs_init()
++ * will not be handled
++ */
++ wpa_printf(MSG_DEBUG, "mtk: trigger acs_init for %s", interfaces->iface[i]->phy);
++ acs_init(interfaces->iface[i]);
++ break;
++ }
++ }
++ }
++
+ if (!iface->need_to_start_in_sync)
+ return hostapd_setup_interface_complete_sync(iface, err);
+
+diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
+index 2a2832cd4..f35832e2e 100644
+--- a/src/ap/hw_features.c
++++ b/src/ap/hw_features.c
+@@ -1158,6 +1158,8 @@ int hostapd_determine_mode(struct hostapd_iface *iface)
+ static enum hostapd_chan_status
+ hostapd_check_chans(struct hostapd_iface *iface)
+ {
++ int i;
++
+ if (iface->freq) {
+ int err;
+
+@@ -1177,6 +1179,14 @@ hostapd_check_chans(struct hostapd_iface *iface)
+ * which is used to trigger ACS.
+ */
+
++ /*
++ * Only allow an ACS at one time.
++ */
++ for (i = 0; i < iface->interfaces->count; i++) {
++ if (iface->interfaces->iface[i]->state == HAPD_IFACE_ACS)
++ return HOSTAPD_CHAN_ACS;
++ }
++
+ switch (acs_init(iface)) {
+ case HOSTAPD_CHAN_ACS:
+ return HOSTAPD_CHAN_ACS;
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0106-mtk-hostapd-find-sta_info-for-legacy-STA-associating.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0106-mtk-hostapd-find-sta_info-for-legacy-STA-associating.patch
new file mode 100644
index 0000000..83f53fc
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0106-mtk-hostapd-find-sta_info-for-legacy-STA-associating.patch
@@ -0,0 +1,48 @@
+From ec640d581610ce8d2eac74ee38459bc84ace18ca Mon Sep 17 00:00:00 2001
+From: Shayne Chen <shayne.chen@mediatek.com>
+Date: Fri, 14 Jun 2024 16:19:46 +0800
+Subject: [PATCH 106/126] mtk: hostapd: find sta_info for legacy STA
+ associating with non-first link when handling rx_from_unknown event
+
+The legacy STA might associates with the AP MLD's non-first link, but
+the 4-addr QoS NULL from STA is still sent to first link's hapd and
+sta_info can not be found, leading to the 4-addr QoS NULL skb being
+dropped.
+
+This commit solves the problem by checking other link's hapd when the
+sta_info is not found in handling rx_from_unknown event.
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ src/ap/ieee802_11.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index ff0f24aaa..62fdfb288 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -7092,6 +7092,21 @@ void ieee802_11_rx_from_unknown(struct hostapd_data *hapd, const u8 *src,
+ sta = ap_get_sta(hapd, src);
+
+ #ifdef CONFIG_IEEE80211BE
++ if (!sta && hapd->conf->mld_ap) {
++ struct hostapd_data *h;
++
++ /* The data frame might be sent by a non-MLD STA via non-first
++ * link, so we must also check other links.
++ */
++ for_each_mld_link(h, hapd) {
++ if (h == hapd)
++ continue;
++
++ if (sta = ap_get_sta(h, src))
++ break;
++ }
++ }
++
+ if (sta && sta->mld_info.mld_sta)
+ sta = sta->mld_assoc_sta;
+ #endif
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0107-mtk-hostapd-do-not-consider-bss-ignore-list-when-par.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0107-mtk-hostapd-do-not-consider-bss-ignore-list-when-par.patch
new file mode 100644
index 0000000..6634548
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0107-mtk-hostapd-do-not-consider-bss-ignore-list-when-par.patch
@@ -0,0 +1,44 @@
+From 1ed61a27f27d721697c4e0705ce934afa4804605 Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Wed, 19 Jun 2024 11:31:09 +0800
+Subject: [PATCH 107/126] mtk: hostapd: do not consider bss ignore list when
+ parsing ML parnter link
+
+By definition, adding BSS into the ignore list only makes wpa_supplicant
+tries the listed BSS with a low priority, but does not prevent the
+listed BSS from being used.
+
+It migth not be suitable to check the ignore list when parsing ML
+partner links. It made wpa_supplicant associate with AP MLD by only
+partial links with the link inside the ignore list being excluded.
+
+After apply this commit, a partner link in the BSS ignore list will
+not be ignored
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ wpa_supplicant/bss.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
+index cf94d4be5..b85b251bf 100644
+--- a/wpa_supplicant/bss.c
++++ b/wpa_supplicant/bss.c
+@@ -1573,9 +1573,12 @@ wpa_bss_parse_ml_rnr_ap_info(struct wpa_supplicant *wpa_s,
+ (bss_params & (RNR_BSS_PARAM_SAME_SSID |
+ RNR_BSS_PARAM_CO_LOCATED)) ||
+ wpa_scan_res_match(wpa_s, 0, neigh_bss,
+- ssid, 1, 0)) &&
++ ssid, 1, 0))
++#if 0 /* MLD partner link should not be excluded */
+ !wpa_bssid_ignore_is_listed(
+- wpa_s, neigh_bss->bssid)) {
++ wpa_s, neigh_bss->bssid)
++#endif
++ ) {
+ struct mld_link *l;
+
+ bss->valid_links |= BIT(link_id);
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0108-mtk-hostapd-support-vendor-command-trig_type-and-ap_.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0108-mtk-hostapd-support-vendor-command-trig_type-and-ap_.patch
new file mode 100644
index 0000000..bac1e4a
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0108-mtk-hostapd-support-vendor-command-trig_type-and-ap_.patch
@@ -0,0 +1,149 @@
+From 41742b992f23847935411c69d676c8c8813190bf Mon Sep 17 00:00:00 2001
+From: Howard Hsu <howard-yh.hsu@mediatek.com>
+Date: Wed, 19 Jun 2024 17:22:41 +0800
+Subject: [PATCH 108/126] mtk: hostapd: support vendor command trig_type and
+ ap_wireless with link_id
+
+For mld ap, we need to add link_id in nl80211 msg so that mt76 driver
+could use link_id to find the corresponding phy.
+
+Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
+---
+ src/ap/ap_drv_ops.c | 18 ++++++++++++++++--
+ src/common/mtk_vendor.h | 2 ++
+ src/drivers/driver.h | 6 ++++--
+ src/drivers/driver_nl80211.c | 11 +++++++++--
+ 4 files changed, 31 insertions(+), 6 deletions(-)
+
+diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
+index 2d2198a44..8631bf960 100644
+--- a/src/ap/ap_drv_ops.c
++++ b/src/ap/ap_drv_ops.c
+@@ -1377,9 +1377,16 @@ int hostapd_drv_get_aval_bss_color_bmp(struct hostapd_data *hapd, u64 *aval_colo
+
+ int hostapd_drv_ap_wireless(struct hostapd_data *hapd, u8 sub_vendor_id, int value)
+ {
++ s8 link_id = -1;
++
+ if (!hapd->driver || !hapd->driver->ap_wireless)
+ return 0;
+- return hapd->driver->ap_wireless(hapd->drv_priv, sub_vendor_id, value);
++
++ if (hapd->conf->mld_ap)
++ link_id = hapd->mld_link_id;
++
++ return hapd->driver->ap_wireless(hapd->drv_priv, sub_vendor_id, value,
++ link_id);
+ }
+
+ int hostapd_drv_ap_rfeatures(struct hostapd_data *hapd, u8 sub_vendor_id, int value)
+@@ -1398,9 +1405,16 @@ int hostapd_drv_ap_rfeatures(struct hostapd_data *hapd, u8 sub_vendor_id, int va
+
+ int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type)
+ {
++ s8 link_id = -1;
++
+ if (!hapd->driver || !hapd->driver->ap_trigtype)
+ return 0;
+- return hapd->driver->ap_trigtype(hapd->drv_priv, enable, type);
++
++ if (hapd->conf->mld_ap)
++ link_id = hapd->mld_link_id;
++
++ return hapd->driver->ap_trigtype(hapd->drv_priv, enable, type,
++ link_id);
+ }
+
+ int hostapd_drv_amnt_set(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_sta_mac)
+diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
+index c6de8862b..937b968d5 100644
+--- a/src/common/mtk_vendor.h
++++ b/src/common/mtk_vendor.h
+@@ -165,6 +165,8 @@ enum mtk_vendor_attr_wireless_ctrl {
+ MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU,
+ MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT = 9,
+ MTK_VENDOR_ATTR_WIRELESS_CTRL_RTS_SIGTA,
++ MTK_VENDOR_ATTR_WIRELESS_CTRL_MU_EDCA,
++ MTK_VENDOR_ATTR_WIRELESS_CTRL_LINK_ID,
+
+ /* keep last */
+ NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL,
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index d5d00db9d..dacf0a98d 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -5334,8 +5334,9 @@ struct wpa_driver_ops {
+ * ap_wireless - set wireless command
+ * @priv: Private driver interface data
+ * @value: value
++ * @link_id: MLD link id. -1 if this is an non-MLD AP.
+ */
+- int (*ap_wireless)(void *priv, u8 mode, int value);
++ int (*ap_wireless)(void *priv, u8 mode, int value, s8 link_id);
+
+ /**
+ * ap_rfeatures - set ap rf features command
+@@ -5350,8 +5351,9 @@ struct wpa_driver_ops {
+ * @priv: Private driver interface data
+ * @enable: enable or disable
+ * @type: trigger type
++ * @link_id: MLD link id. -1 if this is an non-MLD AP.
+ */
+- int (*ap_trigtype)(void *priv, u8 enable, u8 type);
++ int (*ap_trigtype)(void *priv, u8 enable, u8 type, s8 link_id);
+
+ /**
+ * amnt_set - add/delete station from monitoring
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index 3683f6034..80fe2e591 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -141,6 +141,7 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
+ [MTK_VENDOR_ATTR_WIRELESS_CTRL_BA_BUFFER_SIZE] = {.type = NLA_U16 },
+ [MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU] = {.type = NLA_U8 },
+ [MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT] = {.type = NLA_U8 },
++ [MTK_VENDOR_ATTR_WIRELESS_CTRL_LINK_ID] = {.type = NLA_U8 },
+ };
+
+ static struct nla_policy
+@@ -14910,7 +14911,7 @@ static int nl80211_get_aval_color_bmp(void *priv, u64 *aval_color_bmp)
+ return ret;
+ }
+
+-static int nl80211_ap_wireless(void *priv, u8 sub_vendor_id, int value)
++static int nl80211_ap_wireless(void *priv, u8 sub_vendor_id, int value, s8 link_id)
+ {
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+@@ -14941,6 +14942,9 @@ static int nl80211_ap_wireless(void *priv, u8 sub_vendor_id, int value)
+ else
+ nla_put_u8(msg, sub_vendor_id, (u8) value);
+
++ if (link_id > -1)
++ nla_put_u8(msg, MTK_VENDOR_ATTR_WIRELESS_CTRL_LINK_ID, link_id);
++
+ nla_nest_end(msg, data);
+ ret = send_and_recv_cmd(drv, msg);
+ if (ret)
+@@ -14997,7 +15001,7 @@ fail:
+ return -ENOBUFS;
+ }
+
+-static int nl80211_ap_trigtype(void *priv, u8 enable, u8 type)
++static int nl80211_ap_trigtype(void *priv, u8 enable, u8 type, s8 link_id)
+ {
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+@@ -15023,6 +15027,9 @@ static int nl80211_ap_trigtype(void *priv, u8 enable, u8 type)
+ if (!data)
+ goto fail;
+
++ if (link_id > -1)
++ nla_put_u8(msg, MTK_VENDOR_ATTR_RFEATURE_CTRL_LINK_ID, link_id);
++
+ data2 = nla_nest_start(msg, MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE_CFG);
+ if (!data2)
+ goto fail;
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0109-mtk-hostapd-rework-radar-event-handling.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0109-mtk-hostapd-rework-radar-event-handling.patch
new file mode 100644
index 0000000..6daae7e
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0109-mtk-hostapd-rework-radar-event-handling.patch
@@ -0,0 +1,124 @@
+From 3443edc9c46258a0ce8a11ca579f7be29028e363 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Thu, 27 Jun 2024 13:44:00 +0800
+Subject: [PATCH 109/126] mtk: hostapd: rework radar event handling
+
+Specify the ifindex for the radar event in the sinlge wiphy model.
+This resolves the following MBSS MLD radar event issue.
+For example, if the topology is:
+MLD 1 (2G, 6G)
+MLD 2 (2G, 5G)
+2G legacy AP
+5G legacy AP
+6G legacy AP
+Without specifying the ifindex, hostapd will handle the radar event
+with the drv->ctx (MLD 1 2G hapd).
+However, in this case, MLD 1 has no 5G link, so the radar event will
+be ignored.
+
+Depends-On: I41d67b4d6f4610694f3830fdd0154fd392bc7c1f
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ src/drivers/driver_nl80211_event.c | 42 +++++++++++++++++++-----------
+ 1 file changed, 27 insertions(+), 15 deletions(-)
+
+diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
+index 635401564..e95593a5b 100644
+--- a/src/drivers/driver_nl80211_event.c
++++ b/src/drivers/driver_nl80211_event.c
+@@ -2464,11 +2464,23 @@ static void nl80211_connect_failed_event(struct wpa_driver_nl80211_data *drv,
+ static void nl80211_radar_event(struct wpa_driver_nl80211_data *drv,
+ struct nlattr **tb)
+ {
++ struct i802_bss *bss;
+ union wpa_event_data data;
+ enum nl80211_radar_event event_type;
++ int ifidx;
++
++ if (!tb[NL80211_ATTR_WIPHY_FREQ] || !tb[NL80211_ATTR_RADAR_EVENT] ||
++ !tb[NL80211_ATTR_IFINDEX])
++ return;
+
+- if (!tb[NL80211_ATTR_WIPHY_FREQ] || !tb[NL80211_ATTR_RADAR_EVENT])
++ ifidx = nla_get_u32(tb[NL80211_ATTR_IFINDEX]);
++ bss = get_bss_ifindex(drv, ifidx);
++ if (!bss) {
++ wpa_printf(MSG_ERROR,
++ "nl80211: Unknown ifindex (%d) for radar event, ignoring",
++ ifidx);
+ return;
++ }
+
+ os_memset(&data, 0, sizeof(data));
+ data.dfs_event.link_id = NL80211_DRV_LINK_ID_NA;
+@@ -2480,8 +2492,7 @@ static void nl80211_radar_event(struct wpa_driver_nl80211_data *drv,
+ nla_get_u8(tb[NL80211_ATTR_MLO_LINK_ID]);
+ } else if (data.dfs_event.freq) {
+ data.dfs_event.link_id =
+- nl80211_get_link_id_by_freq(drv->first_bss,
+- data.dfs_event.freq);
++ nl80211_get_link_id_by_freq(bss, data.dfs_event.freq);
+ }
+
+ /* Check HT params */
+@@ -2515,43 +2526,44 @@ static void nl80211_radar_event(struct wpa_driver_nl80211_data *drv,
+ data.dfs_event.cf2 = nla_get_u32(tb[NL80211_ATTR_CENTER_FREQ2]);
+
+ wpa_printf(MSG_DEBUG,
+- "nl80211: DFS event on freq %d MHz, ht: %d, offset: %d, width: %d, cf1: %dMHz, cf2: %dMHz, link_id=%d",
++ "nl80211: DFS event on freq %d MHz, ht: %d, offset: %d, width: %d, "
++ "cf1: %dMHz, cf2: %dMHz, ifindex=%d, link_id=%d",
+ data.dfs_event.freq, data.dfs_event.ht_enabled,
+ data.dfs_event.chan_offset, data.dfs_event.chan_width,
+- data.dfs_event.cf1, data.dfs_event.cf2,
++ data.dfs_event.cf1, data.dfs_event.cf2, ifidx,
+ data.dfs_event.link_id);
+
+ switch (event_type) {
+ case NL80211_RADAR_DETECTED:
+- wpa_supplicant_event(drv->ctx, EVENT_DFS_RADAR_DETECTED, &data);
++ wpa_supplicant_event(bss->ctx, EVENT_DFS_RADAR_DETECTED, &data);
+ break;
+ case NL80211_RADAR_CAC_FINISHED:
+- wpa_supplicant_event(drv->ctx, EVENT_DFS_CAC_FINISHED, &data);
++ wpa_supplicant_event(bss->ctx, EVENT_DFS_CAC_FINISHED, &data);
+ break;
+ case NL80211_RADAR_CAC_ABORTED:
+- wpa_supplicant_event(drv->ctx, EVENT_DFS_CAC_ABORTED, &data);
++ wpa_supplicant_event(bss->ctx, EVENT_DFS_CAC_ABORTED, &data);
+ break;
+ case NL80211_RADAR_NOP_FINISHED:
+- wpa_supplicant_event(drv->ctx, EVENT_DFS_NOP_FINISHED, &data);
++ wpa_supplicant_event(bss->ctx, EVENT_DFS_NOP_FINISHED, &data);
+ break;
+ case NL80211_RADAR_PRE_CAC_EXPIRED:
+- wpa_supplicant_event(drv->ctx, EVENT_DFS_PRE_CAC_EXPIRED,
++ wpa_supplicant_event(bss->ctx, EVENT_DFS_PRE_CAC_EXPIRED,
+ &data);
+ break;
+ case NL80211_RADAR_CAC_STARTED:
+- wpa_supplicant_event(drv->ctx, EVENT_DFS_CAC_STARTED, &data);
++ wpa_supplicant_event(bss->ctx, EVENT_DFS_CAC_STARTED, &data);
+ break;
+ case NL80211_RADAR_BACKGROUND_CHAN_UPDATE:
+- wpa_supplicant_event(drv->ctx, EVENT_DFS_BACKGROUND_CHAN_UPDATE, &data);
++ wpa_supplicant_event(bss->ctx, EVENT_DFS_BACKGROUND_CHAN_UPDATE, &data);
+ break;
+ case NL80211_RADAR_BACKGROUND_CHAN_EXPAND:
+- wpa_supplicant_event(drv->ctx, EVENT_DFS_BACKGROUND_CHAN_EXPAND, &data);
++ wpa_supplicant_event(bss->ctx, EVENT_DFS_BACKGROUND_CHAN_EXPAND, &data);
+ break;
+ case NL80211_RADAR_STA_CAC_SKIPPED:
+- wpa_supplicant_event(drv->ctx, EVENT_DFS_STA_CAC_SKIPPED, &data);
++ wpa_supplicant_event(bss->ctx, EVENT_DFS_STA_CAC_SKIPPED, &data);
+ break;
+ case NL80211_RADAR_STA_CAC_EXPIRED:
+- wpa_supplicant_event(drv->ctx, EVENT_DFS_STA_CAC_EXPIRED, &data);
++ wpa_supplicant_event(bss->ctx, EVENT_DFS_STA_CAC_EXPIRED, &data);
+ break;
+ default:
+ wpa_printf(MSG_DEBUG, "nl80211: Unknown radar event %d "
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0110-mtk-hostapd-add-support-for-link-add.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0110-mtk-hostapd-add-support-for-link-add.patch
new file mode 100644
index 0000000..ae3b4da
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0110-mtk-hostapd-add-support-for-link-add.patch
@@ -0,0 +1,292 @@
+From 4418652f8216f0fcdb74e4534d90f21f87d06dbc Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Fri, 28 Jun 2024 14:05:21 +0800
+Subject: [PATCH 110/126] mtk: hostapd: add support for link add
+
+Add support for adding affiliated APs to AP MLD via the following link add command
+hostapd_cli -i <mld intf> raw LINK_ADD bss_config=phyX:<bss_config>
+<bss_config> is per-bss config
+
+Add another cmd format:
+hostapd_cli -i <mld intf> link_add bss_config=phyX:<bss_config>
+
+Current link removal is implemented by hostapd_disable_iface for
+the sake of simplicity.
+When a link is added back after removal, hostapd_enable_iface should be
+called instead of hostapd_add_iface.
+Therefore, this patch is added to support iface enablement in link add cmd
+as a temporary workaround.
+
+Avoid modifying the original cmd str before entering hostapd_add_iface.
+Otherwise, hostapd_add_iface will fail to parse the cmd str correctly.
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ hostapd/ctrl_iface.c | 104 ++++++++++++++++++++++++++++++++++++++++++
+ hostapd/hostapd_cli.c | 8 ++++
+ src/ap/beacon.c | 20 ++++++--
+ src/ap/hostapd.c | 24 +++++++---
+ src/ap/hostapd.h | 1 +
+ 5 files changed, 148 insertions(+), 9 deletions(-)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index 3943cb3aa..988bc90de 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -3910,6 +3910,105 @@ static int hostapd_ctrl_iface_link_remove(struct hostapd_data *hapd, char *cmd,
+
+ return ret;
+ }
++
++
++static int hostapd_ctrl_iface_link_add(struct hostapd_data *hapd, char *cmd,
++ char *buf, size_t buflen)
++{
++ struct hapd_interfaces *interfaces = hapd->iface->interfaces;
++ struct hostapd_iface *iface = NULL;
++ struct hostapd_data *h;
++ struct hostapd_config *conf;
++ const char *ifname, *conf_file, *phy;
++ u16 old_valid_links = 0;
++ bool hapd_existed = false;
++ char *pos, *tmp;
++ int i, ret = -1;
++ size_t len;
++
++ if (!hapd || !hapd->conf->mld_ap || !hapd->mld) {
++ wpa_printf(MSG_ERROR,
++ "Trying to add link to non-MLD AP or non-existed AP");
++ return -1;
++ }
++
++ if (os_strncmp(cmd, "bss_config=", 11))
++ return -1;
++
++ len = os_strlen(cmd) + 1;
++ tmp = os_malloc(len);
++ if (!tmp)
++ return -1;
++
++ os_snprintf(tmp, len, "%s", cmd);
++ phy = tmp + 11;
++ pos = os_strchr(phy, ':');
++ if (!pos)
++ goto out;
++ *pos++ = '\0';
++ conf_file = pos;
++ if (!os_strlen(conf_file))
++ goto out;
++
++ conf = interfaces->config_read_cb(conf_file);
++ if (!conf)
++ goto out;
++
++ ifname = conf->bss[0]->iface;
++ if (ifname[0] != '\0' &&
++ os_strncmp(ifname, hapd->conf->iface, sizeof(hapd->conf->iface))) {
++ wpa_printf(MSG_ERROR,
++ "Interface name %s mismatch (expected %s)",
++ ifname, hapd->conf->iface);
++ hostapd_config_free(conf);
++ goto out;
++ }
++
++ if (!conf->bss[0]->mld_ap) {
++ wpa_printf(MSG_ERROR, "The added interface is not MLD AP");
++ hostapd_config_free(conf);
++ goto out;
++ }
++
++ for (i = 0; i < interfaces->count; i++) {
++ if (os_strcmp(interfaces->iface[i]->phy, phy) == 0) {
++ iface = interfaces->iface[i];
++ break;
++ }
++ }
++ if (iface && iface->state == HAPD_IFACE_DISABLED) {
++ for (i = 0; i < iface->num_bss; i++) {
++ h = iface->bss[i];
++ if (ifname[0] != '\0' &&
++ !os_strncmp(ifname, h->conf->iface, sizeof(h->conf->iface)))
++ hapd_existed = true;
++ }
++ }
++ hostapd_config_free(conf);
++
++ for_each_mld_link(h, hapd)
++ old_valid_links |= BIT(h->mld_link_id);
++ hapd->mld->link_reconf_in_progress = old_valid_links;
++
++ if (hapd_existed)
++ ret = hostapd_enable_iface(iface);
++ else
++ ret = hostapd_add_iface(interfaces, cmd);
++ if (ret < 0)
++ goto out;
++
++ ret = os_snprintf(buf, buflen, "%s\n", "OK");
++ if (os_snprintf_error(buflen, ret))
++ ret = -1;
++ else
++ ret = 0;
++
++out:
++ os_free(tmp);
++
++ return ret;
++}
++
+ #endif /* CONFIG_TESTING_OPTIONS */
+ #endif /* CONFIG_IEEE80211BE */
+
+@@ -6048,6 +6147,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+ if (hostapd_ctrl_iface_link_remove(hapd, buf + 12,
+ reply, reply_size))
+ reply_len = -1;
++ } else if (os_strncmp(buf, "LINK_ADD ", 9) == 0) {
++ if (hostapd_ctrl_iface_link_add(hapd, buf + 9,
++ reply, reply_size))
++ reply_len = -1;
+ #endif /* CONFIG_TESTING_OPTIONS */
+ #endif /* CONFIG_IEEE80211BE */
+ } else if (os_strncmp(buf, "SET_EDCCA ", 10) == 0) {
+@@ -6938,6 +7041,7 @@ void hostapd_ctrl_iface_deinit(struct hostapd_data *hapd)
+ static int hostapd_ctrl_iface_add(struct hapd_interfaces *interfaces,
+ char *buf)
+ {
++ /* TODO: handle link add via global ADD command */
+ if (hostapd_add_iface(interfaces, buf) < 0) {
+ wpa_printf(MSG_ERROR, "Adding interface %s failed", buf);
+ return -1;
+diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
+index 54fda5c45..bfa912dff 100644
+--- a/hostapd/hostapd_cli.c
++++ b/hostapd/hostapd_cli.c
+@@ -1779,6 +1779,12 @@ static int hostapd_cli_cmd_wmm(struct wpa_ctrl *ctrl, int argc,
+ return hostapd_cli_cmd(ctrl, "WMM", 1, argc, argv);
+ }
+
++static int hostapd_cli_cmd_link_add(struct wpa_ctrl *ctrl, int argc,
++ char *argv[])
++{
++ return hostapd_cli_cmd(ctrl, "LINK_ADD", 1, argc, argv);
++}
++
+ struct hostapd_cli_cmd {
+ const char *cmd;
+ int (*handler)(struct wpa_ctrl *ctrl, int argc, char *argv[]);
+@@ -2039,6 +2045,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+ " = Get preamble puncture status"},
+ { "wmm", hostapd_cli_cmd_wmm, NULL,
+ " = <ac> [cwmin=] [cwmax=] [aifs=] [txop_limit=]"},
++ { "link_add", hostapd_cli_cmd_link_add, NULL,
++ " = Add a new link to a MLD AP"},
+ { NULL, NULL, NULL, NULL }
+ };
+
+diff --git a/src/ap/beacon.c b/src/ap/beacon.c
+index 50d45d532..8a9569549 100644
+--- a/src/ap/beacon.c
++++ b/src/ap/beacon.c
+@@ -2809,6 +2809,14 @@ static int __ieee802_11_set_beacon(struct hostapd_data *hapd)
+ return 0;
+ }
+
++#ifdef CONFIG_IEEE80211BE
++#ifdef CONFIG_TESTING_OPTIONS
++ if (hapd->conf->mld_ap && hapd->mld &&
++ (hapd->mld->link_reconf_in_progress & BIT(hapd->mld_link_id)))
++ ieee802_11_set_bss_critical_update(hapd, BSS_CRIT_UPDATE_EVENT_ADD_LINK);
++#endif /* CONFIG_TESTING_OPTIONS */
++#endif /* CONFIG_IEEE80211BE */
++
+ hapd->beacon_set_done = 1;
+
+ if (ieee802_11_build_ap_params(hapd, ¶ms) < 0)
+@@ -2966,13 +2974,19 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
+ }
+
+ #ifdef CONFIG_IEEE80211BE
+- /* clear critical update flag for UPDATE_SINGLE type, for other types,
+- * we should get some notified events from driver
++ /* clear critical update flag for UPDATE_SINGLE type & link adding,
++ * for other types, we should get some notified events from driver
+ */
+ if (hapd->conf->mld_ap) {
+- for_each_mld_link(h, hapd)
++ for_each_mld_link(h, hapd) {
+ if (h->eht_mld_bss_critical_update == BSS_CRIT_UPDATE_SINGLE)
+ h->eht_mld_bss_critical_update = 0;
++ if (h->eht_mld_bss_critical_update == BSS_CRIT_UPDATE_FLAG &&
++ (h->mld->link_reconf_in_progress & BIT(h->mld_link_id))) {
++ h->mld->link_reconf_in_progress &= ~BIT(h->mld_link_id);
++ h->eht_mld_bss_critical_update = 0;
++ }
++ }
+ }
+ #endif /* CONFIG_IEEE80211BE */
+
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index 63d89e614..257849536 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -574,6 +574,10 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd)
+ hapd->iface->bss[0] != hapd)
+ hostapd_if_link_remove(hapd, WPA_IF_AP_BSS, hapd->conf->iface,
+ hapd->mld_link_id);
++ /* Clear the link reconfiguration flag when the added link failed to setup */
++ if (hapd->conf->mld_ap && hapd->mld &&
++ !(hapd->mld->link_reconf_in_progress & BIT(hapd->mld_link_id)))
++ hapd->mld->link_reconf_in_progress = 0;
+ #endif /* CONFIG_IEEE80211BE */
+
+ wpabuf_free(hapd->time_adv);
+@@ -3450,11 +3454,20 @@ hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy,
+ }
+
+ ifname = conf->bss[0]->iface;
+- if (ifname[0] != '\0' && ifname_in_use(interfaces, ifname)) {
+- wpa_printf(MSG_ERROR,
+- "Interface name %s already in use", ifname);
+- hostapd_config_free(conf);
+- return NULL;
++ if (conf->bss[0]->mld_ap) {
++ if (!iface->bss[0]->conf->mld_ap) {
++ wpa_printf(MSG_ERROR,
++ "Cannot add a MLO BSS when the first BSS is non-MLO");
++ hostapd_config_free(conf);
++ return NULL;
++ }
++ } else {
++ if (ifname[0] != '\0' && ifname_in_use(interfaces, ifname)) {
++ wpa_printf(MSG_ERROR,
++ "Interface name %s already in use", ifname);
++ hostapd_config_free(conf);
++ return NULL;
++ }
+ }
+
+ tmp_conf = os_realloc_array(
+@@ -3486,7 +3499,6 @@ hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy,
+ hapd->msg_ctx = hapd;
+ hostapd_bss_setup_multi_link(hapd, interfaces);
+
+-
+ bss_idx = iface->num_bss++;
+ conf->num_bss--;
+ conf->bss[0] = NULL;
+diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
+index 99d5a01d6..52875cca1 100644
+--- a/src/ap/hostapd.h
++++ b/src/ap/hostapd.h
+@@ -549,6 +549,7 @@ struct hostapd_mld {
+ */
+ u8 refcount;
+ bool started;
++ u16 link_reconf_in_progress;
+
+ struct hostapd_data *fbss;
+ struct dl_list links; /* List head of all affiliated links */
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0111-mtk-hostapd-Fix-the-op_class-value-in-the-RNR-IE-to-.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0111-mtk-hostapd-Fix-the-op_class-value-in-the-RNR-IE-to-.patch
new file mode 100644
index 0000000..0dd281b
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0111-mtk-hostapd-Fix-the-op_class-value-in-the-RNR-IE-to-.patch
@@ -0,0 +1,42 @@
+From b039d88e5924a340709646c5e855bc06fcb1da78 Mon Sep 17 00:00:00 2001
+From: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
+Date: Thu, 4 Jul 2024 13:37:23 +0800
+Subject: [PATCH 111/126] mtk: hostapd: Fix the op_class value in the RNR IE to
+ achieve backward compatibility
+
+According to the chapter 11.49 Reduced neighbor report
+of DraftP802.11be_D5.1, the AP should select (one of) the operating
+class(es) that is expected to be understood by all STAs that might
+intend to connect to the reported AP, even if the channel spacing of
+that operating class is less than the BSS bandwidth of all the reported
+APs in the Neighbor AP Information field.
+
+For example, if an AP reports an EHT AP that is operating a BSS with 320
+MHz bandwidth in 6 GHz band using operating class 137, it is recommended
+that the operating class selected by the AP in the Reduced Neighbor Report
+element is operating class 131, 132, 133 or 134, since these are expected
+to be understood by all STAs that can connect to the reported 6GHz AP.
+
+Signed-off-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
+Signed-off-by: Money Wang <money.wang@mediatek.com>
+Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
+---
+ src/ap/ieee802_11.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index 62fdfb288..75ffb2a18 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -7841,7 +7841,7 @@ static bool hostapd_eid_rnr_bss(struct hostapd_data *hapd,
+ * one TBTT info available. */
+ *tbtt_count_pos = eid++;
+ *eid++ = tbtt_info_len;
+- *eid++ = op_class;
++ *eid++ = (op_class == 137 ? 134 : op_class);
+ *eid++ = bss->iconf->channel;
+ *len += RNR_TBTT_HEADER_LEN;
+ }
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0112-mtk-hostapd-support-enable-disable-preamble-puncture.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0112-mtk-hostapd-support-enable-disable-preamble-puncture.patch
new file mode 100644
index 0000000..0f8af3e
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0112-mtk-hostapd-support-enable-disable-preamble-puncture.patch
@@ -0,0 +1,470 @@
+From d45a052e2c7efe295705ad2185f36b38058ede83 Mon Sep 17 00:00:00 2001
+From: Allen Ye <allen.ye@mediatek.com>
+Date: Tue, 28 May 2024 17:46:26 +0800
+Subject: [PATCH 112/126] mtk: hostapd: support enable/disable preamble
+ puncture from mtk vendor command
+
+Add mtk vendor event to update punct bitmap and trigger channel switch.
+Change to pp user mode when use hostapd_cli to channel switch.
+Change pp vendor cmd use link_id instead of band_idx.
+Remove band_ind in hostapd_cli get/set pp cmd.
+
+Change pp default enable firmware mode.
+
+Signed-off-by: Allen Ye <allen.ye@mediatek.com>
+---
+ hostapd/config_file.c | 1 -
+ hostapd/ctrl_iface.c | 45 ++++++++--------
+ hostapd/hostapd_cli.c | 4 +-
+ src/ap/ap_config.c | 2 +-
+ src/ap/ap_drv_ops.c | 10 +++-
+ src/ap/drv_callbacks.c | 82 ++++++++++++++++++++++++++++++
+ src/common/mtk_vendor.h | 8 ++-
+ src/drivers/driver.h | 11 +++-
+ src/drivers/driver_nl80211.c | 10 ++--
+ src/drivers/driver_nl80211_event.c | 48 +++++++++++++++++
+ 10 files changed, 185 insertions(+), 36 deletions(-)
+
+diff --git a/hostapd/config_file.c b/hostapd/config_file.c
+index 38273a4f2..f7bfc357a 100644
+--- a/hostapd/config_file.c
++++ b/hostapd/config_file.c
+@@ -5452,7 +5452,6 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+ if (get_u16(pos, line, &conf->punct_bitmap))
+ return 1;
+ conf->punct_bitmap = atoi(pos);
+- conf->pp_mode = PP_USR_MODE;
+ } else if (os_strcmp(buf, "punct_acs_threshold") == 0) {
+ int val = atoi(pos);
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index 988bc90de..337261f8f 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -2818,6 +2818,7 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+ #ifdef NEED_AP_MLME
+ struct hostapd_hw_modes *mode = iface->current_mode;
+ struct csa_settings settings, background_settings;
++ struct hostapd_data *hapd;
+ int ret;
+ int freq, state;
+ int bandwidth, oper_chwidth;
+@@ -2914,6 +2915,17 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+ break;
+ }
+
++#ifdef CONFIG_IEEE80211BE
++ hapd = iface->bss[0];
++ if (hapd->iconf->punct_bitmap != settings.punct_bitmap &&
++ hapd->iconf->pp_mode != PP_USR_MODE) {
++ hapd->iconf->pp_mode = PP_USR_MODE;
++ ret = hostapd_drv_pp_mode_set(hapd);
++ if (ret)
++ return ret;
++ }
++#endif /* CONFIG_IEEE80211BE */
++
+ for (i = 0; i < iface->num_bss; i++) {
+
+ /* Save CHAN_SWITCH VHT, HE, and EHT config */
+@@ -5172,8 +5184,7 @@ static int
+ hostapd_ctrl_iface_set_pp(struct hostapd_data *hapd, char *cmd, char *buf,
+ size_t buflen)
+ {
+- char *band, *config, *value;
+- u8 band_idx;
++ char *config, *value;
+
+ config = cmd;
+
+@@ -5182,31 +5193,26 @@ hostapd_ctrl_iface_set_pp(struct hostapd_data *hapd, char *cmd, char *buf,
+ return -1;
+ *value++ = '\0';
+
+- band = os_strchr(value, ' ');
+- if (band == NULL)
+- return -1;
+- *band++ = '\0';
+- band_idx = strtol(band, NULL, 10);
+-
+- hapd = hostapd_get_hapd_by_band_idx(hapd, band_idx);
+-
+- if (!hapd)
+- return -1;
+-
+ if (os_strcmp(config, "mode") == 0) {
+ int val = strtol(value, NULL, 10);
+
+- if (val < PP_DISABLE || val > PP_FW_MODE) {
++ switch(val) {
++ case PP_DISABLE:
++ case PP_FW_MODE:
++ break;
++ case PP_USR_MODE:
++ default:
+ wpa_printf(MSG_ERROR, "Invalid value for SET_PP");
+ return -1;
+ }
+ hapd->iconf->pp_mode = (u8) val;
++ hapd->iconf->punct_bitmap = 0;
+ if (hostapd_drv_pp_mode_set(hapd) != 0)
+ return -1;
+ } else {
+ wpa_printf(MSG_ERROR,
+ "Unsupported parameter %s for SET_PP"
+- "Usage: set_pp mode <value> <band_idx>", config);
++ "Usage: set_pp mode <value>", config);
+ return -1;
+ }
+ return os_snprintf(buf, buflen, "OK\n");
+@@ -5216,15 +5222,6 @@ static int
+ hostapd_ctrl_iface_get_pp(struct hostapd_data *hapd, char *cmd, char *buf,
+ size_t buflen)
+ {
+- u8 band_idx;
+-
+- band_idx = strtol(cmd, NULL, 10);
+-
+- hapd = hostapd_get_hapd_by_band_idx(hapd, band_idx);
+-
+- if (!hapd)
+- return -1;
+-
+ return os_snprintf(buf, buflen, "pp_mode: %d, punct_bitmap: 0x%04x\n",
+ hapd->iconf->pp_mode, hapd->iconf->punct_bitmap);
+ }
+diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
+index bfa912dff..12ee0a18f 100644
+--- a/hostapd/hostapd_cli.c
++++ b/hostapd/hostapd_cli.c
+@@ -1764,13 +1764,13 @@ static int hostapd_cli_cmd_dump_csi(struct wpa_ctrl *ctrl, int argc,
+ static int hostapd_cli_cmd_set_pp(struct wpa_ctrl *ctrl, int argc,
+ char *argv[])
+ {
+- return hostapd_cli_cmd(ctrl, "set_pp", 3, argc, argv);
++ return hostapd_cli_cmd(ctrl, "set_pp", 2, argc, argv);
+ }
+
+ static int hostapd_cli_cmd_get_pp(struct wpa_ctrl *ctrl, int argc,
+ char *argv[])
+ {
+- return hostapd_cli_cmd(ctrl, "get_pp", 1, argc, argv);
++ return hostapd_cli_cmd(ctrl, "get_pp", 0, argc, argv);
+ }
+
+ static int hostapd_cli_cmd_wmm(struct wpa_ctrl *ctrl, int argc,
+diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
+index 95100b25c..4528df823 100644
+--- a/src/ap/ap_config.c
++++ b/src/ap/ap_config.c
+@@ -312,7 +312,7 @@ struct hostapd_config * hostapd_config_defaults(void)
+ conf->three_wire_enable = THREE_WIRE_MODE_DISABLE;
+ conf->ibf_enable = IBF_DEFAULT_ENABLE;
+ conf->amsdu = 1;
+- conf->pp_mode = PP_DISABLE;
++ conf->pp_mode = PP_FW_MODE;
+ conf->band_idx = 255;
+
+ hostapd_set_and_check_bw320_offset(conf, 0);
+diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
+index 8631bf960..f9ec9a689 100644
+--- a/src/ap/ap_drv_ops.c
++++ b/src/ap/ap_drv_ops.c
+@@ -1447,14 +1447,20 @@ int hostapd_drv_background_radar_mode(struct hostapd_data *hapd)
+
+ int hostapd_drv_pp_mode_set(struct hostapd_data *hapd)
+ {
++ s8 link_id = -1;
++
+ if (!hapd->driver || !hapd->driver->pp_mode_set ||
+- hapd->iconf->pp_mode >= PP_USR_MODE ||
++ hapd->iconf->pp_mode > PP_USR_MODE ||
+ hapd->iface->current_mode->mode != HOSTAPD_MODE_IEEE80211A)
+ return 0;
+
++ if (hapd->conf->mld_ap)
++ link_id = hapd->mld_link_id;
++
+ return hapd->driver->pp_mode_set(hapd->drv_priv,
+ hapd->iconf->pp_mode,
+- hapd->iconf->band_idx);
++ link_id,
++ hapd->iconf->punct_bitmap);
+ }
+
+ int hostapd_drv_beacon_ctrl(struct hostapd_data *hapd, u8 beacon_mode)
+diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
+index 0e7cfd285..420d156c8 100644
+--- a/src/ap/drv_callbacks.c
++++ b/src/ap/drv_callbacks.c
+@@ -43,6 +43,7 @@
+ #include "fils_hlp.h"
+ #include "neighbor_db.h"
+ #include "nan_usd_ap.h"
++#include "ap/beacon.h"
+
+
+ #ifdef CONFIG_FILS
+@@ -2456,6 +2457,81 @@ static void hostapd_event_color_change(struct hostapd_data *hapd, bool success)
+ #endif /* CONFIG_IEEE80211AX */
+
+
++static void hostapd_event_pp_bitmap_update(struct hostapd_data *hapd,
++ struct ch_switch *ch_switch)
++{
++ struct hostapd_iface *iface = hapd->iface;
++ struct hostapd_hw_modes *cmode = iface->current_mode;
++ int err, freq;
++ struct csa_settings csa_settings;
++ unsigned int i;
++
++ /* Check if CSA in progress */
++ if (hostapd_csa_in_progress(iface))
++ return;
++
++ if (!hw_get_channel_chan(cmode, iface->conf->channel, &freq))
++ return;
++
++ if (iface->conf->punct_bitmap == ch_switch->punct_bitmap ||
++ freq != ch_switch->freq)
++ return;
++
++ /* Setup CSA request */
++ os_memset(&csa_settings, 0, sizeof(csa_settings));
++ csa_settings.cs_count = 5;
++ csa_settings.block_tx = 0;
++ csa_settings.punct_bitmap = ch_switch->punct_bitmap;
++ csa_settings.link_id = ch_switch->link_id;
++
++ err = hostapd_set_freq_params(&csa_settings.freq_params,
++ iface->conf->hw_mode,
++ freq,
++ iface->conf->channel,
++ iface->conf->enable_edmg,
++ iface->conf->edmg_channel,
++ iface->conf->ieee80211n,
++ iface->conf->ieee80211ac,
++ iface->conf->ieee80211ax,
++ iface->conf->ieee80211be,
++ iface->conf->secondary_channel,
++ hostapd_get_oper_chwidth(iface->conf),
++ hostapd_get_oper_centr_freq_seg0_idx(iface->conf),
++ hostapd_get_oper_centr_freq_seg1_idx(iface->conf),
++ cmode->vht_capab,
++ &cmode->he_capab[IEEE80211_MODE_AP],
++ &cmode->eht_capab[IEEE80211_MODE_AP],
++ ch_switch->punct_bitmap);
++
++ if (err) {
++ wpa_printf(MSG_ERROR,
++ "Failed to calculate CSA freq params");
++ hostapd_disable_iface(iface);
++ return;
++ }
++
++ for (i = 0; i < iface->num_bss; i++) {
++ ieee802_11_set_bss_critical_update(iface->bss[i],
++ BSS_CRIT_UPDATE_EVENT_CSA);
++
++ err = hostapd_switch_channel(iface->bss[i], &csa_settings);
++ if (err)
++ break;
++
++#ifdef CONFIG_IEEE80211BE
++ if (iface->bss[i]->conf->mld_ap)
++ hostapd_update_aff_link_beacon(iface->bss[i],
++ csa_settings.cs_count);
++
++ /* FIXME:
++ * CU flag should be cleared when receiving DTIM event from FW
++ */
++ iface->bss[i]->eht_mld_bss_critical_update = 0;
++#endif /* CONFIG_IEEE80211BE */
++ }
++}
++
++
+ void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
+ union wpa_event_data *data)
+ {
+@@ -2759,6 +2835,12 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
+ hostapd_event_dfs_cac_started(hapd, &data->dfs_event);
+ break;
+ #endif /* NEED_AP_MLME */
++ case EVENT_PP_BITMAP_UPDATE:
++ if (!data)
++ break;
++ hapd = switch_link_hapd(hapd, data->ch_switch.link_id);
++ hostapd_event_pp_bitmap_update(hapd, &data->ch_switch);
++ break;
+ case EVENT_INTERFACE_ENABLED:
+ wpa_msg(hapd->msg_ctx, MSG_INFO, INTERFACE_ENABLED);
+ if (hapd->disabled && hapd->started) {
+diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
+index 937b968d5..933f0099d 100644
+--- a/src/common/mtk_vendor.h
++++ b/src/common/mtk_vendor.h
+@@ -22,6 +22,10 @@ enum mtk_nl80211_vendor_subcmds {
+ MTK_NL80211_VENDOR_SUBCMD_EML_CTRL = 0xd3,
+ };
+
++enum mtk_nl80211_vendor_subevents {
++ MTK_NL80211_VENDOR_EVENT_PP_BMP_UPDATE = 0x5,
++};
++
+ enum mtk_vendor_attr_edcca_ctrl {
+ MTK_VENDOR_ATTR_EDCCA_THRESHOLD_INVALID = 0,
+
+@@ -271,7 +275,9 @@ enum mtk_vendor_attr_pp_ctrl {
+ MTK_VENDOR_ATTR_PP_CTRL_UNSPEC,
+
+ MTK_VENDOR_ATTR_PP_MODE,
+- MTK_VENDOR_ATTR_PP_BAND_IDX,
++ MTK_VENDOR_ATTR_PP_LINK_ID,
++ MTK_VENDOR_ATTR_PP_BITMAP,
++ MTK_VENDOR_ATTR_PP_CURR_FREQ,
+
+ /* keep last */
+ NUM_MTK_VENDOR_ATTRS_PP_CTRL,
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index dacf0a98d..5e65d9e0b 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -5381,9 +5381,10 @@ struct wpa_driver_ops {
+ * pp_mode_set - Set preamble puncture operation mode
+ * @priv: Private driver interface data
+ * @pp_mode: Value is defined in enum pp_mode
+- * @band_idx: chip band index
++ * @link_id: MLD link id. -1 if this is an non-MLD AP
++ * @punct_bitmap: current puncture bitmap
+ */
+- int (*pp_mode_set)(void *priv, const u8 pp_mode, u8 band_idx);
++ int (*pp_mode_set)(void *priv, const u8 pp_mode, s8 link_id, u16 punct_bitmap);
+ #ifdef CONFIG_IEEE80211BE
+ int (*get_mld_addr)(void *priv, u8 *addr);
+ #endif
+@@ -6058,6 +6059,12 @@ enum wpa_event_type {
+ * channel has been updated and operating channel should expand its width.
+ */
+ EVENT_DFS_BACKGROUND_CHAN_EXPAND,
++
++ /**
++ * EVENT_PP_BITMAP_UPDATE - Notification that the new puncture bitmap
++ * has been applied and a channel switch should be triggered.
++ */
++ EVENT_PP_BITMAP_UPDATE,
+ };
+
+
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index 80fe2e591..5d97317f7 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -160,7 +160,9 @@ amnt_dump_policy[NUM_MTK_VENDOR_ATTRS_AMNT_DUMP] = {
+ static struct nla_policy
+ pp_ctrl_policy[NUM_MTK_VENDOR_ATTRS_PP_CTRL] = {
+ [MTK_VENDOR_ATTR_PP_MODE] = { .type = NLA_U8 },
+- [MTK_VENDOR_ATTR_PP_BAND_IDX] = { .type = NLA_U8 },
++ [MTK_VENDOR_ATTR_PP_LINK_ID] = { .type = NLA_U8 },
++ [MTK_VENDOR_ATTR_PP_BITMAP] = { .type = NLA_U16 },
++ [MTK_VENDOR_ATTR_PP_CURR_FREQ] = { .type = NLA_U32 },
+ };
+
+ static struct nla_policy csi_ctrl_policy[NUM_MTK_VENDOR_ATTRS_CSI_CTRL] = {
+@@ -15248,7 +15250,7 @@ static int nl80211_background_radar_mode(void *priv, const u8 background_radar_m
+ return ret;
+ }
+
+-static int nl80211_pp_mode_set(void *priv, const u8 pp_mode, u8 band_idx)
++static int nl80211_pp_mode_set(void *priv, const u8 pp_mode, s8 link_id, u16 punct_bitmap)
+ {
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+@@ -15275,8 +15277,10 @@ static int nl80211_pp_mode_set(void *priv, const u8 pp_mode, u8 band_idx)
+ if (!data)
+ goto fail;
+
+- nla_put_u8(msg, MTK_VENDOR_ATTR_PP_BAND_IDX, band_idx);
++ if (link_id > -1)
++ nla_put_u8(msg, MTK_VENDOR_ATTR_PP_LINK_ID, link_id);
+ nla_put_u8(msg, MTK_VENDOR_ATTR_PP_MODE, pp_mode);
++ nla_put_u16(msg, MTK_VENDOR_ATTR_PP_BITMAP, punct_bitmap);
+
+ nla_nest_end(msg, data);
+ ret = send_and_recv_cmd(drv, msg);
+diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
+index e95593a5b..efdb8ef7f 100644
+--- a/src/drivers/driver_nl80211_event.c
++++ b/src/drivers/driver_nl80211_event.c
+@@ -19,6 +19,7 @@
+ #include "common/ieee802_11_defs.h"
+ #include "common/ieee802_11_common.h"
+ #include "driver_nl80211.h"
++#include "common/mtk_vendor.h"
+
+
+ static void
+@@ -3332,6 +3333,50 @@ static void nl80211_vendor_event_brcm(struct wpa_driver_nl80211_data *drv,
+
+ #endif /* CONFIG_DRIVER_NL80211_BRCM */
+
++static void mtk_nl80211_pp_bitmap_update(struct wpa_driver_nl80211_data *drv,
++ const u8 *data, size_t len)
++{
++ struct nlattr *tb[MTK_VENDOR_ATTR_PP_CTRL_MAX + 1];
++ union wpa_event_data event;
++
++ wpa_printf(MSG_DEBUG,
++ "nl80211: MTK pp bitmap update vendor event received");
++
++ if (nla_parse(tb, MTK_VENDOR_ATTR_PP_CTRL_MAX,
++ (struct nlattr *) data, len, NULL) ||
++ !tb[MTK_VENDOR_ATTR_PP_CURR_FREQ] ||
++ !tb[MTK_VENDOR_ATTR_PP_BITMAP])
++ return;
++
++ os_memset(&event, 0, sizeof(event));
++ event.ch_switch.freq = nla_get_u32(tb[MTK_VENDOR_ATTR_PP_CURR_FREQ]);
++
++ event.ch_switch.link_id =
++ nl80211_get_link_id_by_freq(drv->first_bss, event.ch_switch.freq);
++ event.ch_switch.punct_bitmap =
++ nla_get_u16(tb[MTK_VENDOR_ATTR_PP_BITMAP]);
++
++ wpa_printf(MSG_DEBUG,
++ "nl80211: puncture bitmap: 0x%04x, link_id: %d",
++ event.ch_switch.punct_bitmap, event.ch_switch.link_id);
++ wpa_supplicant_event(drv->ctx, EVENT_PP_BITMAP_UPDATE, &event);
++}
++
++static void nl80211_vendor_event_mtk(struct wpa_driver_nl80211_data *drv,
++ u32 subcmd, u8 *data, size_t len)
++{
++ wpa_printf(MSG_DEBUG, "nl80211: Got MTK vendor event %u", subcmd);
++ switch (subcmd) {
++ case MTK_NL80211_VENDOR_EVENT_PP_BMP_UPDATE:
++ mtk_nl80211_pp_bitmap_update(drv, data, len);
++ break;
++ default:
++ wpa_printf(MSG_DEBUG,
++ "%s: Ignore unsupported MTK vendor event %u",
++ __func__, subcmd);
++ break;
++ }
++}
+
+ static void nl80211_vendor_event(struct wpa_driver_nl80211_data *drv,
+ struct nlattr **tb)
+@@ -3388,6 +3433,9 @@ static void nl80211_vendor_event(struct wpa_driver_nl80211_data *drv,
+ nl80211_vendor_event_brcm(drv, subcmd, data, len);
+ break;
+ #endif /* CONFIG_DRIVER_NL80211_BRCM */
++ case OUI_MTK:
++ nl80211_vendor_event_mtk(drv, subcmd, data, len);
++ break;
+ default:
+ wpa_printf(MSG_DEBUG, "nl80211: Ignore unsupported vendor event");
+ break;
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0113-mtk-hostapd-do-not-consider-ht-operation-update-for-.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0113-mtk-hostapd-do-not-consider-ht-operation-update-for-.patch
new file mode 100644
index 0000000..f69891a
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0113-mtk-hostapd-do-not-consider-ht-operation-update-for-.patch
@@ -0,0 +1,28 @@
+From 5cc02e29a2725dcffbee12fece9d946dd809108b Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Wed, 10 Jul 2024 16:13:24 +0800
+Subject: [PATCH 113/126] mtk: hostapd: do not consider ht operation update for
+ 6G BSS
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ src/ap/ieee802_11.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index 75ffb2a18..10b7587a0 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -4628,7 +4628,8 @@ static int ieee80211_ml_process_link(struct hostapd_data *hapd,
+ }
+ hapd->sta_aid[(sta->aid - 1) / 32] |= BIT((sta->aid - 1) % 32);
+ sta->listen_interval = origin_sta->listen_interval;
+- if (update_ht_state(hapd, sta) > 0)
++ if (!is_6ghz_op_class(hapd->iconf->op_class) &&
++ update_ht_state(hapd, sta) > 0)
+ ieee802_11_update_beacons(hapd->iface);
+ }
+
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0114-mtk-hostapd-Add-bandwidth-indication-IE.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0114-mtk-hostapd-Add-bandwidth-indication-IE.patch
new file mode 100644
index 0000000..473d91f
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0114-mtk-hostapd-Add-bandwidth-indication-IE.patch
@@ -0,0 +1,485 @@
+From fd208c32b7e95c3aafce8f89917d4a961713fa75 Mon Sep 17 00:00:00 2001
+From: Allen Ye <allen.ye@mediatek.com>
+Date: Tue, 2 Jul 2024 10:38:49 +0800
+Subject: [PATCH 114/126] mtk: hostapd: Add bandwidth indication IE
+
+Move punct_bitmap from csa_settings to hostapd_freq_params for
+filling bandwidth indication IE while channel switch occurs.
+Handle bitmap change in hostapd_set_freq_params.
+
+Signed-off-by: Allen Ye <allen.ye@mediatek.com>
+---
+ hostapd/ctrl_iface.c | 18 +++---
+ src/ap/ctrl_iface_ap.c | 12 +---
+ src/ap/dfs.c | 1 -
+ src/ap/drv_callbacks.c | 1 -
+ src/ap/hostapd.c | 14 +---
+ src/ap/ieee802_11.c | 110 +++++++++++++++++++++++++++++---
+ src/ap/ieee802_11.h | 2 +
+ src/common/hw_features_common.c | 1 +
+ src/common/ieee802_11_defs.h | 30 +++++++++
+ src/drivers/driver.h | 10 ++-
+ src/drivers/driver_nl80211.c | 6 +-
+ 11 files changed, 156 insertions(+), 49 deletions(-)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index 337261f8f..c8456513e 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -2621,8 +2621,7 @@ static int hostapd_ctrl_register_frame(struct hostapd_data *hapd,
+
+
+ #ifdef NEED_AP_MLME
+-static int hostapd_ctrl_check_freq_params(struct hostapd_freq_params *params,
+- u16 punct_bitmap)
++static int hostapd_ctrl_check_freq_params(struct hostapd_freq_params *params)
+ {
+ u32 start_freq;
+
+@@ -2673,14 +2672,14 @@ static int hostapd_ctrl_check_freq_params(struct hostapd_freq_params *params,
+ if (params->center_freq2 || params->sec_channel_offset)
+ return -1;
+
+- if (punct_bitmap)
++ if (params->punct_bitmap)
+ return -1;
+ break;
+ case 40:
+ if (params->center_freq2 || !params->sec_channel_offset)
+ return -1;
+
+- if (punct_bitmap)
++ if (params->punct_bitmap)
+ return -1;
+
+ if (!params->center_freq1)
+@@ -2717,7 +2716,7 @@ static int hostapd_ctrl_check_freq_params(struct hostapd_freq_params *params,
+ return -1;
+ }
+
+- if (params->center_freq2 && punct_bitmap)
++ if (params->center_freq2 && params->punct_bitmap)
+ return -1;
+
+ /* Adjacent and overlapped are not allowed for 80+80 */
+@@ -2784,7 +2783,7 @@ static int hostapd_ctrl_check_freq_params(struct hostapd_freq_params *params,
+ return -1;
+ }
+
+- if (!punct_bitmap)
++ if (!params->punct_bitmap)
+ return 0;
+
+ if (!params->eht_enabled) {
+@@ -2802,7 +2801,7 @@ static int hostapd_ctrl_check_freq_params(struct hostapd_freq_params *params,
+ start_freq = params->center_freq1 - (params->bandwidth / 2);
+ if (!is_punct_bitmap_valid(params->bandwidth,
+ (params->freq - start_freq) / 20,
+- punct_bitmap)) {
++ params->punct_bitmap)) {
+ wpa_printf(MSG_ERROR, "Invalid preamble puncturing bitmap");
+ return -1;
+ }
+@@ -2843,8 +2842,7 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+ return -1;
+ }
+
+- ret = hostapd_ctrl_check_freq_params(&settings.freq_params,
+- settings.punct_bitmap);
++ ret = hostapd_ctrl_check_freq_params(&settings.freq_params);
+ if (ret) {
+ wpa_printf(MSG_INFO,
+ "chanswitch: invalid frequency settings provided");
+@@ -2917,7 +2915,7 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+
+ #ifdef CONFIG_IEEE80211BE
+ hapd = iface->bss[0];
+- if (hapd->iconf->punct_bitmap != settings.punct_bitmap &&
++ if (hapd->iconf->punct_bitmap != settings.freq_params.punct_bitmap &&
+ hapd->iconf->pp_mode != PP_USR_MODE) {
+ hapd->iconf->pp_mode = PP_USR_MODE;
+ ret = hostapd_drv_pp_mode_set(hapd);
+diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
+index b0ee00b90..e1722620d 100644
+--- a/src/ap/ctrl_iface_ap.c
++++ b/src/ap/ctrl_iface_ap.c
+@@ -1125,20 +1125,11 @@ int hostapd_parse_csa_settings(const char *pos,
+ } \
+ } while (0)
+
+-#define SET_CSA_SETTING_EXT(str) \
+- do { \
+- const char *pos2 = os_strstr(pos, " " #str "="); \
+- if (pos2) { \
+- pos2 += sizeof(" " #str "=") - 1; \
+- settings->str = atoi(pos2); \
+- } \
+- } while (0)
+-
+ SET_CSA_SETTING(center_freq1);
+ SET_CSA_SETTING(center_freq2);
+ SET_CSA_SETTING(bandwidth);
+ SET_CSA_SETTING(sec_channel_offset);
+- SET_CSA_SETTING_EXT(punct_bitmap);
++ SET_CSA_SETTING(punct_bitmap);
+ settings->freq_params.ht_enabled = !!os_strstr(pos, " ht");
+ settings->freq_params.vht_enabled = !!os_strstr(pos, " vht");
+ settings->freq_params.he_enabled = !!os_strstr(pos, " he");
+@@ -1146,7 +1137,6 @@ int hostapd_parse_csa_settings(const char *pos,
+ settings->freq_params.radar_background = !!os_strstr(pos, " skip_cac");
+ settings->block_tx = !!os_strstr(pos, " blocktx");
+ #undef SET_CSA_SETTING
+-#undef SET_CSA_SETTING_EXT
+
+ return 0;
+ }
+diff --git a/src/ap/dfs.c b/src/ap/dfs.c
+index 5e9a2a4ce..5a3112d40 100644
+--- a/src/ap/dfs.c
++++ b/src/ap/dfs.c
+@@ -1081,7 +1081,6 @@ static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface,
+ os_memset(&csa_settings, 0, sizeof(csa_settings));
+ csa_settings.cs_count = 5;
+ csa_settings.block_tx = 1;
+- csa_settings.punct_bitmap = hostapd_get_punct_bitmap(iface->bss[0]);
+ csa_settings.link_id = -1;
+ #ifdef CONFIG_IEEE80211BE
+ if (iface->bss[0]->conf->mld_ap)
+diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
+index 420d156c8..96b8e856e 100644
+--- a/src/ap/drv_callbacks.c
++++ b/src/ap/drv_callbacks.c
+@@ -2481,7 +2481,6 @@ static void hostapd_event_pp_bitmap_update(struct hostapd_data *hapd,
+ os_memset(&csa_settings, 0, sizeof(csa_settings));
+ csa_settings.cs_count = 5;
+ csa_settings.block_tx = 0;
+- csa_settings.punct_bitmap = ch_switch->punct_bitmap;
+ csa_settings.link_id = ch_switch->link_id;
+
+ err = hostapd_set_freq_params(&csa_settings.freq_params,
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index 257849536..73378053b 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -4487,6 +4487,8 @@ static int hostapd_change_config_freq(struct hostapd_data *hapd,
+ hostapd_set_oper_centr_freq_seg0_idx(conf, seg0);
+ hostapd_set_oper_centr_freq_seg1_idx(conf, seg1);
+
++ conf->punct_bitmap = params->punct_bitmap;
++
+ /* TODO: maybe call here hostapd_config_check here? */
+
+ return 0;
+@@ -4499,9 +4501,6 @@ static int hostapd_fill_csa_settings(struct hostapd_data *hapd,
+ struct hostapd_iface *iface = hapd->iface;
+ struct hostapd_freq_params old_freq;
+ int ret;
+-#ifdef CONFIG_IEEE80211BE
+- u16 old_punct_bitmap;
+-#endif /* CONFIG_IEEE80211BE */
+ u8 chan, bandwidth;
+
+ os_memset(&old_freq, 0, sizeof(old_freq));
+@@ -4550,19 +4549,11 @@ static int hostapd_fill_csa_settings(struct hostapd_data *hapd,
+ if (ret)
+ return ret;
+
+-#ifdef CONFIG_IEEE80211BE
+- old_punct_bitmap = iface->conf->punct_bitmap;
+- iface->conf->punct_bitmap = settings->punct_bitmap;
+-#endif /* CONFIG_IEEE80211BE */
+-
+ /* Another CU in the new channel due to OP element modification */
+ ieee802_11_set_bss_critical_update(hapd, BSS_CRIT_UPDATE_EVENT_EHT_OPERATION);
+ ret = hostapd_build_beacon_data(hapd, &settings->beacon_after);
+
+ /* change back the configuration */
+-#ifdef CONFIG_IEEE80211BE
+- iface->conf->punct_bitmap = old_punct_bitmap;
+-#endif /* CONFIG_IEEE80211BE */
+ hostapd_change_config_freq(iface->bss[0], iface->conf,
+ &old_freq, NULL);
+
+@@ -4739,7 +4730,6 @@ int hostapd_update_aff_link_beacon(struct hostapd_data *hapd, u8 cs_count)
+ settings.link_id = cs_link_id;
+ settings.freq_params.link_id = link_id;
+ settings.cs_count = cs_count;
+- settings.punct_bitmap = conf->punct_bitmap;
+ ret = hostapd_drv_switch_channel(h, &settings);
+ free_beacon_data(&settings.beacon_csa);
+ free_beacon_data(&settings.beacon_after);
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index 10b7587a0..93bd8255c 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -7368,10 +7368,95 @@ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
+ tx_pwr);
+ }
+
++#define DISABLED_SUBCHANNEL_BITMAP_BYTES_SIZE 2
++u8 *hostapd_eid_bw_indication(struct hostapd_data *hapd, u8 *eid, u8 ccfs0, u8 ccfs1)
++{
++ u8 *pos = eid, *length_pos;
++ struct ieee80211_bw_ind_element *bw_ind_elem;
++ int bw_ind_status = false;
++ size_t fixed_eid_len;
++
++ if (hapd->cs_freq_params.bandwidth > 160 ||
++ hapd->cs_freq_params.punct_bitmap)
++ bw_ind_status = true;
++
++ if (!bw_ind_status)
++ return eid;
++
++ if (!hapd->cs_freq_params.channel || !hapd->cs_freq_params.eht_enabled)
++ return eid;
++
++ *pos++ = WLAN_EID_EXTENSION;
++ length_pos = pos++;
++ *pos++ = WLAN_EID_EXT_BW_IND;
++
++ fixed_eid_len = (sizeof(struct ieee80211_bw_ind_element) -
++ DISABLED_SUBCHANNEL_BITMAP_BYTES_SIZE);
++
++ bw_ind_elem = (struct ieee80211_bw_ind_element *) pos;
++ os_memset(bw_ind_elem, 0, sizeof(struct ieee80211_bw_ind_element));
++
++ if (hapd->cs_freq_params.punct_bitmap) {
++ bw_ind_elem->bw_ind_params |=
++ BW_IND_PARAMETER_DISABLED_SUBCHAN_BITMAP_PRESENT;
++ bw_ind_elem->bw_ind_info.disabled_chan_bitmap =
++ host_to_le16(hapd->cs_freq_params.punct_bitmap);
++ pos += DISABLED_SUBCHANNEL_BITMAP_BYTES_SIZE;
++ } else {
++ bw_ind_elem->bw_ind_params &=
++ ~BW_IND_PARAMETER_DISABLED_SUBCHAN_BITMAP_PRESENT;
++ }
++
++ switch (hapd->cs_freq_params.bandwidth) {
++ case 320:
++ bw_ind_elem->bw_ind_info.control |=
++ BW_IND_CHANNEL_WIDTH_320MHZ;
++ ccfs1 = ccfs0;
++ if (hapd->cs_freq_params.channel < ccfs0)
++ ccfs0 -= 16;
++ else
++ ccfs0 += 16;
++ break;
++ case 160:
++ bw_ind_elem->bw_ind_info.control |=
++ BW_IND_CHANNEL_WIDTH_160MHZ;
++ ccfs1 = ccfs0;
++ if (hapd->cs_freq_params.channel < ccfs0)
++ ccfs0 -= 8;
++ else
++ ccfs0 += 8;
++ break;
++ case 80:
++ bw_ind_elem->bw_ind_info.control |=
++ BW_IND_CHANNEL_WIDTH_80MHZ;
++ break;
++ case 40:
++ if (hapd->cs_freq_params.sec_channel_offset == 1)
++ bw_ind_elem->bw_ind_info.control |=
++ BW_IND_CHANNEL_WIDTH_40MHZ;
++ else
++ bw_ind_elem->bw_ind_info.control |=
++ BW_IND_CHANNEL_WIDTH_20MHZ;
++ break;
++ default:
++ bw_ind_elem->bw_ind_info.control |=
++ BW_IND_CHANNEL_WIDTH_20MHZ;
++ break;
++ }
++
++ bw_ind_elem->bw_ind_info.ccfs0 = ccfs0;
++ bw_ind_elem->bw_ind_info.ccfs1 = ccfs1;
++
++ pos += fixed_eid_len;
++ *length_pos = pos - (eid + 2);
++
++ return pos;
++}
++
+
+ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid)
+ {
+- u8 bw, chan1 = 0, chan2 = 0;
++ u8 bw, chan1 = 0, chan2 = 0, ccfs0, ccfs1, *pos = eid, *length_pos;
+ int freq1;
+
+ if (!hapd->cs_freq_params.channel ||
+@@ -7412,11 +7497,14 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid)
+ &chan2) != HOSTAPD_MODE_IEEE80211A)
+ return eid;
+
+- *eid++ = WLAN_EID_CHANNEL_SWITCH_WRAPPER;
+- *eid++ = 5; /* Length of Channel Switch Wrapper */
+- *eid++ = WLAN_EID_WIDE_BW_CHSWITCH;
+- *eid++ = 3; /* Length of Wide Bandwidth Channel Switch element */
+- *eid++ = bw; /* New Channel Width */
++ *pos++ = WLAN_EID_CHANNEL_SWITCH_WRAPPER;
++ length_pos = pos++; /* Length of Channel Switch Wrapper */
++ *pos++ = WLAN_EID_WIDE_BW_CHSWITCH;
++ *pos++ = 3; /* Length of Wide Bandwidth Channel Switch element */
++ *pos++ = bw; /* New Channel Width */
++
++ ccfs0 = chan1;
++ ccfs1 = chan2;
+ if (hapd->cs_freq_params.bandwidth == 160) {
+ /* Update the CCFS0 and CCFS1 values in the element based on
+ * IEEE P802.11-REVme/D4.0, Table 9-314 */
+@@ -7432,10 +7520,14 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid)
+ else
+ chan1 += 8;
+ }
+- *eid++ = chan1; /* New Channel Center Frequency Segment 0 */
+- *eid++ = chan2; /* New Channel Center Frequency Segment 1 */
++ *pos++ = chan1; /* New Channel Center Frequency Segment 0 */
++ *pos++ = chan2; /* New Channel Center Frequency Segment 1 */
+
+- return eid;
++#ifdef CONFIG_IEEE80211BE
++ pos = hostapd_eid_bw_indication(hapd, pos, ccfs0, ccfs1);
++#endif /* CONFIG_IEEE80211BE */
++ *length_pos = pos - (eid + 2);
++ return pos;
+ }
+
+
+diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h
+index 2d9adb910..40301bce9 100644
+--- a/src/ap/ieee802_11.h
++++ b/src/ap/ieee802_11.h
+@@ -64,6 +64,8 @@ u8 * hostapd_eid_vht_capabilities(struct hostapd_data *hapd, u8 *eid, u32 nsts);
+ u8 * hostapd_eid_vht_operation(struct hostapd_data *hapd, u8 *eid);
+ u8 * hostapd_eid_vendor_vht(struct hostapd_data *hapd, u8 *eid);
+ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid);
++u8 * hostapd_eid_bw_indication(struct hostapd_data *hapd, u8 *eid,
++ u8 ccfs0, u8 ccfs1);
+ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid);
+ u8 * hostapd_eid_he_capab(struct hostapd_data *hapd, u8 *eid,
+ enum ieee80211_op_mode opmode);
+diff --git a/src/common/hw_features_common.c b/src/common/hw_features_common.c
+index 8bd6e994d..99106c277 100644
+--- a/src/common/hw_features_common.c
++++ b/src/common/hw_features_common.c
+@@ -481,6 +481,7 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
+ data->sec_channel_offset = sec_channel_offset;
+ data->center_freq1 = freq + sec_channel_offset * 10;
+ data->center_freq2 = 0;
++ data->punct_bitmap = punct_bitmap;
+ if (oper_chwidth == CONF_OPER_CHWIDTH_80MHZ)
+ data->bandwidth = 80;
+ else if (oper_chwidth == CONF_OPER_CHWIDTH_160MHZ ||
+diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
+index fb481b8b2..d93fa6660 100644
+--- a/src/common/ieee802_11_defs.h
++++ b/src/common/ieee802_11_defs.h
+@@ -525,6 +525,7 @@
+ #define WLAN_EID_EXT_MULTI_LINK_TRAFFIC_INDICATION 110
+ #define WLAN_EID_EXT_QOS_CHARACTERISTICS 113
+ #define WLAN_EID_EXT_AKM_SUITE_SELECTOR 114
++#define WLAN_EID_EXT_BW_IND 135
+
+ /* Extended Capabilities field */
+ #define WLAN_EXT_CAPAB_20_40_COEX 0
+@@ -3088,6 +3089,35 @@ enum dscp_policy_request_type {
+ #define WFA_CAPA_QM_UNSOLIC_DSCP BIT(1)
+ #define WFA_CAPA_QM_NON_EHT_SCS_TRAFFIC_DESC BIT(2)
+
++/* IEEE P802.11be/D3.0, 9.4.2.319 - Bandwidth Indication element */
++
++/* Figure 9-1002ba: Bandwidth Indication Parameters field subfields */
++#define BW_IND_PARAMETER_RESERVED BIT(0)
++#define BW_IND_PARAMETER_DISABLED_SUBCHAN_BITMAP_PRESENT BIT(1)
++
++/* Table 9-467: Control subfield: Channel Width subfield; */
++#define BW_IND_CHANNEL_WIDTH_20MHZ 0
++#define BW_IND_CHANNEL_WIDTH_40MHZ 1
++#define BW_IND_CHANNEL_WIDTH_80MHZ 2
++#define BW_IND_CHANNEL_WIDTH_160MHZ 3
++#define BW_IND_CHANNEL_WIDTH_320MHZ 4
++
++/* Figure 9-1002c: Bandwidth Indication information
++ * field format similar to EHT Operation Information field format
++ */
++struct ieee80211_bw_ind_info {
++ u8 control; /* B0..B2: Channel Width */
++ u8 ccfs0;
++ u8 ccfs1;
++ le16 disabled_chan_bitmap; /* 0 or 2 octets */
++} STRUCT_PACKED;
++
++/* Figure 9-1002ba—Bandwidth Indication element format */
++struct ieee80211_bw_ind_element {
++ u8 bw_ind_params; /* Bandwidth Indication Parameters */
++ struct ieee80211_bw_ind_info bw_ind_info; /* 3 or 5 octets */
++} STRUCT_PACKED;
++
+ struct ieee80211_neighbor_ap_info {
+ u8 tbtt_info_hdr;
+ u8 tbtt_info_len;
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index 5e65d9e0b..498eff91f 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -876,6 +876,14 @@ struct hostapd_freq_params {
+ */
+ bool eht_enabled;
+
++ /**
++ * punct_bitmap - puncturing bitmap
++ * Each bit corresponds to a 20 MHz subchannel, lowest bit for the
++ * channel with the lowest frequency. Bit set to 1 indicates that the
++ * subchannel is punctured, otherwise active.
++ */
++ u16 punct_bitmap;
++
+ /**
+ * link_id: If >=0 indicates the link of the AP MLD to configure
+ */
+@@ -2750,7 +2758,6 @@ struct beacon_data {
+ * @beacon_after: Next beacon/probe resp/asooc resp info
+ * @counter_offset_beacon: Offset to the count field in beacon's tail
+ * @counter_offset_presp: Offset to the count field in probe resp.
+- * @punct_bitmap - Preamble puncturing bitmap
+ * @link_id: Link ID to determine the link for MLD; -1 for non-MLD
+ * @ubpr: Unsolicited broadcast Probe Response frame data
+ */
+@@ -2766,7 +2773,6 @@ struct csa_settings {
+ u16 counter_offset_presp[2];
+ u16 counter_offset_sta_prof[MAX_NUM_MLD_LINKS][2];
+
+- u16 punct_bitmap;
+ int link_id;
+
+ struct unsol_bcast_probe_resp ubpr;
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index 5d97317f7..639c5e7e1 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -11467,7 +11467,7 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings)
+ settings->freq_params.bandwidth,
+ settings->freq_params.center_freq1,
+ settings->freq_params.center_freq2,
+- settings->punct_bitmap,
++ settings->freq_params.punct_bitmap,
+ settings->freq_params.link_id,
+ settings->freq_params.ht_enabled ? " ht" : "",
+ settings->freq_params.vht_enabled ? " vht" : "",
+@@ -11545,9 +11545,9 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings)
+ (ret = nl80211_put_freq_params(msg, &settings->freq_params)) ||
+ (settings->block_tx &&
+ nla_put_flag(msg, NL80211_ATTR_CH_SWITCH_BLOCK_TX)) ||
+- (settings->punct_bitmap &&
++ (settings->freq_params.punct_bitmap &&
+ nla_put_u32(msg, NL80211_ATTR_PUNCT_BITMAP,
+- settings->punct_bitmap)) ||
++ settings->freq_params.punct_bitmap)) ||
+ (settings->freq_params.link_id != NL80211_DRV_LINK_ID_NA &&
+ nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, settings->freq_params.link_id)))
+ goto error;
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0115-mtk-hostapd-fix-Multiple-MLDs-to-use-the-conf-s-own_.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0115-mtk-hostapd-fix-Multiple-MLDs-to-use-the-conf-s-own_.patch
new file mode 100644
index 0000000..daba900
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0115-mtk-hostapd-fix-Multiple-MLDs-to-use-the-conf-s-own_.patch
@@ -0,0 +1,39 @@
+From 377b708eb38c5a7056eaca0cd54994a226f940b1 Mon Sep 17 00:00:00 2001
+From: Bo Jiao <Bo.Jiao@mediatek.com>
+Date: Wed, 10 Jul 2024 14:49:43 +0800
+Subject: [PATCH 115/126] mtk: hostapd: fix Multiple MLDs to use the conf's
+ own_addr/mld_addr.
+
+Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
+---
+ src/ap/hostapd.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index 73378053b..a89628fe7 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -1506,6 +1506,9 @@ int hostapd_setup_bss(struct hostapd_data *hapd, int first, bool start_beacon)
+ hapd->mld_link_id, hapd->conf->iface);
+ goto setup_mld;
+ }
++
++ if (addr && !is_zero_ether_addr(hapd->conf->mld_addr))
++ os_memcpy(addr, hapd->conf->mld_addr, ETH_ALEN);
+ }
+ #endif /* CONFIG_IEEE80211BE */
+
+@@ -1531,6 +1534,10 @@ int hostapd_setup_bss(struct hostapd_data *hapd, int first, bool start_beacon)
+ hapd->mld_link_id, hapd->conf->iface);
+ os_memcpy(hapd->mld->mld_addr, hapd->own_addr,
+ ETH_ALEN);
++
++ if (!is_zero_ether_addr(conf->bssid))
++ os_memcpy(hapd->own_addr, conf->bssid, ETH_ALEN);
++
+ hostapd_mld_add_link(hapd);
+ }
+ #endif /* CONFIG_IEEE80211BE */
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0116-mtk-hostapd-distribute-the-mgmt-rx-frame-to-bss-with.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0116-mtk-hostapd-distribute-the-mgmt-rx-frame-to-bss-with.patch
new file mode 100644
index 0000000..0d3a4f1
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0116-mtk-hostapd-distribute-the-mgmt-rx-frame-to-bss-with.patch
@@ -0,0 +1,31 @@
+From d66477d21526bd4aa8ba9cdc3f8223df15e64386 Mon Sep 17 00:00:00 2001
+From: Bo Jiao <Bo.Jiao@mediatek.com>
+Date: Wed, 10 Jul 2024 15:00:50 +0800
+Subject: [PATCH 116/126] mtk: hostapd: distribute the mgmt rx frame to bss
+ with same freq.
+
+there is no need to distribute the mgmt rx frame to all bss, we use
+mgmt->freq to filter.
+
+Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
+---
+ src/ap/drv_callbacks.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
+index 96b8e856e..7ae26ab7c 100644
+--- a/src/ap/drv_callbacks.c
++++ b/src/ap/drv_callbacks.c
+@@ -1904,6 +1904,9 @@ static int hostapd_mgmt_rx(struct hostapd_data *hapd, struct rx_mgmt *rx_mgmt)
+ return 0;
+ }
+
++ if (rx_mgmt->freq != 0 && rx_mgmt->freq != iface->freq)
++ return 0;
++
+ os_memset(&fi, 0, sizeof(fi));
+ fi.freq = rx_mgmt->freq;
+ fi.datarate = rx_mgmt->datarate;
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0117-mtk-hostapd-handle-5G-link-setup-after-DFS-bootup-CA.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0117-mtk-hostapd-handle-5G-link-setup-after-DFS-bootup-CA.patch
new file mode 100644
index 0000000..edfd4ca
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0117-mtk-hostapd-handle-5G-link-setup-after-DFS-bootup-CA.patch
@@ -0,0 +1,189 @@
+From 4bae58d6ded6d2b08975054e1c4097dcedb6b333 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Fri, 28 Jun 2024 14:06:20 +0800
+Subject: [PATCH 117/126] mtk: hostapd: handle 5G link setup after DFS bootup
+ CAC as link reconfig
+
+Consider the setup of 5G link after bootup CAC as a link adding
+process via link reconfiguration.
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ src/ap/dfs.c | 38 +++++++++++++++++++++++++++++++++++---
+ src/ap/hostapd.c | 2 ++
+ src/ap/hostapd.h | 1 +
+ src/ap/ieee802_11.c | 7 +++++--
+ src/ap/ieee802_11_eht.c | 13 +++++++++++--
+ 5 files changed, 54 insertions(+), 7 deletions(-)
+
+diff --git a/src/ap/dfs.c b/src/ap/dfs.c
+index 5a3112d40..31e37a2ab 100644
+--- a/src/ap/dfs.c
++++ b/src/ap/dfs.c
+@@ -1034,6 +1034,22 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
+ return -1;
+ }
+
++ /* Remove the CAC link from the active links of AP MLD temporarily to avoid
++ * it being reported in the RNR of the affiliated APs of the same AP MLD
++ */
++ if (iface->cac_started) {
++ int i;
++
++ for (i = 0; i < iface->num_bss; i++) {
++ struct hostapd_data *hapd = iface->bss[i];
++
++ if (!hapd->conf->mld_ap || !hapd->mld)
++ continue;
++
++ hapd->mld->active_links &= ~BIT(hapd->mld_link_id);
++ }
++ }
++
+ return 0;
+ }
+
+@@ -1310,6 +1326,8 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
+ int ht_enabled, int chan_offset, int chan_width,
+ int cf1, int cf2)
+ {
++ int i;
++
+ wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_CAC_COMPLETED
+ "success=%d freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d radar_detected=%d",
+ success, freq, ht_enabled, chan_offset, chan_width, cf1, cf2,
+@@ -1364,10 +1382,26 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
+ * sure the configured channel is available because this
+ * CAC completion event could have been propagated from
+ * another radio.
++ * For a AP MLD, the setup of a DFS link after bootup CAC is
++ * considered as link adding process via link reconfiguration.
+ */
+ if (iface->state != HAPD_IFACE_ENABLED &&
+- hostapd_is_dfs_chan_available(iface))
++ hostapd_is_dfs_chan_available(iface)) {
++ for (i = 0; i < iface->num_bss; i++) {
++ struct hostapd_data *h, *hapd = iface->bss[i];
++
++ if (!hapd->conf->mld_ap || !hapd->mld)
++ continue;
++
++ hapd->mld->active_links |= BIT(hapd->mld_link_id);
++ for_each_mld_link(h, hapd)
++ h->mld->link_reconf_in_progress |=
++ BIT(h->mld_link_id);
++ hapd->mld->link_reconf_in_progress &=
++ ~BIT(hapd->mld_link_id);
++ }
+ hostapd_setup_interface_complete(iface, 0);
++ }
+
+ iface->cac_started = 0;
+
+@@ -1386,8 +1420,6 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
+ iface->radar_background.expand_ch = 0;
+ hostapd_dfs_update_background_chain(iface);
+ } else if (iface->state == HAPD_IFACE_ENABLED) {
+- int i;
+-
+ iface->cac_started = 0;
+ /* Clear all CSA flags once channel switch to DFS channel fails */
+ for (i = 0; i < iface->num_bss; i++)
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index a89628fe7..7518a8b53 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -5109,6 +5109,7 @@ int hostapd_mld_add_link(struct hostapd_data *hapd)
+
+ dl_list_add_tail(&mld->links, &hapd->link);
+ mld->num_links++;
++ mld->active_links |= BIT(hapd->mld_link_id);
+
+ wpa_printf(MSG_DEBUG, "AP MLD %s: Link ID %d added. num_links: %d",
+ mld->name, hapd->mld_link_id, mld->num_links);
+@@ -5137,6 +5138,7 @@ int hostapd_mld_remove_link(struct hostapd_data *hapd)
+
+ dl_list_del(&hapd->link);
+ mld->num_links--;
++ mld->active_links &= ~BIT(hapd->mld_link_id);
+
+ wpa_printf(MSG_DEBUG, "AP MLD %s: Link ID %d removed. num_links: %d",
+ mld->name, hapd->mld_link_id, mld->num_links);
+diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
+index 52875cca1..668f1c44d 100644
+--- a/src/ap/hostapd.h
++++ b/src/ap/hostapd.h
+@@ -550,6 +550,7 @@ struct hostapd_mld {
+ u8 refcount;
+ bool started;
+ u16 link_reconf_in_progress;
++ u16 active_links;
+
+ struct hostapd_data *fbss;
+ struct dl_list links; /* List head of all affiliated links */
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index 93bd8255c..2861c09d7 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -989,6 +989,8 @@ void sae_accept_sta(struct hostapd_data *hapd, struct sta_info *sta)
+ sta->sae->peer_commit_scalar = NULL;
+ if (hostapd_is_mld_ap(hapd)) {
+ for_each_mld_link(link, hapd) {
++ if (!(hapd->mld->active_links & BIT(link->mld_link_id)))
++ continue;
+ wpa_auth_pmksa_add_sae(link->wpa_auth, sta->addr,
+ sta->sae->pmk, sta->sae->pmk_len,
+ sta->sae->pmkid, sta->sae->akmp);
+@@ -8108,7 +8110,7 @@ u8 * hostapd_eid_rnr_mlo(struct hostapd_data *hapd, u32 type,
+ struct hostapd_iface *iface;
+ size_t i;
+
+- if (!hapd->iface || !hapd->iface->interfaces || !hapd->conf->mld_ap)
++ if (!hapd->iface || !hapd->iface->interfaces || !hapd->conf->mld_ap || !hapd->mld)
+ return eid;
+
+ /* TODO: Allow for FILS/Action as well */
+@@ -8119,7 +8121,8 @@ u8 * hostapd_eid_rnr_mlo(struct hostapd_data *hapd, u32 type,
+ iface = hapd->iface->interfaces->iface[i];
+
+ if (!iface || iface == hapd->iface ||
+- hapd->iface->freq == iface->freq)
++ hapd->iface->freq == iface->freq ||
++ !(hapd->mld->active_links & BIT(hapd->mld_link_id)))
+ continue;
+
+ eid = hostapd_eid_rnr_iface(iface->bss[0], hapd, eid,
+diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
+index 63713bc39..cad0d8437 100644
+--- a/src/ap/ieee802_11_eht.c
++++ b/src/ap/ieee802_11_eht.c
+@@ -514,7 +514,13 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd,
+ u8 link_id;
+ u8 common_info_len;
+ u16 mld_cap;
+- u8 max_simul_links, active_links;
++ u8 max_simul_links, active_links = 0;
++
++ if (hapd->mld && !(hapd->mld->active_links & BIT(hapd->mld_link_id))) {
++ wpa_printf(MSG_ERROR, "MLD: Current link %d is not active for %s",
++ hapd->mld_link_id, hapd->mld->name);
++ return pos;
++ }
+
+ /*
+ * As the Multi-Link element can exceed the size of 255 bytes need to
+@@ -573,7 +579,10 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd,
+
+ mld_cap = hapd->iface->mld_mld_capa;
+ max_simul_links = mld_cap & EHT_ML_MLD_CAPA_MAX_NUM_SIM_LINKS_MASK;
+- active_links = hapd->mld->num_links - 1;
++ for (link_id = 0; link_id < MAX_NUM_MLD_LINKS; link_id++)
++ if (hapd->mld_link_id != link_id &&
++ (hapd->mld->active_links & BIT(link_id)))
++ active_links++;
+
+ if (active_links > max_simul_links) {
+ wpa_printf(MSG_ERROR,
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0118-mtk-hostapd-support-MLD-AP-affiliated-link-removal.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0118-mtk-hostapd-support-MLD-AP-affiliated-link-removal.patch
new file mode 100644
index 0000000..e459fed
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0118-mtk-hostapd-support-MLD-AP-affiliated-link-removal.patch
@@ -0,0 +1,434 @@
+From 2f6ed87f722be77d39188f84158b27945c6f41ef Mon Sep 17 00:00:00 2001
+From: Shayne Chen <shayne.chen@mediatek.com>
+Date: Mon, 29 Apr 2024 12:04:52 +0800
+Subject: [PATCH 118/126] mtk: hostapd: support MLD AP affiliated link removal
+
+Support ap link removal of MLD reconfiguration. Main changes include:
+- support to trigger it from hostapd_cli, with the following command:
+ hostapd_cli -i ap-mld-1 -l <link_id> link_remove count=10
+
+- handle NL80211_CMD_LINKS_REMOVED event
+- modify some parts that will teardown whole VIF or STA when removing
+ a link
+- handle case that the setup link sta is removed
+
+Note that currently the code only supports to remove one link at one time.
+
+Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
+---
+ hostapd/ctrl_iface.c | 26 ++++++-
+ hostapd/hostapd_cli.c | 8 +++
+ src/ap/ap_drv_ops.c | 7 ++
+ src/ap/beacon.c | 4 ++
+ src/ap/drv_callbacks.c | 3 +
+ src/ap/hostapd.c | 110 +++++++++++++++++++++++------
+ src/ap/hostapd.h | 2 +
+ src/ap/wpa_auth.c | 6 ++
+ src/ap/wpa_auth.h | 3 +
+ src/drivers/driver.h | 7 ++
+ src/drivers/driver_nl80211.c | 5 ++
+ src/drivers/driver_nl80211_event.c | 34 ++++++++-
+ 12 files changed, 188 insertions(+), 27 deletions(-)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index c8456513e..6db9fa617 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -3903,11 +3903,31 @@ static int hostapd_ctrl_iface_disable_mld(struct hostapd_iface *iface)
+ static int hostapd_ctrl_iface_link_remove(struct hostapd_data *hapd, char *cmd,
+ char *buf, size_t buflen)
+ {
++ char *token, *context = NULL;
++ u32 count = 0;
+ int ret;
+- u32 count = atoi(cmd);
+
+- if (!count)
+- count = 1;
++ while ((token = str_token(cmd, " ", &context))) {
++ if (os_strncmp(token, "count=", 6) == 0) {
++ count = atoi(token + 6);
++ continue;
++ }
++
++ wpa_printf(MSG_ERROR, "CTRL: Invalid LINK_REMOVE parameter: %s",
++ token);
++ return -1;
++ }
++
++ if (!count) {
++ wpa_printf(MSG_ERROR, "Invalid ap removal count");
++ return -1;
++ }
++
++ /* limit total countdown time to be multiple of second */
++ if ((hapd->iconf->beacon_int * count) % 1000) {
++ wpa_printf(MSG_ERROR, "Total countdown time should be multiple of second");
++ return -1;
++ }
+
+ ret = hostapd_link_remove(hapd, count);
+ if (ret == 0) {
+diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
+index 12ee0a18f..9dcc0d74b 100644
+--- a/hostapd/hostapd_cli.c
++++ b/hostapd/hostapd_cli.c
+@@ -1785,6 +1785,12 @@ static int hostapd_cli_cmd_link_add(struct wpa_ctrl *ctrl, int argc,
+ return hostapd_cli_cmd(ctrl, "LINK_ADD", 1, argc, argv);
+ }
+
++static int hostapd_cli_cmd_link_remove(struct wpa_ctrl *ctrl, int argc,
++ char *argv[])
++{
++ return hostapd_cli_cmd(ctrl, "LINK_REMOVE", 1, argc, argv);
++}
++
+ struct hostapd_cli_cmd {
+ const char *cmd;
+ int (*handler)(struct wpa_ctrl *ctrl, int argc, char *argv[]);
+@@ -2047,6 +2053,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+ " = <ac> [cwmin=] [cwmax=] [aifs=] [txop_limit=]"},
+ { "link_add", hostapd_cli_cmd_link_add, NULL,
+ " = Add a new link to a MLD AP"},
++ { "link_remove", hostapd_cli_cmd_link_remove, NULL,
++ " [count=<count>] = Remove affiliated link of a MLD AP"},
+ { NULL, NULL, NULL, NULL }
+ };
+
+diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
+index f9ec9a689..8b6aed0c7 100644
+--- a/src/ap/ap_drv_ops.c
++++ b/src/ap/ap_drv_ops.c
+@@ -332,6 +332,13 @@ int hostapd_set_sta_flags(struct hostapd_data *hapd, struct sta_info *sta)
+ return 0;
+ }
+
++ if (hapd->conf->mld_ap && hapd->mld->removed_links) {
++ wpa_printf(MSG_DEBUG,
++ "%s: Do not update station flags (" MACSTR ")",
++ " during ap link removal", __func__, MAC2STR(sta->addr));
++ return 0;
++ }
++
+ flags_or = total_flags & set_flags;
+ flags_and = total_flags | ~set_flags;
+ return hostapd_sta_set_flags(hapd, sta->addr, total_flags,
+diff --git a/src/ap/beacon.c b/src/ap/beacon.c
+index 8a9569549..5293ee4c1 100644
+--- a/src/ap/beacon.c
++++ b/src/ap/beacon.c
+@@ -2794,6 +2794,10 @@ static int __ieee802_11_set_beacon(struct hostapd_data *hapd)
+ if (hapd->conf->mld_ap && !hapd->mld->started && hapd->beacon_set_done)
+ return 0;
+
++ /* skip setting beacon during ap link removal */
++ if (hapd->conf->mld_ap && hapd->mld->removed_links)
++ return 0;
++
+ if (!hapd->drv_priv) {
+ wpa_printf(MSG_ERROR, "Interface is disabled");
+ return -1;
+diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
+index 7ae26ab7c..9deb87c3d 100644
+--- a/src/ap/drv_callbacks.c
++++ b/src/ap/drv_callbacks.c
+@@ -2919,6 +2919,9 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
+ hapd->conf->iface);
+ hostapd_event_color_change(hapd, true);
+ break;
++ case EVENT_LINK_RECONFIG:
++ hostapd_link_remove_cb(hapd, data->reconfig_info.removed_links);
++ break;
+ #endif /* CONFIG_IEEE80211AX */
+ default:
+ wpa_printf(MSG_DEBUG, "Unknown event %d", event);
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index 7518a8b53..e34bc1fa8 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -428,30 +428,74 @@ static int hostapd_broadcast_wep_set(struct hostapd_data *hapd)
+
+ #define TU_TO_USEC(_val) ((_val) * 1024)
+
+-static void hostapd_link_remove_timeout_handler(void *eloop_data,
+- void *user_ctx)
++static void hostapd_switch_sta_setup_link(struct hostapd_data *hapd)
+ {
+- struct hostapd_data *hapd = (struct hostapd_data *) eloop_data;
++ struct hostapd_data *p_hapd, *new_setup_hapd = NULL;
++ struct sta_info *cur, *sta;
++
++ /* use the current least link_id as new setup link */
++ for_each_mld_link(p_hapd, hapd) {
++ if (p_hapd == hapd)
++ continue;
++ if (!new_setup_hapd || p_hapd->mld_link_id < new_setup_hapd->mld_link_id)
++ new_setup_hapd = p_hapd;
++ }
+
+- if (hapd->eht_mld_link_removal_count == 0)
++ if (!new_setup_hapd)
+ return;
+- hapd->eht_mld_link_removal_count--;
+
+- wpa_printf(MSG_DEBUG, "MLD: Remove link_id=%u in %u beacons",
+- hapd->mld_link_id,
+- hapd->eht_mld_link_removal_count);
++ sta = hapd->sta_list;
++ while (sta) {
++ struct sta_info *new_setup_sta;
+
+- ieee802_11_set_beacon(hapd);
++ cur = sta;
++ sta = sta->next;
++ if (hostapd_sta_is_link_sta(hapd, cur))
++ continue;
+
+- if (!hapd->eht_mld_link_removal_count) {
+- hostapd_free_link_stas(hapd);
+- hostapd_disable_iface(hapd->iface);
+- return;
++ new_setup_sta = ap_get_sta(new_setup_hapd, cur->addr);
++ if (!new_setup_sta)
++ continue;
++
++ new_setup_sta->mld_assoc_link_id = new_setup_hapd->mld_link_id;
++ new_setup_sta->mld_assoc_sta = new_setup_sta;
++ switch_setup_wpa_auth(new_setup_sta->wpa_sm,
++ new_setup_hapd->wpa_auth);
++ new_setup_sta->flags = cur->flags;
++ cur->flags &= ~(WLAN_STA_AUTH | WLAN_STA_AUTHORIZED);
++
++ for_each_mld_link(p_hapd, hapd) {
++ struct sta_info *p_sta;
++
++ p_sta = ap_get_sta(p_hapd, new_setup_sta->addr);
++ if (!p_sta)
++ continue;
++
++ p_sta->mld_assoc_link_id = new_setup_hapd->mld_link_id;
++ p_sta->mld_assoc_sta = new_setup_sta;
++ }
++
++ wpa_printf(MSG_INFO, "Switch assoc link of station " MACSTR " from %u to %u",
++ MAC2STR(cur->addr), hapd->mld_link_id, new_setup_hapd->mld_link_id);
+ }
++}
+
+- eloop_register_timeout(0, TU_TO_USEC(hapd->iconf->beacon_int),
+- hostapd_link_remove_timeout_handler,
+- hapd, NULL);
++static void hostapd_link_remove_timeout_handler(void *eloop_data,
++ void *user_ctx)
++{
++ struct hostapd_data *hapd = (struct hostapd_data *) eloop_data;
++ struct hostapd_mld *mld = hapd->mld;
++ u8 link_id = hapd->mld_link_id;
++
++ if (!mld || !mld->removed_links)
++ return;
++
++ wpa_printf(MSG_DEBUG, "MLD: Remove link_id=%u", hapd->mld_link_id);
++
++ hostapd_switch_sta_setup_link(hapd);
++ hostapd_free_link_stas(hapd);
++ hostapd_disable_iface(hapd->iface);
++ mld->removed_links &= ~BIT(link_id);
+ }
+
+
+@@ -465,16 +509,34 @@ int hostapd_link_remove(struct hostapd_data *hapd, u32 count)
+ hapd->mld_link_id, count);
+
+ hapd->eht_mld_link_removal_count = count;
+- hapd->eht_mld_bss_param_change++;
+-
+- eloop_register_timeout(0, TU_TO_USEC(hapd->iconf->beacon_int),
+- hostapd_link_remove_timeout_handler,
+- hapd, NULL);
++ ieee802_11_set_bss_critical_update(hapd, BSS_CRIT_UPDATE_EVENT_RECONFIG);
+
+ ieee802_11_set_beacon(hapd);
++
++ hapd->eht_mld_link_removal_count = 0;
++ hapd->mld->removed_links |= BIT(hapd->mld_link_id);
+ return 0;
+ }
+
++
++void hostapd_link_remove_cb(struct hostapd_data *hapd, u16 removed_links)
++{
++ struct hostapd_data *link;
++
++ if (!hapd->conf->mld_ap)
++ return;
++
++ for_each_mld_link(link, hapd) {
++ if (!(BIT(link->mld_link_id) & removed_links))
++ continue;
++
++ link->eht_mld_bss_critical_update = 0;
++ eloop_register_timeout(0, 0,
++ hostapd_link_remove_timeout_handler,
++ link, NULL);
++ }
++}
++
+ #endif /* CONFIG_TESTING_OPTIONS */
+ #endif /* CONFIG_IEEE80211BE */
+
+@@ -848,7 +910,9 @@ static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason)
+ void hostapd_bss_deinit_no_free(struct hostapd_data *hapd)
+ {
+ hostapd_free_stas(hapd);
+- hostapd_flush_old_stations(hapd, WLAN_REASON_DEAUTH_LEAVING);
++ /* do not flush stations during ap link removal */
++ if (!hapd->conf->mld_ap || !hapd->mld->removed_links)
++ hostapd_flush_old_stations(hapd, WLAN_REASON_DEAUTH_LEAVING);
+ #ifdef CONFIG_WEP
+ hostapd_clear_wep(hapd);
+ #endif /* CONFIG_WEP */
+@@ -1334,7 +1398,7 @@ static int hostapd_start_beacon(struct hostapd_data *hapd,
+ }
+
+ if (flush_old_stations && !conf->start_disabled &&
+- conf->broadcast_deauth) {
++ conf->broadcast_deauth && (hapd->conf->mld_ap && !hapd->mld->started)) {
+ u8 addr[ETH_ALEN];
+
+ /* Should any previously associated STA not have noticed that
+diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
+index 668f1c44d..c6c286304 100644
+--- a/src/ap/hostapd.h
++++ b/src/ap/hostapd.h
+@@ -551,6 +551,7 @@ struct hostapd_mld {
+ bool started;
+ u16 link_reconf_in_progress;
+ u16 active_links;
++ u16 removed_links;
+
+ struct hostapd_data *fbss;
+ struct dl_list links; /* List head of all affiliated links */
+@@ -922,6 +923,7 @@ int hostapd_mbssid_get_bss_index(struct hostapd_data *hapd);
+ struct hostapd_data * hostapd_mld_get_link_bss(struct hostapd_data *hapd,
+ u8 link_id);
+ int hostapd_link_remove(struct hostapd_data *hapd, u32 count);
++void hostapd_link_remove_cb(struct hostapd_data *hapd, u16 removed_links);
+ bool hostapd_is_ml_partner(struct hostapd_data *hapd1,
+ struct hostapd_data *hapd2);
+ u8 hostapd_get_mld_id(struct hostapd_data *hapd);
+diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
+index 6cb5a4be7..8fb52b697 100644
+--- a/src/ap/wpa_auth.c
++++ b/src/ap/wpa_auth.c
+@@ -7428,3 +7428,9 @@ void wpa_auth_set_ml_info(struct wpa_state_machine *sm,
+ }
+ #endif /* CONFIG_IEEE80211BE */
+ }
++
++void switch_setup_wpa_auth(struct wpa_state_machine *sm,
++ struct wpa_authenticator *wpa_auth)
++{
++ sm->wpa_auth = wpa_auth;
++}
+diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h
+index b22c4199b..4cd46849a 100644
+--- a/src/ap/wpa_auth.h
++++ b/src/ap/wpa_auth.h
+@@ -681,4 +681,7 @@ void wpa_release_link_auth_ref(struct wpa_state_machine *sm,
+ sm->mld_links[link_id].wpa_auth && \
+ sm->wpa_auth != sm->mld_links[link_id].wpa_auth)
+
++void switch_setup_wpa_auth(struct wpa_state_machine *sm,
++ struct wpa_authenticator *wpa_auth);
++
+ #endif /* WPA_AUTH_H */
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index 498eff91f..eb2a48381 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -7062,6 +7062,13 @@ union wpa_event_data {
+ u8 valid_links;
+ struct t2lm_mapping t2lmap[MAX_NUM_MLD_LINKS];
+ } t2l_map_info;
++
++ /**
++ * struct reconfig_info - Data for EVENT_LINK_RECONFIG
++ */
++ struct reconfig_info {
++ u16 removed_links;
++ } reconfig_info;
+ };
+
+ /**
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index 639c5e7e1..1d334b75f 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -1117,6 +1117,11 @@ static void nl80211_put_wiphy_data_ap(struct i802_bss *bss)
+
+ if (w == NULL)
+ return;
++
++ /* do not clear wiphy data if there are still more than one links */
++ if (bss->valid_links && (bss->valid_links & (bss->valid_links - 1)))
++ return;
++
+ bss->wiphy_data = NULL;
+ dl_list_del(&bss->wiphy_list);
+
+diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
+index efdb8ef7f..24a4bf3cf 100644
+--- a/src/drivers/driver_nl80211_event.c
++++ b/src/drivers/driver_nl80211_event.c
+@@ -3930,6 +3930,38 @@ static void nl80211_obss_color_event(struct i802_bss *bss,
+
+ #endif /* CONFIG_IEEE80211AX */
+
++static void nl80211_links_removed(struct wpa_driver_nl80211_data *drv,
++ struct nlattr **tb)
++{
++ struct nlattr *link_attr, *link_data[NL80211_ATTR_MAX + 1];
++ static struct nla_policy link_policy[NL80211_ATTR_MAX + 1] = {
++ [NL80211_ATTR_MLO_LINK_ID] = { .type = NLA_U8 },
++ };
++ union wpa_event_data data = {};
++ int rem;
++
++ if (!tb[NL80211_ATTR_MLO_LINKS])
++ return;
++
++ nla_for_each_nested(link_attr, tb[NL80211_ATTR_MLO_LINKS], rem) {
++ u8 link_id;
++
++ if (nla_parse_nested(link_data, NL80211_ATTR_MAX,
++ link_attr, link_policy) != 0)
++ continue;
++
++ if (!link_data[NL80211_ATTR_MLO_LINK_ID])
++ continue;
++
++ link_id = nla_get_u8(link_data[NL80211_ATTR_MLO_LINK_ID]);
++ if (link_id >= MAX_NUM_MLD_LINKS)
++ continue;
++ data.reconfig_info.removed_links |= BIT(link_id);
++ }
++
++ wpa_supplicant_event(drv->ctx, EVENT_LINK_RECONFIG, &data);
++}
++
+
+ static void do_process_drv_event(struct i802_bss *bss, int cmd,
+ struct nlattr **tb)
+@@ -4195,7 +4227,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
+ break;
+ #endif /* CONFIG_IEEE80211AX */
+ case NL80211_CMD_LINKS_REMOVED:
+- wpa_supplicant_event(drv->ctx, EVENT_LINK_RECONFIG, NULL);
++ nl80211_links_removed(drv, tb);
+ break;
+ default:
+ wpa_dbg(drv->ctx, MSG_DEBUG, "nl80211: Ignored unknown event "
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0119-mtk-hostapd-add-A-TTLM-support.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0119-mtk-hostapd-add-A-TTLM-support.patch
new file mode 100644
index 0000000..a6bdd09
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0119-mtk-hostapd-add-A-TTLM-support.patch
@@ -0,0 +1,760 @@
+From 8aabcfee2bb77e19fc592c27f1121c5725ee665f Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Wed, 3 Jul 2024 15:39:53 +0800
+Subject: [PATCH 119/126] mtk: hostapd: add A-TTLM support
+
+Add a data structure for AP MLD's Advertised Tid-to-Link Mapping (A-TTLM).
+Since it is MLD-level, this commit also adds it into struct hostapd_mld.
+
+There should be 'curr_attlm' and 'new_attlm', which means 2 TTLMs can be
+advertised at the same time ('curr_attlm' is used currently while
+'new_attlm' is about to be used)
+However, since the FW only support 1 attlm now, there is currently only
+'new_attlm'.
+
+There are 3 A-TTLM events from the driver, and hostap should handle them
+accordingly
+1. A-TTLM started: link(s) sould start to advertise TTLM in the beacon.
+2. A-TTLM switch time expired: enabled link(s) keep advertising TTLM in
+ the beacon with switch time excluded, whiel disabled link(s) should
+ stop TX/RX, including beacon
+3. A-TTLM ended: all links stop advertising TTLM in the beacon, and
+ disabled link recover to TX/RX.
+
+This commit adds the support to set ATTLM, from hostapd_cli to driver.
+Setting an ATTLM requires 3 parameters
+1. disabled_links: disabled link ID bitmap
+2. switch_time: how much time it takes to start the A-TTLM (in ms)
+3. duration: how long the A-TTLM lasts (in ms)
+
+Below is a hostapd_cli example that requires an A-TTLM starts to disable
+link_id=1 after 5 seconds and last for 20 seconds:
+$ hostapd_cli -i ap-mld-1 set_attlm disabled_links=2 switch_time=5000
+duration=20000
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ hostapd/ctrl_iface.c | 66 +++++++++++++++++++++++++++++
+ hostapd/hostapd_cli.c | 8 ++++
+ src/ap/ap_drv_ops.c | 9 ++++
+ src/ap/ap_drv_ops.h | 1 +
+ src/ap/beacon.c | 4 ++
+ src/ap/drv_callbacks.c | 53 +++++++++++++++++++++++
+ src/ap/hostapd.c | 8 ++++
+ src/ap/hostapd.h | 4 ++
+ src/ap/ieee802_11.c | 8 ++++
+ src/ap/ieee802_11.h | 1 +
+ src/ap/ieee802_11_eht.c | 68 +++++++++++++++++++++++++++++-
+ src/common/ieee802_11_defs.h | 13 ++++++
+ src/drivers/driver.h | 56 ++++++++++++++++++++++++
+ src/drivers/driver_nl80211.c | 33 +++++++++++++++
+ src/drivers/driver_nl80211_event.c | 54 ++++++++++++++++++++++++
+ src/drivers/nl80211_copy.h | 24 +++++++++++
+ 16 files changed, 409 insertions(+), 1 deletion(-)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index 6db9fa617..2cd5487ca 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -4039,6 +4039,68 @@ out:
+ return ret;
+ }
+
++static int hostapd_ctrl_iface_set_attlm(struct hostapd_data *hapd, char *cmd,
++ char *buf, size_t buflen)
++{
++#define MAX_SWITCH_TIME_MS 30000
++#define MAX_DURATION_MS 16000000
++ struct attlm_settings *attlm;
++ struct hostapd_data *h;
++ char *token, *context = NULL;
++ u16 switch_time, disabled_links, valid_links = 0;
++ u32 duration;
++ int ret, i;
++
++ if (!hapd->conf->mld_ap || !hapd->mld)
++ return -1;
++
++ attlm = &hapd->mld->new_attlm;
++ if (attlm->valid) {
++ wpa_printf(MSG_ERROR, "Busy: A-TTLM is on-going");
++ return -1;
++ }
++
++ for_each_mld_link(h, hapd)
++ valid_links |= BIT(h->mld_link_id);
++
++ while ((token = str_token(cmd, " ", &context))) {
++ if (os_strncmp(token, "switch_time=", 12) == 0) {
++ switch_time = atoi(token + 12);
++ if (switch_time > 0 && switch_time <= MAX_SWITCH_TIME_MS)
++ continue;
++ }
++
++ if (os_strncmp(token, "disabled_links=", 15) == 0) {
++ disabled_links = atoi(token + 15);
++
++ if ((disabled_links & valid_links) &&
++ !(disabled_links & ~valid_links))
++ continue;
++ }
++
++ if (os_strncmp(token, "duration=", 9) == 0) {
++ duration = atoi(token + 9);
++ if (duration > 0 && duration <= MAX_DURATION_MS)
++ continue;
++ }
++
++ wpa_printf(MSG_INFO, "CTRL: Invalid SET_ATTLM parameter: %s",
++ token);
++ return -1;
++ }
++
++ wpa_printf(MSG_DEBUG,
++ "MLD: set A-TTLM disabled_links=%u, switch_time=%u, duration=%u",
++ disabled_links, switch_time, duration);
++
++ attlm->valid = true;
++ attlm->direction = IEEE80211_TTLM_DIRECTION_BOTH;
++ attlm->duration = duration;
++ attlm->switch_time = switch_time;
++ attlm->disabled_links = hapd->conf->mld_allowed_links & disabled_links;
++
++ return hostapd_mld_set_attlm(hapd);
++}
+ #endif /* CONFIG_TESTING_OPTIONS */
+ #endif /* CONFIG_IEEE80211BE */
+
+@@ -6166,6 +6228,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+ if (hostapd_ctrl_iface_link_add(hapd, buf + 9,
+ reply, reply_size))
+ reply_len = -1;
++ } else if (os_strncmp(buf, "SET_ATTLM ", 10) == 0) {
++ if (hostapd_ctrl_iface_set_attlm(hapd, buf + 10, reply,
++ reply_size))
++ reply_len = -1;
+ #endif /* CONFIG_TESTING_OPTIONS */
+ #endif /* CONFIG_IEEE80211BE */
+ } else if (os_strncmp(buf, "SET_EDCCA ", 10) == 0) {
+diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
+index 9dcc0d74b..f81211ba4 100644
+--- a/hostapd/hostapd_cli.c
++++ b/hostapd/hostapd_cli.c
+@@ -1791,6 +1791,12 @@ static int hostapd_cli_cmd_link_remove(struct wpa_ctrl *ctrl, int argc,
+ return hostapd_cli_cmd(ctrl, "LINK_REMOVE", 1, argc, argv);
+ }
+
++static int hostapd_cli_cmd_set_attlm(struct wpa_ctrl *ctrl, int argc,
++ char *argv[])
++{
++ return hostapd_cli_cmd(ctrl, "SET_ATTLM", 1, argc, argv);
++}
++
+ struct hostapd_cli_cmd {
+ const char *cmd;
+ int (*handler)(struct wpa_ctrl *ctrl, int argc, char *argv[]);
+@@ -2055,6 +2061,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+ " = Add a new link to a MLD AP"},
+ { "link_remove", hostapd_cli_cmd_link_remove, NULL,
+ " [count=<count>] = Remove affiliated link of a MLD AP"},
++ { "set_attlm", hostapd_cli_cmd_set_attlm, NULL,
++ " = Disable the affiliated AP of a MLD AP" },
+ { NULL, NULL, NULL, NULL }
+ };
+
+diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
+index 8b6aed0c7..a25a67cdd 100644
+--- a/src/ap/ap_drv_ops.c
++++ b/src/ap/ap_drv_ops.c
+@@ -619,6 +619,15 @@ int hostapd_if_link_remove(struct hostapd_data *hapd,
+ return hapd->driver->link_remove(hapd->drv_priv, type, ifname,
+ hapd->mld_link_id);
+ }
++
++
++int hostapd_drv_set_attlm(struct hostapd_data *hapd)
++{
++ if (!hapd->driver || !hapd->drv_priv || !hapd->driver->set_attlm)
++ return -1;
++
++ return hapd->driver->set_attlm(hapd->drv_priv, &hapd->mld->new_attlm);
++}
+ #endif /* CONFIG_IEEE80211BE */
+
+
+diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
+index e74284b96..7f108bc1d 100644
+--- a/src/ap/ap_drv_ops.h
++++ b/src/ap/ap_drv_ops.h
+@@ -68,6 +68,7 @@ int hostapd_if_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type,
+ int hostapd_if_link_remove(struct hostapd_data *hapd,
+ enum wpa_driver_if_type type,
+ const char *ifname, u8 link_id);
++int hostapd_drv_set_attlm(struct hostapd_data *hapd);
+ int hostapd_set_ieee8021x(struct hostapd_data *hapd,
+ struct wpa_bss_params *params);
+ int hostapd_get_seqnum(const char *ifname, struct hostapd_data *hapd,
+diff --git a/src/ap/beacon.c b/src/ap/beacon.c
+index 5293ee4c1..a5a885213 100644
+--- a/src/ap/beacon.c
++++ b/src/ap/beacon.c
+@@ -943,6 +943,9 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd,
+
+ pos = hostapd_eid_eht_capab(hapd, pos, IEEE80211_MODE_AP);
+ pos = hostapd_eid_eht_operation(hapd, pos);
++
++ if (!params->is_ml_sta_info)
++ pos = hostapd_eid_eht_attlm(hapd, pos);
+ }
+ #endif /* CONFIG_IEEE80211BE */
+
+@@ -2536,6 +2539,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
+ tailpos = hostapd_eid_eht_capab(hapd, tailpos,
+ IEEE80211_MODE_AP);
+ tailpos = hostapd_eid_eht_operation(hapd, tailpos);
++ tailpos = hostapd_eid_eht_attlm(hapd, tailpos);
+ }
+ #endif /* CONFIG_IEEE80211BE */
+
+diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
+index 9deb87c3d..17dc09807 100644
+--- a/src/ap/drv_callbacks.c
++++ b/src/ap/drv_callbacks.c
+@@ -1368,6 +1368,54 @@ void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht,
+ }
+
+
++#ifdef CONFIG_IEEE80211BE
++void hostapd_event_attlm(struct hostapd_data *hapd, struct attlm_event *attlm_event)
++{
++ struct hostapd_mld *mld = hapd->mld;
++ struct hostapd_data *p_hapd;
++ bool mld_indicate_disabled = false;
++
++ if (!hapd->conf->mld_ap || !mld)
++ return;
++
++ wpa_printf(MSG_DEBUG, "A-TTLM event");
++ /*
++ * T0: driver notifies A-TTLM has started and reports Switch Time TSF in TUs
++ * T1: driver notifies Switch Time Expiry of a started A-TTLM
++ * T2: driver notifies Duration Expiry of a started A-TTLM.
++ */
++ switch (attlm_event->event) {
++ case EVENT_ATTLM_STARTED:
++ ieee802_11_set_bss_critical_update(hapd,
++ BSS_CRIT_UPDATE_EVENT_ATTLM);
++ mld->new_attlm.switch_time_tsf_tu =
++ attlm_event->switch_time_tsf_tu;
++ break;
++ case EVENT_ATTLM_SWITCH_TIME_EXPIRED:
++ mld_indicate_disabled = true;
++ mld->new_attlm.switch_time_tsf_tu = 0;
++ os_get_reltime(&mld->new_attlm.start_time);
++ break;
++ case EVENT_ATTLM_END:
++ mld->new_attlm.valid = false;
++ break;
++ default:
++ wpa_printf(MSG_DEBUG, "Unsupported A-TTLM event");
++ return;
++ }
++
++ for_each_mld_link(p_hapd, hapd) {
++ if (mld->new_attlm.disabled_links & BIT(p_hapd->mld_link_id))
++ p_hapd->conf->mld_indicate_disabled =
++ mld_indicate_disabled;
++ }
++
++ ieee802_11_set_beacon(hapd);
++ hapd->eht_mld_bss_critical_update = 0;
++}
++#endif /* CONFIG_IEEE80211BE */
++
++
+ void hostapd_event_connect_failed_reason(struct hostapd_data *hapd,
+ const u8 *addr, int reason_code)
+ {
+@@ -2755,6 +2803,11 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
+ data->ch_switch.punct_bitmap,
+ event == EVENT_CH_SWITCH);
+ break;
++ case EVENT_ATTLM:
++#ifdef CONFIG_IEEE80211BE
++ hostapd_event_attlm(hapd, &data->attlm_event);
++#endif /* CONFIG_IEEE80211BE */
++ break;
+ case EVENT_CONNECT_FAILED_REASON:
+ if (!data)
+ break;
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index e34bc1fa8..9388f6070 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -537,6 +537,14 @@ void hostapd_link_remove_cb(struct hostapd_data *hapd, u16 removed_links)
+ }
+ }
+
++
++int hostapd_mld_set_attlm(struct hostapd_data *hapd)
++{
++ if (!hapd->drv_priv)
++ return -1;
++
++ return hostapd_drv_set_attlm(hapd);
++}
+ #endif /* CONFIG_TESTING_OPTIONS */
+ #endif /* CONFIG_IEEE80211BE */
+
+diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
+index c6c286304..f69fa0062 100644
+--- a/src/ap/hostapd.h
++++ b/src/ap/hostapd.h
+@@ -553,6 +553,7 @@ struct hostapd_mld {
+ u16 active_links;
+ u16 removed_links;
+
++ struct attlm_settings new_attlm;
+ struct hostapd_data *fbss;
+ struct dl_list links; /* List head of all affiliated links */
+
+@@ -924,6 +925,7 @@ struct hostapd_data * hostapd_mld_get_link_bss(struct hostapd_data *hapd,
+ u8 link_id);
+ int hostapd_link_remove(struct hostapd_data *hapd, u32 count);
+ void hostapd_link_remove_cb(struct hostapd_data *hapd, u16 removed_links);
++int hostapd_mld_set_attlm(struct hostapd_data *hapd);
+ bool hostapd_is_ml_partner(struct hostapd_data *hapd1,
+ struct hostapd_data *hapd2);
+ u8 hostapd_get_mld_id(struct hostapd_data *hapd);
+@@ -937,6 +939,8 @@ int hostapd_fill_cca_settings(struct hostapd_data *hapd,
+
+ #ifdef CONFIG_IEEE80211BE
+
++void hostapd_event_attlm(struct hostapd_data *hapd, struct attlm_event *attlm_event);
++
+ bool hostapd_mld_is_first_bss(struct hostapd_data *hapd);
+
+ #define for_each_mld_link(partner, self) \
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index 2861c09d7..886a21a66 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -5088,6 +5088,7 @@ rsnxe_done:
+ p = hostapd_eid_eht_ml_assoc(hapd, sta, p);
+ p = hostapd_eid_eht_capab(hapd, p, IEEE80211_MODE_AP);
+ p = hostapd_eid_eht_operation(hapd, p);
++ p = hostapd_eid_eht_attlm(hapd, p);
+ }
+ #endif /* CONFIG_IEEE80211BE */
+
+@@ -6343,6 +6344,13 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len,
+ wpa_printf(MSG_DEBUG, "MGMT: Drop the frame - MLD not ready");
+ return 1;
+ }
++
++ if (hapd->conf->mld_ap && hapd->mld->new_attlm.valid &&
++ !hapd->mld->new_attlm.switch_time_tsf_tu &&
++ (hapd->mld->new_attlm.disabled_links & BIT(hapd->mld_link_id))) {
++ wpa_printf(MSG_DEBUG, "MGMT: Drop the frame - Disabled link");
++ return 1;
++ }
+ #endif /* CONFIG_IEEE80211BE */
+
+ if (fi && fi->freq)
+diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h
+index 40301bce9..efaa20c86 100644
+--- a/src/ap/ieee802_11.h
++++ b/src/ap/ieee802_11.h
+@@ -243,6 +243,7 @@ u8 * hostapd_eid_eht_capab(struct hostapd_data *hapd, u8 *eid,
+ enum ieee80211_op_mode opmode);
+ u8 * hostapd_eid_non_inheritance(struct hostapd_data *hapd, u8 *eid);
+ u8 * hostapd_eid_eht_operation(struct hostapd_data *hapd, u8 *eid);
++u8 * hostapd_eid_eht_attlm(struct hostapd_data *hapd, u8 *eid);
+ u16 copy_sta_eht_capab(struct hostapd_data *hapd, struct sta_info *sta,
+ enum ieee80211_op_mode opmode,
+ const u8 *he_capab, size_t he_capab_len,
+diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
+index cad0d8437..2ed9414b8 100644
+--- a/src/ap/ieee802_11_eht.c
++++ b/src/ap/ieee802_11_eht.c
+@@ -595,7 +595,7 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd,
+ mld_cap |= active_links & EHT_ML_MLD_CAPA_MAX_NUM_SIM_LINKS_MASK;
+
+ /* TODO: Advertise T2LM based on driver support as well */
+- mld_cap &= ~EHT_ML_MLD_CAPA_TID_TO_LINK_MAP_NEG_SUPP_MSK;
++ mld_cap |= EHT_ML_MLD_CAPA_TID_TO_LINK_MAP_ALL_TO_ALL;
+
+ wpa_printf(MSG_DEBUG, "MLD: MLD Capabilities and Operations=0x%x",
+ mld_cap);
+@@ -824,6 +824,72 @@ static u8 * hostapd_eid_eht_reconf_ml(struct hostapd_data *hapd, u8 *eid)
+ }
+
+
++u8 * hostapd_eid_eht_attlm(struct hostapd_data *hapd, u8 *eid)
++{
++ struct attlm_settings *attlm;
++ struct os_reltime now, res;
++ int i;
++ u16 control = 0;
++ u8 *pos = eid;
++ u16 enabled_links;
++
++ if (!hapd->conf->mld_ap)
++ return eid;
++
++ attlm = &hapd->mld->new_attlm;
++ if (!attlm || !attlm->valid)
++ return eid;
++
++ /* The length will be set at the end */
++ *pos++ = WLAN_EID_EXTENSION;
++ *pos++ = 0;
++ *pos++ = WLAN_EID_EXT_TID_TO_LINK_MAPPING;
++
++ /* Set the A-TTLM Control field */
++ control = (IEEE80211_TTLM_CONTROL_DIRECTION & attlm->direction) |
++ IEEE80211_TTLM_CONTROL_EXPECTED_DUR_PRESENT |
++ IEEE80211_TTLM_CONTROL_INDICATOR;
++
++ if (attlm->switch_time_tsf_tu != 0)
++ control |= IEEE80211_TTLM_CONTROL_SWITCH_TIME_PRESENT;
++
++ WPA_PUT_LE16(pos, control);
++ pos += 2;
++
++ /* switch time & expected duration */
++ if (attlm->switch_time_tsf_tu != 0) {
++ WPA_PUT_LE16(pos, attlm->switch_time_tsf_tu);
++ pos += 2;
++
++ WPA_PUT_LE24(pos, (attlm->duration * 1000) >> 10);
++ pos += 3;
++ } else {
++ u32 diff;
++
++ os_get_reltime(&now);
++ os_reltime_sub(&now, &attlm->start_time, &res);
++ diff = (u32)os_reltime_in_ms(&res);
++
++ if (attlm->duration <= diff)
++ return eid;
++
++ WPA_PUT_LE24(pos, ((attlm->duration - diff) * 1000) >> 10);
++ pos += 3;
++ }
++
++ /* Link Mapping of each TID (0 - 7) */
++ enabled_links = hapd->conf->mld_allowed_links & ~attlm->disabled_links;
++ for (i = 0; i < 8; i++) {
++ WPA_PUT_LE16(pos, enabled_links);
++ pos += 2;
++ }
++
++ eid[1] = pos - eid - 2;
++
++ return pos;
++}
++
++
+ static size_t hostapd_eid_eht_ml_len(struct mld_info *info,
+ bool include_mld_id,
+ u8 eml_disable)
+diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
+index d93fa6660..afcc2f861 100644
+--- a/src/common/ieee802_11_defs.h
++++ b/src/common/ieee802_11_defs.h
+@@ -2912,6 +2912,19 @@ enum ieee80211_eht_ml_sub_elem {
+ EHT_ML_SUB_ELEM_FRAGMENT = 254,
+ };
+
++/* IEEE P802.11be/D5.0, 9.4.2.314 - TID-to-Link Mapping control */
++#define IEEE80211_TTLM_CONTROL_DIRECTION 0x0003
++#define IEEE80211_TTLM_CONTROL_DEF_LINK_MAP 0x0004
++#define IEEE80211_TTLM_CONTROL_SWITCH_TIME_PRESENT 0x0008
++#define IEEE80211_TTLM_CONTROL_EXPECTED_DUR_PRESENT 0x0010
++#define IEEE80211_TTLM_CONTROL_LINK_MAP_SIZE 0x0020
++#define IEEE80211_TTLM_CONTROL_INDICATOR 0xff00
++
++/* TTLM direction */
++#define IEEE80211_TTLM_DIRECTION_DOWN 0
++#define IEEE80211_TTLM_DIRECTION_UP 1
++#define IEEE80211_TTLM_DIRECTION_BOTH 2
++
+ /* IEEE P802.11ay/D4.0, 9.4.2.251 - EDMG Operation element */
+ #define EDMG_BSS_OPERATING_CHANNELS_OFFSET 6
+ #define EDMG_OPERATING_CHANNEL_WIDTH_OFFSET 7
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index eb2a48381..fe327e560 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -2805,6 +2805,29 @@ struct cca_settings {
+ int link_id;
+ };
+
++#ifdef CONFIG_IEEE80211BE
++/**
++ * struct attlm_settings - Setting for Advertised Tid-to-Link Mapping
++ * @valid: whether this A-TTLM is still valid
++ * @direction: direction of this A-TTLM
++ * @disabled_links: disabled link ID bitmap
++ * @switch_time: duration in ms to establish the A-TTLM
++ * @switch_time_tsf_tu: time in TUs that the A-TTLM is established. It should be
++ * the bits 10 to 25 of the TSF
++ * @duration_tu: duration in ms that the A-TTLM lasts
++ * @start_time: the relative time that this A-TTLM is entablished
++ */
++struct attlm_settings {
++ bool valid;
++ u8 direction;
++ u16 disabled_links;
++ u16 switch_time;
++ u16 switch_time_tsf_tu;
++ u32 duration;
++ struct os_reltime start_time;
++};
++#endif /* CONFIG_IEEE80211BE */
++
+ /* TDLS peer capabilities for send_tdls_mgmt() */
+ enum tdls_peer_capability {
+ TDLS_PEER_HT = BIT(0),
+@@ -5239,6 +5262,14 @@ struct wpa_driver_ops {
+ int (*link_remove)(void *priv, enum wpa_driver_if_type type,
+ const char *ifname, u8 link_id);
+
++ /**
++ * set_attlm - Set AP MLD advertised Tid-to-Link Mapping
++ * @priv: Private driver interface data
++ * @attlm: setting of Tid-to-Link Mapping
++ * Returns: 0 on success, negative value on failure
++ */
++ int (*set_attlm)(void *priv, struct attlm_settings *attlm);
++
+ /**
+ * is_drv_shared - Check whether the driver interface is shared
+ * @priv: Private driver interface data from init()
+@@ -6025,6 +6056,16 @@ enum wpa_event_type {
+ */
+ EVENT_LINK_CH_SWITCH_STARTED,
+
++ /**
++ * EVENT_ATTLM - MLD AP Advertised Tid-to-Link Mapping event
++ *
++ * This event is used by the driver to indicate the state transition of
++ * A-TTLM.
++ *
++ * Described in wpa_event_data.attlm_event
++ */
++ EVENT_ATTLM,
++
+ /**
+ * EVENT_TID_LINK_MAP - MLD event to set TID-to-link mapping
+ *
+@@ -6834,6 +6875,21 @@ union wpa_event_data {
+ u16 punct_bitmap;
+ } ch_switch;
+
++ /**
++ * struct attlm_event
++ * @switch_time_tsf_tu: the TSF of switch time in unit of TUs
++ * @started: the ATTLM is started or has been done.
++ * @switch_time_expired: the switch time has expired
++ */
++ struct attlm_event {
++ enum {
++ EVENT_ATTLM_STARTED,
++ EVENT_ATTLM_SWITCH_TIME_EXPIRED,
++ EVENT_ATTLM_END
++ } event;
++ u16 switch_time_tsf_tu;
++ } attlm_event;
++
+ /**
+ * struct connect_failed - Data for EVENT_CONNECT_FAILED_REASON
+ * @addr: Remote client address
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index 1d334b75f..05b231c52 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -11020,6 +11020,38 @@ static bool nl80211_is_drv_shared(void *priv, void *bss_ctx)
+ return true;
+ }
+
++
++static int nl80211_set_attlm(void *priv, struct attlm_settings *attlm)
++{
++ struct nl_msg *msg;
++ struct i802_bss *bss = priv;
++ struct wpa_driver_nl80211_data *drv = bss->drv;
++ int ret = -ENOBUFS;
++
++ wpa_printf(MSG_DEBUG, "nl80211: Set A-TTLM");
++
++ if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_ATTLM)) ||
++ nla_put_u16(msg, NL80211_ATTR_MLO_LINK_DISABLED_BMP,
++ attlm->disabled_links) ||
++ nla_put_u16(msg, NL80211_ATTR_MLO_ATTLM_SWITCH_TIME,
++ attlm->switch_time) ||
++ nla_put_u32(msg, NL80211_ATTR_MLO_ATTLM_DURATION,
++ attlm->duration))
++ goto error;
++
++ ret = send_and_recv_cmd(drv, msg);
++ if (ret) {
++ wpa_printf(MSG_DEBUG,
++ "nl80211: disable link failed err=%d (%s)",
++ ret, strerror(-ret));
++ }
++
++ return ret;
++error:
++ nlmsg_free(msg);
++ wpa_printf(MSG_DEBUG, "nl80211: Could not build link disabling request");
++ return ret;
++}
+ #endif /* CONFIG_IEEE80211BE */
+
+
+@@ -15717,6 +15749,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+ .link_add = nl80211_link_add,
+ #ifdef CONFIG_IEEE80211BE
+ .link_remove = driver_nl80211_link_remove,
++ .set_attlm = nl80211_set_attlm,
+ .is_drv_shared = nl80211_is_drv_shared,
+ .link_sta_remove = wpa_driver_nl80211_link_sta_remove,
+ #endif /* CONFIG_IEEE80211BE */
+diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
+index 24a4bf3cf..863c4eb65 100644
+--- a/src/drivers/driver_nl80211_event.c
++++ b/src/drivers/driver_nl80211_event.c
+@@ -188,6 +188,8 @@ static const char * nl80211_command_to_string(enum nl80211_commands cmd)
+ C2S(NL80211_CMD_SET_HW_TIMESTAMP)
+ C2S(NL80211_CMD_LINKS_REMOVED)
+ C2S(NL80211_CMD_SET_TID_TO_LINK_MAPPING)
++ C2S(NL80211_CMD_ATTLM_EVENT)
++ C2S(NL80211_CMD_SET_ATTLM)
+ C2S(__NL80211_CMD_AFTER_LAST)
+ }
+ #undef C2S
+@@ -1313,6 +1315,53 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv,
+ }
+
+
++static void mlme_event_attlm(struct wpa_driver_nl80211_data *drv,
++ struct nlattr *ifindex,
++ struct nlattr *event,
++ struct nlattr *switch_time_tsf_tu)
++{
++ enum nl80211_attlm_event event_type;
++ union wpa_event_data data;
++ struct i802_bss *bss;
++ int ifidx;
++
++ ifidx = nla_get_u32(ifindex);
++ bss = get_bss_ifindex(drv, ifidx);
++ if (bss == NULL) {
++ wpa_printf(MSG_WARNING,
++ "nl80211: Unknown ifindex (%d) for A-TTLM, ignoring",
++ ifidx);
++ return;
++ }
++
++ if (!event)
++ return;
++
++ wpa_printf(MSG_DEBUG, "nl80211: %s: A-TTLM event", bss->ifname);
++
++ data.attlm_event.switch_time_tsf_tu = switch_time_tsf_tu ?
++ nla_get_u16(switch_time_tsf_tu) : 0;
++ event_type = nla_get_u32(event);
++ switch (event_type) {
++ case NL80211_ATTLM_STARTED:
++ data.attlm_event.event = EVENT_ATTLM_STARTED;
++ break;
++ case NL80211_ATTLM_SWITCH_TIME_EXPIRED:
++ data.attlm_event.event = EVENT_ATTLM_SWITCH_TIME_EXPIRED;
++ break;
++ case NL80211_ATTLM_END:
++ data.attlm_event.event = EVENT_ATTLM_END;
++ break;
++ default:
++ wpa_printf(MSG_DEBUG,
++ "nl80211: Unsupported A-TTLM event");
++ return;
++ }
++
++ wpa_supplicant_event(bss->ctx, EVENT_ATTLM, &data);
++}
++
++
+ static void mlme_timeout_event(struct wpa_driver_nl80211_data *drv,
+ enum nl80211_commands cmd, struct nlattr *addr)
+ {
+@@ -4125,6 +4174,11 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
+ NULL,
+ 1);
+ break;
++ case NL80211_CMD_ATTLM_EVENT:
++ mlme_event_attlm(drv, tb[NL80211_ATTR_IFINDEX],
++ tb[NL80211_ATTR_MLO_ATTLM_EVENT],
++ tb[NL80211_ATTR_MLO_ATTLM_SWITCH_TIME_TSF_TU]);
++ break;
+ case NL80211_CMD_DISCONNECT:
+ mlme_event_disconnect(drv, tb[NL80211_ATTR_REASON_CODE],
+ tb[NL80211_ATTR_MAC],
+diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h
+index 13837297c..f997edd6e 100644
+--- a/src/drivers/nl80211_copy.h
++++ b/src/drivers/nl80211_copy.h
+@@ -1588,6 +1588,10 @@ enum nl80211_commands {
+
+ /* add new commands above here */
+
++ /* MTK internal */
++ NL80211_CMD_ATTLM_EVENT,
++ NL80211_CMD_SET_ATTLM,
++
+ /* used to define NL80211_CMD_MAX below */
+ __NL80211_CMD_AFTER_LAST,
+ NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
+@@ -3388,6 +3392,7 @@ enum nl80211_attrs {
+
+ NL80211_ATTR_MLO_LINKS,
+ NL80211_ATTR_MLO_LINK_ID,
++ NL80211_ATTR_MLO_LINK_DISABLED_BMP,
+ NL80211_ATTR_MLD_ADDR,
+
+ NL80211_ATTR_MLO_SUPPORT,
+@@ -3425,6 +3430,11 @@ enum nl80211_attrs {
+ /* MTK internal */
+ NL80211_ATTR_CNTDWN_OFFS_STA_PROF,
+
++ NL80211_ATTR_MLO_ATTLM_EVENT,
++ NL80211_ATTR_MLO_ATTLM_SWITCH_TIME,
++ NL80211_ATTR_MLO_ATTLM_DURATION,
++ NL80211_ATTR_MLO_ATTLM_SWITCH_TIME_TSF_TU,
++
+ __NL80211_ATTR_AFTER_LAST,
+ NUM_NL80211_ATTR = __NL80211_ATTR_AFTER_LAST,
+ NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
+@@ -8090,4 +8100,18 @@ enum nl80211_wiphy_radio_freq_range {
+ NL80211_WIPHY_RADIO_FREQ_ATTR_MAX = __NL80211_WIPHY_RADIO_FREQ_ATTR_LAST - 1,
+ };
+
++/**
++ * enum nl80211_attlm_event - type of events for Advertised Tid-to-Link
++ * Mapping operations
++ *
++ * @NL80211_ATTLM_STARTED: A A-TTLM request has been set and start to count down.
++ * @NL80211_ATTLM_SWITCH_TIME_EXPIRED: The switch time of A-TTLM has expired.
++ * @NL80211ATTLM_END: The A-TTLM has been done.
++ */
++enum nl80211_attlm_event {
++ NL80211_ATTLM_STARTED,
++ NL80211_ATTLM_SWITCH_TIME_EXPIRED,
++ NL80211_ATTLM_END,
++};
++
+ #endif /* __LINUX_NL80211_H */
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0120-mtk-hostapd-Add-txpower-vendor-command.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0120-mtk-hostapd-Add-txpower-vendor-command.patch
new file mode 100644
index 0000000..4201379
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0120-mtk-hostapd-Add-txpower-vendor-command.patch
@@ -0,0 +1,299 @@
+From 4c0dd29eb15b2cef5cf5256459a19d59e5c98adc Mon Sep 17 00:00:00 2001
+From: Allen Ye <allen.ye@mediatek.com>
+Date: Fri, 22 Dec 2023 18:09:20 +0800
+Subject: [PATCH 120/126] mtk: hostapd: Add txpower vendor command
+
+Porting and refactor from wifi6 power vendor cmd. Add lpi psd control,
+sku index and duplicate mode enhancement.
+
+Signed-off-by: Allen Ye <allen.ye@mediatek.com>
+---
+ hostapd/config_file.c | 8 +++++
+ src/ap/ap_config.c | 4 +++
+ src/ap/ap_config.h | 3 ++
+ src/ap/ap_drv_ops.c | 16 +++++++++
+ src/ap/ap_drv_ops.h | 1 +
+ src/ap/hostapd.c | 2 ++
+ src/ap/ieee802_11_he.c | 3 ++
+ src/common/mtk_vendor.h | 15 +++++++++
+ src/drivers/driver.h | 10 ++++++
+ src/drivers/driver_nl80211.c | 55 +++++++++++++++++++++++++++++++
+ src/drivers/driver_nl80211.h | 1 +
+ src/drivers/driver_nl80211_capa.c | 3 ++
+ 12 files changed, 121 insertions(+)
+
+diff --git a/hostapd/config_file.c b/hostapd/config_file.c
+index f7bfc357a..944669270 100644
+--- a/hostapd/config_file.c
++++ b/hostapd/config_file.c
+@@ -5570,6 +5570,14 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+ return 1;
+ }
+ conf->band_idx = (u8) val;
++ } else if (os_strcmp(buf, "lpi_psd") == 0) {
++ u8 en = strtol(pos, NULL, 10);
++ conf->lpi_psd = !!en;
++ } else if (os_strcmp(buf, "sku_idx") == 0) {
++ conf->sku_idx = strtol(pos, NULL, 10);
++ } else if (os_strcmp(buf, "lpi_bcn_enhance") == 0) {
++ u8 en = strtol(pos, NULL, 10);
++ conf->lpi_bcn_enhance = !!en;
+ } else {
+ wpa_printf(MSG_ERROR,
+ "Line %d: unknown configuration item '%s'",
+diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
+index 4528df823..bb5ec78a1 100644
+--- a/src/ap/ap_config.c
++++ b/src/ap/ap_config.c
+@@ -315,6 +315,10 @@ struct hostapd_config * hostapd_config_defaults(void)
+ conf->pp_mode = PP_FW_MODE;
+ conf->band_idx = 255;
+
++ conf->lpi_psd = 0;
++ conf->sku_idx = 0;
++ conf->lpi_bcn_enhance = 0;
++
+ hostapd_set_and_check_bw320_offset(conf, 0);
+
+ return conf;
+diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
+index 9c3a28cf4..ea8507cea 100644
+--- a/src/ap/ap_config.h
++++ b/src/ap/ap_config.h
+@@ -1356,6 +1356,9 @@ struct hostapd_config {
+ void *muru_config;
+ u8 pp_mode;
+ u8 band_idx;
++ u8 lpi_psd;
++ u8 sku_idx;
++ u8 lpi_bcn_enhance;
+ };
+
+ enum three_wire_mode {
+diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
+index a25a67cdd..2f53c518f 100644
+--- a/src/ap/ap_drv_ops.c
++++ b/src/ap/ap_drv_ops.c
+@@ -1391,6 +1391,22 @@ int hostapd_drv_get_aval_bss_color_bmp(struct hostapd_data *hapd, u64 *aval_colo
+ return hapd->driver->get_aval_color_bmp(hapd->drv_priv, aval_color_bmp);
+ }
+
++int hostapd_drv_txpower_ctrl(struct hostapd_data *hapd)
++{
++ s8 link_id = -1;
++
++ if (!hapd->driver || !hapd->driver->txpower_ctrl)
++ return 0;
++
++ if (hapd->conf->mld_ap)
++ link_id = hapd->mld_link_id;
++
++ return hapd->driver->txpower_ctrl(hapd->drv_priv, hapd->iconf->lpi_psd,
++ hapd->iconf->sku_idx,
++ hapd->iconf->lpi_bcn_enhance,
++ link_id);
++}
++
+ int hostapd_drv_ap_wireless(struct hostapd_data *hapd, u8 sub_vendor_id, int value)
+ {
+ s8 link_id = -1;
+diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
+index 7f108bc1d..a8c60b6f6 100644
+--- a/src/ap/ap_drv_ops.h
++++ b/src/ap/ap_drv_ops.h
+@@ -167,6 +167,7 @@ int hostapd_drv_amsdu_ctrl(struct hostapd_data *hapd);
+ int hostapd_drv_amsdu_dump(struct hostapd_data *hapd, u8 *amsdu);
+ int hostapd_drv_get_aval_bss_color_bmp(struct hostapd_data *hapd,
+ u64 *aval_color_bmp);
++int hostapd_drv_txpower_ctrl(struct hostapd_data *hapd);
+ int hostapd_drv_ap_wireless(struct hostapd_data *hapd, u8 sub_vendor_id, int value);
+ int hostapd_drv_ap_rfeatures(struct hostapd_data *hapd, u8 sub_vendor_id, int value);
+ int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type);
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index 9388f6070..6f7f13f9f 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -2879,6 +2879,8 @@ dfs_offload:
+ goto fail;
+ if (hostapd_drv_amsdu_ctrl(hapd) < 0)
+ goto fail;
++ if (hostapd_drv_txpower_ctrl(hapd) < 0)
++ goto fail;
+
+ wpa_printf(MSG_DEBUG, "%s: Setup of interface done.",
+ iface->bss[0]->conf->iface);
+diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c
+index 3b6b2041c..f3a5679a0 100644
+--- a/src/ap/ieee802_11_he.c
++++ b/src/ap/ieee802_11_he.c
+@@ -264,6 +264,9 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid)
+ else
+ control = center_idx_to_bw_6ghz(seg0);
+
++ if (hapd->iconf->lpi_bcn_enhance)
++ control |= HE_6GHZ_OPER_INFO_CTRL_DUP_BEACON;
++
+ control |= hapd->iconf->he_6ghz_reg_pwr_type <<
+ HE_6GHZ_OPER_INFO_CTRL_REG_INFO_SHIFT;
+
+diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
+index 933f0099d..6d75d39c2 100644
+--- a/src/common/mtk_vendor.h
++++ b/src/common/mtk_vendor.h
+@@ -19,6 +19,7 @@ enum mtk_nl80211_vendor_subcmds {
+ MTK_NL80211_VENDOR_SUBCMD_BACKGROUND_RADAR_CTRL = 0xcb,
+ MTK_NL80211_VENDOR_SUBCMD_PP_CTRL = 0xcc,
+ MTK_NL80211_VENDOR_SUBCMD_BEACON_CTRL = 0xcd,
++ MTK_NL80211_VENDOR_SUBCMD_TXPOWER_CTRL = 0xce,
+ MTK_NL80211_VENDOR_SUBCMD_EML_CTRL = 0xd3,
+ };
+
+@@ -310,6 +311,20 @@ enum mtk_vendor_attr_eml_ctrl {
+ NUM_MTK_VENDOR_ATTRS_EML_CTRL -1
+ };
+
++enum mtk_vendor_attr_txpower_ctrl {
++ MTK_VENDOR_ATTR_TXPOWER_CTRL_UNSPEC,
++
++ MTK_VENDOR_ATTR_TXPOWER_CTRL_LPI_PSD,
++ MTK_VENDOR_ATTR_TXPOWER_CTRL_SKU_IDX,
++ MTK_VENDOR_ATTR_TXPOWER_CTRL_LPI_BCN_ENHANCE,
++ MTK_VENDOR_ATTR_TXPOWER_CTRL_LINK_ID,
++
++ /* keep last */
++ NUM_MTK_VENDOR_ATTRS_TXPOWER_CTRL,
++ MTK_VENDOR_ATTR_TXPOWER_CTRL_MAX =
++ NUM_MTK_VENDOR_ATTRS_TXPOWER_CTRL - 1
++};
++
+ #define CSI_BW20_DATA_COUNT 64
+ #define CSI_BW40_DATA_COUNT 128
+ #define CSI_BW80_DATA_COUNT 256
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index fe327e560..55f62f537 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -5443,6 +5443,16 @@ struct wpa_driver_ops {
+ * @dump_buf: Dump_struct that store csi data and related info
+ */
+ int (*csi_dump)(void *priv, u8 band_idx, void *dump_buf);
++ /**
++ * txpower_ctrl - ctrl txpower operation
++ * @priv: Private driver interface data
++ * @lpi_psd: 1 to enable lpi psd compensate, 0 to disable
++ * @lpi_bcn_enhance: 1 to enable beacon duplicate enhancement in 6G lpi mode, 0 to disable enhancement
++ * @sku_idx: index used to indicate which sku table should be used
++ * @link_id: MLD link id. -1 if this is an non-MLD AP
++ */
++ int (*txpower_ctrl)(void *priv, u8 lpi_psd, u8 sku_idx, u8 lpi_bcn_enhance,
++ u8 link_id);
+ };
+
+ /**
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index 05b231c52..395bb5926 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -195,6 +195,14 @@ static struct nla_policy csi_data_policy[NUM_MTK_VENDOR_ATTRS_CSI_DATA] = {
+ [MTK_VENDOR_ATTR_CSI_DATA_CHAIN_INFO] = { .type = NLA_U32 },
+ };
+
++static struct nla_policy
++txpower_ctrl_policy[NUM_MTK_VENDOR_ATTRS_TXPOWER_CTRL] = {
++ [MTK_VENDOR_ATTR_TXPOWER_CTRL_LPI_PSD] = { .type = NLA_U8 },
++ [MTK_VENDOR_ATTR_TXPOWER_CTRL_SKU_IDX] = { .type = NLA_U8 },
++ [MTK_VENDOR_ATTR_TXPOWER_CTRL_LPI_BCN_ENHANCE] = { .type = NLA_U8 },
++ [MTK_VENDOR_ATTR_TXPOWER_CTRL_LINK_ID] = { .type = NLA_U8 },
++};
++
+ static struct nl_sock * nl_create_handle(struct nl_cb *cb, const char *dbg)
+ {
+ struct nl_sock *handle;
+@@ -15592,6 +15600,52 @@ fail:
+ return -ENOBUFS;
+ }
+
++static int nl80211_txpower_ctrl(void *priv, u8 lpi_psd, u8 sku_idx, u8 lpi_bcn_enhance,
++ u8 link_id)
++{
++ struct i802_bss *bss = priv;
++ struct wpa_driver_nl80211_data *drv = bss->drv;
++ struct nl_msg *msg;
++ struct nlattr *data;
++ int ret;
++
++ if (!drv->mtk_txpower_vendor_cmd_avail) {
++ wpa_printf(MSG_INFO,
++ "nl80211: Driver does not support setting txpower control");
++ return 0;
++ }
++
++ msg = nl80211_drv_msg(drv, 0, NL80211_CMD_VENDOR);
++ if (!msg)
++ goto fail;
++
++ if (nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_MTK) ||
++ nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
++ MTK_NL80211_VENDOR_SUBCMD_TXPOWER_CTRL))
++ goto fail;
++
++ data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
++ if (!data)
++ goto fail;
++
++ nla_put_u8(msg, MTK_VENDOR_ATTR_TXPOWER_CTRL_LPI_PSD, lpi_psd);
++ nla_put_u8(msg, MTK_VENDOR_ATTR_TXPOWER_CTRL_SKU_IDX, sku_idx);
++ nla_put_u8(msg, MTK_VENDOR_ATTR_TXPOWER_CTRL_LPI_BCN_ENHANCE, lpi_bcn_enhance);
++ nla_put_u8(msg, MTK_VENDOR_ATTR_TXPOWER_CTRL_LINK_ID, link_id);
++
++ nla_nest_end(msg, data);
++ ret = send_and_recv_cmd(drv, msg);
++ if (ret)
++ wpa_printf(MSG_ERROR, "Failed to set power. ret=%d (%s)",
++ ret, strerror(-ret));
++
++ return ret;
++
++fail:
++ nlmsg_free(msg);
++ return -ENOBUFS;
++}
++
+ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+ .name = "nl80211",
+ .desc = "Linux nl80211/cfg80211",
+@@ -15779,4 +15833,5 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+ #endif
+ .csi_set = nl80211_csi_set,
+ .csi_dump = nl80211_csi_dump,
++ .txpower_ctrl = nl80211_txpower_ctrl,
+ };
+diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
+index 2cc40e0dc..d32c0ff4d 100644
+--- a/src/drivers/driver_nl80211.h
++++ b/src/drivers/driver_nl80211.h
+@@ -214,6 +214,7 @@ struct wpa_driver_nl80211_data {
+ unsigned int mtk_beacon_ctrl_vendor_cmd_avail:1;
+ unsigned int mtk_csi_vendor_cmd_avail:1;
+ unsigned int mtk_eml_vendor_cmd_avail:1;
++ unsigned int mtk_txpower_vendor_cmd_avail:1;
+
+ u32 ignore_next_local_disconnect;
+ u32 ignore_next_local_deauth;
+diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
+index c1327a679..fc7f9062f 100644
+--- a/src/drivers/driver_nl80211_capa.c
++++ b/src/drivers/driver_nl80211_capa.c
+@@ -1179,6 +1179,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
+ case MTK_NL80211_VENDOR_SUBCMD_EML_CTRL:
+ drv->mtk_eml_vendor_cmd_avail = 1;
+ break;
++ case MTK_NL80211_VENDOR_SUBCMD_TXPOWER_CTRL:
++ drv->mtk_txpower_vendor_cmd_avail = 1;
++ break;
+ }
+ }
+
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0121-mtk-hostapd-Add-Triggered-Uplink-Access-Optimization.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0121-mtk-hostapd-Add-Triggered-Uplink-Access-Optimization.patch
new file mode 100644
index 0000000..567d0d3
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0121-mtk-hostapd-Add-Triggered-Uplink-Access-Optimization.patch
@@ -0,0 +1,651 @@
+From d612e6c3981212812e87374f90b7be07edf9bc2a Mon Sep 17 00:00:00 2001
+From: Howard Hsu <howard-yh.hsu@mediatek.com>
+Date: Tue, 2 Jul 2024 09:46:26 +0800
+Subject: [PATCH 121/126] mtk: hostapd: Add Triggered Uplink Access
+ Optimization support
+
+Add TUAO feature support.
+
+Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
+---
+ hostapd/Makefile | 1 +
+ src/ap/Makefile | 3 +-
+ src/ap/ap_drv_ops.c | 13 ++
+ src/ap/ap_drv_ops.h | 5 +
+ src/ap/ieee802_11.c | 6 +
+ src/ap/scs.c | 247 ++++++++++++++++++++++++++++++
+ src/ap/scs.h | 30 ++++
+ src/ap/sta_info.h | 5 +
+ src/common/ieee802_11_defs.h | 5 +
+ src/common/mtk_vendor.h | 17 ++
+ src/drivers/driver.h | 26 ++++
+ src/drivers/driver_nl80211.c | 62 ++++++++
+ src/drivers/driver_nl80211.h | 1 +
+ src/drivers/driver_nl80211_capa.c | 3 +
+ 14 files changed, 423 insertions(+), 1 deletion(-)
+ create mode 100644 src/ap/scs.c
+ create mode 100644 src/ap/scs.h
+
+diff --git a/hostapd/Makefile b/hostapd/Makefile
+index 8dc6e6216..233176ae5 100644
+--- a/hostapd/Makefile
++++ b/hostapd/Makefile
+@@ -382,6 +382,7 @@ ifdef CONFIG_IEEE80211BE
+ CONFIG_IEEE80211AX=y
+ CFLAGS += -DCONFIG_IEEE80211BE
+ OBJS += ../src/ap/ieee802_11_eht.o
++OBJS += ../src/ap/scs.o
+ endif
+
+ ifdef CONFIG_IEEE80211AX
+diff --git a/src/ap/Makefile b/src/ap/Makefile
+index a1e9b7c44..49c6d4a13 100644
+--- a/src/ap/Makefile
++++ b/src/ap/Makefile
+@@ -55,6 +55,7 @@ LIB_OBJS= \
+ wpa_auth_glue.o \
+ wpa_auth_ie.o \
+ wps_hostapd.o \
+- x_snoop.o
++ x_snoop.o \
++ scs.o
+
+ include ../lib.rules
+diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
+index 2f53c518f..64fd0c04c 100644
+--- a/src/ap/ap_drv_ops.c
++++ b/src/ap/ap_drv_ops.c
+@@ -23,6 +23,10 @@
+ #include "wpa_auth.h"
+ #include "ap_drv_ops.h"
+
++#ifdef CONFIG_IEEE80211BE
++#include "scs.h"
++#endif
++
+
+ u32 hostapd_sta_flags_to_drv(u32 flags)
+ {
+@@ -1531,3 +1535,12 @@ int hostapd_drv_csi_dump(struct hostapd_data *hapd, void *dump_buf)
+ return 0;
+ return hapd->driver->csi_dump(hapd->drv_priv, hapd->iconf->band_idx, dump_buf);
+ }
++
++#ifdef CONFIG_IEEE80211BE
++int hostapd_drv_set_scs(struct hostapd_data *hapd, struct hostapd_scs_desc_info *info)
++{
++ if (!hapd->driver || !hapd->driver->set_scs)
++ return 0;
++ return hapd->driver->set_scs(hapd->drv_priv, info, hapd->mld_link_id);
++}
++#endif
+diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
+index a8c60b6f6..3e5743754 100644
+--- a/src/ap/ap_drv_ops.h
++++ b/src/ap/ap_drv_ops.h
+@@ -190,6 +190,11 @@ int hostapd_drv_wnm_oper(struct hostapd_data *hapd,
+ int hostapd_drv_set_qos_map(struct hostapd_data *hapd, const u8 *qos_map_set,
+ u8 qos_map_set_len);
+
++#ifdef CONFIG_IEEE80211BE
++int hostapd_drv_set_scs(struct hostapd_data *hapd,
++ struct hostapd_scs_desc_info *info);
++#endif
++
+ void hostapd_get_ext_capa(struct hostapd_iface *iface);
+ void hostapd_get_mld_capa(struct hostapd_iface *iface);
+
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index 886a21a66..09aa1141b 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -62,6 +62,9 @@
+ #ifdef CONFIG_APUP
+ # include "apup.h"
+ #endif // def CONFIG_APUP
++#ifdef CONFIG_IEEE80211BE
++#include "scs.h"
++#endif
+
+ #ifdef CONFIG_FILS
+ static struct wpabuf *
+@@ -6247,6 +6250,9 @@ static int handle_action(struct hostapd_data *hapd,
+ hostapd_handle_radio_measurement(hapd, (const u8 *) mgmt, len);
+ return 1;
+ #endif /* CONFIG_NO_RRM */
++ case WLAN_ACTION_ROBUST_AV_STREAMING:
++ hostapd_handle_scs(hapd, (const u8 *) mgmt, len);
++ return 1;
+ }
+
+ hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
+diff --git a/src/ap/scs.c b/src/ap/scs.c
+new file mode 100644
+index 000000000..6f3c0444e
+--- /dev/null
++++ b/src/ap/scs.c
+@@ -0,0 +1,247 @@
++#include "utils/includes.h"
++
++#include "utils/common.h"
++#include "common/ieee802_11_defs.h"
++#include "common/ieee802_11_common.h"
++#include "hostapd.h"
++#include "ieee802_11.h"
++#include "sta_info.h"
++#include "ap_config.h"
++#include "ap_drv_ops.h"
++#include "scs.h"
++
++static bool hostapd_find_scs_session(struct sta_info *sta, u8 scsid,
++ u8 *session_idx)
++{
++ u8 idx;
++
++ for (idx = 0; idx < SCS_MAX_CFG_CNT; idx++) {
++ if (sta->scs_session[idx].scs_id == scsid) {
++ *session_idx = idx;
++ return sta->scs_session[idx].alive;
++ }
++ }
++
++ return false;
++}
++
++static int hostapd_find_available_scs_session(struct sta_info *sta)
++{
++ u8 idx;
++
++ for (idx = 0; idx < SCS_MAX_CFG_CNT; idx++) {
++ if (!sta->scs_session[idx].alive)
++ return idx;
++ }
++
++ return -1;
++}
++
++static bool hostapd_parse_qos_char_element(const struct element *elem,
++ struct hostapd_scs_desc_info *info)
++{
++#define SCS_DIRECTION_UPLINK 0
++ u8 id_extension = elem->data[0];
++ u32 control_info;
++
++ info->qos_ie_len = elem->datalen + 2;
++
++ if (id_extension != WLAN_EID_EXT_QOS_CHARACTERISTICS ||
++ info->qos_ie_len > sizeof(info->qos_ie))
++ return false;
++
++ control_info = WPA_GET_LE32(&elem->data[1]);
++ info->dir = control_info & 0x3;
++
++ /* Only support Uplink direction SCS request now. */
++ if (info->dir != SCS_DIRECTION_UPLINK)
++ return false;
++
++ os_memcpy(info->qos_ie, elem, info->qos_ie_len);
++
++ return true;
++}
++
++static u16 hostapd_process_scs_descriptor(struct hostapd_data *hapd,
++ struct sta_info *sta, const u8 *payload,
++ u8 scs_desc_len,
++ struct hostapd_scs_desc_info *info)
++{
++ bool scs_avail, qos_char_elem_avail = false;
++ const struct element *elem;
++ u8 session_idx;
++ int ret;
++
++ scs_avail = hostapd_find_scs_session(sta, info->id, &session_idx);
++
++ switch (info->req_type) {
++ case SCS_REQ_TYPE_ADD:
++ case SCS_REQ_TYPE_CHANGE:
++ if ((info->req_type == SCS_REQ_TYPE_ADD && scs_avail) ||
++ (info->req_type == SCS_REQ_TYPE_CHANGE && !scs_avail))
++ goto decline;
++
++ if (info->req_type == SCS_REQ_TYPE_ADD) {
++ session_idx = hostapd_find_available_scs_session(sta);
++ if (session_idx == -1) {
++ wpa_printf(MSG_ERROR, "%s: Out of SCS resource.\n",
++ __func__);
++ goto decline;
++ }
++ }
++
++ for_each_element(elem, payload + 2, scs_desc_len - 2) {
++ switch (elem->id) {
++ case WLAN_EID_EXTENSION:
++ qos_char_elem_avail =
++ hostapd_parse_qos_char_element(elem, info);
++ break;
++ default:
++ /* The rest elements would be ignored now. */
++ break;
++ }
++ }
++
++ if (!qos_char_elem_avail) {
++ wpa_printf(MSG_ERROR, "%s: The content of QoS Charactristics"
++ " element is empty or not supported yet!\n",
++ __func__);
++ goto decline;
++ }
++
++ break;
++ case SCS_REQ_TYPE_REMOVE:
++ if (!scs_avail)
++ goto decline;
++
++ break;
++ default:
++ goto decline;
++ }
++
++ ret = hostapd_drv_set_scs(hapd, info);
++ if (ret)
++ goto decline;
++
++ sta->scs_session[session_idx].scs_id = info->id;
++ sta->scs_session[session_idx].alive =
++ info->req_type == SCS_REQ_TYPE_REMOVE ? false : true;
++
++ return (info->req_type == SCS_REQ_TYPE_REMOVE) ?
++ SCS_REQ_TCLAS_PROCESSING_TERMINATED : SCS_REQ_SUCCESS;
++
++decline:
++ wpa_printf(MSG_ERROR, "%s: Decline Request Type %d\n",
++ __func__, info->req_type);
++
++ return SCS_REQ_DECLINED;
++}
++
++static void send_scs_response(struct hostapd_data *hapd,
++ struct scs_status_duple *scs_status, const u8 *da,
++ u8 dialog_token, u8 count)
++{
++ struct wpabuf *buf;
++ size_t len;
++ u8 i;
++
++ if (count == 0)
++ return;
++
++ /* Reference to 802_11be_D5.0 Figure 9-1183 */
++ len = 4 + count * sizeof(struct scs_status_duple);
++ buf = wpabuf_alloc(len);
++ if (buf == NULL)
++ return;
++
++ wpabuf_put_u8(buf, WLAN_ACTION_ROBUST_AV_STREAMING);
++ wpabuf_put_u8(buf, ROBUST_AV_SCS_RESP);
++ wpabuf_put_u8(buf, dialog_token);
++ wpabuf_put_u8(buf, count);
++
++ for (i = 0; i < count && i < SCS_MAX_CFG_CNT; i++) {
++ wpabuf_put_u8(buf, scs_status[i].scs_id);
++ wpabuf_put_le16(buf, scs_status[i].status);
++ }
++
++ len = wpabuf_len(buf);
++ hostapd_drv_send_action(hapd, hapd->iface->freq, 0, da,
++ wpabuf_head(buf), len);
++ wpabuf_free(buf);
++}
++
++static void hostapd_handle_scs_req(struct hostapd_data *hapd,
++ const u8 *buf, size_t len)
++{
++ const struct ieee80211_mgmt *mgmt = (const struct ieee80211_mgmt *) buf;
++ struct hostapd_scs_desc_info info;
++ struct sta_info *sta;
++ struct scs_status_duple scs_status_list[SCS_MAX_CFG_CNT];
++ const u8 *pos, *end;
++ u8 token, index = 0;
++ const struct element *elem;
++
++ sta = ap_get_sta(hapd, mgmt->sa);
++
++ if (!sta) {
++ wpa_printf(MSG_ERROR, "Station " MACSTR " not found "
++ "for SCS Request frame\n", MAC2STR(mgmt->sa));
++ return;
++ }
++
++ token = mgmt->u.action.u.scs.dialog_token;
++ pos = mgmt->u.action.u.scs.variable;
++
++ end = buf + len;
++ len = end - pos;
++
++ for_each_element(elem, pos, len) {
++ if (elem->id != WLAN_EID_SCS_DESCRIPTOR) {
++ wpa_printf(MSG_ERROR, "%s: no scs elem %d in scs req frame!\n",
++ __func__, WLAN_EID_SCS_DESCRIPTOR);
++ break;
++ }
++
++ info.id = elem->data[0];
++ if (!info.id) {
++ wpa_printf(MSG_ERROR, "%s: SCSID = 0 is invalid\n", __func__);
++ break;
++ }
++
++ info.req_type = elem->data[1];
++ os_memcpy(info.peer_addr, mgmt->sa, ETH_ALEN);
++ scs_status_list[index].scs_id = info.id;
++ scs_status_list[index].status =
++ hostapd_process_scs_descriptor(hapd, sta, elem->data,
++ elem->datalen, &info);
++ index++;
++ }
++
++ send_scs_response(hapd, scs_status_list, mgmt->sa, token, index);
++}
++
++void hostapd_handle_scs(struct hostapd_data *hapd, const u8 *buf, size_t len)
++{
++ const struct ieee80211_mgmt *mgmt = (const struct ieee80211_mgmt *) buf;
++
++ /*
++ * Check for enough bytes: header + (1B)Category + (1B)Action +
++ * (1B)Dialog Token.
++ */
++ if (len < IEEE80211_HDRLEN + 3) {
++ wpa_printf(MSG_ERROR, "%s SCS frame len %lu is not enough!",
++ __func__, len);
++ return;
++ }
++
++ switch (mgmt->u.action.u.scs.action) {
++ case ROBUST_AV_SCS_REQ:
++ hostapd_handle_scs_req(hapd, buf, len);
++ break;
++ case ROBUST_AV_SCS_RESP:
++ /* Not supported yet. */
++ break;
++ default:
++ break;
++ }
++}
+diff --git a/src/ap/scs.h b/src/ap/scs.h
+new file mode 100644
+index 000000000..b69190b65
+--- /dev/null
++++ b/src/ap/scs.h
+@@ -0,0 +1,30 @@
++#ifndef SCS_H
++#define SCS_H
++
++struct hostapd_data;
++
++/* Only support TUAO certification */
++#define SCS_MAX_CFG_CNT 2
++
++struct scs_status_duple {
++ u8 scs_id;
++ u16 status;
++};
++
++struct scs_session_status {
++ u8 scs_id;
++ bool alive;
++};
++
++enum scs_req_type {
++ SCS_REQ_TYPE_ADD,
++ SCS_REQ_TYPE_REMOVE,
++ SCS_REQ_TYPE_CHANGE,
++};
++
++#define SCS_REQ_SUCCESS 0
++#define SCS_REQ_DECLINED 37
++#define SCS_REQ_TCLAS_PROCESSING_TERMINATED 97
++
++void hostapd_handle_scs(struct hostapd_data *hapd, const u8 *buf, size_t len);
++#endif
+diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h
+index 60b33f049..339adf987 100644
+--- a/src/ap/sta_info.h
++++ b/src/ap/sta_info.h
+@@ -18,6 +18,10 @@
+ #include "crypto/sha384.h"
+ #include "pasn/pasn_common.h"
+
++#ifdef CONFIG_IEEE80211BE
++#include "scs.h"
++#endif
++
+ /* STA flags */
+ #define WLAN_STA_AUTH BIT(0)
+ #define WLAN_STA_ASSOC BIT(1)
+@@ -335,6 +339,7 @@ struct sta_info {
+ struct mld_info mld_info;
+ u8 mld_assoc_link_id;
+ struct sta_info *mld_assoc_sta;
++ struct scs_session_status scs_session[SCS_MAX_CFG_CNT];
+ #endif /* CONFIG_IEEE80211BE */
+
+ u16 max_idle_period; /* if nonzero, the granted BSS max idle period in
+diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
+index afcc2f861..4754d5a69 100644
+--- a/src/common/ieee802_11_defs.h
++++ b/src/common/ieee802_11_defs.h
+@@ -1196,6 +1196,11 @@ struct ieee80211_mgmt {
+ u8 action;
+ u8 variable[];
+ } STRUCT_PACKED eht_prot;
++ struct {
++ u8 action;
++ u8 dialog_token;
++ u8 variable[];
++ } STRUCT_PACKED scs;
+ } u;
+ } STRUCT_PACKED action;
+ } u;
+diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
+index 6d75d39c2..1fe459126 100644
+--- a/src/common/mtk_vendor.h
++++ b/src/common/mtk_vendor.h
+@@ -20,6 +20,7 @@ enum mtk_nl80211_vendor_subcmds {
+ MTK_NL80211_VENDOR_SUBCMD_PP_CTRL = 0xcc,
+ MTK_NL80211_VENDOR_SUBCMD_BEACON_CTRL = 0xcd,
+ MTK_NL80211_VENDOR_SUBCMD_TXPOWER_CTRL = 0xce,
++ MTK_NL80211_VENDOR_SUBCMD_SCS_CTRL = 0xd0,
+ MTK_NL80211_VENDOR_SUBCMD_EML_CTRL = 0xd3,
+ };
+
+@@ -325,6 +326,22 @@ enum mtk_vendor_attr_txpower_ctrl {
+ NUM_MTK_VENDOR_ATTRS_TXPOWER_CTRL - 1
+ };
+
++enum mtk_vendor_attr_scs_ctrl {
++ MTK_VENDOR_ATTR_SCS_CTRL_UNSPEC,
++
++ MTK_VENDOR_ATTR_SCS_ID,
++ MTK_VENDOR_ATTR_SCS_REQ_TYPE,
++ MTK_VENDOR_ATTR_SCS_DIR,
++ MTK_VENDOR_ATTR_SCS_QOS_IE,
++ MTK_VENDOR_ATTR_SCS_MAC_ADDR,
++ MTK_VENDOR_ATTR_SCS_LINK_ID,
++
++ /* keep last */
++ NUM_MTK_VENDOR_ATTRS_SCS_CTRL,
++ MTK_VENDOR_ATTR_SCS_CTRL_MAX =
++ NUM_MTK_VENDOR_ATTRS_SCS_CTRL - 1
++};
++
+ #define CSI_BW20_DATA_COUNT 64
+ #define CSI_BW40_DATA_COUNT 128
+ #define CSI_BW80_DATA_COUNT 256
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index 55f62f537..f3de2b3bc 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -70,6 +70,25 @@ enum hostapd_chan_width_attr {
+ #define HOSTAPD_DFS_REGION_ETSI 2
+ #define HOSTAPD_DFS_REGION_JP 3
+
++/**
++ * struct hostapd_scs_desc_info - SCS Req information
++ * @id: SCSID of each SCS stream
++ * @req_type: request type in SCS Descriptor element
++ * @dir: Direction in the control info of QoS Characteristics element
++ * @peer_addr: the mac addr of SCS requester station
++ * @qos_ie: QoS Characteristics IE in SCS Descriptor element
++ * @qos_ie_len: the length of QoS Characteristics element
++ */
++#define EID_EXT_QOS_CHAR_MAX_SIZE 44
++struct hostapd_scs_desc_info {
++ u8 id;
++ u8 req_type;
++ u8 dir;
++ u8 peer_addr[ETH_ALEN];
++ u8 qos_ie[EID_EXT_QOS_CHAR_MAX_SIZE];
++ u8 qos_ie_len;
++};
++
+ /**
+ * enum reg_change_initiator - Regulatory change initiator
+ */
+@@ -5424,6 +5443,13 @@ struct wpa_driver_ops {
+ int (*pp_mode_set)(void *priv, const u8 pp_mode, s8 link_id, u16 punct_bitmap);
+ #ifdef CONFIG_IEEE80211BE
+ int (*get_mld_addr)(void *priv, u8 *addr);
++ /**
++ * set_scs - Configure Stream Classification Service
++ * @priv: Private driver interface data
++ * @info: Stream classidication service configuration
++ * @link_id: MLD link id
++ */
++ int (*set_scs)(void *priv, struct hostapd_scs_desc_info *info, u8 link_id);
+ #endif
+ /**
+ * csi_set - Set csi related mode and parameter
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index 395bb5926..d2064fbd6 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -42,6 +42,10 @@
+ #include "common/mtk_vendor.h"
+ #include "ap/ap_config.h"
+
++#ifdef CONFIG_IEEE80211BE
++#include "ap/scs.h"
++#endif
++
+
+ #ifndef NETLINK_CAP_ACK
+ #define NETLINK_CAP_ACK 10
+@@ -2932,6 +2936,9 @@ static int nl80211_action_subscribe_ap(struct i802_bss *bss)
+ /* Protected EHT */
+ if (nl80211_register_action_frame(bss, (u8 *) "\x25", 1) < 0)
+ ret = -1;
++ /* Robust AV SCS Request */
++ if (nl80211_register_action_frame(bss, (u8 *) "\x13\x00", 2) < 0)
++ ret = -1;
+ /* Vendor-specific */
+ if (nl80211_register_action_frame(bss, (u8 *) "\x7f", 1) < 0)
+ ret = -1;
+@@ -15387,6 +15394,60 @@ static int nl80211_set_eml_omn(void *priv, u8 link_id, u8 *addr,
+
+ return ret;
+
++fail:
++ nlmsg_free(msg);
++ return ret;
++}
++
++static int
++nl80211_set_scs(void *priv, struct hostapd_scs_desc_info *info, u8 link_id)
++{
++ struct i802_bss *bss = priv;
++ struct wpa_driver_nl80211_data *drv = bss->drv;
++ struct nl_msg *msg;
++ struct nlattr *data;
++ int ret;
++
++ if (!drv->mtk_scs_vendor_cmd_avail) {
++ wpa_printf(MSG_ERROR,
++ "nl80211: Driver does not support scs");
++ return 0;
++ }
++
++ msg = nl80211_drv_msg(drv, 0, NL80211_CMD_VENDOR);
++ if (!msg)
++ goto fail;
++
++ if (nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_MTK) ||
++ nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
++ MTK_NL80211_VENDOR_SUBCMD_SCS_CTRL))
++ goto fail;
++
++ data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
++ if (!data)
++ goto fail;
++
++ if (nla_put_u8(msg, MTK_VENDOR_ATTR_SCS_ID, info->id) ||
++ nla_put_u8(msg, MTK_VENDOR_ATTR_SCS_REQ_TYPE, info->req_type) ||
++ nla_put(msg, MTK_VENDOR_ATTR_SCS_MAC_ADDR, ETH_ALEN, info->peer_addr) ||
++ nla_put_u8(msg, MTK_VENDOR_ATTR_SCS_LINK_ID, link_id))
++ goto fail;
++
++ if (info->req_type == SCS_REQ_TYPE_ADD ||
++ info->req_type == SCS_REQ_TYPE_CHANGE)
++ if (nla_put_u8(msg, MTK_VENDOR_ATTR_SCS_DIR, info->dir) ||
++ nla_put(msg, MTK_VENDOR_ATTR_SCS_QOS_IE, info->qos_ie_len,
++ info->qos_ie))
++ goto fail;
++
++ nla_nest_end(msg, data);
++ ret = send_and_recv_cmd(drv, msg);
++ if (ret)
++ wpa_printf(MSG_ERROR, "Failed to set scs. ret = %d (%s)",
++ ret, strerror(-ret));
++
++ return ret;
++
+ fail:
+ nlmsg_free(msg);
+ return ret;
+@@ -15830,6 +15891,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+ .pp_mode_set = nl80211_pp_mode_set,
+ #ifdef CONFIG_IEEE80211BE
+ .get_mld_addr = nl80211_get_mld_addr,
++ .set_scs = nl80211_set_scs,
+ #endif
+ .csi_set = nl80211_csi_set,
+ .csi_dump = nl80211_csi_dump,
+diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
+index d32c0ff4d..87ade150b 100644
+--- a/src/drivers/driver_nl80211.h
++++ b/src/drivers/driver_nl80211.h
+@@ -215,6 +215,7 @@ struct wpa_driver_nl80211_data {
+ unsigned int mtk_csi_vendor_cmd_avail:1;
+ unsigned int mtk_eml_vendor_cmd_avail:1;
+ unsigned int mtk_txpower_vendor_cmd_avail:1;
++ unsigned int mtk_scs_vendor_cmd_avail:1;
+
+ u32 ignore_next_local_disconnect;
+ u32 ignore_next_local_deauth;
+diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
+index fc7f9062f..5db6bf6e6 100644
+--- a/src/drivers/driver_nl80211_capa.c
++++ b/src/drivers/driver_nl80211_capa.c
+@@ -1182,6 +1182,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
+ case MTK_NL80211_VENDOR_SUBCMD_TXPOWER_CTRL:
+ drv->mtk_txpower_vendor_cmd_avail = 1;
+ break;
++ case MTK_NL80211_VENDOR_SUBCMD_SCS_CTRL:
++ drv->mtk_scs_vendor_cmd_avail = 1;
++ break;
+ }
+ }
+
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0122-mtk-hostapd-fix-6G-EHT-BW-320-channel-switch-issue.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0122-mtk-hostapd-fix-6G-EHT-BW-320-channel-switch-issue.patch
new file mode 100644
index 0000000..8358b97
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0122-mtk-hostapd-fix-6G-EHT-BW-320-channel-switch-issue.patch
@@ -0,0 +1,100 @@
+From 562e8a54538b200256ba0e0d820951d88686044b Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Mon, 5 Aug 2024 14:56:17 +0800
+Subject: [PATCH 122/126] mtk: hostapd: fix 6G EHT BW 320 channel switch issue
+
+When channel switching from BW 320 to BW 160, the op class is not
+changed for building csa after beacon.
+Therefore, hostapd_eid_eht_operation will use the old op class to fill
+the EHT operation chwidth info for csa after beacon, leading to
+disconnections for stations due to an invalid chandef.
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ src/ap/hostapd.c | 39 ++++++++++++++++++++++-----------------
+ src/drivers/driver.h | 5 +++++
+ 2 files changed, 27 insertions(+), 17 deletions(-)
+
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index 6f7f13f9f..d06a0395b 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -4496,23 +4496,26 @@ static int hostapd_change_config_freq(struct hostapd_data *hapd,
+ mode = hapd->iface->current_mode;
+
+ /* if a pointer to old_params is provided we save previous state */
+- if (old_params &&
+- hostapd_set_freq_params(old_params, conf->hw_mode,
+- hostapd_hw_get_freq(hapd, conf->channel),
+- conf->channel, conf->enable_edmg,
+- conf->edmg_channel, conf->ieee80211n,
+- conf->ieee80211ac, conf->ieee80211ax,
+- conf->ieee80211be, conf->secondary_channel,
+- hostapd_get_oper_chwidth(conf),
+- hostapd_get_oper_centr_freq_seg0_idx(conf),
+- hostapd_get_oper_centr_freq_seg1_idx(conf),
+- conf->vht_capab,
+- mode ? &mode->he_capab[IEEE80211_MODE_AP] :
+- NULL,
+- mode ? &mode->eht_capab[IEEE80211_MODE_AP] :
+- NULL,
+- hostapd_get_punct_bitmap(hapd)))
+- return -1;
++ if (old_params) {
++ if (hostapd_set_freq_params(old_params, conf->hw_mode,
++ hostapd_hw_get_freq(hapd, conf->channel),
++ conf->channel, conf->enable_edmg,
++ conf->edmg_channel, conf->ieee80211n,
++ conf->ieee80211ac, conf->ieee80211ax,
++ conf->ieee80211be, conf->secondary_channel,
++ hostapd_get_oper_chwidth(conf),
++ hostapd_get_oper_centr_freq_seg0_idx(conf),
++ hostapd_get_oper_centr_freq_seg1_idx(conf),
++ conf->vht_capab,
++ mode ? &mode->he_capab[IEEE80211_MODE_AP] :
++ NULL,
++ mode ? &mode->eht_capab[IEEE80211_MODE_AP] :
++ NULL,
++ hostapd_get_punct_bitmap(hapd)))
++ return -1;
++
++ old_params->op_class = conf->op_class;
++ }
+
+ switch (params->bandwidth) {
+ case 0:
+@@ -4557,6 +4560,7 @@ static int hostapd_change_config_freq(struct hostapd_data *hapd,
+ conf->ieee80211n = params->ht_enabled;
+ conf->ieee80211ac = params->vht_enabled;
+ conf->secondary_channel = params->sec_channel_offset;
++ conf->op_class = params->op_class;
+ if (params->center_freq1 &&
+ ieee80211_freq_to_chan(params->center_freq1, &seg0) ==
+ NUM_HOSTAPD_MODES)
+@@ -4624,6 +4628,7 @@ static int hostapd_fill_csa_settings(struct hostapd_data *hapd,
+
+ settings->freq_params.channel = chan;
+
++ settings->freq_params.op_class = hapd->iface->cs_oper_class;
+ ret = hostapd_change_config_freq(iface->bss[0], iface->conf,
+ &settings->freq_params,
+ &old_freq);
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index f3de2b3bc..829274bfe 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -907,6 +907,11 @@ struct hostapd_freq_params {
+ * link_id: If >=0 indicates the link of the AP MLD to configure
+ */
+ int link_id;
++
++ /**
++ * op_class: Operating class of the channel
++ */
++ u8 op_class;
+ };
+
+ /**
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0123-mtk-hostapd-add-puncture-bitmap-to-ucode.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0123-mtk-hostapd-add-puncture-bitmap-to-ucode.patch
new file mode 100644
index 0000000..e480428
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0123-mtk-hostapd-add-puncture-bitmap-to-ucode.patch
@@ -0,0 +1,74 @@
+From f046d62580187077b4d75c3e5f183a8ad8ad9079 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Tue, 6 Aug 2024 10:11:22 +0800
+Subject: [PATCH 123/126] mtk: hostapd: add puncture bitmap to ucode
+
+Add puncture bitmap to ucode since fw might trigger channel switch due
+to pp bitmap change.
+Therefore, the changed pp bitmap should be synchronized to extender's AP
+when root AP changes its pp bitmap.
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ src/ap/ucode.c | 4 ++++
+ src/utils/ucode.c | 2 ++
+ wpa_supplicant/ucode.c | 1 +
+ 3 files changed, 7 insertions(+)
+
+diff --git a/src/ap/ucode.c b/src/ap/ucode.c
+index 8c05404f5..0c6f4043c 100644
+--- a/src/ap/ucode.c
++++ b/src/ap/ucode.c
+@@ -726,6 +726,8 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
+ csa.freq_params.center_freq1 = intval;
+ if ((intval = ucv_int64_get(ucv_object_get(info, "center_freq2", NULL))) && !errno)
+ csa.freq_params.center_freq2 = intval;
++ if ((intval = ucv_int64_get(ucv_object_get(info, "punct_bitmap", NULL))) && !errno)
++ csa.freq_params.punct_bitmap = intval;
+
+ intval = ucv_int64_get(ucv_object_get(info, "band_idx", NULL));
+ band_idx = errno ? iface->conf->band_idx : intval;
+@@ -740,6 +742,8 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
+ csa.freq_params.center_freq1);
+ wpa_printf(MSG_INFO, " * center_freq2 is %d\n",
+ csa.freq_params.center_freq2);
++ wpa_printf(MSG_INFO, " * punct_bitmap is %d\n",
++ csa.freq_params.punct_bitmap);
+ wpa_printf(MSG_INFO, " * band_idx is %d\n",
+ band_idx);
+
+diff --git a/src/utils/ucode.c b/src/utils/ucode.c
+index 8bbbbbeff..c688d9bee 100644
+--- a/src/utils/ucode.c
++++ b/src/utils/ucode.c
+@@ -110,6 +110,7 @@ uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs)
+ uc_value_t *freq = uc_fn_arg(0);
+ uc_value_t *sec = uc_fn_arg(1);
+ int width = ucv_uint64_get(uc_fn_arg(2));
++ int punct_bitmap = ucv_uint64_get(uc_fn_arg(5));
+ int bw320_offset = 1, band_idx;
+ int freq_val, center_idx, center_ofs;
+ enum oper_chan_width chanwidth;
+@@ -185,6 +186,7 @@ uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs)
+ ucv_object_add(ret, "frequency", ucv_int64_new(freq_val));
+ ucv_object_add(ret, "oper_chwidth", ucv_int64_new(chanwidth));
+ ucv_object_add(ret, "band_idx", ucv_int64_new(band_idx));
++ ucv_object_add(ret, "punct_bitmap", ucv_int64_new(punct_bitmap));
+
+ if (chanwidth == CONF_OPER_CHWIDTH_USE_HT) {
+ center_idx = freq_val < 3000 ? 0 : channel;
+diff --git a/wpa_supplicant/ucode.c b/wpa_supplicant/ucode.c
+index 450780737..124038def 100644
+--- a/wpa_supplicant/ucode.c
++++ b/wpa_supplicant/ucode.c
+@@ -178,6 +178,7 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d
+ ucv_object_add(val, "center_freq2", ucv_int64_new(data->ch_switch.cf2));
+ ucv_object_add(val, "ch_width", ucv_int64_new(oper_chwidth));
+ ucv_object_add(val, "bw320_offset", ucv_int64_new(bw320_offset));
++ ucv_object_add(val, "punct_bitmap", ucv_int64_new(data->ch_switch.punct_bitmap));
+ ucv_object_add(val, "band_idx", ucv_int64_new(band_idx));
+ }
+
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0124-mtk-hostapd-Add-AFC-and-lpi-driver-power-support.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0124-mtk-hostapd-Add-AFC-and-lpi-driver-power-support.patch
new file mode 100644
index 0000000..357b17e
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0124-mtk-hostapd-Add-AFC-and-lpi-driver-power-support.patch
@@ -0,0 +1,832 @@
+From 330346c577b4623e52767ad0939cd735a83d9837 Mon Sep 17 00:00:00 2001
+From: Allen Ye <allen.ye@mediatek.com>
+Date: Mon, 22 Jul 2024 20:51:18 +0800
+Subject: [PATCH 124/126] mtk: hostapd: Add AFC and lpi driver power support
+
+Add AFC and lpi driver power support
+This patch parse the AFC response into mtk sku power table format and send
+it to driver by vendor cmd. The table format is like below:
+col\row bw20 bw40 ... ru26 ... ru3472
+chan 1
+chan 5
+...
+chan 233
+
+ - Once the afc procedure start failed, the device would set as lpi mode by
+telling driver lpi_sku_index to use specify sku-index in dst.
+ - Add afc_max_timeout conf is use to limit the maximum interval between the
+two afc requests.
+ - Set default use lpi & sp mode
+
+Signed-off-by: Allen Ye <allen.ye@mediatek.com>
+---
+ hostapd/config_file.c | 4 +
+ src/ap/afc.c | 365 +++++++++++++++++++++++++++++++++--
+ src/ap/ap_config.c | 3 +-
+ src/ap/ap_config.h | 2 +
+ src/ap/ap_drv_ops.c | 34 +++-
+ src/ap/hostapd.h | 60 ++++++
+ src/common/mtk_vendor.h | 2 +
+ src/drivers/driver.h | 4 +-
+ src/drivers/driver_nl80211.c | 36 +++-
+ 9 files changed, 477 insertions(+), 33 deletions(-)
+
+diff --git a/hostapd/config_file.c b/hostapd/config_file.c
+index 944669270..11c5f8947 100644
+--- a/hostapd/config_file.c
++++ b/hostapd/config_file.c
+@@ -4248,6 +4248,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+ } else if (os_strcmp(buf, "afc_op_class") == 0) {
+ if (hostapd_afc_parse_op_class(conf, pos))
+ return 1;
++ } else if (os_strcmp(buf, "afc_max_timeout") == 0) {
++ conf->afc.max_timeout = atoi(pos);
+ #endif /* CONFIG_AFC */
+ } else if (os_strcmp(buf, "mbssid") == 0) {
+ int mbssid = atoi(pos);
+@@ -5575,6 +5577,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+ conf->lpi_psd = !!en;
+ } else if (os_strcmp(buf, "sku_idx") == 0) {
+ conf->sku_idx = strtol(pos, NULL, 10);
++ } else if (os_strcmp(buf, "lpi_sku_idx") == 0) {
++ conf->lpi_sku_idx = strtol(pos, NULL, 10);
+ } else if (os_strcmp(buf, "lpi_bcn_enhance") == 0) {
+ u8 en = strtol(pos, NULL, 10);
+ conf->lpi_bcn_enhance = !!en;
+diff --git a/src/ap/afc.c b/src/ap/afc.c
+index 361ecb575..d36ce00d7 100644
+--- a/src/ap/afc.c
++++ b/src/ap/afc.c
+@@ -16,6 +16,7 @@
+ #include "hostapd.h"
+ #include "acs.h"
+ #include "hw_features.h"
++#include "ap_drv_ops.h"
+
+ #define HOSTAPD_AFC_RETRY_TIMEOUT 180
+ #define HOSTAPD_AFC_TIMEOUT 86400 /* 24h */
+@@ -749,6 +750,9 @@ static int hostapd_afc_parse_reply(struct hostapd_iface *iface, char *reply)
+ iface->afc.timeout = request_timeout;
+ if (iface->afc.timeout < 0)
+ iface->afc.timeout = HOSTAPD_AFC_RETRY_TIMEOUT;
++ else if (iface->afc.timeout > iconf->afc.max_timeout &&
++ iconf->afc.max_timeout >= HOSTAPD_AFC_RETRY_TIMEOUT)
++ iface->afc.timeout = iconf->afc.max_timeout;
+
+ return ret;
+ }
+@@ -772,6 +776,7 @@ static int hostapd_afc_send_receive(struct hostapd_iface *iface)
+ int sockfd, ret;
+ fd_set read_set;
+
++ iface->afc.timeout = HOSTAPD_AFC_RETRY_TIMEOUT;
+ if (iface->afc.data_valid) {
+ /* AFC data already downloaded from the server */
+ return 0;
+@@ -782,7 +787,6 @@ static int hostapd_afc_send_receive(struct hostapd_iface *iface)
+ return -EINVAL;
+ }
+
+- iface->afc.timeout = HOSTAPD_AFC_RETRY_TIMEOUT;
+ if (os_strlen(iconf->afc.socket) >= sizeof(addr.sun_path)) {
+ wpa_printf(MSG_ERROR, "Malformed AFC socket string %s",
+ iconf->afc.socket);
+@@ -880,7 +884,19 @@ static bool hostapd_afc_has_usable_chans(struct hostapd_iface *iface)
+ int hostapd_afc_handle_request(struct hostapd_iface *iface)
+ {
+ struct hostapd_config *iconf = iface->conf;
++ bool lpi_mode;
+ int ret;
++ int afc_status = AFC_CONTINUE;
++
++ lpi_mode = he_reg_is_indoor(iconf->he_6ghz_reg_pwr_type);
++ if (lpi_mode && !he_reg_is_sp(iconf->he_6ghz_reg_pwr_type)) {
++ iface->afc.lpi_mode = true;
++ return 1;
++ }
++
++ if (strncmp(iconf->country, "US", 2) != 0 &&
++ strncmp(iconf->country, "CA", 2) != 0)
++ return 1;
+
+ /* AFC is required just for standard power AP */
+ if (!he_reg_is_sp(iconf->he_6ghz_reg_pwr_type))
+@@ -894,34 +910,50 @@ int hostapd_afc_handle_request(struct hostapd_iface *iface)
+
+ ret = hostapd_afc_send_receive(iface);
+ if (ret < 0) {
+- /*
+- * If the connection to the AFCD failed, resched for a
+- * future attempt.
+- */
+- wpa_printf(MSG_ERROR, "AFC connection failed: %d", ret);
+- if (ret == -EIO)
+- ret = 0;
++ afc_status = lpi_mode ? AFC_LPI : AFC_DISABLE;
+ goto resched;
+ }
+
+ hostap_afc_disable_channels(iface);
+- if (!hostapd_afc_has_usable_chans(iface))
++ if (!hostapd_afc_has_usable_chans(iface)) {
++ afc_status = lpi_mode ? AFC_LPI : AFC_DISABLE;
+ goto resched;
++ }
+
+ if (!hostapd_is_usable_chans(iface)) {
+ /* Trigger an ACS freq scan */
++ afc_status = AFC_RESTART_IFACE;
+ iconf->channel = 0;
+ iface->freq = 0;
+
+ if (acs_init(iface) != HOSTAPD_CHAN_ACS) {
+ wpa_printf(MSG_ERROR, "Could not start ACS");
++ afc_status = AFC_DISABLE;
+ ret = -EINVAL;
+ }
+ } else {
++ afc_status = AFC_CONTINUE;
+ ret = 1;
+ }
+
+ resched:
++ switch(afc_status) {
++ case AFC_LPI:
++ iface->afc.lpi_mode = true;
++ hostapd_afc_enable_lpi_channels(iface);
++ ret = 1;
++ break;
++ /* Disable and restart iface would be finished in hostapd setup flow. */
++ case AFC_RESTART_IFACE:
++ ret = 0;
++ fallthrough;
++ case AFC_DISABLE:
++ case AFC_CONTINUE:
++ break;
++ default:
++ break;
++ }
++
+ eloop_cancel_timeout(hostapd_afc_timeout_handler, iface, NULL);
+ eloop_register_timeout(iface->afc.timeout, 0,
+ hostapd_afc_timeout_handler, iface, NULL);
+@@ -948,34 +980,58 @@ static void hostapd_afc_delete_data_from_server(struct hostapd_iface *iface)
+ static void hostapd_afc_timeout_handler(void *eloop_ctx, void *timeout_ctx)
+ {
+ struct hostapd_iface *iface = eloop_ctx;
+- bool restart_iface = true;
++ bool lpi_mode;
++ int afc_status = AFC_CONTINUE, ret;
++
++ lpi_mode = he_reg_is_indoor(iface->conf->he_6ghz_reg_pwr_type);
++ iface->afc.lpi_mode = false;
+
+ hostapd_afc_delete_data_from_server(iface);
+ if (iface->state != HAPD_IFACE_ENABLED) {
++ afc_status = AFC_RESTART_IFACE;
+ /* Hostapd is not fully enabled yet, toggle the interface */
+ goto restart_interface;
+ }
+
+ if (hostapd_afc_send_receive(iface) < 0 ||
+ hostapd_get_hw_features(iface)) {
+- restart_iface = false;
++ afc_status = lpi_mode ? AFC_LPI : AFC_DISABLE;
+ goto restart_interface;
+ }
+
+- if (hostapd_is_usable_chans(iface))
+- goto resched;
++ ret = hostapd_is_usable_chans(iface);
++ if (ret != 1) {
++ afc_status = lpi_mode && ret == 0 ? AFC_LPI : AFC_DISABLE;
++ goto restart_interface;
++ }
+
+- restart_iface = hostapd_afc_has_usable_chans(iface);
+- if (restart_iface) {
++ ret = hostapd_afc_has_usable_chans(iface);
++ if (ret) {
+ /* Trigger an ACS freq scan */
++ afc_status = AFC_RESTART_IFACE;
+ iface->conf->channel = 0;
+ iface->freq = 0;
+ }
+
+ restart_interface:
+- hostapd_disable_iface(iface);
+- if (restart_iface)
++ switch(afc_status) {
++ case AFC_DISABLE:
++ hostapd_disable_iface(iface);
++ break;
++ case AFC_RESTART_IFACE:
++ hostapd_disable_iface(iface);
+ hostapd_enable_iface(iface);
++ break;
++ case AFC_LPI:
++ iface->afc.lpi_mode = true;
++ hostapd_afc_enable_lpi_channels(iface);
++ hostapd_drv_txpower_ctrl(iface->bss[0]);
++ break;
++ case AFC_CONTINUE:
++ break;
++ default:
++ break;
++ }
+ resched:
+ eloop_register_timeout(iface->afc.timeout, 0,
+ hostapd_afc_timeout_handler, iface, NULL);
+@@ -1040,6 +1096,37 @@ void hostap_afc_disable_channels(struct hostapd_iface *iface)
+ }
+ }
+
++void hostapd_afc_enable_lpi_channels(struct hostapd_iface *iface)
++{
++ struct hostapd_hw_modes *mode = NULL;
++ int i;
++
++ for (i = 0; i < iface->num_hw_features; i++) {
++ mode = &iface->hw_features[i];
++ if (mode->mode == HOSTAPD_MODE_IEEE80211A &&
++ mode->is_6ghz)
++ break;
++ }
++
++ if (i == iface->num_hw_features)
++ return;
++
++ if (!he_reg_is_indoor(iface->conf->he_6ghz_reg_pwr_type))
++ return;
++
++ for (i = 0; i < mode->num_channels; i++) {
++ struct hostapd_channel_data *chan = &mode->channels[i];
++
++ if (!is_6ghz_freq(chan->freq))
++ continue;
++
++ chan->flag &= ~HOSTAPD_CHAN_DISABLED;
++ wpa_printf(MSG_MSGDUMP,
++ "Enabling freq=%d MHz for lpi mode",
++ chan->freq);
++ }
++}
++
+
+ int hostap_afc_get_chan_max_eirp_power(struct hostapd_iface *iface, bool psd,
+ int *power)
+@@ -1076,3 +1163,247 @@ int hostap_afc_get_chan_max_eirp_power(struct hostapd_iface *iface, bool psd,
+ }
+ return -EINVAL;
+ }
++
++void hostapd_afc_init_power_table(s8 ***power_table)
++{
++ int table_idx, bw;
++ s8 *chan_power_list;
++
++ /* init power table */
++ for (table_idx = 0; table_idx < MAX_CHANNEL_NUM_6G; table_idx++) {
++ chan_power_list = (*power_table)[table_idx];
++ for (bw = 0; bw < afc_power_table_num; bw++)
++ chan_power_list[bw] = AFC_INVALID_POWER;
++ }
++}
++
++int hostapd_afc_parse_psd_to_dbm(struct hostapd_iface *iface, s8 ***power_table)
++{
++ int i, freq, channel, bw, table_idx, target_power;
++ s8 *chan_power_list;
++
++ for (i = 0; i < iface->afc.num_freq_range; i++) {
++ struct afc_freq_range_elem *freq_range = &iface->afc.freq_range[i];
++
++ if (!freq_range)
++ continue;
++
++ freq = freq_range->low_freq + 10;
++ channel = hostapd_hw_get_channel(iface->bss[0], freq);
++ if (channel == 0)
++ return -EINVAL;
++
++ table_idx = channel / 4;
++
++ if (table_idx >= MAX_CHANNEL_NUM_6G)
++ return -EINVAL;
++
++ chan_power_list = (*power_table)[table_idx];
++ for (bw = 0; bw < afc_power_bw320_2; bw++) {
++ target_power = freq_range->max_psd * 2 + PSD_TO_DBM_OFFSET +
++ bw * DOUBLE_BW_POWER;
++ target_power = MIN(AFC_MAXIMUM_POWER, target_power);
++ chan_power_list[bw] = MIN(chan_power_list[bw],
++ target_power);
++ }
++ chan_power_list[afc_power_bw320_2] = chan_power_list[afc_power_bw320_1];
++ }
++ return 0;
++}
++
++int hostapd_afc_parse_eirp_to_dbm(struct hostapd_iface *iface, s8 ***power_table)
++{
++ int i, bw, table_idx, target_power;
++ s8 *chan_power_list;
++
++ for (i = 0; i < iface->afc.num_chan_info; i++) {
++ struct afc_chan_info_elem *chan_info = &iface->afc.chan_info_list[i];
++
++ if (!chan_info)
++ continue;
++
++ table_idx = chan_info->chan / 4;
++
++ if (table_idx >= MAX_CHANNEL_NUM_6G)
++ return -EINVAL;
++
++ chan_power_list = (*power_table)[table_idx];
++ target_power = MIN(AFC_MAXIMUM_POWER, chan_info->power * 2);
++ /* FIXME: wider bandwidth power is not stored. */
++ chan_power_list[afc_power_bw20] = MIN(chan_power_list[afc_power_bw20],
++ target_power);
++ }
++ return 0;
++}
++
++int afc_get_ru_be_offset(int bw, int *target_bw, int *offset)
++{
++ switch (bw) {
++ case afc_power_ru26:
++ *target_bw = afc_power_bw20;
++ *offset = RU26_OFFSET_20MHZ;
++ break;
++ case afc_power_ru52:
++ *target_bw = afc_power_bw20;
++ *offset = RU52_OFFSET_20MHZ;
++ break;
++ case afc_power_ru78:
++ *target_bw = afc_power_bw20;
++ *offset = RU78_OFFSET_20MHZ;
++ break;
++ case afc_power_ru106:
++ *target_bw = afc_power_bw20;
++ *offset = RU106_OFFSET_20MHZ;
++ break;
++ case afc_power_ru132:
++ *target_bw = afc_power_bw20;
++ *offset = RU132_OFFSET_20MHZ;
++ break;
++ case afc_power_ru726:
++ *target_bw = afc_power_bw80;
++ *offset = RU726_OFFSET_80MHZ;
++ break;
++ case afc_power_ru1480:
++ *target_bw = afc_power_bw160;
++ *offset = RU1480_OFFSET_160MHZ;
++ break;
++ case afc_power_ru1772:
++ *target_bw = afc_power_bw160;
++ *offset = RU1772_OFFSET_160MHZ;
++ break;
++ case afc_power_ru2476:
++ *target_bw = afc_power_bw320_1;
++ *offset = RU2476_OFFSET_320MHZ;
++ break;
++ case afc_power_ru2988:
++ *target_bw = afc_power_bw320_1;
++ *offset = RU2988_OFFSET_320MHZ;
++ break;
++ case afc_power_ru3472:
++ *target_bw = afc_power_bw320_1;
++ *offset = RU3472_OFFSET_320MHZ;
++ break;
++ default:
++ return -EINVAL;
++ }
++ return 0;
++}
++
++int hostapd_afc_fill_wide_bandwidth_power(s8 ***power_table)
++{
++ int table_idx, bw;
++ s8 *chan_power_list;
++
++ for (table_idx = 0; table_idx < MAX_CHANNEL_NUM_6G; table_idx++) {
++ int target_power, ru26_power;
++
++ if ((*power_table)[table_idx][afc_power_bw20] == AFC_INVALID_POWER)
++ continue;
++
++ chan_power_list = (*power_table)[table_idx];
++
++ /* Check wide bandwidth power minimum or valid. */
++ for (bw = afc_power_bw40; bw <= afc_power_bw320_2; bw++) {
++ int bw_ch_num, first_ch, last_ch;
++
++ target_power = AFC_INVALID_POWER;
++ switch (bw) {
++ case afc_power_bw40:
++ bw_ch_num = 2;
++ break;
++ case afc_power_bw80:
++ bw_ch_num = 4;
++ break;
++ case afc_power_bw160:
++ bw_ch_num = 8;
++ break;
++ case afc_power_bw320_1:
++ case afc_power_bw320_2:
++ bw_ch_num = 16;
++ break;
++ }
++ if ((bw == afc_power_bw320_1 && table_idx > 47) ||
++ (bw == afc_power_bw320_2 && table_idx < 8))
++ continue;
++
++ if (bw == afc_power_bw320_2)
++ first_ch = table_idx - (table_idx + 8) % bw_ch_num;
++ else
++ first_ch = table_idx - table_idx % bw_ch_num;
++ last_ch = first_ch + bw_ch_num;
++ for (int ch = first_ch; ch < last_ch; ch++) {
++ if ((*power_table)[ch][bw] == AFC_INVALID_POWER) {
++ target_power = AFC_INVALID_POWER;
++ break;
++ }
++ target_power = MIN((*power_table)[ch][bw], target_power);
++ }
++ chan_power_list[bw] = target_power;
++ }
++
++ /* Update remain ru */
++ for (bw = afc_power_ru26; bw < afc_power_table_num; bw++) {
++ int target_bw, offset;
++
++ if (afc_get_ru_be_offset(bw, &target_bw, &offset))
++ return -EINVAL;
++
++ if (target_bw == afc_power_bw320_1 &&
++ chan_power_list[target_bw] == AFC_INVALID_POWER)
++ target_bw++;
++
++ if (chan_power_list[target_bw] == AFC_INVALID_POWER) {
++ chan_power_list[bw] = AFC_INVALID_POWER;
++ continue;
++ }
++
++ target_power = chan_power_list[target_bw] - offset;
++ chan_power_list[bw] = target_power;
++ }
++ }
++ return 0;
++}
++
++
++int hostapd_afc_translate_table(struct hostapd_iface *iface,
++ s8 ***power_table)
++{
++ int i, ret, bw320_offset;
++
++ if (!iface->afc.data_valid)
++ return -EINVAL;
++
++ *power_table = (s8**)os_zalloc(MAX_CHANNEL_NUM_6G * sizeof(s8*));
++
++ if (!(*power_table))
++ return -ENOMEM;
++
++ for (i = 0; i < MAX_CHANNEL_NUM_6G; i++) {
++ (*power_table)[i] = (s8*)os_zalloc(afc_power_table_num * sizeof(s8));
++ if (!(*power_table)[i])
++ goto out;
++ }
++
++ hostapd_afc_init_power_table(power_table);
++
++ ret = hostapd_afc_parse_psd_to_dbm(iface, power_table);
++ if (ret)
++ goto out;
++
++ ret = hostapd_afc_parse_eirp_to_dbm(iface, power_table);
++ if (ret)
++ goto out;
++
++ ret = hostapd_afc_fill_wide_bandwidth_power(power_table);
++ if (ret)
++ goto out;
++
++ return 0;
++out:
++ for (i = 0; i < MAX_CHANNEL_NUM_6G; i++)
++ os_free((*power_table)[i]);
++
++ os_free(*power_table);
++ power_table = NULL;
++ return -ENOMEM;
++}
+diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
+index bb5ec78a1..185dae089 100644
+--- a/src/ap/ap_config.c
++++ b/src/ap/ap_config.c
+@@ -288,7 +288,7 @@ struct hostapd_config * hostapd_config_defaults(void)
+ conf->he_6ghz_max_ampdu_len_exp = 7;
+ conf->he_6ghz_rx_ant_pat = 1;
+ conf->he_6ghz_tx_ant_pat = 1;
+- conf->he_6ghz_reg_pwr_type = HE_REG_INFO_6GHZ_AP_TYPE_VLP;
++ conf->he_6ghz_reg_pwr_type = HE_REG_INFO_6GHZ_AP_TYPE_INDOOR;
+ conf->reg_def_cli_eirp_psd = -1;
+ conf->reg_sub_cli_eirp_psd = -1;
+ conf->reg_def_cli_eirp = -1;
+@@ -317,6 +317,7 @@ struct hostapd_config * hostapd_config_defaults(void)
+
+ conf->lpi_psd = 0;
+ conf->sku_idx = 0;
++ conf->lpi_sku_idx = 0;
+ conf->lpi_bcn_enhance = 0;
+
+ hostapd_set_and_check_bw320_offset(conf, 0);
+diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
+index ea8507cea..966a02d6a 100644
+--- a/src/ap/ap_config.h
++++ b/src/ap/ap_config.h
+@@ -1343,6 +1343,7 @@ struct hostapd_config {
+ unsigned int n_op_class;
+ unsigned int *op_class;
+ int min_power;
++ int max_timeout;
+ } afc;
+ #endif /* CONFIG_AFC */
+
+@@ -1358,6 +1359,7 @@ struct hostapd_config {
+ u8 band_idx;
+ u8 lpi_psd;
+ u8 sku_idx;
++ u8 lpi_sku_idx;
+ u8 lpi_bcn_enhance;
+ };
+
+diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
+index 64fd0c04c..bd710832a 100644
+--- a/src/ap/ap_drv_ops.c
++++ b/src/ap/ap_drv_ops.c
+@@ -1397,7 +1397,8 @@ int hostapd_drv_get_aval_bss_color_bmp(struct hostapd_data *hapd, u64 *aval_colo
+
+ int hostapd_drv_txpower_ctrl(struct hostapd_data *hapd)
+ {
+- s8 link_id = -1;
++ s8 link_id = -1, sku_idx = hapd->iconf->sku_idx, ret = 0, i;
++ s8 **afc_power_table = NULL;
+
+ if (!hapd->driver || !hapd->driver->txpower_ctrl)
+ return 0;
+@@ -1405,10 +1406,33 @@ int hostapd_drv_txpower_ctrl(struct hostapd_data *hapd)
+ if (hapd->conf->mld_ap)
+ link_id = hapd->mld_link_id;
+
+- return hapd->driver->txpower_ctrl(hapd->drv_priv, hapd->iconf->lpi_psd,
+- hapd->iconf->sku_idx,
+- hapd->iconf->lpi_bcn_enhance,
+- link_id);
++#ifdef CONFIG_AFC
++ if (hapd->iface->current_mode->is_6ghz &&
++ he_reg_is_sp(hapd->iface->conf->he_6ghz_reg_pwr_type) &&
++ !hapd->iface->afc.lpi_mode) {
++ ret = hostapd_afc_translate_table(hapd->iface, &afc_power_table);
++ if (ret)
++ goto out;
++ }
++
++ if (hapd->iface->afc.lpi_mode == true)
++ sku_idx = hapd->iconf->lpi_sku_idx;
++#endif /* CONFIG_AFC */
++
++ ret = hapd->driver->txpower_ctrl(hapd->drv_priv, hapd->iconf->lpi_psd,
++ sku_idx,
++ hapd->iconf->lpi_bcn_enhance,
++ link_id,
++ afc_power_table,
++ hapd->iface->afc.lpi_mode);
++#ifdef CONFIG_AFC
++out:
++ if (afc_power_table)
++ for (i = 0; i < MAX_CHANNEL_NUM_6G; i++)
++ os_free(afc_power_table[i]);
++ os_free(afc_power_table);
++#endif /* CONFIG_AFC */
++ return ret;
+ }
+
+ int hostapd_drv_ap_wireless(struct hostapd_data *hapd, u8 sub_vendor_id, int value)
+diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
+index f69fa0062..0625bb762 100644
+--- a/src/ap/hostapd.h
++++ b/src/ap/hostapd.h
+@@ -783,17 +783,71 @@ struct hostapd_iface {
+ int power;
+ } *chan_info_list;
+ bool data_valid;
++ bool lpi_mode;
+ } afc;
+ #endif /* CONFIG_AFC */
+ };
+
+ /* hostapd.c */
+ #ifdef CONFIG_AFC
++
++enum afc_state {
++ AFC_DISABLE,
++ AFC_RESTART_IFACE,
++ AFC_LPI,
++ AFC_CONTINUE,
++};
++
++#define MAX_CHANNEL_NUM_6G 59
++
++/* The power unit is 0.5 dBm */
++#define AFC_MAXIMUM_POWER 72
++#define AFC_INVALID_POWER 127
++#define PSD_TO_DBM_OFFSET 26
++#define BW20_TO_RU26_OFFSET 20
++#define DOUBLE_BW_POWER 6
++
++#define RU26_OFFSET_20MHZ 20
++#define RU52_OFFSET_20MHZ 14
++#define RU78_OFFSET_20MHZ 10
++#define RU106_OFFSET_20MHZ 8
++#define RU132_OFFSET_20MHZ 6
++
++#define RU726_OFFSET_80MHZ 2
++#define RU1480_OFFSET_160MHZ 2
++#define RU1772_OFFSET_160MHZ 1
++#define RU2476_OFFSET_320MHZ 4
++#define RU2988_OFFSET_320MHZ 2
++#define RU3472_OFFSET_320MHZ 1
++
++enum afc_table_info {
++ afc_power_bw20,
++ afc_power_bw40,
++ afc_power_bw80,
++ afc_power_bw160,
++ afc_power_bw320_1,
++ afc_power_bw320_2,
++ afc_power_ru26,
++ afc_power_ru52,
++ afc_power_ru78,
++ afc_power_ru106,
++ afc_power_ru132,
++ afc_power_ru726,
++ afc_power_ru1480,
++ afc_power_ru1772,
++ afc_power_ru2476,
++ afc_power_ru2988,
++ afc_power_ru3472,
++ afc_power_table_num,
++};
++
+ int hostap_afc_get_chan_max_eirp_power(struct hostapd_iface *iface, bool psd,
+ int *power);
+ int hostapd_afc_handle_request(struct hostapd_iface *iface);
+ void hostapd_afc_stop(struct hostapd_iface *iface);
+ void hostap_afc_disable_channels(struct hostapd_iface *iface);
++int hostapd_afc_translate_table(struct hostapd_iface *iface,
++ s8 ***power_table);
+ #else
+ static inline int
+ hostap_afc_get_chan_max_eirp_power(struct hostapd_iface *iface, bool psd,
+@@ -814,6 +868,12 @@ static inline void hostapd_afc_stop(struct hostapd_iface *iface)
+ static inline void hostap_afc_disable_channels(struct hostapd_iface *iface)
+ {
+ }
++
++int hostapd_afc_translate_table(struct hostapd_iface *iface,
++ s8 ***power_table)
++{
++ return -EINVAL;
++}
+ #endif /* CONFIG_AFC */
+
+ int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
+diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
+index 1fe459126..4b900162b 100644
+--- a/src/common/mtk_vendor.h
++++ b/src/common/mtk_vendor.h
+@@ -319,6 +319,8 @@ enum mtk_vendor_attr_txpower_ctrl {
+ MTK_VENDOR_ATTR_TXPOWER_CTRL_SKU_IDX,
+ MTK_VENDOR_ATTR_TXPOWER_CTRL_LPI_BCN_ENHANCE,
+ MTK_VENDOR_ATTR_TXPOWER_CTRL_LINK_ID,
++ MTK_VENDOR_ATTR_TXPOWER_CTRL_AFC_TABLE,
++ MTK_VENDOR_ATTR_TXPOWER_CTRL_AFC_LPI,
+
+ /* keep last */
+ NUM_MTK_VENDOR_ATTRS_TXPOWER_CTRL,
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index 829274bfe..6aac87ce1 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -5481,9 +5481,11 @@ struct wpa_driver_ops {
+ * @lpi_bcn_enhance: 1 to enable beacon duplicate enhancement in 6G lpi mode, 0 to disable enhancement
+ * @sku_idx: index used to indicate which sku table should be used
+ * @link_id: MLD link id. -1 if this is an non-MLD AP
++ * @power_table: power table generated from AFC response
++ * @lpi_mode: specify the current mode is whether lpi
+ */
+ int (*txpower_ctrl)(void *priv, u8 lpi_psd, u8 sku_idx, u8 lpi_bcn_enhance,
+- u8 link_id);
++ u8 link_id, s8 **power_table, u8 lpi_mode);
+ };
+
+ /**
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index d2064fbd6..efee210b9 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -41,6 +41,7 @@
+ #include "driver_nl80211.h"
+ #include "common/mtk_vendor.h"
+ #include "ap/ap_config.h"
++#include "ap/hostapd.h"
+
+ #ifdef CONFIG_IEEE80211BE
+ #include "ap/scs.h"
+@@ -205,6 +206,8 @@ txpower_ctrl_policy[NUM_MTK_VENDOR_ATTRS_TXPOWER_CTRL] = {
+ [MTK_VENDOR_ATTR_TXPOWER_CTRL_SKU_IDX] = { .type = NLA_U8 },
+ [MTK_VENDOR_ATTR_TXPOWER_CTRL_LPI_BCN_ENHANCE] = { .type = NLA_U8 },
+ [MTK_VENDOR_ATTR_TXPOWER_CTRL_LINK_ID] = { .type = NLA_U8 },
++ [MTK_VENDOR_ATTR_TXPOWER_CTRL_AFC_TABLE] = { .type = NLA_BINARY },
++ [MTK_VENDOR_ATTR_TXPOWER_CTRL_AFC_LPI] = { .type = NLA_U8 },
+ };
+
+ static struct nl_sock * nl_create_handle(struct nl_cb *cb, const char *dbg)
+@@ -15662,38 +15665,53 @@ fail:
+ }
+
+ static int nl80211_txpower_ctrl(void *priv, u8 lpi_psd, u8 sku_idx, u8 lpi_bcn_enhance,
+- u8 link_id)
++ u8 link_id, s8 **power_table, u8 lpi_mode)
+ {
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+ struct nl_msg *msg;
+ struct nlattr *data;
+- int ret;
++ struct nlattr *table_attr, *channel_list;
++ int ret = 0;
+
+ if (!drv->mtk_txpower_vendor_cmd_avail) {
+ wpa_printf(MSG_INFO,
+ "nl80211: Driver does not support setting txpower control");
+- return 0;
++ goto fail;
+ }
+
+ msg = nl80211_drv_msg(drv, 0, NL80211_CMD_VENDOR);
+- if (!msg)
++ if (!msg) {
++ ret = -ENOBUFS;
+ goto fail;
++ }
+
+ if (nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_MTK) ||
+ nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
+- MTK_NL80211_VENDOR_SUBCMD_TXPOWER_CTRL))
++ MTK_NL80211_VENDOR_SUBCMD_TXPOWER_CTRL)) {
++ ret = -ENOBUFS;
+ goto fail;
++ }
+
+- data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
+- if (!data)
++ data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA | NLA_F_NESTED);
++ if (!data) {
++ ret = -ENOBUFS;
+ goto fail;
++ }
+
+ nla_put_u8(msg, MTK_VENDOR_ATTR_TXPOWER_CTRL_LPI_PSD, lpi_psd);
+ nla_put_u8(msg, MTK_VENDOR_ATTR_TXPOWER_CTRL_SKU_IDX, sku_idx);
+ nla_put_u8(msg, MTK_VENDOR_ATTR_TXPOWER_CTRL_LPI_BCN_ENHANCE, lpi_bcn_enhance);
+- nla_put_u8(msg, MTK_VENDOR_ATTR_TXPOWER_CTRL_LINK_ID, link_id);
+
++ if (link_id > -1)
++ nla_put_u8(msg, MTK_VENDOR_ATTR_TXPOWER_CTRL_LINK_ID, link_id);
++
++ if (power_table && *power_table) {
++ nla_put(msg, MTK_VENDOR_ATTR_TXPOWER_CTRL_AFC_TABLE,
++ MAX_CHANNEL_NUM_6G * afc_power_table_num, power_table);
++ }
++
++ nla_put_u8(msg, MTK_VENDOR_ATTR_TXPOWER_CTRL_AFC_LPI, lpi_mode);
+ nla_nest_end(msg, data);
+ ret = send_and_recv_cmd(drv, msg);
+ if (ret)
+@@ -15704,7 +15722,7 @@ static int nl80211_txpower_ctrl(void *priv, u8 lpi_psd, u8 sku_idx, u8 lpi_bcn_e
+
+ fail:
+ nlmsg_free(msg);
+- return -ENOBUFS;
++ return ret;
+ }
+
+ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0125-mtk-hostapd-do-not-set-secondary-channel-in-HT-opera.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0125-mtk-hostapd-do-not-set-secondary-channel-in-HT-opera.patch
new file mode 100644
index 0000000..8c24366
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0125-mtk-hostapd-do-not-set-secondary-channel-in-HT-opera.patch
@@ -0,0 +1,91 @@
+From 35e67264aef9b6f050e01465ff419495198ad110 Mon Sep 17 00:00:00 2001
+From: Michael-CY Lee <michael-cy.lee@mediatek.com>
+Date: Wed, 14 Aug 2024 17:42:00 +0800
+Subject: [PATCH 125/126] mtk: hostapd: do not set secondary channel in HT
+ operation if punctured
+
+If the secondary channel is punctured, the HT operation in the beacon
+should not indicate a secondary channel offset
+(HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE or HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW)
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ src/ap/ieee802_11_ht.c | 53 ++++++++++++++++++++++++++++++++++++------
+ 1 file changed, 46 insertions(+), 7 deletions(-)
+
+diff --git a/src/ap/ieee802_11_ht.c b/src/ap/ieee802_11_ht.c
+index 7f0a00f95..1b323819e 100644
+--- a/src/ap/ieee802_11_ht.c
++++ b/src/ap/ieee802_11_ht.c
+@@ -79,6 +79,49 @@ u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid)
+ }
+
+
++void set_ht_param(struct hostapd_data *hapd, struct ieee80211_ht_operation *oper,
++ u8 chwidth)
++{
++ int secondary_channel = hapd->iconf->secondary_channel;
++#ifdef CONFIG_IEEE80211BE
++ u8 offset, chan_bit_pos;
++ u16 bw = 0, punct_bitmap = hostapd_get_punct_bitmap(hapd);
++
++ switch (chwidth) {
++ case CONF_OPER_CHWIDTH_80MHZ:
++ bw = 80;
++ offset = 6;
++ break;
++ case CONF_OPER_CHWIDTH_160MHZ:
++ bw = 160;
++ offset = 14;
++ break;
++ case CONF_OPER_CHWIDTH_320MHZ:
++ bw = 320;
++ offset = 30;
++ break;
++ default:
++ break;
++ }
++
++ chan_bit_pos = (hapd->iconf->channel -
++ hostapd_get_oper_centr_freq_seg0_idx(hapd->iconf) +
++ offset) / 4;
++ /* check if secondary channel is punctured */
++ if (bw >= 80 && punct_bitmap && secondary_channel &&
++ (punct_bitmap & BIT(chan_bit_pos + secondary_channel)))
++ return;
++#endif /* CONFIG_IEEE80211BE */
++
++ if (secondary_channel == 1)
++ oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE |
++ HT_INFO_HT_PARAM_STA_CHNL_WIDTH;
++ if (secondary_channel == -1)
++ oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
++ HT_INFO_HT_PARAM_STA_CHNL_WIDTH;
++}
++
++
+ u8 * hostapd_eid_ht_operation(struct hostapd_data *hapd, u8 *eid)
+ {
+ struct ieee80211_ht_operation *oper;
+@@ -98,15 +141,11 @@ u8 * hostapd_eid_ht_operation(struct hostapd_data *hapd, u8 *eid)
+
+ oper->primary_chan = hapd->iconf->channel;
+ oper->operation_mode = host_to_le16(hapd->iface->ht_op_mode);
+- if (hapd->iconf->secondary_channel == 1)
+- oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE |
+- HT_INFO_HT_PARAM_STA_CHNL_WIDTH;
+- if (hapd->iconf->secondary_channel == -1)
+- oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
+- HT_INFO_HT_PARAM_STA_CHNL_WIDTH;
+
+- vht_capabilities_info = host_to_le32(hapd->iface->current_mode->vht_capab);
+ chwidth = hostapd_get_oper_chwidth(hapd->iconf);
++ set_ht_param(hapd, oper, chwidth);
++
++ vht_capabilities_info = host_to_le32(hapd->iface->current_mode->vht_capab);
+ if (vht_capabilities_info & VHT_CAP_EXTENDED_NSS_BW_SUPPORT
+ && ((chwidth == CHANWIDTH_160MHZ) || (chwidth == CHANWIDTH_80P80MHZ))) {
+ oper->operation_mode = host_to_le16(hapd->iconf->vht_oper_centr_freq_seg0_idx << 5);
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0126-mtk-hostapd-Fix-hostapd-crash-in-wds-mode-during-fre.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0126-mtk-hostapd-Fix-hostapd-crash-in-wds-mode-during-fre.patch
new file mode 100644
index 0000000..cf9dd47
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/0126-mtk-hostapd-Fix-hostapd-crash-in-wds-mode-during-fre.patch
@@ -0,0 +1,40 @@
+From 6207a7d1f0601a12be9639aa3507faf10b84398a Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Thu, 15 Aug 2024 18:50:41 +0800
+Subject: [PATCH 126/126] mtk: hostapd: Fix hostapd crash in wds mode during
+ freeing sta
+
+When freeing sta in wds mode, ap_free_sta will pass NULL pointer (ifname_wds)
+to hostapd_set_wds_sta.
+The ifname_wds will directly assigned to name and being used without
+checking whether it is NULL or not in i802_set_wds_sta.
+The following hostapd patch of the openwrt trunk leads to this issue.
+https://github.com/openwrt/openwrt/commit/e80520197c9ca7bced50d3605d6baba6dead6e35
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ src/drivers/driver_nl80211.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index efee210b9..a08afb5d4 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -8603,10 +8603,13 @@ static int i802_set_wds_sta(void *priv, const u8 *addr, int aid, int val,
+ {
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+- const char *name = ifname_wds; // Kept to reduce changes to the minimum
++ char name[IFNAMSIZ + 1];
+ union wpa_event_data event;
+ int ret;
+
++ if (ifname_wds)
++ os_strlcpy(name, ifname_wds, IFNAMSIZ + 1);
++
+ wpa_printf(MSG_DEBUG, "nl80211: Set WDS STA addr=" MACSTR
+ " aid=%d val=%d name=%s", MAC2STR(addr), aid, val, name);
+ if (val) {
+--
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/patches.inc b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/patches.inc
index d61727b..dec3493 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/patches.inc
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/patches.inc
@@ -1,107 +1,129 @@
#patch patches (come from openwrt/lede/target/linux/mediatek)
SRC_URI_append = " \
- file://0001-hostapd-MLO-fix-for_each_mld_link-macro.patch \
- file://0002-hostapd-MLO-frame-link-add-command-on-per-BSS-basis.patch \
- file://0003-nl80211-Print-the-interface-name-in-debug-during-lin.patch \
- file://0004-hostapd-MLO-send-link_id-on-sta_deauth.patch \
- file://0005-hostapd-MLO-handle-auth-assoc-on-link-address.patch \
- file://0006-hostapd-MLO-reset-auth-state-machine-s-ML-info.patch \
- file://0007-hostapd-MLO-add-support-for-cohosted-ML-BSS.patch \
- file://0008-hostapd-MLO-extend-support-for-cohosted-ML-BSS.patch \
- file://0009-hostapd-MLO-pass-link_id-in-get_hapd_bssid-helper-fu.patch \
- file://0010-hostapd-MLO-pass-ctx-in-mlme_event_mgmt.patch \
- file://0011-hostapd-MLO-move-mgmt-and-control-port-Tx-status-to-.patch \
- file://0012-hostapd-make-hostapd_eapol_tx_status-function-static.patch \
- file://0013-hostapd-MLO-handle-link_id-in-EAPOL-Tx-status-handle.patch \
- file://0014-hostapd-MLO-update-all-partner-s-link-beacon.patch \
- file://0015-hostapd-MLO-skip-assoc-link-processing-in-ML-info.patch \
- file://0016-hostapd-MLO-Enhance-wpa-state-machine.patch \
- file://0017-hostapd-MLO-add-support-for-MLO-rekey.patch \
- file://0018-hostapd-MLO-send-link-id-during-flushing-stations.patch \
- file://0019-hostapd-MLO-display-link-details-in-status-command.patch \
- file://0020-hostapd-fix-RNR-building-for-co-location-and-MLO.patch \
- file://0021-tests-MLO-add-basic-cohosted-MLDs-functionality-test.patch \
- file://0022-tests-MLO-add-cohosted-MLDs-connectivity-testing.patch \
- file://0023-backport-hostapd-afcd-add-AFC-daemon-support.patch \
- file://0024-backport-hostapd-export-hostapd_is_usable_chans-util.patch \
- file://0025-backport-hostapd-ap-add-AFC-client-support.patch \
- file://0026-backport-hostapd-update-TPE-IE-according-to-AFC.patch \
- file://0027-hostapd-sync-2024-01-18-openwrt-trunk-src-folder.patch \
- file://0028-hostapd-sync-2024-01-18-openwrt-trunk-patch-folder.patch \
- file://0029-mtk-hostapd-Add-neighbor-report-and-BSS-Termination-.patch \
- file://0030-mtk-hostapd-print-sae-groups-by-hostapd-ctrl.patch \
- file://0031-mtk-hostapd-add-support-for-runtime-set-in-band-disc.patch \
- file://0032-mtk-hostapd-Add-mtk_vendor.h.patch \
- file://0033-mtk-hostapd-Support-EDCCA-hostapd-configuration.patch \
- file://0034-mtk-hostapd-Add-hostapd-MU-SET-GET-control.patch \
- file://0035-mtk-hostapd-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch \
- file://0036-mtk-hostapd-Add-hostapd-iBF-control.patch \
- file://0037-mtk-hostapd-Do-not-include-HE-capab-IE-if-associated.patch \
- file://0038-mtk-hostapd-Add-DFS-detection-mode.patch \
- file://0039-mtk-hostapd-Add-DFS-offchan-channel-switch.patch \
- file://0040-mtk-hostapd-Add-amsdu-set-get-ctrl.patch \
- file://0041-mtk-hostapd-Add-he_ldpc-configuration.patch \
- file://0042-mtk-hostapd-Add-vendor-command-attribute-for-RTS-BW-.patch \
- file://0043-mtk-hostapd-6G-band-does-not-require-DFS.patch \
- file://0044-mtk-hostapd-Fix-sending-wrong-VHT-operation-IE-in-CS.patch \
- file://0045-mtk-hostapd-Add-sta-assisted-DFS-state-update-mechan.patch \
- file://0046-mtk-hostapd-Mark-DFS-channel-as-available-for-CSA.patch \
- file://0047-mtk-hostapd-Add-available-color-bitmap.patch \
- file://0048-mtk-hostapd-Fix-ZWDFS-issue-in-BW-160.patch \
- file://0049-mtk-hostapd-Add-vendor-for-CAPI-certification-comman.patch \
- file://0050-mtk-hostapd-Air-Monitor-support-in-hostapd-by-vendor.patch \
- file://0051-mtk-hostapd-Add-muru-user-number-debug-command.patch \
- file://0052-mtk-hostapd-add-connac3-PHY-MURU-manual-mode-config-.patch \
- file://0053-mtk-hostapd-Add-HE-capabilities-check.patch \
- file://0054-mtk-hostapd-Fix-background-channel-overlapping-opera.patch \
- file://0055-mtk-hostapd-Fix-hostapd_dfs_start_cac-log.patch \
- file://0056-mtk-hostapd-Check-the-bridge-after-ioctl-SIOCBRADDIF.patch \
- file://0057-mtk-hostapd-Update-parameter_set_count-in-MU-EDCA-IE.patch \
- file://0058-mtk-hostapd-add-extension-IE-list-for-non-inherit-IE.patch \
- file://0059-mtk-hostapd-add-back-ht-vht-cap-missing-field-before.patch \
- file://0060-mtk-hostapd-Add-support-for-gtk-rekeying-in-hostapd-.patch \
- file://0061-mtk-hostapd-Set-WMM-and-TX-queue-parameters-for-wpa_.patch \
- file://0062-mtk-hostapd-Set-STA-TX-queue-parameters-configuratio.patch \
- file://0063-mtk-hostapd-avoid-color-switch-when-beacon-is-not-se.patch \
- file://0064-mtk-hostapd-6g-bss-connect-do-not-consider-ht-operat.patch \
- file://0065-mtk-hostapd-Add-ACS-chanlist-info-in-get_config.patch \
- file://0066-mtk-hostapd-Fix-RSNXE-Interop-issue-with-STA.patch \
- file://0067-mtk-hostapd-update-eht-operation-element.patch \
- file://0068-mtk-hostapd-ucode-add-support-for-ucode-to-parse-BW3.patch \
- file://0069-mtk-hostapd-synchronize-bandwidth-in-AP-STA-support.patch \
- file://0070-mtk-hostapd-Add-support-for-updating-background-chan.patch \
- file://0071-mtk-hostapd-add-zwdfs-mode-ctrl-for-eagle-efem-hwits.patch \
- file://0072-mtk-hostapd-add-support-enable-disable-preamble-punc.patch \
- file://0073-mtk-hostapd-add-no_beacon-vendor-command-for-cert.patch \
- file://0074-mtk-hostapd-WPS-added-change-to-configure-AP-PIN-loc.patch \
- file://0075-hostapd-mtk-ACS-remove-chan-freq-list-check-when-sca.patch \
- file://0076-mtk-hostapd-Fix-chan_switch-to-usable-DFS-channel-fa.patch \
- file://0077-Revert-ACS-upstream-changes.patch \
- file://0078-mtk-hostapd-ACS-Add-EHT320-and-HT40-support-fix-issu.patch \
- file://0079-mtk-hostapd-initialize-i802_bss-s-flink-freq-with-if.patch \
- file://0080-mtk-hostapd-fix-mld_assoc_link_id.patch \
- file://0081-mtk-wpa_s-correctly-get-assoc-frequency.patch \
- file://0082-mtk-wpa_s-force-MLD-STA-to-use-SAE-H2E-during-authen.patch \
- file://0083-mtk-hostapd-extend-ap_get_sta-to-find-the-correct-st.patch \
- file://0084-mtk-hostapd-update-cookie-only-when-noack-is-unset.patch \
- file://0085-mtk-wpa_s-fix-bss-selection-when-setting-mld_connect.patch \
- file://0086-mtk-hostapd-add-mld_primary-option.patch \
- file://0087-mtk-wpa_supplicant-add-mld_allowed_phy-configuration.patch \
- file://0088-mtk-hostapd-support-band_idx-option-for-set_mu-get_m.patch \
- file://0089-mtk-hostapd-Handle-DFS-radar-detection-in-MLO.patch \
- file://0090-mtk-hostapd-add-link-id-to-hostapd-cli-chan-switch.patch \
- file://0091-mtk-wifi-hostapd-add-wds-mlo-support.patch \
- file://0093-mtk-hostapd-prevent-getting-non-MLD-STA-for-other-li.patch \
- file://0094-mtk-hostapd-AP-MLD-specify-link-id-for-unicast-DEAUT.patch \
- file://0095-mtk-hostapd-using-MLD-addr-as-SA-BSSID-for-broadcast.patch \
- file://0096-mtk-hostapd-support-vht-bfee-sts-can-be-up-to-0x4.patch \
- file://0097-mtk-hostapd-fix-issue-that-tx-status-handle-with-unm.patch \
- file://0098-mtk-hostapd-add-connac3-csi-control-interface.patch \
- file://0099-fixup-mtk-wifi-hostapd-add-wds-mlo-support.patch \
- file://0100-mtk-hostapd-MLD-find-partner-links-by-BSSID-and-SSID.patch \
- file://0101-mtk-hostapd-MLD-hostapd-add-support-for-basic-MLD-Ex.patch \
- file://0102-mtk-hostapd-Refactor-static-PP-and-mld-support.patch \
- file://0103-mtk-hostapd-make-sure-all-links-are-set-before-enabl.patch \
- file://0104-mtk-hostapd-ucode-add-is_mld_finished-check.patch \
- file://0105-mtk-hostapd-free-station-when-hapd-deinit.patch \
+ file://0001-ctrl_iface-create-link-based-hapd-control-sockets.patch \
+ file://0002-ctrl_iface-MLO-introduce-MLD-level-socket.patch \
+ file://0003-hostapd_cli-MLO-pass-LINKID-in-the-command.patch \
+ file://0004-hostapd_cli-MLO-add-status-command-for-MLD-socket.patch \
+ file://0005-hostapd-afcd-add-AFC-daemon-support.patch \
+ file://0006-hostapd-export-hostapd_is_usable_chans-utility-routi.patch \
+ file://0007-hostapd-ap-add-AFC-client-support.patch \
+ file://0008-hostapd-update-TPE-IE-according-to-AFC.patch \
+ file://0009-sync-2024-06-21-openwrt-trunk-src-folder.patch \
+ file://0010-sync-2024-08-13-openwrt-trunk-patches-folder.patch \
+ file://0011-mtk-hostapd-sync-with-wireless-next.git-include-uapi.patch \
+ file://0012-mtk-hostapd-Add-neighbor-report-and-BSS-Termination-.patch \
+ file://0013-mtk-hostapd-print-some-sae-info-by-hostapd-ctrl.patch \
+ file://0014-mtk-hostapd-add-support-for-runtime-set-in-band-disc.patch \
+ file://0015-mtk-hostapd-Add-mtk_vendor.h.patch \
+ file://0016-mtk-hostapd-Support-EDCCA-hostapd-configuration.patch \
+ file://0017-mtk-hostapd-Add-hostapd-MU-SET-GET-control.patch \
+ file://0018-mtk-hostapd-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch \
+ file://0019-mtk-hostapd-Add-hostapd-iBF-control.patch \
+ file://0020-mtk-hostapd-Do-not-include-HE-capab-IE-if-associated.patch \
+ file://0021-mtk-hostapd-Add-DFS-detection-mode.patch \
+ file://0022-mtk-hostapd-Add-DFS-offchan-channel-switch.patch \
+ file://0023-mtk-hostapd-Add-amsdu-set-get-ctrl.patch \
+ file://0024-mtk-hostapd-Add-he_ldpc-configuration.patch \
+ file://0025-mtk-hostapd-6G-band-does-not-require-DFS.patch \
+ file://0026-mtk-hostapd-Fix-sending-wrong-VHT-operation-IE-in-CS.patch \
+ file://0027-mtk-hostapd-Add-sta-assisted-DFS-state-update-mechan.patch \
+ file://0028-mtk-hostapd-Mark-DFS-channel-as-available-for-CSA.patch \
+ file://0029-mtk-hostapd-Add-available-color-bitmap.patch \
+ file://0030-mtk-hostapd-Fix-ZWDFS-issue-in-BW-160.patch \
+ file://0031-mtk-hostapd-Add-vendor-for-CAPI-certification-comman.patch \
+ file://0032-mtk-hostapd-Air-Monitor-support-in-hostapd-by-vendor.patch \
+ file://0033-mtk-hostapd-Add-muru-user-number-debug-command.patch \
+ file://0034-mtk-hostapd-add-connac3-PHY-MURU-manual-mode-config-.patch \
+ file://0035-mtk-hostapd-Add-HE-capabilities-check.patch \
+ file://0036-mtk-hostapd-Fix-background-channel-overlapping-opera.patch \
+ file://0037-mtk-hostapd-Fix-hostapd_dfs_start_cac-log.patch \
+ file://0038-mtk-hostapd-Check-the-bridge-after-ioctl-SIOCBRADDIF.patch \
+ file://0039-mtk-hostapd-Update-parameter_set_count-in-MU-EDCA-IE.patch \
+ file://0040-mtk-hostapd-add-extension-IE-list-for-non-inherit-IE.patch \
+ file://0041-mtk-hostapd-add-back-ht-vht-cap-missing-field-before.patch \
+ file://0042-mtk-hostapd-Add-support-for-gtk-rekeying-in-hostapd-.patch \
+ file://0043-mtk-hostapd-Set-WMM-and-TX-queue-parameters-for-wpa_.patch \
+ file://0044-mtk-hostapd-Set-STA-TX-queue-parameters-configuratio.patch \
+ file://0045-mtk-hostapd-avoid-color-switch-when-beacon-is-not-se.patch \
+ file://0046-mtk-hostapd-6g-bss-connect-do-not-consider-ht-operat.patch \
+ file://0047-mtk-hostapd-Add-ACS-chanlist-info-in-get_config.patch \
+ file://0048-mtk-hostapd-Fix-RSNXE-Interop-issue-with-STA.patch \
+ file://0049-mtk-hostapd-update-eht-operation-element.patch \
+ file://0050-mtk-hostapd-add-support-for-ucode-to-parse-BW320MHz-.patch \
+ file://0051-mtk-hostapd-synchronize-bandwidth-in-AP-STA-support.patch \
+ file://0052-mtk-hostapd-Add-support-for-updating-background-chan.patch \
+ file://0053-mtk-hostapd-add-zwdfs-mode-ctrl-for-eagle-efem.patch \
+ file://0054-mtk-hostapd-add-support-enable-disable-preamble-punc.patch \
+ file://0055-mtk-hostapd-add-no_beacon-vendor-command-for-cert.patch \
+ file://0056-mtk-hostapd-WPS-added-change-to-configure-AP-PIN-loc.patch \
+ file://0057-mtk-hostapd-remove-chan-freq-list-check-when-scan-re.patch \
+ file://0058-mtk-hostapd-Fix-chan_switch-to-usable-DFS-channel-fa.patch \
+ file://0059-mtk-hostapd-initialize-i802_bss-s-flink-freq-with-if.patch \
+ file://0060-mtk-hostapd-fix-mld_assoc_link_id.patch \
+ file://0061-mtk-wpa_supplicant-correctly-get-assoc-frequency.patch \
+ file://0062-mtk-wpa_supplicant-force-MLD-STA-to-use-SAE-H2E-duri.patch \
+ file://0063-mtk-hostapd-extend-ap_get_sta-to-find-the-correct-st.patch \
+ file://0064-mtk-hostapd-update-cookie-only-when-noack-is-unset.patch \
+ file://0065-mtk-wpa_supplicant-fix-bss-selection-when-setting-ml.patch \
+ file://0066-mtk-hostapd-add-mld_primary-option.patch \
+ file://0067-mtk-wpa_supplicant-add-mld_allowed_phy-configuration.patch \
+ file://0068-mtk-hostapd-support-band_idx-option-for-set_mu-get_m.patch \
+ file://0069-mtk-hostapd-Handle-DFS-radar-detection-in-MLO.patch \
+ file://0070-mtk-hostapd-add-wds-mlo-support.patch \
+ file://0071-mtk-hostapd-prevent-getting-non-MLD-STA-for-other-li.patch \
+ file://0072-mtk-hostapd-specify-link-id-for-unicast-DEAUTH.patch \
+ file://0073-mtk-hostapd-using-MLD-addr-as-SA-BSSID-for-broadcast.patch \
+ file://0074-mtk-hostapd-support-vht-bfee-sts-can-be-up-to-0x4.patch \
+ file://0075-mtk-hostapd-fix-issue-that-tx-status-handle-with-unm.patch \
+ file://0076-mtk-hostapd-add-connac3-csi-control-interface.patch \
+ file://0077-mtk-hostapd-add-support-for-basic-MLD-Extender.patch \
+ file://0078-mtk-hostapd-Refactor-static-PP-and-mld-support.patch \
+ file://0079-mtk-hostapd-make-sure-all-links-are-set-before-enabl.patch \
+ file://0080-mtk-hostapd-add-hidden-SSID-support.patch \
+ file://0081-mtk-hostapd-do-not-roam-within-the-same-MLD.patch \
+ file://0082-mtk-hostapd-update-op_class-in-channel-switch-fallba.patch \
+ file://0083-mtk-hostapd-always-do-ML-probe-request-before-authen.patch \
+ file://0084-mtk-hostapd-prevent-responding-to-mgmt-while-AP-MLD-.patch \
+ file://0085-mtk-hostapd-add-critical-update-support.patch \
+ file://0086-mtk-hostapd-add-support-for-emlsr.patch \
+ file://0087-mtk-hostapd-Fix-Operating-Mode-Notification-issue-in.patch \
+ file://0088-mtk-hostapd-add-mlo-probe-client-support.patch \
+ file://0089-mtk-hostapd-add-support-for-channel-switch.patch \
+ file://0090-mtk-hostapd-extend-MLO-information-getting.patch \
+ file://0091-mtk-hostapd-refactor-the-operating-channel-width-nam.patch \
+ file://0092-mtk-hostapd-refactor-legacy-STA-getting-operating-ch.patch \
+ file://0093-mtk-hostapd-get-link-channel-information-and-synchro.patch \
+ file://0094-mtk-hostapd-adjust-Basic-EHT-MCS-and-Nss-Set-in-EHT-.patch \
+ file://0095-mtk-hostapd-fix-using-wrong-link-id-in-nl80211_set_c.patch \
+ file://0096-mtk-hostapd-Remove-BPCC-and-ML-ie-in-per-sta-profile.patch \
+ file://0097-mtk-hostapd-add-channel-switch-band-sanity-check.patch \
+ file://0098-mtk-hostapd-Fix-the-issue-with-the-presence-of-MLD_I.patch \
+ file://0099-mtk-hostapd-add-support-for-DFS-channel-switching-wi.patch \
+ file://0100-Revert-AP-MLD-Add-MLO-Link-KDE-for-each-affiliated-l.patch \
+ file://0101-mtk-hostapd-Temporary-non-inheritance-IE-solution.patch \
+ file://0102-mtk-hostapd-Fix-multiple-link-connect-get-pmkid-fail.patch \
+ file://0103-mtk-hostapd-ensure-only-a-scan-callback-is-called-on.patch \
+ file://0104-mtk-hostapd-add-support-for-get_survey-to-specify-li.patch \
+ file://0105-mtk-hostapd-sequentially-conduct-multiple-setup-ACS.patch \
+ file://0106-mtk-hostapd-find-sta_info-for-legacy-STA-associating.patch \
+ file://0107-mtk-hostapd-do-not-consider-bss-ignore-list-when-par.patch \
+ file://0108-mtk-hostapd-support-vendor-command-trig_type-and-ap_.patch \
+ file://0109-mtk-hostapd-rework-radar-event-handling.patch \
+ file://0110-mtk-hostapd-add-support-for-link-add.patch \
+ file://0111-mtk-hostapd-Fix-the-op_class-value-in-the-RNR-IE-to-.patch \
+ file://0112-mtk-hostapd-support-enable-disable-preamble-puncture.patch \
+ file://0113-mtk-hostapd-do-not-consider-ht-operation-update-for-.patch \
+ file://0114-mtk-hostapd-Add-bandwidth-indication-IE.patch \
+ file://0115-mtk-hostapd-fix-Multiple-MLDs-to-use-the-conf-s-own_.patch \
+ file://0116-mtk-hostapd-distribute-the-mgmt-rx-frame-to-bss-with.patch \
+ file://0117-mtk-hostapd-handle-5G-link-setup-after-DFS-bootup-CA.patch \
+ file://0118-mtk-hostapd-support-MLD-AP-affiliated-link-removal.patch \
+ file://0119-mtk-hostapd-add-A-TTLM-support.patch \
+ file://0120-mtk-hostapd-Add-txpower-vendor-command.patch \
+ file://0121-mtk-hostapd-Add-Triggered-Uplink-Access-Optimization.patch \
+ file://0122-mtk-hostapd-fix-6G-EHT-BW-320-channel-switch-issue.patch \
+ file://0123-mtk-hostapd-add-puncture-bitmap-to-ucode.patch \
+ file://0124-mtk-hostapd-Add-AFC-and-lpi-driver-power-support.patch \
+ file://0125-mtk-hostapd-do-not-set-secondary-channel-in-HT-opera.patch \
+ file://0126-mtk-hostapd-Fix-hostapd-crash-in-wds-mode-during-fre.patch \
"
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0048-hostapd-mtk-add-support-for-channel-switching-with-c.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0048-hostapd-mtk-add-support-for-channel-switching-with-c.patch
index fc37d6c..97e66b8 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0048-hostapd-mtk-add-support-for-channel-switching-with-c.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0048-hostapd-mtk-add-support-for-channel-switching-with-c.patch
@@ -1,4 +1,4 @@
-From 5d4d4397d0628a1aa83f83163e97ff34a0a5de43 Mon Sep 17 00:00:00 2001
+From cc405da7c2fd5176cd0423246e83a358d477e360 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Thu, 16 Nov 2023 13:18:48 +0800
Subject: [PATCH] hostapd: mtk: add support for channel switching with csa sent
@@ -8,10 +8,10 @@
---
hostapd/ctrl_iface.c | 84 +++++++++++++++++-----
src/ap/ctrl_iface_ap.c | 5 +-
- src/ap/dfs.c | 156 +++++++++++++++++++++++++++++++++++------
+ src/ap/dfs.c | 159 +++++++++++++++++++++++++++++++++++------
src/ap/dfs.h | 9 ++-
src/ap/hostapd.c | 8 ++-
- 5 files changed, 221 insertions(+), 41 deletions(-)
+ 5 files changed, 222 insertions(+), 43 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 96b593a..445cb34 100644
@@ -169,10 +169,10 @@
return -1;
}
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
-index d490032..26ce229 100644
+index d490032..e5f3974 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -248,14 +248,15 @@ static int is_in_chanlist(struct hostapd_iface *iface,
+@@ -248,22 +248,22 @@ static int is_in_chanlist(struct hostapd_iface *iface,
*/
static int dfs_find_channel(struct hostapd_iface *iface,
struct hostapd_channel_data **ret_chan,
@@ -191,7 +191,16 @@
wpa_printf(MSG_DEBUG, "DFS new chan checking %d channels", n_chans);
for (i = 0; i < mode->num_channels; i++) {
-@@ -548,7 +549,7 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
+ chan = &mode->channels[i];
+
+ /* Skip HT40/VHT incompatible channels */
+- if (iface->conf->ieee80211n &&
+- iface->conf->secondary_channel &&
++ if (iface->conf->ieee80211n && n_chans > 1 &&
+ (!dfs_is_chan_allowed(chan, n_chans) ||
+ !(chan->allowed_bw & HOSTAPD_CHAN_WIDTH_40P))) {
+ wpa_printf(MSG_DEBUG,
+@@ -548,7 +548,7 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
return NULL;
/* Get the count first */
@@ -200,7 +209,7 @@
wpa_printf(MSG_DEBUG, "DFS: num_available_chandefs=%d",
num_available_chandefs);
if (num_available_chandefs == 0)
-@@ -569,7 +570,7 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
+@@ -569,7 +569,7 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
return NULL;
chan_idx = _rand % num_available_chandefs;
@@ -209,7 +218,7 @@
if (!chan) {
wpa_printf(MSG_DEBUG, "DFS: no random channel found");
return NULL;
-@@ -599,7 +600,7 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
+@@ -599,7 +599,7 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
for (i = 0; i < num_available_chandefs - 1; i++) {
/* start from chan_idx + 1, end when chan_idx - 1 */
chan_idx2 = (chan_idx + 1 + i) % num_available_chandefs;
@@ -218,7 +227,7 @@
if (chan2 && abs(chan2->chan - chan->chan) > 12) {
/* two channels are not adjacent */
sec_chan_idx_80p80 = chan2->chan;
-@@ -1304,6 +1305,9 @@ int hostapd_dfs_pre_cac_expired(struct hostapd_iface *iface, int freq,
+@@ -1304,6 +1304,9 @@ int hostapd_dfs_pre_cac_expired(struct hostapd_iface *iface, int freq,
set_dfs_state(iface, freq, ht_enabled, chan_offset, chan_width,
cf1, cf2, HOSTAPD_CHAN_DFS_USABLE);
@@ -228,7 +237,7 @@
return 0;
}
-@@ -1717,14 +1721,15 @@ int hostapd_handle_dfs_offload(struct hostapd_iface *iface)
+@@ -1717,14 +1720,15 @@ int hostapd_handle_dfs_offload(struct hostapd_iface *iface)
}
@@ -248,7 +257,7 @@
if (!iface->conf->ieee80211h || !mode ||
mode->mode != HOSTAPD_MODE_IEEE80211A)
-@@ -1757,18 +1762,129 @@ int hostapd_is_dfs_overlap(struct hostapd_iface *iface, enum chan_width width,
+@@ -1757,18 +1761,129 @@ int hostapd_is_dfs_overlap(struct hostapd_iface *iface, enum chan_width width,
if (!(chan->flag & HOSTAPD_CHAN_RADAR))
continue;
diff --git a/recipes-wifi/wpa-supplicant/wpa-supplicant_2.10.3.bb b/recipes-wifi/wpa-supplicant/wpa-supplicant_2.10.3.bb
index 6be4eca..5b8bdd2 100644
--- a/recipes-wifi/wpa-supplicant/wpa-supplicant_2.10.3.bb
+++ b/recipes-wifi/wpa-supplicant/wpa-supplicant_2.10.3.bb
@@ -4,13 +4,13 @@
BUGTRACKER = "http://w1.fi/security/"
SECTION = "network"
LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://hostapd/README;md5=c905478466c90f1cefc0df987c40e172"
+LIC_FILES_CHKSUM = "file://hostapd/README;md5=0e430ef1be3d6eebf257cf493fc7661d"
DEPENDS = "dbus libnl-tiny ubus ucode udebug"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches-${PV}:"
-SRCREV ?= "07c9f183ea744ac04585fb6dd10220c75a5e2e74"
+SRCREV ?= "7e0e69cfeac300414ef0492bc76a2aa164443249"
SRC_URI = "git://w1.fi/hostap.git;protocol=https;branch=main \
file://wpa-supplicant.sh \
file://wpa_supplicant.conf \
@@ -19,6 +19,7 @@
file://wpa_supplicant-full.config \
file://src-${PV} \
file://002-rdkb-add-ucode-support.patch;apply=no \
+ file://003-fix_wpa_supplicant_build_issue.patch;apply=no \
"
require files/patches-${PV}/patches.inc
@@ -37,6 +38,7 @@
cd ${S}
if [ ! -e patch_applied ]; then
patch -p1 < ${WORKDIR}/002-rdkb-add-ucode-support.patch
+ patch -p1 < ${WORKDIR}/003-fix_wpa_supplicant_build_issue.patch
touch patch_applied
fi
}
@@ -82,6 +84,11 @@
echo "CONFIG_UCODE=y" >> wpa_supplicant/.config
echo "CONFIG_LIBNL20=y" >> wpa_supplicant/.config
echo "CONFIG_LIBNL_TINY=y" >> wpa_supplicant/.config
+ echo "CONFIG_TESTING_OPTIONS=y" >> wpa_supplicant/.config
+ echo "CONFIG_SAE_PK=y" >> wpa_supplicant/.config
+ echo "CONFIG_HS20=y" >> wpa_supplicant/.config
+ echo "CONFIG_HE_OVERRIDES=y" >> wpa_supplicant/.config
+ echo "CONFIG_EHT_OVERRIDES=y" >> wpa_supplicant/.config
}
do_compile () {