The branch main has been updated by bz:

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

commit 8be200cf968f0c7f72f75c8a73d7b2bee43f935d
Author:     Bjoern A. Zeeb <b...@freebsd.org>
AuthorDate: 2025-06-02 15:58:49 +0000
Commit:     Bjoern A. Zeeb <b...@freebsd.org>
CommitDate: 2025-06-09 21:44:25 +0000

    net80211: LinuxKPI: migrate HE IE structs from LinuxKPI to net80211
    
    Take the HE IE structures as they are used by drivers and put them
    into net80211 rather than LinuxKPI.  There is little need to
    re-invent the wheel on those.  They settled for long enough.
    
    Do not export them by default to user space as some also overlap with
    wpa and we still do not have a clear distinction for what is available
    only in kernel and what to user space.   In our case ifconfig(8)
    is a consumer of these structs which it can setting WANT_NET80211 like
    we have done for some VHT bits before.
    
    Add struct net80211_he_cap which holds the IE fields but also a bool
    and is meant to be put into ic/vap/ni.  The bool will give us the same
    naming for all layers rather than having individual flags in each part
    which was highly confusing.  In theory this struct should be in
    ieee80211_var.h but that would pull things apart.
    
    Extend struct ieee80211_mu_edca_param_set by a union as it will help
    ifconfig(8) parsing the bk/be/vi/vo parts.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
    Reviewed by:    adrian
    Differential Revision: https://reviews.freebsd.org/D50676
---
 sys/compat/linuxkpi/common/include/net/cfg80211.h | 24 +-------
 sys/compat/linuxkpi/common/include/net/mac80211.h |  5 --
 sys/net80211/ieee80211.h                          | 70 +++++++++++++++++++++++
 3 files changed, 71 insertions(+), 28 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h 
b/sys/compat/linuxkpi/common/include/net/cfg80211.h
index e9af70f751d4..c806afb971e6 100644
--- a/sys/compat/linuxkpi/common/include/net/cfg80211.h
+++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h
@@ -895,29 +895,7 @@ struct linuxkpi_ieee80211_regdomain {
 
 #define        VENDOR_CMD_RAW_DATA     (void *)(uintptr_t)(-ENOENT)
 
-/*
- * 802.11ax-2021,
- * 9.4.2.248.2 HE MAC Capabilities Information field.
- * 9.4.2.248.3 HE PHY Capabilities Information field.
- */
-struct ieee80211_he_cap_elem {
-       u8 mac_cap_info[6];
-       u8 phy_cap_info[11];
-} __packed;
-
-/* 802.11ax-2021, 9.4.2.248.4 Supported HE-MCS And NSS Set field. */
-struct ieee80211_he_mcs_nss_supp {
-       uint16_t        rx_mcs_80;
-       uint16_t        tx_mcs_80;
-       uint16_t        rx_mcs_160;
-       uint16_t        tx_mcs_160;
-       uint16_t        rx_mcs_80p80;
-       uint16_t        tx_mcs_80p80;
-};
-
-#define        IEEE80211_HE_CAP_PPE_THRES_MAX  25
-
-/* net80211::ic_ieee80211_he_cap */
+/* net80211::net80211_he_cap */
 struct ieee80211_sta_he_cap {
        bool                                    has_he;
        struct ieee80211_he_cap_elem            he_cap_elem;
diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h 
b/sys/compat/linuxkpi/common/include/net/mac80211.h
index 6ce6a6384c12..af3199c38939 100644
--- a/sys/compat/linuxkpi/common/include/net/mac80211.h
+++ b/sys/compat/linuxkpi/common/include/net/mac80211.h
@@ -413,11 +413,6 @@ struct ieee80211_ftm_responder_params {
        int                                     civicloc_len;
 };
 
-struct ieee80211_he_mu_edca_param_ac_rec {
-       /* TODO FIXME */
-       int             aifsn, ecw_min_max, mu_edca_timer;
-};
-
 struct ieee80211_conf {
        int                                     dynamic_ps_timeout;
        int                                     power_level;
diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h
index cca721e6b54e..c782e09a522d 100644
--- a/sys/net80211/ieee80211.h
+++ b/sys/net80211/ieee80211.h
@@ -28,6 +28,12 @@
 #ifndef _NET80211_IEEE80211_H_
 #define _NET80211_IEEE80211_H_
 
+#include <sys/types.h>
+
+#ifndef _KERNEL
+#include <stdbool.h>
+#endif
+
 /*
  * 802.11 protocol definitions.
  */
@@ -1098,6 +1104,70 @@ struct ieee80211_ie_vht_txpwrenv {
 #define        WLAN_ACTION_VHT_GROUPID_MGMT            1
 #define        WLAN_ACTION_VHT_OPMODE_NOTIF            2
 
+#if defined(_KERNEL) || defined(WANT_NET80211)
+/*
+ * HE
+ */
+
+/*
+ * 802.11ax-2021,
+ * 9.4.2.248.2 HE MAC Capabilities Information field.
+ * 9.4.2.248.3 HE PHY Capabilities Information field.
+ */
+struct ieee80211_he_cap_elem {
+       uint8_t                                 mac_cap_info[6];
+       uint8_t                                 phy_cap_info[11];
+} __packed;
+
+/* 802.11ax-2021, 9.4.2.248.4 Supported HE-MCS And NSS Set field. */
+struct ieee80211_he_mcs_nss_supp {
+       uint16_t                                rx_mcs_80;
+       uint16_t                                tx_mcs_80;
+       uint16_t                                rx_mcs_160;
+       uint16_t                                tx_mcs_160;
+       uint16_t                                rx_mcs_80p80;
+       uint16_t                                tx_mcs_80p80;
+} __packed;
+
+#define        IEEE80211_HE_CAP_PPE_THRES_MAX          25
+
+/* XXX this should only be internal. */
+struct net80211_he_cap {
+       bool                                    has_he;
+       struct ieee80211_he_cap_elem            he_cap_elem;
+       struct ieee80211_he_mcs_nss_supp        he_mcs_nss_supp;
+       uint8_t                                 
ppe_thres[IEEE80211_HE_CAP_PPE_THRES_MAX];
+};
+
+/* 802.11ax-2021, 9.4.2.249 HE Operation element. */
+struct ieee80211_he_operation {
+       uint32_t                                he_oper_params;
+       uint16_t                                he_mcs_nss_set;
+       uint8_t                                 optional[0];
+} __packed;
+
+/* 802.11ax-2021, 9.4.2.251 MU EDCA Parameter Set element. */
+struct ieee80211_he_mu_edca_param_ac_rec {
+       uint8_t                                 aifsn;
+       uint8_t                                 ecw_min_max;
+       uint8_t                                 mu_edca_timer;
+} __packed;
+
+struct ieee80211_mu_edca_param_set {
+       uint8_t                                 mu_qos_info;
+       union {
+               struct {
+                       struct ieee80211_he_mu_edca_param_ac_rec ac_be;
+                       struct ieee80211_he_mu_edca_param_ac_rec ac_bk;
+                       struct ieee80211_he_mu_edca_param_ac_rec ac_vi;
+                       struct ieee80211_he_mu_edca_param_ac_rec ac_vo;
+               };
+               struct ieee80211_he_mu_edca_param_ac_rec param_ac_recs[4];
+       };
+} __packed;
+#endif /* _KERNEL || WANT_NET80211 */
+
+
 /*
  * Management information element payloads.
  *

Reply via email to