From nobody Mon Jun 9 21:45:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGQSc4jrKz5yXTv; Mon, 09 Jun 2025 21:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGQSc1sN3z4HB1; Mon, 09 Jun 2025 21:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749505504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JGLoY3bghQLqAQicLGEXP6qNTRuTbKOCS8CkEFz3Emo=; b=dSd19IzPzWLBCcM8iRnxQy0ft2o4Oa4cpTpPW05u+DT9hAhCGVvXL9rchZlzJF6t0H08EJ 6DyfD/RQV0FbnR/TagTdAdfMPDWotUS2C8XwdCwY9nC0ozJusnP0lum6zHpZz0rUi72ykr TYuSlVVKmddyWsGs26BAgwaJM7jSQGPSYPIwF4jCa0nhzNkL+MKpOniskIhse1WUoo/Rgd naMVz1MawvEf5wFVTP7+EM+8eBefCHvxCi9mfnk3QFwQvykHptRb/1PgpPdsmq09kLyhzr mi+cio0iCi0jJ8pm1AB2zqtsFQkldjSa8JzNIAU/WZ4rJzZB4E4c3S372gSJFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749505504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JGLoY3bghQLqAQicLGEXP6qNTRuTbKOCS8CkEFz3Emo=; b=KUzKjuoEdgXk6CNnoNehi0CNI88Eej/m5EIJMNqQBmhjoCYSrYyCTb7Yj3ts/oVkIVJHJQ Eq5FMywb+DFQHD6Omsj2QvMRIWIDmevMp6+nf3C7QenSxytO4ZuFJ4a4vhSyjLzxYkWwvR wFf/FUcVtJPH3IYggoDBcKFwR156QutWOINqTf8Q1yIW1Ec2KR2yv7gEly/krsY4Hhua0O Ruu5eS5HTuxXKx4MwzMkNQMs5NiMNxuoZVzvwCZhlZwnVeUfJO20V+pTFa24isXxhbMHOa S1Vdpx7poxZrZugWRY4V+QScjrFBL2YaQ8Vs01C6/zd1huokxi7Bl1jaXXLmmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749505504; a=rsa-sha256; cv=none; b=AtSZk+cn9mrNLDM1LUz/b+flw8bfsWk0+taZ2M0E0YnllQQ9hn5d6WmdVhEW/w863scUPh hGkJpVhMYrtCnP4toDqqOcJAlGiS9Guw6qnNxbAfg1gFREOfBj+EAaD8if+QcCHFuXn+S1 sU1xrpsPR7lZZ2GRvd77dLCPxpR/8jXp06K1pIUKJPom7gbdlZou1zmXn7+sxeJugn23C1 V8nj1kmap+Gd7xkjwApRdEjkGW2GLYlKJ7kplz7mJNXgjqQbi3z9016yav2ADPnAoV+D+u iUcJJ793M8UABnylyb9yFkhS+F4kYRvD6cwLwoHKH7q9ymxe7HJhsmTdMzK9Fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGQSc1SmLz1C9P; Mon, 09 Jun 2025 21:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Lj41w062996; Mon, 9 Jun 2025 21:45:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Lj4Cw062993; Mon, 9 Jun 2025 21:45:04 GMT (envelope-from git) Date: Mon, 9 Jun 2025 21:45:04 GMT Message-Id: <202506092145.559Lj4Cw062993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8be200cf968f - main - net80211: LinuxKPI: migrate HE IE structs from LinuxKPI to net80211 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8be200cf968f0c7f72f75c8a73d7b2bee43f935d Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8be200cf968f0c7f72f75c8a73d7b2bee43f935d commit 8be200cf968f0c7f72f75c8a73d7b2bee43f935d Author: Bjoern A. Zeeb AuthorDate: 2025-06-02 15:58:49 +0000 Commit: Bjoern A. Zeeb 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 + +#ifndef _KERNEL +#include +#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. *