mac80211: add parsing of TDLS specific IEs
[carl9170fw.git] / include / linux / ieee80211.h
index 7507311556c37e95b855001eaaf92a63063306bb..64d65a673ac14142026ac6469987776e8421d31b 100644 (file)
@@ -6,6 +6,7 @@
  * Copyright (c) 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
  * Copyright (c) 2005, Devicescape Software, Inc.
  * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net>
+ * Copyright (c) 2013 - 2014 Intel Mobile Communications GmbH
  *
  * 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
@@ -161,8 +162,12 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
 
 #define IEEE80211_MAX_MESH_ID_LEN      32
 
+#define IEEE80211_FIRST_TSPEC_TSID     8
 #define IEEE80211_NUM_TIDS             16
 
+/* number of user priorities 802.11 uses */
+#define IEEE80211_NUM_UPS              8
+
 #define IEEE80211_QOS_CTL_LEN          2
 /* 1d tag mask */
 #define IEEE80211_QOS_CTL_TAG1D_MASK           0x0007
@@ -842,6 +847,16 @@ enum ieee80211_vht_opmode_bits {
 
 #define WLAN_SA_QUERY_TR_ID_LEN 2
 
+/**
+ * struct ieee80211_tpc_report_ie
+ *
+ * This structure refers to "TPC Report element"
+ */
+struct ieee80211_tpc_report_ie {
+       u8 tx_power;
+       u8 link_margin;
+} __packed;
+
 struct ieee80211_mgmt {
        __le16 frame_control;
        __le16 duration;
@@ -977,6 +992,13 @@ struct ieee80211_mgmt {
                                        u8 action_code;
                                        u8 operating_mode;
                                } __packed vht_opmode_notif;
+                               struct {
+                                       u8 action_code;
+                                       u8 dialog_token;
+                                       u8 tpc_elem_id;
+                                       u8 tpc_elem_length;
+                                       struct ieee80211_tpc_report_ie tpc;
+                               } __packed tpc_report;
                        } u;
                } __packed action;
        } u;
@@ -1005,6 +1027,26 @@ struct ieee80211_vendor_ie {
        u8 oui_type;
 } __packed;
 
+struct ieee80211_wmm_ac_param {
+       u8 aci_aifsn; /* AIFSN, ACM, ACI */
+       u8 cw; /* ECWmin, ECWmax (CW = 2^ECW - 1) */
+       __le16 txop_limit;
+} __packed;
+
+struct ieee80211_wmm_param_ie {
+       u8 element_id; /* Element ID: 221 (0xdd); */
+       u8 len; /* Length: 24 */
+       /* required fields for WMM version 1 */
+       u8 oui[3]; /* 00:50:f2 */
+       u8 oui_type; /* 2 */
+       u8 oui_subtype; /* 1 */
+       u8 version; /* 1 for WMM version 1.0 */
+       u8 qos_info; /* AP/STA specific QoS info */
+       u8 reserved; /* 0 */
+       /* AC_BE, AC_BK, AC_VI, AC_VO */
+       struct ieee80211_wmm_ac_param ac[4];
+} __packed;
+
 /* Control frames */
 struct ieee80211_rts {
        __le16 frame_control;
@@ -1028,6 +1070,12 @@ struct ieee80211_pspoll {
 
 /* TDLS */
 
+/* Channel switch timing */
+struct ieee80211_ch_switch_timing {
+       __le16 switch_time;
+       __le16 switch_timeout;
+} __packed;
+
 /* Link-id information element */
 struct ieee80211_tdls_lnkie {
        u8 ie_type; /* Link Identifier IE */
@@ -1069,6 +1117,15 @@ struct ieee80211_tdls_data {
                        u8 dialog_token;
                        u8 variable[0];
                } __packed discover_req;
+               struct {
+                       u8 target_channel;
+                       u8 oper_class;
+                       u8 variable[0];
+               } __packed chan_switch_req;
+               struct {
+                       __le16 status_code;
+                       u8 variable[0];
+               } __packed chan_switch_resp;
        } u;
 } __packed;
 
@@ -1253,7 +1310,7 @@ struct ieee80211_ht_cap {
 #define                IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT   2
 
 /*
- * Maximum length of AMPDU that the STA can receive.
+ * Maximum length of AMPDU that the STA can receive in high-throughput (HT).
  * Length = 2 ^ (13 + max_ampdu_length_exp) - 1 (octets)
  */
 enum ieee80211_max_ampdu_length_exp {
@@ -1263,6 +1320,21 @@ enum ieee80211_max_ampdu_length_exp {
        IEEE80211_HT_MAX_AMPDU_64K = 3
 };
 
+/*
+ * Maximum length of AMPDU that the STA can receive in VHT.
+ * Length = 2 ^ (13 + max_ampdu_length_exp) - 1 (octets)
+ */
+enum ieee80211_vht_max_ampdu_length_exp {
+       IEEE80211_VHT_MAX_AMPDU_8K = 0,
+       IEEE80211_VHT_MAX_AMPDU_16K = 1,
+       IEEE80211_VHT_MAX_AMPDU_32K = 2,
+       IEEE80211_VHT_MAX_AMPDU_64K = 3,
+       IEEE80211_VHT_MAX_AMPDU_128K = 4,
+       IEEE80211_VHT_MAX_AMPDU_256K = 5,
+       IEEE80211_VHT_MAX_AMPDU_512K = 6,
+       IEEE80211_VHT_MAX_AMPDU_1024K = 7
+};
+
 #define IEEE80211_HT_MAX_AMPDU_FACTOR 13
 
 /* Minimum MPDU start spacing */
@@ -1641,6 +1713,9 @@ enum ieee80211_reasoncode {
        WLAN_REASON_INVALID_RSN_IE_CAP = 22,
        WLAN_REASON_IEEE8021X_FAILED = 23,
        WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
+       /* TDLS (802.11z) */
+       WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE = 25,
+       WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED = 26,
        /* 802.11e */
        WLAN_REASON_DISASSOC_UNSPECIFIED_QOS = 32,
        WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH = 33,
@@ -1731,6 +1806,7 @@ enum ieee80211_eid {
        WLAN_EID_RRM_ENABLED_CAPABILITIES = 70,
        WLAN_EID_MULTIPLE_BSSID = 71,
        WLAN_EID_BSS_COEX_2040 = 72,
+       WLAN_EID_BSS_INTOLERANT_CHL_REPORT = 73,
        WLAN_EID_OVERLAP_BSS_SCAN_PARAM = 74,
        WLAN_EID_RIC_DESCRIPTOR = 75,
        WLAN_EID_MMIE = 76,
@@ -1802,7 +1878,8 @@ enum ieee80211_eid {
        WLAN_EID_DMG_TSPEC = 146,
        WLAN_EID_DMG_AT = 147,
        WLAN_EID_DMG_CAP = 148,
-       /* 149-150 reserved for Cisco */
+       /* 149 reserved for Cisco */
+       WLAN_EID_CISCO_VENDOR_SPECIFIC = 150,
        WLAN_EID_DMG_OPERATION = 151,
        WLAN_EID_DMG_BSS_PARAM_CHANGE = 152,
        WLAN_EID_DMG_BEAM_REFINEMENT = 153,
@@ -1861,6 +1938,7 @@ enum ieee80211_category {
        WLAN_CATEGORY_DLS = 2,
        WLAN_CATEGORY_BACK = 3,
        WLAN_CATEGORY_PUBLIC = 4,
+       WLAN_CATEGORY_RADIO_MEASUREMENT = 5,
        WLAN_CATEGORY_HT = 7,
        WLAN_CATEGORY_SA_QUERY = 8,
        WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9,
@@ -1970,6 +2048,16 @@ enum ieee80211_tdls_actioncode {
        WLAN_TDLS_DISCOVERY_REQUEST = 10,
 };
 
+/* Extended Channel Switching capability to be set in the 1st byte of
+ * the @WLAN_EID_EXT_CAPABILITY information element
+ */
+#define WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING   BIT(2)
+
+/* 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)
+#define WLAN_EXT_CAPA4_TDLS_CHAN_SWITCH                BIT(6)
+
 /* Interworking capabilities are set in 7th bit of 4th byte of the
  * @WLAN_EID_EXT_CAPABILITY information element
  */
@@ -1981,6 +2069,7 @@ enum ieee80211_tdls_actioncode {
  */
 #define WLAN_EXT_CAPA5_TDLS_ENABLED    BIT(5)
 #define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6)
+#define WLAN_EXT_CAPA5_TDLS_CH_SW_PROHIBITED   BIT(7)
 
 #define WLAN_EXT_CAPA8_OPMODE_NOTIF    BIT(6)
 #define WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLED    BIT(7)
@@ -1988,6 +2077,9 @@ enum ieee80211_tdls_actioncode {
 /* TDLS specific payload type in the LLC/SNAP header */
 #define WLAN_TDLS_SNAP_RFTYPE  0x2
 
+/* BSS Coex IE information field bits */
+#define WLAN_BSS_COEX_INFORMATION_REQUEST      BIT(0)
+
 /**
  * enum - mesh synchronization method identifier
  *