ieee80211: remove function ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}
[carl9170fw.git] / include / linux / ieee80211.h
index a334caffc4a0510e3d709dee3681c00c152fe228..3dc381897049938be9579974617dc63961c59ef5 100644 (file)
@@ -143,6 +143,7 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
 #define IEEE80211_MAX_RTS_THRESHOLD    2353
 #define IEEE80211_MAX_AID              2007
 #define IEEE80211_MAX_TIM_LEN          251
+#define IEEE80211_MAX_MESH_PEERINGS    63
 /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
    6.2.1.1.2.
 
@@ -602,6 +603,20 @@ static inline unsigned int ieee80211_hdrlen(__le16 fc)
         return hdrlen;
 }
 
+/**
+ * ieee80211_is_bufferable_mmpdu - check if frame is bufferable MMPDU
+ * @fc: frame control field in little-endian byteorder
+ */
+static inline bool ieee80211_is_bufferable_mmpdu(__le16 fc)
+{
+       /* IEEE 802.11-2012, definition of "bufferable management frame";
+        * note that this ignores the IBSS special case. */
+       return ieee80211_is_mgmt(fc) &&
+              (ieee80211_is_action(fc) ||
+               ieee80211_is_disassoc(fc) ||
+               ieee80211_is_deauth(fc));
+}
+
 /**
  * ieee80211_is_first_frag - check if IEEE80211_SCTL_FRAG is not set
  * @seq_ctrl: frame sequence control bytes in little-endian byteorder
@@ -702,6 +717,18 @@ struct ieee80211_sec_chan_offs_ie {
        u8 sec_chan_offs;
 } __packed;
 
+/**
+ * struct ieee80211_mesh_chansw_params_ie - mesh channel switch parameters IE
+ *
+ * This structure represents the "Mesh Channel Switch Paramters element"
+ */
+struct ieee80211_mesh_chansw_params_ie {
+       u8 mesh_ttl;
+       u8 mesh_flags;
+       __le16 mesh_reason;
+       __le16 mesh_pre_value;
+} __packed;
+
 /**
  * struct ieee80211_wide_bw_chansw_ie - wide bandwidth channel switch IE
  */
@@ -753,6 +780,14 @@ enum mesh_config_capab_flags {
        IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING         = 0x20,
 };
 
+/**
+ * mesh channel switch parameters element's flag indicator
+ *
+ */
+#define WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT BIT(0)
+#define WLAN_EID_CHAN_SWITCH_PARAM_INITIATOR BIT(1)
+#define WLAN_EID_CHAN_SWITCH_PARAM_REASON BIT(2)
+
 /**
  * struct ieee80211_rann_ie
  *
@@ -1410,8 +1445,12 @@ struct ieee80211_vht_operation {
 #define IEEE80211_VHT_CAP_RXSTBC_MASK                          0x00000700
 #define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE                        0x00000800
 #define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE                        0x00001000
-#define IEEE80211_VHT_CAP_BEAMFORMER_ANTENNAS_MAX              0x00006000
-#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MAX              0x00030000
+#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT                  13
+#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK                  \
+               (7 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT)
+#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT            16
+#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK             \
+               (7 << IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT)
 #define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE                        0x00080000
 #define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE                        0x00100000
 #define IEEE80211_VHT_CAP_VHT_TXOP_PS                          0x00200000
@@ -1631,51 +1670,22 @@ enum ieee80211_reasoncode {
 enum ieee80211_eid {
        WLAN_EID_SSID = 0,
        WLAN_EID_SUPP_RATES = 1,
-       WLAN_EID_FH_PARAMS = 2,
+       WLAN_EID_FH_PARAMS = 2, /* reserved now */
        WLAN_EID_DS_PARAMS = 3,
        WLAN_EID_CF_PARAMS = 4,
        WLAN_EID_TIM = 5,
        WLAN_EID_IBSS_PARAMS = 6,
-       WLAN_EID_CHALLENGE = 16,
-
        WLAN_EID_COUNTRY = 7,
        WLAN_EID_HP_PARAMS = 8,
        WLAN_EID_HP_TABLE = 9,
        WLAN_EID_REQUEST = 10,
-
        WLAN_EID_QBSS_LOAD = 11,
        WLAN_EID_EDCA_PARAM_SET = 12,
        WLAN_EID_TSPEC = 13,
        WLAN_EID_TCLAS = 14,
        WLAN_EID_SCHEDULE = 15,
-       WLAN_EID_TS_DELAY = 43,
-       WLAN_EID_TCLAS_PROCESSING = 44,
-       WLAN_EID_QOS_CAPA = 46,
-       /* 802.11z */
-       WLAN_EID_LINK_ID = 101,
-       /* 802.11s */
-       WLAN_EID_MESH_CONFIG = 113,
-       WLAN_EID_MESH_ID = 114,
-       WLAN_EID_LINK_METRIC_REPORT = 115,
-       WLAN_EID_CONGESTION_NOTIFICATION = 116,
-       WLAN_EID_PEER_MGMT = 117,
-       WLAN_EID_CHAN_SWITCH_PARAM = 118,
-       WLAN_EID_MESH_AWAKE_WINDOW = 119,
-       WLAN_EID_BEACON_TIMING = 120,
-       WLAN_EID_MCCAOP_SETUP_REQ = 121,
-       WLAN_EID_MCCAOP_SETUP_RESP = 122,
-       WLAN_EID_MCCAOP_ADVERT = 123,
-       WLAN_EID_MCCAOP_TEARDOWN = 124,
-       WLAN_EID_GANN = 125,
-       WLAN_EID_RANN = 126,
-       WLAN_EID_PREQ = 130,
-       WLAN_EID_PREP = 131,
-       WLAN_EID_PERR = 132,
-       WLAN_EID_PXU = 137,
-       WLAN_EID_PXUC = 138,
-       WLAN_EID_AUTH_MESH_PEER_EXCH = 139,
-       WLAN_EID_MIC = 140,
-
+       WLAN_EID_CHALLENGE = 16,
+       /* 17-31 reserved for challenge text extension */
        WLAN_EID_PWR_CONSTRAINT = 32,
        WLAN_EID_PWR_CAPABILITY = 33,
        WLAN_EID_TPC_REQUEST = 34,
@@ -1686,62 +1696,114 @@ enum ieee80211_eid {
        WLAN_EID_MEASURE_REPORT = 39,
        WLAN_EID_QUIET = 40,
        WLAN_EID_IBSS_DFS = 41,
-
        WLAN_EID_ERP_INFO = 42,
-       WLAN_EID_EXT_SUPP_RATES = 50,
-
+       WLAN_EID_TS_DELAY = 43,
+       WLAN_EID_TCLAS_PROCESSING = 44,
        WLAN_EID_HT_CAPABILITY = 45,
-       WLAN_EID_HT_OPERATION = 61,
-       WLAN_EID_SECONDARY_CHANNEL_OFFSET = 62,
-
+       WLAN_EID_QOS_CAPA = 46,
+       /* 47 reserved for Broadcom */
        WLAN_EID_RSN = 48,
-       WLAN_EID_MMIE = 76,
-       WLAN_EID_VENDOR_SPECIFIC = 221,
-       WLAN_EID_QOS_PARAMETER = 222,
-
+       WLAN_EID_802_15_COEX = 49,
+       WLAN_EID_EXT_SUPP_RATES = 50,
        WLAN_EID_AP_CHAN_REPORT = 51,
        WLAN_EID_NEIGHBOR_REPORT = 52,
        WLAN_EID_RCPI = 53,
+       WLAN_EID_MOBILITY_DOMAIN = 54,
+       WLAN_EID_FAST_BSS_TRANSITION = 55,
+       WLAN_EID_TIMEOUT_INTERVAL = 56,
+       WLAN_EID_RIC_DATA = 57,
+       WLAN_EID_DSE_REGISTERED_LOCATION = 58,
+       WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59,
+       WLAN_EID_EXT_CHANSWITCH_ANN = 60,
+       WLAN_EID_HT_OPERATION = 61,
+       WLAN_EID_SECONDARY_CHANNEL_OFFSET = 62,
        WLAN_EID_BSS_AVG_ACCESS_DELAY = 63,
        WLAN_EID_ANTENNA_INFO = 64,
        WLAN_EID_RSNI = 65,
        WLAN_EID_MEASUREMENT_PILOT_TX_INFO = 66,
        WLAN_EID_BSS_AVAILABLE_CAPACITY = 67,
        WLAN_EID_BSS_AC_ACCESS_DELAY = 68,
+       WLAN_EID_TIME_ADVERTISEMENT = 69,
        WLAN_EID_RRM_ENABLED_CAPABILITIES = 70,
        WLAN_EID_MULTIPLE_BSSID = 71,
        WLAN_EID_BSS_COEX_2040 = 72,
        WLAN_EID_OVERLAP_BSS_SCAN_PARAM = 74,
-       WLAN_EID_EXT_CAPABILITY = 127,
-
-       WLAN_EID_MOBILITY_DOMAIN = 54,
-       WLAN_EID_FAST_BSS_TRANSITION = 55,
-       WLAN_EID_TIMEOUT_INTERVAL = 56,
-       WLAN_EID_RIC_DATA = 57,
        WLAN_EID_RIC_DESCRIPTOR = 75,
-
-       WLAN_EID_DSE_REGISTERED_LOCATION = 58,
-       WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59,
-       WLAN_EID_EXT_CHANSWITCH_ANN = 60,
-
-       WLAN_EID_VHT_CAPABILITY = 191,
-       WLAN_EID_VHT_OPERATION = 192,
-       WLAN_EID_OPMODE_NOTIF = 199,
-       WLAN_EID_WIDE_BW_CHANNEL_SWITCH = 194,
-       WLAN_EID_CHANNEL_SWITCH_WRAPPER = 196,
-
-       /* 802.11ad */
+       WLAN_EID_MMIE = 76,
+       WLAN_EID_ASSOC_COMEBACK_TIME = 77,
+       WLAN_EID_EVENT_REQUEST = 78,
+       WLAN_EID_EVENT_REPORT = 79,
+       WLAN_EID_DIAGNOSTIC_REQUEST = 80,
+       WLAN_EID_DIAGNOSTIC_REPORT = 81,
+       WLAN_EID_LOCATION_PARAMS = 82,
        WLAN_EID_NON_TX_BSSID_CAP =  83,
+       WLAN_EID_SSID_LIST = 84,
+       WLAN_EID_MULTI_BSSID_IDX = 85,
+       WLAN_EID_FMS_DESCRIPTOR = 86,
+       WLAN_EID_FMS_REQUEST = 87,
+       WLAN_EID_FMS_RESPONSE = 88,
+       WLAN_EID_QOS_TRAFFIC_CAPA = 89,
+       WLAN_EID_BSS_MAX_IDLE_PERIOD = 90,
+       WLAN_EID_TSF_REQUEST = 91,
+       WLAN_EID_TSF_RESPOSNE = 92,
+       WLAN_EID_WNM_SLEEP_MODE = 93,
+       WLAN_EID_TIM_BCAST_REQ = 94,
+       WLAN_EID_TIM_BCAST_RESP = 95,
+       WLAN_EID_COLL_IF_REPORT = 96,
+       WLAN_EID_CHANNEL_USAGE = 97,
+       WLAN_EID_TIME_ZONE = 98,
+       WLAN_EID_DMS_REQUEST = 99,
+       WLAN_EID_DMS_RESPONSE = 100,
+       WLAN_EID_LINK_ID = 101,
+       WLAN_EID_WAKEUP_SCHEDUL = 102,
+       /* 103 reserved */
+       WLAN_EID_CHAN_SWITCH_TIMING = 104,
+       WLAN_EID_PTI_CONTROL = 105,
+       WLAN_EID_PU_BUFFER_STATUS = 106,
+       WLAN_EID_INTERWORKING = 107,
+       WLAN_EID_ADVERTISEMENT_PROTOCOL = 108,
+       WLAN_EID_EXPEDITED_BW_REQ = 109,
+       WLAN_EID_QOS_MAP_SET = 110,
+       WLAN_EID_ROAMING_CONSORTIUM = 111,
+       WLAN_EID_EMERGENCY_ALERT = 112,
+       WLAN_EID_MESH_CONFIG = 113,
+       WLAN_EID_MESH_ID = 114,
+       WLAN_EID_LINK_METRIC_REPORT = 115,
+       WLAN_EID_CONGESTION_NOTIFICATION = 116,
+       WLAN_EID_PEER_MGMT = 117,
+       WLAN_EID_CHAN_SWITCH_PARAM = 118,
+       WLAN_EID_MESH_AWAKE_WINDOW = 119,
+       WLAN_EID_BEACON_TIMING = 120,
+       WLAN_EID_MCCAOP_SETUP_REQ = 121,
+       WLAN_EID_MCCAOP_SETUP_RESP = 122,
+       WLAN_EID_MCCAOP_ADVERT = 123,
+       WLAN_EID_MCCAOP_TEARDOWN = 124,
+       WLAN_EID_GANN = 125,
+       WLAN_EID_RANN = 126,
+       WLAN_EID_EXT_CAPABILITY = 127,
+       /* 128, 129 reserved for Agere */
+       WLAN_EID_PREQ = 130,
+       WLAN_EID_PREP = 131,
+       WLAN_EID_PERR = 132,
+       /* 133-136 reserved for Cisco */
+       WLAN_EID_PXU = 137,
+       WLAN_EID_PXUC = 138,
+       WLAN_EID_AUTH_MESH_PEER_EXCH = 139,
+       WLAN_EID_MIC = 140,
+       WLAN_EID_DESTINATION_URI = 141,
+       WLAN_EID_UAPSD_COEX = 142,
        WLAN_EID_WAKEUP_SCHEDULE = 143,
        WLAN_EID_EXT_SCHEDULE = 144,
        WLAN_EID_STA_AVAILABILITY = 145,
        WLAN_EID_DMG_TSPEC = 146,
        WLAN_EID_DMG_AT = 147,
        WLAN_EID_DMG_CAP = 148,
+       /* 149-150 reserved for Cisco */
        WLAN_EID_DMG_OPERATION = 151,
        WLAN_EID_DMG_BSS_PARAM_CHANGE = 152,
        WLAN_EID_DMG_BEAM_REFINEMENT = 153,
        WLAN_EID_CHANNEL_MEASURE_FEEDBACK = 154,
+       /* 155-156 reserved for Cisco */
        WLAN_EID_AWAKE_WINDOW = 157,
        WLAN_EID_MULTI_BAND = 158,
        WLAN_EID_ADDBA_EXT = 159,
@@ -1758,11 +1820,34 @@ enum ieee80211_eid {
        WLAN_EID_MULTIPLE_MAC_ADDR = 170,
        WLAN_EID_U_PID = 171,
        WLAN_EID_DMG_LINK_ADAPT_ACK = 172,
+       /* 173 reserved for Symbol */
+       WLAN_EID_MCCAOP_ADV_OVERVIEW = 174,
        WLAN_EID_QUIET_PERIOD_REQ = 175,
+       /* 176 reserved for Symbol */
        WLAN_EID_QUIET_PERIOD_RESP = 177,
+       /* 178-179 reserved for Symbol */
+       /* 180 reserved for ISO/IEC 20011 */
        WLAN_EID_EPAC_POLICY = 182,
        WLAN_EID_CLISTER_TIME_OFF = 183,
+       WLAN_EID_INTER_AC_PRIO = 184,
+       WLAN_EID_SCS_DESCRIPTOR = 185,
+       WLAN_EID_QLOAD_REPORT = 186,
+       WLAN_EID_HCCA_TXOP_UPDATE_COUNT = 187,
+       WLAN_EID_HL_STREAM_ID = 188,
+       WLAN_EID_GCR_GROUP_ADDR = 189,
        WLAN_EID_ANTENNA_SECTOR_ID_PATTERN = 190,
+       WLAN_EID_VHT_CAPABILITY = 191,
+       WLAN_EID_VHT_OPERATION = 192,
+       WLAN_EID_EXTENDED_BSS_LOAD = 193,
+       WLAN_EID_WIDE_BW_CHANNEL_SWITCH = 194,
+       WLAN_EID_VHT_TX_POWER_ENVELOPE = 195,
+       WLAN_EID_CHANNEL_SWITCH_WRAPPER = 196,
+       WLAN_EID_AID = 197,
+       WLAN_EID_QUIET_CHANNEL = 198,
+       WLAN_EID_OPMODE_NOTIF = 199,
+
+       WLAN_EID_VENDOR_SPECIFIC = 221,
+       WLAN_EID_QOS_PARAMETER = 222,
 };
 
 /* Action category code */
@@ -1848,6 +1933,7 @@ enum ieee80211_key_len {
        WLAN_KEY_LEN_CCMP = 16,
        WLAN_KEY_LEN_TKIP = 32,
        WLAN_KEY_LEN_AES_CMAC = 16,
+       WLAN_KEY_LEN_SMS4 = 32,
 };
 
 #define IEEE80211_WEP_IV_LEN           4
@@ -1880,6 +1966,11 @@ enum ieee80211_tdls_actioncode {
        WLAN_TDLS_DISCOVERY_REQUEST = 10,
 };
 
+/* Interworking capabilities are set in 7th bit of 4th byte of the
+ * @WLAN_EID_EXT_CAPABILITY information element
+ */
+#define WLAN_EXT_CAPA4_INTERWORKING_ENABLED    BIT(7)
+
 /*
  * TDLS capabililites to be enabled in the 5th byte of the
  * @WLAN_EID_EXT_CAPABILITY information element
@@ -1888,6 +1979,7 @@ enum ieee80211_tdls_actioncode {
 #define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6)
 
 #define WLAN_EXT_CAPA8_OPMODE_NOTIF    BIT(6)
+#define WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLED    BIT(7)
 
 /* TDLS specific payload type in the LLC/SNAP header */
 #define WLAN_TDLS_SNAP_RFTYPE  0x2
@@ -2221,42 +2313,6 @@ static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr,
        return mgmt->u.action.category == WLAN_CATEGORY_PUBLIC;
 }
 
-/**
- * ieee80211_dsss_chan_to_freq - get channel center frequency
- * @channel: the DSSS channel
- *
- * Convert IEEE802.11 DSSS channel to the center frequency (MHz).
- * Ref IEEE 802.11-2007 section 15.6
- */
-static inline int ieee80211_dsss_chan_to_freq(int channel)
-{
-       if ((channel > 0) && (channel < 14))
-               return 2407 + (channel * 5);
-       else if (channel == 14)
-               return 2484;
-       else
-               return -1;
-}
-
-/**
- * ieee80211_freq_to_dsss_chan - get channel
- * @freq: the frequency
- *
- * Convert frequency (MHz) to IEEE802.11 DSSS channel
- * Ref IEEE 802.11-2007 section 15.6
- *
- * This routine selects the channel with the closest center frequency.
- */
-static inline int ieee80211_freq_to_dsss_chan(int freq)
-{
-       if ((freq >= 2410) && (freq < 2475))
-               return (freq - 2405) / 5;
-       else if ((freq >= 2482) && (freq < 2487))
-               return 14;
-       else
-               return -1;
-}
-
 /**
  * ieee80211_tu_to_usec - convert time units (TU) to microseconds
  * @tu: the TUs
@@ -2296,4 +2352,8 @@ static inline bool ieee80211_check_tim(const struct ieee80211_tim_ie *tim,
        return !!(tim->virtual_map[indexn0] & mask);
 }
 
+/* convert time units */
+#define TU_TO_JIFFIES(x)       (usecs_to_jiffies((x) * 1024))
+#define TU_TO_EXP_TIME(x)      (jiffies + TU_TO_JIFFIES(x))
+
 #endif /* __LINUX_IEEE80211_H */