wireless: Introduce defines for BAR TID_INFO & MULTI_TID fields
[carl9170fw.git] / include / linux / ieee80211.h
index 4fd6532bef45796e83ca2a3ceb45236ee3caf815..412722af9fc5cc3a9c2a232498452f0ce8437fc8 100644 (file)
 #define IEEE80211_MAX_MESH_ID_LEN      32
 
 #define IEEE80211_QOS_CTL_LEN          2
-#define IEEE80211_QOS_CTL_TID_MASK     0x000F
-#define IEEE80211_QOS_CTL_TAG1D_MASK   0x0007
+/* 1d tag mask */
+#define IEEE80211_QOS_CTL_TAG1D_MASK           0x0007
+/* TID mask */
+#define IEEE80211_QOS_CTL_TID_MASK             0x000f
+/* EOSP */
+#define IEEE80211_QOS_CTL_EOSP                 0x0010
+/* ACK policy */
+#define IEEE80211_QOS_CTL_ACK_POLICY_NORMAL    0x0000
+#define IEEE80211_QOS_CTL_ACK_POLICY_NOACK     0x0020
+#define IEEE80211_QOS_CTL_ACK_POLICY_NO_EXPL   0x0040
+#define IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK  0x0060
+/* A-MSDU 802.11n */
+#define IEEE80211_QOS_CTL_A_MSDU_PRESENT       0x0080
 
 /* U-APSD queue for WMM IEs sent by AP */
 #define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD      (1<<7)
@@ -818,9 +829,11 @@ struct ieee80211_bar {
 } __attribute__((packed)) __aligned(4);
 
 /* 802.11 BA(R) control masks */
-#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL     0x0000
-#define IEEE80211_BAR_CTRL_MULTI_TID            0x0002
-#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA  0x0004
+#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL   0x0000
+#define IEEE80211_BAR_CTRL_MULTI_TID           0x0002
+#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA        0x0004
+#define IEEE80211_BAR_CTRL_TID_INFO_MASK       0xf000
+#define IEEE80211_BAR_CTRL_TID_INFO_SHIFT      12
 
 /**
  * struct ieee80211_ba - HT Block Ack
@@ -914,6 +927,15 @@ struct ieee80211_ht_cap {
 #define IEEE80211_HT_CAP_40MHZ_INTOLERANT      0x4000
 #define IEEE80211_HT_CAP_LSIG_TXOP_PROT                0x8000
 
+/* 802.11n HT extended capabilities masks (for extended_ht_cap_info) */
+#define IEEE80211_HT_EXT_CAP_PCO               0x0001
+#define IEEE80211_HT_EXT_CAP_PCO_TIME          0x0006
+#define                IEEE80211_HT_EXT_CAP_PCO_TIME_SHIFT     1
+#define IEEE80211_HT_EXT_CAP_MCS_FB            0x0300
+#define                IEEE80211_HT_EXT_CAP_MCS_FB_SHIFT       8
+#define IEEE80211_HT_EXT_CAP_HTC_SUP           0x0400
+#define IEEE80211_HT_EXT_CAP_RD_RESPONDER      0x0800
+
 /* 802.11n HT capability AMPDU settings (for ampdu_params_info) */
 #define IEEE80211_HT_AMPDU_PARM_FACTOR         0x03
 #define IEEE80211_HT_AMPDU_PARM_DENSITY                0x1C
@@ -1023,6 +1045,15 @@ struct ieee80211_ht_info {
 
 #define WLAN_CAPABILITY_ESS            (1<<0)
 #define WLAN_CAPABILITY_IBSS           (1<<1)
+
+/*
+ * A mesh STA sets the ESS and IBSS capability bits to zero.
+ * however, this holds true for p2p probe responses (in the p2p_find
+ * phase) as well.
+ */
+#define WLAN_CAPABILITY_IS_STA_BSS(cap)        \
+       (!((cap) & (WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_IBSS)))
+
 #define WLAN_CAPABILITY_CF_POLLABLE    (1<<2)
 #define WLAN_CAPABILITY_CF_POLL_REQUEST        (1<<3)
 #define WLAN_CAPABILITY_PRIVACY                (1<<4)
@@ -1282,9 +1313,8 @@ enum ieee80211_category {
        WLAN_CATEGORY_MULTIHOP_ACTION = 14,
        WLAN_CATEGORY_SELF_PROTECTED = 15,
        WLAN_CATEGORY_WMM = 17,
-       /* TODO: remove MESH_PLINK and MESH_PATH_SEL after */
-       /*       mesh is updated to current 802.11s draft  */
-       WLAN_CATEGORY_MESH_PLINK = 30,
+       /* TODO: remove MESH_PATH_SEL after mesh is updated
+        * to current 802.11s draft  */
        WLAN_CATEGORY_MESH_PATH_SEL = 32,
        WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
        WLAN_CATEGORY_VENDOR_SPECIFIC = 127,
@@ -1355,6 +1385,9 @@ enum {
 /* Although the spec says 8 I'm seeing 6 in practice */
 #define IEEE80211_COUNTRY_IE_MIN_LEN   6
 
+/* The Country String field of the element shall be 3 octets in length */
+#define IEEE80211_COUNTRY_STRING_LEN   3
+
 /*
  * For regulatory extension stuff see IEEE 802.11-2007
  * Annex I (page 1141) and Annex J (page 1147). Also
@@ -1433,9 +1466,6 @@ enum ieee80211_sa_query_action {
 };
 
 
-/* A-MSDU 802.11n */
-#define IEEE80211_QOS_CONTROL_A_MSDU_PRESENT 0x0080
-
 /* cipher suite selectors */
 #define WLAN_CIPHER_SUITE_USE_GROUP    0x000FAC00
 #define WLAN_CIPHER_SUITE_WEP40                0x000FAC01
@@ -1455,6 +1485,43 @@ enum ieee80211_sa_query_action {
 
 #define WLAN_PMKID_LEN                 16
 
+/*
+ * WMM/802.11e Tspec Element
+ */
+#define IEEE80211_WMM_IE_TSPEC_TID_MASK                0x0F
+#define IEEE80211_WMM_IE_TSPEC_TID_SHIFT       1
+
+enum ieee80211_tspec_status_code {
+       IEEE80211_TSPEC_STATUS_ADMISS_ACCEPTED = 0,
+       IEEE80211_TSPEC_STATUS_ADDTS_INVAL_PARAMS = 0x1,
+};
+
+struct ieee80211_tspec_ie {
+       u8 element_id;
+       u8 len;
+       u8 oui[3];
+       u8 oui_type;
+       u8 oui_subtype;
+       u8 version;
+       __le16 tsinfo;
+       u8 tsinfo_resvd;
+       __le16 nominal_msdu;
+       __le16 max_msdu;
+       __le32 min_service_int;
+       __le32 max_service_int;
+       __le32 inactivity_int;
+       __le32 suspension_int;
+       __le32 service_start_time;
+       __le32 min_data_rate;
+       __le32 mean_data_rate;
+       __le32 peak_data_rate;
+       __le32 max_burst_size;
+       __le32 delay_bound;
+       __le32 min_phy_rate;
+       __le16 sba;
+       __le16 medium_time;
+} __packed;
+
 /**
  * ieee80211_get_qos_ctl - get pointer to qos control bytes
  * @hdr: the frame
@@ -1534,6 +1601,7 @@ static inline bool ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr)
                category = ((u8 *) hdr) + 24;
                return *category != WLAN_CATEGORY_PUBLIC &&
                        *category != WLAN_CATEGORY_HT &&
+                       *category != WLAN_CATEGORY_SELF_PROTECTED &&
                        *category != WLAN_CATEGORY_VENDOR_SPECIFIC;
        }