ieee80211: fix HE SPR size calculation
[carl9170fw.git] / include / linux / ieee80211.h
index ca9507d5c2dca0fe34a207755115bf1185de4c3c..f9b0ebe65f5456f9f70b65101918279025895357 100644 (file)
@@ -2081,7 +2081,7 @@ ieee80211_he_ppe_size(u8 ppe_thres_hdr, const u8 *phy_cap_info)
 
 /*
  * ieee80211_he_oper_size - calculate 802.11ax HE Operations IE size
- * @he_oper_ie: byte data of the He Operations IE, stating from the the byte
+ * @he_oper_ie: byte data of the He Operations IE, stating from the byte
  *     after the ext ID byte. It is assumed that he_oper_ie has at least
  *     sizeof(struct ieee80211_he_operation) bytes, the caller must have
  *     validated this.
@@ -2119,7 +2119,7 @@ ieee80211_he_oper_size(const u8 *he_oper_ie)
 
 /*
  * ieee80211_he_spr_size - calculate 802.11ax HE Spatial Reuse IE size
- * @he_spr_ie: byte data of the He Spatial Reuse IE, stating from the the byte
+ * @he_spr_ie: byte data of the He Spatial Reuse IE, stating from the byte
  *     after the ext ID byte. It is assumed that he_spr_ie has at least
  *     sizeof(struct ieee80211_he_spr) bytes, the caller must have validated
  *     this
@@ -2130,14 +2130,14 @@ ieee80211_he_spr_size(const u8 *he_spr_ie)
 {
        struct ieee80211_he_spr *he_spr = (void *)he_spr_ie;
        u8 spr_len = sizeof(struct ieee80211_he_spr);
-       u32 he_spr_params;
+       u8 he_spr_params;
 
        /* Make sure the input is not NULL */
        if (!he_spr_ie)
                return 0;
 
        /* Calc required length */
-       he_spr_params = le32_to_cpu(he_spr->he_sr_control);
+       he_spr_params = he_spr->he_sr_control;
        if (he_spr_params & IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT)
                spr_len++;
        if (he_spr_params & IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT)
@@ -2551,6 +2551,7 @@ enum ieee80211_eid {
        WLAN_EID_FILS_INDICATION = 240,
        WLAN_EID_DILS = 241,
        WLAN_EID_FRAGMENT = 242,
+       WLAN_EID_RSNX = 244,
        WLAN_EID_EXTENSION = 255
 };
 
@@ -2762,7 +2763,7 @@ enum ieee80211_tdls_actioncode {
  */
 #define WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT     BIT(6)
 
-/* TDLS capabilities in the the 4th byte of @WLAN_EID_EXT_CAPABILITY */
+/* TDLS capabilities in the 4th byte of @WLAN_EID_EXT_CAPABILITY */
 #define WLAN_EXT_CAPA4_TDLS_BUFFER_STA         BIT(4)
 #define WLAN_EXT_CAPA4_TDLS_PEER_PSM           BIT(5)
 #define WLAN_EXT_CAPA4_TDLS_CHAN_SWITCH                BIT(6)
@@ -3062,6 +3063,7 @@ struct ieee80211_multiple_bssid_configuration {
 #define WLAN_AKM_SUITE_FILS_SHA384             SUITE(0x000FAC, 15)
 #define WLAN_AKM_SUITE_FT_FILS_SHA256          SUITE(0x000FAC, 16)
 #define WLAN_AKM_SUITE_FT_FILS_SHA384          SUITE(0x000FAC, 17)
+#define WLAN_AKM_SUITE_OWE                     SUITE(0x000FAC, 18)
 
 #define WLAN_MAX_KEY_LEN               32
 
@@ -3351,4 +3353,11 @@ static inline bool for_each_element_completed(const struct element *element,
        return (const u8 *)element == (const u8 *)data + datalen;
 }
 
+/**
+ * RSNX Capabilities:
+ * bits 0-3: Field length (n-1)
+ */
+#define WLAN_RSNX_CAPA_PROTECTED_TWT BIT(4)
+#define WLAN_RSNX_CAPA_SAE_H2E BIT(5)
+
 #endif /* __LINUX_IEEE80211_H */