[rdkb][common][bsp][Refactor and sync wifi from openwrt]
[Description]
5b228d80 [MAC80211][WiFi6][mt76][Fix NULL pointer access when setting QoS map]
7d86a237 [MAC80211][WiFi6][mt76][Fix merlin 5g can't receive rx data at two pcie mode]
0ffd8c9d [MAC80211][WiFi6][mt76][Fix runtime change security mode to open issue]
e20ea87d [MAC80211][misc][Separate MT7992 & MT7996 firmware to reduce image size]
0d70c868 [MAC80211][WiFi6][hostapd][Fix failure of BSS-wise QoS-map setting]
ccf5e237 [MAC80211][Rebase Patch][Change QoS-map setting method to callback function]
81505830 [MAC80211][WiFi6][mt76][Change QoS-map setting method to callback function]
53322d00 [MAC80211][Rebase Patch][Add callback function to set QoS map in HW]
c36b2f81 [MAC80211][WiFi6][core][Add callback function to set QoS map in HW]
c544feaf [MAC80211][WiFi7][Misc][Fix build fail because of wifi-scripts package and iw version]
b471f43a [MAC80211][WiFi7][app][convert mwtcl cmd to mt76 internal debug cmd]
dbd53909 [MAC80211][WiFi6][Misc][Fix Cheetah build fail]
8e6f43e2 [MAC80211][WiFi7][misc][use repo to maintain wifi-scripts]
e497c9f7 [MAC80211][WiFi7][misc][Fix legacy non-EHT bss + MLD issue]
56c2223c [MAC80211][WiFi7][app][convert iwpriv/mwctl command with link_id]
8d1960db [MAC80211][WiFi7][misc][Fix wrong path for per-radio antenna config patch]
c587263f [MAC80211][WiFi7][misc][Add per-radio antenna config support]
[Release-log]
Change-Id: I4b068cc1b5717c4927daaeaac04dca6642454c97
diff --git a/recipes-wifi/iw/iw_5.19.bb b/recipes-wifi/iw/iw_6.9.bb
similarity index 93%
rename from recipes-wifi/iw/iw_5.19.bb
rename to recipes-wifi/iw/iw_6.9.bb
index ac009b2..fb95959 100644
--- a/recipes-wifi/iw/iw_5.19.bb
+++ b/recipes-wifi/iw/iw_6.9.bb
@@ -14,7 +14,7 @@
file://separate-objdir.patch \
"
-SRC_URI[sha256sum] = "f167bbe947dd53bb9ebc0c1dcef5db6ad73ac1d6084f2c6f9376c5c360cc4d4e"
+SRC_URI[sha256sum] = "3f2db22ad41c675242b98ae3942dbf3112548c60a42ff739210f2de4e98e4894"
PATCH_SRC = "${@bb.utils.contains('DISTRO_FEATURES', 'wifi_eht', 'patches-mlo', 'patches', d)}"
diff --git a/recipes-wifi/iw/patches-mlo/0001-iw-info-print-PMSR-capabilities.patch b/recipes-wifi/iw/patches-mlo/0001-iw-info-print-PMSR-capabilities.patch
deleted file mode 100644
index 9169bd9..0000000
--- a/recipes-wifi/iw/patches-mlo/0001-iw-info-print-PMSR-capabilities.patch
+++ /dev/null
@@ -1,156 +0,0 @@
-From ad2f2f8a2c0b4d450a53c24d28769cd187071dee Mon Sep 17 00:00:00 2001
-From: Jaewan Kim <jaewan@google.com>
-Date: Tue, 11 Oct 2022 14:34:05 +0900
-Subject: [PATCH 01/28] iw: info: print PMSR capabilities
-
-Print PMSR and FTM capabilities if any.
-
-Signed-off-by: Jaewan Kim <jaewan@google.com>
-Link: https://lore.kernel.org/r/20221011053405.332375-1-jaewan@google.com
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- info.c | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 121 insertions(+)
-
-diff --git a/info.c b/info.c
-index 21ed07b..eb257f8 100644
---- a/info.c
-+++ b/info.c
-@@ -169,6 +169,124 @@ static void ext_feat_print(enum nl80211_ext_feature_index idx)
- }
- }
-
-+static void __print_ftm_capability(struct nlattr *ftm_capa)
-+{
-+#define PRINT_FTM_FLAG(T, NAME) \
-+ do { \
-+ if (T[NL80211_PMSR_FTM_CAPA_ATTR_##NAME]) \
-+ printf("\t\t\t" #NAME "\n"); \
-+ } while (0)
-+
-+#define PRINT_FTM_U8(T, NAME) \
-+ do { \
-+ if (T[NL80211_PMSR_FTM_CAPA_ATTR_##NAME]) \
-+ printf("\t\t\t" #NAME ": %d\n", \
-+ nla_get_u8(T[NL80211_PMSR_FTM_CAPA_ATTR_##NAME])); \
-+ } while (0)
-+
-+ struct nlattr *tb[NL80211_PMSR_FTM_CAPA_ATTR_MAX + 1];
-+ int ret;
-+
-+ printf("\t\tFTM (Fine time measurement or Flight time measurement)\n");
-+
-+ ret = nla_parse_nested(tb, NL80211_PMSR_FTM_CAPA_ATTR_MAX, ftm_capa,
-+ NULL);
-+ if (ret)
-+ return;
-+
-+ if (tb[NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES]) {
-+#define PRINT_PREAMBLE(P, V) \
-+ do { \
-+ if (P | NL80211_PREAMBLE_##V) \
-+ printf(" " #V); \
-+ } while (0)
-+
-+ uint32_t preambles =
-+ nla_get_u32(tb[NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES]);
-+ printf("\t\t\tPreambles:");
-+
-+ PRINT_PREAMBLE(preambles, LEGACY);
-+ PRINT_PREAMBLE(preambles, HT);
-+ PRINT_PREAMBLE(preambles, VHT);
-+ PRINT_PREAMBLE(preambles, DMG);
-+ printf("\n");
-+#undef PRINT_PREAMBLE
-+ }
-+ if (tb[NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS]) {
-+#define PRINT_BANDWIDTH(B, V) \
-+ do { \
-+ if (B | NL80211_CHAN_WIDTH_##V) \
-+ printf(" " #V); \
-+ } while (0)
-+
-+ uint32_t bandwidth =
-+ nla_get_u32(tb[NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS]);
-+ printf("\t\t\tBandwidth:");
-+ PRINT_BANDWIDTH(bandwidth, 20_NOHT);
-+ PRINT_BANDWIDTH(bandwidth, 20);
-+ PRINT_BANDWIDTH(bandwidth, 40);
-+ PRINT_BANDWIDTH(bandwidth, 80);
-+ PRINT_BANDWIDTH(bandwidth, 80P80);
-+ PRINT_BANDWIDTH(bandwidth, 160);
-+ PRINT_BANDWIDTH(bandwidth, 5);
-+ PRINT_BANDWIDTH(bandwidth, 10);
-+ PRINT_BANDWIDTH(bandwidth, 1);
-+ PRINT_BANDWIDTH(bandwidth, 2);
-+ PRINT_BANDWIDTH(bandwidth, 4);
-+ PRINT_BANDWIDTH(bandwidth, 8);
-+ PRINT_BANDWIDTH(bandwidth, 16);
-+ PRINT_BANDWIDTH(bandwidth, 320);
-+ printf("\n");
-+#undef PRINT_BANDWIDTH
-+ }
-+ PRINT_FTM_U8(tb, MAX_BURSTS_EXPONENT);
-+ PRINT_FTM_U8(tb, MAX_FTMS_PER_BURST);
-+ PRINT_FTM_FLAG(tb, ASAP);
-+ PRINT_FTM_FLAG(tb, NON_ASAP);
-+ PRINT_FTM_FLAG(tb, REQ_LCI);
-+ PRINT_FTM_FLAG(tb, REQ_CIVICLOC);
-+ PRINT_FTM_FLAG(tb, TRIGGER_BASED);
-+ PRINT_FTM_FLAG(tb, NON_TRIGGER_BASED);
-+
-+#undef PRINT_FTM_U8
-+#undef PRINT_FTM_FLAG
-+}
-+
-+static void print_pmsr_capabilities(struct nlattr *pmsr_capa)
-+{
-+ struct nlattr *tb[NL80211_PMSR_ATTR_MAX + 1];
-+ struct nlattr *nla;
-+ int size;
-+ int ret;
-+
-+ printf("\tPeer measurement (PMSR)\n");
-+ ret = nla_parse_nested(tb, NL80211_PMSR_ATTR_MAX, pmsr_capa, NULL);
-+ if (ret) {
-+ printf("\t\tMalformed PMSR\n");
-+ return;
-+ }
-+
-+ if (tb[NL80211_PMSR_ATTR_MAX_PEERS])
-+ printf("\t\tMax peers: %d\n",
-+ nla_get_u32(tb[NL80211_PMSR_ATTR_MAX_PEERS]));
-+ if (tb[NL80211_PMSR_ATTR_REPORT_AP_TSF])
-+ printf("\t\tREPORT_AP_TSF\n");
-+ if (tb[NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR])
-+ printf("\t\tRANDOMIZE_MAC_ADDR\n");
-+
-+ if (tb[NL80211_PMSR_ATTR_TYPE_CAPA]) {
-+ nla_for_each_nested(nla, tb[NL80211_PMSR_ATTR_TYPE_CAPA], size) {
-+ switch (nla_type(nla)) {
-+ case NL80211_PMSR_TYPE_FTM:
-+ __print_ftm_capability(nla);
-+ break;
-+ }
-+ }
-+ } else {
-+ printf("\t\tPMSR type is missing\n");
-+ }
-+}
-+
- static int print_phy_handler(struct nl_msg *msg, void *arg)
- {
- struct nlattr *tb_msg[NL80211_ATTR_MAX + 1];
-@@ -741,6 +859,9 @@ broken_combination:
- pat->max_pattern_len, pat->max_pkt_offset, rule->max_delay);
- }
-
-+ if (tb_msg[NL80211_ATTR_PEER_MEASUREMENTS])
-+ print_pmsr_capabilities(tb_msg[NL80211_ATTR_PEER_MEASUREMENTS]);
-+
- if (tb_msg[NL80211_ATTR_MAX_AP_ASSOC_STA])
- printf("\tMaximum associated stations in AP mode: %u\n",
- nla_get_u16(tb_msg[NL80211_ATTR_MAX_AP_ASSOC_STA]));
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0001-iw-refactor-frequency-help.patch b/recipes-wifi/iw/patches-mlo/0001-iw-refactor-frequency-help.patch
new file mode 100644
index 0000000..d88718b
--- /dev/null
+++ b/recipes-wifi/iw/patches-mlo/0001-iw-refactor-frequency-help.patch
@@ -0,0 +1,169 @@
+From cce989770bf3375bbe4398a5ce80d9a9718460a3 Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Fri, 17 May 2024 12:04:06 +0200
+Subject: [PATCH 01/10] iw: refactor frequency help
+
+The channel parsing is the same in most places, refactor
+the help strings for that to not duplicate them in all
+the commands using them. This also corrects the help for
+a number of commands that never saw 320 MHz support.
+
+Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+---
+ ap.c | 10 ++++++----
+ iw.h | 13 +++++++++++++
+ phy.c | 38 +++++++++++++-------------------------
+ util.c | 4 ++--
+ 4 files changed, 34 insertions(+), 31 deletions(-)
+
+diff --git a/ap.c b/ap.c
+index 748576d..bf72fe2 100644
+--- a/ap.c
++++ b/ap.c
+@@ -144,12 +144,14 @@ static int handle_start_ap(struct nl80211_state *state,
+ nla_put_failure:
+ return -ENOSPC;
+ }
+-COMMAND(ap, start, "",
+- NL80211_CMD_NEW_BEACON, 0, CIB_NETDEV, handle_start_ap,
+- "<SSID> <control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]"
++COMMAND(ap, start,
++ "<SSID> "
++ PARSE_FREQ_ARGS("<SSID> ",
+ " <beacon interval in TU> <DTIM period> [hidden-ssid|zeroed-ssid] head"
+ " <beacon head in hexadecimal> [tail <beacon tail in hexadecimal>]"
+- " [inactivity-time <inactivity time in seconds>] [key0:abcde d:1:6162636465]\n");
++ " [inactivity-time <inactivity time in seconds>] [key0:abcde d:1:6162636465]"),
++ NL80211_CMD_NEW_BEACON, 0, CIB_NETDEV, handle_start_ap,
++ "Start an AP. Note that this usually requires hostapd or similar.\n");
+
+ static int handle_stop_ap(struct nl80211_state *state,
+ struct nl_msg *msg,
+diff --git a/iw.h b/iw.h
+index 7e9107e..82eee7c 100644
+--- a/iw.h
++++ b/iw.h
+@@ -209,6 +209,19 @@ int parse_hex_mask(char *hexmask, unsigned char **result, size_t *result_len,
+ unsigned char *parse_hex(char *hex, size_t *outlen);
+
+ int parse_keys(struct nl_msg *msg, char **argv[], int *argc);
++
++#define _PARSE_FREQ_ARGS_OPT1 "<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]"
++#define _PARSE_FREQ_ARGS_OPT2 "<control freq> [5|10|20|40|80|80+80|160|320] [<center1_freq> [<center2_freq>]]"
++#define PARSE_FREQ_ARGS(pfx, sfx) \
++ pfx _PARSE_FREQ_ARGS_OPT1 sfx "\n" \
++ pfx _PARSE_FREQ_ARGS_OPT2 sfx
++#define _PARSE_FREQ_KHZ_ARGS_OPT1 "<freq in KHz> [1MHz|2MHz|4MHz|8MHz|16MHz]"
++#define _PARSE_FREQ_KHZ_ARGS_OPT2 "<control freq in KHz> [1|2|4|8|16] [<center1_freq> [<center2_freq>]]"
++#define PARSE_FREQ_KHZ_ARGS(pfx, sfx) \
++ pfx _PARSE_FREQ_KHZ_ARGS_OPT1 sfx "\n" \
++ pfx _PARSE_FREQ_KHZ_ARGS_OPT2 sfx
++#define PARSE_CHAN_ARGS(pfx) \
++ pfx "<channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]"
+ int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv,
+ int *parsed, bool freq_in_khz);
+ enum nl80211_chan_width str_to_bw(const char *str);
+diff --git a/phy.c b/phy.c
+index 4722125..584b103 100644
+--- a/phy.c
++++ b/phy.c
+@@ -198,15 +198,10 @@ static int handle_freq(struct nl80211_state *state, struct nl_msg *msg,
+ return put_chandef(msg, &chandef);
+ }
+
+-COMMAND(set, freq,
+- "<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]\n"
+- "<control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]",
++COMMAND(set, freq, PARSE_FREQ_ARGS("", ""),
+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_freq,
+- "Set frequency/channel the hardware is using, including HT\n"
+- "configuration.");
+-COMMAND(set, freq,
+- "<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]\n"
+- "<control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]",
++ "Set frequency/channel configuration the hardware is using.");
++COMMAND(set, freq, PARSE_FREQ_ARGS("", ""),
+ NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_freq, NULL);
+
+ static int handle_freq_khz(struct nl80211_state *state, struct nl_msg *msg,
+@@ -223,15 +218,11 @@ static int handle_freq_khz(struct nl80211_state *state, struct nl_msg *msg,
+ return put_chandef(msg, &chandef);
+ }
+
+-COMMAND(set, freq_khz,
+- "<freq> [1MHz|2MHz|4MHz|8MHz|16MHz]\n"
+- "<control freq> [1|2|4|8|16] [<center1_freq> [<center2_freq>]]",
++COMMAND(set, freq_khz, PARSE_FREQ_KHZ_ARGS("", ""),
+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_freq_khz,
+ "Set frequency in kHz the hardware is using\n"
+ "configuration.");
+-COMMAND(set, freq_khz,
+- "<freq> [1MHz|2MHz|4MHz|8MHz|16MHz]\n"
+- "<control freq> [1|2|4|8|16] [<center1_freq> [<center2_freq>]]",
++COMMAND(set, freq_khz, PARSE_FREQ_KHZ_ARGS("", ""),
+ NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_freq_khz, NULL);
+
+ static int handle_chan(struct nl80211_state *state, struct nl_msg *msg,
+@@ -247,9 +238,9 @@ static int handle_chan(struct nl80211_state *state, struct nl_msg *msg,
+
+ return put_chandef(msg, &chandef);
+ }
+-COMMAND(set, channel, "<channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz]",
++COMMAND(set, channel, PARSE_CHAN_ARGS(""),
+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_chan, NULL);
+-COMMAND(set, channel, "<channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz]",
++COMMAND(set, channel, PARSE_CHAN_ARGS(""),
+ NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_chan, NULL);
+
+
+@@ -403,22 +394,19 @@ err_out:
+ free(cac_trigger_argv);
+ return err;
+ }
+-TOPLEVEL(cac, "channel <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n"
+- "freq <freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n"
+- "freq <control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]",
++TOPLEVEL(cac, PARSE_CHAN_ARGS("channel ") "\n"
++ PARSE_FREQ_ARGS("freq ", ""),
+ 0, 0, CIB_NETDEV, handle_cac, NULL);
+ COMMAND(cac, trigger,
+- "channel <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n"
+- "freq <frequency> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n"
+- "freq <frequency> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]",
++ PARSE_CHAN_ARGS("channel ") "\n"
++ PARSE_FREQ_ARGS("freq ", ""),
+ NL80211_CMD_RADAR_DETECT, 0, CIB_NETDEV, handle_cac_trigger,
+ "Start or trigger a channel availability check (CAC) looking to look for\n"
+ "radars on the given channel.");
+
+ COMMAND(cac, background,
+- "channel <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n"
+- "freq <frequency> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n"
+- "freq <frequency> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]",
++ PARSE_CHAN_ARGS("channel ") "\n"
++ PARSE_FREQ_ARGS("freq ", ""),
+ NL80211_CMD_RADAR_DETECT, 0, CIB_NETDEV, handle_cac_background,
+ "Start background channel availability check (CAC) looking to look for\n"
+ "radars on the given channel.");
+diff --git a/util.c b/util.c
+index d36dbdc..f358317 100644
+--- a/util.c
++++ b/util.c
+@@ -593,11 +593,11 @@ static int parse_freqs(struct chandef *chandef, int argc, char **argv,
+ * user by giving "NOHT" instead.
+ *
+ * The working specifier if chan is set are:
+- * <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz]
++ * <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]
+ *
+ * And if frequency is set:
+ * <freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]
+- * <control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]
++ * <control freq> [5|10|20|40|80|80+80|160|320] [<center1_freq> [<center2_freq>]]
+ *
+ * If the mode/channel width is not given the NOHT is assumed.
+ *
+--
+2.18.0
+
diff --git a/recipes-wifi/iw/patches-mlo/0002-iw-add-cac-background-command.patch b/recipes-wifi/iw/patches-mlo/0002-iw-add-cac-background-command.patch
deleted file mode 100644
index 235a0dc..0000000
--- a/recipes-wifi/iw/patches-mlo/0002-iw-add-cac-background-command.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 82e6fba06a1489a007ef20f9db17cc066f6f53d2 Mon Sep 17 00:00:00 2001
-From: Janusz Dziedzic <janusz.dziedzic@gmail.com>
-Date: Thu, 25 Aug 2022 11:51:11 +0200
-Subject: [PATCH 02/28] iw: add cac background command
-
-Add command that request background CAC radar scan.
-Tested on mt7915.
-
-Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
-Link: https://lore.kernel.org/r/20220825095111.1026649-1-janusz.dziedzic@gmail.com
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- phy.c | 17 +++++++++++++++++
- 1 file changed, 17 insertions(+)
-
-diff --git a/phy.c b/phy.c
-index 2d489ef..0a57ecb 100644
---- a/phy.c
-+++ b/phy.c
-@@ -301,6 +301,15 @@ static int handle_cac_trigger(struct nl80211_state *state,
- return put_chandef(msg, &chandef);
- }
-
-+static int handle_cac_background(struct nl80211_state *state,
-+ struct nl_msg *msg,
-+ int argc, char **argv,
-+ enum id_input id)
-+{
-+ nla_put_flag(msg, NL80211_ATTR_RADAR_BACKGROUND);
-+ return handle_cac_trigger(state, msg, argc, argv, id);
-+}
-+
- static int no_seq_check(struct nl_msg *msg, void *arg)
- {
- return NL_OK;
-@@ -381,6 +390,14 @@ COMMAND(cac, trigger,
- "Start or trigger a channel availability check (CAC) looking to look for\n"
- "radars on the given channel.");
-
-+COMMAND(cac, background,
-+ "channel <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n"
-+ "freq <frequency> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n"
-+ "freq <frequency> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]",
-+ NL80211_CMD_RADAR_DETECT, 0, CIB_NETDEV, handle_cac_background,
-+ "Start background channel availability check (CAC) looking to look for\n"
-+ "radars on the given channel.");
-+
- static int handle_fragmentation(struct nl80211_state *state,
- struct nl_msg *msg,
- int argc, char **argv,
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0002-iw-add-puncturing-support.patch b/recipes-wifi/iw/patches-mlo/0002-iw-add-puncturing-support.patch
new file mode 100644
index 0000000..2ebc109
--- /dev/null
+++ b/recipes-wifi/iw/patches-mlo/0002-iw-add-puncturing-support.patch
@@ -0,0 +1,89 @@
+From b29da202bdcbdc75cd75db37175261fb22d1e13b Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Fri, 17 May 2024 12:12:10 +0200
+Subject: [PATCH 02/10] iw: add puncturing support
+
+Parse and pass the puncturing bitmap to the kernel in any
+chandef (except S1G), the kernel will check validity.
+
+Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+---
+ iw.h | 7 ++++---
+ util.c | 15 ++++++++++++++-
+ 2 files changed, 18 insertions(+), 4 deletions(-)
+
+diff --git a/iw.h b/iw.h
+index 82eee7c..f416d6d 100644
+--- a/iw.h
++++ b/iw.h
+@@ -106,6 +106,7 @@ struct chandef {
+ unsigned int center_freq1;
+ unsigned int center_freq1_offset;
+ unsigned int center_freq2;
++ unsigned int punctured;
+ };
+
+ #define ARRAY_SIZE(ar) (sizeof(ar)/sizeof(ar[0]))
+@@ -210,8 +211,8 @@ unsigned char *parse_hex(char *hex, size_t *outlen);
+
+ int parse_keys(struct nl_msg *msg, char **argv[], int *argc);
+
+-#define _PARSE_FREQ_ARGS_OPT1 "<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]"
+-#define _PARSE_FREQ_ARGS_OPT2 "<control freq> [5|10|20|40|80|80+80|160|320] [<center1_freq> [<center2_freq>]]"
++#define _PARSE_FREQ_ARGS_OPT1 "<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz] [punct <bitmap>]"
++#define _PARSE_FREQ_ARGS_OPT2 "<control freq> [5|10|20|40|80|80+80|160|320] [<center1_freq> [<center2_freq>]] [punct <bitmap>]"
+ #define PARSE_FREQ_ARGS(pfx, sfx) \
+ pfx _PARSE_FREQ_ARGS_OPT1 sfx "\n" \
+ pfx _PARSE_FREQ_ARGS_OPT2 sfx
+@@ -221,7 +222,7 @@ int parse_keys(struct nl_msg *msg, char **argv[], int *argc);
+ pfx _PARSE_FREQ_KHZ_ARGS_OPT1 sfx "\n" \
+ pfx _PARSE_FREQ_KHZ_ARGS_OPT2 sfx
+ #define PARSE_CHAN_ARGS(pfx) \
+- pfx "<channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]"
++ pfx "<channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz] [punct <bitmap>]"
+ int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv,
+ int *parsed, bool freq_in_khz);
+ enum nl80211_chan_width str_to_bw(const char *str);
+diff --git a/util.c b/util.c
+index f358317..e43d590 100644
+--- a/util.c
++++ b/util.c
+@@ -735,13 +735,23 @@ int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv,
+ goto out;
+ }
+
+- /* This was a only a channel definition, nothing further may follow. */
++ /* This was a only a channel definition, only puncturing may follow */
+ if (chan)
+ goto out;
+
+ res = parse_freqs(chandef, argc - 1, argv + 1, &_parsed, freq_in_khz);
+
+ out:
++ if (!freq_in_khz && argc > _parsed && strcmp(argv[_parsed], "punct") == 0) {
++ _parsed++;
++ if (argc <= _parsed)
++ return 1;
++ chandef->punctured = strtoul(argv[_parsed], &end, 10);
++ if (*end)
++ return 1;
++ _parsed++;
++ }
++
+ /* Error out if parsed is NULL. */
+ if (!parsed && _parsed != argc)
+ return 1;
+@@ -800,6 +810,9 @@ int put_chandef(struct nl_msg *msg, struct chandef *chandef)
+ NL80211_ATTR_CENTER_FREQ2,
+ chandef->center_freq2);
+
++ if (chandef->punctured)
++ NLA_PUT_U32(msg, NL80211_ATTR_PUNCT_BITMAP, chandef->punctured);
++
+ return 0;
+
+ nla_put_failure:
+--
+2.18.0
+
diff --git a/recipes-wifi/iw/patches-mlo/0003-iw-info-fix-bug-reading-preambles-and-bandwidths.patch b/recipes-wifi/iw/patches-mlo/0003-iw-info-fix-bug-reading-preambles-and-bandwidths.patch
deleted file mode 100644
index 6f97d62..0000000
--- a/recipes-wifi/iw/patches-mlo/0003-iw-info-fix-bug-reading-preambles-and-bandwidths.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From c4743bbc1b1953bdc035b871ea1899ca94c1c6ac Mon Sep 17 00:00:00 2001
-From: Jaewan Kim <jaewan@google.com>
-Date: Tue, 10 Jan 2023 00:14:55 +0900
-Subject: [PATCH 03/28] iw: info: fix bug reading preambles and bandwidths
-
-Preambles and bandwidths values are considered as bit shifts
-when they're are used for capabilities.
-
-Signed-off-by: Jaewan Kim <jaewan@google.com>
-Link: https://lore.kernel.org/r/20230109151455.325793-1-jaewan@google.com
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- info.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/info.c b/info.c
-index eb257f8..5229d44 100644
---- a/info.c
-+++ b/info.c
-@@ -197,7 +197,7 @@ static void __print_ftm_capability(struct nlattr *ftm_capa)
- if (tb[NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES]) {
- #define PRINT_PREAMBLE(P, V) \
- do { \
-- if (P | NL80211_PREAMBLE_##V) \
-+ if (P & BIT(NL80211_PREAMBLE_##V)) \
- printf(" " #V); \
- } while (0)
-
-@@ -215,7 +215,7 @@ static void __print_ftm_capability(struct nlattr *ftm_capa)
- if (tb[NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS]) {
- #define PRINT_BANDWIDTH(B, V) \
- do { \
-- if (B | NL80211_CHAN_WIDTH_##V) \
-+ if (B & BIT(NL80211_CHAN_WIDTH_##V)) \
- printf(" " #V); \
- } while (0)
-
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0003-util-clarify-comment-about-parsed-pointer.patch b/recipes-wifi/iw/patches-mlo/0003-util-clarify-comment-about-parsed-pointer.patch
new file mode 100644
index 0000000..9ac1723
--- /dev/null
+++ b/recipes-wifi/iw/patches-mlo/0003-util-clarify-comment-about-parsed-pointer.patch
@@ -0,0 +1,36 @@
+From c8b9e772aee35e1db245ec6baa7bce1c7b4110ff Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Fri, 17 May 2024 13:19:47 +0200
+Subject: [PATCH 03/10] util: clarify comment about 'parsed' pointer
+
+It took me a while to understand this (again?), so
+clarify the comment here.
+
+Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+---
+ util.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/util.c b/util.c
+index e43d590..1341a22 100644
+--- a/util.c
++++ b/util.c
+@@ -752,8 +752,12 @@ int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv,
+ _parsed++;
+ }
+
+- /* Error out if parsed is NULL. */
+- if (!parsed && _parsed != argc)
++ /*
++ * Either this must consume all args, or users must pass a
++ * valid pointer as 'parsed' and use it to know how many of
++ * the arguments this function consumed.
++ */
++ if (_parsed != argc && !parsed)
+ return 1;
+
+ if (parsed)
+--
+2.18.0
+
diff --git a/recipes-wifi/iw/patches-mlo/0004-iw-add-support-for-retrieving-keys.patch b/recipes-wifi/iw/patches-mlo/0004-iw-add-support-for-retrieving-keys.patch
deleted file mode 100644
index 2685804..0000000
--- a/recipes-wifi/iw/patches-mlo/0004-iw-add-support-for-retrieving-keys.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-From cc660ccb9a83ec23b672eef178e9b494d95e763d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= <raphael.melotte@mind.be>
-Date: Thu, 12 Jan 2023 13:25:25 +0100
-Subject: [PATCH 04/28] iw: add support for retrieving keys
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-For debugging purposes, it can be useful to be able to retrieve keys.
-
-Add a "iw key get" command, to be able to retrieve keys when the key
-index is known. A new "key" section is also introduced, in preparation
-for future key-related commands.
-
-Example retrieving a pairwise key:
-iw dev wlan0 key get 0 02:02:03:04:05:06
-
-Example retrieving a group key:
-iw dev wlan0 key get 1
-
-Note that only the outer ATTR_KEY_DATA (and seq) is reported, the
-nested KEY_DATA (and seq) within ATTR_KEY is not.
-
-Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
-Link: https://lore.kernel.org/r/20230112122525.2257298-1-raphael.melotte@mind.be
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- keys.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 83 insertions(+)
- create mode 100644 keys.c
-
-diff --git a/keys.c b/keys.c
-new file mode 100644
-index 0000000..65aa426
---- /dev/null
-+++ b/keys.c
-@@ -0,0 +1,83 @@
-+#include <errno.h>
-+#include <netlink/genl/genl.h>
-+#include <netlink/genl/family.h>
-+#include <netlink/genl/ctrl.h>
-+#include <netlink/msg.h>
-+#include <netlink/attr.h>
-+#include "nl80211.h"
-+#include "iw.h"
-+
-+SECTION(key);
-+
-+static int print_keys(struct nl_msg *msg, void *arg)
-+{
-+ struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
-+ struct nlattr *tb[NL80211_ATTR_MAX + 1];
-+
-+ nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
-+ genlmsg_attrlen(gnlh, 0), NULL);
-+
-+ if (!tb[NL80211_ATTR_KEY_IDX]) {
-+ fprintf(stderr, "KEY_IDX missing!\n");
-+ return NL_SKIP;
-+ }
-+
-+ if (!tb[NL80211_ATTR_KEY_DATA]) {
-+ fprintf(stderr, "ATTR_KEY_DATA missing!\n");
-+ return NL_SKIP;
-+ }
-+
-+ iw_hexdump("Key", nla_data(tb[NL80211_ATTR_KEY_DATA]),
-+ nla_len(tb[NL80211_ATTR_KEY_DATA]));
-+
-+ if (!tb[NL80211_ATTR_KEY_SEQ]) {
-+ fprintf(stderr, "ATTR_KEY_SEQ missing!\n");
-+ return NL_SKIP;
-+ }
-+
-+ iw_hexdump("Key seq", nla_data(tb[NL80211_ATTR_KEY_SEQ]),
-+ nla_len(tb[NL80211_ATTR_KEY_SEQ]));
-+
-+ return NL_OK;
-+}
-+
-+static int handle_get_key(struct nl80211_state *state,
-+ struct nl_msg *msg, int argc, char **argv,
-+ enum id_input id)
-+{
-+ char *end;
-+ unsigned char mac[6];
-+
-+ /* key index */
-+ if (argc) {
-+ nla_put_u8(msg, NL80211_ATTR_KEY_IDX, strtoul(argv[0], &end, 10));
-+ if (*end != '\0')
-+ return -EINVAL;
-+ argv++;
-+ argc--;
-+ }
-+
-+ /* mac */
-+ if (argc) {
-+ if (mac_addr_a2n(mac, argv[0]) == 0) {
-+ NLA_PUT(msg, NL80211_ATTR_MAC, 6, mac);
-+ nla_put_u32(msg, NL80211_ATTR_KEY_TYPE,
-+ NL80211_KEYTYPE_PAIRWISE);
-+ argv++;
-+ argc--;
-+ } else {
-+ return -EINVAL;
-+ }
-+ } else {
-+ nla_put_u32(msg, NL80211_ATTR_KEY_TYPE, NL80211_KEYTYPE_GROUP);
-+ }
-+
-+ register_handler(print_keys, NULL);
-+ return 0;
-+
-+ nla_put_failure:
-+ return -ENOSPC;
-+}
-+COMMAND(key, get, "<key index> <MAC address>",
-+ NL80211_CMD_GET_KEY, 0, CIB_NETDEV, handle_get_key,
-+ "Retrieve a key and key sequence.\n");
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0004-iw-remove-sizer-section-and-related-code.patch b/recipes-wifi/iw/patches-mlo/0004-iw-remove-sizer-section-and-related-code.patch
new file mode 100644
index 0000000..909a357
--- /dev/null
+++ b/recipes-wifi/iw/patches-mlo/0004-iw-remove-sizer-section-and-related-code.patch
@@ -0,0 +1,66 @@
+From 8609336b71a8ae37238dc3f4ddff251a4698a4fc Mon Sep 17 00:00:00 2001
+From: Benjamin Berg <benjamin.berg@intel.com>
+Date: Fri, 3 May 2024 13:12:06 +0200
+Subject: [PATCH 04/10] iw: remove sizer section and related code
+
+With commit 338059ace9d0 ("iw: change __cmd section scheme to fit
+gcc/clang"), the __cmd section only includes pointers to struct cmd
+rather than the struct itself. This means that the code to measure the
+spacing is not needed anymore and can be dropped.
+
+Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+---
+ iw.c | 23 -----------------------
+ 1 file changed, 23 deletions(-)
+
+diff --git a/iw.c b/iw.c
+index 35308ba..c99edb1 100644
+--- a/iw.c
++++ b/iw.c
+@@ -87,8 +87,6 @@ static void nl80211_cleanup(struct nl80211_state *state)
+ nl_socket_free(state->nl_sock);
+ }
+
+-static int cmd_size;
+-
+ extern struct cmd *__start___cmd[];
+ extern struct cmd *__stop___cmd;
+
+@@ -555,33 +553,12 @@ int handle_cmd(struct nl80211_state *state, enum id_input idby,
+ return __handle_cmd(state, idby, argc, argv, NULL);
+ }
+
+-/*
+- * Unfortunately, I don't know how densely the linker packs the struct cmd.
+- * For example, if you have a 72-byte struct cmd, the linker will pad each
+- * out to 96 bytes before putting them together in the section. There must
+- * be some algorithm, but I haven't found it yet.
+- *
+- * We used to calculate this by taking the (abs value of) the difference
+- * between __section_get and __section_set, but if LTO is enabled then this
+- * stops working because the entries of the "__cmd" section get rearranged
+- * freely by the compiler/linker.
+- *
+- * Fix this by using yet another "__sizer" section that only contains these
+- * two entries - then the (abs value of) the difference between them will
+- * be how they get packed and that can be used to iterate the __cmd section
+- * as well.
+- */
+-static struct cmd sizer1 __attribute__((section("__sizer"))) = {};
+-static struct cmd sizer2 __attribute__((section("__sizer"))) = {};
+-
+ int main(int argc, char **argv)
+ {
+ struct nl80211_state nlstate;
+ int err;
+ const struct cmd *cmd = NULL;
+
+- /* calculate command size including padding */
+- cmd_size = labs((long)&sizer2 - (long)&sizer1);
+ /* strip off self */
+ argc--;
+ argv0 = *argv++;
+--
+2.18.0
+
diff --git a/recipes-wifi/iw/patches-mlo/0027-Revert-iw-allow-specifying-CFLAGS-LIBS-externally.patch b/recipes-wifi/iw/patches-mlo/0005-Revert-iw-allow-specifying-CFLAGS-LIBS-externally.patch
similarity index 93%
rename from recipes-wifi/iw/patches-mlo/0027-Revert-iw-allow-specifying-CFLAGS-LIBS-externally.patch
rename to recipes-wifi/iw/patches-mlo/0005-Revert-iw-allow-specifying-CFLAGS-LIBS-externally.patch
index 743e415..040dfd2 100644
--- a/recipes-wifi/iw/patches-mlo/0027-Revert-iw-allow-specifying-CFLAGS-LIBS-externally.patch
+++ b/recipes-wifi/iw/patches-mlo/0005-Revert-iw-allow-specifying-CFLAGS-LIBS-externally.patch
@@ -1,7 +1,7 @@
-From 3bcf45100b9512270c674099a21162c6f0c901dc Mon Sep 17 00:00:00 2001
+From 42813f2d9097bce908f1b01982096b550d829ac7 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sun, 21 Nov 2021 00:02:57 +0100
-Subject: [PATCH 27/28] Revert "iw: allow specifying CFLAGS/LIBS externally"
+Subject: [PATCH 05/10] Revert "iw: allow specifying CFLAGS/LIBS externally"
This reverts commit 1325244b77d56fd7a16d1e35fdae0efc151920b1.
@@ -69,5 +69,5 @@
ifeq ($(V),1)
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/iw/patches-mlo/0005-iw-event-fix-printf-format-error.patch b/recipes-wifi/iw/patches-mlo/0005-iw-event-fix-printf-format-error.patch
deleted file mode 100644
index 00c57f0..0000000
--- a/recipes-wifi/iw/patches-mlo/0005-iw-event-fix-printf-format-error.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From d6fd2757f7aab638022ffa635e32e21594ec382d Mon Sep 17 00:00:00 2001
-From: Stefan Weil <sw@weilnetz.de>
-Date: Sat, 21 Jan 2023 20:36:37 +0100
-Subject: [PATCH 05/28] iw: event: fix printf format error
-
-tv_usec can be a 64 bit integer which causes a compiler warning:
-
-event.c: In function 'print_event':
-event.c:930:41: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'suseconds_t' {aka 'long long int'} [-Wformat=]
- 930 | printf("[%s.%06lu]: ", buf, args->ts.tv_usec);
- | ~~~~^ ~~~~~~~~~~~~~~~~
- | | |
- | long unsigned int suseconds_t {aka long long int}
- | %06llu
-
-Signed-off-by: Stefan Weil <sw@weilnetz.de>
-Link: https://lore.kernel.org/r/20230121193637.347109-1-sw@weilnetz.de
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- event.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/event.c b/event.c
-index 4c37297..fa2e125 100644
---- a/event.c
-+++ b/event.c
-@@ -942,7 +942,7 @@ static int print_event(struct nl_msg *msg, void *arg)
-
- memset(buf, 0, 255);
- strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm);
-- printf("[%s.%06lu]: ", buf, args->ts.tv_usec);
-+ printf("[%s.%06lu]: ", buf, (unsigned long )args->ts.tv_usec);
- } else {
- printf("%llu.%06llu: ", usecs/1000000, usecs % 1000000);
- }
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0028-survey-bss-rx-time.patch b/recipes-wifi/iw/patches-mlo/0006-survey-bss-rx-time.patch
similarity index 88%
rename from recipes-wifi/iw/patches-mlo/0028-survey-bss-rx-time.patch
rename to recipes-wifi/iw/patches-mlo/0006-survey-bss-rx-time.patch
index 3869b00..5b61920 100644
--- a/recipes-wifi/iw/patches-mlo/0028-survey-bss-rx-time.patch
+++ b/recipes-wifi/iw/patches-mlo/0006-survey-bss-rx-time.patch
@@ -1,7 +1,7 @@
-From a059a337750198bf2481073194cc55022bb71c76 Mon Sep 17 00:00:00 2001
+From a417f83cef66ca22ce0a362e4812954d15721a70 Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Mon, 25 Dec 2023 11:24:01 +0800
-Subject: [PATCH 28/28] survey bss rx time
+Subject: [PATCH 06/10] survey bss rx time
---
survey.c | 3 +++
@@ -22,5 +22,5 @@
printf("\tchannel transmit time:\t\t%llu ms\n",
(unsigned long long)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_TX]));
--
-2.39.2
+2.18.0
diff --git a/recipes-wifi/iw/patches-mlo/0006-update-nl80211.h.patch b/recipes-wifi/iw/patches-mlo/0006-update-nl80211.h.patch
deleted file mode 100644
index 38d68b2..0000000
--- a/recipes-wifi/iw/patches-mlo/0006-update-nl80211.h.patch
+++ /dev/null
@@ -1,425 +0,0 @@
-From de3da80461f48946b9493fb2b2d54ce6dcdc3e12 Mon Sep 17 00:00:00 2001
-From: Johannes Berg <johannes.berg@intel.com>
-Date: Fri, 14 Apr 2023 12:50:11 +0200
-Subject: [PATCH 06/28] update nl80211.h
-
-Bring in nl80211.h from 6.4-rc.
-
-Change-Id: I96b818a987d243b5cf97e2cc9c62d57637e17165
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- info.c | 4 +
- nl80211.h | 230 +++++++++++++++++++++++++++++++++++++++++++++++++++---
- 2 files changed, 224 insertions(+), 10 deletions(-)
-
-diff --git a/info.c b/info.c
-index 5229d44..9955e5e 100644
---- a/info.c
-+++ b/info.c
-@@ -166,6 +166,10 @@ static void ext_feat_print(enum nl80211_ext_feature_index idx)
- ext_feat_case(BSS_COLOR, "BSS coloring support");
- ext_feat_case(FILS_CRYPTO_OFFLOAD, "FILS crypto offload");
- ext_feat_case(RADAR_BACKGROUND, "Radar background support");
-+ ext_feat_case(POWERED_ADDR_CHANGE, "can change MAC address while up");
-+ ext_feat_case(PUNCT, "preamble puncturing in AP mode");
-+ ext_feat_case(SECURE_NAN, "secure NAN support");
-+ ext_feat_case(AUTH_AND_DEAUTH_RANDOM_TA, "random auth/deauth transmitter address");
- }
- }
-
-diff --git a/nl80211.h b/nl80211.h
-index d9490e3..c59fec4 100644
---- a/nl80211.h
-+++ b/nl80211.h
-@@ -323,6 +323,17 @@
- * Once the association is done, the driver cleans the FILS AAD data.
- */
-
-+/**
-+ * DOC: Multi-Link Operation
-+ *
-+ * In Multi-Link Operation, a connection between to MLDs utilizes multiple
-+ * links. To use this in nl80211, various commands and responses now need
-+ * to or will include the new %NL80211_ATTR_MLO_LINKS attribute.
-+ * Additionally, various commands that need to operate on a specific link
-+ * now need to be given the %NL80211_ATTR_MLO_LINK_ID attribute, e.g. to
-+ * use %NL80211_CMD_START_AP or similar functions.
-+ */
-+
- /**
- * enum nl80211_commands - supported nl80211 commands
- *
-@@ -366,14 +377,22 @@
- * the non-transmitting interfaces are deleted as well.
- *
- * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
-- * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.
-+ * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC. %NL80211_ATTR_MAC
-+ * represents peer's MLD address for MLO pairwise key. For MLO group key,
-+ * the link is identified by %NL80211_ATTR_MLO_LINK_ID.
- * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT,
- * %NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD.
-+ * For MLO connection, the link to set default key is identified by
-+ * %NL80211_ATTR_MLO_LINK_ID.
- * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
- * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC, %NL80211_ATTR_KEY_CIPHER,
-- * and %NL80211_ATTR_KEY_SEQ attributes.
-+ * and %NL80211_ATTR_KEY_SEQ attributes. %NL80211_ATTR_MAC represents
-+ * peer's MLD address for MLO pairwise key. The link to add MLO
-+ * group key is identified by %NL80211_ATTR_MLO_LINK_ID.
- * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
-- * or %NL80211_ATTR_MAC.
-+ * or %NL80211_ATTR_MAC. %NL80211_ATTR_MAC represents peer's MLD address
-+ * for MLO pairwise key. The link to delete group key is identified by
-+ * %NL80211_ATTR_MLO_LINK_ID.
- *
- * @NL80211_CMD_GET_BEACON: (not used)
- * @NL80211_CMD_SET_BEACON: change the beacon on an access point interface
-@@ -405,7 +424,8 @@
- * interface identified by %NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC
- * or, if no MAC address given, all stations, on the interface identified
-- * by %NL80211_ATTR_IFINDEX. %NL80211_ATTR_MGMT_SUBTYPE and
-+ * by %NL80211_ATTR_IFINDEX. For MLD station, MLD address is used in
-+ * %NL80211_ATTR_MAC. %NL80211_ATTR_MGMT_SUBTYPE and
- * %NL80211_ATTR_REASON_CODE can optionally be used to specify which type
- * of disconnection indication should be sent to the station
- * (Deauthentication or Disassociation frame and reason code for that
-@@ -753,6 +773,13 @@
- * %NL80211_ATTR_CSA_C_OFFSETS_TX is an array of offsets to CSA
- * counters which will be updated to the current value. This attribute
- * is used during CSA period.
-+ * For TX on an MLD, the frequency can be omitted and the link ID be
-+ * specified, or if transmitting to a known peer MLD (with MLD addresses
-+ * in the frame) both can be omitted and the link will be selected by
-+ * lower layers.
-+ * For RX notification, %NL80211_ATTR_RX_HW_TIMESTAMP may be included to
-+ * indicate the frame RX timestamp and %NL80211_ATTR_TX_HW_TIMESTAMP may
-+ * be included to indicate the ack TX timestamp.
- * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
- * command may be used with the corresponding cookie to cancel the wait
- * time if it is known that it is no longer necessary. This command is
-@@ -763,7 +790,9 @@
- * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
- * the TX command and %NL80211_ATTR_FRAME includes the contents of the
- * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged
-- * the frame.
-+ * the frame. %NL80211_ATTR_TX_HW_TIMESTAMP may be included to indicate the
-+ * tx timestamp and %NL80211_ATTR_RX_HW_TIMESTAMP may be included to
-+ * indicate the ack RX timestamp.
- * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for
- * backward compatibility.
- *
-@@ -1108,6 +1137,12 @@
- * has been received. %NL80211_ATTR_FRAME is used to specify the
- * frame contents. The frame is the raw EAPoL data, without ethernet or
- * 802.11 headers.
-+ * For an MLD transmitter, the %NL80211_ATTR_MLO_LINK_ID may be given and
-+ * its effect will depend on the destination: If the destination is known
-+ * to be an MLD, this will be used as a hint to select the link to transmit
-+ * the frame on. If the destination is not an MLD, this will select both
-+ * the link to transmit on and the source address will be set to the link
-+ * address of that link.
- * When used as an event indication %NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
- * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT and %NL80211_ATTR_MAC are added
- * indicating the protocol type of the received frame; whether the frame
-@@ -1132,6 +1167,23 @@
- * %NL80211_ATTR_STATUS_CODE attribute in %NL80211_CMD_EXTERNAL_AUTH
- * command interface.
- *
-+ * Host driver sends MLD address of the AP with %NL80211_ATTR_MLD_ADDR in
-+ * %NL80211_CMD_EXTERNAL_AUTH event to indicate user space to enable MLO
-+ * during the authentication offload in STA mode while connecting to MLD
-+ * APs. Host driver should check %NL80211_ATTR_MLO_SUPPORT flag capability
-+ * in %NL80211_CMD_CONNECT to know whether the user space supports enabling
-+ * MLO during the authentication offload or not.
-+ * User space should enable MLO during the authentication only when it
-+ * receives the AP MLD address in authentication offload request. User
-+ * space shouldn't enable MLO when the authentication offload request
-+ * doesn't indicate the AP MLD address even if the AP is MLO capable.
-+ * User space should use %NL80211_ATTR_MLD_ADDR as peer's MLD address and
-+ * interface address identified by %NL80211_ATTR_IFINDEX as self MLD
-+ * address. User space and host driver to use MLD addresses in RA, TA and
-+ * BSSID fields of the frames between them, and host driver translates the
-+ * MLD addresses to/from link addresses based on the link chosen for the
-+ * authentication.
-+ *
- * Host driver reports this status on an authentication failure to the
- * user space through the connect result as the user space would have
- * initiated the connection through the connect request.
-@@ -1237,6 +1289,26 @@
- * to describe the BSSID address of the AP and %NL80211_ATTR_TIMEOUT to
- * specify the timeout value.
- *
-+ * @NL80211_CMD_ADD_LINK: Add a new link to an interface. The
-+ * %NL80211_ATTR_MLO_LINK_ID attribute is used for the new link.
-+ * @NL80211_CMD_REMOVE_LINK: Remove a link from an interface. This may come
-+ * without %NL80211_ATTR_MLO_LINK_ID as an easy way to remove all links
-+ * in preparation for e.g. roaming to a regular (non-MLO) AP.
-+ *
-+ * @NL80211_CMD_ADD_LINK_STA: Add a link to an MLD station
-+ * @NL80211_CMD_MODIFY_LINK_STA: Modify a link of an MLD station
-+ * @NL80211_CMD_REMOVE_LINK_STA: Remove a link of an MLD station
-+ *
-+ * @NL80211_CMD_SET_HW_TIMESTAMP: Enable/disable HW timestamping of Timing
-+ * measurement and Fine timing measurement frames. If %NL80211_ATTR_MAC
-+ * is included, enable/disable HW timestamping only for frames to/from the
-+ * specified MAC address. Otherwise enable/disable HW timestamping for
-+ * all TM/FTM frames (including ones that were enabled with specific MAC
-+ * address). If %NL80211_ATTR_HW_TIMESTAMP_ENABLED is not included, disable
-+ * HW timestamping.
-+ * The number of peers that HW timestamping can be enabled for concurrently
-+ * is indicated by %NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS.
-+ *
- * @NL80211_CMD_MAX: highest used command number
- * @__NL80211_CMD_AFTER_LAST: internal use
- */
-@@ -1481,6 +1553,15 @@ enum nl80211_commands {
-
- NL80211_CMD_ASSOC_COMEBACK,
-
-+ NL80211_CMD_ADD_LINK,
-+ NL80211_CMD_REMOVE_LINK,
-+
-+ NL80211_CMD_ADD_LINK_STA,
-+ NL80211_CMD_MODIFY_LINK_STA,
-+ NL80211_CMD_REMOVE_LINK_STA,
-+
-+ NL80211_CMD_SET_HW_TIMESTAMP,
-+
- /* add new commands above here */
-
- /* used to define NL80211_CMD_MAX below */
-@@ -2340,8 +2421,10 @@ enum nl80211_commands {
- *
- * @NL80211_ATTR_IFTYPE_EXT_CAPA: Nested attribute of the following attributes:
- * %NL80211_ATTR_IFTYPE, %NL80211_ATTR_EXT_CAPA,
-- * %NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities per
-- * interface type.
-+ * %NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities and
-+ * other interface-type specific capabilities per interface type. For MLO,
-+ * %NL80211_ATTR_EML_CAPABILITY and %NL80211_ATTR_MLD_CAPA_AND_OPS are
-+ * present.
- *
- * @NL80211_ATTR_MU_MIMO_GROUP_DATA: array of 24 bytes that defines a MU-MIMO
- * groupID for monitor mode.
-@@ -2663,6 +2746,65 @@ enum nl80211_commands {
- * association request when used with NL80211_CMD_NEW_STATION). Can be set
- * only if %NL80211_STA_FLAG_WME is set.
- *
-+ * @NL80211_ATTR_MLO_LINK_ID: A (u8) link ID for use with MLO, to be used with
-+ * various commands that need a link ID to operate.
-+ * @NL80211_ATTR_MLO_LINKS: A nested array of links, each containing some
-+ * per-link information and a link ID.
-+ * @NL80211_ATTR_MLD_ADDR: An MLD address, used with various commands such as
-+ * authenticate/associate.
-+ *
-+ * @NL80211_ATTR_MLO_SUPPORT: Flag attribute to indicate user space supports MLO
-+ * connection. Used with %NL80211_CMD_CONNECT. If this attribute is not
-+ * included in NL80211_CMD_CONNECT drivers must not perform MLO connection.
-+ *
-+ * @NL80211_ATTR_MAX_NUM_AKM_SUITES: U16 attribute. Indicates maximum number of
-+ * AKM suites allowed for %NL80211_CMD_CONNECT, %NL80211_CMD_ASSOCIATE and
-+ * %NL80211_CMD_START_AP in %NL80211_CMD_GET_WIPHY response. If this
-+ * attribute is not present userspace shall consider maximum number of AKM
-+ * suites allowed as %NL80211_MAX_NR_AKM_SUITES which is the legacy maximum
-+ * number prior to the introduction of this attribute.
-+ *
-+ * @NL80211_ATTR_EML_CAPABILITY: EML Capability information (u16)
-+ * @NL80211_ATTR_MLD_CAPA_AND_OPS: MLD Capabilities and Operations (u16)
-+ *
-+ * @NL80211_ATTR_TX_HW_TIMESTAMP: Hardware timestamp for TX operation in
-+ * nanoseconds (u64). This is the device clock timestamp so it will
-+ * probably reset when the device is stopped or the firmware is reset.
-+ * When used with %NL80211_CMD_FRAME_TX_STATUS, indicates the frame TX
-+ * timestamp. When used with %NL80211_CMD_FRAME RX notification, indicates
-+ * the ack TX timestamp.
-+ * @NL80211_ATTR_RX_HW_TIMESTAMP: Hardware timestamp for RX operation in
-+ * nanoseconds (u64). This is the device clock timestamp so it will
-+ * probably reset when the device is stopped or the firmware is reset.
-+ * When used with %NL80211_CMD_FRAME_TX_STATUS, indicates the ack RX
-+ * timestamp. When used with %NL80211_CMD_FRAME RX notification, indicates
-+ * the incoming frame RX timestamp.
-+ * @NL80211_ATTR_TD_BITMAP: Transition Disable bitmap, for subsequent
-+ * (re)associations.
-+ *
-+ * @NL80211_ATTR_PUNCT_BITMAP: (u32) Preamble puncturing bitmap, lowest
-+ * bit corresponds to the lowest 20 MHz channel. Each bit set to 1
-+ * indicates that the sub-channel is punctured. Higher 16 bits are
-+ * reserved.
-+ *
-+ * @NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS: Maximum number of peers that HW
-+ * timestamping can be enabled for concurrently (u16), a wiphy attribute.
-+ * A value of 0xffff indicates setting for all peers (i.e. not specifying
-+ * an address with %NL80211_CMD_SET_HW_TIMESTAMP) is supported.
-+ * @NL80211_ATTR_HW_TIMESTAMP_ENABLED: Indicates whether HW timestamping should
-+ * be enabled or not (flag attribute).
-+ *
-+ * @NL80211_ATTR_EMA_RNR_ELEMS: Optional nested attribute for
-+ * reduced neighbor report (RNR) elements. This attribute can be used
-+ * only when NL80211_MBSSID_CONFIG_ATTR_EMA is enabled.
-+ * Userspace is responsible for splitting the RNR into multiple
-+ * elements such that each element excludes the non-transmitting
-+ * profiles already included in the MBSSID element
-+ * (%NL80211_ATTR_MBSSID_ELEMS) at the same index. Each EMA beacon
-+ * will be generated by adding MBSSID and RNR elements at the same
-+ * index. If the userspace includes more RNR elements than number of
-+ * MBSSID elements then these will be added in every EMA beacon.
-+ *
- * @NUM_NL80211_ATTR: total number of nl80211_attrs available
- * @NL80211_ATTR_MAX: highest attribute number currently defined
- * @__NL80211_ATTR_AFTER_LAST: internal use
-@@ -3177,6 +3319,28 @@ enum nl80211_attrs {
-
- NL80211_ATTR_DISABLE_EHT,
-
-+ NL80211_ATTR_MLO_LINKS,
-+ NL80211_ATTR_MLO_LINK_ID,
-+ NL80211_ATTR_MLD_ADDR,
-+
-+ NL80211_ATTR_MLO_SUPPORT,
-+
-+ NL80211_ATTR_MAX_NUM_AKM_SUITES,
-+
-+ NL80211_ATTR_EML_CAPABILITY,
-+ NL80211_ATTR_MLD_CAPA_AND_OPS,
-+
-+ NL80211_ATTR_TX_HW_TIMESTAMP,
-+ NL80211_ATTR_RX_HW_TIMESTAMP,
-+ NL80211_ATTR_TD_BITMAP,
-+
-+ NL80211_ATTR_PUNCT_BITMAP,
-+
-+ NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS,
-+ NL80211_ATTR_HW_TIMESTAMP_ENABLED,
-+
-+ NL80211_ATTR_EMA_RNR_ELEMS,
-+
- /* add attributes here, update the policy in nl80211.c */
-
- __NL80211_ATTR_AFTER_LAST,
-@@ -3231,6 +3395,11 @@ enum nl80211_attrs {
- #define NL80211_HE_MIN_CAPABILITY_LEN 16
- #define NL80211_HE_MAX_CAPABILITY_LEN 54
- #define NL80211_MAX_NR_CIPHER_SUITES 5
-+
-+/*
-+ * NL80211_MAX_NR_AKM_SUITES is obsolete when %NL80211_ATTR_MAX_NUM_AKM_SUITES
-+ * present in %NL80211_CMD_GET_WIPHY response.
-+ */
- #define NL80211_MAX_NR_AKM_SUITES 2
- #define NL80211_EHT_MIN_CAPABILITY_LEN 13
- #define NL80211_EHT_MAX_CAPABILITY_LEN 51
-@@ -3892,6 +4061,10 @@ enum nl80211_band_iftype_attr {
- * @NL80211_BAND_ATTR_EDMG_BW_CONFIG: Channel BW Configuration subfield encodes
- * the allowed channel bandwidth configurations.
- * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13.
-+ * @NL80211_BAND_ATTR_S1G_MCS_NSS_SET: S1G capabilities, supported S1G-MCS and NSS
-+ * set subfield, as in the S1G information IE, 5 bytes
-+ * @NL80211_BAND_ATTR_S1G_CAPA: S1G capabilities information subfield as in the
-+ * S1G information IE, 10 bytes
- * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
- * @__NL80211_BAND_ATTR_AFTER_LAST: internal use
- */
-@@ -3912,6 +4085,9 @@ enum nl80211_band_attr {
- NL80211_BAND_ATTR_EDMG_CHANNELS,
- NL80211_BAND_ATTR_EDMG_BW_CONFIG,
-
-+ NL80211_BAND_ATTR_S1G_MCS_NSS_SET,
-+ NL80211_BAND_ATTR_S1G_CAPA,
-+
- /* keep last */
- __NL80211_BAND_ATTR_AFTER_LAST,
- NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
-@@ -4853,6 +5029,8 @@ enum nl80211_bss_scan_width {
- * Contains a nested array of signal strength attributes (u8, dBm),
- * using the nesting index as the antenna number.
- * @NL80211_BSS_FREQUENCY_OFFSET: frequency offset in KHz
-+ * @NL80211_BSS_MLO_LINK_ID: MLO link ID of the BSS (u8).
-+ * @NL80211_BSS_MLD_ADDR: MLD address of this BSS if connected to it.
- * @__NL80211_BSS_AFTER_LAST: internal
- * @NL80211_BSS_MAX: highest BSS attribute
- */
-@@ -4878,6 +5056,8 @@ enum nl80211_bss {
- NL80211_BSS_PARENT_BSSID,
- NL80211_BSS_CHAIN_SIGNAL,
- NL80211_BSS_FREQUENCY_OFFSET,
-+ NL80211_BSS_MLO_LINK_ID,
-+ NL80211_BSS_MLD_ADDR,
-
- /* keep last */
- __NL80211_BSS_AFTER_LAST,
-@@ -5757,6 +5937,7 @@ enum plink_actions {
- #define NL80211_KEK_LEN 16
- #define NL80211_KCK_EXT_LEN 24
- #define NL80211_KEK_EXT_LEN 32
-+#define NL80211_KCK_EXT_LEN_32 32
- #define NL80211_REPLAY_CTR_LEN 8
-
- /**
-@@ -5874,7 +6055,7 @@ enum nl80211_ap_sme_features {
- * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up
- * the connected inactive stations in AP mode.
- * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
-- * to work properly to suppport receiving regulatory hints from
-+ * to work properly to support receiving regulatory hints from
- * cellular base stations.
- * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: (no longer available, only
- * here to reserve the value for API/ABI compatibility)
-@@ -6174,6 +6355,23 @@ enum nl80211_feature_flags {
- * @NL80211_EXT_FEATURE_RADAR_BACKGROUND: Device supports background radar/CAC
- * detection.
- *
-+ * @NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE: Device can perform a MAC address
-+ * change without having to bring the underlying network device down
-+ * first. For example, in station mode this can be used to vary the
-+ * origin MAC address prior to a connection to a new AP for privacy
-+ * or other reasons. Note that certain driver specific restrictions
-+ * might apply, e.g. no scans in progress, no offchannel operations
-+ * in progress, and no active connections.
-+ *
-+ * @NL80211_EXT_FEATURE_PUNCT: Driver supports preamble puncturing in AP mode.
-+ *
-+ * @NL80211_EXT_FEATURE_SECURE_NAN: Device supports NAN Pairing which enables
-+ * authentication, data encryption and message integrity.
-+ *
-+ * @NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA: Device supports randomized TA
-+ * in authentication and deauthentication frames sent to unassociated peer
-+ * using @NL80211_CMD_FRAME.
-+ *
- * @NUM_NL80211_EXT_FEATURES: number of extended features.
- * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
- */
-@@ -6241,6 +6439,10 @@ enum nl80211_ext_feature_index {
- NL80211_EXT_FEATURE_BSS_COLOR,
- NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD,
- NL80211_EXT_FEATURE_RADAR_BACKGROUND,
-+ NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE,
-+ NL80211_EXT_FEATURE_PUNCT,
-+ NL80211_EXT_FEATURE_SECURE_NAN,
-+ NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA,
-
- /* add new features before the definition below */
- NUM_NL80211_EXT_FEATURES,
-@@ -6355,8 +6557,16 @@ enum nl80211_timeout_reason {
- * @NL80211_SCAN_FLAG_FREQ_KHZ: report scan results with
- * %NL80211_ATTR_SCAN_FREQ_KHZ. This also means
- * %NL80211_ATTR_SCAN_FREQUENCIES will not be included.
-- * @NL80211_SCAN_FLAG_COLOCATED_6GHZ: scan for colocated APs reported by
-- * 2.4/5 GHz APs
-+ * @NL80211_SCAN_FLAG_COLOCATED_6GHZ: scan for collocated APs reported by
-+ * 2.4/5 GHz APs. When the flag is set, the scan logic will use the
-+ * information from the RNR element found in beacons/probe responses
-+ * received on the 2.4/5 GHz channels to actively scan only the 6GHz
-+ * channels on which APs are expected to be found. Note that when not set,
-+ * the scan logic would scan all 6GHz channels, but since transmission of
-+ * probe requests on non PSC channels is limited, it is highly likely that
-+ * these channels would passively be scanned. Also note that when the flag
-+ * is set, in addition to the colocated APs, PSC channels would also be
-+ * scanned if the user space has asked for it.
- */
- enum nl80211_scan_flags {
- NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0,
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0007-iw-support-link-id-in-set-bitrates-command.patch b/recipes-wifi/iw/patches-mlo/0007-iw-support-link-id-in-set-bitrates-command.patch
new file mode 100644
index 0000000..8d0e0a0
--- /dev/null
+++ b/recipes-wifi/iw/patches-mlo/0007-iw-support-link-id-in-set-bitrates-command.patch
@@ -0,0 +1,59 @@
+From f885f9be220545bc3d62c369d68ded69e2711b52 Mon Sep 17 00:00:00 2001
+From: Howard Hsu <howard-yh.hsu@mediatek.com>
+Date: Thu, 30 May 2024 10:17:29 +0800
+Subject: [PATCH 07/10] iw: support link id in set bitrates command
+
+Since NL80211_CMD_SET_TX_BITRATE_MASK includes flag
+NL80211_FLAG_MLO_VALID_LINK_ID, nl80211_pre_do_it() will check whether
+nl80211_msg includes LINK_ID. Without this patch, iw set bitrates
+command must failed.
+
+Usage:
+iw dev <intf> set bitrates -l <link_id> [legacy | he-gi-xx ...]
+
+CR-Id: WCNCR00261410
+Change-Id: I4984054543f63c9324d9b81a240382023fbc0b0b
+---
+ bitrate.c | 19 +++++++++++++++++--
+ 1 file changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/bitrate.c b/bitrate.c
+index 8714669..f0f81a0 100644
+--- a/bitrate.c
++++ b/bitrate.c
+@@ -146,7 +146,7 @@ int set_bitrates(struct nl_msg *msg,
+ enum nl80211_attrs attr)
+ {
+ struct nlattr *nl_rates, *nl_band;
+- int i, ret = 0;
++ int i, ret = 0, index = 0;
+ bool have_legacy_24 = false, have_legacy_5 = false;
+ uint8_t legacy_24[32], legacy_5[32];
+ int n_legacy_24 = 0, n_legacy_5 = 0;
+@@ -190,7 +190,22 @@ int set_bitrates(struct nl_msg *msg,
+ S_HE_LTF,
+ } parser_state = S_NONE;
+
+- for (i = 0; i < argc; i++) {
++ if (!strcmp(argv[0], "-l")) {
++ unsigned int link_id;
++ char *endptr;
++
++ link_id = strtol(argv[1], &endptr, 10);
++ if (*endptr)
++ return 1;
++
++ if (link_id > 15)
++ return 1;
++
++ nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id);
++ index = 2;
++ }
++
++ for (i = index; i < argc; i++) {
+ char *end;
+ double tmpd;
+ long tmpl;
+--
+2.18.0
+
diff --git a/recipes-wifi/iw/patches-mlo/0007-util-add-support-for-320Mhz-bandwidth.patch b/recipes-wifi/iw/patches-mlo/0007-util-add-support-for-320Mhz-bandwidth.patch
deleted file mode 100644
index 5794606..0000000
--- a/recipes-wifi/iw/patches-mlo/0007-util-add-support-for-320Mhz-bandwidth.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 81d112f13d290d109e0c64541c0f02a0931a7a8d Mon Sep 17 00:00:00 2001
-From: Mordechay Goodstein <mordechay.goodstein@intel.com>
-Date: Sun, 29 May 2022 19:29:55 +0300
-Subject: [PATCH 07/28] util: add support for 320Mhz bandwidth
-
-In the new standard 11be we can set up to 320Mhz bandwidth so add it
-in parsing params.
-
-Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- util.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/util.c b/util.c
-index 8a2ba10..93269ab 100644
---- a/util.c
-+++ b/util.c
-@@ -471,6 +471,7 @@ enum nl80211_chan_width str_to_bw(const char *str)
- { .name = "80", .val = NL80211_CHAN_WIDTH_80, },
- { .name = "80+80", .val = NL80211_CHAN_WIDTH_80P80, },
- { .name = "160", .val = NL80211_CHAN_WIDTH_160, },
-+ { .name = "320", .val = NL80211_CHAN_WIDTH_320, },
- };
- unsigned int i;
-
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0008-iw-add-per-link-txpower-config.patch b/recipes-wifi/iw/patches-mlo/0008-iw-add-per-link-txpower-config.patch
new file mode 100644
index 0000000..61bf8e0
--- /dev/null
+++ b/recipes-wifi/iw/patches-mlo/0008-iw-add-per-link-txpower-config.patch
@@ -0,0 +1,140 @@
+From 248f4644bcfcf5701fb3ab576736091b6eb4f662 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Wed, 5 Jun 2024 22:10:24 +0800
+Subject: [PATCH 08/10] iw: add per-link txpower config
+
+Add per-link txpower config & info dump
+
+CR-Id: WCNCR00274293
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ ieee80211.h | 3 +++
+ interface.c | 9 +++++++--
+ phy.c | 38 ++++++++++++++++++++++++++------------
+ 3 files changed, 36 insertions(+), 14 deletions(-)
+
+diff --git a/ieee80211.h b/ieee80211.h
+index 3713a4d..c86984d 100644
+--- a/ieee80211.h
++++ b/ieee80211.h
+@@ -75,4 +75,7 @@ struct ieee80211_vht_cap {
+ #define WLAN_CIPHER_SUITE_BIP_GMAC_256 SUITE(0x000FAC, 12)
+ #define WLAN_CIPHER_SUITE_BIP_CMAC_256 SUITE(0x000FAC, 13)
+
++/* multi-link device */
++#define IEEE80211_MLD_MAX_NUM_LINKS 15
++
+ #endif /* __IEEE80211 */
+diff --git a/interface.c b/interface.c
+index bb1a1d3..7a690fa 100644
+--- a/interface.c
++++ b/interface.c
+@@ -406,6 +406,7 @@ static int print_iface_handler(struct nl_msg *msg, void *arg)
+ struct nlattr *tb_msg[NL80211_ATTR_MAX + 1];
+ unsigned int *wiphy = arg;
+ const char *indent = "";
++ int32_t txp;
+
+ nla_parse(tb_msg, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
+ genlmsg_attrlen(gnlh, 0), NULL);
+@@ -449,8 +450,7 @@ static int print_iface_handler(struct nl_msg *msg, void *arg)
+ }
+
+ if (tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]) {
+- int32_t txp = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]);
+-
++ txp = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]);
+ printf("%s\ttxpower %d.%.2d dBm\n",
+ indent, txp / 100, txp % 100);
+ }
+@@ -490,6 +490,11 @@ static int print_iface_handler(struct nl_msg *msg, void *arg)
+ printf("\n%s\t ", indent);
+ print_channel(tb);
+ }
++ if (tb[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]) {
++ txp = nla_get_u32(tb[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]);
++ printf("\n%s\t ", indent);
++ printf("txpower %d.%.2d dBm", txp / 100, txp % 100);
++ }
+ printf("\n");
+ }
+ }
+diff --git a/phy.c b/phy.c
+index 584b103..f9a5b0f 100644
+--- a/phy.c
++++ b/phy.c
+@@ -686,37 +686,51 @@ static int handle_txpower(struct nl80211_state *state,
+ enum id_input id)
+ {
+ enum nl80211_tx_power_setting type;
+- int mbm;
++ unsigned int link_id;
++ int mbm, pos = 0;
++ char *endptr;
+
+- /* get the required args */
+- if (argc != 1 && argc != 2)
++ /* check args number */
++ if (argc < 1 && argc > 4)
+ return 1;
+
+- if (!strcmp(argv[0], "auto"))
++ if (!strcmp(argv[0], "-l")) {
++ link_id = strtol(argv[1], &endptr, 10);
++ if (*endptr)
++ return 1;
++
++ if (link_id >= IEEE80211_MLD_MAX_NUM_LINKS) {
++ printf("link id %d exceeds max number of links\n", link_id);
++ return 2;
++ }
++ NLA_PUT_U8(msg, NL80211_ATTR_MLO_LINK_ID, link_id);
++ pos += 2;
++ }
++
++ if (!strcmp(argv[pos], "auto"))
+ type = NL80211_TX_POWER_AUTOMATIC;
+- else if (!strcmp(argv[0], "fixed"))
++ else if (!strcmp(argv[pos], "fixed"))
+ type = NL80211_TX_POWER_FIXED;
+- else if (!strcmp(argv[0], "limit"))
++ else if (!strcmp(argv[pos], "limit"))
+ type = NL80211_TX_POWER_LIMITED;
+ else {
+- printf("Invalid parameter: %s\n", argv[0]);
++ printf("Invalid parameter: %s\n", argv[pos]);
+ return 2;
+ }
+
+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_TX_POWER_SETTING, type);
+
+ if (type != NL80211_TX_POWER_AUTOMATIC) {
+- char *endptr;
+- if (argc != 2) {
++ if (argc < 2 + pos) {
+ printf("Missing TX power level argument.\n");
+ return 2;
+ }
+
+- mbm = strtol(argv[1], &endptr, 10);
++ mbm = strtol(argv[pos + 1], &endptr, 10);
+ if (*endptr)
+ return 2;
+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_TX_POWER_LEVEL, mbm);
+- } else if (argc != 1)
++ } else if (argc != 1 + pos)
+ return 1;
+
+ return 0;
+@@ -727,7 +741,7 @@ static int handle_txpower(struct nl80211_state *state,
+ COMMAND(set, txpower, "<auto|fixed|limit> [<tx power in mBm>]",
+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_txpower,
+ "Specify transmit power level and setting type.");
+-COMMAND(set, txpower, "<auto|fixed|limit> [<tx power in mBm>]",
++COMMAND(set, txpower, "[-l <link_id>] <auto|fixed|limit> [<tx power in mBm>]",
+ NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_txpower,
+ "Specify transmit power level and setting type.");
+
+--
+2.18.0
+
diff --git a/recipes-wifi/iw/patches-mlo/0008-util-add-support-for-320MHz-bandwidth-without-cf1.patch b/recipes-wifi/iw/patches-mlo/0008-util-add-support-for-320MHz-bandwidth-without-cf1.patch
deleted file mode 100644
index 15aed5d..0000000
--- a/recipes-wifi/iw/patches-mlo/0008-util-add-support-for-320MHz-bandwidth-without-cf1.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From 997e5f13e7bc2267b28e541a2904d7f7d84227d0 Mon Sep 17 00:00:00 2001
-From: Mordechay Goodstein <mordechay.goodstein@intel.com>
-Date: Sun, 29 May 2022 19:29:55 +0300
-Subject: [PATCH 08/28] util: add support for 320MHz bandwidth without cf1
-
-Based on user input for control central freq and 320 BW find the data
-central freq (cf1).
-
-Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- phy.c | 4 ++--
- util.c | 16 +++++++++++++++-
- 2 files changed, 17 insertions(+), 3 deletions(-)
-
-diff --git a/phy.c b/phy.c
-index 0a57ecb..15cea32 100644
---- a/phy.c
-+++ b/phy.c
-@@ -199,13 +199,13 @@ static int handle_freq(struct nl80211_state *state, struct nl_msg *msg,
- }
-
- COMMAND(set, freq,
-- "<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz]\n"
-+ "<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]\n"
- "<control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]",
- NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_freq,
- "Set frequency/channel the hardware is using, including HT\n"
- "configuration.");
- COMMAND(set, freq,
-- "<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz]\n"
-+ "<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]\n"
- "<control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]",
- NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_freq, NULL);
-
-diff --git a/util.c b/util.c
-index 93269ab..80dc301 100644
---- a/util.c
-+++ b/util.c
-@@ -583,7 +583,7 @@ static int parse_freqs(struct chandef *chandef, int argc, char **argv,
- * <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz]
- *
- * And if frequency is set:
-- * <freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz]
-+ * <freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]
- * <control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]
- *
- * If the mode/channel width is not given the NOHT is assumed.
-@@ -1696,6 +1696,8 @@ int get_cf1(const struct chanmode *chanmode, unsigned long freq)
- 6195, 6995 };
- unsigned int bw160[] = { 5180, 5500, 5955, 6115, 6275, 6435,
- 6595, 6755, 6915 };
-+ /* based on 11be D2 E.1 Country information and operating classes */
-+ unsigned int bw320[] = {5955, 6115, 6275, 6435, 6595, 6755};
-
- switch (chanmode->width) {
- case NL80211_CHAN_WIDTH_80:
-@@ -1722,6 +1724,18 @@ int get_cf1(const struct chanmode *chanmode, unsigned long freq)
-
- cf1 = bw160[j] + 70;
- break;
-+ case NL80211_CHAN_WIDTH_320:
-+ /* setup center_freq1 */
-+ for (j = 0; j < ARRAY_SIZE(bw320); j++) {
-+ if (freq >= bw320[j] && freq < bw320[j] + 160)
-+ break;
-+ }
-+
-+ if (j == ARRAY_SIZE(bw320))
-+ break;
-+
-+ cf1 = bw320[j] + 150;
-+ break;
- default:
- cf1 = freq + chanmode->freq1_diff;
- break;
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0009-iw-scan-set-NL80211_SCAN_FLAG_COLOCATED_6GHZ-in-case.patch b/recipes-wifi/iw/patches-mlo/0009-iw-scan-set-NL80211_SCAN_FLAG_COLOCATED_6GHZ-in-case.patch
deleted file mode 100644
index 387088e..0000000
--- a/recipes-wifi/iw/patches-mlo/0009-iw-scan-set-NL80211_SCAN_FLAG_COLOCATED_6GHZ-in-case.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 29555e143d01de7570bdb5d11d9c785f6e59e6bf Mon Sep 17 00:00:00 2001
-From: Ayala Beker <ayala.beker@intel.com>
-Date: Thu, 14 Jul 2022 09:33:36 +0300
-Subject: [PATCH 09/28] iw: scan: set NL80211_SCAN_FLAG_COLOCATED_6GHZ in case
- of full sched scan
-
-Same as in regular scan, in case of full sched scan need to set
-NL80211_SCAN_FLAG_COLOCATED_6GHZ flag, to scan for collocated
-APs by default.
-
-Signed-off-by: Ayala Beker <ayala.beker@intel.com>
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- scan.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/scan.c b/scan.c
-index dfc136a..4c67c87 100644
---- a/scan.c
-+++ b/scan.c
-@@ -349,6 +349,8 @@ int parse_sched_scan(struct nl_msg *msg, int *argc, char ***argv)
- nla_put_nested(msg, NL80211_ATTR_SCAN_SSIDS, ssids);
- if (have_freqs)
- nla_put_nested(msg, NL80211_ATTR_SCAN_FREQUENCIES, freqs);
-+ else
-+ flags |= NL80211_SCAN_FLAG_COLOCATED_6GHZ;
- if (have_matchset)
- nla_put_nested(msg, NL80211_ATTR_SCHED_SCAN_MATCH, matchset);
- if (have_plans)
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0009-mtk-wifi-iw-dump-links-information-in-station-dump.patch b/recipes-wifi/iw/patches-mlo/0009-mtk-wifi-iw-dump-links-information-in-station-dump.patch
new file mode 100644
index 0000000..f6c01f0
--- /dev/null
+++ b/recipes-wifi/iw/patches-mlo/0009-mtk-wifi-iw-dump-links-information-in-station-dump.patch
@@ -0,0 +1,94 @@
+From be69477058da6305cceb451a8449f41f8f9fe24d Mon Sep 17 00:00:00 2001
+From: Peter Chiu <chui-hao.chiu@mediatek.com>
+Date: Tue, 11 Jun 2024 11:18:41 +0800
+Subject: [PATCH 09/10] mtk: wifi: iw: dump links information in station dump
+
+Parse and show the following link information
+1. link address
+2. Rssi
+3. Tx rate
+4. Rx rate
+5. dtim period
+4. beacon interval
+
+CR-Id: WCNCR00240772
+Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
+Change-Id: Ia6122b7938a38ca0b2eb5060c21193f705d48181
+---
+ station.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 60 insertions(+)
+
+diff --git a/station.c b/station.c
+index bf7c0f5..e91cb73 100644
+--- a/station.c
++++ b/station.c
+@@ -636,6 +636,66 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)
+ }
+
+ printf("\n\tcurrent time:\t%llu ms\n", now_ms);
++
++ printf("\t*** MLD Information ***");
++ if (tb[NL80211_ATTR_MLO_LINK_ID])
++ printf("\n\tSetup link = %d", nla_get_u8(tb[NL80211_ATTR_MLO_LINK_ID]));
++
++ if (tb[NL80211_ATTR_MLD_ADDR]) {
++ mac_addr_n2a(mac_addr, nla_data(tb[NL80211_ATTR_MLD_ADDR]));
++ printf("\n\tMLD Address: %s", mac_addr);
++ }
++
++ if (tb[NL80211_ATTR_MLO_LINKS]) {
++ struct nlattr *link;
++ char buf[100];
++ int rem;
++
++ nla_for_each_nested(link, tb[NL80211_ATTR_MLO_LINKS], rem) {
++ struct nlattr *tb_link[NL80211_ATTR_MAX + 1];
++
++ nla_parse_nested(tb_link, NL80211_ATTR_MAX, link, NULL);
++
++ if (tb_link[NL80211_ATTR_MLO_LINK_ID])
++ printf("\n\t***** Link ID: %2d *****",
++ nla_get_u32(tb_link[NL80211_ATTR_MLO_LINK_ID]));
++ if (tb_link[NL80211_ATTR_MAC]) {
++ mac_addr_n2a(buf, nla_data(tb_link[NL80211_ATTR_MAC]));
++ printf("\n\tLink addr: %s", buf);
++ }
++ if (nla_parse_nested(sinfo, NL80211_STA_INFO_MAX,
++ tb_link[NL80211_ATTR_STA_INFO],
++ stats_policy)) {
++ fprintf(stderr, "failed to parse nested attributes!\n");
++ return NL_SKIP;
++ }
++ if (sinfo[NL80211_STA_INFO_TX_BITRATE]) {
++ parse_bitrate(sinfo[NL80211_STA_INFO_TX_BITRATE],
++ buf, sizeof(buf));
++ printf("\n\ttx bitrate:\t%s", buf);
++ }
++ if (sinfo[NL80211_STA_INFO_RX_BITRATE]) {
++ parse_bitrate(sinfo[NL80211_STA_INFO_RX_BITRATE],
++ buf, sizeof(buf));
++ printf("\n\trx bitrate:\t%s", buf);
++ }
++ chain = get_chain_signal(sinfo[NL80211_STA_INFO_CHAIN_SIGNAL]);
++ if (sinfo[NL80211_STA_INFO_SIGNAL])
++ printf("\n\tsignal: \t%d %sdBm",
++ (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL]),
++ chain);
++
++ chain = get_chain_signal(sinfo[NL80211_STA_INFO_CHAIN_SIGNAL_AVG]);
++ if (sinfo[NL80211_STA_INFO_SIGNAL_AVG])
++ printf("\n\tsignal avg:\t%d %sdBm",
++ (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL_AVG]),
++ chain);
++
++ if (sinfo[NL80211_STA_INFO_BSS_PARAM])
++ parse_bss_param(sinfo[NL80211_STA_INFO_BSS_PARAM]);
++ }
++ }
++ printf("\n");
+ return NL_SKIP;
+ }
+
+--
+2.18.0
+
diff --git a/recipes-wifi/iw/patches-mlo/0010-iw-add-per-radio-antenna-config.patch b/recipes-wifi/iw/patches-mlo/0010-iw-add-per-radio-antenna-config.patch
new file mode 100644
index 0000000..8a009fe
--- /dev/null
+++ b/recipes-wifi/iw/patches-mlo/0010-iw-add-per-radio-antenna-config.patch
@@ -0,0 +1,170 @@
+From a050861779a1e01ad2079830336b67d926ed7af7 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Thu, 13 Jun 2024 16:48:00 +0800
+Subject: [PATCH 10/10] iw: add per-radio antenna config
+
+Add per-radio antenna config & info dump
+Currently, there is no radio index or supported band bitmap in wiphy data struct
+& NL80211 ATTRS.
+Therefore, we just use NL80211_BANDS_XX to specify the radio we desire
+to config.
+
+CR-Id: WCNCR00274293
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Change-Id: Ibf0b3efb99b7568ba2195358cbb5483f2d91794a
+---
+ info.c | 49 +++++++++++++++++++++++++++++++++++++++++--------
+ phy.c | 50 ++++++++++++++++++++++++++++++++++++++++----------
+ 2 files changed, 81 insertions(+), 18 deletions(-)
+
+diff --git a/info.c b/info.c
+index c5e863f..ddfef67 100644
+--- a/info.c
++++ b/info.c
+@@ -335,6 +335,14 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
+ static int last_band = -1;
+ static bool band_had_freq = false;
+ bool print_name = true;
++ static const char * const bands[] = {
++ [NL80211_BAND_2GHZ] = "2G",
++ [NL80211_BAND_5GHZ] = "5G",
++ [NL80211_BAND_60GHZ] = "60G",
++ [NL80211_BAND_6GHZ] = "6G",
++ [NL80211_BAND_S1GHZ] = "S1G",
++ [NL80211_BAND_LC] = "LC",
++ };
+
+ nla_parse(tb_msg, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
+ genlmsg_attrlen(gnlh, 0), NULL);
+@@ -540,16 +548,41 @@ next:
+ }
+
+ if (tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX] &&
+- tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX])
+- printf("\tAvailable Antennas: TX %#x RX %#x\n",
+- nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX]),
+- nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX]));
++ tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX]) {
++ int i, tx_num, rx_num;
++ __u32 *avail_ants_tx, *avail_ants_rx;
++
++ tx_num = nla_len(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX]) / sizeof(__u32);
++ rx_num = nla_len(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX]) / sizeof(__u32);
++ if (tx_num == rx_num && tx_num == NUM_NL80211_BANDS) {
++ avail_ants_tx = nla_data(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX]);
++ avail_ants_rx = nla_data(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX]);
++ printf("\tAvailable Antennas:\n");
++ for (i = 0; i < tx_num; i++)
++ if (avail_ants_tx[i] && avail_ants_rx[i])
++ printf("\t\t%s band: TX %#x RX %#x\n",
++ bands[i], avail_ants_tx[i],
++ avail_ants_rx[i]);
++ }
++ }
+
+ if (tb_msg[NL80211_ATTR_WIPHY_ANTENNA_TX] &&
+- tb_msg[NL80211_ATTR_WIPHY_ANTENNA_RX])
+- printf("\tConfigured Antennas: TX %#x RX %#x\n",
+- nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_TX]),
+- nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_RX]));
++ tb_msg[NL80211_ATTR_WIPHY_ANTENNA_RX]) {
++ int i, tx_num, rx_num;
++ __u32 *ants_tx, *ants_rx;
++
++ tx_num = nla_len(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_TX]) / sizeof(__u32);
++ rx_num = nla_len(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_RX]) / sizeof(__u32);
++ if (tx_num == rx_num && tx_num == NUM_NL80211_BANDS) {
++ ants_tx = nla_data(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_TX]);
++ ants_rx = nla_data(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_RX]);
++ printf("\tConfigured Antennas:\n");
++ for (i = 0; i < tx_num; i++)
++ if (ants_tx[i] && ants_rx[i])
++ printf("\t\t%s band: TX %#x RX %#x\n",
++ bands[i], ants_tx[i], ants_rx[i]);
++ }
++ }
+
+ if (tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES])
+ print_iftype_list("\tSupported interface modes", "\t\t",
+diff --git a/phy.c b/phy.c
+index f9a5b0f..594fb25 100644
+--- a/phy.c
++++ b/phy.c
+@@ -752,34 +752,64 @@ static int handle_antenna(struct nl80211_state *state,
+ {
+ char *end;
+ uint32_t tx_ant = 0, rx_ant = 0;
++ uint32_t tx_ants[NUM_NL80211_BANDS], rx_ants[NUM_NL80211_BANDS];
++ int i = 0, bands = 0xffffffff;
++
++ if (!strncmp(argv[0], "-b", 2)) {
++ bands = 0;
++ for (i = 1; i < argc; i++) {
++ if (!strncasecmp("2ghz", argv[i], 4))
++ bands |= BIT(NL80211_BAND_2GHZ);
++ else if (!strncasecmp("5ghz", argv[i], 4))
++ bands |= BIT(NL80211_BAND_5GHZ);
++ else if (!strncasecmp("6ghz", argv[i], 4))
++ bands |= BIT(NL80211_BAND_6GHZ);
++ else
++ break;
++ }
++
++ if (i == 1) {
++ printf("Missing configured bands argument.\n");
++ return 2;
++ }
++ }
+
+- if (argc == 1 && strcmp(argv[0], "all") == 0) {
++ if (argc == 1 + i && strncmp(argv[i], "all", 3) == 0) {
+ tx_ant = 0xffffffff;
+ rx_ant = 0xffffffff;
+- } else if (argc == 1) {
+- tx_ant = rx_ant = strtoul(argv[0], &end, 0);
++ } else if (argc == 1 + i) {
++ tx_ant = rx_ant = strtoul(argv[i], &end, 0);
+ if (*end)
+ return 1;
+- }
+- else if (argc == 2) {
+- tx_ant = strtoul(argv[0], &end, 0);
++ } else if (argc == 2 + i) {
++ tx_ant = strtoul(argv[i], &end, 0);
+ if (*end)
+ return 1;
+- rx_ant = strtoul(argv[1], &end, 0);
++ rx_ant = strtoul(argv[i + 1], &end, 0);
+ if (*end)
+ return 1;
+ } else
+ return 1;
+
+- NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_TX, tx_ant);
+- NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_RX, rx_ant);
++ memset(tx_ants, 0, sizeof(tx_ants));
++ memset(rx_ants, 0, sizeof(rx_ants));
++ for (i = 0; i < NUM_NL80211_BANDS; i++) {
++ if (!(bands & BIT(i)))
++ continue;
++
++ tx_ants[i] = tx_ant;
++ rx_ants[i] = rx_ant;
++ }
++
++ NLA_PUT(msg, NL80211_ATTR_WIPHY_ANTENNA_TX, sizeof(tx_ants), tx_ants);
++ NLA_PUT(msg, NL80211_ATTR_WIPHY_ANTENNA_RX, sizeof(rx_ants), rx_ants);
+
+ return 0;
+
+ nla_put_failure:
+ return -ENOBUFS;
+ }
+-COMMAND(set, antenna, "<bitmap> | all | <tx bitmap> <rx bitmap>",
++COMMAND(set, antenna, "[-b [2GHz] [5GHz] [6GHz]] <bitmap> | all | <tx bitmap> <rx bitmap>",
+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_antenna,
+ "Set a bitmap of allowed antennas to use for TX and RX.\n"
+ "The driver may reject antenna configurations it cannot support.");
+--
+2.18.0
+
diff --git a/recipes-wifi/iw/patches-mlo/0010-link-fix-some-formatting.patch b/recipes-wifi/iw/patches-mlo/0010-link-fix-some-formatting.patch
deleted file mode 100644
index db9f35a..0000000
--- a/recipes-wifi/iw/patches-mlo/0010-link-fix-some-formatting.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 5f64b702482d5818b8573d12ef1b58af00bbd81d Mon Sep 17 00:00:00 2001
-From: Johannes Berg <johannes.berg@intel.com>
-Date: Wed, 31 Aug 2022 21:13:11 +0200
-Subject: [PATCH 10/28] link: fix some formatting
-
-The bss flags has a spurious newline, and we don't use a
-tab for indentation after the colon in other places, fix
-that here.
-
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- link.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/link.c b/link.c
-index 2074488..31de8b4 100644
---- a/link.c
-+++ b/link.c
-@@ -181,7 +181,7 @@ static int print_link_sta(struct nl_msg *msg, void *arg)
- fprintf(stderr, "failed to parse nested bss parameters!\n");
- } else {
- char *delim = "";
-- printf("\n\tbss flags:\t");
-+ printf("\tbss flags: ");
- if (binfo[NL80211_STA_BSS_PARAM_CTS_PROT]) {
- printf("CTS-protection");
- delim = " ";
-@@ -192,9 +192,9 @@ static int print_link_sta(struct nl_msg *msg, void *arg)
- }
- if (binfo[NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME])
- printf("%sshort-slot-time", delim);
-- printf("\n\tdtim period:\t%d",
-+ printf("\n\tdtim period: %d",
- nla_get_u8(binfo[NL80211_STA_BSS_PARAM_DTIM_PERIOD]));
-- printf("\n\tbeacon int:\t%d",
-+ printf("\n\tbeacon int: %d",
- nla_get_u16(binfo[NL80211_STA_BSS_PARAM_BEACON_INTERVAL]));
- printf("\n");
- }
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0011-link-update-for-MLO.patch b/recipes-wifi/iw/patches-mlo/0011-link-update-for-MLO.patch
deleted file mode 100644
index 94cce68..0000000
--- a/recipes-wifi/iw/patches-mlo/0011-link-update-for-MLO.patch
+++ /dev/null
@@ -1,172 +0,0 @@
-From 221875eb77f21d8cf1c50f046705f30708ec82bd Mon Sep 17 00:00:00 2001
-From: Johannes Berg <johannes.berg@intel.com>
-Date: Wed, 31 Aug 2022 22:35:02 +0200
-Subject: [PATCH 11/28] link: update for MLO
-
-In MLO we need to use the MLD address to get the station
-statistics (which still need work for per-link stats),
-adjust the code.
-
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- iw.h | 2 ++
- link.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++-----------
- scan.c | 3 ++-
- 3 files changed, 55 insertions(+), 12 deletions(-)
-
-diff --git a/iw.h b/iw.h
-index e712c59..45e4fbe 100644
---- a/iw.h
-+++ b/iw.h
-@@ -242,6 +242,8 @@ const char *get_status_str(uint16_t status);
- enum print_ie_type {
- PRINT_SCAN,
- PRINT_LINK,
-+ PRINT_LINK_MLO_MLD,
-+ PRINT_LINK_MLO_LINK,
- };
-
- #define BIT(x) (1ULL<<(x))
-diff --git a/link.c b/link.c
-index 31de8b4..a090100 100644
---- a/link.c
-+++ b/link.c
-@@ -13,9 +13,10 @@
- #include "iw.h"
-
- struct link_result {
-- uint8_t bssid[8];
-+ uint8_t sta_addr[8];
- bool link_found;
- bool anything_found;
-+ bool mld;
- };
-
- static struct link_result lr = { .link_found = false };
-@@ -37,7 +38,9 @@ static int link_bss_handler(struct nl_msg *msg, void *arg)
- [NL80211_BSS_STATUS] = { .type = NLA_U32 },
- };
- struct link_result *result = arg;
-- char mac_addr[20], dev[20];
-+ char mac_addr[20], dev[20], link_addr[20];
-+ int link_id = -1;
-+ const char *indent = "\t";
-
- nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
- genlmsg_attrlen(gnlh, 0), NULL);
-@@ -62,9 +65,44 @@ static int link_bss_handler(struct nl_msg *msg, void *arg)
- mac_addr_n2a(mac_addr, nla_data(bss[NL80211_BSS_BSSID]));
- if_indextoname(nla_get_u32(tb[NL80211_ATTR_IFINDEX]), dev);
-
-+ if (bss[NL80211_BSS_MLO_LINK_ID])
-+ link_id = nla_get_u8(bss[NL80211_BSS_MLO_LINK_ID]);
-+
-+ if (bss[NL80211_BSS_MLD_ADDR]) {
-+ mac_addr_n2a(link_addr, nla_data(bss[NL80211_BSS_BSSID]));
-+ indent = "\t\t";
-+
-+ if (result->mld) {
-+ if (memcmp(result->sta_addr,
-+ nla_data(bss[NL80211_BSS_MLD_ADDR]), 6)) {
-+ mac_addr_n2a(mac_addr, nla_data(bss[NL80211_BSS_MLD_ADDR]));
-+ printf("!! inconsistent MLD address information (%s)\n",
-+ mac_addr);
-+ }
-+ } else {
-+ mac_addr_n2a(mac_addr, nla_data(bss[NL80211_BSS_MLD_ADDR]));
-+ result->mld = true;
-+ memcpy(result->sta_addr,
-+ nla_data(bss[NL80211_BSS_MLD_ADDR]), 6);
-+ if (nla_get_u32(bss[NL80211_BSS_STATUS]) == NL80211_BSS_STATUS_ASSOCIATED) {
-+ printf("Connected to %s (on %s)\n", mac_addr, dev);
-+ }
-+
-+ if (bss[NL80211_BSS_INFORMATION_ELEMENTS])
-+ print_ies(nla_data(bss[NL80211_BSS_INFORMATION_ELEMENTS]),
-+ nla_len(bss[NL80211_BSS_INFORMATION_ELEMENTS]),
-+ false, PRINT_LINK_MLO_MLD);
-+ }
-+ } else {
-+ memcpy(result->sta_addr, nla_data(bss[NL80211_BSS_BSSID]), 6);
-+ }
-+
- switch (nla_get_u32(bss[NL80211_BSS_STATUS])) {
- case NL80211_BSS_STATUS_ASSOCIATED:
-- printf("Connected to %s (on %s)\n", mac_addr, dev);
-+ if (result->mld)
-+ printf("\tLink %d BSSID %s\n", link_id, link_addr);
-+ else
-+ printf("Connected to %s (on %s)\n", mac_addr, dev);
- break;
- case NL80211_BSS_STATUS_AUTHENTICATED:
- printf("Authenticated with %s (on %s)\n", mac_addr, dev);
-@@ -81,10 +119,10 @@ static int link_bss_handler(struct nl_msg *msg, void *arg)
- if (bss[NL80211_BSS_INFORMATION_ELEMENTS])
- print_ies(nla_data(bss[NL80211_BSS_INFORMATION_ELEMENTS]),
- nla_len(bss[NL80211_BSS_INFORMATION_ELEMENTS]),
-- false, PRINT_LINK);
-+ false, result->mld ? PRINT_LINK_MLO_LINK : PRINT_LINK);
-
- if (bss[NL80211_BSS_FREQUENCY])
-- printf("\tfreq: %d\n",
-+ printf("%sfreq: %d\n", indent,
- nla_get_u32(bss[NL80211_BSS_FREQUENCY]));
-
- if (nla_get_u32(bss[NL80211_BSS_STATUS]) != NL80211_BSS_STATUS_ASSOCIATED)
-@@ -92,7 +130,6 @@ static int link_bss_handler(struct nl_msg *msg, void *arg)
-
- /* only in the assoc case do we want more info from station get */
- result->link_found = true;
-- memcpy(result->bssid, nla_data(bss[NL80211_BSS_BSSID]), 6);
- return NL_SKIP;
- }
-
-@@ -250,7 +287,7 @@ static int handle_link(struct nl80211_state *state,
- NULL,
- NULL,
- };
-- char bssid_buf[3*6];
-+ char addr_buf[3*6];
- int err;
-
- link_argv[0] = argv[0];
-@@ -264,15 +301,18 @@ static int handle_link(struct nl80211_state *state,
- return 0;
- }
-
-- mac_addr_n2a(bssid_buf, lr.bssid);
-- bssid_buf[17] = '\0';
-+ mac_addr_n2a(addr_buf, lr.sta_addr);
-+ addr_buf[17] = '\0';
-+
-+ if (lr.mld)
-+ printf("MLD %s stats:\n", addr_buf);
-
- station_argv[0] = argv[0];
-- station_argv[3] = bssid_buf;
-+ station_argv[3] = addr_buf;
- return handle_cmd(state, id, 4, station_argv);
- }
- TOPLEVEL(link, NULL, 0, 0, CIB_NETDEV, handle_link,
-- "Print information about the current link, if any.");
-+ "Print information about the current connection, if any.");
- HIDDEN(link, get_sta, "<mac-addr>", NL80211_CMD_GET_STATION, 0,
- CIB_NETDEV, handle_link_sta);
- HIDDEN(link, get_bss, NULL, NL80211_CMD_GET_SCAN, NLM_F_DUMP,
-diff --git a/scan.c b/scan.c
-index 4c67c87..dc26787 100644
---- a/scan.c
-+++ b/scan.c
-@@ -1717,7 +1717,8 @@ static void print_ie(const struct ie_print *p, const uint8_t type, uint8_t len,
- }
-
- static const struct ie_print ieprinters[] = {
-- [0] = { "SSID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), },
-+ [0] = { "SSID", print_ssid, 0, 32,
-+ BIT(PRINT_SCAN) | BIT(PRINT_LINK) | BIT(PRINT_LINK_MLO_MLD), },
- [1] = { "Supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), },
- [3] = { "DS Parameter set", print_ds, 1, 1, BIT(PRINT_SCAN), },
- [5] = { "TIM", print_tim, 4, 255, BIT(PRINT_SCAN), },
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0012-interface-print-links.patch b/recipes-wifi/iw/patches-mlo/0012-interface-print-links.patch
deleted file mode 100644
index 9e6c1a4..0000000
--- a/recipes-wifi/iw/patches-mlo/0012-interface-print-links.patch
+++ /dev/null
@@ -1,114 +0,0 @@
-From 7794573f915174b5dd2cd22e123ecd63610ccf44 Mon Sep 17 00:00:00 2001
-From: Johannes Berg <johannes.berg@intel.com>
-Date: Fri, 2 Sep 2022 21:59:31 +0200
-Subject: [PATCH 12/28] interface: print links
-
-Print link information in 'iw dev' and 'iw ... info'.
-
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- interface.c | 74 ++++++++++++++++++++++++++++++++++++++---------------
- 1 file changed, 53 insertions(+), 21 deletions(-)
-
-diff --git a/interface.c b/interface.c
-index 84990c9..7e1dd58 100644
---- a/interface.c
-+++ b/interface.c
-@@ -369,6 +369,30 @@ char *channel_width_name(enum nl80211_chan_width width)
- }
- }
-
-+static void print_channel(struct nlattr **tb)
-+{
-+ uint32_t freq = nla_get_u32(tb[NL80211_ATTR_WIPHY_FREQ]);
-+
-+ printf("channel %d (%d MHz)",
-+ ieee80211_frequency_to_channel(freq), freq);
-+
-+ if (tb[NL80211_ATTR_CHANNEL_WIDTH]) {
-+ printf(", width: %s",
-+ channel_width_name(nla_get_u32(tb[NL80211_ATTR_CHANNEL_WIDTH])));
-+ if (tb[NL80211_ATTR_CENTER_FREQ1])
-+ printf(", center1: %d MHz",
-+ nla_get_u32(tb[NL80211_ATTR_CENTER_FREQ1]));
-+ if (tb[NL80211_ATTR_CENTER_FREQ2])
-+ printf(", center2: %d MHz",
-+ nla_get_u32(tb[NL80211_ATTR_CENTER_FREQ2]));
-+ } else if (tb[NL80211_ATTR_WIPHY_CHANNEL_TYPE]) {
-+ enum nl80211_channel_type channel_type;
-+
-+ channel_type = nla_get_u32(tb[NL80211_ATTR_WIPHY_CHANNEL_TYPE]);
-+ printf(" %s", channel_type_name(channel_type));
-+ }
-+}
-+
- static int print_iface_handler(struct nl_msg *msg, void *arg)
- {
- struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
-@@ -412,27 +436,8 @@ static int print_iface_handler(struct nl_msg *msg, void *arg)
- if (!wiphy && tb_msg[NL80211_ATTR_WIPHY])
- printf("%s\twiphy %d\n", indent, nla_get_u32(tb_msg[NL80211_ATTR_WIPHY]));
- if (tb_msg[NL80211_ATTR_WIPHY_FREQ]) {
-- uint32_t freq = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_FREQ]);
--
-- printf("%s\tchannel %d (%d MHz)", indent,
-- ieee80211_frequency_to_channel(freq), freq);
--
-- if (tb_msg[NL80211_ATTR_CHANNEL_WIDTH]) {
-- printf(", width: %s",
-- channel_width_name(nla_get_u32(tb_msg[NL80211_ATTR_CHANNEL_WIDTH])));
-- if (tb_msg[NL80211_ATTR_CENTER_FREQ1])
-- printf(", center1: %d MHz",
-- nla_get_u32(tb_msg[NL80211_ATTR_CENTER_FREQ1]));
-- if (tb_msg[NL80211_ATTR_CENTER_FREQ2])
-- printf(", center2: %d MHz",
-- nla_get_u32(tb_msg[NL80211_ATTR_CENTER_FREQ2]));
-- } else if (tb_msg[NL80211_ATTR_WIPHY_CHANNEL_TYPE]) {
-- enum nl80211_channel_type channel_type;
--
-- channel_type = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_CHANNEL_TYPE]);
-- printf(" %s", channel_type_name(channel_type));
-- }
--
-+ printf("%s\t", indent);
-+ print_channel(tb_msg);
- printf("\n");
- }
-
-@@ -455,6 +460,33 @@ static int print_iface_handler(struct nl_msg *msg, void *arg)
- printf("%s\t4addr: on\n", indent);
- }
-
-+ if (tb_msg[NL80211_ATTR_MLO_LINKS]) {
-+ struct nlattr *link;
-+ int n;
-+
-+ printf("%s\tMLD with links:\n", indent);
-+
-+ nla_for_each_nested(link, tb_msg[NL80211_ATTR_MLO_LINKS], n) {
-+ struct nlattr *tb[NL80211_ATTR_MAX + 1];
-+
-+ nla_parse_nested(tb, NL80211_ATTR_MAX, link, NULL);
-+ printf("%s\t - link", indent);
-+ if (tb[NL80211_ATTR_MLO_LINK_ID])
-+ printf(" ID %2d", nla_get_u32(tb[NL80211_ATTR_MLO_LINK_ID]));
-+ if (tb[NL80211_ATTR_MAC]) {
-+ char buf[20];
-+
-+ mac_addr_n2a(buf, nla_data(tb[NL80211_ATTR_MAC]));
-+ printf(" link addr %s", buf);
-+ }
-+ if (tb[NL80211_ATTR_WIPHY_FREQ]) {
-+ printf("\n%s\t ", indent);
-+ print_channel(tb);
-+ }
-+ printf("\n");
-+ }
-+ }
-+
- return NL_SKIP;
- }
-
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0013-util-don-t-print-EHT-info-if-not-present.patch b/recipes-wifi/iw/patches-mlo/0013-util-don-t-print-EHT-info-if-not-present.patch
deleted file mode 100644
index 105e927..0000000
--- a/recipes-wifi/iw/patches-mlo/0013-util-don-t-print-EHT-info-if-not-present.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From f5e3b43de3a5e3e6332106282bbcaf336e8204a5 Mon Sep 17 00:00:00 2001
-From: Johannes Berg <johannes.berg@intel.com>
-Date: Wed, 15 Mar 2023 16:08:22 +0100
-Subject: [PATCH 13/28] util: don't print EHT info if not present
-
-That's just confusing, don't print it if the EHT MAC
-capabilities attribute isn't there (the kernel puts
-all the attrs together.)
-
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- util.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/util.c b/util.c
-index 80dc301..50e3fbc 100644
---- a/util.c
-+++ b/util.c
-@@ -1593,7 +1593,8 @@ void print_eht_info(struct nlattr *nl_iftype, int band)
- nla_parse(tb, NL80211_BAND_IFTYPE_ATTR_MAX,
- nla_data(nl_iftype), nla_len(nl_iftype), NULL);
-
-- if (!tb[NL80211_BAND_IFTYPE_ATTR_IFTYPES])
-+ if (!tb[NL80211_BAND_IFTYPE_ATTR_IFTYPES] ||
-+ !tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC])
- return;
-
- printf("\t\tEHT Iftypes: ");
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0014-iw-S1G-add-frequency-set-in-kHz-and-offset-options.patch b/recipes-wifi/iw/patches-mlo/0014-iw-S1G-add-frequency-set-in-kHz-and-offset-options.patch
deleted file mode 100644
index 316d754..0000000
--- a/recipes-wifi/iw/patches-mlo/0014-iw-S1G-add-frequency-set-in-kHz-and-offset-options.patch
+++ /dev/null
@@ -1,361 +0,0 @@
-From a32046bcffcb766b4999e76399b755887d2d5d0b Mon Sep 17 00:00:00 2001
-From: Gilad Itzkovitch <gilad.itzkovitch@morsemicro.com>
-Date: Mon, 27 Feb 2023 15:05:29 +1300
-Subject: [PATCH 14/28] iw: S1G: add frequency set in kHz and offset options
-
-This change adds support to specify the set frequency in kHz for
-the set frequency command which include an offset whenever needed.
-Also, it adds S1G bandwidth options to the selected chandef.
-
-Signed-off-by: Gilad Itzkovitch <gilad.itzkovitch@morsemicro.com>
-Link: https://lore.kernel.org/r/20230227020529.504934-1-gilad.itzkovitch@virscient.com
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- ap.c | 2 +-
- ibss.c | 2 +-
- interface.c | 2 +-
- iw.h | 5 +++-
- mesh.c | 2 +-
- ocb.c | 2 +-
- phy.c | 37 ++++++++++++++++++++++-----
- util.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++-----
- 8 files changed, 106 insertions(+), 18 deletions(-)
-
-diff --git a/ap.c b/ap.c
-index db9efb7..748576d 100644
---- a/ap.c
-+++ b/ap.c
-@@ -28,7 +28,7 @@ static int handle_start_ap(struct nl80211_state *state,
- argc--;
-
- /* chandef */
-- res = parse_freqchan(&chandef, false, argc, argv, &parsed);
-+ res = parse_freqchan(&chandef, false, argc, argv, &parsed, false);
- if (res)
- return res;
- argc -= parsed;
-diff --git a/ibss.c b/ibss.c
-index f6cbc4c..6e6a835 100644
---- a/ibss.c
-+++ b/ibss.c
-@@ -30,7 +30,7 @@ static int join_ibss(struct nl80211_state *state,
- argv++;
- argc--;
-
-- err = parse_freqchan(&chandef, false, argc, argv, &parsed);
-+ err = parse_freqchan(&chandef, false, argc, argv, &parsed, false);
- if (err)
- return err;
-
-diff --git a/interface.c b/interface.c
-index 7e1dd58..eeef496 100644
---- a/interface.c
-+++ b/interface.c
-@@ -701,7 +701,7 @@ static int handle_chanfreq(struct nl80211_state *state, struct nl_msg *msg,
- int parsed;
- char *end;
-
-- res = parse_freqchan(&chandef, chan, argc, argv, &parsed);
-+ res = parse_freqchan(&chandef, chan, argc, argv, &parsed, false);
- if (res)
- return res;
-
-diff --git a/iw.h b/iw.h
-index 45e4fbe..19c76cf 100644
---- a/iw.h
-+++ b/iw.h
-@@ -102,7 +102,9 @@ struct chandef {
- enum nl80211_chan_width width;
-
- unsigned int control_freq;
-+ unsigned int control_freq_offset;
- unsigned int center_freq1;
-+ unsigned int center_freq1_offset;
- unsigned int center_freq2;
- };
-
-@@ -207,7 +209,8 @@ int parse_hex_mask(char *hexmask, unsigned char **result, size_t *result_len,
- unsigned char *parse_hex(char *hex, size_t *outlen);
-
- int parse_keys(struct nl_msg *msg, char **argv[], int *argc);
--int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv, int *parsed);
-+int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv,
-+ int *parsed, bool freq_in_khz);
- enum nl80211_chan_width str_to_bw(const char *str);
- int parse_txq_stats(char *buf, int buflen, struct nlattr *tid_stats_attr, int header,
- int tid, const char *indent);
-diff --git a/mesh.c b/mesh.c
-index 0fb98a3..40e5e5e 100644
---- a/mesh.c
-+++ b/mesh.c
-@@ -485,7 +485,7 @@ static int join_mesh(struct nl80211_state *state,
- int err, parsed;
-
- err = parse_freqchan(&chandef, false, argc - 1, argv + 1,
-- &parsed);
-+ &parsed, false);
- if (err)
- return err;
-
-diff --git a/ocb.c b/ocb.c
-index fc9579b..ee0eedf 100644
---- a/ocb.c
-+++ b/ocb.c
-@@ -16,7 +16,7 @@ static int join_ocb(struct nl80211_state *state,
- if (argc < 2)
- return 1;
-
-- err = parse_freqchan(&chandef, false, argc, argv, &parsed);
-+ err = parse_freqchan(&chandef, false, argc, argv, &parsed, false);
-
- if (err)
- return err;
-diff --git a/phy.c b/phy.c
-index 15cea32..4722125 100644
---- a/phy.c
-+++ b/phy.c
-@@ -191,7 +191,7 @@ static int handle_freq(struct nl80211_state *state, struct nl_msg *msg,
- struct chandef chandef;
- int res;
-
-- res = parse_freqchan(&chandef, false, argc, argv, NULL);
-+ res = parse_freqchan(&chandef, false, argc, argv, NULL, false);
- if (res)
- return res;
-
-@@ -209,6 +209,31 @@ COMMAND(set, freq,
- "<control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]",
- NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_freq, NULL);
-
-+static int handle_freq_khz(struct nl80211_state *state, struct nl_msg *msg,
-+ int argc, char **argv,
-+ enum id_input id)
-+{
-+ struct chandef chandef;
-+ int res;
-+
-+ res = parse_freqchan(&chandef, false, argc, argv, NULL, true);
-+ if (res)
-+ return res;
-+
-+ return put_chandef(msg, &chandef);
-+}
-+
-+COMMAND(set, freq_khz,
-+ "<freq> [1MHz|2MHz|4MHz|8MHz|16MHz]\n"
-+ "<control freq> [1|2|4|8|16] [<center1_freq> [<center2_freq>]]",
-+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_freq_khz,
-+ "Set frequency in kHz the hardware is using\n"
-+ "configuration.");
-+COMMAND(set, freq_khz,
-+ "<freq> [1MHz|2MHz|4MHz|8MHz|16MHz]\n"
-+ "<control freq> [1|2|4|8|16] [<center1_freq> [<center2_freq>]]",
-+ NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_freq_khz, NULL);
-+
- static int handle_chan(struct nl80211_state *state, struct nl_msg *msg,
- int argc, char **argv,
- enum id_input id)
-@@ -216,7 +241,7 @@ static int handle_chan(struct nl80211_state *state, struct nl_msg *msg,
- struct chandef chandef;
- int res;
-
-- res = parse_freqchan(&chandef, true, argc, argv, NULL);
-+ res = parse_freqchan(&chandef, true, argc, argv, NULL, false);
- if (res)
- return res;
-
-@@ -288,9 +313,9 @@ static int handle_cac_trigger(struct nl80211_state *state,
- return 1;
-
- if (strcmp(argv[0], "channel") == 0) {
-- res = parse_freqchan(&chandef, true, argc - 1, argv + 1, NULL);
-+ res = parse_freqchan(&chandef, true, argc - 1, argv + 1, NULL, false);
- } else if (strcmp(argv[0], "freq") == 0) {
-- res = parse_freqchan(&chandef, false, argc - 1, argv + 1, NULL);
-+ res = parse_freqchan(&chandef, false, argc - 1, argv + 1, NULL, false);
- } else {
- return 1;
- }
-@@ -334,9 +359,9 @@ static int handle_cac(struct nl80211_state *state,
- return 1;
-
- if (strcmp(argv[2], "channel") == 0) {
-- err = parse_freqchan(&chandef, true, argc - 3, argv + 3, NULL);
-+ err = parse_freqchan(&chandef, true, argc - 3, argv + 3, NULL, false);
- } else if (strcmp(argv[2], "freq") == 0) {
-- err = parse_freqchan(&chandef, false, argc - 3, argv + 3, NULL);
-+ err = parse_freqchan(&chandef, false, argc - 3, argv + 3, NULL, false);
- } else {
- err = 1;
- }
-diff --git a/util.c b/util.c
-index 50e3fbc..eef0332 100644
---- a/util.c
-+++ b/util.c
-@@ -484,7 +484,7 @@ enum nl80211_chan_width str_to_bw(const char *str)
- }
-
- static int parse_freqs(struct chandef *chandef, int argc, char **argv,
-- int *parsed)
-+ int *parsed, bool freq_in_khz)
- {
- uint32_t freq;
- char *end;
-@@ -537,7 +537,13 @@ static int parse_freqs(struct chandef *chandef, int argc, char **argv,
- return 1;
- *parsed += 1;
-
-- chandef->center_freq1 = freq;
-+ if (freq_in_khz) {
-+ chandef->center_freq1 = freq / 1000;
-+ chandef->center_freq1_offset = freq % 1000;
-+ } else {
-+ chandef->center_freq1 = freq;
-+ chandef->center_freq1_offset = 0;
-+ }
-
- if (!need_cf2)
- return 0;
-@@ -551,7 +557,11 @@ static int parse_freqs(struct chandef *chandef, int argc, char **argv,
- freq = strtoul(argv[2], &end, 10);
- if (*end)
- return 1;
-- chandef->center_freq2 = freq;
-+
-+ if (freq_in_khz)
-+ chandef->center_freq2 = freq / 1000;
-+ else
-+ chandef->center_freq2 = freq;
-
- *parsed += 1;
-
-@@ -568,6 +578,7 @@ static int parse_freqs(struct chandef *chandef, int argc, char **argv,
- * @argv: Array of string arguments
- * @parsed: Pointer to return the number of used arguments, or NULL to error
- * out if any argument is left unused.
-+ * @freq_in_khz: Boolean whether to parse the frequency in kHz or default as MHz
- *
- * The given chandef structure will be filled in from the command line
- * arguments. argc/argv will be updated so that further arguments from the
-@@ -591,7 +602,7 @@ static int parse_freqs(struct chandef *chandef, int argc, char **argv,
- * Return: Number of used arguments, zero or negative error number otherwise
- */
- int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv,
-- int *parsed)
-+ int *parsed, bool freq_in_khz)
- {
- char *end;
- static const struct chanmode chanmode[] = {
-@@ -631,9 +642,30 @@ int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv,
- .width = NL80211_CHAN_WIDTH_320,
- .freq1_diff = 0,
- .chantype = -1 },
-+ { .name = "1MHz",
-+ .width = NL80211_CHAN_WIDTH_1,
-+ .freq1_diff = 0,
-+ .chantype = -1 },
-+ { .name = "2MHz",
-+ .width = NL80211_CHAN_WIDTH_2,
-+ .freq1_diff = 0,
-+ .chantype = -1 },
-+ { .name = "4MHz",
-+ .width = NL80211_CHAN_WIDTH_4,
-+ .freq1_diff = 0,
-+ .chantype = -1 },
-+ { .name = "8MHz",
-+ .width = NL80211_CHAN_WIDTH_8,
-+ .freq1_diff = 0,
-+ .chantype = -1 },
-+ { .name = "16MHz",
-+ .width = NL80211_CHAN_WIDTH_16,
-+ .freq1_diff = 0,
-+ .chantype = -1 },
-+
- };
- const struct chanmode *chanmode_selected = NULL;
-- unsigned int freq;
-+ unsigned int freq, freq_offset = 0;
- unsigned int i;
- int _parsed = 0;
- int res = 0;
-@@ -643,7 +675,14 @@ int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv,
-
- if (!argv[0])
- goto out;
-+
- freq = strtoul(argv[0], &end, 10);
-+
-+ if (freq_in_khz) {
-+ freq_offset = freq % 1000;
-+ freq = freq / 1000;
-+ }
-+
- if (*end) {
- res = 1;
- goto out;
-@@ -660,8 +699,10 @@ int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv,
- freq = ieee80211_channel_to_frequency(freq, band);
- }
- chandef->control_freq = freq;
-+ chandef->control_freq_offset = freq_offset;
- /* Assume 20MHz NOHT channel for now. */
- chandef->center_freq1 = freq;
-+ chandef->center_freq1_offset = freq_offset;
-
- /* Try to parse HT mode definitions */
- if (argc > 1) {
-@@ -674,9 +715,20 @@ int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv,
- }
- }
-
-+ /* Set channel width's default value */
-+ if (chandef->control_freq < 1000)
-+ chandef->width = NL80211_CHAN_WIDTH_16;
-+ else
-+ chandef->width = NL80211_CHAN_WIDTH_20_NOHT;
-+
- /* channel mode given, use it and return. */
- if (chanmode_selected) {
- chandef->center_freq1 = get_cf1(chanmode_selected, freq);
-+
-+ /* For non-S1G frequency */
-+ if (chandef->center_freq1 > 1000)
-+ chandef->center_freq1_offset = 0;
-+
- chandef->width = chanmode_selected->width;
- goto out;
- }
-@@ -685,7 +737,7 @@ int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv,
- if (chan)
- goto out;
-
-- res = parse_freqs(chandef, argc - 1, argv + 1, &_parsed);
-+ res = parse_freqs(chandef, argc - 1, argv + 1, &_parsed, freq_in_khz);
-
- out:
- /* Error out if parsed is NULL. */
-@@ -701,6 +753,9 @@ int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv,
- int put_chandef(struct nl_msg *msg, struct chandef *chandef)
- {
- NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, chandef->control_freq);
-+ NLA_PUT_U32(msg,
-+ NL80211_ATTR_WIPHY_FREQ_OFFSET,
-+ chandef->control_freq_offset);
- NLA_PUT_U32(msg, NL80211_ATTR_CHANNEL_WIDTH, chandef->width);
-
- switch (chandef->width) {
-@@ -733,6 +788,11 @@ int put_chandef(struct nl_msg *msg, struct chandef *chandef)
- NL80211_ATTR_CENTER_FREQ1,
- chandef->center_freq1);
-
-+ if (chandef->center_freq1_offset)
-+ NLA_PUT_U32(msg,
-+ NL80211_ATTR_CENTER_FREQ1_OFFSET,
-+ chandef->center_freq1_offset);
-+
- if (chandef->center_freq2)
- NLA_PUT_U32(msg,
- NL80211_ATTR_CENTER_FREQ2,
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0015-iw-S1G-add-parsing-for-802.11ah-scan-IE-s.patch b/recipes-wifi/iw/patches-mlo/0015-iw-S1G-add-parsing-for-802.11ah-scan-IE-s.patch
deleted file mode 100644
index 79d8135..0000000
--- a/recipes-wifi/iw/patches-mlo/0015-iw-S1G-add-parsing-for-802.11ah-scan-IE-s.patch
+++ /dev/null
@@ -1,425 +0,0 @@
-From 1bc6ab0abbb6f26f35d826d166d06bc28ae47b6b Mon Sep 17 00:00:00 2001
-From: Gilad Itzkovitch <gilad.itzkovitch@morsemicro.com>
-Date: Tue, 28 Feb 2023 12:01:27 +1300
-Subject: [PATCH 15/28] iw: S1G: add parsing for 802.11ah scan IE's
-
-In order to support scan display for 802.11ah, this change adds
-parsing for S1G capabilities, operation, and short beacon interval
-information elements.
-
-Signed-off-by: Gilad Itzkovitch <gilad.itzkovitch@morsemicro.com>
-Link: https://lore.kernel.org/r/20230227230127.709496-1-gilad.itzkovitch@virscient.com
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- iw.h | 5 ++
- scan.c | 109 ++++++++++++++++++++++++++++-
- util.c | 218 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 330 insertions(+), 2 deletions(-)
-
-diff --git a/iw.h b/iw.h
-index 19c76cf..7e9107e 100644
---- a/iw.h
-+++ b/iw.h
-@@ -224,6 +224,7 @@ void print_vht_info(__u32 capa, const __u8 *mcs);
- void print_he_capability(const uint8_t *ie, int len);
- void print_he_info(struct nlattr *nl_iftype);
- void print_eht_info(struct nlattr *nl_iftype, int band);
-+void print_s1g_capability(const uint8_t *caps);
-
- char *channel_width_name(enum nl80211_chan_width width);
- const char *iftype_name(enum nl80211_iftype iftype);
-@@ -261,6 +262,9 @@ int get_cf1(const struct chanmode *chanmode, unsigned long freq);
-
- int parse_random_mac_addr(struct nl_msg *msg, char *addrs);
-
-+char *s1g_ss_max_support(__u8 maxss);
-+char *s1g_ss_min_support(__u8 minss);
-+
- #define SCHED_SCAN_OPTIONS "[interval <in_msecs> | scan_plans [<interval_secs:iterations>*] <interval_secs>] " \
- "[delay <in_secs>] [freqs <freq>+] [matches [ssid <ssid>]+]] [active [ssid <ssid>]+|passive] " \
- "[randomise[=<addr>/<mask>]] [coloc] [flush]"
-@@ -274,6 +278,7 @@ char *hex2bin(const char *hex, char *buf);
- int set_bitrates(struct nl_msg *msg, int argc, char **argv,
- enum nl80211_attrs attr);
-
-+int calc_s1g_ch_center_freq(__u8 ch_index, __u8 s1g_oper_class);
-
- /* sections */
- DECLARE_SECTION(ap);
-diff --git a/scan.c b/scan.c
-index dc26787..7479220 100644
---- a/scan.c
-+++ b/scan.c
-@@ -1675,6 +1675,101 @@ static void print_mesh_conf(const uint8_t type, uint8_t len,
- printf("\t\t\t Mesh Power Save Level\n");
- }
-
-+static void print_s1g_capa(const uint8_t type, uint8_t len,
-+ const uint8_t *data,
-+ const struct print_ies_data *ie_buffer)
-+{
-+ printf("\n");
-+ print_s1g_capability(data);
-+}
-+
-+static void print_short_beacon_int(const uint8_t type, uint8_t len,
-+ const uint8_t *data,
-+ const struct print_ies_data *ie_buffer)
-+{
-+ printf(" %d\n", (data[1] << 8) | data[0]);
-+}
-+
-+static void print_s1g_oper(const uint8_t type, uint8_t len,
-+ const uint8_t *data,
-+ const struct print_ies_data *ie_buffer)
-+{
-+ int oper_ch_width, prim_ch_width;
-+ int prim_ch_width_subfield = data[0] & 0x1;
-+
-+ prim_ch_width = 2;
-+
-+ /* B1-B4 BSS channel width subfield */
-+ switch ((data[0] >> 1) & 0xf) {
-+ case 0:
-+ oper_ch_width = 1;
-+ prim_ch_width = 1;
-+ if (!prim_ch_width_subfield) {
-+ oper_ch_width = -1;
-+ prim_ch_width = -1;
-+ }
-+ break;
-+ case 1:
-+ oper_ch_width = 2;
-+ if (prim_ch_width_subfield)
-+ prim_ch_width = 1;
-+ break;
-+ case 3:
-+ oper_ch_width = 4;
-+ if (prim_ch_width_subfield)
-+ prim_ch_width = 1;
-+ break;
-+ case 7:
-+ oper_ch_width = 8;
-+ if (prim_ch_width_subfield)
-+ prim_ch_width = 1;
-+ break;
-+ case 15:
-+ oper_ch_width = 16;
-+ if (prim_ch_width_subfield)
-+ prim_ch_width = 1;
-+ break;
-+ default:
-+ oper_ch_width = -1;
-+ prim_ch_width = -1;
-+ break;
-+ }
-+
-+ printf("\n");
-+ printf("\t\tChannel width:\n");
-+ if (oper_ch_width == -1 || prim_ch_width == -1) {
-+ printf("\t\t\tBSS primary channel width: invalid\n");
-+ printf("\t\t\tBSS operating channel width: invalid\n");
-+ } else {
-+ printf("\t\t\tBSS primary channel width: %d MHz\n", prim_ch_width);
-+ printf("\t\t\tBSS operating channel width: %d MHz\n", oper_ch_width);
-+ }
-+ if (data[0] & BIT(5))
-+ printf("\t\t\t1 MHz primary channel located at the lower side of 2 MHz\n");
-+ else
-+ printf("\t\t\t1 MHz primary channel located at the upper side of 2 MHz\n");
-+
-+ if (data[0] & BIT(7))
-+ printf("\t\t\tMCS 10 not recommended\n");
-+
-+ printf("\t\t* operating class: %d\n", data[1]);
-+ printf("\t\t* primary channel number: %d\n", data[2]);
-+
-+ printf("\t\t* channel index: %d\n", data[3]);
-+
-+ printf("\t\tMax S1G MCS Map:\n");
-+ printf("\t\t\tFor 1 SS: %s\n", s1g_ss_max_support((data[4] >> 2) & 0x3));
-+ printf("\t\t\tFor 2 SS: %s\n", s1g_ss_max_support((data[4] >> 6) & 0x3));
-+ printf("\t\t\tFor 3 SS: %s\n", s1g_ss_max_support((data[5] >> 2) & 0x3));
-+ printf("\t\t\tFor 4 SS: %s\n", s1g_ss_max_support((data[5] >> 6) & 0x3));
-+
-+ printf("\t\tMin S1G MCS Map:\n");
-+ printf("\t\t\tFor 1 SS: %s\n", s1g_ss_min_support(data[4] & 0x3));
-+ printf("\t\t\tFor 2 SS: %s\n", s1g_ss_min_support((data[4] >> 4) & 0x3));
-+ printf("\t\t\tFor 3 SS: %s\n", s1g_ss_min_support(data[5] & 0x3));
-+ printf("\t\t\tFor 4 SS: %s\n", s1g_ss_min_support((data[5] >> 4) & 0x3));
-+}
-+
- struct ie_print {
- const char *name;
- void (*print)(const uint8_t type, uint8_t len, const uint8_t *data,
-@@ -1748,6 +1843,9 @@ static const struct ie_print ieprinters[] = {
- [108] = { "802.11u Advertisement", print_11u_advert, 0, 255, BIT(PRINT_SCAN), },
- [111] = { "802.11u Roaming Consortium", print_11u_rcon, 2, 255, BIT(PRINT_SCAN), },
- [195] = { "Transmit Power Envelope", print_tx_power_envelope, 2, 5, BIT(PRINT_SCAN), },
-+ [214] = { "Short beacon interval", print_short_beacon_int, 2, 2, BIT(PRINT_SCAN), },
-+ [217] = { "S1G capabilities", print_s1g_capa, 15, 15, BIT(PRINT_SCAN), },
-+ [232] = { "S1G operation", print_s1g_oper, 6, 6, BIT(PRINT_SCAN), },
- };
-
- static void print_wifi_wpa(const uint8_t type, uint8_t len, const uint8_t *data,
-@@ -2326,7 +2424,8 @@ void print_ies(unsigned char *ie, int ielen, bool unknown,
- while (ielen >= 2 && ielen - 2 >= ie[1]) {
- if (ie[0] < ARRAY_SIZE(ieprinters) &&
- ieprinters[ie[0]].name &&
-- ieprinters[ie[0]].flags & BIT(ptype)) {
-+ ieprinters[ie[0]].flags & BIT(ptype) &&
-+ ie[1] > 0) {
- print_ie(&ieprinters[ie[0]],
- ie[0], ie[1], ie + 2, &ie_buffer);
- } else if (ie[0] == 221 /* vendor */) {
-@@ -2419,6 +2518,7 @@ static int print_bss_handler(struct nl_msg *msg, void *arg)
- static struct nla_policy bss_policy[NL80211_BSS_MAX + 1] = {
- [NL80211_BSS_TSF] = { .type = NLA_U64 },
- [NL80211_BSS_FREQUENCY] = { .type = NLA_U32 },
-+ [NL80211_BSS_FREQUENCY_OFFSET] = { .type = NLA_U32 },
- [NL80211_BSS_BSSID] = { },
- [NL80211_BSS_BEACON_INTERVAL] = { .type = NLA_U16 },
- [NL80211_BSS_CAPABILITY] = { .type = NLA_U16 },
-@@ -2491,7 +2591,12 @@ static int print_bss_handler(struct nl_msg *msg, void *arg)
- }
- if (bss[NL80211_BSS_FREQUENCY]) {
- int freq = nla_get_u32(bss[NL80211_BSS_FREQUENCY]);
-- printf("\tfreq: %d\n", freq);
-+ if (bss[NL80211_BSS_FREQUENCY_OFFSET])
-+ printf("\tfreq: %d.%d\n", freq,
-+ nla_get_u32(bss[NL80211_BSS_FREQUENCY_OFFSET]));
-+ else
-+ printf("\tfreq: %d\n", freq);
-+
- if (freq > 45000)
- is_dmg = true;
- }
-diff --git a/util.c b/util.c
-index eef0332..18a97e1 100644
---- a/util.c
-+++ b/util.c
-@@ -1841,3 +1841,221 @@ int parse_random_mac_addr(struct nl_msg *msg, char *addrs)
- nla_put_failure:
- return -ENOBUFS;
- }
-+
-+char *s1g_ss_max_support(__u8 maxss)
-+{
-+ switch (maxss) {
-+ case 0: return "Max S1G-MCS 2";
-+ case 1: return "Max S1G-MCS 7";
-+ case 2: return "Max S1G-MCS 9";
-+ case 3: return "Not supported";
-+ default: return "";
-+ }
-+}
-+
-+char *s1g_ss_min_support(__u8 minss)
-+{
-+ switch (minss) {
-+ case 0: return "no minimum restriction";
-+ case 1: return "MCS 0 not recommended";
-+ case 2: return "MCS 0 and 1 not recommended";
-+ case 3: return "invalid";
-+ default: return "";
-+ }
-+}
-+
-+void print_s1g_capability(const uint8_t *caps)
-+{
-+#define PRINT_S1G_CAP(_cond, _str) \
-+ do { \
-+ if (_cond) \
-+ printf("\t\t\t" _str "\n"); \
-+ } while (0)
-+
-+ static char buf[20];
-+ int offset = 0;
-+ uint8_t cap = caps[0];
-+
-+ /* S1G Capabilities Information subfield */
-+ if (cap)
-+ printf("\t\tByte[0]: 0x%02x\n", cap);
-+
-+ PRINT_S1G_CAP((cap & BIT(0)), "S1G PHY: S1G_LONG PPDU Format");
-+
-+ if ((cap >> 1) & 0x1f) {
-+ offset = sprintf(buf, "SGI support:");
-+ offset += sprintf(buf + offset, "%s", ((cap >> 1) & 0x1) ? " 1" : "");
-+ offset += sprintf(buf + offset, "%s", ((cap >> 1) & 0x2) ? " 2" : "");
-+ offset += sprintf(buf + offset, "%s", ((cap >> 1) & 0x4) ? " 4" : "");
-+ offset += sprintf(buf + offset, "%s", ((cap >> 1) & 0x8) ? " 8" : "");
-+ offset += sprintf(buf + offset, "%s", ((cap >> 1) & 0x10) ? " 16" : "");
-+ offset += sprintf(buf + offset, " MHz");
-+ printf("\t\t\t%s\n", buf);
-+ }
-+
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x0, "Channel width: 1, 2 MHz");
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x1, "Channel width: 1, 2, 4 MHz");
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x2, "Channel width: 1, 2, 4, 8 MHz");
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x3, "Channel width: 1, 2, 4, 8, 16 MHz");
-+
-+ cap = caps[1];
-+
-+ if (cap)
-+ printf("\t\tByte[1]: 0x%02x\n", cap);
-+
-+ PRINT_S1G_CAP((cap & BIT(0)), "Rx LDPC");
-+ PRINT_S1G_CAP((cap & BIT(1)), "Tx STBC");
-+ PRINT_S1G_CAP((cap & BIT(2)), "Rx STBC");
-+ PRINT_S1G_CAP((cap & BIT(3)), "SU Beamformer");
-+ PRINT_S1G_CAP((cap & BIT(4)), "SU Beamformee");
-+ if (cap & BIT(4))
-+ printf("\t\t\tBeamformee STS: %d\n", (cap >> 5) + 1);
-+
-+ cap = caps[2];
-+ printf("\t\tByte[2]: 0x%02x\n", cap);
-+
-+ if (caps[1] & BIT(3))
-+ printf("\t\t\tSounding dimensions: %d\n", (cap & 0x7) + 1);
-+
-+ PRINT_S1G_CAP((cap & BIT(3)), "MU Beamformer");
-+ PRINT_S1G_CAP((cap & BIT(4)), "MU Beamformee");
-+ PRINT_S1G_CAP((cap & BIT(5)), "+HTC-VHT Capable");
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x0, "No support for Traveling Pilot");
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x1, "Supports 1 STS Traveling Pilot");
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x3, "Supports 1 and 2 STS Traveling Pilot");
-+
-+ cap = caps[3];
-+ printf("\t\tByte[3]: 0x%02x\n", cap);
-+ PRINT_S1G_CAP((cap & BIT(0)), "RD Responder");
-+ /* BIT(1) in Byte 3 or BIT(25) in all capabilities is reserved */
-+ PRINT_S1G_CAP(((cap & BIT(2)) == 0x0), "Max MPDU length: 3895 bytes");
-+ PRINT_S1G_CAP((cap & BIT(2)), "Max MPDU length: 7991 bytes");
-+
-+ if (compute_ampdu_length((cap >> 2) & 0x3)) {
-+ printf("\t\t\tMaximum AMPDU length: %d bytes (exponent: 0x0%02x)\n",
-+ compute_ampdu_length((cap >> 2) & 0x3), (cap >> 2) & 0x3);
-+ } else {
-+ printf("\t\t\tMaximum AMPDU length: unrecognized bytes (exponent: %d)\n",
-+ (cap >> 2) & 0x3);
-+ }
-+
-+ printf("\t\t\tMinimum MPDU time spacing: %s (0x%02x)\n",
-+ print_ampdu_space((cap >> 5) & 0x7), (cap >> 5) & 0x7);
-+
-+ cap = caps[4];
-+ printf("\t\tByte[4]: 0x%02x\n", cap);
-+ PRINT_S1G_CAP((cap & BIT(0)), "Uplink sync capable");
-+ PRINT_S1G_CAP((cap & BIT(1)), "Dynamic AID");
-+ PRINT_S1G_CAP((cap & BIT(2)), "BAT");
-+ PRINT_S1G_CAP((cap & BIT(3)), "TIM ADE");
-+ PRINT_S1G_CAP((cap & BIT(4)), "Non-TIM");
-+ PRINT_S1G_CAP((cap & BIT(5)), "Group AID");
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x0, "Sensor and non-sensor STAs");
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x1, "Only sensor STAs");
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x2, "Only non-sensor STAs");
-+
-+ cap = caps[5];
-+ printf("\t\tByte[5]: 0x%02x\n", cap);
-+ PRINT_S1G_CAP((cap & BIT(0)), "Centralized authentication control");
-+ PRINT_S1G_CAP((cap & BIT(1)), "Distributed authentication control");
-+ PRINT_S1G_CAP((cap & BIT(2)), "A-MSDU supported");
-+ PRINT_S1G_CAP((cap & BIT(3)), "A-MPDU supported");
-+ PRINT_S1G_CAP((cap & BIT(4)), "Asymmetric BA supported");
-+ PRINT_S1G_CAP((cap & BIT(5)), "Flow control supported");
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x0, "Sectorization operation not supported");
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x1, "TXOP-based sectorization operation");
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x2, "only group sectorization operation");
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x3, "Group and TXOP-based sectorization operations");
-+
-+ cap = caps[6];
-+ if (cap)
-+ printf("\t\tByte[6]: 0x%02x\n", cap);
-+
-+ PRINT_S1G_CAP((cap & BIT(0)), "OBSS mitigation");
-+ PRINT_S1G_CAP((cap & BIT(1)), "Fragment BA");
-+ PRINT_S1G_CAP((cap & BIT(2)), "NDP PS-Poll");
-+ PRINT_S1G_CAP((cap & BIT(3)), "RAW operation");
-+ PRINT_S1G_CAP((cap & BIT(4)), "Page slicing");
-+ PRINT_S1G_CAP((cap & BIT(5)), "TXOP sharing smplicit Ack");
-+
-+ /* Only in case +HTC-VHT Capable is 0x1 */
-+ if (caps[2] & BIT(5)) {
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x0, "Not provide VHT MFB (No Feedback)");
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x2, "Provides only unsolicited VHT MFB");
-+ PRINT_S1G_CAP(((cap >> 6) & 0x3) == 0x3,
-+ "Provides both feedback and unsolicited VHT MFB");
-+ }
-+
-+ cap = caps[7];
-+ printf("\t\tByte[7]: 0x%02x\n", cap);
-+ PRINT_S1G_CAP((cap & BIT(0)), "TACK support as PS-Poll response");
-+ PRINT_S1G_CAP((cap & BIT(1)), "Duplicate 1 MHz");
-+ PRINT_S1G_CAP((cap & BIT(2)), "MCS negotiation");
-+ PRINT_S1G_CAP((cap & BIT(3)), "1 MHz control response preamble");
-+ PRINT_S1G_CAP((cap & BIT(4)), "NDP beamforming report poll");
-+ PRINT_S1G_CAP((cap & BIT(5)), "Unsolicited dynamic AID");
-+ PRINT_S1G_CAP((cap & BIT(6)), "Sector training operation");
-+ PRINT_S1G_CAP((cap & BIT(7)), "Temporary PS mode switch");
-+
-+ cap = caps[8];
-+ if (cap)
-+ printf("\t\tByte[8]: 0x%02x\n", cap);
-+
-+ PRINT_S1G_CAP((cap & BIT(0)), "TWT grouping");
-+ PRINT_S1G_CAP((cap & BIT(1)), "BDT capable");
-+ printf("\t\t\tColor: %u\n", (cap >> 2) & 0x7);
-+ PRINT_S1G_CAP((cap & BIT(5)), "TWT requester");
-+ PRINT_S1G_CAP((cap & BIT(6)), "TWT responder");
-+ PRINT_S1G_CAP((cap & BIT(7)), "PV1 frame support");
-+
-+ cap = caps[9];
-+ if (cap)
-+ printf("\t\tByte[9]: 0x%02x\n", cap);
-+
-+ PRINT_S1G_CAP((cap & BIT(0)), "Link Adaptation without NDP CMAC PPDU capable");
-+ /* Rest of byte 9 bits are reserved */
-+
-+ /* Supported S1G-MCS and NSS Set subfield */
-+ /* Rx S1G-MCS Map */
-+ cap = caps[10];
-+ printf("\t\tMax Rx S1G MCS Map: 0x%02x\n", cap);
-+ printf("\t\t\tFor 1 SS: %s\n", s1g_ss_max_support(cap & 0x3));
-+ printf("\t\t\tFor 2 SS: %s\n", s1g_ss_max_support((cap >> 2) & 0x3));
-+ printf("\t\t\tFor 3 SS: %s\n", s1g_ss_max_support((cap >> 4) & 0x3));
-+ printf("\t\t\tFor 4 SS: %s\n", s1g_ss_max_support((cap >> 6) & 0x3));
-+
-+ /* Rx Long GI data rate field comprises of 9 bits */
-+ cap = caps[11];
-+ if (cap || caps[12] & 0x1)
-+ printf("\t\t\tRx Highest Long GI Data Rate: %u Mbps\n",
-+ cap + ((caps[12] & 0x1) << 8));
-+
-+ /* Tx S1G-MCS Map */
-+ cap = caps[12];
-+ printf("\t\tMax Tx S1G MCS Map: 0x%02x\n", cap);
-+ printf("\t\t\tFor 1 SS: %s\n", s1g_ss_max_support((cap >> 1) & 0x3));
-+ printf("\t\t\tFor 2 SS: %s\n", s1g_ss_max_support((cap >> 3) & 0x3));
-+ printf("\t\t\tFor 3 SS: %s\n", s1g_ss_max_support((cap >> 5) & 0x3));
-+ printf("\t\t\tFor 4 SS: %s\n", s1g_ss_max_support(((cap >> 7) & 0x1) +
-+ ((caps[13] << 1) & 0x2)));
-+
-+ /* Tx Long GI data rate field comprises of 9 bits */
-+ cap = caps[13];
-+ if (((cap >> 7) & 0x7f) || (caps[14] & 0x3))
-+ printf("\t\t\tTx Highest Long GI Data Rate: %u Mbps\n", ((cap >> 7) & 0x7f) +
-+ ((caps[14] & 0x3) << 7));
-+
-+ /* Rx and Tx single spatial streams and S1G MCS Map for 1 MHz */
-+ cap = (caps[15] >> 2) & 0xf;
-+ PRINT_S1G_CAP((cap & 0x3) == 0x0, "Rx single SS for 1 MHz: as in Rx S1G MCS Map");
-+ PRINT_S1G_CAP((cap & 0x3) == 0x1, "Rx single SS for 1 MHz: single SS and S1G-MCS 2");
-+ PRINT_S1G_CAP((cap & 0x3) == 0x2, "Rx single SS for 1 MHz: single SS and S1G-MCS 7");
-+ PRINT_S1G_CAP((cap & 0x3) == 0x3, "Rx single SS for 1 MHz: single SS and S1G-MCS 9");
-+ cap = (cap >> 2) & 0x3;
-+ PRINT_S1G_CAP((cap & 0x3) == 0x0, "Tx single SS for 1 MHz: as in Tx S1G MCS Map");
-+ PRINT_S1G_CAP((cap & 0x3) == 0x1, "Tx single SS for 1 MHz: single SS and S1G-MCS 2");
-+ PRINT_S1G_CAP((cap & 0x3) == 0x2, "Tx single SS for 1 MHz: single SS and S1G-MCS 7");
-+ PRINT_S1G_CAP((cap & 0x3) == 0x3, "Tx single SS for 1 MHz: single SS and S1G-MCS 9");
-+ /* Last 2 bits are reserved */
-+#undef PRINT_S1G_CAP
-+}
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0016-iw-S1G-add-list-command-support-for-802.11ah.patch b/recipes-wifi/iw/patches-mlo/0016-iw-S1G-add-list-command-support-for-802.11ah.patch
deleted file mode 100644
index b67eafc..0000000
--- a/recipes-wifi/iw/patches-mlo/0016-iw-S1G-add-list-command-support-for-802.11ah.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From f2d9f5b52677f5414dc194be94b5916d2b080eab Mon Sep 17 00:00:00 2001
-From: Gilad Itzkovitch <gilad.itzkovitch@morsemicro.com>
-Date: Tue, 28 Feb 2023 12:11:24 +1300
-Subject: [PATCH 16/28] iw: S1G: add list command support for 802.11ah
-
-In this changeset S1G frequencies are displayed for any S1G band
-with their relevant properties.
-
-Signed-off-by: Gilad Itzkovitch <gilad.itzkovitch@morsemicro.com>
-Link: https://lore.kernel.org/r/20230227231124.711053-1-gilad.itzkovitch@virscient.com
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- info.c | 13 ++++++++++++-
- util.c | 2 ++
- 2 files changed, 14 insertions(+), 1 deletion(-)
-
-diff --git a/info.c b/info.c
-index 9955e5e..364f9b3 100644
---- a/info.c
-+++ b/info.c
-@@ -301,6 +301,7 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
- struct nlattr *tb_freq[NL80211_FREQUENCY_ATTR_MAX + 1];
- static struct nla_policy freq_policy[NL80211_FREQUENCY_ATTR_MAX + 1] = {
- [NL80211_FREQUENCY_ATTR_FREQ] = { .type = NLA_U32 },
-+ [NL80211_FREQUENCY_ATTR_OFFSET] = { .type = NLA_U32 },
- [NL80211_FREQUENCY_ATTR_DISABLED] = { .type = NLA_FLAG },
- [NL80211_FREQUENCY_ATTR_NO_IR] = { .type = NLA_FLAG },
- [__NL80211_FREQUENCY_ATTR_NO_IBSS] = { .type = NLA_FLAG },
-@@ -396,12 +397,22 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
- }
- nla_for_each_nested(nl_freq, tb_band[NL80211_BAND_ATTR_FREQS], rem_freq) {
- uint32_t freq;
-+
- nla_parse(tb_freq, NL80211_FREQUENCY_ATTR_MAX, nla_data(nl_freq),
- nla_len(nl_freq), freq_policy);
- if (!tb_freq[NL80211_FREQUENCY_ATTR_FREQ])
- continue;
- freq = nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_FREQ]);
-- printf("\t\t\t* %d MHz [%d]", freq, ieee80211_frequency_to_channel(freq));
-+ if (tb_freq[NL80211_FREQUENCY_ATTR_OFFSET]) {
-+ uint32_t offset = nla_get_u32(
-+ tb_freq[NL80211_FREQUENCY_ATTR_OFFSET]);
-+ printf("\t\t\t* %d.%d MHz", freq, offset);
-+ } else {
-+ printf("\t\t\t* %d MHz", freq);
-+ }
-+
-+ if (ieee80211_frequency_to_channel(freq))
-+ printf(" [%d]", ieee80211_frequency_to_channel(freq));
-
- if (tb_freq[NL80211_FREQUENCY_ATTR_MAX_TX_POWER] &&
- !tb_freq[NL80211_FREQUENCY_ATTR_DISABLED])
-diff --git a/util.c b/util.c
-index 18a97e1..dc09193 100644
---- a/util.c
-+++ b/util.c
-@@ -199,6 +199,8 @@ int ieee80211_channel_to_frequency(int chan, enum nl80211_band band)
-
- int ieee80211_frequency_to_channel(int freq)
- {
-+ if (freq < 1000)
-+ return 0;
- /* see 802.11-2007 17.3.8.3.2 and Annex J */
- if (freq == 2484)
- return 14;
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0017-iw-Fix-EHT-rates-printing.patch b/recipes-wifi/iw/patches-mlo/0017-iw-Fix-EHT-rates-printing.patch
deleted file mode 100644
index 1da5c22..0000000
--- a/recipes-wifi/iw/patches-mlo/0017-iw-Fix-EHT-rates-printing.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From cf26fc9ab584833f01e27cc2dd09988179ec6a03 Mon Sep 17 00:00:00 2001
-From: Ben Greear <greearb@candelatech.com>
-Date: Tue, 16 May 2023 11:02:38 -0700
-Subject: [PATCH 17/28] iw: Fix EHT rates printing.
-
-The 20Mhz rates thing is a union with the others, so print one or
-the other. This appears to fix the output of the mcs/bw printout.
-
-Signed-off-by: Ben Greear <greearb@candelatech.com>
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- util.c | 46 +++++++++++++++++++++-------------------------
- 1 file changed, 21 insertions(+), 25 deletions(-)
-
-diff --git a/util.c b/util.c
-index dc09193..d36dbdc 100644
---- a/util.c
-+++ b/util.c
-@@ -1604,33 +1604,29 @@ static void __print_eht_capa(int band,
- printf("%s\t\tEHT bw=20 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n",
- pre, mcs[i],
- mcs_set[i] & 0xf, mcs_set[i] >> 4);
-- }
--
-- mcs_set += 4;
-- if (he_phy_cap[0] & (BIT(2) << 8)) {
-- for (i = 0; i < 3; i++)
-- printf("%s\t\tEHT bw <= 80 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n",
-- pre, mcs[i + 1],
-- mcs_set[i] & 0xf, mcs_set[i] >> 4);
--
-- }
--
-- mcs_set += 3;
-- if (he_phy_cap[0] & (BIT(3) << 8)) {
-- for (i = 0; i < 3; i++)
-- printf("%s\t\tEHT bw=160 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n",
-- pre, mcs[i + 1],
-- mcs_set[i] & 0xf, mcs_set[i] >> 4);
--
-- }
-+ } else {
-+ if (he_phy_cap[0] & (BIT(2) << 8)) {
-+ for (i = 0; i < 3; i++)
-+ printf("%s\t\tEHT bw <= 80 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n",
-+ pre, mcs[i + 1],
-+ mcs_set[i] & 0xf, mcs_set[i] >> 4);
-+ }
-+ mcs_set += 3;
-
-- mcs_set += 3;
-- if (band == NL80211_BAND_6GHZ && (phy_cap[0] & BIT(1))) {
-- for (i = 0; i < 3; i++)
-- printf("%s\t\tEHT bw=320 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n",
-- pre, mcs[i + 1],
-- mcs_set[i] & 0xf, mcs_set[i] >> 4);
-+ if (he_phy_cap[0] & (BIT(3) << 8)) {
-+ for (i = 0; i < 3; i++)
-+ printf("%s\t\tEHT bw=160 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n",
-+ pre, mcs[i + 1],
-+ mcs_set[i] & 0xf, mcs_set[i] >> 4);
-+ }
-
-+ mcs_set += 3;
-+ if (band == NL80211_BAND_6GHZ && (phy_cap[0] & BIT(1))) {
-+ for (i = 0; i < 3; i++)
-+ printf("%s\t\tEHT bw=320 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n",
-+ pre, mcs[i + 1],
-+ mcs_set[i] & 0xf, mcs_set[i] >> 4);
-+ }
- }
-
- if (ppet && ppet_len && (phy_cap[1] & BIT(11))) {
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0018-iw-add-more-extended-capa-bits.patch b/recipes-wifi/iw/patches-mlo/0018-iw-add-more-extended-capa-bits.patch
deleted file mode 100644
index 46ec818..0000000
--- a/recipes-wifi/iw/patches-mlo/0018-iw-add-more-extended-capa-bits.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From cb491fa6b4b5bb1e7c11788a39bcf5a7a74afafa Mon Sep 17 00:00:00 2001
-From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-Date: Wed, 23 Aug 2023 13:10:02 +0300
-Subject: [PATCH 18/28] iw: add more extended capa bits
-
-Those were missing
-
-While at it, fix a bug in the default case, we want to print the actual
-bit offset which is bit + base.
-
-Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- scan.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/scan.c b/scan.c
-index 7479220..faf406d 100644
---- a/scan.c
-+++ b/scan.c
-@@ -1445,8 +1445,12 @@ static void print_capabilities(const uint8_t type, uint8_t len,
- CAPA(72, "Reserved");
- CAPA(73, "Extended Spectrum Management Capable");
- CAPA(74, "Reserved");
-+ CAPA(77, "TWT Requester Support");
-+ CAPA(78, "TWT Responder Support");
-+ CAPA(79, "OBSS Narrow Bandwith RU in UL OFDMA Tolerance Support");
-+
- default:
-- printf(" %d", bit);
-+ printf(" %d", bit + base);
- break;
- }
- #undef ADD_BIT_VAL
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0019-iw-fix-attribute-size-mismatch.patch b/recipes-wifi/iw/patches-mlo/0019-iw-fix-attribute-size-mismatch.patch
deleted file mode 100644
index 93ac02c..0000000
--- a/recipes-wifi/iw/patches-mlo/0019-iw-fix-attribute-size-mismatch.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From ea706b389fd896318bd7310b058fedf11d1b6758 Mon Sep 17 00:00:00 2001
-From: Koen Vandeputte <koen.vandeputte@citymesh.com>
-Date: Fri, 7 Jul 2023 16:48:26 +0200
-Subject: [PATCH 19/28] iw: fix attribute size mismatch
-
-NL80211_ATTR_MAX_AP_ASSOC_STA gets packed as u32 in the kernel.
-Change the receiving side to match this, or it will be wrong
-on big-endian.
-
-Signed-off-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
-Link: https://lore.kernel.org/r/20230707144826.3043151-1-koen.vandeputte@citymesh.com
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- info.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/info.c b/info.c
-index 364f9b3..4c5f463 100644
---- a/info.c
-+++ b/info.c
-@@ -879,7 +879,7 @@ broken_combination:
-
- if (tb_msg[NL80211_ATTR_MAX_AP_ASSOC_STA])
- printf("\tMaximum associated stations in AP mode: %u\n",
-- nla_get_u16(tb_msg[NL80211_ATTR_MAX_AP_ASSOC_STA]));
-+ nla_get_u32(tb_msg[NL80211_ATTR_MAX_AP_ASSOC_STA]));
-
- return NL_SKIP;
- }
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0020-iw-connect-Fix-segfault-during-open-authentication.patch b/recipes-wifi/iw/patches-mlo/0020-iw-connect-Fix-segfault-during-open-authentication.patch
deleted file mode 100644
index 7e5da61..0000000
--- a/recipes-wifi/iw/patches-mlo/0020-iw-connect-Fix-segfault-during-open-authentication.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From a1c9376a115f9af4a50626d2c0fa89667afa0096 Mon Sep 17 00:00:00 2001
-From: Chaitanya Tata <chaitanya.mgit@gmail.com>
-Date: Thu, 27 Jul 2023 00:52:45 +0530
-Subject: [PATCH 20/28] iw: connect: Fix segfault during open authentication
-
-The check for remaining arguments is done after decrement effectively
-bypassing the non-zero check and causes a segfault with below command:
-
- "connect <SSID> auth open/shared".
-
-Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
-Link: https://lore.kernel.org/r/20230726192245.100897-1-Chaitanya.Tata@nordicsemi.no
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- connect.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/connect.c b/connect.c
-index e5b177f..33e1a5f 100644
---- a/connect.c
-+++ b/connect.c
-@@ -77,6 +77,9 @@ static int iw_conn(struct nl80211_state *state,
- if (argc && strcmp(*argv, "key") != 0 && strcmp(*argv, "keys") != 0)
- return 1;
-
-+ if (!argc)
-+ return 0;
-+
- argv++;
- argc--;
-
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0021-update-nl80211.h.patch b/recipes-wifi/iw/patches-mlo/0021-update-nl80211.h.patch
deleted file mode 100644
index 0a3ac71..0000000
--- a/recipes-wifi/iw/patches-mlo/0021-update-nl80211.h.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From 7298198a54d81b969f688164ef33d952ddfcb81e Mon Sep 17 00:00:00 2001
-From: Johannes Berg <johannes.berg@intel.com>
-Date: Thu, 24 Aug 2023 09:19:47 +0200
-Subject: [PATCH 21/28] update nl80211.h
-
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- nl80211.h | 30 +++++++++++++++++++++++++++++-
- 1 file changed, 29 insertions(+), 1 deletion(-)
-
-diff --git a/nl80211.h b/nl80211.h
-index c59fec4..88eb85c 100644
---- a/nl80211.h
-+++ b/nl80211.h
-@@ -11,7 +11,7 @@
- * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
- * Copyright 2008 Colin McCabe <colin@cozybit.com>
- * Copyright 2015-2017 Intel Deutschland GmbH
-- * Copyright (C) 2018-2022 Intel Corporation
-+ * Copyright (C) 2018-2023 Intel Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
-@@ -1309,6 +1309,11 @@
- * The number of peers that HW timestamping can be enabled for concurrently
- * is indicated by %NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS.
- *
-+ * @NL80211_CMD_LINKS_REMOVED: Notify userspace about the removal of STA MLD
-+ * setup links due to AP MLD removing the corresponding affiliated APs with
-+ * Multi-Link reconfiguration. %NL80211_ATTR_MLO_LINKS is used to provide
-+ * information about the removed STA MLD setup links.
-+ *
- * @NL80211_CMD_MAX: highest used command number
- * @__NL80211_CMD_AFTER_LAST: internal use
- */
-@@ -1562,6 +1567,8 @@ enum nl80211_commands {
-
- NL80211_CMD_SET_HW_TIMESTAMP,
-
-+ NL80211_CMD_LINKS_REMOVED,
-+
- /* add new commands above here */
-
- /* used to define NL80211_CMD_MAX below */
-@@ -2805,6 +2812,9 @@ enum nl80211_commands {
- * index. If the userspace includes more RNR elements than number of
- * MBSSID elements then these will be added in every EMA beacon.
- *
-+ * @NL80211_ATTR_MLO_LINK_DISABLED: Flag attribute indicating that the link is
-+ * disabled.
-+ *
- * @NUM_NL80211_ATTR: total number of nl80211_attrs available
- * @NL80211_ATTR_MAX: highest attribute number currently defined
- * @__NL80211_ATTR_AFTER_LAST: internal use
-@@ -3341,6 +3351,8 @@ enum nl80211_attrs {
-
- NL80211_ATTR_EMA_RNR_ELEMS,
-
-+ NL80211_ATTR_MLO_LINK_DISABLED,
-+
- /* add attributes here, update the policy in nl80211.c */
-
- __NL80211_ATTR_AFTER_LAST,
-@@ -3667,6 +3679,13 @@ enum nl80211_eht_ru_alloc {
- * (u8, see &enum nl80211_eht_gi)
- * @NL80211_RATE_INFO_EHT_RU_ALLOC: EHT RU allocation, if not present then
- * non-OFDMA was used (u8, see &enum nl80211_eht_ru_alloc)
-+ * @NL80211_RATE_INFO_S1G_MCS: S1G MCS index (u8, 0-10)
-+ * @NL80211_RATE_INFO_S1G_NSS: S1G NSS value (u8, 1-4)
-+ * @NL80211_RATE_INFO_1_MHZ_WIDTH: 1 MHz S1G rate
-+ * @NL80211_RATE_INFO_2_MHZ_WIDTH: 2 MHz S1G rate
-+ * @NL80211_RATE_INFO_4_MHZ_WIDTH: 4 MHz S1G rate
-+ * @NL80211_RATE_INFO_8_MHZ_WIDTH: 8 MHz S1G rate
-+ * @NL80211_RATE_INFO_16_MHZ_WIDTH: 16 MHz S1G rate
- * @__NL80211_RATE_INFO_AFTER_LAST: internal use
- */
- enum nl80211_rate_info {
-@@ -3693,6 +3712,13 @@ enum nl80211_rate_info {
- NL80211_RATE_INFO_EHT_NSS,
- NL80211_RATE_INFO_EHT_GI,
- NL80211_RATE_INFO_EHT_RU_ALLOC,
-+ NL80211_RATE_INFO_S1G_MCS,
-+ NL80211_RATE_INFO_S1G_NSS,
-+ NL80211_RATE_INFO_1_MHZ_WIDTH,
-+ NL80211_RATE_INFO_2_MHZ_WIDTH,
-+ NL80211_RATE_INFO_4_MHZ_WIDTH,
-+ NL80211_RATE_INFO_8_MHZ_WIDTH,
-+ NL80211_RATE_INFO_16_MHZ_WIDTH,
-
- /* keep last */
- __NL80211_RATE_INFO_AFTER_LAST,
-@@ -4424,6 +4450,7 @@ enum nl80211_sched_scan_match_attr {
- * @NL80211_RRF_NO_160MHZ: 160MHz operation not allowed
- * @NL80211_RRF_NO_HE: HE operation not allowed
- * @NL80211_RRF_NO_320MHZ: 320MHz operation not allowed
-+ * @NL80211_RRF_NO_EHT: EHT operation not allowed
- */
- enum nl80211_reg_rule_flags {
- NL80211_RRF_NO_OFDM = 1<<0,
-@@ -4443,6 +4470,7 @@ enum nl80211_reg_rule_flags {
- NL80211_RRF_NO_160MHZ = 1<<16,
- NL80211_RRF_NO_HE = 1<<17,
- NL80211_RRF_NO_320MHZ = 1<<18,
-+ NL80211_RRF_NO_EHT = 1<<19,
- };
-
- #define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0022-iw-S1G-add-802.11ah-support-for-link-command-display.patch b/recipes-wifi/iw/patches-mlo/0022-iw-S1G-add-802.11ah-support-for-link-command-display.patch
deleted file mode 100644
index 7bb242c..0000000
--- a/recipes-wifi/iw/patches-mlo/0022-iw-S1G-add-802.11ah-support-for-link-command-display.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From e2224c729840cc33c6ea89ba5e91b69f79c88e85 Mon Sep 17 00:00:00 2001
-From: Bassem Dawood <bassem@morsemicro.com>
-Date: Thu, 19 Oct 2023 18:40:19 +1100
-Subject: [PATCH 22/28] iw: S1G: add 802.11ah support for link command display
-
-Amending the link command which depends on kernal changes for
-802.11ah bandwidths/MCS/NSS NL80211_RATE_INFO_ attributes.
-
-S1G frequency offset being used as well for the MHz units print.
-
-Signed-off-by: Bassem Dawood <bassem@morsemicro.com>
-Link: https://lore.kernel.org/r/20231019074019.2246629-1-bassem@morsemicro.com
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- link.c | 9 +++++++--
- station.c | 10 ++++++++++
- 2 files changed, 17 insertions(+), 2 deletions(-)
-
-diff --git a/link.c b/link.c
-index a090100..a7ee963 100644
---- a/link.c
-+++ b/link.c
-@@ -29,6 +29,7 @@ static int link_bss_handler(struct nl_msg *msg, void *arg)
- static struct nla_policy bss_policy[NL80211_BSS_MAX + 1] = {
- [NL80211_BSS_TSF] = { .type = NLA_U64 },
- [NL80211_BSS_FREQUENCY] = { .type = NLA_U32 },
-+ [NL80211_BSS_FREQUENCY_OFFSET] = { .type = NLA_U32 },
- [NL80211_BSS_BSSID] = { },
- [NL80211_BSS_BEACON_INTERVAL] = { .type = NLA_U16 },
- [NL80211_BSS_CAPABILITY] = { .type = NLA_U16 },
-@@ -41,6 +42,7 @@ static int link_bss_handler(struct nl_msg *msg, void *arg)
- char mac_addr[20], dev[20], link_addr[20];
- int link_id = -1;
- const char *indent = "\t";
-+ int freq_offset = 0;
-
- nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
- genlmsg_attrlen(gnlh, 0), NULL);
-@@ -121,9 +123,12 @@ static int link_bss_handler(struct nl_msg *msg, void *arg)
- nla_len(bss[NL80211_BSS_INFORMATION_ELEMENTS]),
- false, result->mld ? PRINT_LINK_MLO_LINK : PRINT_LINK);
-
-+ if (bss[NL80211_BSS_FREQUENCY_OFFSET])
-+ freq_offset = nla_get_u32(bss[NL80211_BSS_FREQUENCY_OFFSET]);
-+
- if (bss[NL80211_BSS_FREQUENCY])
-- printf("%sfreq: %d\n", indent,
-- nla_get_u32(bss[NL80211_BSS_FREQUENCY]));
-+ printf("%sfreq: %d.%d\n", indent,
-+ nla_get_u32(bss[NL80211_BSS_FREQUENCY]), freq_offset);
-
- if (nla_get_u32(bss[NL80211_BSS_STATUS]) != NL80211_BSS_STATUS_ASSOCIATED)
- return NL_SKIP;
-diff --git a/station.c b/station.c
-index da1feae..bf7c0f5 100644
---- a/station.c
-+++ b/station.c
-@@ -241,6 +241,16 @@ void parse_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen)
- pos += snprintf(pos, buflen - (pos - buf), " 160MHz");
- if (rinfo[NL80211_RATE_INFO_320_MHZ_WIDTH])
- pos += snprintf(pos, buflen - (pos - buf), " 320MHz");
-+ if (rinfo[NL80211_RATE_INFO_1_MHZ_WIDTH])
-+ pos += snprintf(pos, buflen - (pos - buf), " 1MHz");
-+ if (rinfo[NL80211_RATE_INFO_2_MHZ_WIDTH])
-+ pos += snprintf(pos, buflen - (pos - buf), " 2MHz");
-+ if (rinfo[NL80211_RATE_INFO_4_MHZ_WIDTH])
-+ pos += snprintf(pos, buflen - (pos - buf), " 4MHz");
-+ if (rinfo[NL80211_RATE_INFO_8_MHZ_WIDTH])
-+ pos += snprintf(pos, buflen - (pos - buf), " 8MHz");
-+ if (rinfo[NL80211_RATE_INFO_16_MHZ_WIDTH])
-+ pos += snprintf(pos, buflen - (pos - buf), " 16MHz");
- if (rinfo[NL80211_RATE_INFO_SHORT_GI])
- pos += snprintf(pos, buflen - (pos - buf), " short GI");
- if (rinfo[NL80211_RATE_INFO_VHT_NSS])
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0023-iw-allow-extra-cflags.patch b/recipes-wifi/iw/patches-mlo/0023-iw-allow-extra-cflags.patch
deleted file mode 100644
index 9897062..0000000
--- a/recipes-wifi/iw/patches-mlo/0023-iw-allow-extra-cflags.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 44686ac3e7b536e905c3749814e4eb0e7e210440 Mon Sep 17 00:00:00 2001
-From: Johannes Berg <johannes.berg@intel.com>
-Date: Fri, 1 Sep 2023 07:50:02 +0200
-Subject: [PATCH 23/28] iw: allow extra cflags
-
-We can override the entirety of CFLAGS from the make
-command line, but not add e.g. -Werror. Append a new
-EXTRA_CFLAGS to make that possible.
-
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- Makefile | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/Makefile b/Makefile
-index 2fb8db8..17be33f 100644
---- a/Makefile
-+++ b/Makefile
-@@ -18,6 +18,7 @@ CFLAGS += -Wall -Wextra -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-a
- CFLAGS += -Werror-implicit-function-declaration -Wsign-compare -Wno-unused-parameter
- CFLAGS += -Wdeclaration-after-statement
- CFLAGS += $(CFLAGS_EVAL)
-+CFLAGS += $(EXTRA_CFLAGS)
-
- _OBJS := $(sort $(patsubst %.c,%.o,$(wildcard *.c)))
- VERSION_OBJS := $(filter-out version.o, $(_OBJS))
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0024-update-nl80211.h.patch b/recipes-wifi/iw/patches-mlo/0024-update-nl80211.h.patch
deleted file mode 100644
index c7d248a..0000000
--- a/recipes-wifi/iw/patches-mlo/0024-update-nl80211.h.patch
+++ /dev/null
@@ -1,623 +0,0 @@
-From ac7e46b2aaf800ff0bd1339be814754b79eed568 Mon Sep 17 00:00:00 2001
-From: Johannes Berg <johannes.berg@intel.com>
-Date: Thu, 21 Dec 2023 12:47:01 +0100
-Subject: [PATCH 24/28] update nl80211.h
-
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- info.c | 2 +
- nl80211.h | 199 ++++++++++++++++++++++++++++++++++++++++--------------
- 2 files changed, 149 insertions(+), 52 deletions(-)
-
-diff --git a/info.c b/info.c
-index 4c5f463..317e7a3 100644
---- a/info.c
-+++ b/info.c
-@@ -170,6 +170,8 @@ static void ext_feat_print(enum nl80211_ext_feature_index idx)
- ext_feat_case(PUNCT, "preamble puncturing in AP mode");
- ext_feat_case(SECURE_NAN, "secure NAN support");
- ext_feat_case(AUTH_AND_DEAUTH_RANDOM_TA, "random auth/deauth transmitter address");
-+ ext_feat_case(OWE_OFFLOAD, "OWE DH element handling offload (client)");
-+ ext_feat_case(OWE_OFFLOAD_AP, "OWE DH element handling offload (AP)");
- }
- }
-
-diff --git a/nl80211.h b/nl80211.h
-index 88eb85c..a682b54 100644
---- a/nl80211.h
-+++ b/nl80211.h
-@@ -72,7 +72,7 @@
- * For drivers supporting TDLS with external setup (WIPHY_FLAG_SUPPORTS_TDLS
- * and WIPHY_FLAG_TDLS_EXTERNAL_SETUP), the station lifetime is as follows:
- * - a setup station entry is added, not yet authorized, without any rate
-- * or capability information, this just exists to avoid race conditions
-+ * or capability information; this just exists to avoid race conditions
- * - when the TDLS setup is done, a single NL80211_CMD_SET_STATION is valid
- * to add rate and capability information to the station and at the same
- * time mark it authorized.
-@@ -87,7 +87,7 @@
- * DOC: Frame transmission/registration support
- *
- * Frame transmission and registration support exists to allow userspace
-- * management entities such as wpa_supplicant react to management frames
-+ * management entities such as wpa_supplicant to react to management frames
- * that are not being handled by the kernel. This includes, for example,
- * certain classes of action frames that cannot be handled in the kernel
- * for various reasons.
-@@ -113,7 +113,7 @@
- *
- * Frame transmission allows userspace to send for example the required
- * responses to action frames. It is subject to some sanity checking,
-- * but many frames can be transmitted. When a frame was transmitted, its
-+ * but many frames can be transmitted. When a frame is transmitted, its
- * status is indicated to the sending socket.
- *
- * For more technical details, see the corresponding command descriptions
-@@ -123,7 +123,7 @@
- /**
- * DOC: Virtual interface / concurrency capabilities
- *
-- * Some devices are able to operate with virtual MACs, they can have
-+ * Some devices are able to operate with virtual MACs; they can have
- * more than one virtual interface. The capability handling for this
- * is a bit complex though, as there may be a number of restrictions
- * on the types of concurrency that are supported.
-@@ -135,7 +135,7 @@
- * Once concurrency is desired, more attributes must be observed:
- * To start with, since some interface types are purely managed in
- * software, like the AP-VLAN type in mac80211 for example, there's
-- * an additional list of these, they can be added at any time and
-+ * an additional list of these; they can be added at any time and
- * are only restricted by some semantic restrictions (e.g. AP-VLAN
- * cannot be added without a corresponding AP interface). This list
- * is exported in the %NL80211_ATTR_SOFTWARE_IFTYPES attribute.
-@@ -164,17 +164,17 @@
- * Packet coalesce feature helps to reduce number of received interrupts
- * to host by buffering these packets in firmware/hardware for some
- * predefined time. Received interrupt will be generated when one of the
-- * following events occur.
-+ * following events occurs.
- * a) Expiration of hardware timer whose expiration time is set to maximum
- * coalescing delay of matching coalesce rule.
-- * b) Coalescing buffer in hardware reaches it's limit.
-+ * b) Coalescing buffer in hardware reaches its limit.
- * c) Packet doesn't match any of the configured coalesce rules.
- *
- * User needs to configure following parameters for creating a coalesce
- * rule.
- * a) Maximum coalescing delay
- * b) List of packet patterns which needs to be matched
-- * c) Condition for coalescence. pattern 'match' or 'no match'
-+ * c) Condition for coalescence: pattern 'match' or 'no match'
- * Multiple such rules can be created.
- */
-
-@@ -213,7 +213,7 @@
- /**
- * DOC: FILS shared key authentication offload
- *
-- * FILS shared key authentication offload can be advertized by drivers by
-+ * FILS shared key authentication offload can be advertised by drivers by
- * setting @NL80211_EXT_FEATURE_FILS_SK_OFFLOAD flag. The drivers that support
- * FILS shared key authentication offload should be able to construct the
- * authentication and association frames for FILS shared key authentication and
-@@ -239,7 +239,7 @@
- * The PMKSA can be maintained in userspace persistently so that it can be used
- * later after reboots or wifi turn off/on also.
- *
-- * %NL80211_ATTR_FILS_CACHE_ID is the cache identifier advertized by a FILS
-+ * %NL80211_ATTR_FILS_CACHE_ID is the cache identifier advertised by a FILS
- * capable AP supporting PMK caching. It specifies the scope within which the
- * PMKSAs are cached in an ESS. %NL80211_CMD_SET_PMKSA and
- * %NL80211_CMD_DEL_PMKSA are enhanced to allow support for PMKSA caching based
-@@ -290,12 +290,12 @@
- * If the configuration needs to be applied for specific peer then the MAC
- * address of the peer needs to be passed in %NL80211_ATTR_MAC, otherwise the
- * configuration will be applied for all the connected peers in the vif except
-- * any peers that have peer specific configuration for the TID by default; if
-- * the %NL80211_TID_CONFIG_ATTR_OVERRIDE flag is set, peer specific values
-+ * any peers that have peer-specific configuration for the TID by default; if
-+ * the %NL80211_TID_CONFIG_ATTR_OVERRIDE flag is set, peer-specific values
- * will be overwritten.
- *
-- * All this configuration is valid only for STA's current connection
-- * i.e. the configuration will be reset to default when the STA connects back
-+ * All this configuration is valid only for STA's current connection,
-+ * i.e., the configuration will be reset to default when the STA connects back
- * after disconnection/roaming, and this configuration will be cleared when
- * the interface goes down.
- */
-@@ -326,7 +326,7 @@
- /**
- * DOC: Multi-Link Operation
- *
-- * In Multi-Link Operation, a connection between to MLDs utilizes multiple
-+ * In Multi-Link Operation, a connection between two MLDs utilizes multiple
- * links. To use this in nl80211, various commands and responses now need
- * to or will include the new %NL80211_ATTR_MLO_LINKS attribute.
- * Additionally, various commands that need to operate on a specific link
-@@ -334,6 +334,15 @@
- * use %NL80211_CMD_START_AP or similar functions.
- */
-
-+/**
-+ * DOC: OWE DH IE handling offload
-+ *
-+ * By setting @NL80211_EXT_FEATURE_OWE_OFFLOAD flag, drivers can indicate
-+ * kernel/application space to avoid DH IE handling. When this flag is
-+ * advertised, the driver/device will take care of DH IE inclusion and
-+ * processing of peer DH IE to generate PMK.
-+ */
-+
- /**
- * enum nl80211_commands - supported nl80211 commands
- *
-@@ -512,7 +521,7 @@
- * %NL80211_ATTR_SCHED_SCAN_PLANS. If %NL80211_ATTR_SCHED_SCAN_PLANS is
- * not specified and only %NL80211_ATTR_SCHED_SCAN_INTERVAL is specified,
- * scheduled scan will run in an infinite loop with the specified interval.
-- * These attributes are mutually exculsive,
-+ * These attributes are mutually exclusive,
- * i.e. NL80211_ATTR_SCHED_SCAN_INTERVAL must not be passed if
- * NL80211_ATTR_SCHED_SCAN_PLANS is defined.
- * If for some reason scheduled scan is aborted by the driver, all scan
-@@ -543,7 +552,7 @@
- * %NL80211_CMD_STOP_SCHED_SCAN command is received or when the interface
- * is brought down while a scheduled scan was running.
- *
-- * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation
-+ * @NL80211_CMD_GET_SURVEY: get survey results, e.g. channel occupation
- * or noise level
- * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to
- * NL80211_CMD_GET_SURVEY and on the "scan" multicast group)
-@@ -554,12 +563,13 @@
- * using %NL80211_ATTR_SSID, %NL80211_ATTR_FILS_CACHE_ID,
- * %NL80211_ATTR_PMKID, and %NL80211_ATTR_PMK in case of FILS
- * authentication where %NL80211_ATTR_FILS_CACHE_ID is the identifier
-- * advertized by a FILS capable AP identifying the scope of PMKSA in an
-+ * advertised by a FILS capable AP identifying the scope of PMKSA in an
- * ESS.
- * @NL80211_CMD_DEL_PMKSA: Delete a PMKSA cache entry, using %NL80211_ATTR_MAC
- * (for the BSSID) and %NL80211_ATTR_PMKID or using %NL80211_ATTR_SSID,
- * %NL80211_ATTR_FILS_CACHE_ID, and %NL80211_ATTR_PMKID in case of FILS
-- * authentication.
-+ * authentication. Additionally in case of SAE offload and OWE offloads
-+ * PMKSA entry can be deleted using %NL80211_ATTR_SSID.
- * @NL80211_CMD_FLUSH_PMKSA: Flush all PMKSA cache entries.
- *
- * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain
-@@ -598,7 +608,7 @@
- * BSSID in case of station mode). %NL80211_ATTR_SSID is used to specify
- * the SSID (mainly for association, but is included in authentication
- * request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ +
-- * %NL80211_ATTR_WIPHY_FREQ_OFFSET is used to specify the frequence of the
-+ * %NL80211_ATTR_WIPHY_FREQ_OFFSET is used to specify the frequency of the
- * channel in MHz. %NL80211_ATTR_AUTH_TYPE is used to specify the
- * authentication type. %NL80211_ATTR_IE is used to define IEs
- * (VendorSpecificInfo, but also including RSN IE and FT IEs) to be added
-@@ -807,7 +817,7 @@
- * reached.
- * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
- * and the attributes determining channel width) the given interface
-- * (identifed by %NL80211_ATTR_IFINDEX) shall operate on.
-+ * (identified by %NL80211_ATTR_IFINDEX) shall operate on.
- * In case multiple channels are supported by the device, the mechanism
- * with which it switches channels is implementation-defined.
- * When a monitor interface is given, it can only switch channel while
-@@ -879,7 +889,7 @@
- * inform userspace of the new replay counter.
- *
- * @NL80211_CMD_PMKSA_CANDIDATE: This is used as an event to inform userspace
-- * of PMKSA caching dandidates.
-+ * of PMKSA caching candidates.
- *
- * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup).
- * In addition, this can be used as an event to request userspace to take
-@@ -915,7 +925,7 @@
- *
- * @NL80211_CMD_PROBE_CLIENT: Probe an associated station on an AP interface
- * by sending a null data frame to it and reporting when the frame is
-- * acknowleged. This is used to allow timing out inactive clients. Uses
-+ * acknowledged. This is used to allow timing out inactive clients. Uses
- * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_MAC. The command returns a
- * direct reply with an %NL80211_ATTR_COOKIE that is later used to match
- * up the event with the request. The event includes the same data and
-@@ -1126,11 +1136,15 @@
- * @NL80211_CMD_DEL_PMK: For offloaded 4-Way handshake, delete the previously
- * configured PMK for the authenticator address identified by
- * %NL80211_ATTR_MAC.
-- * @NL80211_CMD_PORT_AUTHORIZED: An event that indicates an 802.1X FT roam was
-- * completed successfully. Drivers that support 4 way handshake offload
-- * should send this event after indicating 802.1X FT assocation with
-- * %NL80211_CMD_ROAM. If the 4 way handshake failed %NL80211_CMD_DISCONNECT
-- * should be indicated instead.
-+ * @NL80211_CMD_PORT_AUTHORIZED: An event that indicates port is authorized and
-+ * open for regular data traffic. For STA/P2P-client, this event is sent
-+ * with AP MAC address and for AP/P2P-GO, the event carries the STA/P2P-
-+ * client MAC address.
-+ * Drivers that support 4 way handshake offload should send this event for
-+ * STA/P2P-client after successful 4-way HS or after 802.1X FT following
-+ * NL80211_CMD_CONNECT or NL80211_CMD_ROAM. Drivers using AP/P2P-GO 4-way
-+ * handshake offload should send this event on successful completion of
-+ * 4-way handshake with the peer (STA/P2P-client).
- * @NL80211_CMD_CONTROL_PORT_FRAME: Control Port (e.g. PAE) frame TX request
- * and RX notification. This command is used both as a request to transmit
- * a control port frame and as a notification that a control port frame
-@@ -1314,6 +1328,11 @@
- * Multi-Link reconfiguration. %NL80211_ATTR_MLO_LINKS is used to provide
- * information about the removed STA MLD setup links.
- *
-+ * @NL80211_CMD_SET_TID_TO_LINK_MAPPING: Set the TID to Link Mapping for a
-+ * non-AP MLD station. The %NL80211_ATTR_MLO_TTLM_DLINK and
-+ * %NL80211_ATTR_MLO_TTLM_ULINK attributes are used to specify the
-+ * TID to Link mapping for downlink/uplink traffic.
-+ *
- * @NL80211_CMD_MAX: highest used command number
- * @__NL80211_CMD_AFTER_LAST: internal use
- */
-@@ -1569,6 +1588,8 @@ enum nl80211_commands {
-
- NL80211_CMD_LINKS_REMOVED,
-
-+ NL80211_CMD_SET_TID_TO_LINK_MAPPING,
-+
- /* add new commands above here */
-
- /* used to define NL80211_CMD_MAX below */
-@@ -1826,7 +1847,7 @@ enum nl80211_commands {
- * using %CMD_CONTROL_PORT_FRAME. If control port routing over NL80211 is
- * to be used then userspace must also use the %NL80211_ATTR_SOCKET_OWNER
- * flag. When used with %NL80211_ATTR_CONTROL_PORT_NO_PREAUTH, pre-auth
-- * frames are not forwared over the control port.
-+ * frames are not forwarded over the control port.
- *
- * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
- * We recommend using nested, driver-specific attributes within this.
-@@ -1963,10 +1984,10 @@ enum nl80211_commands {
- * bit. Depending on which antennas are selected in the bitmap, 802.11n
- * drivers can derive which chainmasks to use (if all antennas belonging to
- * a particular chain are disabled this chain should be disabled) and if
-- * a chain has diversity antennas wether diversity should be used or not.
-+ * a chain has diversity antennas whether diversity should be used or not.
- * HT capabilities (STBC, TX Beamforming, Antenna selection) can be
- * derived from the available chains after applying the antenna mask.
-- * Non-802.11n drivers can derive wether to use diversity or not.
-+ * Non-802.11n drivers can derive whether to use diversity or not.
- * Drivers may reject configurations or RX/TX mask combinations they cannot
- * support by returning -EINVAL.
- *
-@@ -2536,7 +2557,7 @@ enum nl80211_commands {
- * from successful FILS authentication and is used with
- * %NL80211_CMD_CONNECT.
- *
-- * @NL80211_ATTR_FILS_CACHE_ID: A 2-octet identifier advertized by a FILS AP
-+ * @NL80211_ATTR_FILS_CACHE_ID: A 2-octet identifier advertised by a FILS AP
- * identifying the scope of PMKSAs. This is used with
- * @NL80211_CMD_SET_PMKSA and @NL80211_CMD_DEL_PMKSA.
- *
-@@ -2690,11 +2711,13 @@ enum nl80211_commands {
- *
- * @NL80211_ATTR_FILS_DISCOVERY: Optional parameter to configure FILS
- * discovery. It is a nested attribute, see
-- * &enum nl80211_fils_discovery_attributes.
-+ * &enum nl80211_fils_discovery_attributes. Userspace should pass an empty
-+ * nested attribute to disable this feature and delete the templates.
- *
- * @NL80211_ATTR_UNSOL_BCAST_PROBE_RESP: Optional parameter to configure
- * unsolicited broadcast probe response. It is a nested attribute, see
-- * &enum nl80211_unsol_bcast_probe_resp_attributes.
-+ * &enum nl80211_unsol_bcast_probe_resp_attributes. Userspace should pass an empty
-+ * nested attribute to disable this feature and delete the templates.
- *
- * @NL80211_ATTR_S1G_CAPABILITY: S1G Capability information element (from
- * association request when used with NL80211_CMD_NEW_STATION)
-@@ -2815,6 +2838,19 @@ enum nl80211_commands {
- * @NL80211_ATTR_MLO_LINK_DISABLED: Flag attribute indicating that the link is
- * disabled.
- *
-+ * @NL80211_ATTR_BSS_DUMP_INCLUDE_USE_DATA: Include BSS usage data, i.e.
-+ * include BSSes that can only be used in restricted scenarios and/or
-+ * cannot be used at all.
-+ *
-+ * @NL80211_ATTR_MLO_TTLM_DLINK: Binary attribute specifying the downlink TID to
-+ * link mapping. The length is 8 * sizeof(u16). For each TID the link
-+ * mapping is as defined in section 9.4.2.314 (TID-To-Link Mapping element)
-+ * in Draft P802.11be_D4.0.
-+ * @NL80211_ATTR_MLO_TTLM_ULINK: Binary attribute specifying the uplink TID to
-+ * link mapping. The length is 8 * sizeof(u16). For each TID the link
-+ * mapping is as defined in section 9.4.2.314 (TID-To-Link Mapping element)
-+ * in Draft P802.11be_D4.0.
-+ *
- * @NUM_NL80211_ATTR: total number of nl80211_attrs available
- * @NL80211_ATTR_MAX: highest attribute number currently defined
- * @__NL80211_ATTR_AFTER_LAST: internal use
-@@ -3353,6 +3389,11 @@ enum nl80211_attrs {
-
- NL80211_ATTR_MLO_LINK_DISABLED,
-
-+ NL80211_ATTR_BSS_DUMP_INCLUDE_USE_DATA,
-+
-+ NL80211_ATTR_MLO_TTLM_DLINK,
-+ NL80211_ATTR_MLO_TTLM_ULINK,
-+
- /* add attributes here, update the policy in nl80211.c */
-
- __NL80211_ATTR_AFTER_LAST,
-@@ -4159,7 +4200,7 @@ enum nl80211_wmm_rule {
- * (100 * dBm).
- * @NL80211_FREQUENCY_ATTR_DFS_STATE: current state for DFS
- * (enum nl80211_dfs_state)
-- * @NL80211_FREQUENCY_ATTR_DFS_TIME: time in miliseconds for how long
-+ * @NL80211_FREQUENCY_ATTR_DFS_TIME: time in milliseconds for how long
- * this channel is in this DFS state.
- * @NL80211_FREQUENCY_ATTR_NO_HT40_MINUS: HT40- isn't possible with this
- * channel as the control channel
-@@ -4213,6 +4254,8 @@ enum nl80211_wmm_rule {
- * as the primary or any of the secondary channels isn't possible
- * @NL80211_FREQUENCY_ATTR_NO_EHT: EHT operation is not allowed on this channel
- * in current regulatory domain.
-+ * @NL80211_FREQUENCY_ATTR_PSD: Power spectral density (in dBm) that
-+ * is allowed on this channel in current regulatory domain.
- * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
- * currently defined
- * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
-@@ -4251,6 +4294,7 @@ enum nl80211_frequency_attr {
- NL80211_FREQUENCY_ATTR_16MHZ,
- NL80211_FREQUENCY_ATTR_NO_320MHZ,
- NL80211_FREQUENCY_ATTR_NO_EHT,
-+ NL80211_FREQUENCY_ATTR_PSD,
-
- /* keep last */
- __NL80211_FREQUENCY_ATTR_AFTER_LAST,
-@@ -4351,6 +4395,8 @@ enum nl80211_reg_type {
- * a given frequency range. The value is in mBm (100 * dBm).
- * @NL80211_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds.
- * If not present or 0 default CAC time will be used.
-+ * @NL80211_ATTR_POWER_RULE_PSD: power spectral density (in dBm).
-+ * This could be negative.
- * @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number
- * currently defined
- * @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use
-@@ -4368,6 +4414,8 @@ enum nl80211_reg_rule_attr {
-
- NL80211_ATTR_DFS_CAC_TIME,
-
-+ NL80211_ATTR_POWER_RULE_PSD,
-+
- /* keep last */
- __NL80211_REG_RULE_ATTR_AFTER_LAST,
- NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1
-@@ -4451,6 +4499,7 @@ enum nl80211_sched_scan_match_attr {
- * @NL80211_RRF_NO_HE: HE operation not allowed
- * @NL80211_RRF_NO_320MHZ: 320MHz operation not allowed
- * @NL80211_RRF_NO_EHT: EHT operation not allowed
-+ * @NL80211_RRF_PSD: Ruleset has power spectral density value
- */
- enum nl80211_reg_rule_flags {
- NL80211_RRF_NO_OFDM = 1<<0,
-@@ -4471,6 +4520,7 @@ enum nl80211_reg_rule_flags {
- NL80211_RRF_NO_HE = 1<<17,
- NL80211_RRF_NO_320MHZ = 1<<18,
- NL80211_RRF_NO_EHT = 1<<19,
-+ NL80211_RRF_PSD = 1<<20,
- };
-
- #define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
-@@ -5007,6 +5057,30 @@ enum nl80211_bss_scan_width {
- NL80211_BSS_CHAN_WIDTH_2,
- };
-
-+/**
-+ * enum nl80211_bss_use_for - bitmap indicating possible BSS use
-+ * @NL80211_BSS_USE_FOR_NORMAL: Use this BSS for normal "connection",
-+ * including IBSS/MBSS depending on the type.
-+ * @NL80211_BSS_USE_FOR_MLD_LINK: This BSS can be used as a link in an
-+ * MLO connection. Note that for an MLO connection, all links including
-+ * the assoc link must have this flag set, and the assoc link must
-+ * additionally have %NL80211_BSS_USE_FOR_NORMAL set.
-+ */
-+enum nl80211_bss_use_for {
-+ NL80211_BSS_USE_FOR_NORMAL = 1 << 0,
-+ NL80211_BSS_USE_FOR_MLD_LINK = 1 << 1,
-+};
-+
-+/**
-+ * enum nl80211_bss_cannot_use_reasons - reason(s) connection to a
-+ * BSS isn't possible
-+ * @NL80211_BSS_CANNOT_USE_NSTR_NONPRIMARY: NSTR nonprimary links aren't
-+ * supported by the device, and this BSS entry represents one.
-+ */
-+enum nl80211_bss_cannot_use_reasons {
-+ NL80211_BSS_CANNOT_USE_NSTR_NONPRIMARY = 1 << 0,
-+};
-+
- /**
- * enum nl80211_bss - netlink attributes for a BSS
- *
-@@ -5038,7 +5112,7 @@ enum nl80211_bss_scan_width {
- * elements from a Beacon frame (bin); not present if no Beacon frame has
- * yet been received
- * @NL80211_BSS_CHAN_WIDTH: channel width of the control channel
-- * (u32, enum nl80211_bss_scan_width)
-+ * (u32, enum nl80211_bss_scan_width) - No longer used!
- * @NL80211_BSS_BEACON_TSF: TSF of the last received beacon (u64)
- * (not present if no beacon frame has been received yet)
- * @NL80211_BSS_PRESP_DATA: the data in @NL80211_BSS_INFORMATION_ELEMENTS and
-@@ -5059,6 +5133,14 @@ enum nl80211_bss_scan_width {
- * @NL80211_BSS_FREQUENCY_OFFSET: frequency offset in KHz
- * @NL80211_BSS_MLO_LINK_ID: MLO link ID of the BSS (u8).
- * @NL80211_BSS_MLD_ADDR: MLD address of this BSS if connected to it.
-+ * @NL80211_BSS_USE_FOR: u32 bitmap attribute indicating what the BSS can be
-+ * used for, see &enum nl80211_bss_use_for.
-+ * @NL80211_BSS_CANNOT_USE_REASONS: Indicates the reason that this BSS cannot
-+ * be used for all or some of the possible uses by the device reporting it,
-+ * even though its presence was detected.
-+ * This is a u64 attribute containing a bitmap of values from
-+ * &enum nl80211_cannot_use_reasons, note that the attribute may be missing
-+ * if no reasons are specified.
- * @__NL80211_BSS_AFTER_LAST: internal
- * @NL80211_BSS_MAX: highest BSS attribute
- */
-@@ -5086,6 +5168,8 @@ enum nl80211_bss {
- NL80211_BSS_FREQUENCY_OFFSET,
- NL80211_BSS_MLO_LINK_ID,
- NL80211_BSS_MLD_ADDR,
-+ NL80211_BSS_USE_FOR,
-+ NL80211_BSS_CANNOT_USE_REASONS,
-
- /* keep last */
- __NL80211_BSS_AFTER_LAST,
-@@ -5434,7 +5518,7 @@ enum nl80211_tx_rate_setting {
- * (%NL80211_TID_CONFIG_ATTR_TIDS, %NL80211_TID_CONFIG_ATTR_OVERRIDE).
- * @NL80211_TID_CONFIG_ATTR_PEER_SUPP: same as the previous per-vif one, but
- * per peer instead.
-- * @NL80211_TID_CONFIG_ATTR_OVERRIDE: flag attribue, if set indicates
-+ * @NL80211_TID_CONFIG_ATTR_OVERRIDE: flag attribute, if set indicates
- * that the new configuration overrides all previous peer
- * configurations, otherwise previous peer specific configurations
- * should be left untouched.
-@@ -5817,7 +5901,7 @@ enum nl80211_attr_coalesce_rule {
-
- /**
- * enum nl80211_coalesce_condition - coalesce rule conditions
-- * @NL80211_COALESCE_CONDITION_MATCH: coalaesce Rx packets when patterns
-+ * @NL80211_COALESCE_CONDITION_MATCH: coalesce Rx packets when patterns
- * in a rule are matched.
- * @NL80211_COALESCE_CONDITION_NO_MATCH: coalesce Rx packets when patterns
- * in a rule are not matched.
-@@ -5916,7 +6000,7 @@ enum nl80211_if_combination_attrs {
- * enum nl80211_plink_state - state of a mesh peer link finite state machine
- *
- * @NL80211_PLINK_LISTEN: initial state, considered the implicit
-- * state of non existent mesh peer links
-+ * state of non-existent mesh peer links
- * @NL80211_PLINK_OPN_SNT: mesh plink open frame has been sent to
- * this mesh peer
- * @NL80211_PLINK_OPN_RCVD: mesh plink open frame has been received
-@@ -6209,7 +6293,7 @@ enum nl80211_feature_flags {
- * request to use RRM (see %NL80211_ATTR_USE_RRM) with
- * %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests, which will set
- * the ASSOC_REQ_USE_RRM flag in the association request even if
-- * NL80211_FEATURE_QUIET is not advertized.
-+ * NL80211_FEATURE_QUIET is not advertised.
- * @NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER: This device supports MU-MIMO air
- * sniffer which means that it can be configured to hear packets from
- * certain groups which can be configured by the
-@@ -6221,13 +6305,15 @@ enum nl80211_feature_flags {
- * the BSS that the interface that requested the scan is connected to
- * (if available).
- * @NL80211_EXT_FEATURE_BSS_PARENT_TSF: Per BSS, this driver reports the
-- * time the last beacon/probe was received. The time is the TSF of the
-- * BSS that the interface that requested the scan is connected to
-- * (if available).
-+ * time the last beacon/probe was received. For a non-MLO connection, the
-+ * time is the TSF of the BSS that the interface that requested the scan is
-+ * connected to (if available). For an MLO connection, the time is the TSF
-+ * of the BSS corresponding with link ID specified in the scan request (if
-+ * specified).
- * @NL80211_EXT_FEATURE_SET_SCAN_DWELL: This driver supports configuration of
- * channel dwell time.
- * @NL80211_EXT_FEATURE_BEACON_RATE_LEGACY: Driver supports beacon rate
-- * configuration (AP/mesh), supporting a legacy (non HT/VHT) rate.
-+ * configuration (AP/mesh), supporting a legacy (non-HT/VHT) rate.
- * @NL80211_EXT_FEATURE_BEACON_RATE_HT: Driver supports beacon rate
- * configuration (AP/mesh) with HT rates.
- * @NL80211_EXT_FEATURE_BEACON_RATE_VHT: Driver supports beacon rate
-@@ -6400,6 +6486,12 @@ enum nl80211_feature_flags {
- * in authentication and deauthentication frames sent to unassociated peer
- * using @NL80211_CMD_FRAME.
- *
-+ * @NL80211_EXT_FEATURE_OWE_OFFLOAD: Driver/Device wants to do OWE DH IE
-+ * handling in station mode.
-+ *
-+ * @NL80211_EXT_FEATURE_OWE_OFFLOAD_AP: Driver/Device wants to do OWE DH IE
-+ * handling in AP mode.
-+ *
- * @NUM_NL80211_EXT_FEATURES: number of extended features.
- * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
- */
-@@ -6471,6 +6563,8 @@ enum nl80211_ext_feature_index {
- NL80211_EXT_FEATURE_PUNCT,
- NL80211_EXT_FEATURE_SECURE_NAN,
- NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA,
-+ NL80211_EXT_FEATURE_OWE_OFFLOAD,
-+ NL80211_EXT_FEATURE_OWE_OFFLOAD_AP,
-
- /* add new features before the definition below */
- NUM_NL80211_EXT_FEATURES,
-@@ -6555,7 +6649,7 @@ enum nl80211_timeout_reason {
- * request parameters IE in the probe request
- * @NL80211_SCAN_FLAG_ACCEPT_BCAST_PROBE_RESP: accept broadcast probe responses
- * @NL80211_SCAN_FLAG_OCE_PROBE_REQ_HIGH_TX_RATE: send probe request frames at
-- * rate of at least 5.5M. In case non OCE AP is discovered in the channel,
-+ * rate of at least 5.5M. In case non-OCE AP is discovered in the channel,
- * only the first probe req in the channel will be sent in high rate.
- * @NL80211_SCAN_FLAG_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION: allow probe request
- * tx deferral (dot11FILSProbeDelay shall be set to 15ms)
-@@ -6591,7 +6685,7 @@ enum nl80211_timeout_reason {
- * received on the 2.4/5 GHz channels to actively scan only the 6GHz
- * channels on which APs are expected to be found. Note that when not set,
- * the scan logic would scan all 6GHz channels, but since transmission of
-- * probe requests on non PSC channels is limited, it is highly likely that
-+ * probe requests on non-PSC channels is limited, it is highly likely that
- * these channels would passively be scanned. Also note that when the flag
- * is set, in addition to the colocated APs, PSC channels would also be
- * scanned if the user space has asked for it.
-@@ -6923,7 +7017,7 @@ enum nl80211_nan_func_term_reason {
- * The instance ID for the follow up Service Discovery Frame. This is u8.
- * @NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID: relevant if the function's type
- * is follow up. This is a u8.
-- * The requestor instance ID for the follow up Service Discovery Frame.
-+ * The requester instance ID for the follow up Service Discovery Frame.
- * @NL80211_NAN_FUNC_FOLLOW_UP_DEST: the MAC address of the recipient of the
- * follow up Service Discovery Frame. This is a binary attribute.
- * @NL80211_NAN_FUNC_CLOSE_RANGE: is this function limited for devices in a
-@@ -7313,7 +7407,7 @@ enum nl80211_peer_measurement_attrs {
- * @NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED: flag attribute indicating if
- * trigger based ranging measurement is supported
- * @NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED: flag attribute indicating
-- * if non trigger based ranging measurement is supported
-+ * if non-trigger-based ranging measurement is supported
- *
- * @NUM_NL80211_PMSR_FTM_CAPA_ATTR: internal
- * @NL80211_PMSR_FTM_CAPA_ATTR_MAX: highest attribute number
-@@ -7367,7 +7461,7 @@ enum nl80211_peer_measurement_ftm_capa {
- * if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor
- * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based
- * ranging will be used.
-- * @NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED: request non trigger based
-+ * @NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED: request non-trigger-based
- * ranging measurement (flag)
- * This attribute and %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED are
- * mutually exclusive.
-@@ -7445,7 +7539,7 @@ enum nl80211_peer_measurement_ftm_failure_reasons {
- * @NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS: number of FTM Request frames
- * transmitted (u32, optional)
- * @NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES: number of FTM Request frames
-- * that were acknowleged (u32, optional)
-+ * that were acknowledged (u32, optional)
- * @NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME: retry time received from the
- * busy peer (u32, seconds)
- * @NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP: actual number of bursts exponent
-@@ -7606,7 +7700,7 @@ enum nl80211_iftype_akm_attributes {
- * @NL80211_FILS_DISCOVERY_ATTR_INT_MIN: Minimum packet interval (u32, TU).
- * Allowed range: 0..10000 (TU = Time Unit)
- * @NL80211_FILS_DISCOVERY_ATTR_INT_MAX: Maximum packet interval (u32, TU).
-- * Allowed range: 0..10000 (TU = Time Unit)
-+ * Allowed range: 0..10000 (TU = Time Unit). If set to 0, the feature is disabled.
- * @NL80211_FILS_DISCOVERY_ATTR_TMPL: Template data for FILS discovery action
- * frame including the headers.
- *
-@@ -7639,7 +7733,8 @@ enum nl80211_fils_discovery_attributes {
- *
- * @NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT: Maximum packet interval (u32, TU).
- * Allowed range: 0..20 (TU = Time Unit). IEEE P802.11ax/D6.0
-- * 26.17.2.3.2 (AP behavior for fast passive scanning).
-+ * 26.17.2.3.2 (AP behavior for fast passive scanning). If set to 0, the feature is
-+ * disabled.
- * @NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL: Unsolicited broadcast probe response
- * frame template (binary).
- *
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0025-bump-version-to-6.7.patch b/recipes-wifi/iw/patches-mlo/0025-bump-version-to-6.7.patch
deleted file mode 100644
index 89cdbb7..0000000
--- a/recipes-wifi/iw/patches-mlo/0025-bump-version-to-6.7.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 52ae9650b3a09306608cc266bd2ca5b4d789d453 Mon Sep 17 00:00:00 2001
-From: Johannes Berg <johannes.berg@intel.com>
-Date: Thu, 21 Dec 2023 12:51:14 +0100
-Subject: [PATCH 25/28] bump version to 6.7
-
-This already has some "will be 6.8" content, but
-that's not entirely closed yet.
-
-Change-Id: I16beefdf8b5e37fc72948d8a874772dc8c97e7b2
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- version.sh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/version.sh b/version.sh
-index 9895056..3091e1e 100755
---- a/version.sh
-+++ b/version.sh
-@@ -1,6 +1,6 @@
- #!/bin/sh
-
--VERSION="5.19"
-+VERSION="6.7"
- OUT="$1"
-
- # get the absolute path for the OUT file
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/0026-update-nl80211.h.patch b/recipes-wifi/iw/patches-mlo/0026-update-nl80211.h.patch
deleted file mode 100644
index 6c12bd8..0000000
--- a/recipes-wifi/iw/patches-mlo/0026-update-nl80211.h.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-From c49eb9ee6847953b24ba265add49fa4ec587c7a8 Mon Sep 17 00:00:00 2001
-From: Johannes Berg <johannes.berg@intel.com>
-Date: Thu, 21 Dec 2023 20:42:17 +0100
-Subject: [PATCH 26/28] update nl80211.h
-
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- info.c | 1 +
- nl80211.h | 29 +++++++++++++++++++++++++++++
- 2 files changed, 30 insertions(+)
-
-diff --git a/info.c b/info.c
-index 317e7a3..40dcc81 100644
---- a/info.c
-+++ b/info.c
-@@ -172,6 +172,7 @@ static void ext_feat_print(enum nl80211_ext_feature_index idx)
- ext_feat_case(AUTH_AND_DEAUTH_RANDOM_TA, "random auth/deauth transmitter address");
- ext_feat_case(OWE_OFFLOAD, "OWE DH element handling offload (client)");
- ext_feat_case(OWE_OFFLOAD_AP, "OWE DH element handling offload (AP)");
-+ ext_feat_case(DFS_CONCURRENT, "DFS channel use under concurrent DFS master");
- }
- }
-
-diff --git a/nl80211.h b/nl80211.h
-index a682b54..1ccdcae 100644
---- a/nl80211.h
-+++ b/nl80211.h
-@@ -4256,6 +4256,14 @@ enum nl80211_wmm_rule {
- * in current regulatory domain.
- * @NL80211_FREQUENCY_ATTR_PSD: Power spectral density (in dBm) that
- * is allowed on this channel in current regulatory domain.
-+ * @NL80211_FREQUENCY_ATTR_DFS_CONCURRENT: Operation on this channel is
-+ * allowed for peer-to-peer or adhoc communication under the control
-+ * of a DFS master which operates on the same channel (FCC-594280 D01
-+ * Section B.3). Should be used together with %NL80211_RRF_DFS only.
-+ * @NL80211_FREQUENCY_ATTR_NO_UHB_VLP_CLIENT: Client connection to VLP AP
-+ * not allowed using this channel
-+ * @NL80211_FREQUENCY_ATTR_NO_UHB_AFC_CLIENT: Client connection to AFC AP
-+ * not allowed using this channel
- * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
- * currently defined
- * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
-@@ -4295,6 +4303,9 @@ enum nl80211_frequency_attr {
- NL80211_FREQUENCY_ATTR_NO_320MHZ,
- NL80211_FREQUENCY_ATTR_NO_EHT,
- NL80211_FREQUENCY_ATTR_PSD,
-+ NL80211_FREQUENCY_ATTR_DFS_CONCURRENT,
-+ NL80211_FREQUENCY_ATTR_NO_UHB_VLP_CLIENT,
-+ NL80211_FREQUENCY_ATTR_NO_UHB_AFC_CLIENT,
-
- /* keep last */
- __NL80211_FREQUENCY_ATTR_AFTER_LAST,
-@@ -4500,6 +4511,12 @@ enum nl80211_sched_scan_match_attr {
- * @NL80211_RRF_NO_320MHZ: 320MHz operation not allowed
- * @NL80211_RRF_NO_EHT: EHT operation not allowed
- * @NL80211_RRF_PSD: Ruleset has power spectral density value
-+ * @NL80211_RRF_DFS_CONCURRENT: Operation on this channel is allowed for
-+ peer-to-peer or adhoc communication under the control of a DFS master
-+ which operates on the same channel (FCC-594280 D01 Section B.3).
-+ Should be used together with %NL80211_RRF_DFS only.
-+ * @NL80211_RRF_NO_UHB_VLP_CLIENT: Client connection to VLP AP not allowed
-+ * @NL80211_RRF_NO_UHB_AFC_CLIENT: Client connection to AFC AP not allowed
- */
- enum nl80211_reg_rule_flags {
- NL80211_RRF_NO_OFDM = 1<<0,
-@@ -4521,6 +4538,9 @@ enum nl80211_reg_rule_flags {
- NL80211_RRF_NO_320MHZ = 1<<18,
- NL80211_RRF_NO_EHT = 1<<19,
- NL80211_RRF_PSD = 1<<20,
-+ NL80211_RRF_DFS_CONCURRENT = 1<<21,
-+ NL80211_RRF_NO_UHB_VLP_CLIENT = 1<<22,
-+ NL80211_RRF_NO_UHB_AFC_CLIENT = 1<<23,
- };
-
- #define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
-@@ -5076,9 +5096,12 @@ enum nl80211_bss_use_for {
- * BSS isn't possible
- * @NL80211_BSS_CANNOT_USE_NSTR_NONPRIMARY: NSTR nonprimary links aren't
- * supported by the device, and this BSS entry represents one.
-+ * @NL80211_BSS_CANNOT_USE_UHB_PWR_MISMATCH: STA is not supporting
-+ * the AP power type (SP, VLP, AP) that the AP uses.
- */
- enum nl80211_bss_cannot_use_reasons {
- NL80211_BSS_CANNOT_USE_NSTR_NONPRIMARY = 1 << 0,
-+ NL80211_BSS_CANNOT_USE_UHB_PWR_MISMATCH = 1 << 1,
- };
-
- /**
-@@ -6492,6 +6515,11 @@ enum nl80211_feature_flags {
- * @NL80211_EXT_FEATURE_OWE_OFFLOAD_AP: Driver/Device wants to do OWE DH IE
- * handling in AP mode.
- *
-+ * @NL80211_EXT_FEATURE_DFS_CONCURRENT: The device supports peer-to-peer or
-+ * ad hoc operation on DFS channels under the control of a concurrent
-+ * DFS master on the same channel as described in FCC-594280 D01
-+ * (Section B.3). This, for example, allows P2P GO and P2P clients to
-+ * operate on DFS channels as long as there's a concurrent BSS connection.
- * @NUM_NL80211_EXT_FEATURES: number of extended features.
- * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
- */
-@@ -6565,6 +6593,7 @@ enum nl80211_ext_feature_index {
- NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA,
- NL80211_EXT_FEATURE_OWE_OFFLOAD,
- NL80211_EXT_FEATURE_OWE_OFFLOAD_AP,
-+ NL80211_EXT_FEATURE_DFS_CONCURRENT,
-
- /* add new features before the definition below */
- NUM_NL80211_EXT_FEATURES,
---
-2.39.2
-
diff --git a/recipes-wifi/iw/patches-mlo/patches.inc b/recipes-wifi/iw/patches-mlo/patches.inc
index 09d5579..5c18fcd 100644
--- a/recipes-wifi/iw/patches-mlo/patches.inc
+++ b/recipes-wifi/iw/patches-mlo/patches.inc
@@ -1,31 +1,13 @@
#patch patches (come from openwrt/lede/target/linux/mediatek)
SRC_URI_append = " \
- file://0001-iw-info-print-PMSR-capabilities.patch \
- file://0002-iw-add-cac-background-command.patch \
- file://0003-iw-info-fix-bug-reading-preambles-and-bandwidths.patch \
- file://0004-iw-add-support-for-retrieving-keys.patch \
- file://0005-iw-event-fix-printf-format-error.patch \
- file://0006-update-nl80211.h.patch \
- file://0007-util-add-support-for-320Mhz-bandwidth.patch \
- file://0008-util-add-support-for-320MHz-bandwidth-without-cf1.patch \
- file://0009-iw-scan-set-NL80211_SCAN_FLAG_COLOCATED_6GHZ-in-case.patch \
- file://0010-link-fix-some-formatting.patch \
- file://0011-link-update-for-MLO.patch \
- file://0012-interface-print-links.patch \
- file://0013-util-don-t-print-EHT-info-if-not-present.patch \
- file://0014-iw-S1G-add-frequency-set-in-kHz-and-offset-options.patch \
- file://0015-iw-S1G-add-parsing-for-802.11ah-scan-IE-s.patch \
- file://0016-iw-S1G-add-list-command-support-for-802.11ah.patch \
- file://0017-iw-Fix-EHT-rates-printing.patch \
- file://0018-iw-add-more-extended-capa-bits.patch \
- file://0019-iw-fix-attribute-size-mismatch.patch \
- file://0020-iw-connect-Fix-segfault-during-open-authentication.patch \
- file://0021-update-nl80211.h.patch \
- file://0022-iw-S1G-add-802.11ah-support-for-link-command-display.patch \
- file://0023-iw-allow-extra-cflags.patch \
- file://0024-update-nl80211.h.patch \
- file://0025-bump-version-to-6.7.patch \
- file://0026-update-nl80211.h.patch \
- file://0027-Revert-iw-allow-specifying-CFLAGS-LIBS-externally.patch \
- file://0028-survey-bss-rx-time.patch \
+ file://0001-iw-refactor-frequency-help.patch \
+ file://0002-iw-add-puncturing-support.patch \
+ file://0003-util-clarify-comment-about-parsed-pointer.patch \
+ file://0004-iw-remove-sizer-section-and-related-code.patch \
+ file://0005-Revert-iw-allow-specifying-CFLAGS-LIBS-externally.patch \
+ file://0006-survey-bss-rx-time.patch \
+ file://0007-iw-support-link-id-in-set-bitrates-command.patch \
+ file://0008-iw-add-per-link-txpower-config.patch \
+ file://0009-mtk-wifi-iw-dump-links-information-in-station-dump.patch \
+ file://0010-iw-add-per-radio-antenna-config.patch \
"
diff --git a/recipes-wifi/iw/patches/010-Revert-iw-allow-specifying-CFLAGS-LIBS-externally.patch b/recipes-wifi/iw/patches/010-Revert-iw-allow-specifying-CFLAGS-LIBS-externally.patch
index 1254efa..1c93f00 100644
--- a/recipes-wifi/iw/patches/010-Revert-iw-allow-specifying-CFLAGS-LIBS-externally.patch
+++ b/recipes-wifi/iw/patches/010-Revert-iw-allow-specifying-CFLAGS-LIBS-externally.patch
@@ -16,7 +16,7 @@
--- a/Makefile
+++ b/Makefile
-@@ -45,30 +45,30 @@ NLLIBNAME = libnl-1
+@@ -46,30 +46,30 @@ NLLIBNAME = libnl-1
endif
ifeq ($(NL2FOUND),Y)
@@ -55,7 +55,7 @@
NLLIBNAME = libnl-3.1
endif
-@@ -76,8 +76,8 @@ ifeq ($(NLLIBNAME),)
+@@ -77,8 +77,8 @@ ifeq ($(NLLIBNAME),)
$(error Cannot find development files for any supported version of libnl)
endif
diff --git a/recipes-wifi/iw/patches/1000-Add-support-for-5G-U-NII-3-6G-BW320.patch b/recipes-wifi/iw/patches/1000-Add-support-for-5G-U-NII-3-6G-BW320.patch
index a69e063..e71ca9b 100644
--- a/recipes-wifi/iw/patches/1000-Add-support-for-5G-U-NII-3-6G-BW320.patch
+++ b/recipes-wifi/iw/patches/1000-Add-support-for-5G-U-NII-3-6G-BW320.patch
@@ -1,4 +1,4 @@
-From ed0fd20be0b27d0f3f95819228c87c771a8c3c43 Mon Sep 17 00:00:00 2001
+From 5201393755c54df7469a36d771f6eefdbf230fd1 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Thu, 2 Mar 2023 10:07:05 +0800
Subject: [PATCH] Add support for 5G U-NII-3 & 6G BW320
@@ -6,42 +6,34 @@
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
phy.c | 4 ++--
- util.c | 11 ++++++-----
- 2 files changed, 8 insertions(+), 7 deletions(-)
+ util.c | 10 +++++-----
+ 2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/phy.c b/phy.c
-index 2d489ef..4fa66b7 100644
+index 4722125..abe94db 100644
--- a/phy.c
+++ b/phy.c
@@ -200,13 +200,13 @@ static int handle_freq(struct nl80211_state *state, struct nl_msg *msg,
COMMAND(set, freq,
- "<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz]\n"
+ "<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]\n"
- "<control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]",
+ "<control freq> [5|10|20|40|80|80+80|160|320] [<center1_freq> [<center2_freq>]]",
NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_freq,
"Set frequency/channel the hardware is using, including HT\n"
"configuration.");
COMMAND(set, freq,
- "<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz]\n"
+ "<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]\n"
- "<control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]",
+ "<control freq> [5|10|20|40|80|80+80|160|320] [<center1_freq> [<center2_freq>]]",
NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_freq, NULL);
- static int handle_chan(struct nl80211_state *state, struct nl_msg *msg,
+ static int handle_freq_khz(struct nl80211_state *state, struct nl_msg *msg,
diff --git a/util.c b/util.c
-index 8a2ba10..7126ce8 100644
+index d36dbdc..818dc96 100644
--- a/util.c
+++ b/util.c
-@@ -471,6 +471,7 @@ enum nl80211_chan_width str_to_bw(const char *str)
- { .name = "80", .val = NL80211_CHAN_WIDTH_80, },
- { .name = "80+80", .val = NL80211_CHAN_WIDTH_80P80, },
- { .name = "160", .val = NL80211_CHAN_WIDTH_160, },
-+ { .name = "320", .val = NL80211_CHAN_WIDTH_320, },
- };
- unsigned int i;
-
-@@ -1690,11 +1691,11 @@ int get_cf1(const struct chanmode *chanmode, unsigned long freq)
+@@ -1750,11 +1750,11 @@ int get_cf1(const struct chanmode *chanmode, unsigned long freq)
{
unsigned int cf1 = freq, j;
unsigned int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745,
@@ -55,9 +47,9 @@
+ 6835, 6915, 6995 };
+ unsigned int bw160[] = { 5180, 5500, 5745, 5955, 6115, 6275,
+ 6435, 6595, 6755, 6915 };
+ /* based on 11be D2 E.1 Country information and operating classes */
+ unsigned int bw320[] = {5955, 6115, 6275, 6435, 6595, 6755};
- switch (chanmode->width) {
- case NL80211_CHAN_WIDTH_80:
--
2.18.0