Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kanchanapally, Vidyullatha | 3f3b654 | 2015-08-21 14:38:49 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. |
AnjaneeDevi Kapparapu | 24b52ff | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
Gopichand Nakkala | 9c070ad | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
AnjaneeDevi Kapparapu | 24b52ff | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
Gopichand Nakkala | 9c070ad | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 28 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 29 | * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 30 | * This file sirMacPropExts.h contains the MAC protocol |
| 31 | * extensions to support ANI feature set. |
| 32 | * Author: Chandra Modumudi |
| 33 | * Date: 11/27/02 |
| 34 | * History:- |
| 35 | * Date Modified by Modification Information |
| 36 | * -------------------------------------------------------------------- |
Jeff Johnson | da6d749 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 37 | * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 38 | */ |
| 39 | #ifndef __MAC_PROP_EXTS_H |
| 40 | #define __MAC_PROP_EXTS_H |
| 41 | |
| 42 | #include "sirTypes.h" |
| 43 | #include "sirApi.h" |
| 44 | #include "aniSystemDefs.h" |
| 45 | |
| 46 | /// EID (Element ID) definitions |
| 47 | |
| 48 | // Proprietary IEs |
| 49 | |
| 50 | // Types definitions used within proprietary IE |
| 51 | #define SIR_MAC_PROP_EXT_RATES_TYPE 0 |
| 52 | #define SIR_MAC_PROP_AP_NAME_TYPE 1 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 53 | #define SIR_MAC_PROP_LOAD_INFO_TYPE 6 |
| 54 | #define SIR_MAC_PROP_ASSOC_TYPE 7 |
| 55 | #define SIR_MAC_PROP_LOAD_BALANCE_TYPE 8 |
| 56 | #define SIR_MAC_PROP_LL_ATTR_TYPE 9 |
| 57 | #define SIR_MAC_PROP_CAPABILITY 10 // proprietary capabilities |
| 58 | #define SIR_MAC_PROP_VERSION 11 // version info |
| 59 | #define SIR_MAC_PROP_EDCAPARAMS 12 // edca params for 11e and wme |
| 60 | #define SIR_MAC_PROP_SRCMAC 13 // sender's mac address |
| 61 | #define SIR_MAC_PROP_TITAN 14 // Advertises a TITAN device |
| 62 | #define SIR_MAC_PROP_CHANNEL_SWITCH 15 // proprietary channel switch info |
| 63 | #define SIR_MAC_PROP_QUIET_BSS 16 // Broadcast's REQ for Quiet BSS |
| 64 | #define SIR_MAC_PROP_TRIG_STA_BK_SCAN 17 // trigger station bk scan during quiet bss duration |
| 65 | #define SIR_MAC_PROP_TAURUS 18 // Advertises a TAURUS device |
| 66 | |
| 67 | // capability ie info |
| 68 | #define SIR_MAC_PROP_CAPABILITY_MIN sizeof(tANI_U16) |
| 69 | |
| 70 | // trigger sta scan ie length defines |
| 71 | #define SIR_MAC_PROP_TRIG_STA_BK_SCAN_EID_MIN 0 |
| 72 | #define SIR_MAC_PROP_TRIG_STA_BK_SCAN_EID_MAX 1 |
| 73 | |
| 74 | // the bit map is also used as a config enable, setting a bit in the |
| 75 | // propIE config variable, enables the corresponding capability in the propIE |
| 76 | // the enables simply result in including the corresponding element in the |
| 77 | // propIE |
| 78 | // Ex: setting the capability bit HCF would result in using the capability bit map for |
| 79 | // hcf instead of including the full HCF element in the IE |
| 80 | // capabilities bit map - bit offsets |
| 81 | // setting 11eQos has effect only if QoS is also enabled. then it overrides |
| 82 | // 11e support and implements it silently (as part of the prop ie) |
| 83 | #define SIR_MAC_PROP_CAPABILITY_HCF WNI_CFG_PROP_CAPABILITY_HCF |
| 84 | #define SIR_MAC_PROP_CAPABILITY_11EQOS WNI_CFG_PROP_CAPABILITY_11EQOS |
| 85 | #define SIR_MAC_PROP_CAPABILITY_WME WNI_CFG_PROP_CAPABILITY_WME |
| 86 | #define SIR_MAC_PROP_CAPABILITY_WSM WNI_CFG_PROP_CAPABILITY_WSM |
| 87 | #define SIR_MAC_PROP_CAPABILITY_EXTRATES WNI_CFG_PROP_CAPABILITY_EXTRATES |
| 88 | // ap->sta only, request STA to stop using prop rates for some time |
| 89 | #define SIR_MAC_PROP_CAPABILITY_EXTRATE_STOP WNI_CFG_PROP_CAPABILITY_EXTRATE_STOP |
| 90 | #define SIR_MAC_PROP_CAPABILITY_TITAN WNI_CFG_PROP_CAPABILITY_TITAN |
| 91 | #define SIR_MAC_PROP_CAPABILITY_TAURUS WNI_CFG_PROP_CAPABILITY_TAURUS |
| 92 | #define SIR_MAC_PROP_CAPABILITY_ESCORT_PKT WNI_CFG_PROP_CAPABILITY_ESCORT_PKT |
| 93 | // unused 9-12 |
| 94 | #define SIR_MAC_PROP_CAPABILITY_EDCAPARAMS WNI_CFG_PROP_CAPABILITY_EDCAPARAMS |
| 95 | #define SIR_MAC_PROP_CAPABILITY_LOADINFO WNI_CFG_PROP_CAPABILITY_LOADINFO |
| 96 | #define SIR_MAC_PROP_CAPABILITY_VERSION WNI_CFG_PROP_CAPABILITY_VERSION |
| 97 | #define SIR_MAC_PROP_CAPABILITY_MAXBITOFFSET WNI_CFG_PROP_CAPABILITY_MAXBITOFFSET |
| 98 | |
| 99 | // macro to set/get a capability bit, bitname is one of HCF/11EQOS/etc... |
| 100 | #define PROP_CAPABILITY_SET(bitname, value) \ |
Madan Mohan Koyyalamudi | a53c4dc | 2012-11-13 10:35:42 -0800 | [diff] [blame] | 101 | ((value) = (value) | ((tANI_U16)(1 << SIR_MAC_PROP_CAPABILITY_ ## bitname))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 102 | |
| 103 | #define PROP_CAPABILITY_RESET(bitname, value) \ |
Madan Mohan Koyyalamudi | a53c4dc | 2012-11-13 10:35:42 -0800 | [diff] [blame] | 104 | ((value) = (value) & ~((tANI_U16)(1 << SIR_MAC_PROP_CAPABILITY_ ## bitname))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 105 | |
| 106 | #define PROP_CAPABILITY_GET(bitname, value) \ |
| 107 | (((value) >> SIR_MAC_PROP_CAPABILITY_ ## bitname) & 1) |
| 108 | |
| 109 | |
| 110 | #define IS_DOT11_MODE_PROPRIETARY(dot11Mode) \ |
| 111 | (((dot11Mode == WNI_CFG_DOT11_MODE_POLARIS) || \ |
| 112 | (dot11Mode == WNI_CFG_DOT11_MODE_TITAN) || \ |
| 113 | (dot11Mode == WNI_CFG_DOT11_MODE_TAURUS) || \ |
| 114 | (dot11Mode == WNI_CFG_DOT11_MODE_ALL)) ? TRUE: FALSE) |
| 115 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 116 | #define IS_DOT11_MODE_HT(dot11Mode) \ |
| 117 | (((dot11Mode == WNI_CFG_DOT11_MODE_11N) || \ |
| 118 | (dot11Mode == WNI_CFG_DOT11_MODE_11N_ONLY) || \ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 119 | (dot11Mode == WNI_CFG_DOT11_MODE_11AC) || \ |
| 120 | (dot11Mode == WNI_CFG_DOT11_MODE_11AC_ONLY) || \ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 121 | (dot11Mode == WNI_CFG_DOT11_MODE_TAURUS) || \ |
| 122 | (dot11Mode == WNI_CFG_DOT11_MODE_ALL)) ? TRUE: FALSE) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 123 | |
| 124 | #ifdef WLAN_FEATURE_11AC |
| 125 | #define IS_DOT11_MODE_VHT(dot11Mode) \ |
| 126 | (((dot11Mode == WNI_CFG_DOT11_MODE_11AC) || \ |
| 127 | (dot11Mode == WNI_CFG_DOT11_MODE_11AC_ONLY) || \ |
| 128 | (dot11Mode == WNI_CFG_DOT11_MODE_TAURUS) || \ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 129 | (dot11Mode == WNI_CFG_DOT11_MODE_ALL)) ? TRUE: FALSE) |
| 130 | #endif |
| 131 | /* |
| 132 | * When Titan capabilities can be turned on based on the |
| 133 | * Proprietary Extensions CFG, then this macro can be used. |
| 134 | * Here Titan capabilities can be turned on for 11G/Gonly/N/NOnly mode also. |
| 135 | */ |
| 136 | #define IS_DOT11_MODE_TITAN_ALLOWED(dot11Mode) \ |
| 137 | (((dot11Mode == WNI_CFG_DOT11_MODE_TITAN) || \ |
| 138 | (dot11Mode == WNI_CFG_DOT11_MODE_TAURUS) || \ |
| 139 | (dot11Mode == WNI_CFG_DOT11_MODE_11G) || \ |
| 140 | (dot11Mode == WNI_CFG_DOT11_MODE_11N) || \ |
| 141 | (dot11Mode == WNI_CFG_DOT11_MODE_ALL)) ? TRUE: FALSE) |
| 142 | |
| 143 | |
| 144 | /* |
| 145 | * When Taurus capabilities can be turned on based on the |
| 146 | * Proprietary Extensions CFG, then this macro can be used. |
| 147 | * Here Taurus capabilities can be turned on for 11N/Nonly mode also. |
| 148 | */ |
| 149 | #define IS_DOT11_MODE_TAURUS_ALLOWED(dot11Mode) \ |
| 150 | (((dot11Mode == WNI_CFG_DOT11_MODE_TAURUS) || \ |
| 151 | (dot11Mode == WNI_CFG_DOT11_MODE_11N) || \ |
| 152 | (dot11Mode == WNI_CFG_DOT11_MODE_ALL)) ? TRUE: FALSE) |
| 153 | |
| 154 | |
| 155 | |
| 156 | #define IS_DOT11_MODE_POLARIS(dot11Mode) IS_DOT11_MODE_PROPRIETARY(dot11Mode) |
| 157 | |
| 158 | #define IS_DOT11_MODE_11B(dot11Mode) \ |
| 159 | ((dot11Mode == WNI_CFG_DOT11_MODE_11B) ? TRUE : FALSE) |
| 160 | |
Kanchanapally, Vidyullatha | 3f3b654 | 2015-08-21 14:38:49 +0530 | [diff] [blame] | 161 | #define IS_BSS_VHT_CAPABLE(vhtCaps) \ |
| 162 | ((vhtCaps).present && \ |
| 163 | ((vhtCaps).rxMCSMap != 0xFFFF) && \ |
| 164 | ((vhtCaps).txMCSMap != 0xFFFF)) |
| 165 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 166 | /// ANI proprietary Status Codes enum |
| 167 | /// (present in Management response frames) |
| 168 | typedef enum eSirMacPropStatusCodes |
| 169 | { |
| 170 | dummy |
| 171 | } tSirMacPropStatusCodes; |
| 172 | |
| 173 | /** |
| 174 | * ANI proprietary Reason Codes enum |
| 175 | * (present in Deauthentication/Disassociation Management frames) |
| 176 | */ |
| 177 | typedef enum eSirMacPropReasonCodes |
| 178 | { |
| 179 | eSIR_MAC_ULA_TIMEOUT_REASON=0xFF00 |
| 180 | } tSirMacPropReasonCodes; |
| 181 | |
| 182 | |
| 183 | /// Proprietary IE definition |
| 184 | typedef struct sSirMacPropIE |
| 185 | { |
| 186 | tANI_U8 elementID; // SIR_MAC_ANI_PROP_IE_EID |
| 187 | tANI_U8 length; |
| 188 | tANI_U8 oui[3]; // ANI_OUI for Airgo products |
| 189 | tANI_U8 info[1]; |
| 190 | } tSirMacPropIE, *tpSirMacPropIE; |
| 191 | |
| 192 | |
| 193 | typedef struct sSirMacPropRateSet |
| 194 | { |
| 195 | tANI_U8 numPropRates; |
| 196 | tANI_U8 propRate[8]; |
| 197 | } tSirMacPropRateSet, *tpSirMacPropRateSet; |
| 198 | |
| 199 | |
| 200 | typedef struct sSirMacPropLLSet |
| 201 | { |
| 202 | tANI_U32 deferThreshold; |
| 203 | } tSirMacPropLLSet, *tpSirMacPropLLSet; |
| 204 | |
| 205 | #define SIR_PROP_VERSION_STR_MAX 20 |
| 206 | typedef struct sSirMacPropVersion |
| 207 | { |
| 208 | tANI_U32 chip_rev; // board, chipset info |
| 209 | tANI_U8 card_type; // Type of Card |
| 210 | tANI_U8 build_version[SIR_PROP_VERSION_STR_MAX]; //build version string |
| 211 | } tSirMacPropVersion, *tpSirMacPropVersion; |
| 212 | #define SIR_MAC_PROP_VERSION_MIN (SIR_PROP_VERSION_STR_MAX + sizeof(tANI_U32)) |
| 213 | |
| 214 | |
| 215 | // TCID MACRO's |
| 216 | #define TCID_0 0x01 |
| 217 | #define TCID_1 0x02 |
| 218 | #define TCID_2 0x04 |
| 219 | #define TCID_3 0x08 |
| 220 | #define TCID_4 0x10 |
| 221 | #define TCID_5 0x20 |
| 222 | #define TCID_6 0x40 |
| 223 | #define TCID_7 0x80 |
| 224 | #define TCID_ALL 0xFF |
| 225 | |
| 226 | // Get state of Concatenation |
| 227 | #define GET_CONCAT_STATE(ccBitmap,tcid) \ |
| 228 | ((ccBitmap) & (tcid)) |
| 229 | |
| 230 | // Get state of Compression |
| 231 | #define GET_COMPRESSION_STATE(cpBitmap,tcid) \ |
| 232 | ((cpBitmap) & (tcid)) |
| 233 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 234 | // Get/Set the state of Reverse FCS |
| 235 | #define GET_RFCS_OPER_STATE(revFcsState) (revFcsState & 0x01) |
| 236 | #define GET_RFCS_PATTERN_ID(revFcsState) ((revFcsState & 0x0E) >> 1) |
| 237 | |
| 238 | /* STA CB Legacy Bss detect states */ |
| 239 | #define LIM_CB_LEGACY_BSS_DETECT_IDLE 0 |
| 240 | #define LIM_CB_LEGACY_BSS_DETECT_RUNNING 1 |
| 241 | |
| 242 | /* Default value for gLimRestoreCBNumScanInterval */ |
| 243 | #define LIM_RESTORE_CB_NUM_SCAN_INTERVAL_DEFAULT 2 |
| 244 | |
| 245 | // |
| 246 | // Proprietary Quite BSS IE structure |
| 247 | // |
| 248 | // Based on the setting of the "Titan" proprietary bit |
| 249 | // in the tSirPropIEStruct.capability field (bit #6), |
| 250 | // this IE will be sent appropriately to all the ANI |
| 251 | // peers in the following management frames - |
| 252 | // 1) Beacons |
| 253 | // 2) Probe Rsp |
| 254 | // |
| 255 | typedef struct sQuietBssIEStruct |
| 256 | { |
| 257 | |
| 258 | // Indicates the number of TBTT's until the next beacon |
| 259 | // interval during which the next quiet interval will |
| 260 | // start |
| 261 | // 1 - Quiet Interval will start during the beacon |
| 262 | // interval starting at the next TBTT |
| 263 | // 0 - Reserved |
| 264 | tANI_U8 quietCount; |
| 265 | |
| 266 | // Shall be set to the number of beacon intervals between |
| 267 | // the start of regularly scheduled quiet intervals |
| 268 | // defined by this Quiet Element |
| 269 | // 0 - No periodic quiet interval is defined |
| 270 | tANI_U8 quietPeriod; |
| 271 | |
| 272 | // Duration of the quiet interval, expressed in TUs |
| 273 | // 1 TU = 1024 microseconds?? |
| 274 | tANI_U16 quietDuration; |
| 275 | |
| 276 | // Set to the offset of the start of the quiet interval |
| 277 | // from the TBTT specified by the quietCount field, |
| 278 | // expressed in TUs. The value of this offset field will |
| 279 | // be less than one beacon interval |
| 280 | // 1 TU = 1024 microseconds?? |
| 281 | tANI_U16 quietOffset; |
| 282 | |
| 283 | } tQuietBssIEStruct, *tpQuietBssIEStruct; |
| 284 | |
| 285 | typedef struct sChannelSwitchPropIEStruct |
| 286 | { |
| 287 | tANI_U8 mode; |
| 288 | tANI_U8 primaryChannel; |
| 289 | tANI_U8 subBand; |
| 290 | tANI_U8 channelSwitchCount; |
| 291 | |
| 292 | } tChannelSwitchPropIEStruct, *tpChannelSwitchPropIEStruct; |
| 293 | |
| 294 | // generic proprietary IE structure definition |
| 295 | typedef struct sSirPropIEStruct |
| 296 | { |
| 297 | tANI_U8 aniIndicator; |
| 298 | |
| 299 | tANI_U8 propRatesPresent:1; |
| 300 | tANI_U8 apNamePresent:1; |
| 301 | tANI_U8 loadBalanceInfoPresent:1; |
| 302 | tANI_U8 versionPresent:1; |
| 303 | tANI_U8 edcaParamPresent:1; |
| 304 | tANI_U8 capabilityPresent:1; |
| 305 | tANI_U8 titanPresent:1; |
| 306 | tANI_U8 taurusPresent:1; |
| 307 | tANI_U8 propChannelSwitchPresent:1; |
| 308 | tANI_U8 quietBssPresent:1; |
| 309 | tANI_U8 triggerStaScanPresent:1; |
| 310 | tANI_U8 rsvd:5; |
| 311 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 312 | |
| 313 | tSirMacPropRateSet propRates; |
| 314 | tAniApName apName; // used in beacon/probe only |
| 315 | tSirAlternateRadioInfo alternateRadio; // used in assoc response only |
| 316 | tANI_U16 capability; // capability bit map |
| 317 | tSirMacPropVersion version; |
| 318 | tSirMacEdcaParamSetIE edca; |
| 319 | tChannelSwitchPropIEStruct channelSwitch; |
| 320 | tQuietBssIEStruct quietBss; |
| 321 | tANI_U8 triggerStaScanEnable; |
| 322 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 323 | |
| 324 | } tSirPropIEStruct, *tpSirPropIEStruct; |
| 325 | |
| 326 | |
| 327 | |
| 328 | #endif /* __MAC_PROP_EXTS_H */ |