git: 6ff5793af7a8 - stable/13 - LinuxKPI: 802.11 update header files

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Mon, 28 Nov 2022 17:27:00 UTC
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=6ff5793af7a864aef658fd3f42f6d186227a22e9

commit 6ff5793af7a864aef658fd3f42f6d186227a22e9
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-10-31 22:09:25 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-11-28 16:30:36 +0000

    LinuxKPI: 802.11 update header files
    
    Adjust struct members, add more (for HE dummy) defines, add more
    (wrapper) functions in order to acoomodate another driver.
    
    (cherry picked from commit 1d70218e9e1a27915a5d6ac434c226c8861f64f2)
---
 sys/compat/linuxkpi/common/include/linux/ieee80211.h |  3 +++
 sys/compat/linuxkpi/common/include/linux/nl80211.h   |  8 ++++++++
 sys/compat/linuxkpi/common/include/net/cfg80211.h    | 16 ++++++++++++----
 sys/compat/linuxkpi/common/include/net/mac80211.h    | 14 +++++++++++++-
 4 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h
index 5a29137d0510..c797967f357a 100644
--- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h
+++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h
@@ -282,6 +282,9 @@ struct ieee80211_ht_cap {
 };
 
 #define	IEEE80211_HT_MAX_AMPDU_FACTOR		13
+#define	IEEE80211_HE_HT_MAX_AMPDU_FACTOR	16
+#define	IEEE80211_HE_VHT_MAX_AMPDU_FACTOR	20
+#define	IEEE80211_HE_6GHZ_MAX_AMPDU_FACTOR	13
 
 enum ieee80211_ht_max_ampdu_len {
 	IEEE80211_HT_MAX_AMPDU_64K
diff --git a/sys/compat/linuxkpi/common/include/linux/nl80211.h b/sys/compat/linuxkpi/common/include/linux/nl80211.h
index f8de2eedf1b7..e4c904ff5cac 100644
--- a/sys/compat/linuxkpi/common/include/linux/nl80211.h
+++ b/sys/compat/linuxkpi/common/include/linux/nl80211.h
@@ -334,6 +334,10 @@ enum nl80211_dfs_regions {
 	NL80211_DFS_JP,
 };
 
+enum nl80211_dfs_state {
+	NL80211_DFS_USABLE,
+};
+
 enum nl80211_sar_type {
 	NL80211_SAR_TYPE_POWER,
 };
@@ -373,6 +377,10 @@ enum nl80211_probe_resp_offload_support {
 	NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P,
 };
 
+enum nl80211_user_reg_hint_type {
+	NL80211_USER_REG_HINT_USER,
+};
+
 #define	NL80211_KCK_LEN				16
 #define	NL80211_KCK_EXT_LEN			24
 #define	NL80211_KEK_LEN				16
diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h
index 41fe6983eb4d..e6f1bd88309d 100644
--- a/sys/compat/linuxkpi/common/include/net/cfg80211.h
+++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h
@@ -531,7 +531,7 @@ struct station_info {
 	int     assoc_req_ies_len, connected_time;
 	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_failed, tx_retries;
+	int	rx_duration, tx_duration, tx_failed, tx_retries;
 
 	int					chains;
 	uint8_t					chain_signal[IEEE80211_MAX_CHAINS];
@@ -652,7 +652,6 @@ struct linuxkpi_ieee80211_regdomain {
 #define	IEEE80211_HE_6GHZ_CAP_MAX_MPDU_LEN		0x08
 #define	IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP		0x10
 #define	IEEE80211_HE_6GHZ_CAP_SM_PS			0x20
-#define	IEEE80211_HE_6GHZ_MAX_AMPDU_FACTOR		0x40
 
 #define	IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G		0x1
 #define	IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G	0x2
@@ -756,6 +755,14 @@ struct linuxkpi_ieee80211_regdomain {
 
 #define	IEEE80211_HE_PHY_CAP10_HE_MU_M1RU_MAX_LTF		0x1
 
+#define	IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED		0x1
+#define	IEEE80211_HE_OPERATION_BSS_COLOR_OFFSET			0x2
+
+#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	VENDOR_CMD_RAW_DATA	(void *)(uintptr_t)(-ENOENT)
 
 struct ieee80211_he_cap_elem {
@@ -791,9 +798,9 @@ struct ieee80211_he_obss_pd {
 	uint8_t					min_offset;
 	uint8_t					max_offset;
 	uint8_t					non_srg_max_offset;
-	uint8_t					bss_color_bitmap;
-	uint8_t					partial_bssid_bitmap;
 	uint8_t					sr_ctrl;
+	uint8_t					bss_color_bitmap[8];
+	uint8_t					partial_bssid_bitmap[8];
 };
 
 struct ieee80211_sta_he_6ghz_capa {
@@ -931,6 +938,7 @@ struct regulatory_request {
 		/* XXX TODO */
 	uint8_t					alpha2[2];
 	int	initiator, dfs_region;
+	int	user_reg_hint_type;
 };
 
 enum wiphy_vendor_cmd_need_flags {
diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h
index 7f6d50de6b78..75f2dac02be2 100644
--- a/sys/compat/linuxkpi/common/include/net/mac80211.h
+++ b/sys/compat/linuxkpi/common/include/net/mac80211.h
@@ -240,6 +240,10 @@ struct ieee80211_bss_conf {
 		uint8_t membership[WLAN_MEMBERSHIP_LEN];
 		uint8_t position[WLAN_USER_POSITION_LEN];
 	}  mu_group;
+	struct {
+		uint32_t			params;
+		/* single field struct? */
+	} he_oper;
 	struct cfg80211_he_bss_color		he_bss_color;
 	struct ieee80211_he_obss_pd		he_obss_pd;
 	size_t					ssid_len;
@@ -276,7 +280,7 @@ struct ieee80211_bss_conf {
 	int		profile_periodicity;
 	int		twt_requester, uora_exists, uora_ocw_range;
 	int		assoc_capability, enable_beacon, hidden_ssid, ibss_joined, twt_protected;
-	int		 he_oper, twt_responder, unsol_bcast_probe_resp_interval;
+	int		twt_responder, unsol_bcast_probe_resp_interval;
 	int		color_change_active;
 };
 
@@ -458,6 +462,7 @@ enum ieee802111_key_flag {
 	IEEE80211_KEY_FLAG_SW_MGMT_TX		= BIT(5),
 	IEEE80211_KEY_FLAG_GENERATE_IV_MGMT	= BIT(6),
 	IEEE80211_KEY_FLAG_GENERATE_MMIE	= BIT(7),
+	IEEE80211_KEY_FLAG_RESERVE_TAILROOM	= BIT(8),
 };
 
 struct ieee80211_key_conf {
@@ -1465,6 +1470,13 @@ ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb)
 	linuxkpi_ieee80211_rx(hw, skb, NULL, NULL);
 }
 
+static __inline void
+ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
+{
+
+	linuxkpi_ieee80211_rx(hw, skb, NULL, NULL);
+}
+
 /* -------------------------------------------------------------------------- */
 
 static __inline uint8_t