git: 9a9bb0d0fbf4 - stable/13 - LinuxKPI: 802.11: update compat code for updated drivers

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Wed, 29 Nov 2023 16:38:06 UTC
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=9a9bb0d0fbf461282dfca6a8e11cbeabde791a28

commit 9a9bb0d0fbf461282dfca6a8e11cbeabde791a28
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-05-16 22:07:53 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-11-29 16:36:05 +0000

    LinuxKPI: 802.11: update compat code for updated drivers
    
    Adjust and add structs, fields, functions to make more modern versions
    of LinuxKPI based wireless drivers (based on wireless-testing (
    wt-2023-06-09, wt-2023-07-24, and later)) compile.
    
    Some of these changes can only be applied once all drivers get
    updated to not break the old versions currently in the tree.
    Mark those changes with __FOR_LATER_DRV_UPDATE for now and flip the
    switch at a later point.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit adff403fe7a870c5b7a2d7e003d445c3b409bc0c)
---
 .../linuxkpi/common/include/linux/ieee80211.h      |  60 ++++-
 sys/compat/linuxkpi/common/include/linux/nl80211.h |  38 ++-
 sys/compat/linuxkpi/common/include/net/cfg80211.h  | 161 +++++++++++-
 sys/compat/linuxkpi/common/include/net/mac80211.h  | 280 +++++++++++++++++++--
 sys/compat/linuxkpi/common/src/linux_80211.c       |  15 +-
 sys/compat/linuxkpi/dummy/include/net/gso.h        |   0
 6 files changed, 509 insertions(+), 45 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h
index 4e37ee612921..4648a12ec889 100644
--- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h
+++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2020-2021 The FreeBSD Foundation
+ * Copyright (c) 2020-2023 The FreeBSD Foundation
  *
  * This software was developed by Björn Zeeb under sponsorship from
  * the FreeBSD Foundation.
@@ -60,9 +60,10 @@ struct ieee80211_mmie_16 {
 
 #define	IEEE80211_INVAL_HW_QUEUE		((uint8_t)-1)
 
-#define	IEEE80211_MAX_AMPDU_BUF_HT		0x40
 #define	IEEE80211_MAX_AMPDU_BUF			256	/* for HE? */
+#define	IEEE80211_MAX_AMPDU_BUF_HT		64
 #define	IEEE80211_MAX_AMPDU_BUF_HE		256
+#define	IEEE80211_MAX_AMPDU_BUF_EHT		1024
 
 #define	IEEE80211_MAX_FRAME_LEN			2352
 #define	IEEE80211_MAX_DATA_LEN			(2300 + IEEE80211_CRC_LEN)
@@ -140,8 +141,8 @@ enum ieee80211_min_mpdu_start_spacing {
 	IEEE80211_HT_MPDU_DENSITY_NONE		= 0,
 #if 0
 	IEEE80211_HT_MPDU_DENSITY_XXX		= 1,	/* 1/4 us */
-	IEEE80211_HT_MPDU_DENSITY_YYY		= 2,	/* 1/2 us */
 #endif
+	IEEE80211_HT_MPDU_DENSITY_0_5		= 2,	/* 1/2 us */
 	IEEE80211_HT_MPDU_DENSITY_1		= 3,	/* 1 us */
 	IEEE80211_HT_MPDU_DENSITY_2		= 4,	/* 2 us */
 	IEEE80211_HT_MPDU_DENSITY_4		= 5,	/* 4us */
@@ -159,6 +160,7 @@ enum ieee80211_min_mpdu_start_spacing {
 #define	IEEE80211_FCTL_FROMDS			(IEEE80211_FC1_DIR_FROMDS << 8)
 #define	IEEE80211_FCTL_TODS			(IEEE80211_FC1_DIR_TODS << 8)
 #define	IEEE80211_FCTL_MOREFRAGS		(IEEE80211_FC1_MORE_FRAG << 8)
+#define	IEEE80211_FCTL_PM			(IEEE80211_FC1_PWR_MGT << 8)
 
 #define	IEEE80211_FTYPE_MGMT			IEEE80211_FC0_TYPE_MGT
 #define	IEEE80211_FTYPE_CTL			IEEE80211_FC0_TYPE_CTL
@@ -170,8 +172,12 @@ enum ieee80211_min_mpdu_start_spacing {
 #define	IEEE80211_STYPE_DISASSOC		IEEE80211_FC0_SUBTYPE_DISASSOC
 #define	IEEE80211_STYPE_AUTH			IEEE80211_FC0_SUBTYPE_AUTH
 #define	IEEE80211_STYPE_DEAUTH			IEEE80211_FC0_SUBTYPE_DEAUTH
+#define	IEEE80211_STYPE_CTS			IEEE80211_FC0_SUBTYPE_CTS
+#define	IEEE80211_STYPE_RTS			IEEE80211_FC0_SUBTYPE_RTS
 #define	IEEE80211_STYPE_ACTION			IEEE80211_FC0_SUBTYPE_ACTION
 #define	IEEE80211_STYPE_QOS_DATA		IEEE80211_FC0_SUBTYPE_QOS_DATA
+#define	IEEE80211_STYPE_QOS_NULLFUNC		IEEE80211_FC0_SUBTYPE_QOS_NULL
+#define	IEEE80211_STYPE_QOS_CFACK		0xd0	/* XXX-BZ reserved? */
 
 #define	IEEE80211_NUM_ACS			4	/* net8021::WME_NUM_AC */
 
@@ -211,15 +217,19 @@ enum ieee80211_tdls_action_code {
 	/* 11-255 reserved */
 };
 
-/* 9.4.2.27, Table 9-135. Extended Capabilities field. */
+/* 802.11-2020 9.4.2.26, Table 9-153. Extended Capabilities field. */
 /* This is split up into octets CAPA1 = octet 1, ... */
 #define	WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING			BIT(2  % 8)
 #define	WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT			BIT(22 % 8)
+#define	WLAN_EXT_CAPA3_TIMING_MEASUREMENT_SUPPORT		BIT(23 % 8)
 #define	WLAN_EXT_CAPA8_OPMODE_NOTIF				BIT(62 % 8)
+#define	WLAN_EXT_CAPA8_MAX_MSDU_IN_AMSDU_LSB			BIT(63 % 8)
+#define	WLAN_EXT_CAPA9_MAX_MSDU_IN_AMSDU_MSB			BIT(64 % 8)
+#define	WLAN_EXT_CAPA10_TWT_REQUESTER_SUPPORT			BIT(77 % 8)
+#define	WLAN_EXT_CAPA10_TWT_RESPONDER_SUPPORT			BIT(78 % 8)
+#define	WLAN_EXT_CAPA10_OBSS_NARROW_BW_RU_TOLERANCE_SUPPORT	BIT(79 % 8)
 
-#define	WLAN_EXT_CAPA10_TWT_REQUESTER_SUPPORT			BIT(5)		/* XXX */
-#define	WLAN_EXT_CAPA10_OBSS_NARROW_BW_RU_TOLERANCE_SUPPORT	BIT(7)		/* XXX */
-#define	WLAN_EXT_CAPA10_TWT_RESPONDER_SUPPORT			BIT(6)		/* XXX */
+#define	WLAN_EXT_CAPA11_EMA_SUPPORT				0x00	/* XXX TODO FIXME */
 
 
 /* iwlwifi/mvm/utils:: for (ac = IEEE80211_AC_VO; ac <= IEEE80211_AC_VI; ac++) */
@@ -262,6 +272,8 @@ enum ieee80211_ac_numbers {
 #define	IEEE80211_HT_MCS_RX_HIGHEST_MASK	0x3ff
 #define	IEEE80211_HT_MCS_MASK_LEN		10
 
+#define	IEEE80211_MLD_MAX_NUM_LINKS		15
+
 struct ieee80211_mcs_info {
 	uint8_t		rx_mask[IEEE80211_HT_MCS_MASK_LEN];
 	uint16_t	rx_highest;
@@ -384,12 +396,20 @@ enum ieee80211_tx_info_flags {
 	IEEE80211_TX_CTL_HW_80211_ENCAP		= BIT(16),
 	IEEE80211_TX_CTL_USE_MINRATE		= BIT(17),
 	IEEE80211_TX_CTL_RATE_CTRL_PROBE	= BIT(18),
+	IEEE80211_TX_CTL_LDPC			= BIT(19),
+	IEEE80211_TX_CTL_STBC			= BIT(20),
+};
+
+enum ieee80211_tx_status_flags {
+	IEEE80211_TX_STATUS_ACK_SIGNAL_VALID	= BIT(0),
 };
 
 enum ieee80211_tx_control_flags {
 	/* XXX TODO .. right shift numbers */
 	IEEE80211_TX_CTRL_PORT_CTRL_PROTO	= BIT(0),
 	IEEE80211_TX_CTRL_PS_RESPONSE		= BIT(1),
+	IEEE80211_TX_CTRL_RATE_INJECT		= BIT(2),
+	IEEE80211_TX_CTRL_MLO_LINK		= 0xF0000000,	/* This is IEEE80211_LINK_UNSPECIFIED on the high bits. */
 };
 
 enum ieee80211_tx_rate_flags {
@@ -404,6 +424,8 @@ enum ieee80211_tx_rate_flags {
 	IEEE80211_TX_RC_USE_SHORT_PREAMBLE	= BIT(7),
 };
 
+#define	IEEE80211_RNR_TBTT_PARAMS_PSD_RESERVED	-128
+
 #define	IEEE80211_HT_CTL_LEN	4
 
 struct ieee80211_hdr {		/* net80211::ieee80211_frame_addr4 */
@@ -511,11 +533,28 @@ struct ieee80211_mgmt {
 					/* Optional follows... */
 					uint8_t variable[0];
 				} addba_req;
+				/* XXX */
+				struct {
+					uint8_t dialog_token;
+				} wnm_timing_msr;
 			} u;
 		} action;
 	} u;
 };
 
+struct ieee80211_cts {		/* net80211::ieee80211_frame_cts */
+        __le16		frame_control;
+        __le16		duration;
+	uint8_t		ra[ETH_ALEN];
+} __packed;
+
+struct ieee80211_rts {		/* net80211::ieee80211_frame_rts */
+        __le16		frame_control;
+        __le16		duration;
+	uint8_t		ra[ETH_ALEN];
+	uint8_t		ta[ETH_ALEN];
+} __packed;
+
 #define	MHZ_TO_KHZ(_f)		((_f) * 1000)
 #define	DBI_TO_MBI(_g)		((_g) * 100)
 #define	MBI_TO_DBI(_x)		((_x) / 100)
@@ -546,6 +585,7 @@ enum ieee80211_eid {
 	WLAN_EID_HT_CAPABILITY			= 45,	/* IEEE80211_ELEMID_HTCAP */
 	WLAN_EID_RSN				= 48,	/* IEEE80211_ELEMID_RSN */
 	WLAN_EID_EXT_SUPP_RATES			= 50,
+	WLAN_EID_EXT_NON_INHERITANCE		= 56,
 	WLAN_EID_EXT_CHANSWITCH_ANN		= 60,
 	WLAN_EID_MULTIPLE_BSSID			= 71,	/* IEEE80211_ELEMID_MULTIBSSID */
 	WLAN_EID_MULTI_BSSID_IDX		= 85,
@@ -650,6 +690,12 @@ struct ieee80211_bssid_index {
 	int	bssid_index;
 };
 
+enum ieee80211_reg_ap_power {
+	IEEE80211_REG_LPI_AP,
+	IEEE80211_REG_SP_AP,
+	IEEE80211_REG_VLP_AP,
+};
+
 /* net80211: IEEE80211_IS_CTL() */
 static __inline bool
 ieee80211_is_ctl(__le16 fc)
diff --git a/sys/compat/linuxkpi/common/include/linux/nl80211.h b/sys/compat/linuxkpi/common/include/linux/nl80211.h
index 93b40361202d..5b43ff675e19 100644
--- a/sys/compat/linuxkpi/common/include/linux/nl80211.h
+++ b/sys/compat/linuxkpi/common/include/linux/nl80211.h
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2020-2021 The FreeBSD Foundation
+ * Copyright (c) 2020-2023 The FreeBSD Foundation
  *
  * This software was developed by Björn Zeeb under sponsorship from
  * the FreeBSD Foundation.
@@ -78,6 +78,8 @@ enum nl80211_reg_rule_flags {
 	NL80211_RRF_NO_160MHZ				= BIT(8),
 	NL80211_RRF_NO_HE				= BIT(9),
 	NL80211_RRF_NO_OFDM				= BIT(10),
+	NL80211_RRF_NO_320MHZ				= BIT(11),
+	NL80211_RRF_NO_EHT				= BIT(12),
 };
 #define	NL80211_RRF_NO_HT40	(NL80211_RRF_NO_HT40MINUS|NL80211_RRF_NO_HT40PLUS)
 
@@ -143,6 +145,7 @@ enum nl80211_chan_width {
 	NL80211_CHAN_WIDTH_160,
 	NL80211_CHAN_WIDTH_5,
 	NL80211_CHAN_WIDTH_10,
+	NL80211_CHAN_WIDTH_320,
 };
 
 enum nl80211_iftype {
@@ -159,6 +162,7 @@ enum nl80211_iftype {
 	NL80211_IFTYPE_MESH_POINT,
 	NL80211_IFTYPE_WDS,
 	NL80211_IFTYPE_OCB,
+	NL80211_IFTYPE_NAN,
 
 	/* Keep this last. */
 	NUM_NL80211_IFTYPES
@@ -223,6 +227,9 @@ enum nl80211_ext_feature {
 	NL80211_EXT_FEATURE_FILS_DISCOVERY,
 	NL80211_EXT_FEATURE_RADAR_BACKGROUND,
 	NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP,
+	NL80211_EXT_FEATURE_BEACON_PROTECTION,
+	NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT,
+	NL80211_EXT_FEATURE_PUNCT,
 
 	/* Keep this last. */
 	NUM_NL80211_EXT_FEATURES
@@ -247,10 +254,13 @@ enum nl80211_sta_info {
 	NL80211_STA_INFO_TX_PACKETS,
 	NL80211_STA_INFO_TX_BYTES,
 	NL80211_STA_INFO_TX_BYTES64,
+	NL80211_STA_INFO_RX_BYTES64,
 	NL80211_STA_INFO_TX_FAILED,
 	NL80211_STA_INFO_TX_RETRIES,
 	NL80211_STA_INFO_RX_DURATION,
 	NL80211_STA_INFO_TX_DURATION,
+	NL80211_STA_INFO_ACK_SIGNAL,
+	NL80211_STA_INFO_ACK_SIGNAL_AVG,
 };
 
 enum nl80211_ftm_stats {
@@ -326,6 +336,31 @@ enum nl80211_he_ltf {
 	NL80211_RATE_INFO_HE_4XLTF,
 };
 
+enum nl80211_eht_gi {
+	NL80211_RATE_INFO_EHT_GI_0_8,
+	NL80211_RATE_INFO_EHT_GI_1_6,
+	NL80211_RATE_INFO_EHT_GI_3_2,
+};
+
+enum nl80211_eht_ru_alloc {
+	NL80211_RATE_INFO_EHT_RU_ALLOC_26,
+	NL80211_RATE_INFO_EHT_RU_ALLOC_52,
+	NL80211_RATE_INFO_EHT_RU_ALLOC_52P26,
+	NL80211_RATE_INFO_EHT_RU_ALLOC_106,
+	NL80211_RATE_INFO_EHT_RU_ALLOC_106P26,
+	NL80211_RATE_INFO_EHT_RU_ALLOC_242,
+	NL80211_RATE_INFO_EHT_RU_ALLOC_484,
+	NL80211_RATE_INFO_EHT_RU_ALLOC_484P242,
+	NL80211_RATE_INFO_EHT_RU_ALLOC_996,
+	NL80211_RATE_INFO_EHT_RU_ALLOC_996P484,
+	NL80211_RATE_INFO_EHT_RU_ALLOC_996P484P242,
+	NL80211_RATE_INFO_EHT_RU_ALLOC_2x996,
+	NL80211_RATE_INFO_EHT_RU_ALLOC_2x996P484,
+	NL80211_RATE_INFO_EHT_RU_ALLOC_3x996,
+	NL80211_RATE_INFO_EHT_RU_ALLOC_3x996P484,
+	NL80211_RATE_INFO_EHT_RU_ALLOC_4x996,
+};
+
 enum nl80211_dfs_regions {
 	NL80211_DFS_UNSET,
 	NL80211_DFS_FCC,
@@ -352,6 +387,7 @@ enum nl80211_tid_cfg_attr {
 	NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL,
 	NL80211_TID_CONFIG_ATTR_RETRY_LONG,
 	NL80211_TID_CONFIG_ATTR_AMPDU_CTRL,
+	NL80211_TID_CONFIG_ATTR_AMSDU_CTRL,
 };
 
 enum nl80211_tid_config {
diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h
index 43d4cd662c97..56ca9a231d2d 100644
--- a/sys/compat/linuxkpi/common/include/net/cfg80211.h
+++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h
@@ -70,10 +70,11 @@ enum rfkill_hard_block_reasons {
 #define	IEEE80211_MAX_CHAINS	4		/* net80211: IEEE80211_MAX_CHAINS copied */
 
 enum cfg80211_rate_info_flags {
-	RATE_INFO_FLAGS_SHORT_GI	= BIT(0),
-	RATE_INFO_FLAGS_MCS		= BIT(1),
-	RATE_INFO_FLAGS_VHT_MCS		= BIT(2),
-	RATE_INFO_FLAGS_HE_MCS		= BIT(3),
+	RATE_INFO_FLAGS_MCS		= BIT(0),
+	RATE_INFO_FLAGS_VHT_MCS		= BIT(1),
+	RATE_INFO_FLAGS_SHORT_GI	= BIT(2),
+	RATE_INFO_FLAGS_HE_MCS		= BIT(4),
+	RATE_INFO_FLAGS_EHT_MCS		= BIT(7),
 	/* Max 8 bits as used in struct rate_info. */
 };
 
@@ -149,6 +150,8 @@ enum rate_info_bw {
 	RATE_INFO_BW_80,
 	RATE_INFO_BW_160,
 	RATE_INFO_BW_HE_RU,
+	RATE_INFO_BW_320,
+	RATE_INFO_BW_EHT_RU,
 };
 
 struct rate_info {
@@ -160,6 +163,7 @@ struct rate_info {
 	uint8_t					he_dcm;
 	uint8_t					he_gi;
 	uint8_t					he_ru_alloc;
+	uint8_t					eht_gi;
 };
 
 struct ieee80211_rate {
@@ -224,6 +228,7 @@ struct ieee80211_sta_ht_cap {
 #define	IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK	\
 	(7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT)	/* IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK */
 
+#define	IEEE80211_VHT_CAP_EXT_NSS_BW_MASK	0xc0000000
 
 struct ieee80211_sta_vht_cap {
 		/* TODO FIXME */
@@ -362,7 +367,7 @@ struct cfg80211_ssid {
 struct cfg80211_scan_6ghz_params {
 	/* XXX TODO */
 	uint8_t				*bssid;
-	int	channel_idx, psc_no_listen, short_ssid, short_ssid_valid, unsolicited_probe;
+	int	channel_idx, psc_no_listen, short_ssid, short_ssid_valid, unsolicited_probe, psd_20;
 };
 
 struct cfg80211_match_set {
@@ -529,6 +534,7 @@ struct station_info {
 	int	generation, inactive_time, rx_bytes, rx_dropped_misc, rx_packets, signal, tx_bytes, tx_packets;
 	int     filled, rx_beacon, rx_beacon_signal_avg, signal_avg;
 	int	rx_duration, tx_duration, tx_failed, tx_retries;
+	int	ack_signal, avg_ack_signal;
 
 	int					chains;
 	uint8_t					chain_signal[IEEE80211_MAX_CHAINS];
@@ -656,6 +662,7 @@ struct linuxkpi_ieee80211_regdomain {
 #define	IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_RU_MAPPING_IN_2G	0x10
 #define	IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_RU_MAPPING_IN_5G	0x20
 #define	IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_MASK			0x40
+#define	IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_MASK_ALL		0xff
 
 #define	IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A		0x1
 #define	IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD	0x2
@@ -753,12 +760,95 @@ struct linuxkpi_ieee80211_regdomain {
 
 #define	IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED		0x1
 #define	IEEE80211_HE_OPERATION_BSS_COLOR_OFFSET			0x2
+#define	IEEE80211_HE_OPERATION_ER_SU_DISABLE			0x4
 
 #define	IEEE80211_HE_SPR_HESIGA_SR_VAL15_ALLOWED		0x01
 #define	IEEE80211_HE_SPR_NON_SRG_OBSS_PD_SR_DISALLOWED		0x02
 #define	IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT			0x04
 #define	IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT		0x08
 
+#define	IEEE80211_EHT_MAC_CAP0_EPCS_PRIO_ACCESS			0x01
+#define	IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_11454		0x02
+#define	IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_MASK		0x03
+#define	IEEE80211_EHT_MAC_CAP0_OM_CONTROL			0x04
+#define	IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE1		0x05
+#define	IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE2		0x06
+#define	IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_7991		0x07
+
+#define	IEEE80211_EHT_MAC_CAP1_MAX_AMPDU_LEN_MASK		0x01
+
+#define	IEEE80211_EHT_MCS_NSS_RX				0x01
+#define	IEEE80211_EHT_MCS_NSS_TX				0x02
+
+#define	IEEE80211_EHT_PHY_CAP0_242_TONE_RU_GT20MHZ		0x01
+#define	IEEE80211_EHT_PHY_CAP0_320MHZ_IN_6GHZ			0x02
+#define	IEEE80211_EHT_PHY_CAP0_BEAMFORMEE_SS_80MHZ_MASK		0x03
+#define	IEEE80211_EHT_PHY_CAP0_NDP_4_EHT_LFT_32_GI		0x04
+#define	IEEE80211_EHT_PHY_CAP0_PARTIAL_BW_UL_MU_MIMO		0x05
+#define	IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMEE			0x06
+#define	IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMER			0x07
+
+#define	IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_160MHZ_MASK	0x01
+#define	IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_320MHZ_MASK	0x02
+#define	IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_80MHZ_MASK		0x03
+
+#define	IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_80MHZ_MASK		0x01
+#define	IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_160MHZ_MASK		0x02
+#define	IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_320MHZ_MASK		0x03
+
+#define	IEEE80211_EHT_PHY_CAP3_CODEBOOK_4_2_SU_FDBK		0x01
+#define	IEEE80211_EHT_PHY_CAP3_CODEBOOK_7_5_MU_FDBK		0x02
+#define	IEEE80211_EHT_PHY_CAP3_NG_16_MU_FEEDBACK		0x03
+#define	IEEE80211_EHT_PHY_CAP3_NG_16_SU_FEEDBACK		0x04
+#define	IEEE80211_EHT_PHY_CAP3_TRIG_CQI_FDBK			0x05
+#define	IEEE80211_EHT_PHY_CAP3_TRIG_MU_BF_PART_BW_FDBK		0x06
+#define	IEEE80211_EHT_PHY_CAP3_TRIG_SU_BF_FDBK			0x07
+#define	IEEE80211_EHT_PHY_CAP3_SOUNDING_DIM_320MHZ_MASK		0x08
+
+#define	IEEE80211_EHT_PHY_CAP4_EHT_MU_PPDU_4_EHT_LTF_08_GI	0x01
+#define	IEEE80211_EHT_PHY_CAP4_PART_BW_DL_MU_MIMO		0x02
+#define	IEEE80211_EHT_PHY_CAP4_POWER_BOOST_FACT_SUPP		0x03
+#define	IEEE80211_EHT_PHY_CAP4_MAX_NC_MASK			0x04
+
+#define	IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_0US	0x01
+#define	IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_16US	0x02
+#define	IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_20US	0x03
+#define	IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_8US	0x04
+#define	IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_MASK	0x05
+#define	IEEE80211_EHT_PHY_CAP5_NON_TRIG_CQI_FEEDBACK		0x06
+#define	IEEE80211_EHT_PHY_CAP5_PPE_THRESHOLD_PRESENT		0x07
+#define	IEEE80211_EHT_PHY_CAP5_RX_LESS_242_TONE_RU_SUPP		0x08
+#define	IEEE80211_EHT_PHY_CAP5_TX_LESS_242_TONE_RU_SUPP		0x09
+#define	IEEE80211_EHT_PHY_CAP5_MAX_NUM_SUPP_EHT_LTF_MASK	0x0a
+#define	IEEE80211_EHT_PHY_CAP5_SUPP_EXTRA_EHT_LTF		0x0b
+
+#define	IEEE80211_EHT_PHY_CAP6_EHT_DUP_6GHZ_SUPP		0x01
+#define	IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_MASK			0x02
+#define	IEEE80211_EHT_PHY_CAP6_MAX_NUM_SUPP_EHT_LTF_MASK	0x03
+
+#define	IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_80MHZ		0x01
+#define	IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_160MHZ		0x02
+#define	IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_320MHZ		0x03
+#define	IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_80MHZ	0x04
+#define	IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_160MHZ	0x05
+#define	IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_320MHZ	0x06
+
+#define	IEEE80211_EHT_PHY_CAP8_RX_1024QAM_WIDER_BW_DL_OFDMA	0x01
+#define	IEEE80211_EHT_PHY_CAP8_RX_4096QAM_WIDER_BW_DL_OFDMA	0x02
+
+#define	IEEE80211_EHT_PPE_THRES_INFO_HEADER_SIZE		0x01
+#define	IEEE80211_EHT_PPE_THRES_NSS_MASK			0x02
+#define	IEEE80211_EHT_PPE_THRES_RU_INDEX_BITMASK_MASK		0x03
+#define	IEEE80211_EHT_PPE_THRES_INFO_PPET_SIZE			0x04
+
+#define	IEEE80211_EML_CAP_EMLSR_SUPP				0x01
+#define	IEEE80211_EML_CAP_TRANSITION_TIMEOUT			0x02
+#define	IEEE80211_EML_CAP_TRANSITION_TIMEOUT_128TU		0x04
+#define	IEEE80211_EML_CAP_EMLSR_PADDING_DELAY			0x08
+#define	IEEE80211_EML_CAP_EMLSR_PADDING_DELAY_32US		0x10
+#define	IEEE80211_EML_CAP_EMLSR_TRANSITION_DELAY		0x20
+#define	IEEE80211_EML_CAP_EMLSR_TRANSITION_DELAY_64US		0x40
+
 #define	VENDOR_CMD_RAW_DATA	(void *)(uintptr_t)(-ENOENT)
 
 struct ieee80211_he_cap_elem {
@@ -804,11 +894,51 @@ struct ieee80211_sta_he_6ghz_capa {
 	int	capa;
 };
 
+struct ieee80211_eht_mcs_nss_supp_20mhz_only {
+	uint8_t					rx_tx_mcs7_max_nss;
+	uint8_t					rx_tx_mcs9_max_nss;
+	uint8_t					rx_tx_mcs11_max_nss;
+	uint8_t					rx_tx_mcs13_max_nss;
+};
+
+struct ieee80211_eht_mcs_nss_supp_bw {
+	uint8_t					rx_tx_mcs9_max_nss;
+	uint8_t					rx_tx_mcs11_max_nss;
+	uint8_t					rx_tx_mcs13_max_nss;
+};
+
+struct ieee80211_eht_cap_elem_fixed {
+	uint8_t					mac_cap_info[2];
+	uint8_t					phy_cap_info[9];
+};
+
+struct ieee80211_eht_mcs_nss_supp {
+	/* TODO FIXME */
+	/* Can only have either or... */
+	union {
+		struct ieee80211_eht_mcs_nss_supp_20mhz_only		only_20mhz;
+		struct {
+			struct ieee80211_eht_mcs_nss_supp_bw		_80;
+			struct ieee80211_eht_mcs_nss_supp_bw		_160;
+			struct ieee80211_eht_mcs_nss_supp_bw		_320;
+		} bw;
+	};
+};
+
+#define	IEEE80211_STA_EHT_PPE_THRES_MAX		32
+struct ieee80211_sta_eht_cap {
+	bool					has_eht;
+	struct ieee80211_eht_cap_elem_fixed	eht_cap_elem;
+	struct ieee80211_eht_mcs_nss_supp	eht_mcs_nss_supp;
+	uint8_t					eht_ppe_thres[IEEE80211_STA_EHT_PPE_THRES_MAX];
+};
+
 struct ieee80211_sband_iftype_data {
 	/* TODO FIXME */
 	enum nl80211_iftype			types_mask;
 	struct ieee80211_sta_he_cap		he_cap;
 	struct ieee80211_sta_he_6ghz_capa	he_6ghz_capa;
+	struct ieee80211_sta_eht_cap		eht_cap;
 	struct {
 		const uint8_t			*data;
 		size_t				len;
@@ -900,7 +1030,7 @@ struct cfg80211_gtk_rekey_data {
 
 struct cfg80211_tid_cfg {
 	/* XXX TODO */
-	int	mask, noack, retry_long, rtscts, tids;
+	int	mask, noack, retry_long, rtscts, tids, amsdu, ampdu;
 	enum nl80211_tx_rate_setting		txrate_type;
 	struct cfg80211_bitrate_mask		txrate_mask;
 };
@@ -938,6 +1068,11 @@ struct regulatory_request {
 	int	user_reg_hint_type;
 };
 
+struct cfg80211_set_hw_timestamp {
+	const uint8_t				*macaddr;
+	bool					enable;
+};
+
 enum wiphy_vendor_cmd_need_flags {
 	WIPHY_VENDOR_CMD_NEED_NETDEV		= 0x01,
 	WIPHY_VENDOR_CMD_NEED_RUNNING		= 0x02,
@@ -960,6 +1095,7 @@ struct wiphy_iftype_ext_capab {
 	const uint8_t				*extended_capabilities;
 	const uint8_t				*extended_capabilities_mask;
 	uint8_t					extended_capabilities_len;
+	uint16_t				eml_capabilities;
 
 };
 
@@ -996,6 +1132,7 @@ enum wiphy_flags {
 	WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD	= BIT(13),
 	WIPHY_FLAG_4ADDR_AP			= BIT(14),
 	WIPHY_FLAG_4ADDR_STATION		= BIT(15),
+	WIPHY_FLAG_SUPPORTS_MLO			= BIT(16),
 };
 
 struct wiphy {
@@ -1037,6 +1174,8 @@ struct wiphy {
 	int	max_data_retry_count;
 	int     tx_queue_len, rfkill;
 	int	mbssid_max_interfaces;
+	int	hw_timestamp_max_peers;
+	int	ema_max_profile_periodicity;
 
 	unsigned long				ext_features[BITS_TO_LONGS(NUM_NL80211_EXT_FEATURES)];
 	struct dentry				*debugfsdir;
@@ -1816,7 +1955,7 @@ cfg80211_background_radar_event(struct wiphy *wiphy,
 }
 
 static __inline const u8 *
-cfg80211_find_ext_ie(uint8_t eid, uint8_t *p, size_t len)
+cfg80211_find_ext_ie(uint8_t eid, const uint8_t *p, size_t len)
 {
 	TODO();
 	return (NULL);
@@ -1829,6 +1968,14 @@ cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef)
 	return (false);
 }
 
+static __inline const struct ieee80211_sta_eht_cap *
+ieee80211_get_eht_iftype_cap(const struct ieee80211_supported_band *band,
+    enum nl80211_iftype iftype)
+{
+	TODO();
+	return (NULL);
+}
+
 #define	wiphy_info(wiphy, fmt, ...)					\
 	printf("%s:%d XXX TODO " fmt, __func__, __LINE__, __VA_ARGS__)
 
diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h
index 5597300e18c9..cacf9d652fd0 100644
--- a/sys/compat/linuxkpi/common/include/net/mac80211.h
+++ b/sys/compat/linuxkpi/common/include/net/mac80211.h
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2020-2022 The FreeBSD Foundation
+ * Copyright (c) 2020-2023 The FreeBSD Foundation
  * Copyright (c) 2020-2022 Bjoern A. Zeeb
  *
  * This software was developed by Björn Zeeb under sponsorship from
@@ -50,6 +50,8 @@
 #define	WLAN_OUI_TYPE_WFA_P2P			(9)
 #define	WLAN_OUI_WFA				(0x506F9A)
 
+#define	IEEE80211_LINK_UNSPECIFIED		0x0f
+
 /* hw->conf.flags */
 enum ieee80211_hw_conf_flags {
 	IEEE80211_CONF_IDLE			= BIT(0),
@@ -114,6 +116,7 @@ enum ieee80211_bss_changed {
 	BSS_CHANGED_HE_OBSS_PD		= BIT(27),
 	BSS_CHANGED_TWT			= BIT(28),
 	BSS_CHANGED_UNSOL_BCAST_PROBE_RESP = BIT(30),
+	BSS_CHANGED_EHT_PUNCTURING	= BIT(31),
 };
 
 /* 802.11 Figure 9-256 Suite selector format. [OUI(3), SUITE TYPE(1)] */
@@ -224,6 +227,15 @@ struct ieee80211_chanctx_conf {
 
 struct ieee80211_rate_status {
 	struct rate_info			rate_idx;
+	uint8_t					try_count;
+};
+
+struct ieee80211_ema_beacons {
+	uint8_t					cnt;
+	struct {
+		struct sk_buff			*skb;
+		struct ieee80211_mutable_offsets offs;
+	} bcn[0];
 };
 
 #define	WLAN_MEMBERSHIP_LEN			(8)
@@ -231,7 +243,11 @@ struct ieee80211_rate_status {
 
 struct ieee80211_bss_conf {
 	/* TODO FIXME */
+	struct ieee80211_vif			*vif;
 	const uint8_t				*bssid;
+	uint8_t					addr[ETH_ALEN];
+	uint8_t					link_id;
+	uint8_t					_pad0;
 	uint8_t					transmitter_bssid[ETH_ALEN];
 	struct ieee80211_ftm_responder_params	*ftmr_params;
 	struct ieee80211_p2p_noa_attr		p2p_noa_attr;
@@ -248,11 +264,28 @@ struct ieee80211_bss_conf {
 	} he_oper;
 	struct cfg80211_he_bss_color		he_bss_color;
 	struct ieee80211_he_obss_pd		he_obss_pd;
+
+	bool					ht_ldpc;
+	bool					vht_ldpc;
+	bool					he_ldpc;
+	bool					vht_mu_beamformee;
+	bool					vht_mu_beamformer;
+	bool					vht_su_beamformee;
+	bool					vht_su_beamformer;
+	bool					he_mu_beamformer;
+	bool					he_su_beamformee;
+	bool					he_su_beamformer;
+	bool					he_full_ul_mumimo;
+	bool					eht_su_beamformee;
+	bool					eht_su_beamformer;
+	bool					eht_mu_beamformer;
+
 	size_t					ssid_len;
 	uint8_t					ssid[IEEE80211_NWID_LEN];
 	uint16_t				aid;
 	uint16_t				ht_operation_mode;
 	int					arp_addr_cnt;
+	uint16_t				eht_puncturing;
 
 	uint8_t					dtim_period;
 	uint8_t					sync_dtim_count;
@@ -265,16 +298,20 @@ struct ieee80211_bss_conf {
 	bool					use_short_preamble;
 	bool					use_short_slot;
 	bool					he_support;
+	bool					eht_support;
 	bool					csa_active;
+	bool					mu_mimo_owner;
 	uint32_t				sync_device_ts;
 	uint64_t				sync_tsf;
 	uint16_t				beacon_int;
 	int16_t					txpower;
 	uint32_t				basic_rates;
 	int					mcast_rate[NUM_NL80211_BANDS];
+	enum ieee80211_reg_ap_power 		power_type;
 	struct cfg80211_bitrate_mask		beacon_tx_rate;
 	struct mac80211_fils_discovery		fils_discovery;
 	struct ieee80211_chanctx_conf		*chanctx_conf;
+	struct ieee80211_vif			*mbssid_tx_vif;
 
 	int		ack_enabled, bssid_index, bssid_indicator, cqm_rssi_hyst, cqm_rssi_thold, ema_ap, frame_time_rts_th, ftm_responder;
 	int		htc_trig_based_pkt_ext;
@@ -410,6 +447,7 @@ enum ieee80211_hw_flags {
 	IEEE80211_HW_SUPPORTS_RX_DECAP_OFFLOAD,
 	IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD,
 	IEEE80211_HW_SUPPORTS_RC_TABLE,
+	IEEE80211_HW_DETECTS_COLOR_COLLISION,
 
 	/* Keep last. */
 	NUM_IEEE80211_HW_FLAGS
@@ -477,6 +515,7 @@ struct ieee80211_key_conf {
 	uint16_t			flags;
 	uint8_t				keylen;
 	uint8_t				key[0];
+	int8_t				link_id;	/* signed! */
 };
 
 struct ieee80211_key_seq {
@@ -529,31 +568,47 @@ enum ieee80211_rx_status_flags {
 	RX_FLAG_ONLY_MONITOR		= BIT(25),
 	RX_FLAG_SKIP_MONITOR		= BIT(26),
 	RX_FLAG_8023			= BIT(27),
+	RX_FLAG_RADIOTAP_TLV_AT_END	= BIT(28),
 };
 
 enum mac80211_rx_encoding {
 	RX_ENC_LEGACY		= 0,
 	RX_ENC_HT,
 	RX_ENC_VHT,
-	RX_ENC_HE
+	RX_ENC_HE,
+	RX_ENC_EHT,
 };
 
 struct ieee80211_rx_status {
 	/* TODO FIXME, this is too large. Over-reduce types to u8 where possible. */
-	uint64_t			boottime_ns;
+	union {
+		uint64_t			boottime_ns;
+		int64_t				ack_tx_hwtstamp;
+	};
 	uint64_t			mactime;
 	uint32_t			device_timestamp;
 	enum ieee80211_rx_status_flags	flag;
 	uint16_t			freq;
-	uint8_t				encoding:2, bw:3, he_ru:3;	/* enum mac80211_rx_encoding, rate_info_bw */	/* See mt76.h */
+	uint8_t				encoding:3, bw:4;	/* enum mac80211_rx_encoding, rate_info_bw */	/* See mt76.h */
 	uint8_t				ampdu_reference;
 	uint8_t				band;
 	uint8_t				chains;
 	int8_t				chain_signal[IEEE80211_MAX_CHAINS];
 	int8_t				signal;
 	uint8_t				enc_flags;
-	uint8_t				he_dcm;
-	uint8_t				he_gi;
+	union {
+		struct {
+			uint8_t		he_ru:3;	/* nl80211::enum nl80211_he_ru_alloc */
+			uint8_t		he_gi:2;	/* nl80211::enum nl80211_he_gi */
+			uint8_t		he_dcm:1;
+		};
+		struct {
+			uint8_t		ru:4;		/* nl80211::enum nl80211_eht_ru_alloc */
+			uint8_t		gi:2;		/* nl80211::enum nl80211_eht_gi */
+		} eht;
+	};
+	bool				link_valid;
+	uint8_t				link_id;	/* very incosistent sizes? */
 	uint8_t				zero_length_psdu_type;
 	uint8_t				nss;
 	uint8_t				rate_idx;
@@ -562,6 +617,7 @@ struct ieee80211_rx_status {
 struct ieee80211_tx_status {
 	struct ieee80211_sta		*sta;
 	struct ieee80211_tx_info	*info;
+	int64_t				ack_hwtstamp;
 
 	u8				n_rates;
 	struct ieee80211_rate_status	*rates;
@@ -608,17 +664,22 @@ struct ieee80211_sta_txpwr {
 	short				power;
 };
 
+#define	IEEE80211_NUM_TIDS			16	/* net80211::WME_NUM_TID */
 struct ieee80211_sta_agg {
-	/* XXX TODO */
-	int max_amsdu_len;
+	uint16_t				max_amsdu_len;
+	uint16_t				max_rc_amsdu_len;
+	uint16_t				max_tid_amsdu_len[IEEE80211_NUM_TIDS];
 };
 
 struct ieee80211_link_sta {
+	uint8_t					addr[ETH_ALEN];
+	uint8_t					link_id;
 	uint32_t				supp_rates[NUM_NL80211_BANDS];
 	struct ieee80211_sta_ht_cap		ht_cap;
 	struct ieee80211_sta_vht_cap		vht_cap;
 	struct ieee80211_sta_he_cap		he_cap;
 	struct ieee80211_sta_he_6ghz_capa	he_6ghz_capa;
+	struct ieee80211_sta_eht_cap		eht_cap;
 	uint8_t					rx_nss;
 	enum ieee80211_sta_rx_bw		bandwidth;
 	enum ieee80211_smps_mode		smps_mode;
@@ -626,21 +687,27 @@ struct ieee80211_link_sta {
 	struct ieee80211_sta_txpwr		txpwr;
 };
 
-#define	IEEE80211_NUM_TIDS			16	/* net80211::WME_NUM_TID */
 struct ieee80211_sta {
 	/* TODO FIXME */
-	int		max_amsdu_len, max_amsdu_subframes, max_rc_amsdu_len;
+	int		max_amsdu_subframes;
 	int		mfp, smps_mode, tdls, tdls_initiator;
 	struct ieee80211_txq			*txq[IEEE80211_NUM_TIDS + 1];	/* iwlwifi: 8 and adds +1 to tid_data, net80211::IEEE80211_TID_SIZE */
 	struct ieee80211_sta_rates		*rates;	/* some rcu thing? */
-	uint32_t				max_tid_amsdu_len[IEEE80211_NUM_TIDS];
 	uint8_t					addr[ETH_ALEN];
 	uint16_t				aid;
 	bool					wme;
 	uint8_t					max_sp;
 	uint8_t					uapsd_queues;
+	uint16_t				valid_links;
 
 	struct ieee80211_link_sta		deflink;
+	struct ieee80211_link_sta		*link[IEEE80211_MLD_MAX_NUM_LINKS];	/* rcu? */
+
+#ifndef __FOR_LATER_DRV_UPDATE
+	uint16_t				max_rc_amsdu_len;
+	uint16_t				max_amsdu_len;
+	uint16_t				max_tid_amsdu_len[IEEE80211_NUM_TIDS];
+#endif
 
 	/* Must stay last. */
 	uint8_t					drv_priv[0] __aligned(CACHE_LINE_SIZE);
@@ -681,16 +748,24 @@ enum ieee80211_vif_driver_flags {
 	IEEE80211_VIF_BEACON_FILTER		= BIT(0),
 	IEEE80211_VIF_SUPPORTS_CQM_RSSI		= BIT(1),
 	IEEE80211_VIF_SUPPORTS_UAPSD		= BIT(2),
+	IEEE80211_VIF_DISABLE_SMPS_OVERRIDE	= BIT(3),
 };
 
 #define	IEEE80211_BSS_ARP_ADDR_LIST_LEN		4
 
 struct ieee80211_vif_cfg {
 	uint16_t				aid;
+	uint16_t				eml_cap;
+	uint16_t				eml_med_sync_delay;
 	bool					assoc;
 	bool					ps;
+	bool					idle;
+	bool					ibss_joined;
 	int					arp_addr_cnt;
+	size_t					ssid_len;
 	uint32_t				arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN];		/* big endian */
+	uint8_t					ssid[IEEE80211_NWID_LEN];
+	uint8_t					ap_addr[ETH_ALEN];
 };
 
 struct ieee80211_vif {
@@ -707,7 +782,11 @@ struct ieee80211_vif {
 	struct ieee80211_chanctx_conf	*chanctx_conf;
 	struct ieee80211_txq		*txq;
 	struct ieee80211_bss_conf	bss_conf;
+	struct ieee80211_bss_conf	*link_conf[IEEE80211_MLD_MAX_NUM_LINKS];	/* rcu? */
 	uint8_t				hw_queue[IEEE80211_NUM_ACS];
+	uint16_t			active_links;
+	uint16_t			valid_links;
+	struct ieee80211_vif		*mbssid_tx_vif;
 
 /* #ifdef CONFIG_MAC80211_DEBUGFS */	/* Do not change structure depending on compile-time option. */
 	struct dentry			*debugfs_dir;
@@ -720,6 +799,7 @@ struct ieee80211_vif {
 struct ieee80211_vif_chanctx_switch {
 	struct ieee80211_chanctx_conf	*old_ctx, *new_ctx;
 	struct ieee80211_vif		*vif;
+	struct ieee80211_bss_conf	*link_conf;
 };
 
 struct ieee80211_prep_tx_info {
@@ -750,7 +830,7 @@ struct ieee80211_tx_info {
 			uint8_t				ampdu_len;
 			uint8_t				antenna;
 			uint16_t			tx_time;
-			bool				is_valid_ack_signal;
+			uint8_t				flags;
 			void				*status_driver_data[16 / sizeof(void *)];		/* XXX TODO */
 		} status;
 #define	IEEE80211_TX_INFO_DRIVER_DATA_SIZE	40
@@ -792,11 +872,10 @@ enum ieee80211_iface_iter {
 	IEEE80211_IFACE_ITER_NORMAL	= BIT(0),
 	IEEE80211_IFACE_ITER_RESUME_ALL	= BIT(1),
 	IEEE80211_IFACE_SKIP_SDATA_NOT_IN_DRIVER = BIT(2),	/* seems to be an iter flag */
+	IEEE80211_IFACE_ITER_ACTIVE	= BIT(3),
 
 	/* Internal flags only. */
-	/* ieee80211_iterate_active_interfaces*(). */
 	IEEE80211_IFACE_ITER__ATOMIC	= BIT(6),
-	IEEE80211_IFACE_ITER__ACTIVE	= BIT(7),
 	IEEE80211_IFACE_ITER__MTX	= BIT(8),
 };
 
@@ -864,6 +943,7 @@ struct ieee80211_ops {
 	void (*mgd_protect_tdls_discover)(struct ieee80211_hw *, struct ieee80211_vif *);
 
 	void (*flush)(struct ieee80211_hw *, struct ieee80211_vif *, u32, bool);
+	void (*flush_sta)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *);
 
 	int  (*set_frag_threshold)(struct ieee80211_hw *, u32);
 
@@ -933,6 +1013,7 @@ struct ieee80211_ops {
 	int  (*set_key)(struct ieee80211_hw *, enum set_key_cmd, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *);
 	void (*set_default_unicast_key)(struct ieee80211_hw *, struct ieee80211_vif *, int);
 	void (*update_tkip_key)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_key_conf *, struct ieee80211_sta *, u32, u16 *);
+	void (*set_rekey_data)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_gtk_rekey_data *);
 
 	int  (*start_pmsr)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_pmsr_request *);
 	void (*abort_pmsr)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_pmsr_request *);
@@ -961,6 +1042,14 @@ struct ieee80211_ops {
 	void (*add_twt_setup)(struct ieee80211_hw *, struct ieee80211_sta *, struct ieee80211_twt_setup *);
 	void (*twt_teardown_request)(struct ieee80211_hw *, struct ieee80211_sta *, u8);
 
+	int (*set_hw_timestamp)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_set_hw_timestamp *);
+
+        void (*link_info_changed)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *, u64);
+        void (*vif_cfg_changed)(struct ieee80211_hw *, struct ieee80211_vif *, u64);
+
+	int (*change_vif_links)(struct ieee80211_hw *, struct ieee80211_vif *, u16, u16, struct ieee80211_bss_conf *[IEEE80211_MLD_MAX_NUM_LINKS]);
+	int (*change_sta_links)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, u16, u16);
+
 /* #ifdef CONFIG_MAC80211_DEBUGFS */	/* Do not change depending on compile-time option. */
 	void (*sta_add_debugfs)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct dentry *);
 /* #endif */
@@ -1017,7 +1106,7 @@ void linuxkpi_ieee80211_queue_work(struct ieee80211_hw *, struct work_struct *);
 struct sk_buff *linuxkpi_ieee80211_pspoll_get(struct ieee80211_hw *,
     struct ieee80211_vif *);
 struct sk_buff *linuxkpi_ieee80211_nullfunc_get(struct ieee80211_hw *,
-    struct ieee80211_vif *, bool);
+    struct ieee80211_vif *, int, bool);
 void linuxkpi_ieee80211_txq_get_depth(struct ieee80211_txq *, unsigned long *,
     unsigned long *);
 struct wireless_dev *linuxkpi_ieee80211_vif_to_wdev(struct ieee80211_vif *);
@@ -1140,6 +1229,37 @@ ieee80211_restart_hw(struct ieee80211_hw *hw)
 	linuxkpi_ieee80211_restart_hw(hw);
 }
 
+static inline void
+ieee80211_hw_restart_disconnect(struct ieee80211_vif *vif)
+{
+	TODO();
+}
+
+/* -------------------------------------------------------------------------- */
+
+#define	link_conf_dereference_check(_vif, _linkid)			\
+    rcu_dereference_check((_vif)->link_conf[_linkid], true)
+
+#define	link_conf_dereference_protected(_vif, _linkid)			\
+    rcu_dereference_protected((_vif)->link_conf[_linkid], true)
+
+#define	link_sta_dereference_check(_sta, _linkid)			\
+    rcu_dereference_check((_sta)->link[_linkid], true)
+
+#define	link_sta_dereference_protected(_sta, _linkid)			\
+    rcu_dereference_protected((_sta)->link[_linkid], true)
+
+#define	for_each_vif_active_link(_vif, _link, _linkid)			\
+    for (_linkid = 0; _linkid < nitems((_vif)->link_conf); _linkid++)	\
+	if ( ((_vif)->active_links == 0 /* no MLO */ ||			\
+	    ((_vif)->active_links & BIT(_linkid)) != 0) &&		\
+	    (_link = rcu_dereference((_vif)->link_conf[_linkid])) )
+
+#define	for_each_sta_active_link(_vif, _sta, _linksta, _linkid)		\
+    for (_linkid = 0; _linkid < nitems((_vif)->link_conf); _linkid++)	\
+	if ( ((_vif)->active_links == 0 /* no MLO */ ||			\
+	    ((_vif)->active_links & BIT(_linkid)) != 0) &&		\
+	    (_linksta = link_sta_dereference_protected((_sta), (_linkid))) )
 
 /* -------------------------------------------------------------------------- */
 
@@ -1301,8 +1421,18 @@ ieee80211_is_back_req(__le16 fc)
 }
 
 static __inline bool
+#ifdef __FOR_LATER_DRV_UPDATE
+ieee80211_is_bufferable_mmpdu(struct sk_buff *skb)
+{
+	struct ieee80211_mgmt *mgmt;
+	__le16 fc;
+
+	mgmt = (struct ieee80211_mgmt *)skb->data;
+	fc = mgmt->frame_control;
+#else
 ieee80211_is_bufferable_mmpdu(__le16 fc)
*** 299 LINES SKIPPED ***