]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - src/common/ieee802_11_defs.h
HE: Fix HE Capabilities element variable length encoding
[thirdparty/hostap.git] / src / common / ieee802_11_defs.h
index 64b6167d3d3f235d36476f4274286c0143aea62f..dbe832c2eaaf5f6e57bfd105423a6eb7fd788c8c 100644 (file)
@@ -2105,8 +2105,9 @@ enum nr_chan_width {
 struct ieee80211_he_capabilities {
        u8 he_mac_capab_info[6];
        u8 he_phy_capab_info[11];
-       u8 he_txrx_mcs_support[12]; /* TODO: 4, 8, or 12 octets */
-       /* PPE Thresholds (optional) */
+       /* Followed by 4, 8, or 12 octets of Supported HE-MCS And NSS Set field
+       * and optional variable length PPE Thresholds field. */
+       u8 optional[];
 } STRUCT_PACKED;
 
 struct ieee80211_he_operation {
@@ -2135,6 +2136,15 @@ struct ieee80211_spatial_reuse {
 } STRUCT_PACKED;
 
 /* HE Capabilities Information defines */
+
+#define HE_PHYCAP_CHANNEL_WIDTH_SET_IDX                0
+#define HE_PHYCAP_CHANNEL_WIDTH_MASK           ((u8) (BIT(1) | BIT(2) | \
+                                                     BIT(3) | BIT(4)))
+#define HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_IN_2G         ((u8) BIT(1))
+#define HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G  ((u8) BIT(2))
+#define HE_PHYCAP_CHANNEL_WIDTH_SET_160MHZ_IN_5G       ((u8) BIT(3))
+#define HE_PHYCAP_CHANNEL_WIDTH_SET_80PLUS80MHZ_IN_5G  ((u8) BIT(4))
+
 #define HE_PHYCAP_SU_BEAMFORMER_CAPAB_IDX      3
 #define HE_PHYCAP_SU_BEAMFORMER_CAPAB          ((u8) BIT(7))
 #define HE_PHYCAP_SU_BEAMFORMEE_CAPAB_IDX      4
@@ -2142,6 +2152,14 @@ struct ieee80211_spatial_reuse {
 #define HE_PHYCAP_MU_BEAMFORMER_CAPAB_IDX      4
 #define HE_PHYCAP_MU_BEAMFORMER_CAPAB          ((u8) BIT(1))
 
+#define HE_PHYCAP_PPE_THRESHOLD_PRESENT_IDX    6
+#define HE_PHYCAP_PPE_THRESHOLD_PRESENT                ((u8) BIT(7))
+
+/* HE PPE Threshold define */
+#define HE_PPE_THRES_RU_INDEX_BITMASK_MASK     0xf
+#define HE_PPE_THRES_RU_INDEX_BITMASK_SHIFT    3
+#define HE_PPE_THRES_NSS_MASK                  0x7
+
 /* HE Operation defines */
 /* HE Operation Parameters and BSS Color Information fields */
 #define HE_OPERATION_DFLT_PE_DURATION_MASK     ((u32) (BIT(0) | BIT(1) | \