Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 May 2025 11:50:30 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 6a0dbc0a1246 - stable/14 - LinuxKPI: 802.11: header updates for mt76
Message-ID:  <202505071150.547BoUeH089184@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by bz:

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

commit 6a0dbc0a1246c9825f0892bb6dd957f5d081057a
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-05-02 20:13:33 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-05-07 08:52:09 +0000

    LinuxKPI: 802.11: header updates for mt76
    
    Add more structs, fields, flags, defines.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 675e6b1c68ba71af1853952f7df4d84399340009)
---
 .../linuxkpi/common/include/linux/ieee80211.h      |  6 ++
 sys/compat/linuxkpi/common/include/net/cfg80211.h  | 96 +++++++++++++++-------
 sys/compat/linuxkpi/common/include/net/mac80211.h  | 36 ++++++--
 3 files changed, 100 insertions(+), 38 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h
index 8a33ad002e09..396204c3c484 100644
--- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h
+++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h
@@ -295,6 +295,7 @@ enum ieee80211_ac_numbers {
 #define	IEEE80211_HT_MCS_MASK_LEN		10
 
 #define	IEEE80211_MLD_MAX_NUM_LINKS		15
+#define	IEEE80211_MLD_CAP_OP_MAX_SIMUL_LINKS	0xf
 #define	IEEE80211_MLD_CAP_OP_TID_TO_LINK_MAP_NEG_SUPP		0x0060
 #define	IEEE80211_MLD_CAP_OP_TID_TO_LINK_MAP_NEG_SUPP_SAME	1
 
@@ -427,6 +428,7 @@ enum ieee80211_tx_control_flags {
 	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_DONT_USE_RATE_MASK	= BIT(3),
 	IEEE80211_TX_CTRL_MLO_LINK		= 0xF0000000,	/* This is IEEE80211_LINK_UNSPECIFIED on the high bits. */
 };
 
@@ -493,6 +495,10 @@ enum ieee80211_category {
 	WLAN_CATEGORY_SA_QUERY		= 8,	/* net80211::IEEE80211_ACTION_CAT_SA_QUERY */
 };
 
+struct ieee80211_he_6ghz_capa {
+	uint16_t capa;
+};
+
 /* 80211-2020 9.3.3.2 Format of Management frames */
 struct ieee80211_mgmt {
 	__le16		frame_control;
diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h
index aae60983f5f6..1e4f917a2796 100644
--- a/sys/compat/linuxkpi/common/include/net/cfg80211.h
+++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h
@@ -744,6 +744,8 @@ struct linuxkpi_ieee80211_regdomain {
 #define	IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4	0x20
 #define	IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_MASK	0x40
 #define	IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_MASK	0x80
+#define	IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_5		0x80
+#define	IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_5		0x80
 
 #define	IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2	0x1
 #define	IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2	0x2
@@ -931,11 +933,6 @@ struct ieee80211_he_obss_pd {
 	uint8_t					partial_bssid_bitmap[8];
 };
 
-struct ieee80211_sta_he_6ghz_capa {
-	/* TODO FIXME */
-	int	capa;
-};
-
 struct ieee80211_eht_mcs_nss_supp_20mhz_only {
 	union {
 		struct {
@@ -989,7 +986,7 @@ 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_he_6ghz_capa		he_6ghz_capa;
 	struct ieee80211_sta_eht_cap		eht_cap;
 	struct {
 		const uint8_t			*data;
@@ -1182,6 +1179,18 @@ enum cfg80211_regulatory {
 	REGULATORY_COUNTRY_IE_FOLLOW_POWER	= BIT(6),
 };
 
+struct wiphy_radio_freq_range {
+	uint32_t				start_freq;
+	uint32_t				end_freq;
+};
+
+struct wiphy_radio {
+	int					n_freq_range;
+	int					n_iface_combinations;
+	const struct wiphy_radio_freq_range	*freq_range;
+	const struct ieee80211_iface_combination *iface_combinations;
+};
+
 enum wiphy_flags {
 	WIPHY_FLAG_AP_UAPSD			= BIT(0),
 	WIPHY_FLAG_HAS_CHANNEL_SWITCH		= BIT(1),
@@ -1246,6 +1255,9 @@ struct wiphy {
 	uint8_t					available_antennas_rx;
 	uint8_t					available_antennas_tx;
 
+	int					n_radio;
+	const struct wiphy_radio		*radio;
+
 	int	features, hw_version;
 	int	interface_modes, max_match_sets, max_remain_on_channel_duration, max_scan_ssids, max_sched_scan_ie_len, max_sched_scan_plan_interval, max_sched_scan_plan_iterations, max_sched_scan_plans, max_sched_scan_reqs, max_sched_scan_ssids;
 	int	num_iftype_ext_capab;
@@ -1259,6 +1271,7 @@ struct wiphy {
 
 	unsigned long				ext_features[BITS_TO_LONGS(NUM_NL80211_EXT_FEATURES)];
 	struct dentry				*debugfsdir;
+
 	const struct wiphy_wowlan_support	*wowlan;
 	struct cfg80211_wowlan			*wowlan_config;
 	/* Lower layer (driver/mac80211) specific data. */
@@ -1271,8 +1284,9 @@ struct wiphy {
 
 struct wireless_dev {
 		/* XXX TODO, like ic? */
-	int		iftype;
-	int     address;
+	enum nl80211_iftype			iftype;
+	uint32_t				radio_mask;
+	uint8_t					address[ETH_ALEN];
 	struct net_device			*netdev;
 	struct wiphy				*wiphy;
 };
@@ -1542,6 +1556,43 @@ cfg80211_chandef_create(struct cfg80211_chan_def *chandef,
 	};
 }
 
+static __inline bool
+cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef)
+{
+	TODO();
+	return (false);
+}
+
+static __inline bool
+cfg80211_chandef_dfs_usable(struct wiphy *wiphy, const struct cfg80211_chan_def *chandef)
+{
+	TODO();
+	return (false);
+}
+
+static __inline unsigned int
+cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy, const struct cfg80211_chan_def *chandef)
+{
+	TODO();
+	return (0);
+}
+
+static __inline bool
+cfg80211_chandef_identical(const struct cfg80211_chan_def *chandef_1,
+    const struct cfg80211_chan_def *chandef_2)
+{
+	TODO();
+	return (false);
+}
+
+static __inline bool
+cfg80211_chandef_usable(struct wiphy *wiphy,
+    const struct cfg80211_chan_def *chandef, uint32_t flags)
+{
+	TODO();
+	return (false);
+}
+
 static __inline void
 cfg80211_bss_iter(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,
     void (*iterfunc)(struct wiphy *, struct cfg80211_bss *, void *), void *data)
@@ -2077,27 +2128,6 @@ cfg80211_find_ext_ie(uint8_t eid, const uint8_t *p, size_t len)
 	return (NULL);
 }
 
-static __inline bool
-cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef)
-{
-	TODO();
-	return (false);
-}
-
-static __inline bool
-cfg80211_chandef_dfs_usable(struct wiphy *wiphy, const struct cfg80211_chan_def *chandef)
-{
-	TODO();
-	return (false);
-}
-
-static __inline unsigned int
-cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy, const struct cfg80211_chan_def *chandef)
-{
-	TODO();
-	return (0);
-}
-
 static inline void
 _ieee80211_set_sband_iftype_data(struct ieee80211_supported_band *band,
     struct ieee80211_sband_iftype_data *iftype_data, size_t nitems)
@@ -2189,6 +2219,14 @@ cfg80211_get_iftype_ext_capa(struct wiphy *wiphy, enum nl80211_iftype iftype)
 	return (NULL);
 }
 
+static inline uint16_t
+ieee80211_get_he_6ghz_capa(const struct ieee80211_supported_band *sband,
+    enum nl80211_iftype iftype)
+{
+	TODO();
+	return (0);
+}
+
 static inline int
 nl80211_chan_width_to_mhz(enum nl80211_chan_width width)
 {
diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h
index c6cdcbc43269..f8eb180d63a1 100644
--- a/sys/compat/linuxkpi/common/include/net/mac80211.h
+++ b/sys/compat/linuxkpi/common/include/net/mac80211.h
@@ -473,6 +473,7 @@ enum ieee80211_hw_flags {
 	IEEE80211_HW_DISALLOW_PUNCTURING_5GHZ,
 	IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN,
 	IEEE80211_HW_HANDLES_QUIET_CSA,
+	IEEE80211_HW_NO_VIRTUAL_MONITOR,
 
 	/* Keep last. */
 	NUM_IEEE80211_HW_FLAGS
@@ -708,9 +709,10 @@ struct ieee80211_sta_rates {
 	/* XXX TODO */
 	/* XXX some _rcu thing */
 	struct {
-		int	idx;
-		int	flags;
-	} rate[1];		/* XXX what is the real number? */
+		uint8_t			idx;
+		uint8_t			count;
+		uint16_t		flags;
+	} rate[4];		/* XXX what is the real number? */
 };
 
 struct ieee80211_sta_txpwr {
@@ -734,7 +736,7 @@ struct ieee80211_link_sta {
 	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_he_6ghz_capa		he_6ghz_capa;
 	struct ieee80211_sta_eht_cap		eht_cap;
 	uint8_t					rx_nss;
 	enum ieee80211_sta_rx_bw		bandwidth;
@@ -1093,7 +1095,7 @@ struct ieee80211_ops {
 
 	void (*update_vif_offload)(struct ieee80211_hw *, struct ieee80211_vif *);
 
-	int  (*get_txpower)(struct ieee80211_hw *, struct ieee80211_vif *, int *);
+	int  (*get_txpower)(struct ieee80211_hw *, struct ieee80211_vif *, unsigned int, int *);
 	int  (*get_stats)(struct ieee80211_hw *, struct ieee80211_low_level_stats *);
 
 	int  (*set_radar_background)(struct ieee80211_hw *, struct cfg80211_chan_def *);
@@ -1870,13 +1872,13 @@ ieee80211_rate_set_vht(struct ieee80211_tx_rate *r, uint8_t mcs, uint8_t nss)
 }
 
 static inline uint8_t
-ieee80211_rate_get_vht_nss(struct ieee80211_tx_rate *r)
+ieee80211_rate_get_vht_nss(const struct ieee80211_tx_rate *r)
 {
 	return (((r->idx >> 4) & 0x07) + 1);
 }
 
 static inline uint8_t
-ieee80211_rate_get_vht_mcs(struct ieee80211_tx_rate *r)
+ieee80211_rate_get_vht_mcs(const struct ieee80211_tx_rate *r)
 {
 	return (r->idx & 0x0f);
 }
@@ -2180,12 +2182,27 @@ ieee80211_queue_work(struct ieee80211_hw *hw, struct work_struct *w)
 	linuxkpi_ieee80211_queue_work(hw, w);
 }
 
+static __inline bool
+ieee80211_tx_prepare_skb(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+    struct sk_buff *skb, enum nl80211_band band, struct ieee80211_sta **sta)
+{
+	TODO();
+	return (false);
+}
+
 static __inline void
 ieee80211_tx_status_skb(struct ieee80211_hw *hw, struct sk_buff *skb)
 {
 	linuxkpi_ieee80211_tx_status(hw, skb);
 }
 
+static inline void
+ieee80211_tx_status_noskb(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
+    struct ieee80211_tx_info *info)
+{
+	TODO();
+}
+
 static __inline void
 ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb)
 {
@@ -2267,7 +2284,8 @@ ieee80211_txq_may_transmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
 }
 
 static __inline void
-ieee80211_radar_detected(struct ieee80211_hw *hw)
+ieee80211_radar_detected(struct ieee80211_hw *hw,
+    struct ieee80211_chanctx_conf *chanctx_conf)
 {
 	TODO();
 }
@@ -2327,7 +2345,7 @@ ieee80211_get_tx_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta,
 }
 
 static __inline void
-ieee80211_color_change_finish(struct ieee80211_vif *vif)
+ieee80211_color_change_finish(struct ieee80211_vif *vif, uint8_t link_id)
 {
 	TODO();
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202505071150.547BoUeH089184>