History

cfg80211: Add data structures to capture EHT capabilities

And advertise EHT capabilities to user space when supported.

Ilan Peer committed 4 years ago

Commit 5cd5a8a1 parent 2a2c86f3 files · +102 −0Browse files

Showing the changes to include (2 of 3 files). Show all

Unified · Split

2 files
  1. include/net/cfg80211.h +63 −0
  2. include/uapi/linux/nl80211.h +12 −0
include/net/cfg80211.h+63−0
@@ -360,6 +360,48 @@ struct ieee80211_sta_he_cap { · 359 unmodified lines
360360 u8 ppe_thres[IEEE80211_HE_PPE_THRES_MAX_LEN];
361361 };
362362
363+/**
364+ * struct ieee80211_eht_mcs_nss_supp - EHT max supported NSS per MCS
365+ *
366+ * See P802.11be_D1.3 Table 9-401k - "Subfields of the Supported EHT-MCS
367+ * and NSS Set field"
368+ *
369+ * @only_20mhz: MCS/NSS support for 20 MHz-only STA.
370+ * @bw._80: MCS/NSS support for BW <= 80 MHz
371+ * @bw._160: MCS/NSS support for BW = 160 MHz
372+ * @bw._320: MCS/NSS support for BW = 320 MHz
373+ */
374+struct ieee80211_eht_mcs_nss_supp {
375+ union {
376+ struct ieee80211_eht_mcs_nss_supp_20mhz_only only_20mhz;
377+ struct {
378+ struct ieee80211_eht_mcs_nss_supp_bw _80;
379+ struct ieee80211_eht_mcs_nss_supp_bw _160;
380+ struct ieee80211_eht_mcs_nss_supp_bw _320;
381+ } __packed bw;
382+ } __packed;
383+} __packed;
384+
385+#define IEEE80211_EHT_PPE_THRES_MAX_LEN 32
386+
387+/**
388+ * struct ieee80211_sta_eht_cap - STA's EHT capabilities
389+ *
390+ * This structure describes most essential parameters needed
391+ * to describe 802.11be EHT capabilities for a STA.
392+ *
393+ * @has_eht: true iff EHT data is valid.
394+ * @eht_cap_elem: Fixed portion of the eht capabilities element.
395+ * @eht_mcs_nss_supp: The supported NSS/MCS combinations.
396+ * @eht_ppe_thres: Holds the PPE Thresholds data.
397+ */
398+struct ieee80211_sta_eht_cap {
399+ bool has_eht;
400+ struct ieee80211_eht_cap_elem_fixed eht_cap_elem;
401+ struct ieee80211_eht_mcs_nss_supp eht_mcs_nss_supp;
402+ u8 eht_ppe_thres[IEEE80211_EHT_PPE_THRES_MAX_LEN];
403+};
404+
363405 /**
364406 * struct ieee80211_sband_iftype_data - sband data per interface type
365407 *
@@ -379,6 +421,7 @@ struct ieee80211_sband_iftype_data { · 13 unmodified lines
379421 u16 types_mask;
380422 struct ieee80211_sta_he_cap he_cap;
381423 struct ieee80211_he_6ghz_capa he_6ghz_capa;
424+ struct ieee80211_sta_eht_cap eht_cap;
382425 struct {
383426 const u8 *data;
384427 unsigned int len;
@@ -561,6 +604,26 @@ ieee80211_get_he_6ghz_capa(const struct ieee80211_supported_band *sband, · 176 unmodified lines
561604 return data->he_6ghz_capa.capa;
562605 }
563606
607+/**
608+ * ieee80211_get_eht_iftype_cap - return ETH capabilities for an sband's iftype
609+ * @sband: the sband to search for the iftype on
610+ * @iftype: enum nl80211_iftype
611+ *
612+ * Return: pointer to the struct ieee80211_sta_eht_cap, or NULL is none found
613+ */
614+static inline const struct ieee80211_sta_eht_cap *
615+ieee80211_get_eht_iftype_cap(const struct ieee80211_supported_band *sband,
616+ enum nl80211_iftype iftype)
617+{
618+ const struct ieee80211_sband_iftype_data *data =
619+ ieee80211_get_sband_iftype_data(sband, iftype);
620+
621+ if (data && data->eht_cap.has_eht)
622+ return &data->eht_cap;
623+
624+ return NULL;
625+}
626+
564627 /**
565628 * wiphy_read_of_freq_limits - read frequency limits from device tree
566629 *
include/uapi/linux/nl80211.h+12−0
@@ -3766,6 +3766,14 @@ enum nl80211_mpath_info { · 3765 unmodified lines
37663766 * given for all 6 GHz band channels
37673767 * @NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS: vendor element capabilities that are
37683768 * advertised on this band/for this iftype (binary)
3769+ * @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC: EHT MAC capabilities as in EHT
3770+ * capabilities element
3771+ * @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PHY: EHT PHY capabilities as in EHT
3772+ * capabilities element
3773+ * @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MCS_SET: EHT supported NSS/MCS as in EHT
3774+ * capabilities element
3775+ * @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PPE: EHT PPE thresholds information as
3776+ * defined in EHT capabilities element
37693777 * @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use
37703778 * @NL80211_BAND_IFTYPE_ATTR_MAX: highest band attribute currently defined
37713779 */
@@ -3779,6 +3787,10 @@ enum nl80211_band_iftype_attr { · 7 unmodified lines
37793787 NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE,
37803788 NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA,
37813789 NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS,
3790+ NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC,
3791+ NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PHY,
3792+ NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MCS_SET,
3793+ NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PPE,
37823794
37833795 /* keep last */
37843796 __NL80211_BAND_IFTYPE_ATTR_AFTER_LAST,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t