wireless: unify QoS control field definitions
[carl9170fw.git] / include / linux / ieee80211.h
index 2be159d248d0e374c49f31074840678e6bea87ee..d1c00535c02fd634fd001b4894743a2cd376ccd4 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)
@@ -1032,6 +1043,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)
@@ -1444,9 +1464,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
@@ -1545,6 +1562,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;
        }