[rdkb][common][bsp][Refactor and sync wifi from openwrt]
[Description]
efcf684 [MAC80211][hostapd][Fix itxbfen default to disable]
de4501b [mac80211][app][Add mt7996e WED ON case support]
724b01f [MAC80211][hostapd][rebase patch based on 2023-03-29]
854dd5a [mac80211][regdb][Fix patch fail]
b9034cf [MAC80211][regdb][Add U-NII-4 support to country code vv]
32dc14f [MAC80211][regdb][Add 5G U-NII-4 in default country]
8e967da [MAC80211][mt76][Enable Wi-Fi interface when AP boots up]
2a9366f [MAC80211][hostapd][Add muru user number debug command]
813385b [MAC80211][mt76][Add muru user number debug command]
[Release-log]
Change-Id: I2d7d65905367346c8933b9c5d8672893650abc29
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch b/recipes-wifi/hostapd/files/patches-2.10.3/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch
index 6bc48ab..761fe36 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch
@@ -14,7 +14,7 @@
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -2436,7 +2436,7 @@ static int drv_supports_vht(struct wpa_s
+@@ -2621,7 +2621,7 @@ static int drv_supports_vht(struct wpa_s
}
@@ -23,7 +23,7 @@
{
int i;
-@@ -2445,7 +2445,10 @@ static bool ibss_mesh_is_80mhz_avail(int
+@@ -2630,7 +2630,10 @@ static bool ibss_mesh_is_80mhz_avail(int
chan = hw_get_channel_chan(mode, i, NULL);
if (!chan ||
@@ -35,16 +35,16 @@
return false;
}
-@@ -2474,6 +2477,8 @@ void ibss_mesh_setup_freq(struct wpa_sup
- int chwidth, seg0, seg1;
- u32 vht_caps = 0;
- bool is_24ghz, is_6ghz;
-+ bool dfs_enabled = wpa_s->conf->country[0] &&
-+ (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
-
- freq->freq = ssid->frequency;
-
-@@ -2570,8 +2575,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
+@@ -2757,7 +2760,7 @@ static void ibss_mesh_select_40mhz(struc
+ const struct wpa_ssid *ssid,
+ struct hostapd_hw_modes *mode,
+ struct hostapd_freq_params *freq,
+- int obss_scan) {
++ int obss_scan, bool dfs_enabled) {
+ int chan_idx;
+ struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL;
+ int i, res;
+@@ -2781,8 +2784,11 @@ static void ibss_mesh_select_40mhz(struc
return;
/* Check primary channel flags */
@@ -55,9 +55,9 @@
+ if (!dfs_enabled)
+ return;
- freq->channel = pri_chan->chan;
-
-@@ -2604,8 +2612,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
+ #ifdef CONFIG_HT_OVERRIDES
+ if (ssid->disable_ht40)
+@@ -2808,8 +2814,11 @@ static void ibss_mesh_select_40mhz(struc
return;
/* Check secondary channel flags */
@@ -70,25 +70,34 @@
if (ht40 == -1) {
if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS))
-@@ -2694,7 +2705,7 @@ skip_to_6ghz:
- return;
+@@ -2863,7 +2872,7 @@ static bool ibss_mesh_select_80_160mhz(s
+ const struct wpa_ssid *ssid,
+ struct hostapd_hw_modes *mode,
+ struct hostapd_freq_params *freq,
+- int ieee80211_mode, bool is_6ghz) {
++ int ieee80211_mode, bool is_6ghz, bool dfs_enabled) {
+ static const int bw80[] = {
+ 5180, 5260, 5500, 5580, 5660, 5745, 5825,
+ 5955, 6035, 6115, 6195, 6275, 6355, 6435,
+@@ -2908,7 +2917,7 @@ static bool ibss_mesh_select_80_160mhz(s
+ goto skip_80mhz;
- /* Back to HT configuration if channel not usable */
+ /* Use 40 MHz if channel not usable */
- if (!ibss_mesh_is_80mhz_avail(channel, mode))
+ if (!ibss_mesh_is_80mhz_avail(channel, mode, dfs_enabled))
- return;
+ goto skip_80mhz;
chwidth = CONF_OPER_CHWIDTH_80MHZ;
-@@ -2708,7 +2719,7 @@ skip_to_6ghz:
- * above; check the remaining four 20 MHz channels for the total
- * of 160 MHz bandwidth.
- */
-- if (!ibss_mesh_is_80mhz_avail(channel + 16, mode))
-+ if (!ibss_mesh_is_80mhz_avail(channel + 16, mode, dfs_enabled))
- return;
-
+@@ -2922,7 +2931,7 @@ static bool ibss_mesh_select_80_160mhz(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 &&
+- ibss_mesh_is_80mhz_avail(channel + 16, mode)) {
++ ibss_mesh_is_80mhz_avail(channel + 16, mode, dfs_enabled)) {
for (j = 0; j < ARRAY_SIZE(bw160); j++) {
-@@ -2738,10 +2749,12 @@ skip_to_6ghz:
+ if (freq->freq == bw160[j]) {
+ chwidth = CONF_OPER_CHWIDTH_160MHZ;
+@@ -2950,10 +2959,12 @@ static bool ibss_mesh_select_80_160mhz(s
if (!chan)
continue;
@@ -104,3 +113,23 @@
/* Found a suitable second segment for 80+80 */
chwidth = CONF_OPER_CHWIDTH_80P80MHZ;
+@@ -3008,6 +3019,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
+ int i, obss_scan = 1;
+ u8 channel;
+ bool is_6ghz;
++ bool dfs_enabled = wpa_s->conf->country[0] && (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
+
+ freq->freq = ssid->frequency;
+
+@@ -3053,9 +3065,9 @@ void ibss_mesh_setup_freq(struct wpa_sup
+ freq->channel = channel;
+ /* Setup higher BW only for 5 GHz */
+ if (mode->mode == HOSTAPD_MODE_IEEE80211A) {
+- ibss_mesh_select_40mhz(wpa_s, ssid, mode, freq, obss_scan);
++ ibss_mesh_select_40mhz(wpa_s, ssid, mode, freq, obss_scan, dfs_enabled);
+ if (!ibss_mesh_select_80_160mhz(wpa_s, ssid, mode, freq,
+- ieee80211_mode, is_6ghz))
++ ieee80211_mode, is_6ghz, dfs_enabled))
+ freq->he_enabled = freq->vht_enabled = false;
+ }
+
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/011-mesh-use-deterministic-channel-on-channel-switch.patch b/recipes-wifi/hostapd/files/patches-2.10.3/011-mesh-use-deterministic-channel-on-channel-switch.patch
index 32a4479..20a8bee 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/011-mesh-use-deterministic-channel-on-channel-switch.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/011-mesh-use-deterministic-channel-on-channel-switch.patch
@@ -29,7 +29,7 @@
enum dfs_channel_type {
-@@ -515,9 +516,14 @@ dfs_get_valid_channel(struct hostapd_ifa
+@@ -521,9 +522,14 @@ dfs_get_valid_channel(struct hostapd_ifa
int num_available_chandefs;
int chan_idx, chan_idx2;
int sec_chan_idx_80p80 = -1;
@@ -44,7 +44,7 @@
wpa_printf(MSG_DEBUG, "DFS: Selecting random channel");
*secondary_channel = 0;
*oper_centr_freq_seg0_idx = 0;
-@@ -537,8 +543,20 @@ dfs_get_valid_channel(struct hostapd_ifa
+@@ -543,8 +549,20 @@ dfs_get_valid_channel(struct hostapd_ifa
if (num_available_chandefs == 0)
return NULL;
@@ -68,7 +68,7 @@
if (!chan) {
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -9948,6 +9948,10 @@ static int nl80211_switch_channel(void *
+@@ -10739,6 +10739,10 @@ static int nl80211_switch_channel(void *
if (ret)
goto error;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/021-fix-sta-add-after-previous-connection.patch b/recipes-wifi/hostapd/files/patches-2.10.3/021-fix-sta-add-after-previous-connection.patch
index 80b23bd..827e122 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/021-fix-sta-add-after-previous-connection.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/021-fix-sta-add-after-previous-connection.patch
@@ -1,6 +1,6 @@
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
-@@ -4963,6 +4963,13 @@ static int add_associated_sta(struct hos
+@@ -4168,6 +4168,13 @@ static int add_associated_sta(struct hos
* drivers to accept the STA parameter configuration. Since this is
* after a new FT-over-DS exchange, a new TK has been derived, so key
* reinstallation is not a concern for this case.
@@ -14,7 +14,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)",
-@@ -4976,7 +4983,8 @@ static int add_associated_sta(struct hos
+@@ -4181,7 +4188,8 @@ static int add_associated_sta(struct hos
(!(sta->flags & WLAN_STA_AUTHORIZED) ||
(reassoc && sta->ft_over_ds && sta->auth_alg == WLAN_AUTH_FT) ||
(!wpa_auth_sta_ft_tk_already_set(sta->wpa_sm) &&
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/022-hostapd-fix-use-of-uninitialized-stack-variables.patch b/recipes-wifi/hostapd/files/patches-2.10.3/022-hostapd-fix-use-of-uninitialized-stack-variables.patch
index 25801da..f4f56f5 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/022-hostapd-fix-use-of-uninitialized-stack-variables.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/022-hostapd-fix-use-of-uninitialized-stack-variables.patch
@@ -14,7 +14,7 @@
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -3453,7 +3453,7 @@ static int hostapd_change_config_freq(st
+@@ -3562,7 +3562,7 @@ static int hostapd_change_config_freq(st
struct hostapd_freq_params *old_params)
{
int channel;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch b/recipes-wifi/hostapd/files/patches-2.10.3/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch
index 988fbbc..c02d4b4 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch
@@ -20,7 +20,7 @@
#include <linux/rtnetlink.h>
#include <netpacket/packet.h>
#include <linux/errqueue.h>
-@@ -5344,26 +5341,29 @@ fail:
+@@ -5590,26 +5587,29 @@ fail:
static void rtnl_neigh_delete_fdb_entry(struct i802_bss *bss, const u8 *addr)
{
@@ -64,7 +64,7 @@
if (err < 0) {
wpa_printf(MSG_DEBUG, "nl80211: bridge FDB entry delete for "
MACSTR " ifindex=%d failed: %s", MAC2STR(addr),
-@@ -5373,9 +5373,8 @@ static void rtnl_neigh_delete_fdb_entry(
+@@ -5619,9 +5619,8 @@ static void rtnl_neigh_delete_fdb_entry(
MACSTR, MAC2STR(addr));
}
@@ -76,7 +76,7 @@
}
-@@ -7763,7 +7762,6 @@ static void *i802_init(struct hostapd_da
+@@ -8275,7 +8274,6 @@ static void *i802_init(struct hostapd_da
(params->num_bridge == 0 || !params->bridge[0]))
add_ifidx(drv, br_ifindex, drv->ifindex);
@@ -84,7 +84,7 @@
if (bss->added_if_into_bridge || bss->already_in_bridge) {
int err;
-@@ -7780,7 +7778,6 @@ static void *i802_init(struct hostapd_da
+@@ -8292,7 +8290,6 @@ static void *i802_init(struct hostapd_da
goto failed;
}
}
@@ -92,7 +92,7 @@
if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) {
wpa_printf(MSG_DEBUG,
-@@ -10813,13 +10810,14 @@ static int wpa_driver_br_add_ip_neigh(vo
+@@ -11605,13 +11602,14 @@ static int wpa_driver_br_add_ip_neigh(vo
const u8 *ipaddr, int prefixlen,
const u8 *addr)
{
@@ -112,7 +112,7 @@
int res;
if (!ipaddr || prefixlen == 0 || !addr)
-@@ -10838,85 +10836,66 @@ static int wpa_driver_br_add_ip_neigh(vo
+@@ -11630,85 +11628,66 @@ static int wpa_driver_br_add_ip_neigh(vo
}
if (version == 4) {
@@ -220,7 +220,7 @@
addrsize = 16;
} else {
return -EINVAL;
-@@ -10934,41 +10913,30 @@ static int wpa_driver_br_delete_ip_neigh
+@@ -11726,41 +11705,30 @@ static int wpa_driver_br_delete_ip_neigh
return -1;
}
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/040-mesh-allow-processing-authentication-frames-in-block.patch b/recipes-wifi/hostapd/files/patches-2.10.3/040-mesh-allow-processing-authentication-frames-in-block.patch
index 6b34cd4..179d47e 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/040-mesh-allow-processing-authentication-frames-in-block.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/040-mesh-allow-processing-authentication-frames-in-block.patch
@@ -16,7 +16,7 @@
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
-@@ -3781,15 +3781,6 @@ static void handle_auth(struct hostapd_d
+@@ -2948,15 +2948,6 @@ static void handle_auth(struct hostapd_d
seq_ctrl);
return;
}
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/050-build_fix.patch b/recipes-wifi/hostapd/files/patches-2.10.3/050-build_fix.patch
index c9268f5..8680b07 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/050-build_fix.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/050-build_fix.patch
@@ -10,7 +10,7 @@
CFLAGS += -DCONFIG_FILS_SK_PFS
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
-@@ -320,6 +320,7 @@ endif
+@@ -331,6 +331,7 @@ endif
ifdef CONFIG_FILS
CFLAGS += -DCONFIG_FILS
NEED_SHA384=y
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/110-mbedtls-TLS-crypto-option-initial-port.patch b/recipes-wifi/hostapd/files/patches-2.10.3/110-mbedtls-TLS-crypto-option-initial-port.patch
index 01af14b..2210794 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/110-mbedtls-TLS-crypto-option-initial-port.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/110-mbedtls-TLS-crypto-option-initial-port.patch
@@ -273,7 +273,7 @@
ifdef CONFIG_RADIUS_SERVER
CFLAGS += -DRADIUS_SERVER
-@@ -1327,7 +1412,9 @@ NOBJS += ../src/utils/trace.o
+@@ -1329,7 +1414,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
@@ -283,7 +283,7 @@
ifdef CONFIG_INTERNAL_AES
HOBJS += ../src/crypto/aes-internal.o
HOBJS += ../src/crypto/aes-internal-enc.o
-@@ -1350,13 +1437,17 @@ SOBJS += ../src/common/sae.o
+@@ -1352,13 +1439,17 @@ SOBJS += ../src/common/sae.o
SOBJS += ../src/common/sae_pk.o
SOBJS += ../src/common/dragonfly.o
SOBJS += $(AESOBJS)
@@ -7765,7 +7765,7 @@
CONFIG_SIM_SIMULATOR=y
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
-@@ -1149,6 +1149,29 @@ endif
+@@ -1163,6 +1163,29 @@ endif
CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\"
endif
@@ -7795,7 +7795,7 @@
ifeq ($(CONFIG_TLS), gnutls)
ifndef CONFIG_CRYPTO
# default to libgcrypt
-@@ -1341,9 +1364,11 @@ endif
+@@ -1355,9 +1378,11 @@ endif
ifneq ($(CONFIG_TLS), openssl)
ifneq ($(CONFIG_TLS), wolfssl)
@@ -7807,7 +7807,7 @@
ifdef CONFIG_OPENSSL_INTERNAL_AES_WRAP
# Seems to be needed at least with BoringSSL
NEED_INTERNAL_AES_WRAP=y
-@@ -1357,9 +1382,11 @@ endif
+@@ -1371,9 +1396,11 @@ endif
ifdef NEED_INTERNAL_AES_WRAP
ifneq ($(CONFIG_TLS), linux)
@@ -7819,7 +7819,7 @@
ifdef NEED_AES_EAX
AESOBJS += ../src/crypto/aes-eax.o
NEED_AES_CTR=y
-@@ -1369,35 +1396,45 @@ AESOBJS += ../src/crypto/aes-siv.o
+@@ -1383,35 +1410,45 @@ AESOBJS += ../src/crypto/aes-siv.o
NEED_AES_CTR=y
endif
ifdef NEED_AES_CTR
@@ -7865,7 +7865,7 @@
ifdef NEED_AES_ENC
ifdef CONFIG_INTERNAL_AES
AESOBJS += ../src/crypto/aes-internal-enc.o
-@@ -1412,12 +1449,16 @@ ifneq ($(CONFIG_TLS), openssl)
+@@ -1426,12 +1463,16 @@ ifneq ($(CONFIG_TLS), openssl)
ifneq ($(CONFIG_TLS), linux)
ifneq ($(CONFIG_TLS), gnutls)
ifneq ($(CONFIG_TLS), wolfssl)
@@ -7882,7 +7882,7 @@
ifdef CONFIG_INTERNAL_SHA1
SHA1OBJS += ../src/crypto/sha1-internal.o
ifdef NEED_FIPS186_2_PRF
-@@ -1429,29 +1470,37 @@ CFLAGS += -DCONFIG_NO_PBKDF2
+@@ -1443,29 +1484,37 @@ CFLAGS += -DCONFIG_NO_PBKDF2
else
ifneq ($(CONFIG_TLS), openssl)
ifneq ($(CONFIG_TLS), wolfssl)
@@ -7920,7 +7920,7 @@
ifdef NEED_MD5
ifdef CONFIG_INTERNAL_MD5
MD5OBJS += ../src/crypto/md5-internal.o
-@@ -1506,12 +1555,17 @@ ifneq ($(CONFIG_TLS), openssl)
+@@ -1520,12 +1569,17 @@ ifneq ($(CONFIG_TLS), openssl)
ifneq ($(CONFIG_TLS), linux)
ifneq ($(CONFIG_TLS), gnutls)
ifneq ($(CONFIG_TLS), wolfssl)
@@ -7938,7 +7938,7 @@
ifdef CONFIG_INTERNAL_SHA256
SHA256OBJS += ../src/crypto/sha256-internal.o
endif
-@@ -1524,50 +1578,68 @@ CFLAGS += -DCONFIG_INTERNAL_SHA512
+@@ -1538,50 +1592,68 @@ CFLAGS += -DCONFIG_INTERNAL_SHA512
SHA256OBJS += ../src/crypto/sha512-internal.o
endif
ifdef NEED_TLS_PRF_SHA256
@@ -8007,7 +8007,7 @@
ifdef NEED_ASN1
OBJS += ../src/tls/asn1.o
-@@ -1742,10 +1814,12 @@ ifdef CONFIG_FIPS
+@@ -1756,10 +1828,12 @@ ifdef CONFIG_FIPS
CFLAGS += -DCONFIG_FIPS
ifneq ($(CONFIG_TLS), openssl)
ifneq ($(CONFIG_TLS), wolfssl)
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/120-mbedtls-fips186_2_prf.patch b/recipes-wifi/hostapd/files/patches-2.10.3/120-mbedtls-fips186_2_prf.patch
index a0d2870..a487252 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/120-mbedtls-fips186_2_prf.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/120-mbedtls-fips186_2_prf.patch
@@ -101,7 +101,7 @@
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
-@@ -1160,10 +1160,6 @@ endif
+@@ -1174,10 +1174,6 @@ endif
OBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
OBJS_p += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
OBJS_priv += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/140-tests-Makefile-make-run-tests-with-CONFIG_TLS.patch b/recipes-wifi/hostapd/files/patches-2.10.3/140-tests-Makefile-make-run-tests-with-CONFIG_TLS.patch
index 9e9e88c..148c268 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/140-tests-Makefile-make-run-tests-with-CONFIG_TLS.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/140-tests-Makefile-make-run-tests-with-CONFIG_TLS.patch
@@ -727,7 +727,7 @@
def check_ec_support(dev):
tls = dev.request("GET tls_library")
-@@ -1625,7 +1668,7 @@ def test_ap_wpa2_eap_ttls_pap_subject_ma
+@@ -1595,7 +1638,7 @@ def test_ap_wpa2_eap_ttls_pap_subject_ma
eap_connect(dev[0], hapd, "TTLS", "pap user",
anonymous_identity="ttls", password="password",
ca_cert="auth_serv/ca.pem", phase2="auth=PAP",
@@ -736,7 +736,7 @@
altsubject_match="EMAIL:noone@example.com;DNS:server.w1.fi;URI:http://example.com/")
eap_reauth(dev[0], "TTLS")
-@@ -2860,6 +2903,7 @@ def test_ap_wpa2_eap_tls_neg_domain_matc
+@@ -2830,6 +2873,7 @@ def test_ap_wpa2_eap_tls_neg_domain_matc
def test_ap_wpa2_eap_tls_neg_subject_match(dev, apdev):
"""WPA2-Enterprise negative test - subject mismatch"""
@@ -744,7 +744,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",
-@@ -2920,6 +2964,7 @@ def test_ap_wpa2_eap_tls_neg_subject_mat
+@@ -2890,6 +2934,7 @@ def test_ap_wpa2_eap_tls_neg_subject_mat
def test_ap_wpa2_eap_tls_neg_altsubject_match(dev, apdev):
"""WPA2-Enterprise negative test - altsubject mismatch"""
@@ -752,7 +752,7 @@
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
hostapd.add_ap(apdev[0], params)
-@@ -3460,7 +3505,7 @@ def test_ap_wpa2_eap_ikev2_oom(dev, apde
+@@ -3430,7 +3475,7 @@ def test_ap_wpa2_eap_ikev2_oom(dev, apde
dev[0].request("REMOVE_NETWORK all")
tls = dev[0].request("GET tls_library")
@@ -761,7 +761,7 @@
tests = [(1, "os_get_random;dh_init")]
else:
tests = [(1, "crypto_dh_init;dh_init")]
-@@ -4774,7 +4819,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca
+@@ -4744,7 +4789,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca
params["private_key"] = "auth_serv/iCA-server/server.key"
hostapd.add_ap(apdev[0], params)
tls = dev[0].request("GET tls_library")
@@ -770,7 +770,7 @@
ca_cert = "auth_serv/iCA-user/ca-and-root.pem"
client_cert = "auth_serv/iCA-user/user_and_ica.pem"
else:
-@@ -4840,6 +4885,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca
+@@ -4810,6 +4855,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca
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):
@@ -778,7 +778,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"
-@@ -4849,7 +4895,7 @@ def run_ap_wpa2_eap_tls_intermediate_ca_
+@@ -4819,7 +4865,7 @@ def run_ap_wpa2_eap_tls_intermediate_ca_
try:
hostapd.add_ap(apdev[0], params)
tls = dev[0].request("GET tls_library")
@@ -787,7 +787,7 @@
ca_cert = "auth_serv/iCA-user/ca-and-root.pem"
client_cert = "auth_serv/iCA-user/user_and_ica.pem"
else:
-@@ -4885,7 +4931,7 @@ def run_ap_wpa2_eap_tls_intermediate_ca_
+@@ -4855,7 +4901,7 @@ def run_ap_wpa2_eap_tls_intermediate_ca_
try:
hostapd.add_ap(apdev[0], params)
tls = dev[0].request("GET tls_library")
@@ -796,7 +796,7 @@
ca_cert = "auth_serv/iCA-user/ca-and-root.pem"
client_cert = "auth_serv/iCA-user/user_and_ica.pem"
else:
-@@ -4935,7 +4981,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca
+@@ -4905,7 +4951,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca
try:
hostapd.add_ap(apdev[0], params)
tls = dev[0].request("GET tls_library")
@@ -805,7 +805,7 @@
ca_cert = "auth_serv/iCA-user/ca-and-root.pem"
client_cert = "auth_serv/iCA-user/user_and_ica.pem"
else:
-@@ -5002,7 +5048,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca
+@@ -4972,7 +5018,7 @@ def test_ap_wpa2_eap_tls_intermediate_ca
hostapd.add_ap(apdev[0], params)
tls = dev[0].request("GET tls_library")
@@ -814,7 +814,7 @@
ca_cert = "auth_serv/iCA-user/ca-and-root.pem"
client_cert = "auth_serv/iCA-user/user_and_ica.pem"
else:
-@@ -5260,6 +5306,7 @@ def test_ap_wpa2_eap_ttls_server_cert_ek
+@@ -5230,6 +5276,7 @@ def test_ap_wpa2_eap_ttls_server_cert_ek
def test_ap_wpa2_eap_ttls_server_pkcs12(dev, apdev):
"""WPA2-Enterprise using EAP-TTLS and server PKCS#12 file"""
@@ -822,7 +822,7 @@
skip_with_fips(dev[0])
params = int_eap_server_params()
del params["server_cert"]
-@@ -5272,6 +5319,7 @@ def test_ap_wpa2_eap_ttls_server_pkcs12(
+@@ -5242,6 +5289,7 @@ def test_ap_wpa2_eap_ttls_server_pkcs12(
def test_ap_wpa2_eap_ttls_server_pkcs12_extra(dev, apdev):
"""EAP-TTLS and server PKCS#12 file with extra certs"""
@@ -830,7 +830,7 @@
skip_with_fips(dev[0])
params = int_eap_server_params()
del params["server_cert"]
-@@ -5294,6 +5342,7 @@ def test_ap_wpa2_eap_ttls_dh_params_serv
+@@ -5264,6 +5312,7 @@ def test_ap_wpa2_eap_ttls_dh_params_serv
def test_ap_wpa2_eap_ttls_dh_params_dsa_server(dev, apdev):
"""WPA2-Enterprise using EAP-TTLS and alternative server dhparams (DSA)"""
@@ -838,7 +838,7 @@
params = int_eap_server_params()
params["dh_file"] = "auth_serv/dsaparam.pem"
hapd = hostapd.add_ap(apdev[0], params)
-@@ -5605,8 +5654,8 @@ def test_ap_wpa2_eap_non_ascii_identity2
+@@ -5575,8 +5624,8 @@ def test_ap_wpa2_eap_non_ascii_identity2
def test_openssl_cipher_suite_config_wpas(dev, apdev):
"""OpenSSL cipher suite configuration on wpa_supplicant"""
tls = dev[0].request("GET tls_library")
@@ -849,7 +849,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",
-@@ -5632,14 +5681,14 @@ def test_openssl_cipher_suite_config_wpa
+@@ -5602,14 +5651,14 @@ def test_openssl_cipher_suite_config_wpa
def test_openssl_cipher_suite_config_hapd(dev, apdev):
"""OpenSSL cipher suite configuration on hostapd"""
tls = dev[0].request("GET tls_library")
@@ -868,7 +868,7 @@
eap_connect(dev[0], hapd, "TTLS", "pap user",
anonymous_identity="ttls", password="password",
ca_cert="auth_serv/ca.pem", phase2="auth=PAP")
-@@ -6081,13 +6130,17 @@ def test_ap_wpa2_eap_tls_versions(dev, a
+@@ -6051,13 +6100,17 @@ def test_ap_wpa2_eap_tls_versions(dev, a
check_tls_ver(dev[0], hapd,
"tls_disable_tlsv1_0=1 tls_disable_tlsv1_1=1",
"TLSv1.2")
@@ -891,7 +891,7 @@
if "run=OpenSSL 1.1.1" in tls or "run=OpenSSL 3.0" 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")
-@@ -6109,6 +6162,11 @@ def test_ap_wpa2_eap_tls_versions_server
+@@ -6079,6 +6132,11 @@ def test_ap_wpa2_eap_tls_versions_server
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]")]
@@ -903,7 +903,7 @@
for exp, flags in tests:
hapd.disable()
hapd.set("tls_flags", flags)
-@@ -7145,6 +7203,7 @@ def test_ap_wpa2_eap_assoc_rsn(dev, apde
+@@ -7115,6 +7173,7 @@ def test_ap_wpa2_eap_assoc_rsn(dev, apde
def test_eap_tls_ext_cert_check(dev, apdev):
"""EAP-TLS and external server certification validation"""
# With internal server certificate chain validation
@@ -911,7 +911,7 @@
id = dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TLS",
identity="tls user",
ca_cert="auth_serv/ca.pem",
-@@ -7157,6 +7216,7 @@ def test_eap_tls_ext_cert_check(dev, apd
+@@ -7127,6 +7186,7 @@ def test_eap_tls_ext_cert_check(dev, apd
def test_eap_ttls_ext_cert_check(dev, apdev):
"""EAP-TTLS and external server certification validation"""
# Without internal server certificate chain validation
@@ -919,7 +919,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",
-@@ -7167,6 +7227,7 @@ def test_eap_ttls_ext_cert_check(dev, ap
+@@ -7137,6 +7197,7 @@ def test_eap_ttls_ext_cert_check(dev, ap
def test_eap_peap_ext_cert_check(dev, apdev):
"""EAP-PEAP and external server certification validation"""
# With internal server certificate chain validation
@@ -927,7 +927,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",
-@@ -7177,6 +7238,7 @@ def test_eap_peap_ext_cert_check(dev, ap
+@@ -7147,6 +7208,7 @@ def test_eap_peap_ext_cert_check(dev, ap
def test_eap_fast_ext_cert_check(dev, apdev):
"""EAP-FAST and external server certification validation"""
@@ -935,7 +935,7 @@
check_eap_capa(dev[0], "FAST")
# With internal server certificate chain validation
dev[0].request("SET blob fast_pac_auth_ext ")
-@@ -7191,10 +7253,6 @@ def test_eap_fast_ext_cert_check(dev, ap
+@@ -7161,10 +7223,6 @@ def test_eap_fast_ext_cert_check(dev, ap
run_ext_cert_check(dev, apdev, id)
def run_ext_cert_check(dev, apdev, net_id):
@@ -948,7 +948,7 @@
--- a/tests/hwsim/test_ap_ft.py
+++ b/tests/hwsim/test_ap_ft.py
-@@ -2347,11 +2347,11 @@ def test_ap_ft_ap_oom5(dev, apdev):
+@@ -2471,11 +2471,11 @@ def test_ap_ft_ap_oom5(dev, apdev):
# This will fail to roam
dev[0].roam(bssid1, check_bssid=False)
@@ -992,7 +992,7 @@
raise HwsimSkip("Crypto library does not support Brainpool curves: " + tls)
capa = dev.request("GET_CAPABILITY dpp")
ver = 1
-@@ -3621,6 +3622,9 @@ def test_dpp_proto_auth_req_no_i_proto_k
+@@ -3892,6 +3893,9 @@ def test_dpp_proto_auth_req_no_i_proto_k
def test_dpp_proto_auth_req_invalid_i_proto_key(dev, apdev):
"""DPP protocol testing - invalid I-proto key in Auth Req"""
@@ -1002,7 +1002,7 @@
run_dpp_proto_auth_req_missing(dev, 66, "Invalid Initiator Protocol Key")
def test_dpp_proto_auth_req_no_i_nonce(dev, apdev):
-@@ -3716,7 +3720,12 @@ def test_dpp_proto_auth_resp_no_r_proto_
+@@ -3987,7 +3991,12 @@ def test_dpp_proto_auth_resp_no_r_proto_
def test_dpp_proto_auth_resp_invalid_r_proto_key(dev, apdev):
"""DPP protocol testing - invalid R-Proto Key in Auth Resp"""
@@ -1016,7 +1016,7 @@
def test_dpp_proto_auth_resp_no_r_nonce(dev, apdev):
"""DPP protocol testing - no R-nonce in Auth Resp"""
-@@ -4078,11 +4087,17 @@ def test_dpp_proto_pkex_exchange_resp_in
+@@ -4349,11 +4358,17 @@ def test_dpp_proto_pkex_exchange_resp_in
def test_dpp_proto_pkex_cr_req_invalid_bootstrap_key(dev, apdev):
"""DPP protocol testing - invalid Bootstrap Key in PKEX Commit-Reveal Request"""
@@ -1106,7 +1106,7 @@
raise HwsimSkip("EC group not supported")
--- a/tests/hwsim/test_pmksa_cache.py
+++ b/tests/hwsim/test_pmksa_cache.py
-@@ -954,7 +954,7 @@ def test_pmksa_cache_preauth_wpas_oom(de
+@@ -955,7 +955,7 @@ def test_pmksa_cache_preauth_wpas_oom(de
eap_connect(dev[0], hapd, "PAX", "pax.user@example.com",
password_hex="0123456789abcdef0123456789abcdef",
bssid=apdev[0]['bssid'])
@@ -1115,7 +1115,7 @@
with alloc_fail(dev[0], i, "rsn_preauth_init"):
res = dev[0].request("PREAUTH f2:11:22:33:44:55").strip()
logger.info("Iteration %d - PREAUTH command results: %s" % (i, res))
-@@ -962,7 +962,7 @@ def test_pmksa_cache_preauth_wpas_oom(de
+@@ -963,7 +963,7 @@ def test_pmksa_cache_preauth_wpas_oom(de
state = dev[0].request('GET_ALLOC_FAIL')
if state.startswith('0:'):
break
@@ -1138,7 +1138,7 @@
heavy_groups = [14, 15, 16]
suitable_groups = [15, 16, 17, 18, 19, 20, 21]
groups = [str(g) for g in sae_groups]
-@@ -2122,6 +2127,8 @@ def run_sae_pwe_group(dev, apdev, group)
+@@ -2188,6 +2193,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")
@@ -1149,7 +1149,7 @@
start_sae_pwe_ap(apdev[0], group, 2)
--- a/tests/hwsim/test_suite_b.py
+++ b/tests/hwsim/test_suite_b.py
-@@ -26,6 +26,8 @@ def check_suite_b_tls_lib(dev, dhe=False
+@@ -27,6 +27,8 @@ def check_suite_b_tls_lib(dev, dhe=False
return
if tls.startswith("wolfSSL"):
return
@@ -1158,7 +1158,7 @@
if not tls.startswith("OpenSSL"):
raise HwsimSkip("TLS library not supported for Suite B: " + tls)
supported = False
-@@ -499,6 +501,7 @@ def test_suite_b_192_rsa_insufficient_dh
+@@ -520,6 +522,7 @@ def test_suite_b_192_rsa_insufficient_dh
dev[0].connect("test-suite-b", key_mgmt="WPA-EAP-SUITE-B-192",
ieee80211w="2",
@@ -1168,7 +1168,7 @@
ca_cert="auth_serv/rsa3072-ca.pem",
--- a/tests/hwsim/test_wpas_ctrl.py
+++ b/tests/hwsim/test_wpas_ctrl.py
-@@ -1834,7 +1834,7 @@ def _test_wpas_ctrl_oom(dev):
+@@ -1842,7 +1842,7 @@ def _test_wpas_ctrl_oom(dev):
tls = dev[0].request("GET tls_library")
if not tls.startswith("internal"):
tests.append(('NFC_GET_HANDOVER_SEL NDEF P2P-CR-TAG', 'FAIL',
@@ -1179,7 +1179,7 @@
res = dev[0].request(cmd)
--- a/tests/hwsim/utils.py
+++ b/tests/hwsim/utils.py
-@@ -135,7 +135,13 @@ def check_fils_sk_pfs_capa(dev):
+@@ -141,7 +141,13 @@ def check_imsi_privacy_support(dev):
def check_tls_tod(dev):
tls = dev.request("GET tls_library")
@@ -1308,7 +1308,7 @@
if (need_more_data) {
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
-@@ -1108,6 +1108,7 @@ CFLAGS += -DCONFIG_TLSV12
+@@ -1122,6 +1122,7 @@ CFLAGS += -DCONFIG_TLSV12
endif
ifeq ($(CONFIG_TLS), wolfssl)
@@ -1316,7 +1316,7 @@
ifdef TLS_FUNCS
CFLAGS += -DWOLFSSL_DER_LOAD
OBJS += ../src/crypto/tls_wolfssl.o
-@@ -1123,6 +1124,7 @@ LIBS_p += -lwolfssl -lm
+@@ -1137,6 +1138,7 @@ LIBS_p += -lwolfssl -lm
endif
ifeq ($(CONFIG_TLS), openssl)
@@ -1324,7 +1324,7 @@
CFLAGS += -DCRYPTO_RSA_OAEP_SHA256
ifdef TLS_FUNCS
CFLAGS += -DEAP_TLS_OPENSSL
-@@ -1150,6 +1152,7 @@ CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONF
+@@ -1164,6 +1166,7 @@ CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONF
endif
ifeq ($(CONFIG_TLS), mbedtls)
@@ -1332,7 +1332,7 @@
ifndef CONFIG_CRYPTO
CONFIG_CRYPTO=mbedtls
endif
-@@ -1169,6 +1172,7 @@ endif
+@@ -1183,6 +1186,7 @@ endif
endif
ifeq ($(CONFIG_TLS), gnutls)
@@ -1340,7 +1340,7 @@
ifndef CONFIG_CRYPTO
# default to libgcrypt
CONFIG_CRYPTO=gnutls
-@@ -1199,6 +1203,7 @@ endif
+@@ -1213,6 +1217,7 @@ endif
endif
ifeq ($(CONFIG_TLS), internal)
@@ -1348,7 +1348,7 @@
ifndef CONFIG_CRYPTO
CONFIG_CRYPTO=internal
endif
-@@ -1279,6 +1284,7 @@ endif
+@@ -1293,6 +1298,7 @@ endif
endif
ifeq ($(CONFIG_TLS), linux)
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/150-add-NULL-checks-encountered-during-tests-hwsim.patch b/recipes-wifi/hostapd/files/patches-2.10.3/150-add-NULL-checks-encountered-during-tests-hwsim.patch
index 361f726..c8c3ff3 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/150-add-NULL-checks-encountered-during-tests-hwsim.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/150-add-NULL-checks-encountered-during-tests-hwsim.patch
@@ -14,7 +14,7 @@
--- a/src/common/dpp_crypto.c
+++ b/src/common/dpp_crypto.c
-@@ -248,6 +248,12 @@ struct crypto_ec_key * dpp_set_pubkey_po
+@@ -269,6 +269,12 @@ int dpp_get_pubkey_hash(struct crypto_ec
struct crypto_ec_key * dpp_gen_keypair(const struct dpp_curve_params *curve)
{
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/160-dpp_pkex-EC-point-mul-w-value-prime.patch b/recipes-wifi/hostapd/files/patches-2.10.3/160-dpp_pkex-EC-point-mul-w-value-prime.patch
index 56ae8d0..db4fcfe 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/160-dpp_pkex-EC-point-mul-w-value-prime.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/160-dpp_pkex-EC-point-mul-w-value-prime.patch
@@ -13,7 +13,7 @@
--- a/src/common/dpp_crypto.c
+++ b/src/common/dpp_crypto.c
-@@ -1567,7 +1567,9 @@ dpp_pkex_derive_Qr(const struct dpp_curv
+@@ -1588,7 +1588,9 @@ dpp_pkex_derive_Qr(const struct dpp_curv
Pr = crypto_ec_key_get_public_key(Pr_key);
Qr = crypto_ec_point_init(ec);
hash_bn = crypto_bignum_init_set(hash, curve->hash_len);
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/170-DPP-fix-memleak-of-intro.peer_key.patch b/recipes-wifi/hostapd/files/patches-2.10.3/170-DPP-fix-memleak-of-intro.peer_key.patch
deleted file mode 100644
index 157347d..0000000
--- a/recipes-wifi/hostapd/files/patches-2.10.3/170-DPP-fix-memleak-of-intro.peer_key.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 639bb1bb912029ec4ff110c3ed807b62f583d6bf Mon Sep 17 00:00:00 2001
-From: Glenn Strauss <gstrauss@gluelogic.com>
-Date: Sun, 9 Oct 2022 04:02:44 -0400
-Subject: [PATCH 7/7] DPP: fix memleak of intro.peer_key
-
-fix memleak of intro.peer_key in wpas_dpp_rx_peer_disc_resp()
-
-Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
----
- wpa_supplicant/dpp_supplicant.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
---- a/wpa_supplicant/dpp_supplicant.c
-+++ b/wpa_supplicant/dpp_supplicant.c
-@@ -2610,6 +2610,8 @@ static void wpas_dpp_rx_peer_disc_resp(s
- return;
- }
-
-+ os_memset(&intro, 0, sizeof(intro));
-+
- trans_id = dpp_get_attr(buf, len, DPP_ATTR_TRANSACTION_ID,
- &trans_id_len);
- if (!trans_id || trans_id_len != 1) {
-@@ -2720,7 +2722,7 @@ static void wpas_dpp_rx_peer_disc_resp(s
- wpa_supplicant_req_scan(wpa_s, 0, 0);
- }
- fail:
-- os_memset(&intro, 0, sizeof(intro));
-+ dpp_peer_intro_deinit(&intro);
- }
-
-
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/170-wpa_supplicant-fix-compiling-without-IEEE8021X_EAPOL.patch b/recipes-wifi/hostapd/files/patches-2.10.3/170-wpa_supplicant-fix-compiling-without-IEEE8021X_EAPOL.patch
new file mode 100644
index 0000000..7724f1a
--- /dev/null
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/170-wpa_supplicant-fix-compiling-without-IEEE8021X_EAPOL.patch
@@ -0,0 +1,41 @@
+From c85ce84d942e1eabde33e120b18e5b1f1637b76e Mon Sep 17 00:00:00 2001
+From: Nick Hainke <vincent@systemli.org>
+Date: Tue, 14 Mar 2023 21:40:53 +0100
+Subject: [PATCH] wpa_supplicant: fix compiling without IEEE8021X_EAPOL
+
+If IEEE8021X_EAPOL is not defined wpa_supplicant will not compile with
+following error:
+
+ events.c: In function 'wpa_supplicant_connect':
+ events.c:1827:14: warning: implicit declaration of function 'eap_is_wps_pbc_enrollee' [-Wimplicit-function-declaration]
+ 1827 | if ((eap_is_wps_pbc_enrollee(&ssid->eap) &&
+ | ^~~~~~~~~~~~~~~~~~~~~~~
+ events.c:1827:43: error: 'struct wpa_ssid' has no member named 'eap'
+ 1827 | if ((eap_is_wps_pbc_enrollee(&ssid->eap) &&
+ | ^~
+
+Adding ifdef statements around the calling function fixes the issue.
+
+Signed-off-by: Nick Hainke <vincent@systemli.org>
+---
+ wpa_supplicant/events.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/wpa_supplicant/events.c
++++ b/wpa_supplicant/events.c
+@@ -1824,6 +1824,7 @@ int wpa_supplicant_connect(struct wpa_su
+ struct wpa_bss *selected,
+ struct wpa_ssid *ssid)
+ {
++#ifdef IEEE8021X_EAPOL
+ if ((eap_is_wps_pbc_enrollee(&ssid->eap) &&
+ wpas_wps_partner_link_overlap_detect(wpa_s)) ||
+ wpas_wps_scan_pbc_overlap(wpa_s, selected, ssid)) {
+@@ -1846,6 +1847,7 @@ int wpa_supplicant_connect(struct wpa_su
+ #endif /* CONFIG_WPS */
+ return -1;
+ }
++#endif /* IEEE8021X_EAPOL */
+
+ wpa_msg(wpa_s, MSG_DEBUG,
+ "Considering connect request: reassociate: %d selected: "
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/200-multicall.patch b/recipes-wifi/hostapd/files/patches-2.10.3/200-multicall.patch
index 0db8caa..f12aeb0 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/200-multicall.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/200-multicall.patch
@@ -36,7 +36,7 @@
LIBS += $(DRV_AP_LIBS)
ifdef CONFIG_L2_PACKET
-@@ -1378,6 +1384,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
+@@ -1380,6 +1386,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
_OBJS_VAR := OBJS
include ../src/objs.mk
@@ -49,7 +49,7 @@
hostapd: $(OBJS)
$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
@$(E) " LD " $@
-@@ -1458,6 +1470,12 @@ include ../src/objs.mk
+@@ -1460,6 +1472,12 @@ include ../src/objs.mk
_OBJS_VAR := SOBJS
include ../src/objs.mk
@@ -71,8 +71,8 @@
+-include $(if $(MULTICALL),../hostapd/.config)
include ../src/build.rules
- ifdef CONFIG_BUILD_WPA_CLIENT_SO
-@@ -371,7 +372,9 @@ endif
+ ifdef CONFIG_BUILD_PASN_SO
+@@ -382,7 +383,9 @@ endif
ifdef CONFIG_IBSS_RSN
NEED_RSN_AUTHENTICATOR=y
CFLAGS += -DCONFIG_IBSS_RSN
@@ -82,7 +82,7 @@
OBJS += ibss_rsn.o
endif
-@@ -912,6 +915,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
+@@ -924,6 +927,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
LIBS += -ldl -rdynamic
endif
@@ -93,7 +93,7 @@
endif
ifdef CONFIG_AP
-@@ -919,9 +926,11 @@ NEED_EAP_COMMON=y
+@@ -931,9 +938,11 @@ NEED_EAP_COMMON=y
NEED_RSN_AUTHENTICATOR=y
CFLAGS += -DCONFIG_AP
OBJS += ap.o
@@ -105,7 +105,7 @@
OBJS += ../src/ap/hostapd.o
OBJS += ../src/ap/wpa_auth_glue.o
OBJS += ../src/ap/utils.o
-@@ -1008,6 +1017,12 @@ endif
+@@ -1022,6 +1031,12 @@ endif
ifdef CONFIG_HS20
OBJS += ../src/ap/hs20.o
endif
@@ -118,7 +118,7 @@
endif
ifdef CONFIG_MBO
-@@ -1016,7 +1031,9 @@ CFLAGS += -DCONFIG_MBO
+@@ -1030,7 +1045,9 @@ CFLAGS += -DCONFIG_MBO
endif
ifdef NEED_RSN_AUTHENTICATOR
@@ -128,7 +128,7 @@
NEED_AES_WRAP=y
OBJS += ../src/ap/wpa_auth.o
OBJS += ../src/ap/wpa_auth_ie.o
-@@ -1996,6 +2013,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
+@@ -2010,6 +2027,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
_OBJS_VAR := OBJS
include ../src/objs.mk
@@ -141,7 +141,7 @@
wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
@$(E) " LD " $@
-@@ -2128,6 +2151,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK)
+@@ -2142,6 +2165,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK)
$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
@$(E) " sed" $<
@@ -156,7 +156,7 @@
wpa_cli.exe: wpa_cli
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -6171,8 +6171,8 @@ union wpa_event_data {
+@@ -6544,8 +6544,8 @@ union wpa_event_data {
* Driver wrapper code should call this function whenever an event is received
* from the driver.
*/
@@ -167,7 +167,7 @@
/**
* wpa_supplicant_event_global - Report a driver event for wpa_supplicant
-@@ -6184,7 +6184,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -6557,7 +6557,7 @@ void wpa_supplicant_event(void *ctx, enu
* Same as wpa_supplicant_event(), but we search for the interface in
* wpa_global.
*/
@@ -178,7 +178,7 @@
/*
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
-@@ -1872,8 +1872,8 @@ err:
+@@ -1887,8 +1887,8 @@ err:
#endif /* CONFIG_OWE */
@@ -189,7 +189,7 @@
{
struct hostapd_data *hapd = ctx;
#ifndef CONFIG_NO_STDOUT_DEBUG
-@@ -2145,7 +2145,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -2161,7 +2161,7 @@ void wpa_supplicant_event(void *ctx, enu
}
@@ -200,7 +200,7 @@
struct hapd_interfaces *interfaces = ctx;
--- a/wpa_supplicant/wpa_priv.c
+++ b/wpa_supplicant/wpa_priv.c
-@@ -1038,8 +1038,8 @@ static void wpa_priv_send_ft_response(st
+@@ -1039,8 +1039,8 @@ static void wpa_priv_send_ft_response(st
}
@@ -211,7 +211,7 @@
{
struct wpa_priv_interface *iface = ctx;
-@@ -1102,7 +1102,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -1103,7 +1103,7 @@ void wpa_supplicant_event(void *ctx, enu
}
@@ -220,7 +220,7 @@
union wpa_event_data *data)
{
struct wpa_priv_global *global = ctx;
-@@ -1216,6 +1216,8 @@ int main(int argc, char *argv[])
+@@ -1217,6 +1217,8 @@ int main(int argc, char *argv[])
if (os_program_init())
return -1;
@@ -231,7 +231,7 @@
os_memset(&global, 0, sizeof(global));
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
-@@ -4953,8 +4953,8 @@ static void wpas_event_unprot_beacon(str
+@@ -5237,8 +5237,8 @@ static void wpas_event_unprot_beacon(str
}
@@ -242,7 +242,7 @@
{
struct wpa_supplicant *wpa_s = ctx;
int resched;
-@@ -5813,7 +5813,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -6149,7 +6149,7 @@ void wpa_supplicant_event(void *ctx, enu
}
@@ -253,7 +253,7 @@
struct wpa_supplicant *wpa_s;
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -7087,7 +7087,6 @@ struct wpa_interface * wpa_supplicant_ma
+@@ -7408,7 +7408,6 @@ struct wpa_interface * wpa_supplicant_ma
return NULL;
}
@@ -261,7 +261,7 @@
/**
* wpa_supplicant_match_existing - Match existing interfaces
* @global: Pointer to global data from wpa_supplicant_init()
-@@ -7122,6 +7121,11 @@ static int wpa_supplicant_match_existing
+@@ -7443,6 +7442,11 @@ static int wpa_supplicant_match_existing
#endif /* CONFIG_MATCH_IFACE */
@@ -273,7 +273,7 @@
/**
* wpa_supplicant_add_iface - Add a new network interface
-@@ -7378,6 +7382,8 @@ struct wpa_global * wpa_supplicant_init(
+@@ -7699,6 +7703,8 @@ struct wpa_global * wpa_supplicant_init(
#ifndef CONFIG_NO_WPA_MSG
wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
#endif /* CONFIG_NO_WPA_MSG */
@@ -284,7 +284,7 @@
wpa_debug_open_file(params->wpa_debug_file_path);
--- a/hostapd/main.c
+++ b/hostapd/main.c
-@@ -591,6 +591,11 @@ fail:
+@@ -595,6 +595,11 @@ fail:
return -1;
}
@@ -296,7 +296,7 @@
#ifdef CONFIG_WPS
static int gen_uuid(const char *txt_addr)
-@@ -684,6 +689,8 @@ int main(int argc, char *argv[])
+@@ -688,6 +693,8 @@ int main(int argc, char *argv[])
return -1;
#endif /* CONFIG_DPP */
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/300-noscan.patch b/recipes-wifi/hostapd/files/patches-2.10.3/300-noscan.patch
index a0e00c4..91e1aaa 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/300-noscan.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/300-noscan.patch
@@ -1,6 +1,6 @@
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -3439,6 +3439,10 @@ static int hostapd_config_fill(struct ho
+@@ -3446,6 +3446,10 @@ static int hostapd_config_fill(struct ho
if (bss->ocv && !bss->ieee80211w)
bss->ieee80211w = 1;
#endif /* CONFIG_OCV */
@@ -13,7 +13,7 @@
} else if (os_strcmp(buf, "ht_capab") == 0) {
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1043,6 +1043,8 @@ struct hostapd_config {
+@@ -1061,6 +1061,8 @@ struct hostapd_config {
int ht_op_mode_fixed;
u16 ht_capab;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/301-mesh-noscan.patch b/recipes-wifi/hostapd/files/patches-2.10.3/301-mesh-noscan.patch
index 9985401..8a1bdaa 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/301-mesh-noscan.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/301-mesh-noscan.patch
@@ -1,6 +1,6 @@
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
-@@ -2555,6 +2555,7 @@ static const struct parse_data ssid_fiel
+@@ -2599,6 +2599,7 @@ static const struct parse_data ssid_fiel
#else /* CONFIG_MESH */
{ INT_RANGE(mode, 0, 4) },
#endif /* CONFIG_MESH */
@@ -10,7 +10,7 @@
{ STR(id_str) },
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
-@@ -766,6 +766,7 @@ static void wpa_config_write_network(FIL
+@@ -775,6 +775,7 @@ static void wpa_config_write_network(FIL
#endif /* IEEE8021X_EAPOL */
INT(mode);
INT(no_auto_peer);
@@ -31,36 +31,36 @@
/*
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -2463,7 +2463,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
+@@ -2693,7 +2693,7 @@ static bool ibss_mesh_can_use_vht(struct
+ const struct wpa_ssid *ssid,
+ struct hostapd_hw_modes *mode)
+ {
+- if (mode->mode != HOSTAPD_MODE_IEEE80211A)
++ if (mode->mode != HOSTAPD_MODE_IEEE80211A && !(ssid->noscan))
+ return false;
+
+ if (!drv_supports_vht(wpa_s, ssid))
+@@ -2766,7 +2766,7 @@ static void ibss_mesh_select_40mhz(struc
+ int i, res;
+ unsigned int j;
+ static const int ht40plus[] = {
+- 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157, 165, 173,
++ 1, 2, 3, 4, 5, 6, 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157, 165, 173,
+ 184, 192
+ };
+ int ht40 = -1;
+@@ -3016,7 +3016,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
int ieee80211_mode = wpas_mode_to_ieee80211_mode(ssid->mode);
enum hostapd_hw_mode hw_mode;
struct hostapd_hw_modes *mode = NULL;
-- int ht40plus[] = { 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157,
-+ int ht40plus[] = { 1, 2, 3, 4, 5, 6, 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157,
- 184, 192 };
- int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955,
- 6035, 6115, 6195, 6275, 6355, 6435, 6515,
-@@ -2471,7 +2471,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
- int bw160[] = { 5955, 6115, 6275, 6435, 6595, 6755, 6915 };
- struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL;
+- int i, obss_scan = 1;
++ int i, obss_scan = !(ssid->noscan);
u8 channel;
-- int i, chan_idx, ht40 = -1, res, obss_scan = 1;
-+ int i, chan_idx, ht40 = -1, res, obss_scan = !(ssid->noscan);
- unsigned int j, k;
- struct hostapd_freq_params vht_freq;
- int chwidth, seg0, seg1;
-@@ -2562,7 +2562,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
- #endif /* CONFIG_HE_OVERRIDES */
-
- /* Setup higher BW only for 5 GHz */
-- if (mode->mode != HOSTAPD_MODE_IEEE80211A)
-+ if (mode->mode != HOSTAPD_MODE_IEEE80211A && !(ssid->noscan))
- return;
-
- for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) {
+ bool is_6ghz;
+ bool dfs_enabled = wpa_s->conf->country[0] && (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
-@@ -981,6 +981,8 @@ struct wpa_ssid {
+@@ -1035,6 +1035,8 @@ struct wpa_ssid {
*/
int no_auto_peer;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/310-rescan_immediately.patch b/recipes-wifi/hostapd/files/patches-2.10.3/310-rescan_immediately.patch
index 2c25419..033f763 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/310-rescan_immediately.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/310-rescan_immediately.patch
@@ -1,6 +1,6 @@
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -5419,7 +5419,7 @@ wpa_supplicant_alloc(struct wpa_supplica
+@@ -5713,7 +5713,7 @@ wpa_supplicant_alloc(struct wpa_supplica
if (wpa_s == NULL)
return NULL;
wpa_s->scan_req = INITIAL_SCAN_REQ;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/330-nl80211_fix_set_freq.patch b/recipes-wifi/hostapd/files/patches-2.10.3/330-nl80211_fix_set_freq.patch
index 8218a43..93a03a6 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/330-nl80211_fix_set_freq.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/330-nl80211_fix_set_freq.patch
@@ -1,6 +1,6 @@
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -5022,7 +5022,7 @@ static int nl80211_set_channel(struct i8
+@@ -5224,7 +5224,7 @@ static int nl80211_set_channel(struct i8
freq->he_enabled, freq->eht_enabled, freq->bandwidth,
freq->center_freq1, freq->center_freq2);
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/340-reload_freq_change.patch b/recipes-wifi/hostapd/files/patches-2.10.3/340-reload_freq_change.patch
index b591074..9a46807 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/340-reload_freq_change.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/340-reload_freq_change.patch
@@ -1,6 +1,6 @@
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -119,6 +119,29 @@ static void hostapd_reload_bss(struct ho
+@@ -142,6 +142,29 @@ static void hostapd_reload_bss(struct ho
#endif /* CONFIG_NO_RADIUS */
ssid = &hapd->conf->ssid;
@@ -30,7 +30,7 @@
if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next &&
ssid->wpa_passphrase_set && ssid->wpa_passphrase) {
/*
-@@ -220,6 +243,7 @@ int hostapd_reload_config(struct hostapd
+@@ -250,6 +273,7 @@ int hostapd_reload_config(struct hostapd
struct hostapd_data *hapd = iface->bss[0];
struct hostapd_config *newconf, *oldconf;
size_t j;
@@ -38,7 +38,7 @@
if (iface->config_fname == NULL) {
/* Only in-memory config in use - assume it has been updated */
-@@ -270,24 +294,20 @@ int hostapd_reload_config(struct hostapd
+@@ -300,6 +324,17 @@ int hostapd_reload_config(struct hostapd
}
iface->conf = newconf;
@@ -55,6 +55,10 @@
+
for (j = 0; j < iface->num_bss; j++) {
hapd = iface->bss[j];
+ if (!hapd->conf->config_id || !newconf->bss[j]->config_id ||
+@@ -307,21 +342,6 @@ int hostapd_reload_config(struct hostapd
+ newconf->bss[j]->config_id) != 0)
+ hostapd_clear_old_bss(hapd);
hapd->iconf = newconf;
- hapd->iconf->channel = oldconf->channel;
- hapd->iconf->acs = oldconf->acs;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/341-mesh-ctrl-iface-channel-switch.patch b/recipes-wifi/hostapd/files/patches-2.10.3/341-mesh-ctrl-iface-channel-switch.patch
index 29a3799..8784452 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/341-mesh-ctrl-iface-channel-switch.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/341-mesh-ctrl-iface-channel-switch.patch
@@ -1,6 +1,6 @@
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
-@@ -1803,15 +1803,35 @@ int ap_switch_channel(struct wpa_supplic
+@@ -1825,15 +1825,35 @@ int ap_switch_channel(struct wpa_supplic
#ifdef CONFIG_CTRL_IFACE
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/350-nl80211_del_beacon_bss.patch b/recipes-wifi/hostapd/files/patches-2.10.3/350-nl80211_del_beacon_bss.patch
index a88b63e..a943395 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/350-nl80211_del_beacon_bss.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/350-nl80211_del_beacon_bss.patch
@@ -1,34 +1,35 @@
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -2938,11 +2938,11 @@ static int wpa_driver_nl80211_del_beacon
- struct wpa_driver_nl80211_data *drv = bss->drv;
+@@ -3006,12 +3006,12 @@ static int wpa_driver_nl80211_del_beacon
+ return 0;
wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)",
- drv->ifindex);
+ bss->ifindex);
- bss->beacon_set = 0;
- bss->freq = 0;
+ link->beacon_set = 0;
+ link->freq = 0;
+
nl80211_put_wiphy_data_ap(bss);
- msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON);
+ msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_BEACON);
- return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
- }
+ if (!msg)
+ return -ENOBUFS;
-@@ -5661,7 +5661,7 @@ static void nl80211_teardown_ap(struct i
+@@ -5907,7 +5907,7 @@ static void nl80211_teardown_ap(struct i
nl80211_mgmt_unsubscribe(bss, "AP teardown");
nl80211_put_wiphy_data_ap(bss);
-- bss->beacon_set = 0;
-+ wpa_driver_nl80211_del_beacon(bss);
+- bss->flink->beacon_set = 0;
++ wpa_driver_nl80211_del_beacon_all(bss);
}
-@@ -8120,8 +8120,6 @@ static int wpa_driver_nl80211_if_remove(
+@@ -8642,8 +8642,6 @@ static int wpa_driver_nl80211_if_remove(
} else {
wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context");
nl80211_teardown_ap(bss);
- if (!bss->added_if && !drv->first_bss->next)
-- wpa_driver_nl80211_del_beacon(bss);
+- wpa_driver_nl80211_del_beacon_all(bss);
nl80211_destroy_bss(bss);
if (!bss->added_if)
i802_set_iface_flags(bss, 0);
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/360-ctrl_iface_reload.patch b/recipes-wifi/hostapd/files/patches-2.10.3/360-ctrl_iface_reload.patch
index 7699541..e9f46ce 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/360-ctrl_iface_reload.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/360-ctrl_iface_reload.patch
@@ -1,6 +1,6 @@
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -67,6 +67,7 @@
+@@ -68,6 +68,7 @@
#include "fst/fst_ctrl_iface.h"
#include "config_file.h"
#include "ctrl_iface.h"
@@ -8,7 +8,7 @@
#define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256
-@@ -82,6 +83,7 @@ static void hostapd_ctrl_iface_send(stru
+@@ -83,6 +84,7 @@ static void hostapd_ctrl_iface_send(stru
enum wpa_msg_type type,
const char *buf, size_t len);
@@ -16,7 +16,7 @@
static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd,
struct sockaddr_storage *from,
-@@ -133,6 +135,61 @@ static int hostapd_ctrl_iface_new_sta(st
+@@ -134,6 +136,61 @@ static int hostapd_ctrl_iface_new_sta(st
return 0;
}
@@ -78,7 +78,7 @@
#ifdef NEED_AP_MLME
static int hostapd_ctrl_iface_sa_query(struct hostapd_data *hapd,
-@@ -3449,6 +3506,8 @@ static int hostapd_ctrl_iface_receive_pr
+@@ -3529,6 +3586,8 @@ static int hostapd_ctrl_iface_receive_pr
} else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply,
reply_size);
@@ -89,7 +89,7 @@
#ifdef RADIUS_SERVER
--- a/src/ap/ctrl_iface_ap.c
+++ b/src/ap/ctrl_iface_ap.c
-@@ -945,7 +945,13 @@ int hostapd_parse_csa_settings(const cha
+@@ -1008,7 +1008,13 @@ int hostapd_parse_csa_settings(const cha
int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
{
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/370-ap_sta_support.patch b/recipes-wifi/hostapd/files/patches-2.10.3/370-ap_sta_support.patch
index 6faaffc..2406483 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/370-ap_sta_support.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/370-ap_sta_support.patch
@@ -1,6 +1,6 @@
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
-@@ -115,6 +115,8 @@ OBJS_c += ../src/utils/common.o
+@@ -126,6 +126,8 @@ OBJS_c += ../src/utils/common.o
OBJS_c += ../src/common/cli.o
OBJS += wmm_ac.o
@@ -19,7 +19,7 @@
#include "drivers/driver.h"
#include "eap_peer/eap.h"
#include "wpa_supplicant_i.h"
-@@ -282,6 +283,10 @@ void calculate_update_time(const struct
+@@ -283,6 +284,10 @@ void calculate_update_time(const struct
static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
struct os_reltime *fetch_time)
{
@@ -30,7 +30,7 @@
dst->flags = src->flags;
os_memcpy(dst->bssid, src->bssid, ETH_ALEN);
dst->freq = src->freq;
-@@ -295,6 +300,15 @@ static void wpa_bss_copy_res(struct wpa_
+@@ -296,6 +301,15 @@ static void wpa_bss_copy_res(struct wpa_
dst->est_throughput = src->est_throughput;
dst->snr = src->snr;
@@ -154,7 +154,7 @@
#ifdef CONFIG_WEP
/* Configure default/group WEP keys for static WEP */
-@@ -1016,6 +1064,8 @@ void wpa_supplicant_set_state(struct wpa
+@@ -1026,6 +1074,8 @@ void wpa_supplicant_set_state(struct wpa
sme_sched_obss_scan(wpa_s, 1);
@@ -163,7 +163,7 @@
#if defined(CONFIG_FILS) && defined(IEEE8021X_EAPOL)
if (!fils_hlp_sent && ssid && ssid->eap.erp)
update_fils_connect_params = true;
-@@ -1026,6 +1076,8 @@ void wpa_supplicant_set_state(struct wpa
+@@ -1036,6 +1086,8 @@ void wpa_supplicant_set_state(struct wpa
#endif /* CONFIG_OWE */
} else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING ||
state == WPA_ASSOCIATED) {
@@ -172,7 +172,7 @@
wpa_s->new_connection = 1;
wpa_drv_set_operstate(wpa_s, 0);
#ifndef IEEE8021X_EAPOL
-@@ -2335,6 +2387,8 @@ void wpa_supplicant_associate(struct wpa
+@@ -2520,6 +2572,8 @@ void wpa_supplicant_associate(struct wpa
return;
}
wpa_s->current_bss = bss;
@@ -181,7 +181,7 @@
#else /* CONFIG_MESH */
wpa_msg(wpa_s, MSG_ERROR,
"mesh mode support not included in the build");
-@@ -6693,6 +6747,16 @@ static int wpa_supplicant_init_iface(str
+@@ -7010,6 +7064,16 @@ static int wpa_supplicant_init_iface(str
sizeof(wpa_s->bridge_ifname));
}
@@ -198,7 +198,7 @@
/* RSNA Supplicant Key Management - INITIALIZE */
eapol_sm_notify_portEnabled(wpa_s->eapol, false);
eapol_sm_notify_portValid(wpa_s->eapol, false);
-@@ -7031,6 +7095,11 @@ static void wpa_supplicant_deinit_iface(
+@@ -7352,6 +7416,11 @@ static void wpa_supplicant_deinit_iface(
if (terminate)
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING);
@@ -212,7 +212,7 @@
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
-@@ -105,6 +105,11 @@ struct wpa_interface {
+@@ -106,6 +106,11 @@ struct wpa_interface {
const char *ifname;
/**
@@ -224,7 +224,7 @@
* bridge_ifname - Optional bridge interface name
*
* If the driver interface (ifname) is included in a Linux bridge
-@@ -717,6 +722,8 @@ struct wpa_supplicant {
+@@ -665,6 +670,8 @@ struct wpa_supplicant {
#endif /* CONFIG_CTRL_IFACE_BINDER */
char bridge_ifname[16];
@@ -235,7 +235,7 @@
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -2641,6 +2641,12 @@ static int hostapd_ctrl_iface_chan_switc
+@@ -2716,6 +2716,12 @@ static int hostapd_ctrl_iface_chan_switc
return 0;
}
@@ -250,7 +250,7 @@
/* Save CHAN_SWITCH VHT, HE, and EHT config */
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
-@@ -1903,11 +1903,6 @@ static int __ieee802_11_set_beacon(struc
+@@ -2052,11 +2052,6 @@ static int __ieee802_11_set_beacon(struc
return -1;
}
@@ -264,7 +264,7 @@
if (ieee802_11_build_ap_params(hapd, ¶ms) < 0)
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
-@@ -4953,6 +4953,60 @@ static void wpas_event_unprot_beacon(str
+@@ -5237,6 +5237,60 @@ static void wpas_event_unprot_beacon(str
}
@@ -325,7 +325,7 @@
void supplicant_event(void *ctx, enum wpa_event_type event,
union wpa_event_data *data)
{
-@@ -5268,8 +5322,10 @@ void supplicant_event(void *ctx, enum wp
+@@ -5586,8 +5640,10 @@ void supplicant_event(void *ctx, enum wp
channel_width_to_string(data->ch_switch.ch_width),
data->ch_switch.cf1,
data->ch_switch.cf2);
@@ -339,7 +339,7 @@
wpa_s->current_ssid->frequency = data->ch_switch.freq;
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5968,6 +5968,7 @@ union wpa_event_data {
+@@ -6324,6 +6324,7 @@ union wpa_event_data {
/**
* struct ch_switch
@@ -347,8 +347,8 @@
* @freq: Frequency of new channel in MHz
* @ht_enabled: Whether this is an HT channel
* @ch_offset: Secondary channel offset
-@@ -5976,6 +5977,7 @@ union wpa_event_data {
- * @cf2: Center frequency 2
+@@ -6334,6 +6335,7 @@ union wpa_event_data {
+ * @punct_bitmap: Puncturing bitmap
*/
struct ch_switch {
+ int count;
@@ -357,16 +357,15 @@
int ch_offset;
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
-@@ -694,7 +694,7 @@ static void mlme_event_ch_switch(struct
- struct nlattr *ifindex, struct nlattr *freq,
- struct nlattr *type, struct nlattr *bw,
- struct nlattr *cf1, struct nlattr *cf2,
-- int finished)
-+ struct nlattr *count, int finished)
+@@ -997,6 +997,7 @@ static void mlme_event_ch_switch(struct
+ struct nlattr *bw, struct nlattr *cf1,
+ struct nlattr *cf2,
+ struct nlattr *punct_bitmap,
++ struct nlattr *count,
+ int finished)
{
struct i802_bss *bss;
- union wpa_event_data data;
-@@ -755,6 +755,8 @@ static void mlme_event_ch_switch(struct
+@@ -1060,6 +1061,8 @@ static void mlme_event_ch_switch(struct
data.ch_switch.cf1 = nla_get_u32(cf1);
if (cf2)
data.ch_switch.cf2 = nla_get_u32(cf2);
@@ -374,19 +373,19 @@
+ data.ch_switch.count = nla_get_u32(count);
if (finished)
- bss->freq = data.ch_switch.freq;
-@@ -3113,6 +3115,7 @@ static void do_process_drv_event(struct
- tb[NL80211_ATTR_CHANNEL_WIDTH],
+ bss->flink->freq = data.ch_switch.freq;
+@@ -3604,6 +3607,7 @@ static void do_process_drv_event(struct
tb[NL80211_ATTR_CENTER_FREQ1],
tb[NL80211_ATTR_CENTER_FREQ2],
+ tb[NL80211_ATTR_PUNCT_BITMAP],
+ tb[NL80211_ATTR_CH_SWITCH_COUNT],
0);
break;
case NL80211_CMD_CH_SWITCH_NOTIFY:
-@@ -3123,6 +3126,7 @@ static void do_process_drv_event(struct
- tb[NL80211_ATTR_CHANNEL_WIDTH],
+@@ -3616,6 +3620,7 @@ static void do_process_drv_event(struct
tb[NL80211_ATTR_CENTER_FREQ1],
tb[NL80211_ATTR_CENTER_FREQ2],
+ tb[NL80211_ATTR_PUNCT_BITMAP],
+ NULL,
1);
break;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/380-disable_ctrl_iface_mib.patch b/recipes-wifi/hostapd/files/patches-2.10.3/380-disable_ctrl_iface_mib.patch
index 1f78c42..b886ab7 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/380-disable_ctrl_iface_mib.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/380-disable_ctrl_iface_mib.patch
@@ -12,7 +12,7 @@
else
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -3265,6 +3265,7 @@ static int hostapd_ctrl_iface_receive_pr
+@@ -3342,6 +3342,7 @@ static int hostapd_ctrl_iface_receive_pr
reply_size);
} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
reply_len = hostapd_drv_status(hapd, reply, reply_size);
@@ -20,7 +20,7 @@
} else if (os_strcmp(buf, "MIB") == 0) {
reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
if (reply_len >= 0) {
-@@ -3306,6 +3307,7 @@ static int hostapd_ctrl_iface_receive_pr
+@@ -3383,6 +3384,7 @@ static int hostapd_ctrl_iface_receive_pr
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
reply_size);
@@ -30,7 +30,7 @@
reply_len = -1;
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
-@@ -973,6 +973,9 @@ ifdef CONFIG_FILS
+@@ -985,6 +985,9 @@ ifdef CONFIG_FILS
OBJS += ../src/ap/fils_hlp.o
endif
ifdef CONFIG_CTRL_IFACE
@@ -42,7 +42,7 @@
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
-@@ -2325,7 +2325,7 @@ static int wpa_supplicant_ctrl_iface_sta
+@@ -2326,7 +2326,7 @@ static int wpa_supplicant_ctrl_iface_sta
pos += ret;
}
@@ -51,7 +51,7 @@
if (wpa_s->ap_iface) {
pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos,
end - pos,
-@@ -11565,6 +11565,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -11964,6 +11964,7 @@ char * wpa_supplicant_ctrl_iface_process
reply_len = -1;
} else if (os_strncmp(buf, "NOTE ", 5) == 0) {
wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
@@ -59,7 +59,7 @@
} else if (os_strcmp(buf, "MIB") == 0) {
reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
if (reply_len >= 0) {
-@@ -11577,6 +11578,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -11976,6 +11977,7 @@ char * wpa_supplicant_ctrl_iface_process
reply_size - reply_len);
#endif /* CONFIG_MACSEC */
}
@@ -67,7 +67,7 @@
} else if (os_strncmp(buf, "STATUS", 6) == 0) {
reply_len = wpa_supplicant_ctrl_iface_status(
wpa_s, buf + 6, reply, reply_size);
-@@ -12065,6 +12067,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -12464,6 +12466,7 @@ char * wpa_supplicant_ctrl_iface_process
reply_len = wpa_supplicant_ctrl_iface_bss(
wpa_s, buf + 4, reply, reply_size);
#ifdef CONFIG_AP
@@ -75,7 +75,7 @@
} else if (os_strcmp(buf, "STA-FIRST") == 0) {
reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
} else if (os_strncmp(buf, "STA ", 4) == 0) {
-@@ -12073,12 +12076,15 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -12472,12 +12475,15 @@ char * wpa_supplicant_ctrl_iface_process
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
reply_size);
@@ -93,15 +93,61 @@
reply_len = -1;
--- a/src/ap/ctrl_iface_ap.c
+++ b/src/ap/ctrl_iface_ap.c
-@@ -26,6 +26,7 @@
+@@ -26,6 +26,26 @@
#include "taxonomy.h"
#include "wnm_ap.h"
++static const char * hw_mode_str(enum hostapd_hw_mode mode)
++{
++ switch (mode) {
++ case HOSTAPD_MODE_IEEE80211B:
++ return "b";
++ case HOSTAPD_MODE_IEEE80211G:
++ return "g";
++ case HOSTAPD_MODE_IEEE80211A:
++ return "a";
++ case HOSTAPD_MODE_IEEE80211AD:
++ return "ad";
++ case HOSTAPD_MODE_IEEE80211ANY:
++ return "any";
++ case NUM_HOSTAPD_MODES:
++ return "invalid";
++ }
++ return "unknown";
++}
++
+#ifdef CONFIG_CTRL_IFACE_MIB
static size_t hostapd_write_ht_mcs_bitmask(char *buf, size_t buflen,
size_t curr_len, const u8 *mcs_set)
-@@ -460,6 +461,7 @@ int hostapd_ctrl_iface_sta_next(struct h
+@@ -212,26 +232,6 @@ static const char * timeout_next_str(int
+ }
+
+
+-static const char * hw_mode_str(enum hostapd_hw_mode mode)
+-{
+- switch (mode) {
+- case HOSTAPD_MODE_IEEE80211B:
+- return "b";
+- case HOSTAPD_MODE_IEEE80211G:
+- return "g";
+- case HOSTAPD_MODE_IEEE80211A:
+- return "a";
+- case HOSTAPD_MODE_IEEE80211AD:
+- return "ad";
+- case HOSTAPD_MODE_IEEE80211ANY:
+- return "any";
+- case NUM_HOSTAPD_MODES:
+- return "invalid";
+- }
+- return "unknown";
+-}
+-
+-
+ static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd,
+ struct sta_info *sta,
+ char *buf, size_t buflen)
+@@ -493,6 +493,7 @@ int hostapd_ctrl_iface_sta_next(struct h
return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
}
@@ -109,7 +155,7 @@
#ifdef CONFIG_P2P_MANAGER
static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
-@@ -832,12 +834,12 @@ int hostapd_ctrl_iface_status(struct hos
+@@ -884,12 +885,12 @@ int hostapd_ctrl_iface_status(struct hos
return len;
len += ret;
}
@@ -126,7 +172,7 @@
if (os_snprintf_error(buflen - len, ret))
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
-@@ -2740,6 +2740,7 @@ static const char * bool_txt(bool val)
+@@ -2753,6 +2753,7 @@ static const char * bool_txt(bool val)
return val ? "TRUE" : "FALSE";
}
@@ -134,7 +180,7 @@
int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
{
-@@ -2926,6 +2927,7 @@ int ieee802_1x_get_mib_sta(struct hostap
+@@ -2939,6 +2940,7 @@ int ieee802_1x_get_mib_sta(struct hostap
return len;
}
@@ -144,7 +190,7 @@
static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx)
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
-@@ -4559,6 +4559,7 @@ static const char * wpa_bool_txt(int val
+@@ -4786,6 +4786,7 @@ static const char * wpa_bool_txt(int val
return val ? "TRUE" : "FALSE";
}
@@ -152,7 +198,7 @@
#define RSN_SUITE "%02x-%02x-%02x-%d"
#define RSN_SUITE_ARG(s) \
-@@ -4709,7 +4710,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
+@@ -4938,7 +4939,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
return len;
}
@@ -163,7 +209,7 @@
{
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
-@@ -2802,6 +2802,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
+@@ -3834,6 +3834,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
}
@@ -172,7 +218,7 @@
#define RSN_SUITE "%02x-%02x-%02x-%d"
#define RSN_SUITE_ARG(s) \
((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
-@@ -2883,6 +2885,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
+@@ -3915,6 +3917,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
return (int) len;
}
@@ -182,7 +228,7 @@
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
-@@ -1477,7 +1477,7 @@ int wpas_ap_wps_nfc_report_handover(stru
+@@ -1499,7 +1499,7 @@ int wpas_ap_wps_nfc_report_handover(stru
#endif /* CONFIG_WPS */
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/381-hostapd_cli_UNKNOWN-COMMAND.patch b/recipes-wifi/hostapd/files/patches-2.10.3/381-hostapd_cli_UNKNOWN-COMMAND.patch
index d2414fa..e9083f6 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/381-hostapd_cli_UNKNOWN-COMMAND.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/381-hostapd_cli_UNKNOWN-COMMAND.patch
@@ -1,6 +1,6 @@
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -744,7 +744,7 @@ static int wpa_ctrl_command_sta(struct w
+@@ -757,7 +757,7 @@ static int wpa_ctrl_command_sta(struct w
}
buf[len] = '\0';
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/390-wpa_ie_cap_workaround.patch b/recipes-wifi/hostapd/files/patches-2.10.3/390-wpa_ie_cap_workaround.patch
index bf481c3..40c39ff 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/390-wpa_ie_cap_workaround.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/390-wpa_ie_cap_workaround.patch
@@ -1,6 +1,6 @@
--- a/src/common/wpa_common.c
+++ b/src/common/wpa_common.c
-@@ -2529,6 +2529,31 @@ u32 wpa_akm_to_suite(int akm)
+@@ -2719,6 +2719,31 @@ u32 wpa_akm_to_suite(int akm)
}
@@ -32,7 +32,7 @@
int wpa_compare_rsn_ie(int ft_initial_assoc,
const u8 *ie1, size_t ie1len,
const u8 *ie2, size_t ie2len)
-@@ -2536,8 +2561,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
+@@ -2726,8 +2751,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
if (ie1 == NULL || ie2 == NULL)
return -1;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/410-limit_debug_messages.patch b/recipes-wifi/hostapd/files/patches-2.10.3/410-limit_debug_messages.patch
index d2713fc..48a5589 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/410-limit_debug_messages.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/410-limit_debug_messages.patch
@@ -60,7 +60,7 @@
#ifdef CONFIG_DEBUG_FILE
static char *last_path = NULL;
#endif /* CONFIG_DEBUG_FILE */
-@@ -636,7 +610,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_
+@@ -644,7 +618,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_
}
@@ -69,7 +69,7 @@
{
va_list ap;
char *buf;
-@@ -674,7 +648,7 @@ void wpa_msg(void *ctx, int level, const
+@@ -682,7 +656,7 @@ void wpa_msg(void *ctx, int level, const
}
@@ -80,9 +80,9 @@
char *buf;
--- a/src/utils/wpa_debug.h
+++ b/src/utils/wpa_debug.h
-@@ -50,6 +50,17 @@ int wpa_debug_reopen_file(void);
- void wpa_debug_close_file(void);
+@@ -51,6 +51,17 @@ void wpa_debug_close_file(void);
void wpa_debug_setup_stdout(void);
+ void wpa_debug_stop_log(void);
+/* internal */
+void _wpa_hexdump(int level, const char *title, const u8 *buf,
@@ -98,7 +98,7 @@
/**
* wpa_debug_printf_timestamp - Print timestamp for debug output
*
-@@ -70,9 +81,15 @@ void wpa_debug_print_timestamp(void);
+@@ -71,9 +82,15 @@ void wpa_debug_print_timestamp(void);
*
* Note: New line '\n' is added to the end of the text when printing to stdout.
*/
@@ -115,7 +115,7 @@
/**
* wpa_hexdump - conditional hex dump
* @level: priority level (MSG_*) of the message
-@@ -84,7 +101,13 @@ PRINTF_FORMAT(2, 3);
+@@ -85,7 +102,13 @@ PRINTF_FORMAT(2, 3);
* output may be directed to stdout, stderr, and/or syslog based on
* configuration. The contents of buf is printed out has hex dump.
*/
@@ -130,7 +130,7 @@
static inline void wpa_hexdump_buf(int level, const char *title,
const struct wpabuf *buf)
-@@ -106,7 +129,13 @@ static inline void wpa_hexdump_buf(int l
+@@ -107,7 +130,13 @@ static inline void wpa_hexdump_buf(int l
* like wpa_hexdump(), but by default, does not include secret keys (passwords,
* etc.) in debug output.
*/
@@ -145,7 +145,7 @@
static inline void wpa_hexdump_buf_key(int level, const char *title,
const struct wpabuf *buf)
-@@ -128,8 +157,14 @@ static inline void wpa_hexdump_buf_key(i
+@@ -129,8 +158,14 @@ static inline void wpa_hexdump_buf_key(i
* the hex numbers and ASCII characters (for printable range) are shown. 16
* bytes per line will be shown.
*/
@@ -162,7 +162,7 @@
/**
* wpa_hexdump_ascii_key - conditional hex dump, hide keys
-@@ -145,8 +180,14 @@ void wpa_hexdump_ascii(int level, const
+@@ -146,8 +181,14 @@ void wpa_hexdump_ascii(int level, const
* bytes per line will be shown. This works like wpa_hexdump_ascii(), but by
* default, does not include secret keys (passwords, etc.) in debug output.
*/
@@ -179,7 +179,7 @@
/*
* wpa_dbg() behaves like wpa_msg(), but it can be removed from build to reduce
-@@ -183,7 +224,12 @@ void wpa_hexdump_ascii_key(int level, co
+@@ -184,7 +225,12 @@ void wpa_hexdump_ascii_key(int level, co
*
* Note: New line '\n' is added to the end of the text when printing to stdout.
*/
@@ -193,7 +193,7 @@
/**
* wpa_msg_ctrl - Conditional printf for ctrl_iface monitors
-@@ -197,8 +243,13 @@ void wpa_msg(void *ctx, int level, const
+@@ -198,8 +244,13 @@ void wpa_msg(void *ctx, int level, const
* attached ctrl_iface monitors. In other words, it can be used for frequent
* events that do not need to be sent to syslog.
*/
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/420-indicate-features.patch b/recipes-wifi/hostapd/files/patches-2.10.3/420-indicate-features.patch
index 12edb6b..356d5f8 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/420-indicate-features.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/420-indicate-features.patch
@@ -9,7 +9,7 @@
struct hapd_global {
void **drv_priv;
-@@ -692,7 +692,7 @@ int main(int argc, char *argv[])
+@@ -696,7 +696,7 @@ int main(int argc, char *argv[])
wpa_supplicant_event = hostapd_wpa_event;
wpa_supplicant_event_global = hostapd_wpa_event_global;
for (;;) {
@@ -18,7 +18,7 @@
if (c < 0)
break;
switch (c) {
-@@ -729,6 +729,8 @@ int main(int argc, char *argv[])
+@@ -733,6 +733,8 @@ int main(int argc, char *argv[])
break;
#endif /* CONFIG_DEBUG_LINUX_TRACING */
case 'v':
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/430-hostapd_cli_ifdef.patch b/recipes-wifi/hostapd/files/patches-2.10.3/430-hostapd_cli_ifdef.patch
index e524209..a21f0bf 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/430-hostapd_cli_ifdef.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/430-hostapd_cli_ifdef.patch
@@ -1,6 +1,6 @@
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -388,7 +388,6 @@ static int hostapd_cli_cmd_disassociate(
+@@ -401,7 +401,6 @@ static int hostapd_cli_cmd_disassociate(
}
@@ -8,7 +8,7 @@
static int hostapd_cli_cmd_signature(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
-@@ -401,7 +400,6 @@ static int hostapd_cli_cmd_signature(str
+@@ -414,7 +413,6 @@ static int hostapd_cli_cmd_signature(str
os_snprintf(buf, sizeof(buf), "SIGNATURE %s", argv[0]);
return wpa_ctrl_command(ctrl, buf);
}
@@ -16,7 +16,7 @@
static int hostapd_cli_cmd_sa_query(struct wpa_ctrl *ctrl, int argc,
-@@ -418,7 +416,6 @@ static int hostapd_cli_cmd_sa_query(stru
+@@ -431,7 +429,6 @@ static int hostapd_cli_cmd_sa_query(stru
}
@@ -24,7 +24,7 @@
static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
-@@ -644,7 +641,6 @@ static int hostapd_cli_cmd_wps_config(st
+@@ -657,7 +654,6 @@ static int hostapd_cli_cmd_wps_config(st
ssid_hex, argv[1]);
return wpa_ctrl_command(ctrl, buf);
}
@@ -32,7 +32,7 @@
static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
-@@ -1588,13 +1584,10 @@ static const struct hostapd_cli_cmd host
+@@ -1610,13 +1606,10 @@ static const struct hostapd_cli_cmd host
{ "disassociate", hostapd_cli_cmd_disassociate,
hostapd_complete_stations,
"<addr> = disassociate a station" },
@@ -46,7 +46,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,
-@@ -1619,7 +1612,6 @@ static const struct hostapd_cli_cmd host
+@@ -1641,7 +1634,6 @@ static const struct hostapd_cli_cmd host
"<SSID> <auth> <encr> <key> = configure AP" },
{ "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL,
"= show current WPS status" },
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/450-scan_wait.patch b/recipes-wifi/hostapd/files/patches-2.10.3/450-scan_wait.patch
index ac874ad..e265d1a 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/450-scan_wait.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/450-scan_wait.patch
@@ -33,7 +33,7 @@
/* Initialize the driver interface */
if (!(b[0] | b[1] | b[2] | b[3] | b[4] | b[5]))
b = NULL;
-@@ -404,8 +416,6 @@ static void hostapd_global_deinit(const
+@@ -407,8 +419,6 @@ static void hostapd_global_deinit(const
#endif /* CONFIG_NATIVE_WINDOWS */
eap_server_unregister_methods();
@@ -42,7 +42,7 @@
}
-@@ -431,18 +441,6 @@ static int hostapd_global_run(struct hap
+@@ -434,18 +444,6 @@ static int hostapd_global_run(struct hap
}
#endif /* EAP_SERVER_TNC */
@@ -61,7 +61,7 @@
eloop_run();
return 0;
-@@ -645,8 +643,7 @@ int main(int argc, char *argv[])
+@@ -649,8 +647,7 @@ int main(int argc, char *argv[])
struct hapd_interfaces interfaces;
int ret = 1;
size_t i, j;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/recipes-wifi/hostapd/files/patches-2.10.3/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch
index 38ff663..8098777 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch
@@ -22,7 +22,7 @@
#include "common/defs.h"
#include "common/ieee802_11_defs.h"
#include "common/wpa_common.h"
-@@ -894,6 +895,9 @@ struct wpa_driver_associate_params {
+@@ -936,6 +937,9 @@ struct wpa_driver_associate_params {
* responsible for selecting with which BSS to associate. */
const u8 *bssid;
@@ -42,7 +42,7 @@
#include "config.h"
-@@ -2345,6 +2346,97 @@ static char * wpa_config_write_peerkey(c
+@@ -2389,6 +2390,97 @@ static char * wpa_config_write_mac_value
#endif /* NO_CONFIG_WRITE */
@@ -140,7 +140,7 @@
/* Helper macros for network block parser */
#ifdef OFFSET
-@@ -2629,6 +2721,8 @@ static const struct parse_data ssid_fiel
+@@ -2673,6 +2765,8 @@ static const struct parse_data ssid_fiel
{ INT(ap_max_inactivity) },
{ INT(dtim_period) },
{ INT(beacon_int) },
@@ -162,7 +162,7 @@
#define DEFAULT_EAP_WORKAROUND ((unsigned int) -1)
-@@ -846,6 +848,9 @@ struct wpa_ssid {
+@@ -879,6 +881,9 @@ struct wpa_ssid {
*/
void *parent_cred;
@@ -174,7 +174,7 @@
* macsec_policy - Determines the policy for MACsec secure session
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -3899,6 +3899,12 @@ static void wpas_start_assoc_cb(struct w
+@@ -4177,6 +4177,12 @@ static void wpas_start_assoc_cb(struct w
params.beacon_int = ssid->beacon_int;
else
params.beacon_int = wpa_s->conf->beacon_int;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/461-driver_nl80211-use-new-parameters-during-ibss-join.patch b/recipes-wifi/hostapd/files/patches-2.10.3/461-driver_nl80211-use-new-parameters-during-ibss-join.patch
deleted file mode 100644
index 65d67b8..0000000
--- a/recipes-wifi/hostapd/files/patches-2.10.3/461-driver_nl80211-use-new-parameters-during-ibss-join.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From ffc4445958a3ed4064f2e1bf73fa478a61c5cf7b Mon Sep 17 00:00:00 2001
-From: Antonio Quartulli <ordex@autistici.org>
-Date: Sun, 3 Jun 2012 18:42:25 +0200
-Subject: [PATCHv2 602/602] driver_nl80211: use new parameters during ibss join
-
-Signed-hostap: Antonio Quartulli <ordex@autistici.org>
----
- src/drivers/driver_nl80211.c | 33 ++++++++++++++++++++++++++++++++-
- 1 file changed, 32 insertions(+), 1 deletion(-)
-
---- a/src/drivers/driver_nl80211.c
-+++ b/src/drivers/driver_nl80211.c
-@@ -6005,7 +6005,7 @@ static int wpa_driver_nl80211_ibss(struc
- struct wpa_driver_associate_params *params)
- {
- struct nl_msg *msg;
-- int ret = -1;
-+ int ret = -1, i;
- int count = 0;
-
- wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex);
-@@ -6032,6 +6032,37 @@ retry:
- nl80211_put_beacon_int(msg, params->beacon_int))
- goto fail;
-
-+ if (params->fixed_freq) {
-+ wpa_printf(MSG_DEBUG, " * fixed_freq");
-+ nla_put_flag(msg, NL80211_ATTR_FREQ_FIXED);
-+ }
-+
-+ if (params->beacon_int > 0) {
-+ wpa_printf(MSG_DEBUG, " * beacon_int=%d",
-+ params->beacon_int);
-+ nla_put_u32(msg, NL80211_ATTR_BEACON_INTERVAL,
-+ params->beacon_int);
-+ }
-+
-+ if (params->rates[0] > 0) {
-+ wpa_printf(MSG_DEBUG, " * basic_rates:");
-+ i = 0;
-+ while (i < NL80211_MAX_SUPP_RATES &&
-+ params->rates[i] > 0) {
-+ wpa_printf(MSG_DEBUG, " %.1f",
-+ (double)params->rates[i] / 2);
-+ i++;
-+ }
-+ nla_put(msg, NL80211_ATTR_BSS_BASIC_RATES, i,
-+ params->rates);
-+ }
-+
-+ if (params->mcast_rate > 0) {
-+ wpa_printf(MSG_DEBUG, " * mcast_rate=%.1f",
-+ (double)params->mcast_rate / 10);
-+ nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate);
-+ }
-+
- ret = nl80211_set_conn_keys(params, msg);
- if (ret)
- goto fail;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/463-add-mcast_rate-to-11s.patch b/recipes-wifi/hostapd/files/patches-2.10.3/463-add-mcast_rate-to-11s.patch
index 5dc19fe..e738ea1 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/463-add-mcast_rate-to-11s.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/463-add-mcast_rate-to-11s.patch
@@ -19,7 +19,7 @@
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -1661,6 +1661,7 @@ struct wpa_driver_mesh_join_params {
+@@ -1768,6 +1768,7 @@ struct wpa_driver_mesh_join_params {
#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
unsigned int flags;
bool handle_dfs;
@@ -29,7 +29,7 @@
struct wpa_driver_set_key_params {
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -10627,6 +10627,18 @@ static int nl80211_put_mesh_id(struct nl
+@@ -11388,6 +11388,18 @@ static int nl80211_put_mesh_id(struct nl
}
@@ -48,7 +48,7 @@
static int nl80211_put_mesh_config(struct nl_msg *msg,
struct wpa_driver_mesh_bss_params *params)
{
-@@ -10688,6 +10700,7 @@ static int nl80211_join_mesh(struct i802
+@@ -11449,6 +11461,7 @@ static int nl80211_join_mesh(struct i802
nl80211_put_basic_rates(msg, params->basic_rates) ||
nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) ||
nl80211_put_beacon_int(msg, params->beacon_int) ||
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/464-fix-mesh-obss-check.patch b/recipes-wifi/hostapd/files/patches-2.10.3/464-fix-mesh-obss-check.patch
index 48086ea..73ccc65 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/464-fix-mesh-obss-check.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/464-fix-mesh-obss-check.patch
@@ -1,19 +1,13 @@
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -2539,11 +2539,13 @@ void ibss_mesh_setup_freq(struct wpa_sup
- for (j = 0; j < wpa_s->last_scan_res_used; j++) {
- struct wpa_bss *bss = wpa_s->last_scan_res[j];
+@@ -3077,6 +3077,10 @@ void ibss_mesh_setup_freq(struct wpa_sup
-- if (ssid->mode != WPAS_MODE_IBSS)
-+ /* Don't adjust control freq in case of fixed_freq */
-+ if (ssid->fixed_freq) {
-+ obss_scan = 0;
- break;
-+ }
+ freq->freq = ssid->frequency;
-- /* Don't adjust control freq in case of fixed_freq */
-- if (ssid->fixed_freq)
-+ if (ssid->mode != WPAS_MODE_IBSS)
- break;
++ if (ssid->fixed_freq) {
++ obss_scan = 0;
++ }
++
+ if (ssid->mode == WPAS_MODE_IBSS && !ssid->fixed_freq) {
+ struct wpa_bss *bss = ibss_find_existing_bss(wpa_s, ssid);
- if (!bss_is_ibss(bss))
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/465-hostapd-config-support-random-BSS-color.patch b/recipes-wifi/hostapd/files/patches-2.10.3/465-hostapd-config-support-random-BSS-color.patch
index 6810b79..ada7785 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/465-hostapd-config-support-random-BSS-color.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/465-hostapd-config-support-random-BSS-color.patch
@@ -13,7 +13,7 @@
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -3489,6 +3489,8 @@ static int hostapd_config_fill(struct ho
+@@ -3498,6 +3498,8 @@ static int hostapd_config_fill(struct ho
} 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;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/470-survey_data_fallback.patch b/recipes-wifi/hostapd/files/patches-2.10.3/470-survey_data_fallback.patch
index 359b5f3..79ab48c 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/470-survey_data_fallback.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/470-survey_data_fallback.patch
@@ -1,24 +1,29 @@
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
-@@ -420,20 +420,19 @@ static int acs_usable_bw160_chan(const s
+@@ -455,17 +455,17 @@ static int acs_get_bw_center_chan(int fr
static int acs_survey_is_sufficient(struct freq_survey *survey)
{
if (!(survey->filled & SURVEY_HAS_NF)) {
+ survey->nf = -95;
- wpa_printf(MSG_INFO, "ACS: Survey is missing noise floor");
+ wpa_printf(MSG_INFO,
+ "ACS: Survey for freq %d is missing noise floor",
+ survey->freq);
- return 0;
}
if (!(survey->filled & SURVEY_HAS_CHAN_TIME)) {
+ survey->channel_time = 0;
- wpa_printf(MSG_INFO, "ACS: Survey is missing channel time");
+ wpa_printf(MSG_INFO,
+ "ACS: Survey for freq %d is missing channel time",
+ survey->freq);
- return 0;
}
if (!(survey->filled & SURVEY_HAS_CHAN_TIME_BUSY) &&
- !(survey->filled & SURVEY_HAS_CHAN_TIME_RX)) {
+@@ -473,7 +473,6 @@ static int acs_survey_is_sufficient(stru
wpa_printf(MSG_INFO,
- "ACS: Survey is missing RX and busy time (at least one is required)");
+ "ACS: Survey for freq %d is missing RX and busy time (at least one is required)",
+ survey->freq);
- return 0;
}
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/500-lto-jobserver-support.patch b/recipes-wifi/hostapd/files/patches-2.10.3/500-lto-jobserver-support.patch
index 1a0ce12..046da42 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/500-lto-jobserver-support.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/500-lto-jobserver-support.patch
@@ -1,6 +1,6 @@
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
-@@ -1394,7 +1394,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS)
+@@ -1396,7 +1396,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS)
@$(AR) cr $@ hostapd_multi.o $(OBJS)
hostapd: $(OBJS)
@@ -9,7 +9,7 @@
@$(E) " LD " $@
ifdef CONFIG_WPA_TRACE
-@@ -1405,7 +1405,7 @@ _OBJS_VAR := OBJS_c
+@@ -1407,7 +1407,7 @@ _OBJS_VAR := OBJS_c
include ../src/objs.mk
hostapd_cli: $(OBJS_c)
@@ -20,7 +20,7 @@
NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS)
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
-@@ -2025,31 +2025,31 @@ wpa_supplicant_multi.a: .config $(BCHECK
+@@ -2039,31 +2039,31 @@ wpa_supplicant_multi.a: .config $(BCHECK
@$(AR) cr $@ wpa_supplicant_multi.o $(OBJS)
wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/590-rrm-wnm-statistics.patch b/recipes-wifi/hostapd/files/patches-2.10.3/590-rrm-wnm-statistics.patch
index 98b8820..a6f4317 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/590-rrm-wnm-statistics.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/590-rrm-wnm-statistics.patch
@@ -42,9 +42,9 @@
wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request to "
MACSTR " dialog_token=%u req_mode=0x%x disassoc_timer=%u "
"validity_interval=%u",
-@@ -659,10 +660,12 @@ int ieee802_11_rx_wnm_action_ap(struct h
-
- switch (action) {
+@@ -790,10 +791,12 @@ int ieee802_11_rx_wnm_action_ap(struct h
+ plen);
+ return 0;
case WNM_BSS_TRANS_MGMT_QUERY:
+ hapd->openwrt_stats.wnm.bss_transition_query_rx++;
ieee802_11_rx_bss_trans_mgmt_query(hapd, mgmt->sa, payload,
@@ -55,7 +55,7 @@
ieee802_11_rx_bss_trans_mgmt_resp(hapd, mgmt->sa, payload,
plen);
return 0;
-@@ -709,6 +712,7 @@ int wnm_send_disassoc_imminent(struct ho
+@@ -840,6 +843,7 @@ int wnm_send_disassoc_imminent(struct ho
pos = mgmt->u.action.u.bss_tm_req.variable;
@@ -63,7 +63,7 @@
wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request frame to indicate imminent disassociation (disassoc_timer=%d) to "
MACSTR, disassoc_timer, MAC2STR(sta->addr));
if (hostapd_drv_send_mlme(hapd, buf, pos - buf, 0, NULL, 0, 0) < 0) {
-@@ -790,6 +794,7 @@ int wnm_send_ess_disassoc_imminent(struc
+@@ -921,6 +925,7 @@ int wnm_send_ess_disassoc_imminent(struc
return -1;
}
@@ -71,7 +71,7 @@
if (disassoc_timer) {
/* send disassociation frame after time-out */
set_disassoc_timer(hapd, sta, disassoc_timer);
-@@ -870,6 +875,7 @@ int wnm_send_bss_tm_req(struct hostapd_d
+@@ -1001,6 +1006,7 @@ int wnm_send_bss_tm_req(struct hostapd_d
}
os_free(buf);
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/600-ubus_support.patch b/recipes-wifi/hostapd/files/patches-2.10.3/600-ubus_support.patch
index 521e7df..aa68079 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/600-ubus_support.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/600-ubus_support.patch
@@ -39,7 +39,7 @@
int interface_added; /* virtual interface added for this BSS */
unsigned int started:1;
unsigned int disabled:1;
-@@ -673,6 +675,7 @@ hostapd_alloc_bss_data(struct hostapd_if
+@@ -682,6 +684,7 @@ hostapd_alloc_bss_data(struct hostapd_if
struct hostapd_bss_config *bss);
int hostapd_setup_interface(struct hostapd_iface *iface);
int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err);
@@ -49,7 +49,7 @@
struct hostapd_iface * hostapd_alloc_iface(void);
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -401,6 +401,7 @@ void hostapd_free_hapd_data(struct hosta
+@@ -435,6 +435,7 @@ void hostapd_free_hapd_data(struct hosta
hapd->beacon_set_done = 0;
wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface);
@@ -57,7 +57,7 @@
accounting_deinit(hapd);
hostapd_deinit_wpa(hapd);
vlan_deinit(hapd);
-@@ -1431,6 +1432,8 @@ static int hostapd_setup_bss(struct host
+@@ -1185,6 +1186,8 @@ static int hostapd_start_beacon(struct h
if (hapd->driver && hapd->driver->set_operstate)
hapd->driver->set_operstate(hapd->drv_priv, 1);
@@ -66,7 +66,7 @@
return 0;
}
-@@ -2050,6 +2053,7 @@ static int hostapd_setup_interface_compl
+@@ -2126,6 +2129,7 @@ static int hostapd_setup_interface_compl
if (err)
goto fail;
@@ -74,7 +74,7 @@
wpa_printf(MSG_DEBUG, "Completing interface initialization");
if (iface->freq) {
#ifdef NEED_AP_MLME
-@@ -2248,6 +2252,7 @@ dfs_offload:
+@@ -2342,6 +2346,7 @@ dfs_offload:
fail:
wpa_printf(MSG_ERROR, "Interface initialization failed");
@@ -82,7 +82,7 @@
hostapd_set_state(iface, HAPD_IFACE_DISABLED);
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED);
#ifdef CONFIG_FST
-@@ -2723,6 +2728,7 @@ void hostapd_interface_deinit_free(struc
+@@ -2817,6 +2822,7 @@ void hostapd_interface_deinit_free(struc
(unsigned int) iface->conf->num_bss);
driver = iface->bss[0]->driver;
drv_priv = iface->bss[0]->drv_priv;
@@ -92,7 +92,7 @@
__func__, driver, drv_priv);
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
-@@ -3573,13 +3573,18 @@ static void handle_auth(struct hostapd_d
+@@ -2740,13 +2740,18 @@ static void handle_auth(struct hostapd_d
u16 auth_alg, auth_transaction, status_code;
u16 resp = WLAN_STATUS_SUCCESS;
struct sta_info *sta = NULL;
@@ -112,7 +112,7 @@
if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) {
wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)",
-@@ -3747,6 +3752,13 @@ static void handle_auth(struct hostapd_d
+@@ -2914,6 +2919,13 @@ static void handle_auth(struct hostapd_d
resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
goto fail;
}
@@ -126,7 +126,7 @@
if (res == HOSTAPD_ACL_PENDING)
return;
-@@ -5488,7 +5500,7 @@ static void handle_assoc(struct hostapd_
+@@ -4695,7 +4707,7 @@ static void handle_assoc(struct hostapd_
int resp = WLAN_STATUS_SUCCESS;
u16 reply_res = WLAN_STATUS_UNSPECIFIED_FAILURE;
const u8 *pos;
@@ -135,7 +135,7 @@
struct sta_info *sta;
u8 *tmp = NULL;
#ifdef CONFIG_FILS
-@@ -5701,6 +5713,11 @@ static void handle_assoc(struct hostapd_
+@@ -4908,6 +4920,11 @@ static void handle_assoc(struct hostapd_
left = res;
}
#endif /* CONFIG_FILS */
@@ -147,7 +147,7 @@
/* followed by SSID and Supported rates; and HT capabilities if 802.11n
* is used */
-@@ -5799,6 +5816,13 @@ static void handle_assoc(struct hostapd_
+@@ -5006,6 +5023,13 @@ static void handle_assoc(struct hostapd_
}
#endif /* CONFIG_FILS */
@@ -161,7 +161,7 @@
fail:
/*
-@@ -5892,6 +5916,7 @@ static void handle_disassoc(struct hosta
+@@ -5099,6 +5123,7 @@ static void handle_disassoc(struct hosta
wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d",
MAC2STR(mgmt->sa),
le_to_host16(mgmt->u.disassoc.reason_code));
@@ -169,7 +169,7 @@
sta = ap_get_sta(hapd, mgmt->sa);
if (sta == NULL) {
-@@ -5961,6 +5986,8 @@ static void handle_deauth(struct hostapd
+@@ -5168,6 +5193,8 @@ static void handle_deauth(struct hostapd
/* Clear the PTKSA cache entries for PASN */
ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE);
@@ -180,7 +180,7 @@
wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying "
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
-@@ -919,6 +919,12 @@ void handle_probe_req(struct hostapd_dat
+@@ -1006,6 +1006,12 @@ void handle_probe_req(struct hostapd_dat
u16 csa_offs[2];
size_t csa_offs_len;
struct radius_sta rad_info;
@@ -193,7 +193,7 @@
if (hapd->iconf->rssi_ignore_probe_request && ssi_signal &&
ssi_signal < hapd->iconf->rssi_ignore_probe_request)
-@@ -1105,6 +1111,12 @@ void handle_probe_req(struct hostapd_dat
+@@ -1192,6 +1198,12 @@ void handle_probe_req(struct hostapd_dat
}
#endif /* CONFIG_P2P */
@@ -250,7 +250,7 @@
ap_free_sta(hapd, sta);
break;
}
-@@ -1298,12 +1300,25 @@ void ap_sta_set_authorized(struct hostap
+@@ -1305,15 +1307,28 @@ void ap_sta_set_authorized(struct hostap
sta->addr, authorized, dev_addr);
if (authorized) {
@@ -265,18 +265,21 @@
+ [WLAN_AUTH_PASN] = "pasn",
+ };
+ const char *auth_alg = NULL;
+ const u8 *dpp_pkhash;
const char *keyid;
+ char dpp_pkhash_buf[100];
char keyid_buf[100];
char ip_addr[100];
+ char alg_buf[100];
+ dpp_pkhash_buf[0] = '\0';
keyid_buf[0] = '\0';
ip_addr[0] = '\0';
+ alg_buf[0] = '\0';
#ifdef CONFIG_P2P
if (wpa_auth_get_ip_addr(sta->wpa_sm, ip_addr_buf) == 0) {
os_snprintf(ip_addr, sizeof(ip_addr),
-@@ -1313,22 +1328,31 @@ void ap_sta_set_authorized(struct hostap
+@@ -1323,6 +1338,13 @@ void ap_sta_set_authorized(struct hostap
}
#endif /* CONFIG_P2P */
@@ -285,27 +288,29 @@
+
+ if (auth_alg)
+ os_snprintf(alg_buf, sizeof(alg_buf),
-+ " auth_alg=%s", auth_alg);
++ " auth_alg=%s", auth_alg);
+
keyid = ap_sta_wpa_get_keyid(hapd, sta);
if (keyid) {
os_snprintf(keyid_buf, sizeof(keyid_buf),
- " keyid=%s", keyid);
+@@ -1341,17 +1363,19 @@ void ap_sta_set_authorized(struct hostap
+ dpp_pkhash, SHA256_MAC_LEN);
}
-- wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s",
-- buf, ip_addr, keyid_buf);
+- wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s%s",
+- buf, ip_addr, keyid_buf, dpp_pkhash_buf);
+ hostapd_ubus_notify_authorized(hapd, sta, auth_alg);
-+ wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s%s",
-+ buf, ip_addr, keyid_buf, alg_buf);
++ wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s%s%s",
++ buf, ip_addr, keyid_buf, dpp_pkhash_buf, alg_buf);
if (hapd->msg_ctx_parent &&
hapd->msg_ctx_parent != hapd->msg_ctx)
wpa_msg_no_global(hapd->msg_ctx_parent, MSG_INFO,
-- AP_STA_CONNECTED "%s%s%s",
-- buf, ip_addr, keyid_buf);
-+ AP_STA_CONNECTED "%s%s%s%s",
-+ buf, ip_addr, keyid_buf, alg_buf);
+- AP_STA_CONNECTED "%s%s%s%s",
++ AP_STA_CONNECTED "%s%s%s%s%s",
+ buf, ip_addr, keyid_buf,
+- dpp_pkhash_buf);
++ dpp_pkhash_buf, alg_buf);
} else {
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf);
+ hostapd_ubus_notify(hapd, "disassoc", sta->addr);
@@ -314,7 +319,7 @@
hapd->msg_ctx_parent != hapd->msg_ctx)
--- a/src/ap/wpa_auth_glue.c
+++ b/src/ap/wpa_auth_glue.c
-@@ -268,6 +268,7 @@ static void hostapd_wpa_auth_psk_failure
+@@ -269,6 +269,7 @@ static void hostapd_wpa_auth_psk_failure
struct hostapd_data *hapd = ctx;
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR,
MAC2STR(addr));
@@ -324,7 +329,7 @@
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
-@@ -183,6 +183,12 @@ ifdef CONFIG_EAPOL_TEST
+@@ -194,6 +194,12 @@ ifdef CONFIG_EAPOL_TEST
CFLAGS += -Werror -DEAPOL_TEST
endif
@@ -337,7 +342,7 @@
ifdef CONFIG_CODE_COVERAGE
CFLAGS += -O0 -fprofile-arcs -ftest-coverage
LIBS += -lgcov
-@@ -977,6 +983,9 @@ ifdef CONFIG_CTRL_IFACE_MIB
+@@ -989,6 +995,9 @@ ifdef CONFIG_CTRL_IFACE_MIB
CFLAGS += -DCONFIG_CTRL_IFACE_MIB
endif
OBJS += ../src/ap/ctrl_iface_ap.o
@@ -349,7 +354,7 @@
CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -7285,6 +7285,8 @@ struct wpa_supplicant * wpa_supplicant_a
+@@ -7608,6 +7608,8 @@ struct wpa_supplicant * wpa_supplicant_a
}
#endif /* CONFIG_P2P */
@@ -358,7 +363,7 @@
return wpa_s;
}
-@@ -7311,6 +7313,8 @@ int wpa_supplicant_remove_iface(struct w
+@@ -7634,6 +7636,8 @@ int wpa_supplicant_remove_iface(struct w
struct wpa_supplicant *parent = wpa_s->parent;
#endif /* CONFIG_MESH */
@@ -367,7 +372,7 @@
/* Remove interface from the global list of interfaces */
prev = global->ifaces;
if (prev == wpa_s) {
-@@ -7614,8 +7618,12 @@ int wpa_supplicant_run(struct wpa_global
+@@ -7980,8 +7984,12 @@ int wpa_supplicant_run(struct wpa_global
eloop_register_signal_terminate(wpa_supplicant_terminate, global);
eloop_register_signal_reconfig(wpa_supplicant_reconfig, global);
@@ -382,15 +387,15 @@
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
-@@ -20,6 +20,7 @@
- #include "wps/wps_defs.h"
+@@ -21,6 +21,7 @@
#include "config_ssid.h"
#include "wmm_ac.h"
+ #include "pasn/pasn_common.h"
+#include "ubus.h"
extern const char *const wpa_supplicant_version;
extern const char *const wpa_supplicant_license;
-@@ -323,6 +324,8 @@ struct wpa_global {
+@@ -324,6 +325,8 @@ struct wpa_global {
#endif /* CONFIG_WIFI_DISPLAY */
struct psk_list_entry *add_psk; /* From group formation */
@@ -399,7 +404,7 @@
};
-@@ -707,6 +710,7 @@ struct wpa_supplicant {
+@@ -655,6 +658,7 @@ struct wpa_supplicant {
unsigned char own_addr[ETH_ALEN];
unsigned char perm_addr[ETH_ALEN];
char ifname[100];
@@ -417,7 +422,7 @@
#ifndef WPS_PIN_SCAN_IGNORE_SEL_REG
-@@ -391,6 +392,8 @@ static int wpa_supplicant_wps_cred(void
+@@ -402,6 +403,8 @@ static int wpa_supplicant_wps_cred(void
wpa_hexdump_key(MSG_DEBUG, "WPS: Received Credential attribute",
cred->cred_attr, cred->cred_attr_len);
@@ -428,7 +433,7 @@
--- a/hostapd/main.c
+++ b/hostapd/main.c
-@@ -897,6 +897,7 @@ int main(int argc, char *argv[])
+@@ -901,6 +901,7 @@ int main(int argc, char *argv[])
}
hostapd_global_ctrl_iface_init(&interfaces);
@@ -436,7 +441,7 @@
if (hostapd_global_run(&interfaces, daemonize, pid_file)) {
wpa_printf(MSG_ERROR, "Failed to start eloop");
-@@ -906,6 +907,7 @@ int main(int argc, char *argv[])
+@@ -910,6 +911,7 @@ int main(int argc, char *argv[])
ret = 0;
out:
@@ -527,7 +532,7 @@
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -1203,6 +1203,8 @@ int hostapd_dfs_pre_cac_expired(struct h
+@@ -1211,6 +1211,8 @@ int hostapd_dfs_pre_cac_expired(struct h
"freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d",
freq, ht_enabled, chan_offset, chan_width, cf1, cf2);
@@ -569,7 +574,7 @@
}
--- a/src/ap/sta_info.h
+++ b/src/ap/sta_info.h
-@@ -328,6 +328,7 @@ struct sta_info {
+@@ -293,6 +293,7 @@ struct sta_info {
#endif /* CONFIG_TESTING_OPTIONS */
#ifdef CONFIG_AIRTIME_POLICY
unsigned int airtime_weight;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/700-wifi-reload.patch b/recipes-wifi/hostapd/files/patches-2.10.3/700-wifi-reload.patch
index 174127d..5ac7f71 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/700-wifi-reload.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/700-wifi-reload.patch
@@ -1,6 +1,6 @@
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -2416,6 +2416,8 @@ static int hostapd_config_fill(struct ho
+@@ -2418,6 +2418,8 @@ static int hostapd_config_fill(struct ho
bss->isolate = atoi(pos);
} else if (os_strcmp(buf, "ap_max_inactivity") == 0) {
bss->ap_max_inactivity = atoi(pos);
@@ -8,8 +8,8 @@
+ bss->config_id = os_strdup(pos);
} else if (os_strcmp(buf, "skip_inactivity_poll") == 0) {
bss->skip_inactivity_poll = atoi(pos);
- } else if (os_strcmp(buf, "country_code") == 0) {
-@@ -3121,6 +3123,8 @@ static int hostapd_config_fill(struct ho
+ } else if (os_strcmp(buf, "config_id") == 0) {
+@@ -3128,6 +3130,8 @@ static int hostapd_config_fill(struct ho
}
} else if (os_strcmp(buf, "acs_exclude_dfs") == 0) {
conf->acs_exclude_dfs = atoi(pos);
@@ -20,15 +20,7 @@
} else if (os_strcmp(buf, "channel") == 0) {
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
-@@ -796,6 +796,7 @@ void hostapd_config_free_bss(struct host
- os_free(conf->radius_req_attr_sqlite);
- os_free(conf->rsn_preauth_interfaces);
- os_free(conf->ctrl_interface);
-+ os_free(conf->config_id);
- os_free(conf->ca_cert);
- os_free(conf->server_cert);
- os_free(conf->server_cert2);
-@@ -995,6 +996,7 @@ void hostapd_config_free(struct hostapd_
+@@ -997,6 +997,7 @@ void hostapd_config_free(struct hostapd_
for (i = 0; i < conf->num_bss; i++)
hostapd_config_free_bss(conf->bss[i]);
@@ -38,16 +30,7 @@
os_free(conf->basic_rates);
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -285,6 +285,8 @@ struct hostapd_bss_config {
- char vlan_bridge[IFNAMSIZ + 1];
- char wds_bridge[IFNAMSIZ + 1];
-
-+ char *config_id;
-+
- enum hostapd_logger_level logger_syslog_level, logger_stdout_level;
-
- unsigned int logger_syslog; /* module bitfield */
-@@ -969,6 +971,7 @@ struct eht_phy_capabilities_info {
+@@ -987,6 +987,7 @@ struct eht_phy_capabilities_info {
struct hostapd_config {
struct hostapd_bss_config **bss, *last_bss;
size_t num_bss;
@@ -57,7 +40,7 @@
int rts_threshold;
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -224,6 +224,10 @@ static int hostapd_iface_conf_changed(st
+@@ -254,6 +254,10 @@ static int hostapd_iface_conf_changed(st
{
size_t i;
@@ -68,7 +51,7 @@
if (newconf->num_bss != oldconf->num_bss)
return 1;
-@@ -237,7 +241,7 @@ static int hostapd_iface_conf_changed(st
+@@ -267,7 +271,7 @@ static int hostapd_iface_conf_changed(st
}
@@ -77,26 +60,17 @@
{
struct hapd_interfaces *interfaces = iface->interfaces;
struct hostapd_data *hapd = iface->bss[0];
-@@ -260,13 +264,16 @@ int hostapd_reload_config(struct hostapd
- if (newconf == NULL)
- return -1;
-
-- hostapd_clear_old(iface);
--
- oldconf = hapd->iconf;
- if (hostapd_iface_conf_changed(newconf, oldconf)) {
+@@ -295,6 +299,9 @@ int hostapd_reload_config(struct hostapd
char *fname;
int res;
+ if (reconf)
+ return -1;
+
-+ hostapd_clear_old(iface);
-+
+ hostapd_clear_old(iface);
+
wpa_printf(MSG_DEBUG,
- "Configuration changes include interface/BSS modification - force full disable+enable sequence");
- fname = os_strdup(iface->config_fname);
-@@ -291,6 +298,24 @@ int hostapd_reload_config(struct hostapd
+@@ -321,6 +328,24 @@ int hostapd_reload_config(struct hostapd
wpa_printf(MSG_ERROR,
"Failed to enable interface on config reload");
return res;
@@ -121,7 +95,7 @@
}
iface->conf = newconf;
-@@ -307,6 +332,12 @@ int hostapd_reload_config(struct hostapd
+@@ -337,6 +362,12 @@ int hostapd_reload_config(struct hostapd
for (j = 0; j < iface->num_bss; j++) {
hapd = iface->bss[j];
@@ -131,10 +105,10 @@
+ }
+ if (newconf->bss[j]->config_id)
+ hapd->config_id = strdup(newconf->bss[j]->config_id);
- hapd->iconf = newconf;
- hapd->conf = newconf->bss[j];
- hostapd_reload_bss(hapd);
-@@ -2420,6 +2451,10 @@ hostapd_alloc_bss_data(struct hostapd_if
+ if (!hapd->conf->config_id || !newconf->bss[j]->config_id ||
+ os_strcmp(hapd->conf->config_id,
+ newconf->bss[j]->config_id) != 0)
+@@ -2514,6 +2545,10 @@ hostapd_alloc_bss_data(struct hostapd_if
hapd->iconf = conf;
hapd->conf = bss;
hapd->iface = hapd_iface;
@@ -164,7 +138,7 @@
int interface_added; /* virtual interface added for this BSS */
unsigned int started:1;
unsigned int disabled:1;
-@@ -667,7 +668,7 @@ struct hostapd_iface {
+@@ -676,7 +677,7 @@ struct hostapd_iface {
int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
int (*cb)(struct hostapd_iface *iface,
void *ctx), void *ctx);
@@ -175,19 +149,19 @@
hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -4852,6 +4852,9 @@ static int wpa_driver_nl80211_set_ap(voi
+@@ -5054,6 +5054,9 @@ static int wpa_driver_nl80211_set_ap(voi
if (ret) {
wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)",
ret, strerror(-ret));
-+ if (!bss->beacon_set)
++ if (!bss->flink->beacon_set)
+ ret = 0;
-+ bss->beacon_set = 0;
++ bss->flink->beacon_set = 0;
} else {
- bss->beacon_set = 1;
+ bss->flink->beacon_set = 1;
nl80211_set_bss(bss, params->cts_protect, params->preamble,
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -186,7 +186,7 @@ static int hostapd_ctrl_iface_update(str
+@@ -187,7 +187,7 @@ static int hostapd_ctrl_iface_update(str
iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read;
reload_opts = txt;
@@ -198,7 +172,7 @@
}
--- a/hostapd/main.c
+++ b/hostapd/main.c
-@@ -317,7 +317,7 @@ static void handle_term(int sig, void *s
+@@ -320,7 +320,7 @@ static void handle_term(int sig, void *s
static int handle_reload_iface(struct hostapd_iface *iface, void *ctx)
{
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/710-vlan_no_bridge.patch b/recipes-wifi/hostapd/files/patches-2.10.3/710-vlan_no_bridge.patch
index b06ef8f..f625f4b 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/710-vlan_no_bridge.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/710-vlan_no_bridge.patch
@@ -30,7 +30,7 @@
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -3346,6 +3346,8 @@ static int hostapd_config_fill(struct ho
+@@ -3353,6 +3353,8 @@ static int hostapd_config_fill(struct ho
#ifndef CONFIG_NO_VLAN
} else if (os_strcmp(buf, "dynamic_vlan") == 0) {
bss->ssid.dynamic_vlan = atoi(pos);
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/711-wds_bridge_force.patch b/recipes-wifi/hostapd/files/patches-2.10.3/711-wds_bridge_force.patch
index 169807c..e04ae62 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/711-wds_bridge_force.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/711-wds_bridge_force.patch
@@ -6,12 +6,12 @@
os_strlcpy(bss->bridge, pos, sizeof(bss->bridge));
+ if (!bss->wds_bridge[0])
+ os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge));
+ } else if (os_strcmp(buf, "bridge_hairpin") == 0) {
+ bss->bridge_hairpin = atoi(pos);
} 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) {
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -340,8 +340,6 @@ int hostapd_set_wds_sta(struct hostapd_d
+@@ -348,8 +348,6 @@ int hostapd_set_wds_sta(struct hostapd_d
return -1;
if (hapd->conf->wds_bridge[0])
bridge = hapd->conf->wds_bridge;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/720-iface_max_num_sta.patch b/recipes-wifi/hostapd/files/patches-2.10.3/720-iface_max_num_sta.patch
index ed76d22..a06f141 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/720-iface_max_num_sta.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/720-iface_max_num_sta.patch
@@ -1,6 +1,6 @@
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -2841,6 +2841,14 @@ static int hostapd_config_fill(struct ho
+@@ -2848,6 +2848,14 @@ static int hostapd_config_fill(struct ho
line, bss->max_num_sta, MAX_STA_COUNT);
return 1;
}
@@ -17,7 +17,7 @@
} else if (os_strcmp(buf, "extended_key_id") == 0) {
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
-@@ -711,6 +711,7 @@ void hostapd_cleanup_cs_params(struct ho
+@@ -721,6 +721,7 @@ void hostapd_cleanup_cs_params(struct ho
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);
@@ -27,7 +27,7 @@
void hostapd_cleanup_cca_params(struct hostapd_data *hapd);
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -241,6 +241,30 @@ static int hostapd_iface_conf_changed(st
+@@ -271,6 +271,30 @@ static int hostapd_iface_conf_changed(st
}
@@ -60,7 +60,7 @@
struct hapd_interfaces *interfaces = iface->interfaces;
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
-@@ -1135,7 +1135,7 @@ void handle_probe_req(struct hostapd_dat
+@@ -1222,7 +1222,7 @@ void handle_probe_req(struct hostapd_dat
if (hapd->conf->no_probe_resp_if_max_sta &&
is_multicast_ether_addr(mgmt->da) &&
is_multicast_ether_addr(mgmt->bssid) &&
@@ -71,7 +71,7 @@
" since no room for additional STA",
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1010,6 +1010,8 @@ struct hostapd_config {
+@@ -1026,6 +1026,8 @@ struct hostapd_config {
unsigned int track_sta_max_num;
unsigned int track_sta_max_age;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/730-ft_iface.patch b/recipes-wifi/hostapd/files/patches-2.10.3/730-ft_iface.patch
index d9a4f15..1826c97 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/730-ft_iface.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/730-ft_iface.patch
@@ -1,6 +1,6 @@
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -3000,6 +3000,8 @@ static int hostapd_config_fill(struct ho
+@@ -3007,6 +3007,8 @@ static int hostapd_config_fill(struct ho
wpa_printf(MSG_INFO,
"Line %d: Obsolete peerkey parameter ignored", line);
#ifdef CONFIG_IEEE80211R_AP
@@ -18,10 +18,10 @@
+ char ft_iface[IFNAMSIZ + 1];
char vlan_bridge[IFNAMSIZ + 1];
char wds_bridge[IFNAMSIZ + 1];
-
+ int bridge_hairpin; /* hairpin_mode on bridge members */
--- a/src/ap/wpa_auth_glue.c
+++ b/src/ap/wpa_auth_glue.c
-@@ -1595,8 +1595,12 @@ int hostapd_setup_wpa(struct hostapd_dat
+@@ -1616,8 +1616,12 @@ int hostapd_setup_wpa(struct hostapd_dat
wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt)) {
const char *ft_iface;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/740-snoop_iface.patch b/recipes-wifi/hostapd/files/patches-2.10.3/740-snoop_iface.patch
index 608f15a..a116644 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/740-snoop_iface.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/740-snoop_iface.patch
@@ -7,7 +7,7 @@
+ char snoop_iface[IFNAMSIZ + 1];
char vlan_bridge[IFNAMSIZ + 1];
char wds_bridge[IFNAMSIZ + 1];
-
+ int bridge_hairpin; /* hairpin_mode on bridge members */
--- a/src/ap/x_snoop.c
+++ b/src/ap/x_snoop.c
@@ -33,14 +33,16 @@ int x_snoop_init(struct hostapd_data *ha
@@ -55,10 +55,10 @@
"x_snoop: Failed to initialize L2 packet processing %s",
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -2318,6 +2318,8 @@ static int hostapd_config_fill(struct ho
- os_strlcpy(bss->bridge, pos, sizeof(bss->bridge));
- if (!bss->wds_bridge[0])
+@@ -2320,6 +2320,8 @@ static int hostapd_config_fill(struct ho
os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge));
+ } else if (os_strcmp(buf, "bridge_hairpin") == 0) {
+ bss->bridge_hairpin = atoi(pos);
+ } else if (os_strcmp(buf, "snoop_iface") == 0) {
+ os_strlcpy(bss->snoop_iface, pos, sizeof(bss->snoop_iface));
} else if (os_strcmp(buf, "vlan_bridge") == 0) {
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/750-qos_map_set_without_interworking.patch b/recipes-wifi/hostapd/files/patches-2.10.3/750-qos_map_set_without_interworking.patch
index 479d561..c3a77bc 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/750-qos_map_set_without_interworking.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/750-qos_map_set_without_interworking.patch
@@ -18,7 +18,7 @@
#ifdef CONFIG_HS20
static int hs20_parse_conn_capab(struct hostapd_bss_config *bss, char *buf,
-@@ -4046,10 +4046,10 @@ static int hostapd_config_fill(struct ho
+@@ -4064,10 +4064,10 @@ static int hostapd_config_fill(struct ho
bss->gas_frag_limit = val;
} else if (os_strcmp(buf, "gas_comeback_delay") == 0) {
bss->gas_comeback_delay = atoi(pos);
@@ -32,7 +32,7 @@
os_free(bss->dump_msk_file);
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -1424,6 +1424,7 @@ static int hostapd_setup_bss(struct host
+@@ -1499,6 +1499,7 @@ static int hostapd_setup_bss(struct host
wpa_printf(MSG_ERROR, "GAS server initialization failed");
return -1;
}
@@ -40,7 +40,7 @@
if (conf->qos_map_set_len &&
hostapd_drv_set_qos_map(hapd, conf->qos_map_set,
-@@ -1431,7 +1432,6 @@ static int hostapd_setup_bss(struct host
+@@ -1506,7 +1507,6 @@ static int hostapd_setup_bss(struct host
wpa_printf(MSG_ERROR, "Failed to initialize QoS Map");
return -1;
}
@@ -50,7 +50,7 @@
wpa_printf(MSG_ERROR, "BSS Load initialization failed");
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
-@@ -2586,8 +2586,6 @@ void wnm_bss_keep_alive_deinit(struct wp
+@@ -2672,8 +2672,6 @@ void wnm_bss_keep_alive_deinit(struct wp
}
@@ -59,16 +59,16 @@
static int wpas_qos_map_set(struct wpa_supplicant *wpa_s, const u8 *qos_map,
size_t len)
{
-@@ -2620,8 +2618,6 @@ static void interworking_process_assoc_r
+@@ -2706,8 +2704,6 @@ static void interworking_process_assoc_r
}
}
-#endif /* CONFIG_INTERWORKING */
-
- static void multi_ap_process_assoc_resp(struct wpa_supplicant *wpa_s,
- const u8 *ies, size_t ies_len)
-@@ -2954,10 +2950,8 @@ static int wpa_supplicant_event_associnf
+ static void wpa_supplicant_set_4addr_mode(struct wpa_supplicant *wpa_s)
+ {
+@@ -3087,10 +3083,8 @@ static int wpa_supplicant_event_associnf
wnm_process_assoc_resp(wpa_s, data->assoc_info.resp_ies,
data->assoc_info.resp_ies_len);
#endif /* CONFIG_WNM */
@@ -81,7 +81,7 @@
data->assoc_info.resp_ies_len, WLAN_EID_VHT_CAP))
--- a/src/ap/ieee802_11_shared.c
+++ b/src/ap/ieee802_11_shared.c
-@@ -1100,13 +1100,11 @@ u8 * hostapd_eid_rsnxe(struct hostapd_da
+@@ -1116,13 +1116,11 @@ u8 * hostapd_eid_rsnxe(struct hostapd_da
u16 check_ext_capab(struct hostapd_data *hapd, struct sta_info *sta,
const u8 *ext_capab_ie, size_t ext_capab_ie_len)
{
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/751-qos_map_ignore_when_unsupported.patch b/recipes-wifi/hostapd/files/patches-2.10.3/751-qos_map_ignore_when_unsupported.patch
index d90a275..1fc4e8a 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/751-qos_map_ignore_when_unsupported.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/751-qos_map_ignore_when_unsupported.patch
@@ -1,6 +1,6 @@
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -864,7 +864,8 @@ int hostapd_start_dfs_cac(struct hostapd
+@@ -874,7 +874,8 @@ int hostapd_start_dfs_cac(struct hostapd
int hostapd_drv_set_qos_map(struct hostapd_data *hapd,
const u8 *qos_map_set, u8 qos_map_set_len)
{
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/760-dynamic_own_ip.patch b/recipes-wifi/hostapd/files/patches-2.10.3/760-dynamic_own_ip.patch
index 3d2b59e..2f50158 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/760-dynamic_own_ip.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/760-dynamic_own_ip.patch
@@ -1,6 +1,6 @@
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -311,6 +311,7 @@ struct hostapd_bss_config {
+@@ -310,6 +310,7 @@ struct hostapd_bss_config {
unsigned int eap_sim_db_timeout;
int eap_server_erp; /* Whether ERP is enabled on internal EAP server */
struct hostapd_ip_addr own_ip_addr;
@@ -98,7 +98,7 @@
hapd->conf->own_ip_addr.af == AF_INET &&
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -2681,6 +2681,8 @@ static int hostapd_config_fill(struct ho
+@@ -2688,6 +2688,8 @@ static int hostapd_config_fill(struct ho
} else if (os_strcmp(buf, "iapp_interface") == 0) {
wpa_printf(MSG_INFO, "DEPRECATED: iapp_interface not used");
#endif /* CONFIG_IAPP */
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/761-shared_das_port.patch b/recipes-wifi/hostapd/files/patches-2.10.3/761-shared_das_port.patch
index 7516b73..59c2a96 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/761-shared_das_port.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/761-shared_das_port.patch
@@ -10,7 +10,7 @@
unsigned int time_window;
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -1367,6 +1367,7 @@ static int hostapd_setup_bss(struct host
+@@ -1442,6 +1442,7 @@ static int hostapd_setup_bss(struct host
struct radius_das_conf das_conf;
os_memset(&das_conf, 0, sizeof(das_conf));
das_conf.port = conf->radius_das_port;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/800-acs-don-t-select-indoor-channel-on-outdoor-operation.patch b/recipes-wifi/hostapd/files/patches-2.10.3/800-acs-don-t-select-indoor-channel-on-outdoor-operation.patch
deleted file mode 100644
index 1d9e956..0000000
--- a/recipes-wifi/hostapd/files/patches-2.10.3/800-acs-don-t-select-indoor-channel-on-outdoor-operation.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 37528a5205cb0b9e2238b7d97fb2ff5457448f1c Mon Sep 17 00:00:00 2001
-From: David Bauer <mail@david-bauer.net>
-Date: Thu, 8 Sep 2022 01:45:41 +0200
-Subject: [PATCH] acs: don't select indoor channel on outdoor operation
-
-Don't select channels designated for exclusive-indoor use when the
-country3 element is set on outdoor operation.
-
-Signed-off-by: David Bauer <mail@david-bauer.net>
----
- src/ap/acs.c | 9 +++++++++
- src/ap/dfs.c | 3 +++
- 2 files changed, 12 insertions(+)
-
---- a/src/ap/acs.c
-+++ b/src/ap/acs.c
-@@ -552,6 +552,9 @@ static void acs_survey_mode_interference
- if (chan->max_tx_power < iface->conf->min_tx_power)
- continue;
-
-+ if (chan->flag & HOSTAPD_CHAN_INDOOR_ONLY && iface->conf->country[2] == 0x4f)
-+ continue;
-+
- wpa_printf(MSG_DEBUG, "ACS: Survey analysis for channel %d (%d MHz)",
- chan->chan, chan->freq);
-
-@@ -686,6 +689,9 @@ acs_find_ideal_chan_mode(struct hostapd_
- if (chan->max_tx_power < iface->conf->min_tx_power)
- continue;
-
-+ if (chan->flag & HOSTAPD_CHAN_INDOOR_ONLY && iface->conf->country[2] == 0x4f)
-+ continue;
-+
- if (!chan_bw_allowed(chan, bw, 1, 1)) {
- wpa_printf(MSG_DEBUG,
- "ACS: Channel %d: BW %u is not supported",
-@@ -1067,6 +1073,9 @@ static int * acs_request_scan_add_freqs(
- if (chan->max_tx_power < iface->conf->min_tx_power)
- continue;
-
-+ if (chan->flag & HOSTAPD_CHAN_INDOOR_ONLY && iface->conf->country[2] == 0x4f)
-+ continue;
-+
- *freq++ = chan->freq;
- }
-
---- a/src/ap/dfs.c
-+++ b/src/ap/dfs.c
-@@ -282,6 +282,9 @@ static int dfs_find_channel(struct hosta
- if (chan->max_tx_power < iface->conf->min_tx_power)
- continue;
-
-+ if (chan->flag & HOSTAPD_CHAN_INDOOR_ONLY && iface->conf->country[2] == 0x4f)
-+ continue;
-+
- if (ret_chan && idx == channel_idx) {
- wpa_printf(MSG_DEBUG, "Selected channel %d (%d)",
- chan->freq, chan->chan);
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch b/recipes-wifi/hostapd/files/patches-2.10.3/990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch
index e78a4ef..51690de 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch
@@ -13,7 +13,7 @@
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
-@@ -12241,7 +12241,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -12640,7 +12640,7 @@ char * wpa_supplicant_ctrl_iface_process
if (wpas_ctrl_iface_coloc_intf_report(wpa_s, buf + 18))
reply_len = -1;
#endif /* CONFIG_WNM */
@@ -22,7 +22,7 @@
} else if (os_strncmp(buf, "DISASSOC_IMMINENT ", 18) == 0) {
if (ap_ctrl_iface_disassoc_imminent(wpa_s, buf + 18))
reply_len = -1;
-@@ -12251,7 +12251,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -12650,7 +12650,7 @@ char * wpa_supplicant_ctrl_iface_process
} else if (os_strncmp(buf, "BSS_TM_REQ ", 11) == 0) {
if (ap_ctrl_iface_bss_tm_req(wpa_s, buf + 11))
reply_len = -1;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/992-openssl-include-rsa.patch b/recipes-wifi/hostapd/files/patches-2.10.3/992-openssl-include-rsa.patch
deleted file mode 100644
index 581ae9f..0000000
--- a/recipes-wifi/hostapd/files/patches-2.10.3/992-openssl-include-rsa.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From f374d52079111a4340acb6df835f45ac6b5f3f60 Mon Sep 17 00:00:00 2001
-From: Andre Heider <a.heider@gmail.com>
-Date: Wed, 22 Jun 2022 14:13:55 +0200
-Subject: OpenSSL: Include rsa.h for all OpenSSL versions
-
-This fixes the build with OpenSSL 1.1.1:
-../src/crypto/crypto_openssl.c: In function 'crypto_rsa_oaep_sha256_decrypt':
-../src/crypto/crypto_openssl.c:4404:49: error: 'RSA_PKCS1_OAEP_PADDING' undeclared (first use in this function)
-
-Signed-off-by: Andre Heider <a.heider@gmail.com>
----
- src/crypto/crypto_openssl.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/src/crypto/crypto_openssl.c
-+++ b/src/crypto/crypto_openssl.c
-@@ -16,6 +16,7 @@
- #include <openssl/dh.h>
- #include <openssl/hmac.h>
- #include <openssl/rand.h>
-+#include <openssl/rsa.h>
- #include <openssl/pem.h>
- #ifdef CONFIG_ECC
- #include <openssl/ec.h>
-@@ -25,7 +26,6 @@
- #include <openssl/provider.h>
- #include <openssl/core_names.h>
- #include <openssl/param_build.h>
--#include <openssl/rsa.h>
- #include <openssl/encoder.h>
- #include <openssl/decoder.h>
- #else /* OpenSSL version >= 3.0 */
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch
index edab139..22e4841 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch
@@ -1,7 +1,7 @@
-From 6e4d4d6feafd223615cddf334b6c3beb6e5191cc Mon Sep 17 00:00:00 2001
+From cb7b7459ac276c5713dae22b8fe19365c2895de1 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 01/29] hostapd: mtk: Add neighbor report and BSS Termination
+Subject: [PATCH 01/28] hostapd: mtk: Add neighbor report and BSS Termination
for MBO certification
1. Add hostapd_neighbor_count() and hostapd_neighbor_insert_buffer ()
@@ -32,10 +32,10 @@
9 files changed, 252 insertions(+), 5 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index a258492..c2a2822 100644
+index a0e4ecd..0355e8b 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -1338,6 +1338,11 @@ static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd)
+@@ -1347,6 +1347,11 @@ static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd)
#endif /* CONFIG_DPP */
} else if (os_strcasecmp(cmd, "setband") == 0) {
ret = hostapd_ctrl_iface_set_band(hapd, value);
@@ -48,7 +48,7 @@
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 d7a0c7c..4a20eb4 100644
+index 2755146..9f450f6 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -170,6 +170,7 @@ void hostapd_config_defaults_bss(struct hostapd_bss_config *bss)
@@ -60,7 +60,7 @@
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 39b26d6..a875632 100644
+index 7774360..af9bf92 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -558,6 +558,7 @@ struct hostapd_bss_config {
@@ -72,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 96209ce..18bae5c 100644
+index d46de44..38fc8e4 100644
--- a/src/ap/ctrl_iface_ap.c
+++ b/src/ap/ctrl_iface_ap.c
-@@ -1203,6 +1203,10 @@ int hostapd_ctrl_iface_bss_tm_req(struct hostapd_data *hapd,
+@@ -1265,6 +1265,10 @@ int hostapd_ctrl_iface_bss_tm_req(struct hostapd_data *hapd,
wpa_printf(MSG_DEBUG, "Invalid bss_term data");
return -1;
}
@@ -86,7 +86,7 @@
end++;
WPA_PUT_LE16(&bss_term_dur[10], atoi(end));
}
-@@ -1229,14 +1233,25 @@ int hostapd_ctrl_iface_bss_tm_req(struct hostapd_data *hapd,
+@@ -1291,14 +1295,25 @@ int hostapd_ctrl_iface_bss_tm_req(struct hostapd_data *hapd,
req_mode |= WNM_BSS_TM_REQ_ESS_DISASSOC_IMMINENT;
}
@@ -115,7 +115,7 @@
if (pos) {
unsigned int mbo_reason, cell_pref, reassoc_delay;
diff --git a/src/ap/gas_serv.c b/src/ap/gas_serv.c
-index 90f1577..5845ff8 100644
+index 4642e49..cce6df4 100644
--- a/src/ap/gas_serv.c
+++ b/src/ap/gas_serv.c
@@ -19,6 +19,7 @@
@@ -183,7 +183,7 @@
#ifdef CONFIG_FILS
if (info_id == ANQP_FILS_REALM_INFO &&
diff --git a/src/ap/gas_serv.h b/src/ap/gas_serv.h
-index 1528af4..d0241f2 100644
+index 7646a98..ce492b5 100644
--- a/src/ap/gas_serv.h
+++ b/src/ap/gas_serv.h
@@ -40,6 +40,8 @@
@@ -196,7 +196,7 @@
* First 15 Hotspot 2.0 vendor specific ANQP-elements can be included in the
* optimized bitmap.
diff --git a/src/ap/neighbor_db.c b/src/ap/neighbor_db.c
-index 52f25eb..9254d09 100644
+index 5b276e8..1c14b32 100644
--- a/src/ap/neighbor_db.c
+++ b/src/ap/neighbor_db.c
@@ -89,6 +89,38 @@ int hostapd_neighbor_show(struct hostapd_data *hapd, char *buf, size_t buflen)
@@ -348,7 +348,7 @@
+#endif
#endif /* NEIGHBOR_DB_H */
diff --git a/src/ap/wnm_ap.c b/src/ap/wnm_ap.c
-index 3ea92af..4349e1d 100644
+index ba1dd2e..32ccf14 100644
--- a/src/ap/wnm_ap.c
+++ b/src/ap/wnm_ap.c
@@ -20,6 +20,7 @@
@@ -402,7 +402,7 @@
hapd->openwrt_stats.wnm.bss_transition_request_tx++;
wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request to "
MACSTR " dialog_token=%u req_mode=0x%x disassoc_timer=%u "
-@@ -759,6 +780,50 @@ static void set_disassoc_timer(struct hostapd_data *hapd, struct sta_info *sta,
+@@ -890,6 +911,50 @@ static void set_disassoc_timer(struct hostapd_data *hapd, struct sta_info *sta,
}
@@ -453,15 +453,7 @@
int wnm_send_ess_disassoc_imminent(struct hostapd_data *hapd,
struct sta_info *sta, const char *url,
int disassoc_timer)
-@@ -848,6 +913,7 @@ int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta,
- bss_term_dur) {
- os_memcpy(pos, bss_term_dur, 12);
- pos += 12;
-+ set_disable_iface_timer(hapd, sta, hapd->conf->bss_termination_tsf);
- }
-
- if (url) {
-@@ -884,7 +950,7 @@ int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta,
+@@ -934,7 +999,7 @@ int wnm_send_ess_disassoc_imminent(struct hostapd_data *hapd,
hapd->openwrt_stats.wnm.bss_transition_request_tx++;
if (disassoc_timer) {
/* send disassociation frame after time-out */
@@ -470,6 +462,14 @@
}
return 0;
+@@ -979,6 +1044,7 @@ int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta,
+ bss_term_dur) {
+ os_memcpy(pos, bss_term_dur, 12);
+ pos += 12;
++ set_disable_iface_timer(hapd, sta, hapd->conf->bss_termination_tsf);
+ }
+
+ if (url) {
--
2.18.0
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
index b4ce65c..d5ebb61 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
@@ -1,17 +1,17 @@
-From 1320c3e6d39c08371da1a80ffa1ae3ecb711c742 Mon Sep 17 00:00:00 2001
+From 41cf77cdfd1b260a688592a8ae4c1474d492d6e4 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 02/29] hostapd: mtk: print sae groups by hostapd ctrl
+Subject: [PATCH 02/28] hostapd: mtk: 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 c2a2822..bc690c5 100644
+index 0355e8b..8e8a1a7 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -1412,6 +1412,19 @@ static int hostapd_ctrl_iface_get(struct hostapd_data *hapd, char *cmd,
+@@ -1421,6 +1421,19 @@ static int hostapd_ctrl_iface_get(struct hostapd_data *hapd, char *cmd,
if (os_snprintf_error(buflen, res))
return -1;
return res;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch
index 8a2ed4d..94bc2b9 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch
@@ -1,7 +1,7 @@
-From 11a3a8dcba0e17a032bf8445c6bb50835cbe8e85 Mon Sep 17 00:00:00 2001
+From c7e5ad8609443c3e484ea06df88755de55f5bda0 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 03/29] hostapd: mtk: add support for runtime set in-band
+Subject: [PATCH 03/28] hostapd: mtk: add support for runtime set in-band
discovery
Usage:
@@ -21,10 +21,10 @@
5 files changed, 98 insertions(+), 4 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index bc690c5..bb8c74f 100644
+index 8e8a1a7..c4e344e 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -826,6 +826,69 @@ static int hostapd_ctrl_iface_send_qos_map_conf(struct hostapd_data *hapd,
+@@ -827,6 +827,69 @@ static int hostapd_ctrl_iface_send_qos_map_conf(struct hostapd_data *hapd,
#endif /* CONFIG_INTERWORKING */
@@ -94,7 +94,7 @@
#ifdef CONFIG_WNM_AP
-@@ -3434,6 +3497,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -3511,6 +3574,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 */
@@ -105,10 +105,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 85c41d0..db21258 100644
+index bc8993f..05ac5ac 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -642,6 +642,24 @@ static int hostapd_cli_cmd_wps_config(struct wpa_ctrl *ctrl, int argc,
+@@ -655,6 +655,24 @@ static int hostapd_cli_cmd_wps_config(struct wpa_ctrl *ctrl, int argc,
return wpa_ctrl_command(ctrl, buf);
}
@@ -133,7 +133,7 @@
static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
char *argv[])
-@@ -1749,6 +1767,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1773,6 +1791,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 */
@@ -143,10 +143,10 @@
};
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
-index 814e86e..1a26f11 100644
+index 73ab31c..ddb5d03 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
-@@ -1497,6 +1497,8 @@ static u8 * hostapd_fils_discovery(struct hostapd_data *hapd,
+@@ -1618,6 +1618,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;
@@ -155,7 +155,7 @@
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;
-@@ -1505,7 +1507,8 @@ static u8 * hostapd_fils_discovery(struct hostapd_data *hapd,
+@@ -1626,7 +1628,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;
@@ -166,10 +166,10 @@
¶ms->fd_frame_tmpl_len);
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 1fa7dd8..c695263 100644
+index 4377165..d79929b 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -4498,9 +4498,10 @@ static int nl80211_fils_discovery(struct i802_bss *bss, struct nl_msg *msg,
+@@ -4631,9 +4631,10 @@ static int nl80211_fils_discovery(struct i802_bss *bss, struct nl_msg *msg,
params->fd_max_int) ||
(params->fd_frame_tmpl &&
nla_put(msg, NL80211_FILS_DISCOVERY_ATTR_TMPL,
@@ -182,7 +182,7 @@
nla_nest_end(msg, attr);
return 0;
}
-@@ -4844,7 +4845,10 @@ static int wpa_driver_nl80211_set_ap(void *priv,
+@@ -5038,7 +5039,10 @@ static int wpa_driver_nl80211_set_ap(void *priv,
#endif /* CONFIG_SAE */
#ifdef CONFIG_FILS
@@ -195,10 +195,10 @@
#endif /* CONFIG_FILS */
diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h
-index 0568a79..c4bf3ad 100644
+index 9a0ac03..12fc6a9 100644
--- a/src/drivers/nl80211_copy.h
+++ b/src/drivers/nl80211_copy.h
-@@ -7379,6 +7379,7 @@ enum nl80211_fils_discovery_attributes {
+@@ -7569,6 +7569,7 @@ enum nl80211_fils_discovery_attributes {
NL80211_FILS_DISCOVERY_ATTR_INT_MIN,
NL80211_FILS_DISCOVERY_ATTR_INT_MAX,
NL80211_FILS_DISCOVERY_ATTR_TMPL,
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch
index 0490689..e9d1726 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch
@@ -1,7 +1,7 @@
-From f05288a19fe295685de4cb419c31f4bd11a774df Mon Sep 17 00:00:00 2001
+From e478ae5563a043f3d18be4bbbed682ac04e48d22 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 04/29] hostapd: mtk: Add mtk_vendor.h
+Subject: [PATCH 04/28] hostapd: mtk: Add mtk_vendor.h
---
src/common/mtk_vendor.h | 195 ++++++++++++++++++++++++++++++++++++++++
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
index ade6b9d..751ad04 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
@@ -1,7 +1,7 @@
-From c69f15f922f2095b6f36a5bbd5186e4ff5e44021 Mon Sep 17 00:00:00 2001
+From 15420724ea5d0aef0296e562c96be19262485575 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 05/29] hostapd: mtk: Support EDCCA hostapd configuration
+Subject: [PATCH 05/28] hostapd: mtk: Support EDCCA hostapd configuration
edcca_enable and edcca_compensation and implement edcca related handlers.
---
@@ -10,22 +10,22 @@
src/ap/ap_config.c | 4 +
src/ap/ap_config.h | 29 ++++++
src/ap/ap_drv_ops.c | 24 +++++
- src/ap/ap_drv_ops.h | 5 +-
+ src/ap/ap_drv_ops.h | 4 +
src/ap/hostapd.c | 7 ++
src/common/mtk_vendor.h | 19 ++--
src/drivers/driver.h | 4 +
src/drivers/driver_nl80211.c | 165 ++++++++++++++++++++++++++++++
src/drivers/driver_nl80211.h | 1 +
src/drivers/driver_nl80211_capa.c | 7 ++
- 12 files changed, 415 insertions(+), 7 deletions(-)
+ 12 files changed, 415 insertions(+), 6 deletions(-)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index 24018f7..b5024cc 100644
+index 11a3a1a..a48034b 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -4755,6 +4755,38 @@ static int hostapd_config_fill(struct hostapd_config *conf,
- } else if (os_strcmp(buf, "eht_mu_beamformer") == 0) {
- conf->eht_phy_capab.mu_beamformer = atoi(pos);
+@@ -4799,6 +4799,38 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+ }
+ conf->punct_acs_threshold = val;
#endif /* CONFIG_IEEE80211BE */
+ } else if (os_strcmp(buf, "edcca_threshold") == 0) {
+ if (hostapd_parse_intlist(&conf->edcca_threshold, pos) ||
@@ -63,10 +63,10 @@
wpa_printf(MSG_ERROR,
"Line %d: unknown configuration item '%s'",
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index bb8c74f..9c70d54 100644
+index c4e344e..c5c0e91 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -598,6 +598,19 @@ static const char * pbc_status_str(enum pbc_status status)
+@@ -599,6 +599,19 @@ static const char * pbc_status_str(enum pbc_status status)
}
@@ -86,7 +86,7 @@
static int hostapd_ctrl_iface_wps_get_status(struct hostapd_data *hapd,
char *buf, size_t buflen)
{
-@@ -3322,6 +3335,112 @@ static int hostapd_ctrl_iface_driver_cmd(struct hostapd_data *hapd, char *cmd,
+@@ -3397,6 +3410,112 @@ static int hostapd_ctrl_iface_driver_cmd(struct hostapd_data *hapd, char *cmd,
#endif /* ANDROID */
@@ -199,7 +199,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
int reply_size,
-@@ -3868,6 +3987,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -3952,6 +4071,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
reply_len = hostapd_ctrl_iface_driver_cmd(hapd, buf + 7, reply,
reply_size);
#endif /* ANDROID */
@@ -213,7 +213,7 @@
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 4a20eb4..344585a 100644
+index 9f450f6..55c35c7 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -294,6 +294,9 @@ struct hostapd_config * hostapd_config_defaults(void)
@@ -226,7 +226,7 @@
return conf;
}
-@@ -1007,6 +1010,7 @@ void hostapd_config_free(struct hostapd_config *conf)
+@@ -1008,6 +1011,7 @@ void hostapd_config_free(struct hostapd_config *conf)
#ifdef CONFIG_ACS
os_free(conf->acs_chan_bias);
#endif /* CONFIG_ACS */
@@ -235,18 +235,19 @@
wpabuf_free(conf->civic);
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index a875632..4ac4699 100644
+index af9bf92..22b1276 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1154,8 +1154,37 @@ struct hostapd_config {
- #define CH_SWITCH_EHT_ENABLED BIT(0)
- #define CH_SWITCH_EHT_DISABLED BIT(1)
- unsigned int ch_switch_eht_config;
+@@ -1180,8 +1180,37 @@ struct hostapd_config {
+ MBSSID_ENABLED = 1,
+ ENHANCED_MBSSID_ENABLED = 2,
+ } mbssid;
++
+ u8 edcca_enable;
+ s8 edcca_compensation;
+ int *edcca_threshold;
- };
-
++};
++
+enum edcca_mode {
+ EDCCA_MODE_FORCE_DISABLE = 0,
+ EDCCA_MODE_AUTO = 1,
@@ -265,32 +266,31 @@
+ EDCCA_CTRL_GET_EN,
+ EDCCA_CTRL_GET_THRES,
+ EDCCA_CTRL_NUM,
-+};
-+
+ };
+
+#define EDCCA_DEFAULT_COMPENSATION -6
+#define EDCCA_MIN_COMPENSATION -126
+#define EDCCA_MAX_COMPENSATION 126
+#define EDCCA_MIN_CONFIG_THRES -126
+#define EDCCA_MAX_CONFIG_THRES 0
-+
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 0c7aee2..25e967d 100644
+index ab84a63..af6944b 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1015,3 +1015,27 @@ int hostapd_drv_dpp_listen(struct hostapd_data *hapd, bool enable)
- return 0;
- return hapd->driver->dpp_listen(hapd->drv_priv, enable);
+@@ -1054,3 +1054,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 */
+
+int hostapd_drv_configure_edcca_enable(struct hostapd_data *hapd)
+{
+ if (!hapd->driver || !hapd->driver->configure_edcca_enable)
+ return 0;
+ return hapd->driver->configure_edcca_enable(hapd->drv_priv,
-+ hapd->iconf->edcca_enable,
++ hapd->iconf->edcca_enable,
+ hapd->iconf->edcca_compensation);
+}
+
@@ -309,14 +309,13 @@
+ 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 b4fb766..70a99f4 100644
+index 93b2244..b89ad6e 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -138,7 +138,10 @@ int hostapd_drv_do_acs(struct hostapd_data *hapd);
- int hostapd_drv_update_dh_ie(struct hostapd_data *hapd, const u8 *peer,
- u16 reason_code, const u8 *ie, size_t ielen);
- int hostapd_drv_dpp_listen(struct hostapd_data *hapd, bool enable);
--
+@@ -144,6 +144,10 @@ int hostapd_drv_set_secure_ranging_ctx(struct hostapd_data *hapd,
+ u8 ltf_keyseed_len,
+ const u8 *ltf_keyseed, u32 action);
+
+int hostapd_drv_configure_edcca_enable(struct hostapd_data *hapd);
+int hostapd_drv_configure_edcca_threshold(struct hostapd_data *hapd,
+ const int *threshold);
@@ -325,10 +324,10 @@
#include "drivers/driver.h"
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index 65487ac..3bb38fe 100644
+index f5da65a..cd0a0c9 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -2296,6 +2296,13 @@ dfs_offload:
+@@ -2390,6 +2390,13 @@ dfs_offload:
}
#endif /* CONFIG_MESH */
@@ -375,10 +374,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 1d2b1b2..3559974 100644
+index 2f91d30..73c7bb4 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -4676,6 +4676,10 @@ struct wpa_driver_ops {
+@@ -5001,6 +5001,10 @@ struct wpa_driver_ops {
const u8 *match, size_t match_len,
bool multicast);
#endif /* CONFIG_TESTING_OPTIONS */
@@ -390,10 +389,10 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index c695263..6d4a4db 100644
+index d79929b..f5c95e1 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -35,6 +35,8 @@
+@@ -37,6 +37,8 @@
#include "radiotap_iter.h"
#include "rfkill.h"
#include "driver_nl80211.h"
@@ -402,7 +401,7 @@
#ifndef NETLINK_CAP_ACK
-@@ -12368,6 +12370,165 @@ static int testing_nl80211_radio_disable(void *priv, int disabled)
+@@ -13366,6 +13368,165 @@ static int testing_nl80211_radio_disable(void *priv, int disabled)
#endif /* CONFIG_TESTING_OPTIONS */
@@ -568,7 +567,7 @@
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211",
-@@ -12514,4 +12675,8 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -13519,4 +13680,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 */
@@ -578,19 +577,19 @@
+ .get_edcca = nl80211_get_edcca,
};
diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
-index 6e40d55..13e5d24 100644
+index 8bfbdd5..55c29cc 100644
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
-@@ -181,6 +181,7 @@ struct wpa_driver_nl80211_data {
- unsigned int qca_do_acs:1;
- unsigned int brcm_do_acs:1;
+@@ -199,6 +199,7 @@ struct wpa_driver_nl80211_data {
unsigned int uses_6ghz:1;
+ unsigned int secure_ranging_ctx_vendor_cmd_avail:1;
+ unsigned int puncturing:1;
+ unsigned int mtk_edcca_vendor_cmd_avail:1;
u64 vendor_scan_cookie;
u64 remain_on_chan_cookie;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index 7ede0d0..732ae29 100644
+index 27ab1d9..efe7ae4 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -18,6 +18,7 @@
@@ -601,7 +600,7 @@
static int protocol_feature_handler(struct nl_msg *msg, void *arg)
-@@ -1050,6 +1051,12 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
+@@ -1099,6 +1100,12 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
break;
}
#endif /* CONFIG_DRIVER_NL80211_BRCM */
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch
index 026b4fd..a79555a 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch
@@ -1,7 +1,7 @@
-From f27bf939f8e2815e2f65790e538fba3bfc46a9c3 Mon Sep 17 00:00:00 2001
+From fd2df638591cc86c21153e94abe8fc00451703b8 Mon Sep 17 00:00:00 2001
From: TomLiu <tomml.liu@mediatek.com>
Date: Tue, 9 Aug 2022 10:23:44 -0700
-Subject: [PATCH 06/29] hostapd: mtk: Add hostapd MU SET/GET control
+Subject: [PATCH 06/28] hostapd: mtk: Add hostapd MU SET/GET control
---
hostapd/config_file.c | 9 +++
@@ -20,13 +20,13 @@
13 files changed, 251 insertions(+)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index b5024cc..62e8b33 100644
+index a48034b..12741f8 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -3661,6 +3661,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -3679,6 +3679,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
return 1;
}
- bss->unsol_bcast_probe_resp_interval = val;
+ conf->mbssid = mbssid;
+ } else if (os_strcmp(buf, "mu_onoff") == 0) {
+ int val = atoi(pos);
+ if (val < 0 || val > 15) {
@@ -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 9c70d54..c72f336 100644
+index c5c0e91..b317a65 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -3441,6 +3441,63 @@ hostapd_ctrl_iface_get_edcca(struct hostapd_data *hapd, char *cmd, char *buf,
+@@ -3516,6 +3516,63 @@ hostapd_ctrl_iface_get_edcca(struct hostapd_data *hapd, char *cmd, char *buf,
}
@@ -107,7 +107,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
int reply_size,
-@@ -3993,6 +4050,11 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4077,6 +4134,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);
@@ -120,10 +120,10 @@
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index db21258..e16a1dc 100644
+index 05ac5ac..285aeba 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1380,6 +1380,20 @@ static int hostapd_cli_cmd_driver_flags(struct wpa_ctrl *ctrl, int argc,
+@@ -1400,6 +1400,20 @@ static int hostapd_cli_cmd_driver_flags(struct wpa_ctrl *ctrl, int argc,
}
@@ -144,7 +144,7 @@
#ifdef CONFIG_DPP
static int hostapd_cli_cmd_dpp_qr_code(struct wpa_ctrl *ctrl, int argc,
-@@ -1705,6 +1719,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1729,6 +1743,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
" = send FTM range request"},
{ "driver_flags", hostapd_cli_cmd_driver_flags, NULL,
" = show supported driver flags"},
@@ -156,7 +156,7 @@
{ "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 344585a..d4fc191 100644
+index 55c35c7..1cad303 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -280,6 +280,7 @@ struct hostapd_config * hostapd_config_defaults(void)
@@ -168,22 +168,22 @@
/* 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 4ac4699..37779b7 100644
+index 22b1276..2077c67 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1115,6 +1115,7 @@ struct hostapd_config {
- u8 he_6ghz_rx_ant_pat;
+@@ -1133,6 +1133,7 @@ struct hostapd_config {
u8 he_6ghz_tx_ant_pat;
u8 he_6ghz_reg_pwr_type;
+ bool require_he;
+ u8 mu_onoff;
#endif /* CONFIG_IEEE80211AX */
/* VHT enable/disable config from CHAN_SWITCH */
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 25e967d..60b9fc0 100644
+index af6944b..d290a00 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1039,3 +1039,17 @@ int hostapd_drv_get_edcca(struct hostapd_data *hapd, const u8 mode, u8 *value)
+@@ -1078,3 +1078,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);
}
@@ -202,10 +202,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 70a99f4..185d5f3 100644
+index b89ad6e..1565bfa 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -142,6 +142,8 @@ int hostapd_drv_configure_edcca_enable(struct hostapd_data *hapd);
+@@ -148,6 +148,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);
@@ -215,10 +215,10 @@
#include "drivers/driver.h"
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index 3bb38fe..71d7bfa 100644
+index cd0a0c9..21aba48 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -2302,6 +2302,8 @@ dfs_offload:
+@@ -2396,6 +2396,8 @@ dfs_offload:
if (hostapd_drv_configure_edcca_threshold(hapd,
hapd->iconf->edcca_threshold) < 0)
goto fail;
@@ -261,13 +261,13 @@
#define ETH_ALEN 6
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 3559974..fa5ad45 100644
+index 73c7bb4..1a3f070 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -1623,6 +1623,11 @@ struct wpa_driver_ap_params {
- * Unsolicited broadcast Probe Response template length
+@@ -1730,6 +1730,11 @@ struct wpa_driver_ap_params {
+ * subchannel is punctured, otherwise active.
*/
- size_t unsol_bcast_probe_resp_tmpl_len;
+ u16 punct_bitmap;
+
+ /**
+ * mu onoff=<val> (bitmap- UL MU-MIMO(bit3), DL MU-MIMO(bit2), UL OFDMA(bit1), DL OFDMA(bit0))
@@ -276,7 +276,7 @@
};
struct wpa_driver_mesh_bss_params {
-@@ -4680,6 +4685,14 @@ struct wpa_driver_ops {
+@@ -5005,6 +5010,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);
@@ -292,10 +292,10 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 6d4a4db..0523aab 100644
+index f5c95e1..fc8422c 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -12304,6 +12304,114 @@ fail:
+@@ -13231,6 +13231,114 @@ fail:
}
@@ -410,7 +410,7 @@
#ifdef CONFIG_DPP
static int nl80211_dpp_listen(void *priv, bool enable)
{
-@@ -12668,6 +12776,8 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -13671,6 +13779,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,
@@ -420,22 +420,22 @@
.dpp_listen = nl80211_dpp_listen,
#endif /* CONFIG_DPP */
diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
-index 13e5d24..1dd984c 100644
+index 55c29cc..f3a45ec 100644
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
-@@ -182,6 +182,7 @@ struct wpa_driver_nl80211_data {
- unsigned int brcm_do_acs:1;
- unsigned int uses_6ghz:1;
+@@ -200,6 +200,7 @@ struct wpa_driver_nl80211_data {
+ unsigned int secure_ranging_ctx_vendor_cmd_avail:1;
+ unsigned int puncturing:1;
unsigned int mtk_edcca_vendor_cmd_avail:1;
+ unsigned int mtk_mu_vendor_cmd_avail:1;
u64 vendor_scan_cookie;
u64 remain_on_chan_cookie;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index 732ae29..cc11891 100644
+index efe7ae4..dcd1bcd 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
-@@ -1056,6 +1056,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
+@@ -1105,6 +1105,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
case MTK_NL80211_VENDOR_SUBCMD_EDCCA_CTRL :
drv->mtk_edcca_vendor_cmd_avail = 1;
break;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
index b8d1836..398e058 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
@@ -1,7 +1,7 @@
-From 94c7af6787585f1d063ce90c33208aa7e4f5730e Mon Sep 17 00:00:00 2001
+From 84d1dfb1adee1da3435b445e557396cc5318787d 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 07/29] hostapd: mtk: Add three wire PTA ctrl hostapd vendor
+Subject: [PATCH 07/28] hostapd: mtk: 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 62e8b33..6e526eb 100644
+index 12741f8..860beee 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -4796,6 +4796,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -4840,6 +4840,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
return 1;
}
conf->edcca_compensation = (s8) val;
@@ -35,7 +35,7 @@
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 d4fc191..1a1a059 100644
+index 1cad303..2c447ba 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -297,6 +297,7 @@ struct hostapd_config * hostapd_config_defaults(void)
@@ -47,10 +47,10 @@
return conf;
}
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 37779b7..f1be7ae 100644
+index 2077c67..e784629 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1158,6 +1158,19 @@ struct hostapd_config {
+@@ -1185,6 +1185,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 60b9fc0..973b44e 100644
+index d290a00..ff2c6f8 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1053,3 +1053,14 @@ int hostapd_drv_mu_dump(struct hostapd_data *hapd, u8 *mu_onoff)
+@@ -1092,3 +1092,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 185d5f3..51d7b3b 100644
+index 1565bfa..e760658 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -144,6 +144,7 @@ int hostapd_drv_configure_edcca_threshold(struct hostapd_data *hapd,
+@@ -150,6 +150,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 71d7bfa..77e7eb4 100644
+index 21aba48..2bf9fb2 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -2304,6 +2304,8 @@ dfs_offload:
+@@ -2398,6 +2398,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 fa5ad45..6c4c70c 100644
+index 1a3f070..2ced065 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -4693,6 +4693,14 @@ struct wpa_driver_ops {
+@@ -5018,6 +5018,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 0523aab..568c704 100644
+index fc8422c..34bc9ac 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -12637,6 +12637,38 @@ static int nl80211_get_edcca(void *priv, const u8 mode, u8 *value)
+@@ -13635,6 +13635,38 @@ static int nl80211_get_edcca(void *priv, const u8 mode, u8 *value)
return ret;
}
@@ -210,18 +210,18 @@
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211",
-@@ -12789,4 +12821,5 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -13794,4 +13826,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,
+ .three_wire_ctrl = nl80211_enable_three_wire,
};
diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
-index 1dd984c..35fd4d2 100644
+index f3a45ec..92da450 100644
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
-@@ -183,6 +183,7 @@ struct wpa_driver_nl80211_data {
- unsigned int uses_6ghz:1;
+@@ -201,6 +201,7 @@ struct wpa_driver_nl80211_data {
+ unsigned int puncturing:1;
unsigned int mtk_edcca_vendor_cmd_avail:1;
unsigned int mtk_mu_vendor_cmd_avail:1;
+ unsigned int mtk_3wire_vendor_cmd_avail:1;
@@ -229,10 +229,10 @@
u64 vendor_scan_cookie;
u64 remain_on_chan_cookie;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index cc11891..dc2d7b1 100644
+index dcd1bcd..3b25754 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
-@@ -1059,6 +1059,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
+@@ -1108,6 +1108,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
case MTK_NL80211_VENDOR_SUBCMD_MU_CTRL :
drv->mtk_mu_vendor_cmd_avail = 1;
break;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch
index acefdee..acb40a7 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch
@@ -1,7 +1,7 @@
-From a75dc659e600dc2d6f7eda2dc9886747b6c55254 Mon Sep 17 00:00:00 2001
+From 7011a7a5503e76228d475060a72b3a168fac1b54 Mon Sep 17 00:00:00 2001
From: mtk27835 <shurong.wen@mediatek.com>
Date: Wed, 7 Sep 2022 14:41:51 -0700
-Subject: [PATCH 08/29] hostapd: mtk: Add hostapd iBF control
+Subject: [PATCH 08/28] hostapd: mtk: 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 6e526eb..579193f 100644
+index 860beee..e1dd540 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -4800,6 +4800,9 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -4844,6 +4844,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 c72f336..5590100 100644
+index b317a65..45797cd 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -3498,6 +3498,30 @@ hostapd_ctrl_iface_get_mu(struct hostapd_data *hapd, char *buf,
+@@ -3573,6 +3573,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,
-@@ -4055,6 +4079,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4139,6 +4163,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 e16a1dc..1f7013e 100644
+index 285aeba..5922fe3 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1586,6 +1586,13 @@ static int hostapd_cli_cmd_driver(struct wpa_ctrl *ctrl, int argc, char *argv[])
+@@ -1606,6 +1606,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[]);
-@@ -1787,6 +1794,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1811,6 +1818,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,7 +106,7 @@
};
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
-index 1a1a059..df90814 100644
+index 2c447ba..a9f77e0 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -298,6 +298,7 @@ struct hostapd_config * hostapd_config_defaults(void)
@@ -118,10 +118,10 @@
return conf;
}
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index f1be7ae..be30b51 100644
+index e784629..c88c8ae 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1159,6 +1159,7 @@ struct hostapd_config {
+@@ -1186,6 +1186,7 @@ struct hostapd_config {
s8 edcca_compensation;
int *edcca_threshold;
u8 three_wire_enable;
@@ -129,19 +129,19 @@
};
enum three_wire_mode {
-@@ -1199,6 +1200,7 @@ enum mtk_vendor_attr_edcca_ctrl_mode {
- #define EDCCA_MIN_CONFIG_THRES -126
- #define EDCCA_MAX_CONFIG_THRES 0
+@@ -1310,6 +1311,7 @@ hostapd_set_oper_centr_freq_seg1_idx(struct hostapd_config *conf,
+ conf->vht_oper_centr_freq_seg1_idx = oper_centr_freq_seg1_idx;
+ }
+#define IBF_DEFAULT_ENABLE 0
- static inline enum oper_chan_width
- hostapd_get_oper_chwidth(struct hostapd_config *conf)
+ 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 973b44e..bec9798 100644
+index ff2c6f8..91ade16 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1064,3 +1064,17 @@ int hostapd_drv_three_wire_ctrl(struct hostapd_data *hapd)
+@@ -1103,3 +1103,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 51d7b3b..30b0322 100644
+index e760658..2cc39b7 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -145,6 +145,8 @@ int hostapd_drv_get_edcca(struct hostapd_data *hapd, const u8 mode, u8 *value);
+@@ -151,6 +151,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 77e7eb4..e83298e 100644
+index 2bf9fb2..2deb9a3 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -2306,6 +2306,8 @@ dfs_offload:
+@@ -2400,6 +2400,8 @@ dfs_offload:
goto fail;
if (hostapd_drv_three_wire_ctrl(hapd) < 0)
goto fail;
@@ -240,10 +240,10 @@
#define CSI_MAX_COUNT 256
#define ETH_ALEN 6
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 6c4c70c..913a194 100644
+index 2ced065..9e12e42 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -1628,6 +1628,11 @@ struct wpa_driver_ap_params {
+@@ -1735,6 +1735,11 @@ struct wpa_driver_ap_params {
* mu onoff=<val> (bitmap- UL MU-MIMO(bit3), DL MU-MIMO(bit2), UL OFDMA(bit1), DL OFDMA(bit0))
*/
u8 mu_onoff;
@@ -255,7 +255,7 @@
};
struct wpa_driver_mesh_bss_params {
-@@ -4701,6 +4706,20 @@ struct wpa_driver_ops {
+@@ -5026,6 +5031,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 568c704..ff257eb 100644
+index 34bc9ac..641b894 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -12670,6 +12670,112 @@ static int nl80211_enable_three_wire(void *priv, const u8 three_wire_enable)
+@@ -13668,6 +13668,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",
-@@ -12822,4 +12928,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -13827,4 +13933,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,
@@ -401,10 +401,10 @@
+ .ibf_dump = nl80211_ibf_dump,
};
diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
-index 35fd4d2..92e5ad6 100644
+index 92da450..9ef313b 100644
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
-@@ -184,6 +184,7 @@ struct wpa_driver_nl80211_data {
+@@ -202,6 +202,7 @@ struct wpa_driver_nl80211_data {
unsigned int mtk_edcca_vendor_cmd_avail:1;
unsigned int mtk_mu_vendor_cmd_avail:1;
unsigned int mtk_3wire_vendor_cmd_avail:1;
@@ -413,10 +413,10 @@
u64 vendor_scan_cookie;
u64 remain_on_chan_cookie;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index dc2d7b1..83b4c5e 100644
+index 3b25754..5c6bb36 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
-@@ -1062,6 +1062,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
+@@ -1111,6 +1111,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
case MTK_NL80211_VENDOR_SUBCMD_3WIRE_CTRL :
drv->mtk_3wire_vendor_cmd_avail = 1;
break;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch
index d96423d..8c4b67f 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch
@@ -1,7 +1,7 @@
-From 0c960d33f909f8c119d533cc57b1585d77e319e1 Mon Sep 17 00:00:00 2001
+From fd9094f2ca304f391f9ea5569a60e563703fa907 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 09/29] hostapd: mtk: Do not include HE capab IE if associated
+Subject: [PATCH 09/28] hostapd: mtk: Do not include HE capab IE if associated
sta's HE capab IE is invalid
---
@@ -9,10 +9,10 @@
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index d921783..098793e 100644
+index 5b40b13..b5dfad9 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
-@@ -5192,7 +5192,8 @@ static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
+@@ -4399,7 +4399,8 @@ static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
#endif /* CONFIG_IEEE80211AC */
#ifdef CONFIG_IEEE80211AX
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch
index ffe0426..41cdcf6 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch
@@ -1,7 +1,7 @@
-From f57c471059e4e9909b7fc6cbd351343cd2628e2c Mon Sep 17 00:00:00 2001
+From 246c1629481117413fd4648cdfc25f6fb24a5502 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 10/29] hostapd: mtk: Add DFS detection mode
+Subject: [PATCH 10/28] hostapd: mtk: 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 579193f..8a61726 100644
+index e1dd540..09b5605 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -4803,6 +4803,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -4847,6 +4847,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 5590100..fcbc4ae 100644
+index 45797cd..5ea8934 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -3522,6 +3522,26 @@ hostapd_ctrl_iface_get_ibf(struct hostapd_data *hapd, char *buf,
+@@ -3597,6 +3597,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,
-@@ -4081,6 +4101,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4165,6 +4185,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 be30b51..d3a9fb0 100644
+index c88c8ae..d651bfb 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1160,6 +1160,7 @@ struct hostapd_config {
+@@ -1187,6 +1187,7 @@ struct hostapd_config {
int *edcca_threshold;
u8 three_wire_enable;
u8 ibf_enable;
@@ -84,7 +84,7 @@
};
enum three_wire_mode {
-@@ -1174,6 +1175,18 @@ enum three_wire_mode {
+@@ -1201,6 +1202,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 b5d105d..5cb7799 100644
+index a19afb0..644a7ea 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -1317,6 +1317,11 @@ hostapd_dfs_background_start_channel_switch(struct hostapd_iface *iface,
+@@ -1322,6 +1322,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;
-@@ -1365,6 +1370,11 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
+@@ -1370,6 +1375,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");
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch
index 187f804..03f32ec 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch
@@ -1,7 +1,7 @@
-From 43e5bfa91c67528eb2a37071e0e4a6f32807ad8f Mon Sep 17 00:00:00 2001
+From b0a253a420b901e3f5b7b069a85a135835a702ff 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 11/29] hostapd: mtk: Add DFS offchan channel switch
+Subject: [PATCH 11/28] hostapd: mtk: 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 fcbc4ae..37a1b2a 100644
+index 5ea8934..40fb0d4 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -3542,6 +3542,76 @@ hostapd_ctrl_iface_set_dfs_detect_mode(struct hostapd_data *hapd, char *value,
+@@ -3617,6 +3617,76 @@ hostapd_ctrl_iface_set_dfs_detect_mode(struct hostapd_data *hapd, char *value,
}
@@ -96,7 +96,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
int reply_size,
-@@ -4104,6 +4174,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4188,6 +4258,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,7 +106,7 @@
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
-index 5cb7799..1c3f678 100644
+index 644a7ea..48c5fc9 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -19,13 +19,6 @@
@@ -136,7 +136,7 @@
{
struct hostapd_hw_modes *mode;
struct hostapd_channel_data *chan;
-@@ -299,12 +292,12 @@ static int dfs_find_channel(struct hostapd_iface *iface,
+@@ -300,12 +293,12 @@ static int dfs_find_channel(struct hostapd_iface *iface,
}
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
index 53936b2..230cbaa 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
@@ -1,7 +1,7 @@
-From 8dee72b3608710a9cb6e9694c3d6535be000e104 Mon Sep 17 00:00:00 2001
+From e906e5508fc01ce8c518431728218d04670a1ca3 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 12/29] hostapd: mtk: Add amsdu set get ctrl
+Subject: [PATCH 12/28] hostapd: mtk: 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 8a61726..017c21e 100644
+index 09b5605..dc3defe 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -4807,6 +4807,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -4851,6 +4851,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 37a1b2a..61c9e80 100644
+index 40fb0d4..07de0ad 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -3612,6 +3612,30 @@ hostapd_ctrl_iface_set_offchan_ctrl(struct hostapd_data *hapd, char *cmd,
+@@ -3687,6 +3687,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,
-@@ -4176,6 +4200,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4260,6 +4284,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 1f7013e..0da18e2 100644
+index 5922fe3..04451f5 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1593,6 +1593,13 @@ static int hostapd_cli_cmd_get_ibf(struct wpa_ctrl *ctrl, int argc,
+@@ -1613,6 +1613,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[]);
-@@ -1796,6 +1803,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1820,6 +1827,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,7 +111,7 @@
};
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
-index df90814..24fc0f5 100644
+index a9f77e0..f437f9f 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -299,6 +299,7 @@ struct hostapd_config * hostapd_config_defaults(void)
@@ -123,10 +123,10 @@
return conf;
}
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index d3a9fb0..ce0d84c 100644
+index d651bfb..7732af0 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1161,6 +1161,7 @@ struct hostapd_config {
+@@ -1188,6 +1188,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 bec9798..342a7a8 100644
+index 91ade16..00492b8 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1077,4 +1077,18 @@ int hostapd_drv_ibf_dump(struct hostapd_data *hapd, u8 *ibf_enable)
+@@ -1116,4 +1116,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 30b0322..79fef71 100644
+index 2cc39b7..2b8b587 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -147,6 +147,8 @@ int hostapd_drv_mu_dump(struct hostapd_data *hapd, u8 *mu_onoff);
+@@ -153,6 +153,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 e83298e..42e8ed7 100644
+index 2deb9a3..88eb984 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -2308,6 +2308,8 @@ dfs_offload:
+@@ -2402,6 +2402,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 913a194..3e034d7 100644
+index 9e12e42..2144cc4 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -4720,6 +4720,15 @@ struct wpa_driver_ops {
+@@ -5045,6 +5045,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 ff257eb..6c65901 100644
+index 641b894..7c20b14 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -12776,6 +12776,118 @@ fail:
+@@ -13774,6 +13774,118 @@ fail:
return -ENOBUFS;
}
@@ -362,7 +362,7 @@
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211",
.desc = "Linux nl80211/cfg80211",
-@@ -12930,4 +13042,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -13935,4 +14047,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,
@@ -370,10 +370,10 @@
+ .amsdu_dump = nl80211_dump_amsdu,
};
diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
-index 92e5ad6..21d48cc 100644
+index 9ef313b..3bcc770 100644
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
-@@ -185,6 +185,7 @@ struct wpa_driver_nl80211_data {
+@@ -203,6 +203,7 @@ struct wpa_driver_nl80211_data {
unsigned int mtk_mu_vendor_cmd_avail:1;
unsigned int mtk_3wire_vendor_cmd_avail:1;
unsigned int mtk_ibf_vendor_cmd_avail:1;
@@ -382,10 +382,10 @@
u64 vendor_scan_cookie;
u64 remain_on_chan_cookie;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index 83b4c5e..06a52db 100644
+index 5c6bb36..dee99f0 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
-@@ -1065,6 +1065,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
+@@ -1114,6 +1114,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
case MTK_NL80211_VENDOR_SUBCMD_IBF_CTRL:
drv->mtk_ibf_vendor_cmd_avail = 1;
break;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch
index 094e102..0f096d4 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch
@@ -1,7 +1,7 @@
-From 858e23d3ff04d156a6391168d2554796962b294c Mon Sep 17 00:00:00 2001
+From cacedd3d26510c3eaf923d19ac16813162ff7727 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 13/29] hostapd: mtk: Add he_ldpc configuration
+Subject: [PATCH 13/28] hostapd: mtk: 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 017c21e..649618b 100644
+index dc3defe..ac8359a 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -3508,6 +3508,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+@@ -3517,6 +3517,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 ea67aa1..e3a5eb3 100644
+index bc4a0f6..d95a11e 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
-@@ -830,6 +830,11 @@ wmm_ac_vo_acm=0
+@@ -833,6 +833,11 @@ wmm_ac_vo_acm=0
# 1 = supported
#he_mu_beamformer=1
@@ -42,7 +42,7 @@
#he_bss_color=1
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
-index 24fc0f5..4e46a62 100644
+index f437f9f..26d6770 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -268,6 +268,7 @@ struct hostapd_config * hostapd_config_defaults(void)
@@ -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 ce0d84c..7aeb176 100644
+index 7732af0..b9aaa85 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -929,6 +929,7 @@ struct hostapd_bss_config {
+@@ -945,6 +945,7 @@ struct hostapd_bss_config {
* struct he_phy_capabilities_info - HE PHY capabilities
*/
struct he_phy_capabilities_info {
@@ -66,7 +66,7 @@
bool he_su_beamformee;
bool he_mu_beamformer;
diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c
-index b5b7e5d..f27aeb1 100644
+index 548a448..9407dd6 100644
--- a/src/ap/ieee802_11_he.c
+++ b/src/ap/ieee802_11_he.c
@@ -138,6 +138,13 @@ u8 * hostapd_eid_he_capab(struct hostapd_data *hapd, u8 *eid,
@@ -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 65e125e..62088bd 100644
+index dfad0b7..bc8fe05 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
-@@ -2298,6 +2298,9 @@ struct ieee80211_spatial_reuse {
+@@ -2355,6 +2355,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))
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch
deleted file mode 100644
index abca258..0000000
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From d45d0c40a81b1196b0dc4cc8da08fe736f04022f Mon Sep 17 00:00:00 2001
-From: MeiChia Chiu <meichia.chiu@mediatek.com>
-Date: Tue, 17 Jan 2023 13:25:18 +0800
-Subject: [PATCH 14/29] hostapd: mtk: Add the broadcast destination address of
- Probe Response frame on 6 GHz
-
-According to IEEE 802.11ax 26.17.2.3.2,
-if a 6 GHz AP receives a Probe Request frame and responds with a Probe Response frame,
-the Address 1 field of the Probe Response frame shall be set to the broadcast address,
-unless the AP is not indicating its actual SSID in the SSID element of its Beacon frames.
-
-Without this, hostapd fill the Address 1 feild of the Probe Response frame
-with the source address from Probe Request frame on 6 GHz.
-Fix this to use broadcast address instead.
-
-Signed-off-by: MeiChia Chiu <meichia.chiu@mediatek.com>
----
- src/ap/beacon.c | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/src/ap/beacon.c b/src/ap/beacon.c
-index 1a26f11..f3ea5c2 100644
---- a/src/ap/beacon.c
-+++ b/src/ap/beacon.c
-@@ -1156,8 +1156,13 @@ void handle_probe_req(struct hostapd_data *hapd,
- wpa_msg_ctrl(hapd->msg_ctx, MSG_INFO, RX_PROBE_REQUEST "sa=" MACSTR
- " signal=%d", MAC2STR(mgmt->sa), ssi_signal);
-
-- resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL,
-- &resp_len, false);
-+ if (is_6ghz_op_class(hapd->iconf->op_class) &&
-+ is_broadcast_ether_addr(mgmt->da))
-+ resp = hostapd_gen_probe_resp(hapd, NULL, elems.p2p != NULL,
-+ &resp_len, true);
-+ else
-+ resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL,
-+ &resp_len, false);
- if (resp == NULL)
- return;
-
---
-2.18.0
-
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0014-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
similarity index 84%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0014-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
index a74780c..6b22222 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0014-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
@@ -1,7 +1,7 @@
-From a0cc42414bd6abd0342f2fd06c09650c366c959c Mon Sep 17 00:00:00 2001
+From 6bf2c734595e9faa8ba39bdda119e292fb747107 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 15/29] hostapd: mtk: Add vendor command attribute for RTS BW
+Subject: [PATCH 14/28] hostapd: mtk: Add vendor command attribute for RTS BW
signaling.
Signed-off-by: himanshu.goyal <himanshu.goyal@mediatek.com>
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0015-hostapd-mtk-6G-band-does-not-require-DFS.patch
similarity index 69%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0015-hostapd-mtk-6G-band-does-not-require-DFS.patch
index 30cc7eb..f17fe17 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0015-hostapd-mtk-6G-band-does-not-require-DFS.patch
@@ -1,17 +1,17 @@
-From 08a909a1a06a2231fda12b34aad68c6361c45e6b Mon Sep 17 00:00:00 2001
+From 0d48d01ab386b4999a7914009d3b0878823535e7 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 16/29] hostapd: mtk: 6G band does not require DFS
+Subject: [PATCH 15/28] hostapd: mtk: 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 1c3f678..4b1e642 100644
+index 48c5fc9..dcf89ce 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -1506,6 +1506,7 @@ int hostapd_is_dfs_required(struct hostapd_iface *iface)
+@@ -1511,6 +1511,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 ||
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0016-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
similarity index 83%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0016-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
index 81e22a2..08b8327 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0016-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
@@ -1,7 +1,7 @@
-From 4c7054d6a1d7e373d93b6abf309c41c0151e523f Mon Sep 17 00:00:00 2001
+From ded7bc8b684fa76874abc1ba47f59ecdf7126bdb 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 17/29] hostapd: mtk: Fix sending wrong VHT operation IE in CSA
+Subject: [PATCH 16/28] hostapd: mtk: 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 4b1e642..307a4e1 100644
+index dcf89ce..e5ed645 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -1110,6 +1110,14 @@ static int
+@@ -1115,6 +1115,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;
-@@ -1122,11 +1130,7 @@ hostapd_dfs_start_channel_switch_background(struct hostapd_iface *iface)
+@@ -1127,11 +1135,7 @@ hostapd_dfs_start_channel_switch_background(struct hostapd_iface *iface)
hostpad_dfs_update_background_chain(iface);
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0017-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
similarity index 88%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0017-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
index 059ded9..5259512 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0017-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
@@ -1,7 +1,7 @@
-From d851c49cd0afb0e86676670f8b49170bb0386cba Mon Sep 17 00:00:00 2001
+From dda8da5352e042ff4fb1621c58624981ee00dce7 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 18/29] hostapd: mtk: Add sta-assisted DFS state update
+Subject: [PATCH 17/28] hostapd: mtk: 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 307a4e1..d082fe0 100644
+index e5ed645..d52a60e 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -1503,6 +1503,26 @@ int hostapd_dfs_nop_finished(struct hostapd_iface *iface, int freq,
+@@ -1508,6 +1508,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 09783cb..275f6b3 100644
+index ede88b2..c1f9a0e 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
-@@ -1790,6 +1790,24 @@ static void hostapd_event_dfs_cac_started(struct hostapd_data *hapd,
+@@ -1805,6 +1805,24 @@ static void hostapd_event_dfs_cac_started(struct hostapd_data *hapd,
radar->cf1, radar->cf2);
}
@@ -89,7 +89,7 @@
#endif /* NEED_AP_MLME */
-@@ -2064,6 +2082,16 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
+@@ -2080,6 +2098,16 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
break;
hostapd_event_dfs_nop_finished(hapd, &data->dfs_event);
break;
@@ -107,10 +107,10 @@
/* 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 3435084..79c8a82 100644
+index 4ab2a1b..866ae0b 100644
--- a/src/common/wpa_ctrl.h
+++ b/src/common/wpa_ctrl.h
-@@ -360,6 +360,7 @@ extern "C" {
+@@ -369,6 +369,7 @@ extern "C" {
#define DFS_EVENT_CAC_COMPLETED "DFS-CAC-COMPLETED "
#define DFS_EVENT_NOP_FINISHED "DFS-NOP-FINISHED "
#define DFS_EVENT_PRE_CAC_EXPIRED "DFS-PRE-CAC-EXPIRED "
@@ -119,13 +119,13 @@
#define AP_CSA_FINISHED "AP-CSA-FINISHED "
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 3e034d7..82daef0 100644
+index 2144cc4..faa4b7b 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -5317,6 +5317,20 @@ enum wpa_event_type {
- * EVENT_CCA_NOTIFY - Notification that CCA has completed
+@@ -5666,6 +5666,20 @@ enum wpa_event_type {
+ * Described in wpa_event_data.ch_switch.
*/
- EVENT_CCA_NOTIFY,
+ EVENT_LINK_CH_SWITCH_STARTED,
+
+ /**
+ * EVENT_DFS_STA_CAC_SKIPPED - Notification that CAC has been skipped
@@ -144,10 +144,10 @@
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
-index 73bb7a4..ee922ac 100644
+index a45804c..67d9ce2 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
-@@ -1854,6 +1854,12 @@ static void nl80211_radar_event(struct wpa_driver_nl80211_data *drv,
+@@ -2217,6 +2217,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 c4bf3ad..0937752 100644
+index 12fc6a9..6493023 100644
--- a/src/drivers/nl80211_copy.h
+++ b/src/drivers/nl80211_copy.h
-@@ -6431,6 +6431,10 @@ enum nl80211_smps_mode {
+@@ -6621,6 +6621,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,
-@@ -6439,6 +6443,8 @@ enum nl80211_radar_event {
+@@ -6629,6 +6633,8 @@ enum nl80211_radar_event {
NL80211_RADAR_NOP_FINISHED,
NL80211_RADAR_PRE_CAC_EXPIRED,
NL80211_RADAR_CAC_STARTED,
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0018-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
similarity index 71%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0018-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
index f89da87..c53b55a 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0018-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
@@ -1,19 +1,19 @@
-From 0aa1200534c41279f5f05e1919040a86f003ca0a Mon Sep 17 00:00:00 2001
+From 3237a993233da052219018eec10ca82d79225fdb Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Mon, 20 Feb 2023 16:58:20 +0800
-Subject: [PATCH 19/29] hostapd: mtk: Fix auto ht issue when switching to DFS
+Subject: [PATCH 18/28] hostapd: mtk: Fix auto ht issue when switching to DFS
channel
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
- hostapd/ctrl_iface.c | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
+ hostapd/ctrl_iface.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 61c9e80..06cbea1 100644
+index 07de0ad..be86f6c 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -2698,6 +2698,13 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+@@ -2773,6 +2773,12 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
break;
}
@@ -21,13 +21,12 @@
+ settings.freq_params.ht_enabled = iface->conf->ieee80211n;
+ settings.freq_params.vht_enabled = iface->conf->ieee80211ac;
+ settings.freq_params.he_enabled = iface->conf->ieee80211ax;
-+ settings.freq_params.eht_enabled = iface->conf->ieee80211be;
+ }
+
if (settings.freq_params.center_freq1)
dfs_range += hostapd_is_dfs_overlap(
iface, bandwidth, settings.freq_params.center_freq1);
-@@ -2735,12 +2742,6 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+@@ -2810,12 +2816,6 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
return 0;
}
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0019-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
similarity index 77%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0019-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
index 5b14a77..d38e758 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0019-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
@@ -1,7 +1,7 @@
-From c229d874452a61f58b65473d26b89c64b4693908 Mon Sep 17 00:00:00 2001
+From 5832d4ddc23f535932b590f5e8d16c349b4c4a51 Mon Sep 17 00:00:00 2001
From: "himanshu.goyal" <himanshu.goyal@mediatek.com>
-Date: Sat, 29 Apr 2023 06:57:36 +0800
-Subject: [PATCH 20/29] hostapd: mtk: Mark DFS channel as available for CSA.
+Date: Fri, 3 Mar 2023 12:45:42 +0800
+Subject: [PATCH 19/28] hostapd: mtk: Mark DFS channel as available for CSA.
---
hostapd/ctrl_iface.c | 10 ++++++++++
@@ -10,11 +10,11 @@
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 06cbea1..7b59bb5 100644
+index be86f6c..d09c22f 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -2705,6 +2705,16 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
- settings.freq_params.eht_enabled = iface->conf->ieee80211be;
+@@ -2779,6 +2779,16 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+ settings.freq_params.he_enabled = iface->conf->ieee80211ax;
}
+ if (settings.freq_params.radar_background) {
@@ -31,10 +31,10 @@
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 0da18e2..6231e51 100644
+index 04451f5..36d19d8 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1693,7 +1693,7 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1715,7 +1715,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"
@@ -44,17 +44,17 @@
{ "hs20_wnm_notif", hostapd_cli_cmd_hs20_wnm_notif, NULL,
"<addr> <url>\n"
diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
-index 18bae5c..2fae590 100644
+index 38fc8e4..fed5473 100644
--- a/src/ap/ctrl_iface_ap.c
+++ b/src/ap/ctrl_iface_ap.c
-@@ -938,6 +938,7 @@ int hostapd_parse_csa_settings(const char *pos,
+@@ -999,6 +999,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");
+ 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
--
2.18.0
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0020-hostapd-mtk-Add-available-color-bitmap.patch
similarity index 63%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0020-hostapd-mtk-Add-available-color-bitmap.patch
index 544ab11..ffdab20 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0020-hostapd-mtk-Add-available-color-bitmap.patch
@@ -1,26 +1,26 @@
-From 93880afd007b74cb7b56f9711bb0ab07b9858ac1 Mon Sep 17 00:00:00 2001
+From e3a3b2a33385a97229956f83574b1ae60f39d2cc 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 22/29] hostapd: mtk: Add available color bitmap
+Subject: [PATCH 20/28] hostapd: mtk: Add available color bitmap
Signed-off-by: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
---
- hostapd/ctrl_iface.c | 74 +++++++++++++++++++++++++++++++
- hostapd/hostapd_cli.c | 18 ++++++++
- src/ap/ap_drv_ops.c | 10 ++++-
- src/ap/ap_drv_ops.h | 2 +
- src/common/mtk_vendor.h | 11 +++++
- src/drivers/driver.h | 8 ++++
- src/drivers/driver_nl80211.c | 66 +++++++++++++++++++++++++++
- src/drivers/driver_nl80211.h | 1 +
- src/drivers/driver_nl80211_capa.c | 3 ++
- 9 files changed, 192 insertions(+), 1 deletion(-)
+ hostapd/ctrl_iface.c | 74 +++++++++++
+ hostapd/hostapd_cli.c | 18 +++
+ src/ap/ap_drv_ops.c | 10 +-
+ src/ap/ap_drv_ops.h | 2 +
+ src/common/mtk_vendor.h | 11 ++
+ src/drivers/driver.h | 8 ++
+ src/drivers/driver_nl80211.c | 199 +++++++++++++++++++++++++++++-
+ src/drivers/driver_nl80211.h | 1 +
+ src/drivers/driver_nl80211_capa.c | 3 +
+ 9 files changed, 324 insertions(+), 2 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 7b59bb5..78179aa 100644
+index d09c22f..bc7a97b 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -3646,6 +3646,76 @@ hostapd_ctrl_iface_get_amsdu(struct hostapd_data *hapd, char *buf,
+@@ -3720,6 +3720,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,
-@@ -4213,6 +4283,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4296,6 +4366,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 6231e51..aad7aa5 100644
+index 36d19d8..dc01ad9 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1578,6 +1578,20 @@ static int hostapd_cli_cmd_reload_wpa_psk(struct wpa_ctrl *ctrl, int argc,
+@@ -1598,6 +1598,20 @@ static int hostapd_cli_cmd_reload_wpa_psk(struct wpa_ctrl *ctrl, int argc,
}
@@ -133,7 +133,7 @@
#ifdef ANDROID
static int hostapd_cli_cmd_driver(struct wpa_ctrl *ctrl, int argc, char *argv[])
{
-@@ -1795,6 +1809,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1819,6 +1833,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
"<addr> [req_mode=] <measurement request hexdump> = send a Beacon report request to a station" },
{ "reload_wpa_psk", hostapd_cli_cmd_reload_wpa_psk, NULL,
"= reload wpa_psk_file only" },
@@ -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 342a7a8..40b9a20 100644
+index 00492b8..7b686e5 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1091,4 +1091,12 @@ int hostapd_drv_amsdu_dump(struct hostapd_data *hapd, u8 *amsdu)
+@@ -1130,4 +1130,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 79fef71..136a3ac 100644
+index 2b8b587..47356ab 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -149,6 +149,8 @@ int hostapd_drv_ibf_ctrl(struct hostapd_data *hapd);
+@@ -155,6 +155,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);
@@ -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 36f465c..7f6392f 100644
+index faa4b7b..f9f9fb5 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -4771,6 +4771,14 @@ struct wpa_driver_ops {
+@@ -5054,6 +5054,14 @@ struct wpa_driver_ops {
*/
int (*amsdu_ctrl)(void *priv, u8 amsdu);
int (*amsdu_dump)(void *priv, u8 *amsdu);
@@ -225,12 +225,20 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 3753409..f9a8763 100644
+index 7c20b14..18a5647 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -12485,6 +12485,71 @@ static int nl80211_dpp_listen(void *priv, bool enable)
+@@ -12498,7 +12498,6 @@ static void nl80211_parse_btm_candidate_info(struct candidate_list *candidate,
+ num, MAC2STR(candidate->bssid), buf);
}
- #endif /* CONFIG_DPP */
+
+-
+ static int
+ nl80211_get_bss_transition_status_handler(struct nl_msg *msg, void *arg)
+ {
+@@ -13886,6 +13885,203 @@ fail:
+ return -ENOBUFS;
+ }
+static int nl80211_get_aval_color_bmp_handler(struct nl_msg *msg, void *arg)
+{
@@ -297,20 +305,152 @@
+ }
+ return ret;
+}
-
- #ifdef CONFIG_TESTING_OPTIONS
-
-@@ -13096,4 +13161,5 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
++
++static int nl80211_ap_wireless(void *priv, u8 sub_vendor_id, int value)
++{
++ 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_wireless_vendor_cmd_avail) {
++ wpa_printf(MSG_INFO,
++ "nl80211: Driver does not support setting ap wireless 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_WIRELESS_CTRL))
++ goto fail;
++
++ data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
++ if (!data)
++ goto fail;
++
++ if (sub_vendor_id == MTK_VENDOR_ATTR_WIRELESS_CTRL_BA_BUFFER_SIZE)
++ nla_put_u16(msg, sub_vendor_id, (u16) value);
++ else
++ nla_put_u8(msg, sub_vendor_id, (u8) value);
++
++ nla_nest_end(msg, data);
++ ret = send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
++ if (ret)
++ wpa_printf(MSG_ERROR, "Failed to set ap_wireless. ret=%d (%s)", ret, strerror(-ret));
++
++ return ret;
++
++fail:
++ nlmsg_free(msg);
++ return -ENOBUFS;
++}
++
++static int nl80211_ap_rfeatures(void *priv, u8 sub_vendor_id, int value)
++{
++ 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_rfeatures_vendor_cmd_avail) {
++ wpa_printf(MSG_INFO,
++ "nl80211: Driver does not support setting ap rfeatures 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_RFEATURE_CTRL))
++ goto fail;
++
++ data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
++ if (!data)
++ goto fail;
++
++ nla_put_u8(msg, sub_vendor_id, (u8) value);
++
++ nla_nest_end(msg, data);
++
++ ret = send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
++ if (ret)
++ wpa_printf(MSG_ERROR, "Failed to set rf_features. ret=%d (%s)", ret, strerror(-ret));
++
++ return ret;
++
++fail:
++ nlmsg_free(msg);
++ return -ENOBUFS;
++}
++
++static int nl80211_ap_trigtype(void *priv, u8 enable, u8 type)
++{
++ struct i802_bss *bss = priv;
++ struct wpa_driver_nl80211_data *drv = bss->drv;
++ struct nl_msg *msg;
++ struct nlattr *data, *data2;
++ int ret;
++
++ if (!drv->mtk_rfeatures_vendor_cmd_avail) {
++ wpa_printf(MSG_INFO,
++ "nl80211: Driver does not support setting ap rfeatures 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_RFEATURE_CTRL))
++ goto fail;
++
++ data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
++ if (!data)
++ goto fail;
++
++ data2 = nla_nest_start(msg, MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE_CFG);
++ if (!data2)
++ goto fail;
++
++ nla_put_u8(msg, MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE_EN, enable);
++ nla_put_u8(msg, MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE, type);
++
++ nla_nest_end(msg, data2);
++ nla_nest_end(msg, data);
++
++ ret = send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
++ if (ret)
++ wpa_printf(MSG_ERROR, "Failed to set trig_type. 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",
+@@ -14049,4 +14245,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,
+ .get_aval_color_bmp = nl80211_get_aval_color_bmp,
};
diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
-index 21d48cc..72c7abd 100644
+index 3bcc770..190e7a5 100644
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
-@@ -186,6 +186,7 @@ struct wpa_driver_nl80211_data {
+@@ -204,6 +204,7 @@ struct wpa_driver_nl80211_data {
unsigned int mtk_3wire_vendor_cmd_avail:1;
unsigned int mtk_ibf_vendor_cmd_avail:1;
unsigned int mtk_wireless_vendor_cmd_avail:1;
@@ -319,10 +459,10 @@
u64 vendor_scan_cookie;
u64 remain_on_chan_cookie;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index d8078bc..e7c6f39 100644
+index dee99f0..a266926 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
-@@ -1092,6 +1092,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
+@@ -1117,6 +1117,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
case MTK_NL80211_VENDOR_SUBCMD_WIRELESS_CTRL:
drv->mtk_wireless_vendor_cmd_avail = 1;
break;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0021-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
similarity index 91%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0021-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
index 5df63b2..bf3a442 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0021-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
@@ -1,7 +1,7 @@
-From a2d6ad8b3330feca1ea3f7fc8539a964145371a9 Mon Sep 17 00:00:00 2001
+From 8374019111ad6232db54e19e36f0fc1357612712 Mon Sep 17 00:00:00 2001
From: Michael Lee <michael-cy.lee@mediatek.com>
Date: Wed, 22 Mar 2023 13:59:29 +0800
-Subject: [PATCH 23/29] hostapd: mtk: Add channel information for hostapd
+Subject: [PATCH 21/28] hostapd: mtk: Add channel information for hostapd
reload
Add center channel, operating class, and bandwidth into the UPDATE
@@ -15,10 +15,10 @@
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 78179aa..87448e7 100644
+index bc7a97b..da6e727 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -170,6 +170,17 @@ static struct hostapd_config *hostapd_ctrl_iface_config_read(const char *fname)
+@@ -171,6 +171,17 @@ static struct hostapd_config *hostapd_ctrl_iface_config_read(const char *fname)
conf->hw_mode = atoi(val);
else if ((val = get_option(opt, "ieee80211n=")))
conf->ieee80211n = atoi(val);
@@ -37,7 +37,7 @@
break;
}
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
-index 270da46..04c37b1 100644
+index b67b5ad..bec8db8 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -150,9 +150,10 @@ static int hostapd_reload(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch
deleted file mode 100644
index c9b8ea9..0000000
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch
+++ /dev/null
@@ -1,1175 +0,0 @@
-From bed7e913c79fcd0f2d7d686b7d1da0ec8bf4d23f Mon Sep 17 00:00:00 2001
-From: mtk20656 <chank.chen@mediatek.com>
-Date: Thu, 2 Mar 2023 10:51:43 +0800
-Subject: [PATCH 21/29] hostapd: mtk: add 11v_mbss and ema support for hostapd
-
-Signed-off-by: mtk20656 <chank.chen@mediatek.com>
----
- hostapd/config_file.c | 9 +
- hostapd/hostapd.conf | 58 +++++++
- hostapd/main.c | 3 +
- src/ap/ap_config.c | 12 ++
- src/ap/ap_config.h | 6 +
- src/ap/beacon.c | 124 ++++++++++++--
- src/ap/hostapd.c | 72 +++++++-
- src/ap/hostapd.h | 7 +
- src/ap/ieee802_11.c | 276 +++++++++++++++++++++++++++++-
- src/ap/ieee802_11.h | 7 +-
- src/ap/ieee802_11_shared.c | 11 ++
- src/common/ieee802_11_common.c | 4 +
- src/common/ieee802_11_common.h | 3 +
- src/common/ieee802_11_defs.h | 5 +
- src/drivers/driver.h | 42 +++++
- src/drivers/driver_nl80211.c | 52 ++++++
- src/drivers/driver_nl80211_capa.c | 27 +++
- 17 files changed, 698 insertions(+), 20 deletions(-)
-
-diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index 649618b..3f26191 100644
---- a/hostapd/config_file.c
-+++ b/hostapd/config_file.c
-@@ -3663,6 +3663,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
- return 1;
- }
- bss->unsol_bcast_probe_resp_interval = val;
-+ } else if (os_strcmp(buf, "mbssid") == 0) {
-+ int mbssid = atoi(pos);
-+ if (mbssid < 0 || mbssid > ENHANCED_MBSSID_ENABLED) {
-+ wpa_printf(MSG_ERROR,
-+ "Line %d: invalid mbssid (%d): '%s'.",
-+ line, mbssid, pos);
-+ return 1;
-+ }
-+ conf->mbssid = mbssid;
- } else if (os_strcmp(buf, "mu_onoff") == 0) {
- int val = atoi(pos);
- if (val < 0 || val > 15) {
-diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
-index e3a5eb3..f926029 100644
---- a/hostapd/hostapd.conf
-+++ b/hostapd/hostapd.conf
-@@ -3123,3 +3123,61 @@ own_ip_addr=127.0.0.1
- #bss=wlan0_1
- #bssid=00:13:10:95:fe:0b
- # ...
-+#
-+# Multiple BSSID Advertisement in 802.11ax
-+# IEEE Std 802.11ax-2021 added a feature where instead of multiple interfaces
-+# on a common radio transmitting individual beacons, those can form a set with
-+# a common beacon is transmitted for all. The interface which is brought up
-+# first is called as the transmitting profile of the MBSSID set which transmits
-+# the beacons. The remaining interfaces are called as the non-transmitting
-+# profiles and these are advertised inside the multiple BSSID element in the
-+# beacons and probe response frames.
-+# The transmitting interface is visible to all clients in the vicinity, however
-+# the clients which do not support parsing of the multiple BSSID element will
-+# not be able to connect to the non-transmitting interfaces.
-+#
-+# Enhanced Multiple BSSID Advertisements (EMA)
-+# When enabled, the non-transmitting interfaces are split into multiple
-+# beacons. The number of beacons required to cover all the non-transmitting
-+# profiles is called as the profile periodicity.
-+#
-+# Refer to IEEE Std 802.11-2020 for details regarding the procedure and
-+# required MAC address assignment.
-+#
-+# Following configuration is per radio.
-+# 0 = Disabled (Default)
-+# 1 = Multiple BSSID advertisements enabled.
-+# 2 = Enhanced multiple BSSID advertisements enabled.
-+#mbssid=0
-+#
-+# The transmitting interface should be added with 'interface' option while
-+# the non-transmitting interfaces should be added using 'bss' option.
-+# Security configuration should be added separately per interface, if required.
-+#
-+# Example:
-+#mbssid=2
-+#interface=wlan2
-+#ctrl_interface=/var/run/hostapd
-+#wpa_passphrase=0123456789
-+#ieee80211w=2
-+#sae_pwe=1
-+#auth_algs=1
-+#wpa=2
-+#wpa_pairwise=CCMP
-+#ssid=<SSID-0>
-+#bridge=br-lan
-+#wpa_key_mgmt=SAE
-+#bssid=00:03:7f:12:84:84
-+#
-+#bss=wlan2-1
-+#ctrl_interface=/var/run/hostapd
-+#wpa_passphrase=0123456789
-+#ieee80211w=2
-+#sae_pwe=1
-+#auth_algs=1
-+#wpa=2
-+#wpa_pairwise=CCMP
-+#ssid=<SSID-1>
-+#bridge=br-lan
-+#wpa_key_mgmt=SAE
-+#bssid=00:03:7f:12:84:85
-diff --git a/hostapd/main.c b/hostapd/main.c
-index 70a4b32..1b6474a 100644
---- a/hostapd/main.c
-+++ b/hostapd/main.c
-@@ -253,6 +253,9 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
- wpa_printf(MSG_ERROR, "set_wowlan failed");
- }
- os_free(triggs);
-+
-+ iface->mbssid_max_interfaces = capa.mbssid_max_interfaces;
-+ iface->ema_max_periodicity = capa.ema_max_periodicity;
- }
-
- return 0;
-diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
-index 4e46a62..7d9d5cb 100644
---- a/src/ap/ap_config.c
-+++ b/src/ap/ap_config.c
-@@ -1462,6 +1462,12 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
- }
- #endif /* CONFIG_IEEE80211BE */
-
-+ if (full_config && bss->ignore_broadcast_ssid && conf->mbssid) {
-+ wpa_printf(MSG_ERROR,
-+ "Hidden SSID is not suppored when MBSSID is enabled");
-+ return -1;
-+ }
-+
- return 0;
- }
-
-@@ -1545,6 +1551,12 @@ int hostapd_config_check(struct hostapd_config *conf, int full_config)
- }
- #endif /* CONFIG_IEEE80211BE */
-
-+ if (full_config && conf->mbssid && !conf->ieee80211ax) {
-+ wpa_printf(MSG_ERROR,
-+ "Cannot enable multiple BSSID support without ieee80211ax");
-+ 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 7aeb176..51476b8 100644
---- a/src/ap/ap_config.h
-+++ b/src/ap/ap_config.h
-@@ -923,6 +923,8 @@ struct hostapd_bss_config {
- u8 ext_capa[EXT_CAPA_MAX_LEN];
-
- u8 rnr;
-+
-+ bool xrates_supported;
- };
-
- /**
-@@ -1163,6 +1165,10 @@ struct hostapd_config {
- u8 ibf_enable;
- u8 dfs_detect_mode;
- u8 amsdu;
-+
-+#define MBSSID_ENABLED 1
-+#define ENHANCED_MBSSID_ENABLED 2
-+ u8 mbssid;
- };
-
- enum three_wire_mode {
-diff --git a/src/ap/beacon.c b/src/ap/beacon.c
-index f3ea5c2..ad56046 100644
---- a/src/ap/beacon.c
-+++ b/src/ap/beacon.c
-@@ -462,15 +462,77 @@ static u8 * hostapd_eid_supported_op_classes(struct hostapd_data *hapd, u8 *eid)
- }
-
-
-+static int ieee802_11_build_ap_params_mbssid(struct hostapd_data *hapd,
-+ struct wpa_driver_ap_params *params,
-+ u8 **eid)
-+{
-+ struct hostapd_iface *iface = hapd->iface;
-+ struct hostapd_data *tx_bss;
-+ size_t len;
-+ u8 elem_count = 0, *elem = NULL, **elem_offset = NULL, *end;
-+ u8 *tailpos = *eid;
-+
-+ if (!iface->mbssid_max_interfaces ||
-+ iface->num_bss > iface->mbssid_max_interfaces ||
-+ (iface->conf->mbssid == ENHANCED_MBSSID_ENABLED &&
-+ !iface->ema_max_periodicity))
-+ goto fail;
-+
-+ tx_bss = hostapd_mbssid_get_tx_bss(hapd);
-+ len = hostapd_eid_mbssid_len(tx_bss, WLAN_FC_STYPE_BEACON, &elem_count,
-+ NULL, 0);
-+ if (!len || (iface->conf->mbssid == ENHANCED_MBSSID_ENABLED &&
-+ elem_count > iface->ema_max_periodicity))
-+ goto fail;
-+
-+ elem = os_zalloc(len);
-+ if (!elem)
-+ goto fail;
-+
-+ elem_offset = os_zalloc(elem_count * sizeof(u8 *));
-+ if (!elem_offset)
-+ goto fail;
-+
-+ end = hostapd_eid_mbssid(tx_bss, elem, elem + len, WLAN_FC_STYPE_BEACON,
-+ elem_count, elem_offset, NULL, 0);
-+
-+ params->mbssid_tx_iface = tx_bss->conf->iface;
-+ params->mbssid_index = hostapd_mbssid_get_bss_index(hapd);
-+ params->mbssid_elem = elem;
-+ params->mbssid_elem_len = end - elem;
-+ params->mbssid_elem_count = elem_count;
-+ params->mbssid_elem_offset = elem_offset;
-+ if (iface->conf->mbssid == ENHANCED_MBSSID_ENABLED) {
-+ params->ema = true;
-+ *tailpos++ = WLAN_EID_EXTENSION;
-+ *tailpos++ = 3;
-+ *tailpos++ = WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION;
-+ *tailpos++ = iface->num_bss;
-+ *tailpos++ = params->mbssid_elem_count;
-+ *eid = tailpos;
-+ }
-+
-+ return 0;
-+
-+fail:
-+ os_free(elem);
-+ wpa_printf(MSG_ERROR, "MBSSID: Configuration failed");
-+ return -1;
-+}
-+
-+
- static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
- const struct ieee80211_mgmt *req,
- int is_p2p, size_t *resp_len,
-- bool bcast_probe_resp)
-+ bool bcast_probe_resp, const u8 *known_bss,
-+ u8 known_bss_len)
- {
- struct ieee80211_mgmt *resp;
-- u8 *pos, *epos, *csa_pos;
-+ u8 *pos, *epos, *csa_pos, *ext_cap_pos;
- size_t buflen;
-
-+ hapd = hostapd_mbssid_get_tx_bss(hapd);
-+
- #define MAX_PROBERESP_LEN 768
- buflen = MAX_PROBERESP_LEN;
- #ifdef CONFIG_WPS
-@@ -517,6 +579,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
- }
- #endif /* CONFIG_IEEE80211BE */
-
-+ buflen += hostapd_eid_mbssid_len(hapd, WLAN_FC_STYPE_PROBE_RESP, NULL,
-+ known_bss, known_bss_len);
- buflen += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_PROBE_RESP);
- buflen += hostapd_mbo_ie_len(hapd);
- buflen += hostapd_eid_owe_trans_len(hapd);
-@@ -588,8 +652,16 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
- pos = hostapd_eid_supported_op_classes(hapd, pos);
- pos = hostapd_eid_ht_capabilities(hapd, pos);
- pos = hostapd_eid_ht_operation(hapd, pos);
-+ pos = hostapd_eid_mbssid(hapd, pos, epos, WLAN_FC_STYPE_PROBE_RESP, 0,
-+ NULL, known_bss, known_bss_len);
-
-+ ext_cap_pos = pos;
- pos = hostapd_eid_ext_capab(hapd, pos);
-+ if (hapd->iconf->mbssid >= MBSSID_ENABLED && !known_bss_len)
-+ ext_cap_pos[12] |= 0x01; /* Probe responses always include all
-+ * non-tx profiles except when a list
-+ * of known BSSes is included in the
-+ * probe request. */
-
- pos = hostapd_eid_time_adv(hapd, pos);
- pos = hostapd_eid_time_zone(hapd, pos);
-@@ -1153,16 +1225,23 @@ void handle_probe_req(struct hostapd_data *hapd,
- }
- #endif /* CONFIG_TESTING_OPTIONS */
-
-+ /* Do not send probe response from a non-transmitting multiple BSSID
-+ * profile unless the probe request is directed at that paticular BSS */
-+ if (hapd != hostapd_mbssid_get_tx_bss(hapd) && res != EXACT_SSID_MATCH)
-+ return;
-+
- wpa_msg_ctrl(hapd->msg_ctx, MSG_INFO, RX_PROBE_REQUEST "sa=" MACSTR
- " signal=%d", MAC2STR(mgmt->sa), ssi_signal);
-
- if (is_6ghz_op_class(hapd->iconf->op_class) &&
- is_broadcast_ether_addr(mgmt->da))
- resp = hostapd_gen_probe_resp(hapd, NULL, elems.p2p != NULL,
-- &resp_len, true);
-+ &resp_len, true, elems.mbssid_known_bss,
-+ elems.mbssid_known_bss_len);
- else
- resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL,
-- &resp_len, false);
-+ &resp_len, false, elems.mbssid_known_bss,
-+ elems.mbssid_known_bss_len);
- if (resp == NULL)
- return;
-
-@@ -1184,7 +1263,8 @@ void handle_probe_req(struct hostapd_data *hapd,
- hapd->cs_c_off_ecsa_proberesp;
- }
-
-- ret = hostapd_drv_send_mlme(hapd, resp, resp_len, noack,
-+ ret = hostapd_drv_send_mlme(hostapd_mbssid_get_tx_bss(hapd), resp,
-+ resp_len, noack,
- csa_offs_len ? csa_offs : NULL,
- csa_offs_len, 0);
-
-@@ -1231,7 +1311,7 @@ static u8 * hostapd_probe_resp_offloads(struct hostapd_data *hapd,
- "this");
-
- /* Generate a Probe Response template for the non-P2P case */
-- return hostapd_gen_probe_resp(hapd, NULL, 0, resp_len, false);
-+ return hostapd_gen_probe_resp(hapd, NULL, 0, resp_len, false, NULL, 0);
- }
-
- #endif /* NEED_AP_MLME */
-@@ -1250,7 +1330,7 @@ static u8 * hostapd_unsol_bcast_probe_resp(struct hostapd_data *hapd,
-
- return hostapd_gen_probe_resp(hapd, NULL, 0,
- ¶ms->unsol_bcast_probe_resp_tmpl_len,
-- true);
-+ true, NULL, 0);
- }
- #endif /* CONFIG_IEEE80211AX */
-
-@@ -1533,8 +1613,12 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
- size_t resp_len = 0;
- #ifdef NEED_AP_MLME
- u16 capab_info;
-- u8 *pos, *tailpos, *tailend, *csa_pos;
-+ u8 *pos, *tailpos, *tailend, *csa_pos, *ext_cap_pos;
-+#endif /* NEED_AP_MLME */
-
-+ os_memset(params, 0, sizeof(*params));
-+
-+#ifdef NEED_AP_MLME
- #define BEACON_HEAD_BUF_SIZE 256
- #define BEACON_TAIL_BUF_SIZE 512
- head = os_zalloc(BEACON_HEAD_BUF_SIZE);
-@@ -1586,6 +1670,9 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
- }
- #endif /* CONFIG_IEEE80211BE */
-
-+ 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_mbo_ie_len(hapd);
- tail_len += hostapd_eid_owe_trans_len(hapd);
-@@ -1671,9 +1758,23 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
- tailpos = hostapd_eid_supported_op_classes(hapd, tailpos);
- tailpos = hostapd_eid_ht_capabilities(hapd, tailpos);
- tailpos = hostapd_eid_ht_operation(hapd, tailpos);
--
-+ ext_cap_pos = tailpos;
- tailpos = hostapd_eid_ext_capab(hapd, tailpos);
-
-+ if (hapd->iconf->mbssid && hapd->iconf->num_bss > 1) {
-+ if (ieee802_11_build_ap_params_mbssid(hapd, params, &tailpos)) {
-+ os_free(head);
-+ os_free(tail);
-+ wpa_printf(MSG_ERROR, "Failed to set beacon data");
-+ return -1;
-+ } else if (hapd->iconf->mbssid == MBSSID_ENABLED ||
-+ (hapd->iconf->mbssid == ENHANCED_MBSSID_ENABLED &&
-+ params->mbssid_elem_count == 1)) {
-+ /* Set the extended capability bit for "complete list
-+ * of non-tx profiles" */
-+ ext_cap_pos[12] |= 0x01;
-+ }
-+ }
- /*
- * TODO: Time Advertisement element should only be included in some
- * DTIM Beacon frames.
-@@ -1794,7 +1895,6 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
- resp = hostapd_probe_resp_offloads(hapd, &resp_len);
- #endif /* NEED_AP_MLME */
-
-- os_memset(params, 0, sizeof(*params));
- params->head = (u8 *) head;
- params->head_len = head_len;
- params->tail = tail;
-@@ -1897,6 +1997,10 @@ void ieee802_11_free_ap_params(struct wpa_driver_ap_params *params)
- params->head = NULL;
- os_free(params->proberesp);
- params->proberesp = NULL;
-+ os_free(params->mbssid_elem);
-+ params->mbssid_elem = NULL;
-+ os_free(params->mbssid_elem_offset);
-+ params->mbssid_elem_offset = NULL;
- #ifdef CONFIG_FILS
- os_free(params->fd_frame_tmpl);
- params->fd_frame_tmpl = NULL;
-diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index 42e8ed7..ef0d6db 100644
---- a/src/ap/hostapd.c
-+++ b/src/ap/hostapd.c
-@@ -91,6 +91,29 @@ int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
- }
-
-
-+struct hostapd_data * hostapd_mbssid_get_tx_bss(struct hostapd_data *hapd)
-+{
-+ if (hapd->iconf->mbssid)
-+ return hapd->iface->bss[0];
-+
-+ return hapd;
-+}
-+
-+
-+int hostapd_mbssid_get_bss_index(struct hostapd_data *hapd)
-+{
-+ if (hapd->iconf->mbssid) {
-+ size_t i;
-+
-+ for (i = 1; i < hapd->iface->num_bss; i++)
-+ if (hapd->iface->bss[i] == hapd)
-+ return i;
-+ }
-+
-+ return 0;
-+}
-+
-+
- void hostapd_reconfig_encryption(struct hostapd_data *hapd)
- {
- if (hapd->wpa_auth)
-@@ -1179,19 +1202,37 @@ static int db_table_create_radius_attributes(sqlite3 *db)
-
- #endif /* CONFIG_NO_RADIUS */
-
-+static int hostapd_start_beacon(struct hostapd_data *hapd)
-+{
-+ struct hostapd_bss_config *conf = hapd->conf;
-+
-+ if (!conf->start_disabled && ieee802_11_set_beacon(hapd) < 0)
-+ return -1;
-+
-+ if (hapd->driver && hapd->driver->set_operstate)
-+ hapd->driver->set_operstate(hapd->drv_priv, 1);
-+
-+ return 0;
-+}
-
- /**
- * hostapd_setup_bss - Per-BSS setup (initialization)
- * @hapd: Pointer to BSS data
- * @first: Whether this BSS is the first BSS of an interface; -1 = not first,
- * but interface may exist
-+ * @start_beacon: Whether beacons should be configured and transmission started
-+ * at this time. This is used when MBSSID IE is enabled where the
-+ * information regarding all BSSes should be retrieved before configuring
-+ * the beacons. The calling functions are responsible to configure the
-+ * beacon explicitly if this is set to 'false'.
- *
- * This function is used to initialize all per-BSS data structures and
- * resources. This gets called in a loop for each BSS when an interface is
- * initialized. Most of the modules that are initialized here will be
- * deinitialized in hostapd_cleanup().
- */
--static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
-+static int hostapd_setup_bss(struct hostapd_data *hapd, int first,
-+ bool start_beacon)
- {
- struct hostapd_bss_config *conf = hapd->conf;
- u8 ssid[SSID_MAX_LEN + 1];
-@@ -1464,9 +1505,6 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
- return -1;
- }
-
-- if (!conf->start_disabled && ieee802_11_set_beacon(hapd) < 0)
-- return -1;
--
- if (flush_old_stations && !conf->start_disabled &&
- conf->broadcast_deauth) {
- u8 addr[ETH_ALEN];
-@@ -1485,8 +1523,8 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
- if (hapd->wpa_auth && wpa_init_keys(hapd->wpa_auth) < 0)
- return -1;
-
-- if (hapd->driver && hapd->driver->set_operstate)
-- hapd->driver->set_operstate(hapd->drv_priv, 1);
-+ if (start_beacon && hostapd_start_beacon(hapd) < 0)
-+ return -1;
-
- hostapd_ubus_add_bss(hapd);
-
-@@ -2214,7 +2252,7 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface,
- hapd = iface->bss[j];
- if (j)
- os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN);
-- if (hostapd_setup_bss(hapd, j == 0)) {
-+ if (hostapd_setup_bss(hapd, j == 0, !iface->conf->mbssid)) {
- for (;;) {
- hapd = iface->bss[j];
- hostapd_bss_deinit_no_free(hapd);
-@@ -2228,6 +2266,24 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface,
- if (is_zero_ether_addr(hapd->conf->bssid))
- prev_addr = hapd->own_addr;
- }
-+
-+ if (hapd->iconf->mbssid) {
-+ for (j = 0; j < iface->num_bss; j++) {
-+ hapd = iface->bss[j];
-+ if (hostapd_start_beacon(hapd)) {
-+ for (;;) {
-+ hapd = iface->bss[j];
-+ hostapd_bss_deinit_no_free(hapd);
-+ hostapd_free_hapd_data(hapd);
-+ if (j == 0)
-+ break;
-+ j--;
-+ }
-+ goto fail;
-+ }
-+ }
-+ }
-+
- hapd = iface->bss[0];
-
- hostapd_tx_queue_params(iface);
-@@ -3130,7 +3186,7 @@ int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf)
-
- if (start_ctrl_iface_bss(hapd) < 0 ||
- (hapd_iface->state == HAPD_IFACE_ENABLED &&
-- hostapd_setup_bss(hapd, -1))) {
-+ hostapd_setup_bss(hapd, -1, true))) {
- hostapd_cleanup(hapd);
- hapd_iface->bss[hapd_iface->num_bss - 1] = NULL;
- hapd_iface->conf->num_bss--;
-diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
-index 56d96a5..093c28a 100644
---- a/src/ap/hostapd.h
-+++ b/src/ap/hostapd.h
-@@ -660,6 +660,11 @@ struct hostapd_iface {
- /* Previous WMM element information */
- struct hostapd_wmm_ac_params prev_wmm[WMM_AC_NUM];
-
-+ /* Maximum number of interfaces supported for MBSSID advertisements */
-+ u8 mbssid_max_interfaces;
-+ /* Maximum profile periodicity for enhanced MBSSID advertisements */
-+ u8 ema_max_periodicity;
-+
- int (*enable_iface_cb)(struct hostapd_iface *iface);
- int (*disable_iface_cb)(struct hostapd_iface *iface);
- };
-@@ -762,5 +767,7 @@ void fst_hostapd_fill_iface_obj(struct hostapd_data *hapd,
- #endif /* CONFIG_FST */
-
- int hostapd_set_acl(struct hostapd_data *hapd);
-+struct hostapd_data * hostapd_mbssid_get_tx_bss(struct hostapd_data *hapd);
-+int hostapd_mbssid_get_bss_index(struct hostapd_data *hapd);
-
- #endif /* HOSTAPD_H */
-diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
-index 098793e..30bfa30 100644
---- a/src/ap/ieee802_11.c
-+++ b/src/ap/ieee802_11.c
-@@ -165,6 +165,7 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid)
- int i, num, count;
- int h2e_required;
-
-+ hapd->conf->xrates_supported = 0;
- if (hapd->iface->current_rates == NULL)
- return eid;
-
-@@ -214,6 +215,7 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid)
- *pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY;
- }
-
-+ hapd->conf->xrates_supported = 1;
- return pos;
- }
-
-@@ -3979,6 +3981,23 @@ static void handle_auth(struct hostapd_data *hapd,
- }
-
-
-+static u8 hostapd_max_bssid_indicator(struct hostapd_data *hapd)
-+{
-+ size_t num_bss_nontx;
-+ u8 max_bssid_ind = 0;
-+
-+ if (!hapd->iconf->mbssid || hapd->iface->num_bss <= 1)
-+ return 0;
-+
-+ num_bss_nontx = hapd->iface->num_bss - 1;
-+ while (num_bss_nontx > 0) {
-+ max_bssid_ind++;
-+ num_bss_nontx >>= 1;
-+ }
-+ return max_bssid_ind;
-+}
-+
-+
- int hostapd_get_aid(struct hostapd_data *hapd, struct sta_info *sta)
- {
- int i, j = 32, aid;
-@@ -4004,7 +4023,10 @@ int hostapd_get_aid(struct hostapd_data *hapd, struct sta_info *sta)
- }
- if (j == 32)
- return -1;
-- aid = i * 32 + j + 1;
-+ aid = i * 32 + j;
-+
-+ aid += (1 << hostapd_max_bssid_indicator(hapd));
-+
- if (aid > 2007)
- return -1;
-
-@@ -7579,4 +7601,256 @@ u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type)
- return eid;
- }
-
-+
-+static size_t hostapd_eid_mbssid_elem_len(struct hostapd_data *hapd,
-+ u32 frame_type, size_t *bss_index,
-+ const u8 *known_bss,
-+ size_t known_bss_len)
-+{
-+ struct hostapd_data *tx_bss = hostapd_mbssid_get_tx_bss(hapd);
-+ size_t len = 3, i;
-+
-+ for (i = *bss_index; i < hapd->iface->num_bss; i++) {
-+ struct hostapd_data *bss = hapd->iface->bss[i];
-+ const u8 *auth, *rsn = NULL, *rsnx = NULL;
-+ size_t nontx_profile_len, auth_len;
-+ u8 ie_count = 0;
-+
-+ if (known_bss && (known_bss_len > (i / 8))) {
-+ known_bss = &known_bss[i / 8];
-+ if (*known_bss & (u8)(BIT(i % 8)))
-+ continue;
-+ }
-+
-+ if (!bss || !bss->conf || !bss->started)
-+ continue;
-+
-+ /*
-+ * Sublement ID: 1 byte
-+ * Length: 1 byte
-+ * Nontransmitted capabilities: 4 bytes
-+ * SSID element: 2 + variable
-+ * Multiple BSSID Index Element: 3 bytes (+2 bytes in beacons)
-+ * Fixed length = 1 + 1 + 4 + 2 + 3 = 11
-+ */
-+ nontx_profile_len = 11 + bss->conf->ssid.ssid_len;
-+
-+ if (frame_type == WLAN_FC_STYPE_BEACON)
-+ nontx_profile_len += 2;
-+
-+ auth = wpa_auth_get_wpa_ie(bss->wpa_auth, &auth_len);
-+ if (auth) {
-+ rsn = get_ie(auth, auth_len, WLAN_EID_RSN);
-+ if (rsn)
-+ nontx_profile_len += (2 + rsn[1]);
-+
-+ rsnx = get_ie(auth, auth_len, WLAN_EID_RSNX);
-+ if (rsnx)
-+ nontx_profile_len += (2 + rsnx[1]);
-+ }
-+ if (!rsn && hostapd_wpa_ie(tx_bss, WLAN_EID_RSN))
-+ ie_count++;
-+ if (!rsnx && hostapd_wpa_ie(tx_bss, WLAN_EID_RSNX))
-+ ie_count++;
-+ if (bss->conf->xrates_supported)
-+ nontx_profile_len += 8;
-+ else if (hapd->conf->xrates_supported)
-+ ie_count++;
-+ if (ie_count)
-+ nontx_profile_len += (4 + ie_count);
-+
-+ if ((len + nontx_profile_len) > 255)
-+ goto mbssid_too_big;
-+
-+ len += nontx_profile_len;
-+ }
-+
-+mbssid_too_big:
-+ *bss_index = i;
-+ return len;
-+}
-+
-+
-+size_t hostapd_eid_mbssid_len(struct hostapd_data *hapd, u32 frame_type,
-+ u8 *elem_count, const u8 *known_bss,
-+ size_t known_bss_len)
-+{
-+ size_t len = 0, bss_index = 1;
-+
-+ if (!hapd->iconf->mbssid || hapd->iface->num_bss <= 1 ||
-+ (frame_type != WLAN_FC_STYPE_BEACON &&
-+ frame_type != WLAN_FC_STYPE_PROBE_RESP))
-+ return 0;
-+
-+ if (frame_type == WLAN_FC_STYPE_BEACON) {
-+ if (!elem_count) {
-+ wpa_printf(MSG_ERROR,
-+ "MBSSID: Insufficient data for beacons");
-+ return 0;
-+ }
-+ *elem_count = 0;
-+ }
-+
-+ while (bss_index < hapd->iface->num_bss) {
-+ len += hostapd_eid_mbssid_elem_len(hapd, frame_type,
-+ &bss_index, known_bss,
-+ known_bss_len);
-+
-+ if (frame_type == WLAN_FC_STYPE_BEACON)
-+ *elem_count += 1;
-+ }
-+ return len;
-+}
-+
-+
-+static u8 * hostapd_eid_mbssid_elem(struct hostapd_data *hapd, u8 *eid, u8 *end,
-+ u32 frame_type, u8 max_bssid_indicator,
-+ size_t *bss_index, u8 elem_count,
-+ const u8 *known_bss, size_t known_bss_len)
-+{
-+ struct hostapd_data *tx_bss = hostapd_mbssid_get_tx_bss(hapd);
-+ size_t i;
-+ u8 *eid_len_offset, *max_bssid_indicator_offset;
-+
-+ *eid++ = WLAN_EID_MULTIPLE_BSSID;
-+ eid_len_offset = eid++;
-+ max_bssid_indicator_offset = eid++;
-+
-+ for (i = *bss_index; i < hapd->iface->num_bss; i++) {
-+ struct hostapd_data *bss = hapd->iface->bss[i];
-+ struct hostapd_bss_config *conf;
-+ u8 *eid_len_pos, *nontx_bss_start = eid;
-+ const u8 *auth, *rsn = NULL, *rsnx = NULL;
-+ u8 ie_count = 0, non_inherit_ie[3];
-+ size_t auth_len = 0;
-+ u16 capab_info;
-+
-+ if (known_bss && (known_bss_len > (i / 8))) {
-+ known_bss = &known_bss[i / 8];
-+ if (*known_bss & (u8)(BIT(i % 8)))
-+ continue;
-+ }
-+
-+ if (!bss || !bss->conf || !bss->started)
-+ continue;
-+ conf = bss->conf;
-+
-+ *eid++ = WLAN_EID_SUBELEMENT_NONTRANSMITTED_BSSID_PROFILE;
-+ eid_len_pos = eid++;
-+
-+ *eid++ = WLAN_EID_NONTRANSMITTED_BSSID_CAPA;
-+ *eid++ = sizeof(capab_info);
-+ capab_info = host_to_le16(hostapd_own_capab_info(bss));
-+ os_memcpy(eid, (const void *)&capab_info, sizeof(capab_info));
-+ eid += sizeof(capab_info);
-+
-+ *eid++ = WLAN_EID_SSID;
-+ *eid++ = conf->ssid.ssid_len;
-+ os_memcpy(eid, conf->ssid.ssid, conf->ssid.ssid_len);
-+ eid += conf->ssid.ssid_len;
-+
-+ *eid++ = WLAN_EID_MULTIPLE_BSSID_INDEX;
-+ if (frame_type == WLAN_FC_STYPE_BEACON) {
-+ *eid++ = 3;
-+ *eid++ = i;
-+ if (hapd->iconf->mbssid == ENHANCED_MBSSID_ENABLED &&
-+ (conf->dtim_period % elem_count))
-+ conf->dtim_period = elem_count;
-+ *eid++ = conf->dtim_period;
-+ *eid++ = 0xFF;
-+ } else {
-+ *eid++ = 1;
-+ *eid++ = i;
-+ }
-+
-+ auth = wpa_auth_get_wpa_ie(bss->wpa_auth, &auth_len);
-+ if (auth) {
-+ rsn = get_ie(auth, auth_len, WLAN_EID_RSN);
-+ if (rsn) {
-+ os_memcpy(eid, rsn, 2 + rsn[1]);
-+ eid += (2 + rsn[1]);
-+ }
-+
-+ rsnx = get_ie(auth, auth_len, WLAN_EID_RSNX);
-+ if (rsnx) {
-+ os_memcpy(eid, rsnx, 2 + rsnx[1]);
-+ eid += (2 + rsnx[1]);
-+ }
-+ }
-+ if (!rsn && hostapd_wpa_ie(tx_bss, WLAN_EID_RSN)) {
-+ non_inherit_ie[ie_count] = WLAN_EID_RSN;
-+ ie_count++;
-+ }
-+ if (!rsnx && hostapd_wpa_ie(tx_bss, WLAN_EID_RSNX)) {
-+ non_inherit_ie[ie_count] = WLAN_EID_RSNX;
-+ ie_count++;
-+ }
-+ if (hapd->conf->xrates_supported &&
-+ !bss->conf->xrates_supported) {
-+ non_inherit_ie[ie_count] = WLAN_EID_EXT_SUPP_RATES;
-+ ie_count++;
-+ }
-+ if (ie_count) {
-+ *eid++ = WLAN_EID_EXTENSION;
-+ *eid++ = 2 + ie_count;
-+ *eid++ = WLAN_EID_EXT_NON_INHERITANCE;
-+ *eid++ = ie_count;
-+ os_memcpy(eid, non_inherit_ie, ie_count);
-+ eid += ie_count;
-+ }
-+
-+ *eid_len_pos = (eid - eid_len_pos) - 1;
-+
-+ if (((eid - eid_len_offset) - 1) > 255) {
-+ eid = nontx_bss_start;
-+ goto mbssid_too_big;
-+ }
-+ }
-+
-+mbssid_too_big:
-+ *bss_index = i;
-+ *max_bssid_indicator_offset = max_bssid_indicator;
-+ if (*max_bssid_indicator_offset < 1)
-+ *max_bssid_indicator_offset = 1;
-+ *eid_len_offset = (eid - eid_len_offset) - 1;
-+ return eid;
-+}
-+
-+
-+u8 * hostapd_eid_mbssid(struct hostapd_data *hapd, u8 *eid, u8 *end,
-+ u32 frame_type, u8 elem_count, u8 **elem_offset,
-+ const u8 *known_bss, size_t known_bss_len)
-+{
-+ size_t bss_index = 1;
-+ u8 elem_index = 0;
-+
-+ if (!hapd->iconf->mbssid || hapd->iface->num_bss <= 1 ||
-+ (frame_type != WLAN_FC_STYPE_BEACON &&
-+ frame_type != WLAN_FC_STYPE_PROBE_RESP))
-+ return eid;
-+
-+ if (frame_type == WLAN_FC_STYPE_BEACON && !elem_offset) {
-+ wpa_printf(MSG_ERROR, "MBSSID: Insufficient data for beacons");
-+ return eid;
-+ }
-+
-+ while (bss_index < hapd->iface->num_bss) {
-+ if (frame_type == WLAN_FC_STYPE_BEACON) {
-+ if (elem_index == elem_count) {
-+ wpa_printf(MSG_WARNING,
-+ "MBSSID: More number of elements than provided array");
-+ break;
-+ }
-+
-+ elem_offset[elem_index] = eid;
-+ elem_index = elem_index + 1;
-+ }
-+ eid = hostapd_eid_mbssid_elem(hapd, eid, end, frame_type,
-+ hostapd_max_bssid_indicator(hapd),
-+ &bss_index, elem_count,
-+ known_bss, known_bss_len);
-+ }
-+ return eid;
-+}
-+
- #endif /* CONFIG_NATIVE_WINDOWS */
-diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h
-index fa1f47b..bb454bb 100644
---- a/src/ap/ieee802_11.h
-+++ b/src/ap/ieee802_11.h
-@@ -214,5 +214,10 @@ 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,
- const u8 *eht_capab, size_t eht_capab_len);
--
-+size_t hostapd_eid_mbssid_len(struct hostapd_data *hapd, u32 frame_type,
-+ u8 *elem_count, const u8 *known_bss,
-+ size_t known_bss_len);
-+u8 * hostapd_eid_mbssid(struct hostapd_data *hapd, u8 *eid, u8 *end,
-+ u32 frame_type, u8 elem_count, u8 **elem_offset,
-+ const u8 *known_bss, size_t known_bss_len);
- #endif /* IEEE802_11_H */
-diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c
-index 4f85d78..7f5b475 100644
---- a/src/ap/ieee802_11_shared.c
-+++ b/src/ap/ieee802_11_shared.c
-@@ -364,6 +364,8 @@ static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx)
- *pos |= 0x02; /* Bit 17 - WNM-Sleep Mode */
- if (hapd->conf->bss_transition)
- *pos |= 0x08; /* Bit 19 - BSS Transition */
-+ if (hapd->iconf->mbssid)
-+ *pos |= 0x40; /* Bit 22 - Multiple BSSID */
- break;
- case 3: /* Bits 24-31 */
- #ifdef CONFIG_WNM_AP
-@@ -436,6 +438,8 @@ static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx)
- (hapd->iface->drv_flags &
- WPA_DRIVER_FLAGS_BEACON_PROTECTION))
- *pos |= 0x10; /* Bit 84 - Beacon Protection Enabled */
-+ if (hapd->iconf->mbssid == ENHANCED_MBSSID_ENABLED)
-+ *pos |= 0x08; /* Bit 83 - Enhanced multiple BSSID */
- break;
- case 11: /* Bits 88-95 */
- #ifdef CONFIG_SAE_PK
-@@ -471,6 +475,13 @@ u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid)
- *pos &= ~hapd->conf->ext_capa_mask[i];
- *pos |= hapd->conf->ext_capa[i];
- }
-+
-+ /* Clear bits 83 and 22 if EMA and MBSSID are not enabled
-+ * otherwise association fails with some clients */
-+ if (i == 10 && hapd->iconf->mbssid < ENHANCED_MBSSID_ENABLED)
-+ *pos &= ~0x08;
-+ if (i == 2 && !hapd->iconf->mbssid)
-+ *pos &= ~0x40;
- }
-
- while (len > 0 && eid[1 + len] == 0) {
-diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c
-index c8ee90c..2fab7c3 100644
---- a/src/common/ieee802_11_common.c
-+++ b/src/common/ieee802_11_common.c
-@@ -315,6 +315,10 @@ static int ieee802_11_parse_extension(const u8 *pos, size_t elen,
- elems->eht_operation = pos;
- elems->eht_operation_len = elen;
- break;
-+ case WLAN_EID_EXT_KNOWN_BSSID:
-+ elems->mbssid_known_bss = pos;
-+ elems->mbssid_known_bss_len = elen;
-+ break;
- default:
- if (show_errors) {
- wpa_printf(MSG_MSGDUMP,
-diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h
-index 94e1d7b..1e4e27d 100644
---- a/src/common/ieee802_11_common.h
-+++ b/src/common/ieee802_11_common.h
-@@ -119,6 +119,7 @@ struct ieee802_11_elems {
- const u8 *pasn_params;
- const u8 *eht_capabilities;
- const u8 *eht_operation;
-+ const u8 *mbssid_known_bss;
-
- u8 ssid_len;
- u8 supp_rates_len;
-@@ -176,6 +177,8 @@ struct ieee802_11_elems {
- u8 eht_capabilities_len;
- u8 eht_operation_len;
-
-+ u8 mbssid_known_bss_len;
-+
- struct mb_ies_info mb_ies;
- struct frag_ies_info frag_ies;
- };
-diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
-index 62088bd..0bbbca9 100644
---- a/src/common/ieee802_11_defs.h
-+++ b/src/common/ieee802_11_defs.h
-@@ -481,6 +481,9 @@
- #define WLAN_EID_EXT_SPATIAL_REUSE 39
- #define WLAN_EID_EXT_COLOR_CHANGE_ANNOUNCEMENT 42
- #define WLAN_EID_EXT_OCV_OCI 54
-+#define WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION 55
-+#define WLAN_EID_EXT_NON_INHERITANCE 56
-+#define WLAN_EID_EXT_KNOWN_BSSID 57
- #define WLAN_EID_EXT_SHORT_SSID_LIST 58
- #define WLAN_EID_EXT_HE_6GHZ_BAND_CAP 59
- #define WLAN_EID_EXT_EDMG_CAPABILITIES 61
-@@ -497,6 +500,8 @@
- #define WLAN_EID_EXT_MULTI_LINK_TRAFFIC_INDICATION 110
- #define WLAN_EID_EXT_AKM_SUITE_SELECTOR 114
-
-+#define WLAN_EID_SUBELEMENT_NONTRANSMITTED_BSSID_PROFILE 0
-+
- /* Extended Capabilities field */
- #define WLAN_EXT_CAPAB_20_40_COEX 0
- #define WLAN_EXT_CAPAB_GLK 1
-diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 82daef0..36f465c 100644
---- a/src/drivers/driver.h
-+++ b/src/drivers/driver.h
-@@ -1633,6 +1633,43 @@ struct wpa_driver_ap_params {
- * ibf_enable=<val>
- */
- u8 ibf_enable;
-+
-+ /**
-+ * mbssid_tx_iface - Transmitting interface of the MBSSID set
-+ */
-+ const char *mbssid_tx_iface;
-+
-+ /**
-+ * mbssid_index - The index of this BSS in the MBSSID set
-+ */
-+ unsigned int mbssid_index;
-+
-+ /**
-+ * mbssid_elem - Buffer containing all MBSSID elements
-+ */
-+ u8 *mbssid_elem;
-+
-+ /**
-+ * mbssid_elem_len - Total length of all MBSSID elements
-+ */
-+ size_t mbssid_elem_len;
-+
-+ /**
-+ * mbssid_elem_count - The number of MBSSID elements
-+ */
-+ u8 mbssid_elem_count;
-+
-+ /**
-+ * mbssid_elem_offset - Offsets to elements in mbssid_elem.
-+ * Kernel will use these offsets to generate multiple BSSID beacons.
-+ */
-+ u8 **mbssid_elem_offset;
-+
-+ /**
-+ * ema - Enhanced MBSSID advertisements support.
-+ */
-+ bool ema;
-+
- };
-
- struct wpa_driver_mesh_bss_params {
-@@ -2197,6 +2234,11 @@ struct wpa_driver_capa {
-
- /* Maximum number of supported CSA counters */
- u16 max_csa_counters;
-+
-+ /* Maximum number of interfaces supported for MBSSID advertisements */
-+ u8 mbssid_max_interfaces;
-+ /* Maximum profile periodicity for enhanced MBSSID advertisements */
-+ u8 ema_max_periodicity;
- };
-
-
-diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 6c65901..3753409 100644
---- a/src/drivers/driver_nl80211.c
-+++ b/src/drivers/driver_nl80211.c
-@@ -4540,6 +4540,55 @@ static int nl80211_unsol_bcast_probe_resp(struct i802_bss *bss,
- nla_nest_end(msg, attr);
- return 0;
- }
-+
-+
-+static int nl80211_mbssid(struct nl_msg *msg,
-+ struct wpa_driver_ap_params *params)
-+{
-+ struct nlattr *config, *elems;
-+ int ifidx;
-+
-+ if (!params->mbssid_tx_iface)
-+ return 0;
-+
-+ config = nla_nest_start(msg, NL80211_ATTR_MBSSID_CONFIG);
-+ if (!config)
-+ return -1;
-+
-+ nla_put_u8(msg, NL80211_MBSSID_CONFIG_ATTR_INDEX, params->mbssid_index);
-+ if (params->mbssid_tx_iface) {
-+ ifidx = if_nametoindex(params->mbssid_tx_iface);
-+ if (ifidx <= 0)
-+ return -1;
-+ nla_put_u32(msg,
-+ NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX,
-+ ifidx);
-+ }
-+
-+ if (params->ema)
-+ nla_put_flag(msg, NL80211_MBSSID_CONFIG_ATTR_EMA);
-+
-+ nla_nest_end(msg, config);
-+
-+ if (params->mbssid_elem_count && params->mbssid_elem_len &&
-+ params->mbssid_elem_offset && *params->mbssid_elem_offset) {
-+ u8 i, **offs = params->mbssid_elem_offset;
-+
-+ elems = nla_nest_start(msg, NL80211_ATTR_MBSSID_ELEMS);
-+ if (!elems)
-+ return -1;
-+
-+ for (i = 0; i < params->mbssid_elem_count - 1; i++)
-+ nla_put(msg, i + 1, offs[i + 1] - offs[i], offs[i]);
-+
-+ nla_put(msg, i + 1,
-+ *offs + params->mbssid_elem_len - offs[i],
-+ offs[i]);
-+
-+ nla_nest_end(msg, elems);
-+ }
-+ return 0;
-+}
- #endif /* CONFIG_IEEE80211AX */
-
-
-@@ -4838,6 +4887,9 @@ static int wpa_driver_nl80211_set_ap(void *priv,
- if (params->unsol_bcast_probe_resp_interval &&
- nl80211_unsol_bcast_probe_resp(bss, msg, params) < 0)
- goto fail;
-+
-+ if (nl80211_mbssid(msg, params) < 0)
-+ goto fail;
- #endif /* CONFIG_IEEE80211AX */
-
- #ifdef CONFIG_SAE
-diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index 06a52db..d8078bc 100644
---- a/src/drivers/driver_nl80211_capa.c
-+++ b/src/drivers/driver_nl80211_capa.c
-@@ -857,6 +857,30 @@ err:
- }
-
-
-+static void wiphy_info_mbssid(struct wpa_driver_capa *cap, struct nlattr *attr)
-+{
-+ struct nlattr *config[NL80211_MBSSID_CONFIG_ATTR_MAX + 1];
-+
-+ if (nla_parse_nested(config, NL80211_MBSSID_CONFIG_ATTR_MAX, attr,
-+ NULL))
-+ return;
-+
-+ if (!config[NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES])
-+ return;
-+
-+ cap->mbssid_max_interfaces =
-+ nla_get_u8(config[NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES]);
-+
-+ if (config[NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY])
-+ cap->ema_max_periodicity =
-+ nla_get_u8(config[NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY]);
-+
-+ wpa_printf(MSG_DEBUG,
-+ "multiple_bssid: max interfaces %u, max profile periodicity %u\n",
-+ cap->mbssid_max_interfaces, cap->ema_max_periodicity);
-+}
-+
-+
- static int wiphy_info_handler(struct nl_msg *msg, void *arg)
- {
- struct nlattr *tb[NL80211_ATTR_MAX + 1];
-@@ -1106,6 +1130,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
- if (tb[NL80211_ATTR_WIPHY_SELF_MANAGED_REG])
- capa->flags |= WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY;
-
-+ if (tb[NL80211_ATTR_MBSSID_CONFIG])
-+ wiphy_info_mbssid(capa, tb[NL80211_ATTR_MBSSID_CONFIG]);
-+
- return NL_SKIP;
- }
-
---
-2.18.0
-
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0022-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
similarity index 92%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0022-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
index 5eb131b..d4fd615 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0022-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
@@ -1,7 +1,7 @@
-From 2d97fca26e0c3cd46d1c21cc18d6adc68be60f52 Mon Sep 17 00:00:00 2001
+From f1a0b030838b8e6e6505b74bbabd7af9fa7913dc 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 25/29] hostapd: mtk: Fix ZWDFS issue in BW 160
+Subject: [PATCH 22/28] hostapd: mtk: 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,7 +14,7 @@
1 file changed, 79 insertions(+), 19 deletions(-)
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
-index d082fe0..d688ecb 100644
+index d52a60e..2f5c86e 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)
@@ -96,7 +96,7 @@
}
-@@ -826,8 +834,12 @@ static unsigned int dfs_get_cac_time(struct hostapd_iface *iface,
+@@ -831,8 +839,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;
-@@ -890,7 +902,7 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
+@@ -895,7 +907,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,
-@@ -900,6 +912,16 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
+@@ -905,6 +917,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,
-@@ -908,14 +930,14 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
+@@ -913,14 +935,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 =
-@@ -936,6 +958,35 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
+@@ -941,6 +963,35 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
iface->radar_background.temp_ch = 1;
return 1;
@@ -189,7 +189,7 @@
}
return 0;
-@@ -1185,6 +1236,15 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
+@@ -1190,6 +1241,15 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
hostapd_setup_interface_complete(iface, 0);
iface->cac_started = 0;
}
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0023-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
similarity index 70%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0023-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
index 5872b47..386ce8d 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0023-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
@@ -1,33 +1,33 @@
-From 4c6d148fea7cd1ea380a792d83d2dabe61e9c869 Mon Sep 17 00:00:00 2001
+From 934c90729e00901fe6785727dc9004315725b587 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 26/29] hostapd: mtk: Add vendor for CAPI certification
+Subject: [PATCH 23/28] hostapd: mtk: Add vendor for CAPI certification
commands
---
- hostapd/ctrl_iface.c | 95 +++++++++++++++
- src/ap/ap_drv_ops.c | 21 ++++
- src/ap/ap_drv_ops.h | 3 +
- src/common/mtk_vendor.h | 32 +-----
- src/drivers/driver.h | 22 ++++
- src/drivers/driver_nl80211.c | 185 ++++++++++++++++++++++++++++++
- src/drivers/driver_nl80211.h | 1 +
- src/drivers/driver_nl80211_capa.c | 3 +
- 8 files changed, 332 insertions(+), 30 deletions(-)
+ hostapd/ctrl_iface.c | 95 +++++++++++++++++++++++++++++++
+ src/ap/ap_drv_ops.c | 21 +++++++
+ src/ap/ap_drv_ops.h | 3 +
+ src/common/mtk_vendor.h | 32 +----------
+ src/drivers/driver.h | 22 +++++++
+ src/drivers/driver_nl80211.c | 54 ++++++++++++++++++
+ src/drivers/driver_nl80211.h | 1 +
+ src/drivers/driver_nl80211_capa.c | 3 +
+ 8 files changed, 201 insertions(+), 30 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 87448e7..b0323e7 100644
+index da6e727..79457d7 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -38,6 +38,7 @@
- #endif /* CONFIG_DPP */
- #include "common/wpa_ctrl.h"
- #include "common/ptksa_cache.h"
+@@ -70,6 +70,7 @@
+ #include "ctrl_iface.h"
+ #include "config_file.h"
+
+#include "common/mtk_vendor.h"
- #include "crypto/tls.h"
- #include "drivers/driver.h"
- #include "eapol_auth/eapol_auth_sm.h"
-@@ -3727,6 +3728,96 @@ hostapd_ctrl_iface_get_aval_color_bmp(struct hostapd_data *hapd, char *buf,
+
+ #define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256
+
+@@ -3801,6 +3802,96 @@ hostapd_ctrl_iface_get_aval_color_bmp(struct hostapd_data *hapd, char *buf,
return pos - buf;
}
@@ -124,7 +124,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
-@@ -4298,6 +4389,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4381,6 +4472,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);
@@ -136,10 +136,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 40b9a20..52d0fff 100644
+index 7b686e5..78b52c8 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1100,3 +1100,24 @@ int hostapd_drv_get_aval_bss_color_bmp(struct hostapd_data *hapd, u64 *aval_colo
+@@ -1139,3 +1139,24 @@ 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);
}
@@ -165,10 +165,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 136a3ac..659c3f8 100644
+index 47356ab..bb9fdf7 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -151,6 +151,9 @@ int hostapd_drv_amsdu_ctrl(struct hostapd_data *hapd);
+@@ -157,6 +157,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);
@@ -257,10 +257,10 @@
MTK_VENDOR_ATTR_BSS_COLOR_CTRL_UNSPEC,
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 1bf0cd6..6a46832 100644
+index f9f9fb5..ae692c2 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -4787,6 +4787,28 @@ struct wpa_driver_ops {
+@@ -5062,6 +5062,28 @@ struct wpa_driver_ops {
*
*/
int (*get_aval_color_bmp)(void *priv, u64 *aval_color_bmp);
@@ -290,10 +290,10 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 945ce3e..7fae013 100644
+index 18a5647..730a696 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -74,6 +74,57 @@ enum nlmsgerr_attrs {
+@@ -76,6 +76,57 @@ enum nlmsgerr_attrs {
#endif /* ANDROID */
@@ -351,145 +351,7 @@
static struct nl_sock * nl_create_handle(struct nl_cb *cb, const char *dbg)
{
struct nl_sock *handle;
-@@ -13014,6 +13065,137 @@ fail:
- return -ENOBUFS;
- }
-
-+static int nl80211_ap_wireless(void *priv, u8 sub_vendor_id, int value)
-+{
-+ 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_wireless_vendor_cmd_avail) {
-+ wpa_printf(MSG_INFO,
-+ "nl80211: Driver does not support setting ap wireless 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_WIRELESS_CTRL))
-+ goto fail;
-+
-+ data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
-+ if (!data)
-+ goto fail;
-+
-+ if (sub_vendor_id == MTK_VENDOR_ATTR_WIRELESS_CTRL_BA_BUFFER_SIZE)
-+ nla_put_u16(msg, sub_vendor_id, (u16) value);
-+ else
-+ nla_put_u8(msg, sub_vendor_id, (u8) value);
-+
-+ nla_nest_end(msg, data);
-+ ret = send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
-+ if (ret)
-+ wpa_printf(MSG_ERROR, "Failed to set ap_wireless. ret=%d (%s)", ret, strerror(-ret));
-+
-+ return ret;
-+
-+fail:
-+ nlmsg_free(msg);
-+ return -ENOBUFS;
-+}
-+
-+static int nl80211_ap_rfeatures(void *priv, u8 sub_vendor_id, int value)
-+{
-+ 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_rfeatures_vendor_cmd_avail) {
-+ wpa_printf(MSG_INFO,
-+ "nl80211: Driver does not support setting ap rfeatures 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_RFEATURE_CTRL))
-+ goto fail;
-+
-+ data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
-+ if (!data)
-+ goto fail;
-+
-+ nla_put_u8(msg, sub_vendor_id, (u8) value);
-+
-+ nla_nest_end(msg, data);
-+
-+ ret = send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
-+ if (ret)
-+ wpa_printf(MSG_ERROR, "Failed to set rf_features. ret=%d (%s)", ret, strerror(-ret));
-+
-+ return ret;
-+
-+fail:
-+ nlmsg_free(msg);
-+ return -ENOBUFS;
-+}
-+
-+static int nl80211_ap_trigtype(void *priv, u8 enable, u8 type)
-+{
-+ struct i802_bss *bss = priv;
-+ struct wpa_driver_nl80211_data *drv = bss->drv;
-+ struct nl_msg *msg;
-+ struct nlattr *data, *data2;
-+ int ret;
-+
-+ if (!drv->mtk_rfeatures_vendor_cmd_avail) {
-+ wpa_printf(MSG_INFO,
-+ "nl80211: Driver does not support setting ap rfeatures 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_RFEATURE_CTRL))
-+ goto fail;
-+
-+ data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
-+ if (!data)
-+ goto fail;
-+
-+ data2 = nla_nest_start(msg, MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE_CFG);
-+ if (!data2)
-+ goto fail;
-+
-+ nla_put_u8(msg, MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE_EN, enable);
-+ nla_put_u8(msg, MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TYPE, type);
-+
-+ nla_nest_end(msg, data2);
-+ nla_nest_end(msg, data);
-+
-+ ret = send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
-+ if (ret)
-+ wpa_printf(MSG_ERROR, "Failed to set trig_type. 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",
-@@ -13171,4 +13353,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -14246,4 +14297,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,
@@ -498,10 +360,10 @@
+ .ap_trigtype = nl80211_ap_trigtype,
};
diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
-index 72c7abd..7a03446 100644
+index 190e7a5..49588e6 100644
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
-@@ -187,6 +187,7 @@ struct wpa_driver_nl80211_data {
+@@ -205,6 +205,7 @@ struct wpa_driver_nl80211_data {
unsigned int mtk_ibf_vendor_cmd_avail:1;
unsigned int mtk_wireless_vendor_cmd_avail:1;
unsigned int mtk_bss_color_vendor_cmd_avail:1;
@@ -510,10 +372,10 @@
u64 vendor_scan_cookie;
u64 remain_on_chan_cookie;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index e7c6f39..6f4d029 100644
+index a266926..0674b66 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
-@@ -1095,6 +1095,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
+@@ -1120,6 +1120,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
case MTK_NL80211_VENDOR_SUBCMD_BSS_COLOR_CTRL :
drv->mtk_bss_color_vendor_cmd_avail = 1;
break;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch
deleted file mode 100644
index 57e8b9b..0000000
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch
+++ /dev/null
@@ -1,227 +0,0 @@
-From 87dbbd2f6e02272e2ceee1e30dce60828bf0cc1c Mon Sep 17 00:00:00 2001
-From: Amit Khatri <amit.khatri@mediatek.com>
-Date: Thu, 23 Mar 2023 14:26:46 +0800
-Subject: [PATCH 24/29] hostapd: mtk: Add support for masking EHT capabilities.
-
-If STA want to disable EHT mode connection.
-STA can set
-disable_eht=1 in netowrk bloack of AP configuration.
-e.g.
-wpa_cli -iapcli0 set_network 0 disable_eht=1
-
-It will make EHT capability on driver level.
-
-Signed-off-by: Amit Khatri <amit.khatri@mediatek.com>
----
- src/drivers/driver.h | 8 ++++++++
- src/drivers/driver_nl80211.c | 9 +++++++++
- src/drivers/nl80211_copy.h | 2 ++
- wpa_supplicant/Makefile | 4 ++++
- wpa_supplicant/config.c | 3 +++
- wpa_supplicant/config_file.c | 3 +++
- wpa_supplicant/config_ssid.h | 11 +++++++++++
- wpa_supplicant/sme.c | 4 ++++
- wpa_supplicant/wpa_cli.c | 3 +++
- wpa_supplicant/wpa_supplicant.c | 15 +++++++++++++++
- wpa_supplicant/wpa_supplicant_i.h | 6 ++++++
- 11 files changed, 68 insertions(+)
-
-diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 7f6392f..1bf0cd6 100644
---- a/src/drivers/driver.h
-+++ b/src/drivers/driver.h
-@@ -1151,6 +1151,14 @@ struct wpa_driver_associate_params {
- int disable_he;
- #endif /* CONFIG_HE_OVERRIDES */
-
-+#ifdef CONFIG_EHT_OVERRIDES
-+ /**
-+ * disable_eht - Disable EHT for this connection
-+ */
-+ int disable_eht;
-+#endif /* CONFIG_EHT_OVERRIDES */
-+
-+
- /**
- * req_key_mgmt_offload - Request key management offload for connection
- *
-diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index f9a8763..945ce3e 100644
---- a/src/drivers/driver_nl80211.c
-+++ b/src/drivers/driver_nl80211.c
-@@ -6058,6 +6058,15 @@ static int nl80211_ht_vht_overrides(struct nl_msg *msg,
- }
- #endif /* CONFIG_HE_OVERRIDES */
-
-+#ifdef CONFIG_EHT_OVERRIDES
-+ if (params->disable_eht) {
-+ wpa_printf(MSG_DEBUG, " * EHT disabled");
-+ if (nla_put_flag(msg, NL80211_ATTR_DISABLE_EHT))
-+ return -1;
-+ }
-+#endif /* CONFIG_EHT_OVERRIDES */
-+
-+
- return 0;
- }
-
-diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h
-index 0937752..ce8ee58 100644
---- a/src/drivers/nl80211_copy.h
-+++ b/src/drivers/nl80211_copy.h
-@@ -3175,6 +3175,8 @@ enum nl80211_attrs {
-
- NL80211_ATTR_EHT_CAPABILITY,
-
-+ NL80211_ATTR_DISABLE_EHT,
-+
- /* add attributes here, update the policy in nl80211.c */
-
- __NL80211_ATTR_AFTER_LAST,
-diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
-index ef36b56..40cdb59 100644
---- a/wpa_supplicant/Makefile
-+++ b/wpa_supplicant/Makefile
-@@ -208,6 +208,10 @@ ifdef CONFIG_HE_OVERRIDES
- CFLAGS += -DCONFIG_HE_OVERRIDES
- endif
-
-+ifdef CONFIG_EHT_OVERRIDES
-+CFLAGS += -DCONFIG_EHT_OVERRIDES
-+endif
-+
- ifndef CONFIG_BACKEND
- CONFIG_BACKEND=file
- endif
-diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
-index f9880ed..994ee5e 100644
---- a/wpa_supplicant/config.c
-+++ b/wpa_supplicant/config.c
-@@ -2718,6 +2718,9 @@ static const struct parse_data ssid_fields[] = {
- #ifdef CONFIG_HE_OVERRIDES
- { INT_RANGE(disable_he, 0, 1)},
- #endif /* CONFIG_HE_OVERRIDES */
-+#ifdef CONFIG_EHT_OVERRIDES
-+ { INT_RANGE(disable_eht, 0, 1)},
-+#endif /* CONFIG_EHT_OVERRIDES */
- { INT(ap_max_inactivity) },
- { INT(dtim_period) },
- { INT(beacon_int) },
-diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
-index 24c2998..056b265 100644
---- a/wpa_supplicant/config_file.c
-+++ b/wpa_supplicant/config_file.c
-@@ -881,6 +881,9 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
- #ifdef CONFIG_HE_OVERRIDES
- INT(disable_he);
- #endif /* CONFIG_HE_OVERRIDES */
-+#ifdef CONFIG_EHT_OVERRIDES
-+ INT(disable_eht);
-+#endif /* CONFIG_EHT_OVERRIDES */
-
- #undef STR
- #undef INT
-diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
-index 9a389cc..cc9aa8e 100644
---- a/wpa_supplicant/config_ssid.h
-+++ b/wpa_supplicant/config_ssid.h
-@@ -810,6 +810,17 @@ struct wpa_ssid {
- int disable_he;
- #endif /* CONFIG_HE_OVERRIDES */
-
-+#ifdef CONFIG_EHT_OVERRIDES
-+ /**
-+ * disable_eht - Disable EHT (IEEE 802.11be) for this network
-+ *
-+ * By default, use it if it is available, but this can be configured
-+ * to 1 to have it disabled.
-+ */
-+ int disable_eht;
-+#endif /* CONFIG_EHT_OVERRIDES */
-+
-+
- /**
- * ap_max_inactivity - Timeout in seconds to detect STA's inactivity
- *
-diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
-index 2dad36d..e7aadf6 100644
---- a/wpa_supplicant/sme.c
-+++ b/wpa_supplicant/sme.c
-@@ -2001,6 +2001,10 @@ mscs_fail:
- #ifdef CONFIG_HE_OVERRIDES
- wpa_supplicant_apply_he_overrides(wpa_s, ssid, ¶ms);
- #endif /* CONFIG_HE_OVERRIDES */
-+#ifdef CONFIG_EHT_OVERRIDES
-+ wpa_supplicant_apply_eht_overrides(wpa_s, ssid, ¶ms);
-+#endif /* CONFIG_EHT_OVERRIDES */
-+
- #ifdef CONFIG_IEEE80211R
- if (auth_type == WLAN_AUTH_FT && wpa_s->sme.ft_ies &&
- get_ie(wpa_s->sme.ft_ies, wpa_s->sme.ft_ies_len,
-diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
-index 8443f54..ea251db 100644
---- a/wpa_supplicant/wpa_cli.c
-+++ b/wpa_supplicant/wpa_cli.c
-@@ -1476,6 +1476,9 @@ static const char *network_fields[] = {
- #ifdef CONFIG_HE_OVERRIDES
- "disable_he",
- #endif /* CONFIG_HE_OVERRIDES */
-+#ifdef CONFIG_EHT_OVERRIDES
-+ "disable_eht",
-+#endif /* CONFIG_EHT_OVERRIDES */
- "ap_max_inactivity", "dtim_period", "beacon_int",
- #ifdef CONFIG_MACSEC
- "macsec_policy",
-diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
-index 04c37b1..67c801d 100644
---- a/wpa_supplicant/wpa_supplicant.c
-+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -4084,6 +4084,10 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
- #ifdef CONFIG_HE_OVERRIDES
- wpa_supplicant_apply_he_overrides(wpa_s, ssid, ¶ms);
- #endif /* CONFIG_HE_OVERRIDES */
-+#ifdef CONFIG_EHT_OVERRIDES
-+ wpa_supplicant_apply_eht_overrides(wpa_s, ssid, ¶ms);
-+#endif /* CONFIG_EHT_OVERRIDES */
-+
-
- #ifdef CONFIG_P2P
- /*
-@@ -5879,6 +5883,17 @@ void wpa_supplicant_apply_he_overrides(
- }
- #endif /* CONFIG_HE_OVERRIDES */
-
-+#ifdef CONFIG_EHT_OVERRIDES
-+void wpa_supplicant_apply_eht_overrides(
-+ struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
-+ struct wpa_driver_associate_params *params)
-+{
-+ if (!ssid)
-+ return;
-+
-+ params->disable_eht = ssid->disable_eht;
-+}
-+#endif /* CONFIG_EHT_OVERRIDES */
-
- static int pcsc_reader_init(struct wpa_supplicant *wpa_s)
- {
-diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
-index 3285af3..1140360 100644
---- a/wpa_supplicant/wpa_supplicant_i.h
-+++ b/wpa_supplicant/wpa_supplicant_i.h
-@@ -1576,6 +1576,12 @@ void wpa_supplicant_apply_vht_overrides(
- void wpa_supplicant_apply_he_overrides(
- struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
- struct wpa_driver_associate_params *params);
-+#ifdef CONFIG_EHT_OVERRIDES
-+void wpa_supplicant_apply_eht_overrides(
-+ struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
-+ struct wpa_driver_associate_params *params);
-+#endif /* CONFIG_EHT_OVERRIDES */
-+
-
- int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
- int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,
---
-2.18.0
-
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0024-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
similarity index 91%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0024-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
index eb17c61..72c6355 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0024-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
@@ -1,8 +1,7 @@
-From 11fefdfadbc5bbdf0fcb4d890ea24906a286db43 Mon Sep 17 00:00:00 2001
-From: mtk23888 <dipanshu.mittal@mediatek.com>
-Date: Tue, 4 Apr 2023 13:06:41 +0800
-Subject: [PATCH 27/29] hostapd: mtk: Air Monitor support in hostapd by vendor
- NL
+From c8a55373f42c6149df669ba74ffbff70ec74d8db 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 24/28] hostapd: mtk: Air Monitor support in hostapd by vendor
Signed-off-by: mtk23888 <dipanshu.mittal@mediatek.com>
---
@@ -18,10 +17,10 @@
9 files changed, 352 insertions(+)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index b0323e7..056583c 100644
+index 79457d7..234b800 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -3766,6 +3766,44 @@ hostapd_ctrl_iface_ap_wireless(struct hostapd_data *hapd, char *cmd,
+@@ -3840,6 +3840,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 +65,7 @@
return os_snprintf(buf, buflen, "OK\n");
}
-@@ -3819,6 +3857,75 @@ exit:
+@@ -3893,6 +3931,75 @@ exit:
return os_snprintf(buf, buflen, "OK\n");
}
@@ -142,7 +141,7 @@
static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
char *buf, char *reply,
int reply_size,
-@@ -4393,6 +4500,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4476,6 +4583,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 +155,10 @@
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index aad7aa5..0c4a176 100644
+index dc01ad9..02f8546 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -1613,6 +1613,17 @@ static int hostapd_cli_cmd_get_amsdu(struct wpa_ctrl *ctrl, int argc,
+@@ -1633,6 +1633,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 +176,7 @@
struct hostapd_cli_cmd {
const char *cmd;
-@@ -1823,6 +1834,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
+@@ -1847,6 +1858,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 +188,10 @@
};
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 52d0fff..eafa588 100644
+index 78b52c8..0052a6d 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
-@@ -1121,3 +1121,17 @@ int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type)
+@@ -1160,3 +1160,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 +210,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 659c3f8..28f2a4d 100644
+index bb9fdf7..9d5a23b 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
-@@ -155,6 +155,9 @@ int hostapd_drv_ap_wireless(struct hostapd_data *hapd, u8 sub_vendor_id, int val
+@@ -161,6 +161,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);
@@ -248,10 +247,10 @@
+
#endif /* MTK_VENDOR_H */
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 6a46832..1444cbe 100644
+index ae692c2..cb885f9 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -4809,6 +4809,22 @@ struct wpa_driver_ops {
+@@ -5084,6 +5084,22 @@ struct wpa_driver_ops {
* @type: trigger type
*/
int (*ap_trigtype)(void *priv, u8 enable, u8 type);
@@ -275,10 +274,10 @@
/**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 7fae013..0470079 100644
+index 730a696..088f625 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -125,6 +125,19 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
+@@ -127,6 +127,19 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
[MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT] = {.type = NLA_U8 },
};
@@ -298,7 +297,7 @@
static struct nl_sock * nl_create_handle(struct nl_cb *cb, const char *dbg)
{
struct nl_sock *handle;
-@@ -13196,6 +13209,171 @@ fail:
+@@ -14133,6 +14146,171 @@ fail:
return -ENOBUFS;
}
@@ -470,7 +469,7 @@
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211",
.desc = "Linux nl80211/cfg80211",
-@@ -13356,4 +13534,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+@@ -14300,4 +14478,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,
@@ -478,10 +477,10 @@
+ .amnt_dump = nl80211_amnt_dump,
};
diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
-index 7a03446..7dd88e7 100644
+index 49588e6..e64a12e 100644
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
-@@ -188,6 +188,7 @@ struct wpa_driver_nl80211_data {
+@@ -206,6 +206,7 @@ struct wpa_driver_nl80211_data {
unsigned int mtk_wireless_vendor_cmd_avail:1;
unsigned int mtk_bss_color_vendor_cmd_avail:1;
unsigned int mtk_rfeatures_vendor_cmd_avail:1;
@@ -490,10 +489,10 @@
u64 vendor_scan_cookie;
u64 remain_on_chan_cookie;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index 6f4d029..5c1a35d 100644
+index 0674b66..7b5079b 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
-@@ -1094,6 +1094,8 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
+@@ -1119,6 +1119,8 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
break;
case MTK_NL80211_VENDOR_SUBCMD_BSS_COLOR_CTRL :
drv->mtk_bss_color_vendor_cmd_avail = 1;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0025-hostapd-mtk-Fix-scan-result-updating-issue.patch
similarity index 79%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0025-hostapd-mtk-Fix-scan-result-updating-issue.patch
index 05f6dc8..e00c83b 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0025-hostapd-mtk-Fix-scan-result-updating-issue.patch
@@ -1,7 +1,7 @@
-From 38a7f0f985e33f24f0da234966f560e7136868cf Mon Sep 17 00:00:00 2001
+From b86163db7e137c7a91f77f35bc2d5001177c371e Mon Sep 17 00:00:00 2001
From: Michael Lee <michael-cy.lee@mediatek.com>
Date: Wed, 19 Apr 2023 17:18:33 +0800
-Subject: [PATCH 28/29] hostapd: mtk: Fix scan result updating issue
+Subject: [PATCH 25/28] hostapd: mtk: Fix scan result updating issue
There are no HT capability and operation in beacon of AP operating in
NOHT.
@@ -12,10 +12,10 @@
1 file changed, 4 insertions(+)
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
-index 01ddb13..4e711cf 100644
+index 3bfcf7e..004d4a6 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
-@@ -306,8 +306,12 @@ static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
+@@ -307,8 +307,12 @@ static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
oper = (struct ieee80211_ht_operation *) elems.ht_operation;
if (capab)
dst->ht_capab = le_to_host16(capab->ht_capabilities_info);
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0026-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch
similarity index 80%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0026-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch
index e9e12e9..87e286e 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0026-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch
@@ -1,8 +1,8 @@
-From 38507640ec424ff6c9c552b0f3c2d068a6192146 Mon Sep 17 00:00:00 2001
-From: Michael Lee <michael-cy.lee@mediatek.com>
-Date: Fri, 28 Apr 2023 10:22:58 +0800
-Subject: [PATCH] hostapd: mtk: avoid setting beacon after wpa_supplicant stop
- the AP
+From 1d5dfbffb750a0de15622265dc709524a330f059 Mon Sep 17 00:00:00 2001
+From: Evelyn Tsai <evelyn.tsai@mediatek.com>
+Date: Fri, 12 May 2023 05:21:28 +0800
+Subject: [PATCH 26/28] hostapd: mtk: avoid setting beacon after wpa_supplicant
+ stop the AP
Add a new variable 'stopped_by_supplicant' to indicate the AP
interface is currently stopped by co-locating STA interface.
@@ -19,10 +19,10 @@
6 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 4c5d494..07c97b5 100644
+index 234b800..06d8345 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -192,11 +192,15 @@ static int hostapd_ctrl_iface_update(struct hostapd_data *hapd, char *txt)
+@@ -194,11 +194,15 @@ static int hostapd_ctrl_iface_update(struct hostapd_data *hapd, char *txt)
{
struct hostapd_config * (*config_read_cb)(const char *config_fname);
struct hostapd_iface *iface = hapd->iface;
@@ -39,10 +39,10 @@
iface->interfaces->config_read_cb = config_read_cb;
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
-index 51db23a..187e314 100644
+index ddb5d03..ffa27f3 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
-@@ -2125,7 +2125,8 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
+@@ -2169,7 +2169,8 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
continue;
for (i = 0; i < colocated->num_bss; i++) {
@@ -52,7 +52,7 @@
__ieee802_11_set_beacon(colocated->bss[i]);
}
}
-@@ -2141,6 +2142,7 @@ int ieee802_11_set_beacons(struct hostapd_iface *iface)
+@@ -2185,6 +2186,7 @@ int ieee802_11_set_beacons(struct hostapd_iface *iface)
for (i = 0; i < iface->num_bss; i++) {
if (iface->bss[i]->started &&
@@ -60,7 +60,7 @@
ieee802_11_set_beacon(iface->bss[i]) < 0)
ret = -1;
}
-@@ -2157,6 +2159,7 @@ int ieee802_11_update_beacons(struct hostapd_iface *iface)
+@@ -2201,6 +2203,7 @@ int ieee802_11_update_beacons(struct hostapd_iface *iface)
for (i = 0; i < iface->num_bss; i++) {
if (iface->bss[i]->beacon_set_done && iface->bss[i]->started &&
@@ -83,10 +83,10 @@
err = hostapd_drv_get_survey(hapd, hapd->iface->freq);
diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
-index 2fae590..1ad37c5 100644
+index fed5473..2a8ac9d 100644
--- a/src/ap/ctrl_iface_ap.c
+++ b/src/ap/ctrl_iface_ap.c
-@@ -951,8 +951,10 @@ int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
+@@ -1013,8 +1013,10 @@ int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
struct hostapd_iface *iface = hapd->iface;
int i;
@@ -99,10 +99,10 @@
return 0;
}
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index ef0d6db..b2fd9b9 100644
+index 88eb984..05ddb6f 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -477,6 +477,7 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd)
+@@ -488,6 +488,7 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd)
}
hapd->started = 0;
hapd->beacon_set_done = 0;
@@ -110,7 +110,7 @@
wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface);
hostapd_ubus_free_bss(hapd);
-@@ -1257,6 +1258,7 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first,
+@@ -1290,6 +1291,7 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first,
return -1;
}
hapd->started = 1;
@@ -119,7 +119,7 @@
if (!first || first == -1) {
u8 *addr = hapd->own_addr;
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
-index 093c28a..3b51050 100644
+index c0b3a08..fb8566a 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -190,6 +190,7 @@ struct hostapd_data {
@@ -131,5 +131,5 @@
u8 own_addr[ETH_ALEN];
--
-2.25.1
+2.18.0
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch
similarity index 70%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch
index c2ef3f7..462989c 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch
@@ -1,7 +1,7 @@
-From 1814fca214ecf2a876734af789906e2316172ba8 Mon Sep 17 00:00:00 2001
-From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
-Date: Thu, 30 Mar 2023 17:03:03 +0800
-Subject: [PATCH 29/29] hostapd: mtk: Fix setting wrong seg0 index for 5G
+From f229416c4283da4a2f3b264285a5d97fdc8dcc96 Mon Sep 17 00:00:00 2001
+From: Evelyn Tsai <evelyn.tsai@mediatek.com>
+Date: Fri, 12 May 2023 05:23:00 +0800
+Subject: [PATCH 27/28] hostapd: mtk: Fix setting wrong seg0 index for 5G
center chan 159 BW40
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
@@ -10,10 +10,10 @@
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 51476b8..ae22a2f 100644
+index b9aaa85..9df0b2c 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -1275,7 +1275,8 @@ hostapd_set_oper_centr_freq_seg0_idx(struct hostapd_config *conf,
+@@ -1294,7 +1294,8 @@ hostapd_set_oper_centr_freq_seg0_idx(struct hostapd_config *conf,
#ifdef CONFIG_IEEE80211BE
if (conf->ieee80211be)
conf->eht_oper_centr_freq_seg0_idx = oper_centr_freq_seg0_idx;
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0028-hostapd-mtk-Add-muru-user-number-debug-command.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0028-hostapd-mtk-Add-muru-user-number-debug-command.patch
new file mode 100644
index 0000000..26ea489
--- /dev/null
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0028-hostapd-mtk-Add-muru-user-number-debug-command.patch
@@ -0,0 +1,229 @@
+From a90c24ae2b7558eac18cf92fee6cfaf480233ec2 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 28/28] hostapd: mtk: Add muru user number debug command
+
+---
+ hostapd/ctrl_iface.c | 13 ++++++++++++-
+ src/ap/ap_drv_ops.c | 4 ++--
+ src/ap/ap_drv_ops.h | 2 +-
+ src/ap/hostapd.c | 4 ++--
+ src/common/mtk_vendor.h | 7 +++++++
+ src/drivers/driver.h | 4 ++--
+ src/drivers/driver_nl80211.c | 37 ++++++++++++++++++++++++++++--------
+ 7 files changed, 55 insertions(+), 16 deletions(-)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index 06d8345..2d99647 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -3441,6 +3441,8 @@ hostapd_ctrl_iface_set_edcca(struct hostapd_data *hapd, char *cmd,
+ char *buf, size_t buflen)
+ {
+ char *pos, *config, *value;
++ u8 mode;
++
+ config = cmd;
+ pos = os_strchr(config, ' ');
+ if (pos == NULL)
+@@ -3547,6 +3549,8 @@ hostapd_ctrl_iface_set_mu(struct hostapd_data *hapd, char *cmd,
+ char *buf, size_t buflen)
+ {
+ char *pos, *config, *value;
++ u8 mode;
++
+ config = cmd;
+ pos = os_strchr(config, ' ');
+ if (pos == NULL)
+@@ -3564,13 +3568,20 @@ hostapd_ctrl_iface_set_mu(struct hostapd_data *hapd, char *cmd,
+ return -1;
+ }
+ hapd->iconf->mu_onoff = (u8) mu;
++ mode = MU_CTRL_ONOFF;
++ } else if (os_strcmp(config, "ul_user_cnt") == 0) {
++ mode = MU_CTRL_UL_USER_CNT;
++ wpa_printf(MSG_ERROR, "ul_user_cnt:%d\n", (u8)atoi(value));
++ } else if (os_strcmp(config, "dl_user_cnt") == 0) {
++ mode = MU_CTRL_DL_USER_CNT;
++ wpa_printf(MSG_ERROR, "dl_user_cnt:%d\n", (u8)atoi(value));
+ } else {
+ wpa_printf(MSG_ERROR,
+ "Unsupported parameter %s for SET_MU", config);
+ return -1;
+ }
+
+- if(hostapd_drv_mu_ctrl(hapd) == 0) {
++ if(hostapd_drv_mu_ctrl(hapd, mode, (u8)atoi(value)) == 0) {
+ return os_snprintf(buf, buflen, "OK\n");
+ } else {
+ return -1;
+diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
+index 0052a6d..d5c7b15 100644
+--- a/src/ap/ap_drv_ops.c
++++ b/src/ap/ap_drv_ops.c
+@@ -1079,11 +1079,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);
+ }
+
+-int hostapd_drv_mu_ctrl(struct hostapd_data *hapd)
++int hostapd_drv_mu_ctrl(struct hostapd_data *hapd, u8 mode, u8 val)
+ {
+ if (!hapd->driver || !hapd->driver->mu_ctrl)
+ return 0;
+- return hapd->driver->mu_ctrl(hapd->drv_priv, hapd->iconf->mu_onoff);
++ return hapd->driver->mu_ctrl(hapd->drv_priv, mode, val);
+ }
+
+ 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 9d5a23b..82283e6 100644
+--- a/src/ap/ap_drv_ops.h
++++ b/src/ap/ap_drv_ops.h
+@@ -148,7 +148,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);
+-int hostapd_drv_mu_ctrl(struct hostapd_data *hapd);
++int hostapd_drv_mu_ctrl(struct hostapd_data *hapd, u8 mode, u8 val);
+ 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);
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index 05ddb6f..9bd81d3 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -55,7 +55,7 @@
+ #include "hs20.h"
+ #include "airtime_policy.h"
+ #include "wpa_auth_kay.h"
+-
++#include "common/mtk_vendor.h"
+
+ static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason);
+ #ifdef CONFIG_WEP
+@@ -2398,7 +2398,7 @@ dfs_offload:
+ if (hostapd_drv_configure_edcca_threshold(hapd,
+ hapd->iconf->edcca_threshold) < 0)
+ goto fail;
+- if (hostapd_drv_mu_ctrl(hapd) < 0)
++ if (hostapd_drv_mu_ctrl(hapd, MU_CTRL_ONOFF, hapd->iconf->mu_onoff) < 0)
+ goto fail;
+ 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 74f467c..7dd2fc4 100644
+--- a/src/common/mtk_vendor.h
++++ b/src/common/mtk_vendor.h
+@@ -197,6 +197,8 @@ enum mtk_vendor_attr_mu_ctrl {
+
+ MTK_VENDOR_ATTR_MU_CTRL_ONOFF,
+ MTK_VENDOR_ATTR_MU_CTRL_DUMP,
++ MTK_VENDOR_ATTR_MU_CTRL_OFDMA_MODE,
++ MTK_VENDOR_ATTR_MU_CTRL_OFDMA_VAL,
+
+ /* keep last */
+ NUM_MTK_VENDOR_ATTRS_MU_CTRL,
+@@ -270,4 +272,9 @@ struct amnt_resp_data {
+ struct amnt_data resp_data[0];
+ };
+
++enum {
++ MU_CTRL_ONOFF,
++ MU_CTRL_DL_USER_CNT,
++ MU_CTRL_UL_USER_CNT,
++};
+ #endif /* MTK_VENDOR_H */
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index cb885f9..6cd4dc9 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -5017,11 +5017,11 @@ struct wpa_driver_ops {
+ int (*get_edcca)(void *priv, const u8 mode, u8 *value);
+
+ /**
+- * mu_ctrl - ctrl on off for UL/DL MURU
++ * mu_ctrl - ctrl for UL/DL MURU
+ * @priv: Private driver interface data
+ *
+ */
+- int (*mu_ctrl)(void *priv, u8 mu_onoff);
++ int (*mu_ctrl)(void *priv, u8 mode, u8 val);
+ int (*mu_dump)(void *priv, u8 *mu_onoff);
+
+ /**
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index 088f625..8400e57 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -13295,13 +13295,13 @@ fail:
+
+
+ #ifdef CONFIG_IEEE80211AX
+-static int nl80211_mu_onoff(void *priv, u8 mu_onoff)
++static int nl80211_mu_ctrl(void *priv, u8 mode, u8 val)
+ {
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+ struct nl_msg *msg;
+ struct nlattr *data;
+- int ret;
++ int ret = -ENOBUFS;
+
+ if (!drv->mtk_mu_vendor_cmd_avail) {
+ wpa_printf(MSG_INFO,
+@@ -13312,17 +13312,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) ||
+- !(data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA)) ||
+- nla_put_u8(msg, MTK_VENDOR_ATTR_MU_CTRL_ONOFF, mu_onoff)) {
+- nlmsg_free(msg);
+- return -ENOBUFS;
++ !(data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA)))
++ goto fail;
++
++ switch (mode) {
++ case MU_CTRL_ONOFF:
++ if (nla_put_u8(msg, MTK_VENDOR_ATTR_MU_CTRL_ONOFF, val))
++ goto fail;
++ break;
++ case MU_CTRL_UL_USER_CNT:
++ case MU_CTRL_DL_USER_CNT:
++ if (nla_put_u8(msg, MTK_VENDOR_ATTR_MU_CTRL_OFDMA_MODE, mode) ||
++ nla_put_u8(msg, MTK_VENDOR_ATTR_MU_CTRL_OFDMA_VAL, val))
++ goto fail;
++ break;
++ default:
++ wpa_printf(MSG_ERROR, "nl80211: Wrong mu mode !");
++ ret = -EINVAL;
++ goto fail;
+ }
++
+ nla_nest_end(msg, data);
++
+ ret = send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
+ if(ret){
+- wpa_printf(MSG_ERROR, "Failed to set mu_onoff. ret=%d (%s)", ret, strerror(-ret));
++ wpa_printf(MSG_ERROR, "Failed to set mu_ctrl. ret=%d (%s)", ret, strerror(-ret));
+ }
+ return ret;
++
++fail:
++ nl80211_nlmsg_clear(msg);
++ nlmsg_free(msg);
++ return ret;
+ }
+
+
+@@ -14454,7 +14475,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,
+- .mu_ctrl = nl80211_mu_onoff,
++ .mu_ctrl = nl80211_mu_ctrl,
+ .mu_dump = nl80211_mu_dump,
+ #ifdef CONFIG_DPP
+ .dpp_listen = nl80211_dpp_listen,
+--
+2.18.0
+
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0100-hostapd-mtk-update-eht-operation-elem.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0100-hostapd-mtk-update-eht-operation-elem.patch
deleted file mode 100644
index bbb52ed..0000000
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0100-hostapd-mtk-update-eht-operation-elem.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 6251cf18a39e56eb5b240f967d36a397573e5b3e Mon Sep 17 00:00:00 2001
-From: Peter Chiu <chui-hao.chiu@mediatek.com>
-Date: Fri, 30 Sep 2022 00:16:21 +0800
-Subject: [PATCH] hostapd: mtk: update eht operation elem
-
----
- src/ap/ieee802_11_eht.c | 5 +++--
- src/common/ieee802_11_defs.h | 1 +
- 2 files changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
-index ec36a9e..fc472b8 100644
---- a/src/ap/ieee802_11_eht.c
-+++ b/src/ap/ieee802_11_eht.c
-@@ -183,7 +183,7 @@ u8 * hostapd_eid_eht_operation(struct hostapd_data *hapd, u8 *eid)
- return eid;
-
- *pos++ = WLAN_EID_EXTENSION;
-- *pos++ = 5;
-+ *pos++ = 9;
- *pos++ = WLAN_EID_EXT_EHT_OPERATION;
-
- oper = (struct ieee80211_eht_operation *) pos;
-@@ -224,10 +224,11 @@ u8 * hostapd_eid_eht_operation(struct hostapd_data *hapd, u8 *eid)
- return eid;
- }
-
-+ oper->mcs_nss_set = 0x11111111;
- oper->oper_info.ccfs0 = seg0 ? seg0 : hapd->iconf->channel;
- oper->oper_info.ccfs1 = seg1;
-
-- return pos + 4;
-+ return pos + 8;
- }
-
-
-diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
-index 0bbbca9..f7ec11b 100644
---- a/src/common/ieee802_11_defs.h
-+++ b/src/common/ieee802_11_defs.h
-@@ -2440,6 +2440,7 @@ struct ieee80211_eht_oper_info {
- /* Figure 9-1002a: EHT Operation element format */
- struct ieee80211_eht_operation {
- u8 oper_params; /* EHT Operation Parameters: EHT_OPER_* bits */
-+ le32 mcs_nss_set;
- struct ieee80211_eht_oper_info oper_info; /* 0 or 3 or 5 octets */
- } STRUCT_PACKED;
-
---
-2.18.0
-
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0100-hostapd-mtk-update-eht-operation-element.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0100-hostapd-mtk-update-eht-operation-element.patch
new file mode 100644
index 0000000..d8cdf15
--- /dev/null
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0100-hostapd-mtk-update-eht-operation-element.patch
@@ -0,0 +1,29 @@
+From ea9c7bda66bcd7819e106d5f672345b941365d15 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 100/103] hostapd: mtk: 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 6ebe0f9..c14c5e2 100644
+--- a/src/ap/ieee802_11_eht.c
++++ b/src/ap/ieee802_11_eht.c
+@@ -214,9 +214,9 @@ 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] = 0x00;
+- oper->basic_eht_mcs_nss_set[2] = 0x00;
+- oper->basic_eht_mcs_nss_set[3] = 0x00;
++ 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 (is_6ghz_op_class(conf->op_class))
+ chwidth = op_class_to_ch_width(conf->op_class);
+--
+2.18.0
+
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0101-hostapd-mtk-Fix-CCA-issue.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0101-hostapd-mtk-Fix-CCA-issue.patch
new file mode 100644
index 0000000..9b46d70
--- /dev/null
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0101-hostapd-mtk-Fix-CCA-issue.patch
@@ -0,0 +1,97 @@
+From 39a0dd44653f12ce13af68de81bfae683669623a Mon Sep 17 00:00:00 2001
+From: Evelyn Tsai <evelyn.tsai@mediatek.com>
+Date: Thu, 11 May 2023 14:08:59 +0800
+Subject: [PATCH 101/103] hostapd: mtk: Fix CCA issue
+
+When receiving CCA related nl80211 command, hostapd used to work on
+struct wpa_driver_nl80211_data, whose ctx always points to
+hostpad_iface->bss[0]. However, CCA command is sent on per-BSS based.
+This patch makes hostapd handle CCA related commands on per-BSS based.
+
+Signed-off-by: Michael Lee <michael-cy.lee@mediatek.com>
+---
+ src/drivers/driver_nl80211_event.c | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
+index 67d9ce2..bcce9f5 100644
+--- a/src/drivers/driver_nl80211_event.c
++++ b/src/drivers/driver_nl80211_event.c
+@@ -3418,7 +3418,7 @@ static void nl80211_assoc_comeback(struct wpa_driver_nl80211_data *drv,
+
+ #ifdef CONFIG_IEEE80211AX
+
+-static void nl80211_obss_color_collision(struct wpa_driver_nl80211_data *drv,
++static void nl80211_obss_color_collision(struct i802_bss *bss,
+ struct nlattr *tb[])
+ {
+ union wpa_event_data data;
+@@ -3432,37 +3432,37 @@ static void nl80211_obss_color_collision(struct wpa_driver_nl80211_data *drv,
+
+ wpa_printf(MSG_DEBUG, "nl80211: BSS color collision - bitmap %08llx",
+ (long long unsigned int) data.bss_color_collision.bitmap);
+- wpa_supplicant_event(drv->ctx, EVENT_BSS_COLOR_COLLISION, &data);
++ wpa_supplicant_event(bss->ctx, EVENT_BSS_COLOR_COLLISION, &data);
+ }
+
+
+ static void
+-nl80211_color_change_announcement_started(struct wpa_driver_nl80211_data *drv)
++nl80211_color_change_announcement_started(struct i802_bss *bss)
+ {
+ union wpa_event_data data = {};
+
+ wpa_printf(MSG_DEBUG, "nl80211: CCA started");
+- wpa_supplicant_event(drv->ctx, EVENT_CCA_STARTED_NOTIFY, &data);
++ wpa_supplicant_event(bss->ctx, EVENT_CCA_STARTED_NOTIFY, &data);
+ }
+
+
+ static void
+-nl80211_color_change_announcement_aborted(struct wpa_driver_nl80211_data *drv)
++nl80211_color_change_announcement_aborted(struct i802_bss *bss)
+ {
+ union wpa_event_data data = {};
+
+ wpa_printf(MSG_DEBUG, "nl80211: CCA aborted");
+- wpa_supplicant_event(drv->ctx, EVENT_CCA_ABORTED_NOTIFY, &data);
++ wpa_supplicant_event(bss->ctx, EVENT_CCA_ABORTED_NOTIFY, &data);
+ }
+
+
+ static void
+-nl80211_color_change_announcement_completed(struct wpa_driver_nl80211_data *drv)
++nl80211_color_change_announcement_completed(struct i802_bss *bss)
+ {
+ union wpa_event_data data = {};
+
+ wpa_printf(MSG_DEBUG, "nl80211: CCA completed");
+- wpa_supplicant_event(drv->ctx, EVENT_CCA_NOTIFY, &data);
++ wpa_supplicant_event(bss->ctx, EVENT_CCA_NOTIFY, &data);
+ }
+
+ #endif /* CONFIG_IEEE80211AX */
+@@ -3724,16 +3724,16 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
+ break;
+ #ifdef CONFIG_IEEE80211AX
+ case NL80211_CMD_OBSS_COLOR_COLLISION:
+- nl80211_obss_color_collision(drv, tb);
++ nl80211_obss_color_collision(bss, tb);
+ break;
+ case NL80211_CMD_COLOR_CHANGE_STARTED:
+- nl80211_color_change_announcement_started(drv);
++ nl80211_color_change_announcement_started(bss);
+ break;
+ case NL80211_CMD_COLOR_CHANGE_ABORTED:
+- nl80211_color_change_announcement_aborted(drv);
++ nl80211_color_change_announcement_aborted(bss);
+ break;
+ case NL80211_CMD_COLOR_CHANGE_COMPLETED:
+- nl80211_color_change_announcement_completed(drv);
++ nl80211_color_change_announcement_completed(bss);
+ break;
+ #endif /* CONFIG_IEEE80211AX */
+ default:
+--
+2.18.0
+
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0102-hostapd-mtk-Fix-unexpected-AP-beacon-state-transitio.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0102-hostapd-mtk-Fix-unexpected-AP-beacon-state-transitio.patch
new file mode 100644
index 0000000..4075531
--- /dev/null
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0102-hostapd-mtk-Fix-unexpected-AP-beacon-state-transitio.patch
@@ -0,0 +1,37 @@
+From 097b204ffed838a4bbf7649fb23310f64ace22ad Mon Sep 17 00:00:00 2001
+From: Evelyn Tsai <evelyn.tsai@mediatek.com>
+Date: Thu, 11 May 2023 14:12:44 +0800
+Subject: [PATCH 102/103] hostapd: mtk: Fix unexpected AP beacon state
+ transition
+
+When AP fails setting the beacon, it assigns bss->beacon_set to 0 no
+matter what the error number is.
+However, in the case that the error number is -EBUSY, the driver might
+not free the beacon and expect a later beacon re-setting. If hostapd set
+a new beacon under this case, driver will return -EALREADY.
+This patch checks the error number after hostapd fails setting the
+beacon. If the error number is -EBUSY, bss->beacon_set will not be
+assigned to 0.
+
+Signed-off-by: Michael Lee <michael-cy.lee@mediatek.com>
+---
+ src/drivers/driver_nl80211.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index 8400e57..ccfc2d0 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -5126,7 +5126,8 @@ static int wpa_driver_nl80211_set_ap(void *priv,
+ ret, strerror(-ret));
+ if (!bss->flink->beacon_set)
+ ret = 0;
+- bss->flink->beacon_set = 0;
++ if (ret != -EBUSY)
++ bss->flink->beacon_set = 0;
+ } else {
+ bss->flink->beacon_set = 1;
+ nl80211_set_bss(bss, params->cts_protect, params->preamble,
+--
+2.18.0
+
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0103-hostapd-mtk-Add-BW320-channel-switch-command.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0103-hostapd-mtk-Add-BW320-channel-switch-command.patch
new file mode 100644
index 0000000..5d38688
--- /dev/null
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0103-hostapd-mtk-Add-BW320-channel-switch-command.patch
@@ -0,0 +1,107 @@
+From e61b734969cd94121434adef85f241f835aa1f5a Mon Sep 17 00:00:00 2001
+From: Evelyn Tsai <evelyn.tsai@mediatek.com>
+Date: Thu, 11 May 2023 14:16:57 +0800
+Subject: [PATCH 103/103] hostapd: mtk: Add BW320 channel switch command
+
+---
+ hostapd/ctrl_iface.c | 32 +++++++++++++++++++++++++++++++
+ src/ap/drv_callbacks.c | 3 ++-
+ src/ap/hostapd.c | 4 ++++
+ src/drivers/driver_nl80211_capa.c | 2 ++
+ 4 files changed, 40 insertions(+), 1 deletion(-)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index 2d99647..274d079 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -2713,6 +2713,38 @@ static int hostapd_ctrl_check_freq_params(struct hostapd_freq_params *params,
+ return -1;
+ }
+ break;
++ case 320:
++ if (!params->center_freq1 || params->center_freq2 ||
++ !params->sec_channel_offset)
++ return -1;
++
++ switch (params->sec_channel_offset) {
++ case 1:
++ if (params->freq + 150 != params->center_freq1 &&
++ params->freq + 110 != params->center_freq1 &&
++ params->freq + 70 != params->center_freq1 &&
++ params->freq + 30 != params->center_freq1 &&
++ params->freq - 10 != params->center_freq1 &&
++ params->freq - 50 != params->center_freq1 &&
++ params->freq - 90 != params->center_freq1 &&
++ params->freq - 130 != params->center_freq1)
++ return -1;
++ break;
++ case -1:
++ if (params->freq + 130 != params->center_freq1 &&
++ params->freq + 90 != params->center_freq1 &&
++ params->freq + 50 != params->center_freq1 &&
++ params->freq + 10 != params->center_freq1 &&
++ params->freq - 30 != params->center_freq1 &&
++ params->freq - 70 != params->center_freq1 &&
++ params->freq - 110 != params->center_freq1 &&
++ params->freq - 150 != params->center_freq1)
++ return -1;
++ break;
++ default:
++ return -1;
++ }
++ break;
+ default:
+ return -1;
+ }
+diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
+index c1f9a0e..dccbdb6 100644
+--- a/src/ap/drv_callbacks.c
++++ b/src/ap/drv_callbacks.c
+@@ -988,7 +988,8 @@ void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht,
+ hapd->iconf->ch_switch_eht_config = 0;
+
+ if (width == CHAN_WIDTH_40 || width == CHAN_WIDTH_80 ||
+- width == CHAN_WIDTH_80P80 || width == CHAN_WIDTH_160)
++ width == CHAN_WIDTH_80P80 || width == CHAN_WIDTH_160 ||
++ width == CHAN_WIDTH_320)
+ hapd->iconf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET;
+ else if (width == CHAN_WIDTH_20 || width == CHAN_WIDTH_20_NOHT)
+ hapd->iconf->ht_capab &= ~HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET;
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index 9bd81d3..6fd5947 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -3705,6 +3705,7 @@ static int hostapd_change_config_freq(struct hostapd_data *hapd,
+ case 40:
+ case 80:
+ case 160:
++ case 320:
+ conf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET;
+ break;
+ default:
+@@ -3777,6 +3778,9 @@ static int hostapd_fill_csa_settings(struct hostapd_data *hapd,
+ case 160:
+ bandwidth = CONF_OPER_CHWIDTH_160MHZ;
+ break;
++ case 320:
++ bandwidth = CONF_OPER_CHWIDTH_320MHZ;
++ break;
+ default:
+ bandwidth = CONF_OPER_CHWIDTH_USE_HT;
+ break;
+diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
+index 7b5079b..1a53ade 100644
+--- a/src/drivers/driver_nl80211_capa.c
++++ b/src/drivers/driver_nl80211_capa.c
+@@ -1701,6 +1701,8 @@ static void phy_info_freq(struct hostapd_hw_modes *mode,
+ chan->allowed_bw &= ~HOSTAPD_CHAN_WIDTH_80;
+ if (tb_freq[NL80211_FREQUENCY_ATTR_NO_160MHZ])
+ chan->allowed_bw &= ~HOSTAPD_CHAN_WIDTH_160;
++ if (tb_freq[NL80211_FREQUENCY_ATTR_NO_320MHZ])
++ chan->allowed_bw &= ~HOSTAPD_CHAN_WIDTH_320;
+
+ if (tb_freq[NL80211_FREQUENCY_ATTR_DFS_STATE]) {
+ enum nl80211_dfs_state state =
+--
+2.18.0
+
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/patches.inc b/recipes-wifi/hostapd/files/patches-2.10.3/patches.inc
index 5aaec3e..a71c43f 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/patches.inc
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/patches.inc
@@ -16,7 +16,7 @@
file://140-tests-Makefile-make-run-tests-with-CONFIG_TLS.patch \
file://150-add-NULL-checks-encountered-during-tests-hwsim.patch \
file://160-dpp_pkex-EC-point-mul-w-value-prime.patch \
- file://170-DPP-fix-memleak-of-intro.peer_key.patch \
+ file://170-wpa_supplicant-fix-compiling-without-IEEE8021X_EAPOL.patch \
file://200-multicall.patch \
file://300-noscan.patch \
file://301-mesh-noscan.patch \
@@ -39,7 +39,6 @@
file://432-missing-typedef.patch \
file://450-scan_wait.patch;apply=no \
file://460-wpa_supplicant-add-new-config-params-to-be-used-with.patch \
- file://461-driver_nl80211-use-new-parameters-during-ibss-join.patch \
file://463-add-mcast_rate-to-11s.patch \
file://464-fix-mesh-obss-check.patch \
file://465-hostapd-config-support-random-BSS-color.patch \
@@ -59,9 +58,7 @@
file://751-qos_map_ignore_when_unsupported.patch \
file://760-dynamic_own_ip.patch \
file://761-shared_das_port.patch \
- file://800-acs-don-t-select-indoor-channel-on-outdoor-operation.patch \
file://990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch \
- file://992-openssl-include-rsa.patch \
file://mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch \
file://mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch \
file://mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch \
@@ -75,22 +72,23 @@
file://mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch \
file://mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch \
file://mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch \
- file://mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch \
- file://mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch \
- file://mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch \
- file://mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch \
- file://mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch \
- file://mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch \
- file://mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch \
- file://mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch \
- file://mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch \
- file://mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch \
- file://mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch \
- file://mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch \
- file://mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch \
- file://mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch \
- file://mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch \
- file://mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch \
- file://mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch \
- file://mtk-0100-hostapd-mtk-update-eht-operation-elem.patch \
+ file://mtk-0014-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch \
+ file://mtk-0015-hostapd-mtk-6G-band-does-not-require-DFS.patch \
+ file://mtk-0016-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch \
+ file://mtk-0017-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch \
+ file://mtk-0018-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch \
+ file://mtk-0019-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch \
+ file://mtk-0020-hostapd-mtk-Add-available-color-bitmap.patch \
+ file://mtk-0021-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch \
+ file://mtk-0022-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch \
+ file://mtk-0023-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch \
+ file://mtk-0024-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch \
+ file://mtk-0025-hostapd-mtk-Fix-scan-result-updating-issue.patch \
+ file://mtk-0026-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch \
+ file://mtk-0027-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch \
+ file://mtk-0028-hostapd-mtk-Add-muru-user-number-debug-command.patch \
+ file://mtk-0100-hostapd-mtk-update-eht-operation-element.patch \
+ file://mtk-0101-hostapd-mtk-Fix-CCA-issue.patch \
+ file://mtk-0102-hostapd-mtk-Fix-unexpected-AP-beacon-state-transitio.patch \
+ file://mtk-0103-hostapd-mtk-Add-BW320-channel-switch-command.patch \
"
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0030-hostapd-mtk-Add-muru-user-number-debug-command.patch b/recipes-wifi/hostapd/files/patches/mtk-0030-hostapd-mtk-Add-muru-user-number-debug-command.patch
new file mode 100644
index 0000000..c405a4d
--- /dev/null
+++ b/recipes-wifi/hostapd/files/patches/mtk-0030-hostapd-mtk-Add-muru-user-number-debug-command.patch
@@ -0,0 +1,220 @@
+From 985f076026a2e4d7083272da975601be9b74d806 Mon Sep 17 00:00:00 2001
+From: MeiChia Chiu <meichia.chiu@mediatek.com>
+Date: Thu, 27 Apr 2023 15:28:43 +0800
+Subject: [PATCH] hostapd: mtk: Add muru user number debug command
+
+---
+ hostapd/ctrl_iface.c | 11 ++++++++++-
+ src/ap/ap_drv_ops.c | 4 ++--
+ src/ap/ap_drv_ops.h | 2 +-
+ src/ap/hostapd.c | 4 ++--
+ src/common/mtk_vendor.h | 7 +++++++
+ src/drivers/driver.h | 4 ++--
+ src/drivers/driver_nl80211.c | 37 ++++++++++++++++++++++++++++--------
+ 7 files changed, 53 insertions(+), 16 deletions(-)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index becb09c..3391015 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -3473,6 +3473,8 @@ hostapd_ctrl_iface_set_mu(struct hostapd_data *hapd, char *cmd,
+ char *buf, size_t buflen)
+ {
+ char *pos, *config, *value;
++ u8 mode;
++
+ config = cmd;
+ pos = os_strchr(config, ' ');
+ if (pos == NULL)
+@@ -3490,13 +3492,20 @@ hostapd_ctrl_iface_set_mu(struct hostapd_data *hapd, char *cmd,
+ return -1;
+ }
+ hapd->iconf->mu_onoff = (u8) mu;
++ mode = MU_CTRL_ONOFF;
++ } else if (os_strcmp(config, "ul_user_cnt") == 0) {
++ mode = MU_CTRL_UL_USER_CNT;
++ wpa_printf(MSG_ERROR, "ul_user_cnt:%d\n", (u8)atoi(value));
++ } else if (os_strcmp(config, "dl_user_cnt") == 0) {
++ mode = MU_CTRL_DL_USER_CNT;
++ wpa_printf(MSG_ERROR, "dl_user_cnt:%d\n", (u8)atoi(value));
+ } else {
+ wpa_printf(MSG_ERROR,
+ "Unsupported parameter %s for SET_MU", config);
+ return -1;
+ }
+
+- if(hostapd_drv_mu_ctrl(hapd) == 0) {
++ if(hostapd_drv_mu_ctrl(hapd, mode, (u8)atoi(value)) == 0) {
+ return os_snprintf(buf, buflen, "OK\n");
+ } else {
+ return -1;
+diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
+index eafa588..bf64b77 100644
+--- a/src/ap/ap_drv_ops.c
++++ b/src/ap/ap_drv_ops.c
+@@ -1040,11 +1040,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);
+ }
+
+-int hostapd_drv_mu_ctrl(struct hostapd_data *hapd)
++int hostapd_drv_mu_ctrl(struct hostapd_data *hapd, u8 mode, u8 val)
+ {
+ if (!hapd->driver || !hapd->driver->mu_ctrl)
+ return 0;
+- return hapd->driver->mu_ctrl(hapd->drv_priv, hapd->iconf->mu_onoff);
++ return hapd->driver->mu_ctrl(hapd->drv_priv, mode, val);
+ }
+
+ 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 28f2a4d..2a89b99 100644
+--- a/src/ap/ap_drv_ops.h
++++ b/src/ap/ap_drv_ops.h
+@@ -142,7 +142,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);
+-int hostapd_drv_mu_ctrl(struct hostapd_data *hapd);
++int hostapd_drv_mu_ctrl(struct hostapd_data *hapd, u8 mode, u8 val);
+ 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);
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index b2fd9b9..49a1d30 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -55,7 +55,7 @@
+ #include "hs20.h"
+ #include "airtime_policy.h"
+ #include "wpa_auth_kay.h"
+-
++#include "common/mtk_vendor.h"
+
+ static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason);
+ #ifdef CONFIG_WEP
+@@ -2360,7 +2360,7 @@ dfs_offload:
+ if (hostapd_drv_configure_edcca_threshold(hapd,
+ hapd->iconf->edcca_threshold) < 0)
+ goto fail;
+- if (hostapd_drv_mu_ctrl(hapd) < 0)
++ if (hostapd_drv_mu_ctrl(hapd, MU_CTRL_ONOFF, hapd->iconf->mu_onoff) < 0)
+ goto fail;
+ 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 74f467c..7dd2fc4 100644
+--- a/src/common/mtk_vendor.h
++++ b/src/common/mtk_vendor.h
+@@ -197,6 +197,8 @@ enum mtk_vendor_attr_mu_ctrl {
+
+ MTK_VENDOR_ATTR_MU_CTRL_ONOFF,
+ MTK_VENDOR_ATTR_MU_CTRL_DUMP,
++ MTK_VENDOR_ATTR_MU_CTRL_OFDMA_MODE,
++ MTK_VENDOR_ATTR_MU_CTRL_OFDMA_VAL,
+
+ /* keep last */
+ NUM_MTK_VENDOR_ATTRS_MU_CTRL,
+@@ -270,4 +272,9 @@ struct amnt_resp_data {
+ struct amnt_data resp_data[0];
+ };
+
++enum {
++ MU_CTRL_ONOFF,
++ MU_CTRL_DL_USER_CNT,
++ MU_CTRL_UL_USER_CNT,
++};
+ #endif /* MTK_VENDOR_H */
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index 1444cbe..01281a1 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -4742,11 +4742,11 @@ struct wpa_driver_ops {
+ int (*get_edcca)(void *priv, const u8 mode, u8 *value);
+
+ /**
+- * mu_ctrl - ctrl on off for UL/DL MURU
++ * mu_ctrl - ctrl for UL/DL MURU
+ * @priv: Private driver interface data
+ *
+ */
+- int (*mu_ctrl)(void *priv, u8 mu_onoff);
++ int (*mu_ctrl)(void *priv, u8 mode, u8 val);
+ int (*mu_dump)(void *priv, u8 *mu_onoff);
+
+ /**
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index 0470079..3d71405 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -12430,13 +12430,13 @@ fail:
+
+
+ #ifdef CONFIG_IEEE80211AX
+-static int nl80211_mu_onoff(void *priv, u8 mu_onoff)
++static int nl80211_mu_ctrl(void *priv, u8 mode, u8 val)
+ {
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+ struct nl_msg *msg;
+ struct nlattr *data;
+- int ret;
++ int ret = -ENOBUFS;
+
+ if (!drv->mtk_mu_vendor_cmd_avail) {
+ wpa_printf(MSG_INFO,
+@@ -12447,17 +12447,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) ||
+- !(data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA)) ||
+- nla_put_u8(msg, MTK_VENDOR_ATTR_MU_CTRL_ONOFF, mu_onoff)) {
+- nlmsg_free(msg);
+- return -ENOBUFS;
++ !(data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA)))
++ goto fail;
++
++ switch (mode) {
++ case MU_CTRL_ONOFF:
++ if (nla_put_u8(msg, MTK_VENDOR_ATTR_MU_CTRL_ONOFF, val))
++ goto fail;
++ break;
++ case MU_CTRL_UL_USER_CNT:
++ case MU_CTRL_DL_USER_CNT:
++ if (nla_put_u8(msg, MTK_VENDOR_ATTR_MU_CTRL_OFDMA_MODE, mode) ||
++ nla_put_u8(msg, MTK_VENDOR_ATTR_MU_CTRL_OFDMA_VAL, val))
++ goto fail;
++ break;
++ default:
++ wpa_printf(MSG_ERROR, "nl80211: Wrong mu mode !");
++ ret = -EINVAL;
++ goto fail;
+ }
++
+ nla_nest_end(msg, data);
++
+ ret = send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
+ if(ret){
+- wpa_printf(MSG_ERROR, "Failed to set mu_onoff. ret=%d (%s)", ret, strerror(-ret));
++ wpa_printf(MSG_ERROR, "Failed to set mu_ctrl. ret=%d (%s)", ret, strerror(-ret));
+ }
+ return ret;
++
++fail:
++ nl80211_nlmsg_clear(msg);
++ nlmsg_free(msg);
++ return ret;
+ }
+
+
+@@ -13512,7 +13533,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,
+- .mu_ctrl = nl80211_mu_onoff,
++ .mu_ctrl = nl80211_mu_ctrl,
+ .mu_dump = nl80211_mu_dump,
+ #ifdef CONFIG_DPP
+ .dpp_listen = nl80211_dpp_listen,
+--
+2.39.0
+
diff --git a/recipes-wifi/hostapd/files/patches/patches.inc b/recipes-wifi/hostapd/files/patches/patches.inc
index d7cc2b2..13cb2d5 100644
--- a/recipes-wifi/hostapd/files/patches/patches.inc
+++ b/recipes-wifi/hostapd/files/patches/patches.inc
@@ -92,4 +92,5 @@
file://mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch \
file://mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch \
file://mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch \
+ file://mtk-0030-hostapd-mtk-Add-muru-user-number-debug-command.patch \
"