git: e6010da63903 - main - LinuxKPI: 802.11: updates to headers for driver update

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Thu, 24 Apr 2025 22:14:42 UTC
The branch main has been updated by bz:

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

commit e6010da63903cc6d9aac0077ab861cfd6bae2aa7
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-04-24 10:27:49 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-04-24 22:13:55 +0000

    LinuxKPI: 802.11: updates to headers for driver update
    
    Move some structs into the appropriate header to be visible.
    Add new fields to structs and enums.
    
    Remove arguments from two functions (one function currently unused
    by drivers in the tree, for the other the argument was unused).
    Adjust the iwlwifi accordingly.  This is in preparation for new
    driver versions to allow a smooth transition.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
---
 .../linuxkpi/common/include/linux/ieee80211.h      | 16 ++++++++++++++-
 sys/compat/linuxkpi/common/include/net/cfg80211.h  | 24 +++++++++++++++++++++-
 sys/compat/linuxkpi/common/include/net/mac80211.h  | 22 ++++++++------------
 sys/contrib/dev/iwlwifi/mvm/mac-ctxt.c             |  2 +-
 4 files changed, 47 insertions(+), 17 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h
index efac2a26e27e..8a33ad002e09 100644
--- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h
+++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h
@@ -349,6 +349,7 @@ enum ieee80211_chanctx_change_flags {
 	IEEE80211_CHANCTX_CHANGE_WIDTH		= BIT(3),
 	IEEE80211_CHANCTX_CHANGE_CHANNEL	= BIT(4),
 	IEEE80211_CHANCTX_CHANGE_PUNCTURING	= BIT(5),
+	IEEE80211_CHANCTX_CHANGE_MIN_DEF	= BIT(6),
 };
 
 enum ieee80211_frame_release_type {
@@ -783,6 +784,20 @@ struct ieee80211_bss_load_elem {
 	uint16_t				avail_adm_capa;
 };
 
+struct ieee80211_p2p_noa_desc {
+	uint32_t				count;		/* uint8_t ? */
+	uint32_t				duration;
+	uint32_t				interval;
+	uint32_t				start_time;
+};
+
+struct ieee80211_p2p_noa_attr {
+	uint8_t					index;
+	uint8_t					oppps_ctwindow;
+	struct ieee80211_p2p_noa_desc		desc[4];
+};
+
+
 /* net80211: IEEE80211_IS_CTL() */
 static __inline bool
 ieee80211_is_ctl(__le16 fc)
@@ -1225,5 +1240,4 @@ ieee80211_get_qos_ctl(struct ieee80211_hdr *hdr)
                 return (u8 *)hdr + 24;
 }
 
-
 #endif	/* _LINUXKPI_LINUX_IEEE80211_H */
diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h
index 2cdb96ffccdf..328563b4a125 100644
--- a/sys/compat/linuxkpi/common/include/net/cfg80211.h
+++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h
@@ -1458,6 +1458,18 @@ rfkill_soft_blocked(int rfkill)
 	return (false);
 }
 
+static __inline void
+wiphy_rfkill_start_polling(struct wiphy *wiphy)
+{
+	TODO();
+}
+
+static __inline void
+wiphy_rfkill_stop_polling(struct wiphy *wiphy)
+{
+	TODO();
+}
+
 static __inline int
 reg_query_regdb_wmm(uint8_t *alpha2, uint32_t center_freq,
     struct ieee80211_reg_rule *rule)
@@ -1994,7 +2006,7 @@ cfg80211_channel_is_psc(struct linuxkpi_ieee80211_channel *channel)
 
 static inline int
 cfg80211_get_ies_channel_number(const uint8_t *ie, size_t len,
-    enum nl80211_band band, enum cfg80211_bss_frame_type ftype)
+    enum nl80211_band band)
 {
 	const struct element *elem;
 
@@ -2207,6 +2219,16 @@ nl80211_chan_width_to_mhz(enum nl80211_chan_width width)
 	}
 }
 
+static __inline ssize_t
+wiphy_locked_debugfs_write(struct wiphy *wiphy, struct file *file,
+    char *buf, size_t bufsize, const char __user *userbuf, size_t count,
+    ssize_t (*handler)(struct wiphy *, struct file *, char *, size_t, void *),
+    void *data)
+{
+	TODO();
+	return (-ENXIO);
+}
+
 /* -------------------------------------------------------------------------- */
 
 static inline void
diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h
index 50c1475063e2..c6cdcbc43269 100644
--- a/sys/compat/linuxkpi/common/include/net/mac80211.h
+++ b/sys/compat/linuxkpi/common/include/net/mac80211.h
@@ -41,6 +41,7 @@
 #include <linux/skbuff.h>
 #include <linux/workqueue.h>
 #include <linux/dcache.h>
+#include <linux/ieee80211.h>
 #include <net/cfg80211.h>
 #include <net/if_inet6.h>
 
@@ -208,19 +209,6 @@ struct ieee80211_bar {
 	uint16_t	frame_control;
 };
 
-struct ieee80211_p2p_noa_desc {
-	uint32_t				count;		/* uint8_t ? */
-	uint32_t				duration;
-	uint32_t				interval;
-	uint32_t				start_time;
-};
-
-struct ieee80211_p2p_noa_attr {
-	uint8_t					index;
-	uint8_t					oppps_ctwindow;
-	struct ieee80211_p2p_noa_desc		desc[4];
-};
-
 struct ieee80211_mutable_offsets {
 	/* TODO FIXME */
 	uint16_t				tim_offset;
@@ -334,6 +322,7 @@ struct ieee80211_bss_conf {
 
 	uint8_t					dtim_period;
 	uint8_t					sync_dtim_count;
+	uint8_t					bss_param_ch_cnt_link_id;
 	bool					qos;
 	bool					twt_broadcast;
 	bool					use_cts_prot;
@@ -815,6 +804,7 @@ enum ieee80211_vif_driver_flags {
 #endif
 	IEEE80211_VIF_EML_ACTIVE		= BIT(4),
 	IEEE80211_VIF_IGNORE_OFDMA_WIDER_BW	= BIT(5),
+	IEEE80211_VIF_REMOVE_AP_AFTER_DISASSOC	= BIT(6),
 };
 
 #define	IEEE80211_BSS_ARP_ADDR_LIST_LEN		4
@@ -989,6 +979,7 @@ struct ieee80211_ops {
 	int  (*config)(struct ieee80211_hw *, u32);
 	void (*reconfig_complete)(struct ieee80211_hw *, enum ieee80211_reconfig_type);
 
+	void (*prep_add_interface)(struct ieee80211_hw *, enum nl80211_iftype);
 	int  (*add_interface)(struct ieee80211_hw *, struct ieee80211_vif *);
 	void (*remove_interface)(struct ieee80211_hw *, struct ieee80211_vif *);
 	int  (*change_interface)(struct ieee80211_hw *, struct ieee80211_vif *, enum nl80211_iftype, bool);
@@ -1027,6 +1018,7 @@ struct ieee80211_ops {
 	int  (*sta_state)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, enum ieee80211_sta_state, enum ieee80211_sta_state);
 	void (*sta_notify)(struct ieee80211_hw *, struct ieee80211_vif *, enum sta_notify_cmd, struct ieee80211_sta *);
 	void (*sta_rc_update)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, u32);
+	void (*link_sta_rc_update)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_link_sta *, u32);
 	void (*sta_rate_tbl_update)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *);
 	void (*sta_set_4addr)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, bool);
 	void (*sta_set_decap_offload)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, bool);
@@ -1118,6 +1110,8 @@ struct ieee80211_ops {
 	bool (*can_activate_links)(struct ieee80211_hw *, struct ieee80211_vif *, u16);
 	enum ieee80211_neg_ttlm_res (*can_neg_ttlm)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_neg_ttlm *);
 
+	void (*rfkill_poll)(struct ieee80211_hw *);
+
 /* #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 *);
 	void (*vif_add_debugfs)(struct ieee80211_hw *, struct ieee80211_vif *);
@@ -2312,7 +2306,7 @@ ieee80211_disconnect(struct ieee80211_vif *vif, bool _x)
 }
 
 static __inline void
-ieee80211_channel_switch_disconnect(struct ieee80211_vif *vif, bool _x)
+ieee80211_channel_switch_disconnect(struct ieee80211_vif *vif)
 {
 	TODO();
 }
diff --git a/sys/contrib/dev/iwlwifi/mvm/mac-ctxt.c b/sys/contrib/dev/iwlwifi/mvm/mac-ctxt.c
index 71c02b53af5d..24bfdb054a63 100644
--- a/sys/contrib/dev/iwlwifi/mvm/mac-ctxt.c
+++ b/sys/contrib/dev/iwlwifi/mvm/mac-ctxt.c
@@ -1922,7 +1922,7 @@ void iwl_mvm_channel_switch_error_notif(struct iwl_mvm *mvm,
 	if (csa_err_mask & (CS_ERR_COUNT_ERROR |
 			    CS_ERR_LONG_DELAY_AFTER_CS |
 			    CS_ERR_TX_BLOCK_TIMER_EXPIRED))
-		ieee80211_channel_switch_disconnect(vif, true);
+		ieee80211_channel_switch_disconnect(vif);
 	rcu_read_unlock();
 }