iwlwifi: mvm: support FTM initiator
[carl9170fw.git] / include / linux / ieee80211.h
index e71604bdb53b1e1ffe1a1c863db0e7dd85473684..190c69ca35874a2a38eb2d591bde165a7c5fbebb 100644 (file)
@@ -8,7 +8,7 @@
  * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net>
  * Copyright (c) 2013 - 2014 Intel Mobile Communications GmbH
  * Copyright (c) 2016 - 2017 Intel Deutschland GmbH
- * Copyright (c) 2018        Intel Corporation
+ * Copyright (c) 2018 - 2019 Intel Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -2137,6 +2137,8 @@ ieee80211_he_oper_size(const u8 *he_oper_ie)
 #define IEEE80211_SPCT_MSR_RPRT_TYPE_BASIC     0
 #define IEEE80211_SPCT_MSR_RPRT_TYPE_CCA       1
 #define IEEE80211_SPCT_MSR_RPRT_TYPE_RPI       2
+#define IEEE80211_SPCT_MSR_RPRT_TYPE_LCI       8
+#define IEEE80211_SPCT_MSR_RPRT_TYPE_CIVIC     11
 
 /* 802.11g ERP information element */
 #define WLAN_ERP_NON_ERP_PRESENT (1<<0)
@@ -2494,6 +2496,7 @@ enum ieee80211_eid_ext {
        WLAN_EID_EXT_HE_OPERATION = 36,
        WLAN_EID_EXT_UORA = 37,
        WLAN_EID_EXT_HE_MU_EDCA = 38,
+       WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION = 55,
 };
 
 /* Action category code */
@@ -2675,6 +2678,11 @@ enum ieee80211_tdls_actioncode {
  */
 #define WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING   BIT(2)
 
+/* Multiple BSSID capability is set in the 6th bit of 3rd byte of the
+ * @WLAN_EID_EXT_CAPABILITY information element
+ */
+#define WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT     BIT(6)
+
 /* TDLS capabilities in the 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)
@@ -2710,6 +2718,9 @@ enum ieee80211_tdls_actioncode {
 #define WLAN_EXT_CAPA10_TWT_REQUESTER_SUPPORT  BIT(5)
 #define WLAN_EXT_CAPA10_TWT_RESPONDER_SUPPORT  BIT(6)
 
+/* Defines support for enhanced multi-bssid advertisement*/
+#define WLAN_EXT_CAPA11_EMA_SUPPORT    BIT(1)
+
 /* TDLS specific payload type in the LLC/SNAP header */
 #define WLAN_TDLS_SNAP_RFTYPE  0x2
 
@@ -2901,6 +2912,35 @@ enum ieee80211_sa_query_action {
        WLAN_ACTION_SA_QUERY_RESPONSE = 1,
 };
 
+/**
+ * struct ieee80211_bssid_index
+ *
+ * This structure refers to "Multiple BSSID-index element"
+ *
+ * @bssid_index: BSSID index
+ * @dtim_period: optional, overrides transmitted BSS dtim period
+ * @dtim_count: optional, overrides transmitted BSS dtim count
+ */
+struct ieee80211_bssid_index {
+       u8 bssid_index;
+       u8 dtim_period;
+       u8 dtim_count;
+};
+
+/**
+ * struct ieee80211_multiple_bssid_configuration
+ *
+ * This structure refers to "Multiple BSSID Configuration element"
+ *
+ * @bssid_count: total number of active BSSIDs in the set
+ * @profile_periodicity: the least number of beacon frames need to be received
+ *     in order to discover all the nontransmitted BSSIDs in the set.
+ */
+struct ieee80211_multiple_bssid_configuration {
+       u8 bssid_count;
+       u8 profile_periodicity;
+};
+
 #define SUITE(oui, id) (((oui) << 8) | (id))
 
 /* cipher suite selectors */
@@ -3176,23 +3216,23 @@ struct element {
        u8 id;
        u8 datalen;
        u8 data[];
-};
+} __packed;
 
 /* element iteration helpers */
-#define for_each_element(element, _data, _datalen)                     \
-       for (element = (void *)(_data);                                 \
-            (u8 *)(_data) + (_datalen) - (u8 *)element >=              \
-               sizeof(*element) &&                                     \
-            (u8 *)(_data) + (_datalen) - (u8 *)element >=              \
-               sizeof(*element) + element->datalen;                    \
-            element = (void *)(element->data + element->datalen))
+#define for_each_element(_elem, _data, _datalen)                       \
+       for (_elem = (const struct element *)(_data);                   \
+            (const u8 *)(_data) + (_datalen) - (const u8 *)_elem >=    \
+               (int)sizeof(*_elem) &&                                  \
+            (const u8 *)(_data) + (_datalen) - (const u8 *)_elem >=    \
+               (int)sizeof(*_elem) + _elem->datalen;                   \
+            _elem = (const struct element *)(_elem->data + _elem->datalen))
 
 #define for_each_element_id(element, _id, data, datalen)               \
        for_each_element(element, data, datalen)                        \
                if (element->id == (_id))
 
-#define for_each_element_extid(element, extid, data, datalen)          \
-       for_each_element(element, data, datalen)                        \
+#define for_each_element_extid(element, extid, _data, _datalen)                \
+       for_each_element(element, _data, _datalen)                      \
                if (element->id == WLAN_EID_EXTENSION &&                \
                    element->datalen > 0 &&                             \
                    element->data[0] == (extid))
@@ -3222,7 +3262,7 @@ struct element {
 static inline bool for_each_element_completed(const struct element *element,
                                              const void *data, size_t datalen)
 {
-       return (u8 *)element == (u8 *)data + datalen;
+       return (const u8 *)element == (const u8 *)data + datalen;
 }
 
 #endif /* __LINUX_IEEE80211_H */