Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Rajeev Kumar Sirasanagandla | 2bb30b8 | 2019-01-07 22:30:16 +0530 | [diff] [blame] | 2 | * Copyright (c) 2011-2017, 2019 The Linux Foundation. All rights reserved. |
Kiet Lam | 842dad0 | 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. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 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 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 28 | /* |
| 29 | * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 30 | * This file limGlobal.h contains the definitions exported by |
| 31 | * LIM module. |
| 32 | * Author: Chandra Modumudi |
| 33 | * Date: 02/11/02 |
| 34 | * History:- |
| 35 | * Date Modified by Modification Information |
| 36 | * -------------------------------------------------------------------- |
| 37 | * |
| 38 | */ |
| 39 | #ifndef __LIM_GLOBAL_H |
| 40 | #define __LIM_GLOBAL_H |
| 41 | |
| 42 | #include "wniApi.h" |
| 43 | #include "sirApi.h" |
| 44 | #include "sirMacProtDef.h" |
| 45 | #include "sirMacPropExts.h" |
| 46 | #include "sirCommon.h" |
| 47 | #include "sirDebug.h" |
Satyanarayana Dash | 6f43827 | 2015-03-03 18:01:06 +0530 | [diff] [blame] | 48 | #include "wniCfg.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 49 | #include "csrApi.h" |
| 50 | #include "sapApi.h" |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 51 | #include "dot11f.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 52 | |
| 53 | /// Maximum number of scan hash table entries |
| 54 | #define LIM_MAX_NUM_OF_SCAN_RESULTS 256 |
| 55 | |
| 56 | // Link Test Report Status. This appears in the report frame |
| 57 | #define LINK_TEST_STATUS_SUCCESS 0x1 |
| 58 | #define LINK_TEST_STATUS_UNSUPPORTED_RATE 0x2 |
| 59 | #define LINK_TEST_STATUS_INVALID_ADDR 0x3 |
| 60 | |
| 61 | // Amount of time in nanosec to be sleep-waited before |
| 62 | // enabling RHP (1 millisec) |
| 63 | #define LIM_RHP_WORK_AROUND_DURATION 1000000 |
| 64 | |
| 65 | // Maximum amount of Quiet duration in millisec |
| 66 | #define LIM_MAX_QUIET_DURATION 32 |
| 67 | |
| 68 | #define LIM_TX_WQ_EMPTY_SLEEP_NS 100000 |
| 69 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 70 | // Deferred Message Queue Length |
| 71 | #define MAX_DEFERRED_QUEUE_LEN 20 |
| 72 | |
| 73 | // Maximum Buffer size |
| 74 | #define LIM_MAX_BUF_SIZE 8192 |
| 75 | |
| 76 | // Maximum number of PS - TIM's to be sent with out wakeup from STA |
| 77 | #define LIM_TIM_WAIT_COUNT_FACTOR 5 |
| 78 | |
| 79 | /** Use this count if (LIM_TIM_WAIT_FACTOR * ListenInterval) is less than LIM_MIN_TIM_WAIT_CNT*/ |
| 80 | #define LIM_MIN_TIM_WAIT_COUNT 50 |
| 81 | |
| 82 | #define GET_TIM_WAIT_COUNT(LIntrvl) ((LIntrvl * LIM_TIM_WAIT_COUNT_FACTOR) > LIM_MIN_TIM_WAIT_COUNT ? \ |
| 83 | (LIntrvl * LIM_TIM_WAIT_COUNT_FACTOR) : LIM_MIN_TIM_WAIT_COUNT) |
Kiran Kumar Lokere | 79540f9 | 2013-04-25 17:32:16 -0700 | [diff] [blame] | 84 | #define IS_5G_BAND(__rfBand) ((__rfBand & 0x3) == 0x2) |
| 85 | #define IS_24G_BAND(__rfBand) ((__rfBand & 0x3) == 0x1) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 86 | |
| 87 | // enums exported by LIM are as follows |
| 88 | |
| 89 | /// System role definition |
| 90 | typedef enum eLimSystemRole |
| 91 | { |
| 92 | eLIM_UNKNOWN_ROLE, |
| 93 | eLIM_AP_ROLE, |
| 94 | eLIM_STA_IN_IBSS_ROLE, |
| 95 | eLIM_STA_ROLE, |
| 96 | eLIM_BT_AMP_STA_ROLE, |
Gopichand Nakkala | 48b4d7e | 2013-03-06 23:34:16 +0530 | [diff] [blame] | 97 | eLIM_BT_AMP_AP_ROLE, |
| 98 | eLIM_P2P_DEVICE_ROLE, |
| 99 | eLIM_P2P_DEVICE_GO, |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 100 | eLIM_P2P_DEVICE_CLIENT |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 101 | } tLimSystemRole; |
| 102 | |
| 103 | /** |
| 104 | * SME state definition accessible across all Sirius modules. |
| 105 | * AP only states are LIM_SME_CHANNEL_SCAN_STATE & |
| 106 | * LIM_SME_NORMAL_CHANNEL_SCAN_STATE. |
| 107 | * Note that these states may also be present in STA |
| 108 | * side too when DFS support is present for a STA in IBSS mode. |
| 109 | */ |
| 110 | typedef enum eLimSmeStates |
| 111 | { |
| 112 | eLIM_SME_OFFLINE_STATE, |
| 113 | eLIM_SME_IDLE_STATE, |
| 114 | eLIM_SME_SUSPEND_STATE, |
| 115 | eLIM_SME_WT_SCAN_STATE, |
| 116 | eLIM_SME_WT_JOIN_STATE, |
| 117 | eLIM_SME_WT_AUTH_STATE, |
| 118 | eLIM_SME_WT_ASSOC_STATE, |
| 119 | eLIM_SME_WT_REASSOC_STATE, |
| 120 | eLIM_SME_WT_REASSOC_LINK_FAIL_STATE, |
| 121 | eLIM_SME_JOIN_FAILURE_STATE, |
| 122 | eLIM_SME_ASSOCIATED_STATE, |
| 123 | eLIM_SME_REASSOCIATED_STATE, |
| 124 | eLIM_SME_LINK_EST_STATE, |
| 125 | eLIM_SME_LINK_EST_WT_SCAN_STATE, |
| 126 | eLIM_SME_WT_PRE_AUTH_STATE, |
| 127 | eLIM_SME_WT_DISASSOC_STATE, |
| 128 | eLIM_SME_WT_DEAUTH_STATE, |
| 129 | eLIM_SME_WT_START_BSS_STATE, |
| 130 | eLIM_SME_WT_STOP_BSS_STATE, |
| 131 | eLIM_SME_NORMAL_STATE, |
| 132 | eLIM_SME_CHANNEL_SCAN_STATE, |
| 133 | eLIM_SME_NORMAL_CHANNEL_SCAN_STATE |
| 134 | } tLimSmeStates; |
| 135 | |
| 136 | /** |
| 137 | * MLM state definition. |
| 138 | * While these states are present on AP too when it is |
| 139 | * STA mode, per-STA MLM state exclusive to AP is: |
| 140 | * eLIM_MLM_WT_AUTH_FRAME3. |
| 141 | */ |
| 142 | typedef enum eLimMlmStates |
| 143 | { |
| 144 | eLIM_MLM_OFFLINE_STATE, |
| 145 | eLIM_MLM_IDLE_STATE, |
| 146 | eLIM_MLM_WT_PROBE_RESP_STATE, |
| 147 | eLIM_MLM_PASSIVE_SCAN_STATE, |
| 148 | eLIM_MLM_WT_JOIN_BEACON_STATE, |
| 149 | eLIM_MLM_JOINED_STATE, |
| 150 | eLIM_MLM_BSS_STARTED_STATE, |
| 151 | eLIM_MLM_WT_AUTH_FRAME2_STATE, |
| 152 | eLIM_MLM_WT_AUTH_FRAME3_STATE, |
| 153 | eLIM_MLM_WT_AUTH_FRAME4_STATE, |
| 154 | eLIM_MLM_AUTH_RSP_TIMEOUT_STATE, |
| 155 | eLIM_MLM_AUTHENTICATED_STATE, |
| 156 | eLIM_MLM_WT_ASSOC_RSP_STATE, |
| 157 | eLIM_MLM_WT_REASSOC_RSP_STATE, |
| 158 | eLIM_MLM_ASSOCIATED_STATE, |
| 159 | eLIM_MLM_REASSOCIATED_STATE, |
| 160 | eLIM_MLM_LINK_ESTABLISHED_STATE, |
| 161 | eLIM_MLM_WT_ASSOC_CNF_STATE, |
| 162 | eLIM_MLM_LEARN_STATE, |
| 163 | eLIM_MLM_WT_ADD_BSS_RSP_STATE, |
| 164 | eLIM_MLM_WT_DEL_BSS_RSP_STATE, |
| 165 | eLIM_MLM_WT_ADD_BSS_RSP_ASSOC_STATE, |
| 166 | eLIM_MLM_WT_ADD_BSS_RSP_REASSOC_STATE, |
| 167 | eLIM_MLM_WT_ADD_BSS_RSP_PREASSOC_STATE, |
| 168 | eLIM_MLM_WT_ADD_STA_RSP_STATE, |
| 169 | eLIM_MLM_WT_DEL_STA_RSP_STATE, |
| 170 | //MLM goes to this state when LIM initiates DELETE_STA as processing of Assoc req because |
| 171 | //the entry already exists. LIM comes out of this state when DELETE_STA response from |
| 172 | //HAL is received. LIM needs to maintain this state so that ADD_STA can be issued while |
| 173 | //processing DELETE_STA response from HAL. |
| 174 | eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE, |
| 175 | eLIM_MLM_WT_SET_BSS_KEY_STATE, |
| 176 | eLIM_MLM_WT_SET_STA_KEY_STATE, |
| 177 | eLIM_MLM_WT_SET_STA_BCASTKEY_STATE, |
| 178 | eLIM_MLM_WT_ADDBA_RSP_STATE, |
| 179 | eLIM_MLM_WT_REMOVE_BSS_KEY_STATE, |
| 180 | eLIM_MLM_WT_REMOVE_STA_KEY_STATE, |
| 181 | eLIM_MLM_WT_SET_MIMOPS_STATE, |
| 182 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 183 | eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE, |
| 184 | eLIM_MLM_WT_FT_REASSOC_RSP_STATE, |
| 185 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 186 | eLIM_MLM_P2P_LISTEN_STATE, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 187 | } tLimMlmStates; |
| 188 | |
| 189 | // 11h channel quiet states |
| 190 | /* This enum indicates in which state the device is in |
| 191 | * when it receives quiet element in beacon or probe-response. |
| 192 | * The default quiet state of the device is always INIT |
| 193 | * eLIM_QUIET_BEGIN - When Quiet period is started |
| 194 | * eLIM_QUIET_CHANGED - When Quiet period is updated |
| 195 | * eLIM_QUIET_RUNNING - Between two successive Quiet updates |
| 196 | * eLIM_QUIET_END - When quiet period ends |
| 197 | */ |
| 198 | typedef enum eLimQuietStates |
| 199 | { |
| 200 | eLIM_QUIET_INIT, |
| 201 | eLIM_QUIET_BEGIN, |
| 202 | eLIM_QUIET_CHANGED, |
| 203 | eLIM_QUIET_RUNNING, |
| 204 | eLIM_QUIET_END |
| 205 | } tLimQuietStates; |
| 206 | |
| 207 | // 11h channel switch states |
| 208 | /* This enum indicates in which state the channel-swith |
| 209 | * is presently operating. |
| 210 | * eLIM_11H_CHANSW_INIT - Default state |
| 211 | * eLIM_11H_CHANSW_RUNNING - When channel switch is running |
| 212 | * eLIM_11H_CHANSW_END - After channel switch is complete |
| 213 | */ |
| 214 | typedef enum eLimDot11hChanSwStates |
| 215 | { |
| 216 | eLIM_11H_CHANSW_INIT, |
| 217 | eLIM_11H_CHANSW_RUNNING, |
| 218 | eLIM_11H_CHANSW_END |
| 219 | } tLimDot11hChanSwStates; |
| 220 | |
| 221 | #ifdef GEN4_SCAN |
| 222 | |
| 223 | //WLAN_SUSPEND_LINK Related |
| 224 | typedef void (*SUSPEND_RESUME_LINK_CALLBACK)(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data); |
| 225 | |
| 226 | // LIM to HAL SCAN Management Message Interface states |
| 227 | typedef enum eLimHalScanState |
| 228 | { |
| 229 | eLIM_HAL_IDLE_SCAN_STATE, |
| 230 | eLIM_HAL_INIT_SCAN_WAIT_STATE, |
| 231 | eLIM_HAL_START_SCAN_WAIT_STATE, |
| 232 | eLIM_HAL_END_SCAN_WAIT_STATE, |
| 233 | eLIM_HAL_FINISH_SCAN_WAIT_STATE, |
| 234 | eLIM_HAL_INIT_LEARN_WAIT_STATE, |
| 235 | eLIM_HAL_START_LEARN_WAIT_STATE, |
| 236 | eLIM_HAL_END_LEARN_WAIT_STATE, |
| 237 | eLIM_HAL_FINISH_LEARN_WAIT_STATE, |
| 238 | eLIM_HAL_SCANNING_STATE, |
| 239 | //WLAN_SUSPEND_LINK Related |
| 240 | eLIM_HAL_SUSPEND_LINK_WAIT_STATE, |
| 241 | eLIM_HAL_SUSPEND_LINK_STATE, |
| 242 | eLIM_HAL_RESUME_LINK_WAIT_STATE, |
| 243 | //end WLAN_SUSPEND_LINK Related |
| 244 | } tLimLimHalScanState; |
| 245 | #endif // GEN4_SCAN |
| 246 | |
| 247 | // LIM states related to A-MPDU/BA |
| 248 | // This is used for maintaining the state between PE and HAL only. |
| 249 | typedef enum eLimBAState |
| 250 | { |
| 251 | eLIM_BA_STATE_IDLE, // we are not waiting for anything from HAL. |
| 252 | eLIM_BA_STATE_WT_ADD_RSP, //We are waiting for Add rsponse from HAL. |
| 253 | eLIM_BA_STATE_WT_DEL_RSP // We are waiting for Del response from HAL. |
| 254 | } tLimBAState; |
| 255 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 256 | |
| 257 | |
Jeff Johnson | 62c2798 | 2013-02-27 17:53:55 -0800 | [diff] [blame] | 258 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 259 | |
| 260 | // MLM Req/Cnf structure definitions |
| 261 | typedef struct sLimMlmAuthReq |
| 262 | { |
| 263 | tSirMacAddr peerMacAddr; |
| 264 | tAniAuthType authType; |
| 265 | tANI_U32 authFailureTimeout; |
| 266 | tANI_U8 sessionId; |
| 267 | } tLimMlmAuthReq, *tpLimMlmAuthReq; |
| 268 | |
| 269 | typedef struct sLimMlmJoinReq |
| 270 | { |
| 271 | tANI_U32 joinFailureTimeout; |
| 272 | tSirMacRateSet operationalRateSet; |
| 273 | tANI_U8 sessionId; |
| 274 | tSirBssDescription bssDescription; |
Sridhar Selvaraj | b59cd8c | 2017-07-17 18:43:55 +0530 | [diff] [blame] | 275 | /* |
| 276 | * WARNING: Pls make bssDescription as last variable in struct |
| 277 | * tLimMlmJoinReq as it has ieFields followed after this bss |
| 278 | * description. Adding a variable after this corrupts the ieFields |
| 279 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 280 | } tLimMlmJoinReq, *tpLimMlmJoinReq; |
| 281 | |
| 282 | typedef struct sLimMlmScanReq |
| 283 | { |
| 284 | tSirBssType bssType; |
| 285 | tSirMacAddr bssId; |
| 286 | tSirMacSSid ssId[SIR_SCAN_MAX_NUM_SSID]; |
| 287 | tSirScanType scanType; |
| 288 | tANI_U32 minChannelTime; |
| 289 | tANI_U32 maxChannelTime; |
Abhishek Singh | 3a93ee4 | 2016-09-29 17:00:03 +0530 | [diff] [blame] | 290 | tANI_U32 min_chntime_btc_esco; |
| 291 | tANI_U32 max_chntime_btc_esco; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 292 | tSirBackgroundScanMode backgroundScanMode; |
| 293 | tANI_U32 dot11mode; |
| 294 | /* Number of SSIDs to scan(send Probe request) */ |
| 295 | tANI_U8 numSsid; |
| 296 | |
Rajeev Kumar Sirasanagandla | 2bb30b8 | 2019-01-07 22:30:16 +0530 | [diff] [blame] | 297 | bool scan_randomize; |
| 298 | bool nl_scan; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 299 | tANI_BOOLEAN p2pSearch; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 300 | tANI_U16 uIEFieldLen; |
| 301 | tANI_U16 uIEFieldOffset; |
| 302 | |
| 303 | //channelList MUST be the last field of this structure |
| 304 | tSirChannelList channelList; |
| 305 | /*----------------------------- |
| 306 | tLimMlmScanReq.... |
| 307 | ----------------------------- |
| 308 | uIEFiledLen |
| 309 | ----------------------------- |
| 310 | uIEFiledOffset ----+ |
| 311 | ----------------------------- | |
| 312 | channelList.numChannels | |
| 313 | ----------------------------- | |
| 314 | ... variable size up to | |
| 315 | channelNumber[numChannels-1] | |
| 316 | This can be zero, if | |
| 317 | numChannel is zero. | |
| 318 | ----------------------------- <--+ |
| 319 | ... variable size uIEFiled |
| 320 | up to uIEFieldLen (can be 0) |
| 321 | -----------------------------*/ |
| 322 | } tLimMlmScanReq, *tpLimMlmScanReq; |
| 323 | |
| 324 | typedef struct tLimScanResultNode tLimScanResultNode; |
| 325 | struct tLimScanResultNode |
| 326 | { |
| 327 | tLimScanResultNode *next; |
| 328 | tSirBssDescription bssDescription; |
| 329 | }; |
| 330 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 331 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 332 | |
| 333 | #ifndef OEM_DATA_REQ_SIZE |
Madan Mohan Koyyalamudi | 7a4d931 | 2012-12-04 17:21:36 -0800 | [diff] [blame] | 334 | #define OEM_DATA_REQ_SIZE 134 |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 335 | #endif |
| 336 | #ifndef OEM_DATA_RSP_SIZE |
Madan Mohan Koyyalamudi | 7a4d931 | 2012-12-04 17:21:36 -0800 | [diff] [blame] | 337 | #define OEM_DATA_RSP_SIZE 1968 |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 338 | #endif |
| 339 | |
| 340 | // OEM Data related structure definitions |
| 341 | typedef struct sLimMlmOemDataReq |
| 342 | { |
| 343 | tSirMacAddr selfMacAddr; |
| 344 | tANI_U8 oemDataReq[OEM_DATA_REQ_SIZE]; |
| 345 | } tLimMlmOemDataReq, *tpLimMlmOemDataReq; |
| 346 | |
| 347 | typedef struct sLimMlmOemDataRsp |
| 348 | { |
| 349 | tANI_U8 oemDataRsp[OEM_DATA_RSP_SIZE]; |
| 350 | } tLimMlmOemDataRsp, *tpLimMlmOemDataRsp; |
| 351 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 352 | |
| 353 | // Pre-authentication structure definition |
| 354 | typedef struct tLimPreAuthNode |
| 355 | { |
| 356 | struct tLimPreAuthNode *next; |
| 357 | tSirMacAddr peerMacAddr; |
| 358 | tAniAuthType authType; |
| 359 | tLimMlmStates mlmState; |
| 360 | tANI_U8 authNodeIdx; |
| 361 | tANI_U8 challengeText[SIR_MAC_AUTH_CHALLENGE_LENGTH]; |
| 362 | tANI_U8 fTimerStarted:1; |
| 363 | tANI_U8 fSeen:1; |
| 364 | tANI_U8 fFree:1; |
| 365 | tANI_U8 rsvd:5; |
| 366 | TX_TIMER timer; |
Sushant Kaushik | f9c963c | 2015-01-28 12:50:26 +0530 | [diff] [blame] | 367 | tANI_U16 seqNo; |
Edhar, Mahesh Kumar | 0d82c21 | 2015-02-03 17:47:16 +0530 | [diff] [blame] | 368 | v_TIME_t timestamp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 369 | }tLimPreAuthNode, *tpLimPreAuthNode; |
| 370 | |
| 371 | // Pre-authentication table definition |
| 372 | typedef struct tLimPreAuthTable |
| 373 | { |
| 374 | tANI_U32 numEntry; |
| 375 | tpLimPreAuthNode pTable; |
| 376 | }tLimPreAuthTable, *tpLimPreAuthTable; |
| 377 | |
| 378 | /// Per STA context structure definition |
| 379 | typedef struct sLimMlmStaContext |
| 380 | { |
| 381 | tLimMlmStates mlmState; |
| 382 | tAniAuthType authType; |
| 383 | tANI_U16 listenInterval; |
| 384 | tSirMacCapabilityInfo capabilityInfo; |
| 385 | tSirMacPropRateSet propRateSet; |
| 386 | tSirMacReasonCodes disassocReason; |
| 387 | tANI_U16 cleanupTrigger; |
| 388 | |
| 389 | tSirResultCodes resultCode; |
| 390 | tANI_U16 protStatusCode; |
| 391 | |
| 392 | tANI_U8 subType:1; // Indicates ASSOC (0) or REASSOC (1) |
| 393 | tANI_U8 updateContext:1; |
| 394 | tANI_U8 schClean:1; |
| 395 | // 802.11n HT Capability in Station: Enabled 1 or DIsabled 0 |
| 396 | tANI_U8 htCapability:1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 397 | #ifdef WLAN_FEATURE_11AC |
| 398 | tANI_U8 vhtCapability:1; |
| 399 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 400 | } tLimMlmStaContext, *tpLimMlmStaContext; |
| 401 | |
| 402 | // Structure definition to hold deferred messages queue parameters |
| 403 | typedef struct sLimDeferredMsgQParams |
| 404 | { |
| 405 | tSirMsgQ deferredQueue[MAX_DEFERRED_QUEUE_LEN]; |
| 406 | tANI_U16 size; |
| 407 | tANI_U16 read; |
| 408 | tANI_U16 write; |
| 409 | } tLimDeferredMsgQParams, *tpLimDeferredMsgQParams; |
| 410 | |
| 411 | typedef struct sLimTraceQ |
| 412 | { |
| 413 | tANI_U32 type; |
| 414 | tLimSmeStates smeState; |
| 415 | tLimMlmStates mlmState; |
| 416 | tANI_U32 value; |
| 417 | tANI_U32 value2; |
| 418 | } tLimTraceQ; |
| 419 | |
| 420 | typedef struct sLimTraceParams |
| 421 | { |
| 422 | tLimTraceQ traceQueue[1024]; |
| 423 | tANI_U16 write; |
| 424 | tANI_U16 enabled; |
| 425 | } tLimTraceParams; |
| 426 | |
| 427 | typedef struct sCfgProtection |
| 428 | { |
| 429 | tANI_U32 overlapFromlla:1; |
| 430 | tANI_U32 overlapFromllb:1; |
| 431 | tANI_U32 overlapFromllg:1; |
| 432 | tANI_U32 overlapHt20:1; |
| 433 | tANI_U32 overlapNonGf:1; |
| 434 | tANI_U32 overlapLsigTxop:1; |
| 435 | tANI_U32 overlapRifs:1; |
| 436 | tANI_U32 overlapOBSS:1; /* added for obss */ |
| 437 | tANI_U32 fromlla:1; |
| 438 | tANI_U32 fromllb:1; |
| 439 | tANI_U32 fromllg:1; |
| 440 | tANI_U32 ht20:1; |
| 441 | tANI_U32 nonGf:1; |
| 442 | tANI_U32 lsigTxop:1; |
| 443 | tANI_U32 rifs:1; |
| 444 | tANI_U32 obss:1; /* added for Obss */ |
| 445 | }tCfgProtection, *tpCfgProtection; |
| 446 | |
| 447 | typedef enum eLimProtStaCacheType |
| 448 | { |
| 449 | eLIM_PROT_STA_CACHE_TYPE_INVALID, |
| 450 | eLIM_PROT_STA_CACHE_TYPE_llB, |
| 451 | eLIM_PROT_STA_CACHE_TYPE_llG, |
| 452 | eLIM_PROT_STA_CACHE_TYPE_HT20 |
| 453 | }tLimProtStaCacheType; |
| 454 | |
| 455 | typedef struct sCacheParams |
| 456 | { |
| 457 | tANI_U8 active; |
| 458 | tSirMacAddr addr; |
| 459 | tLimProtStaCacheType protStaCacheType; |
| 460 | |
| 461 | } tCacheParams, *tpCacheParams; |
| 462 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 463 | #define LIM_PROT_STA_OVERLAP_CACHE_SIZE HAL_NUM_ASSOC_STA |
| 464 | #define LIM_PROT_STA_CACHE_SIZE HAL_NUM_ASSOC_STA |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 465 | |
| 466 | typedef struct sLimProtStaParams |
| 467 | { |
| 468 | tANI_U8 numSta; |
| 469 | tANI_U8 protectionEnabled; |
| 470 | } tLimProtStaParams, *tpLimProtStaParams; |
| 471 | |
| 472 | |
| 473 | typedef struct sLimNoShortParams |
| 474 | { |
| 475 | tANI_U8 numNonShortPreambleSta; |
| 476 | tCacheParams staNoShortCache[LIM_PROT_STA_CACHE_SIZE]; |
| 477 | } tLimNoShortParams, *tpLimNoShortParams; |
| 478 | |
| 479 | typedef struct sLimNoShortSlotParams |
| 480 | { |
| 481 | tANI_U8 numNonShortSlotSta; |
| 482 | tCacheParams staNoShortSlotCache[LIM_PROT_STA_CACHE_SIZE]; |
| 483 | } tLimNoShortSlotParams, *tpLimNoShortSlotParams; |
| 484 | |
| 485 | |
| 486 | typedef struct tLimIbssPeerNode tLimIbssPeerNode; |
| 487 | struct tLimIbssPeerNode |
| 488 | { |
| 489 | tLimIbssPeerNode *next; |
| 490 | tSirMacAddr peerMacAddr; |
| 491 | tANI_U8 aniIndicator:1; |
| 492 | tANI_U8 extendedRatesPresent:1; |
| 493 | tANI_U8 edcaPresent:1; |
| 494 | tANI_U8 wmeEdcaPresent:1; |
| 495 | tANI_U8 wmeInfoPresent:1; |
| 496 | tANI_U8 htCapable:1; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 497 | tANI_U8 vhtCapable:1; |
| 498 | tANI_U8 rsvd:1; |
| 499 | tANI_U8 htSecondaryChannelOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 500 | tSirMacCapabilityInfo capabilityInfo; |
| 501 | tSirMacRateSet supportedRates; |
| 502 | tSirMacRateSet extendedRates; |
| 503 | tANI_U8 supportedMCSSet[SIZE_OF_SUPPORTED_MCS_SET]; |
| 504 | tSirMacEdcaParamSetIE edcaParams; |
| 505 | tANI_U16 propCapability; |
| 506 | tANI_U8 erpIePresent; |
| 507 | |
| 508 | //HT Capabilities of IBSS Peer |
| 509 | tANI_U8 htGreenfield; |
| 510 | tANI_U8 htShortGI40Mhz; |
| 511 | tANI_U8 htShortGI20Mhz; |
| 512 | |
| 513 | // DSSS/CCK at 40 MHz: Enabled 1 or Disabled |
| 514 | tANI_U8 htDsssCckRate40MHzSupport; |
| 515 | |
| 516 | // MIMO Power Save |
| 517 | tSirMacHTMIMOPowerSaveState htMIMOPSState; |
| 518 | |
| 519 | // |
| 520 | // A-MPDU Density |
| 521 | // 000 - No restriction |
| 522 | // 001 - 1/8 usec |
| 523 | // 010 - 1/4 usec |
| 524 | // 011 - 1/2 usec |
| 525 | // 100 - 1 usec |
| 526 | // 101 - 2 usec |
| 527 | // 110 - 4 usec |
| 528 | // 111 - 8 usec |
| 529 | // |
| 530 | tANI_U8 htAMpduDensity; |
| 531 | |
| 532 | // Maximum Rx A-MPDU factor |
| 533 | tANI_U8 htMaxRxAMpduFactor; |
| 534 | |
| 535 | //Set to 0 for 3839 octets |
| 536 | //Set to 1 for 7935 octets |
| 537 | tANI_U8 htMaxAmsduLength; |
| 538 | |
| 539 | // |
| 540 | // Recommended Tx Width Set |
| 541 | // 0 - use 20 MHz channel (control channel) |
| 542 | // 1 - use 40 Mhz channel |
| 543 | // |
| 544 | tANI_U8 htSupportedChannelWidthSet; |
| 545 | |
| 546 | tANI_U8 beaconHBCount; |
| 547 | tANI_U8 heartbeatFailure; |
| 548 | |
| 549 | tANI_U8 *beacon; //Hold beacon to be sent to HDD/CSR |
| 550 | tANI_U16 beaconLen; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 551 | |
| 552 | #ifdef WLAN_FEATURE_11AC |
| 553 | tDot11fIEVHTCaps VHTCaps; |
| 554 | tANI_U8 vhtSupportedChannelWidthSet; |
| 555 | tANI_U8 vhtBeamFormerCapable; |
| 556 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 557 | }; |
| 558 | |
| 559 | // Enums used for channel switching. |
| 560 | typedef enum eLimChannelSwitchState |
| 561 | { |
| 562 | eLIM_CHANNEL_SWITCH_IDLE, |
| 563 | eLIM_CHANNEL_SWITCH_PRIMARY_ONLY, |
| 564 | eLIM_CHANNEL_SWITCH_SECONDARY_ONLY, |
| 565 | eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY |
| 566 | } tLimChannelSwitchState; |
| 567 | |
| 568 | |
| 569 | // Channel Switch Info |
| 570 | typedef struct sLimChannelSwitchInfo |
| 571 | { |
| 572 | tLimChannelSwitchState state; |
| 573 | tANI_U8 primaryChannel; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 574 | ePhyChanBondState secondarySubBand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 575 | tANI_U32 switchCount; |
| 576 | tANI_U32 switchTimeoutValue; |
| 577 | tANI_U8 switchMode; |
| 578 | } tLimChannelSwitchInfo, *tpLimChannelSwitchInfo; |
| 579 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 580 | #ifdef WLAN_FEATURE_11AC |
| 581 | typedef struct sLimOperatingModeInfo |
| 582 | { |
| 583 | tANI_U8 present; |
| 584 | tANI_U8 chanWidth: 2; |
| 585 | tANI_U8 reserved: 2; |
| 586 | tANI_U8 rxNSS: 3; |
| 587 | tANI_U8 rxNSSType: 1; |
| 588 | }tLimOperatingModeInfo, *tpLimOperatingModeInfo; |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 589 | |
| 590 | typedef struct sLimWiderBWChannelSwitch |
| 591 | { |
| 592 | tANI_U8 newChanWidth; |
| 593 | tANI_U8 newCenterChanFreq0; |
| 594 | tANI_U8 newCenterChanFreq1; |
| 595 | }tLimWiderBWChannelSwitchInfo, *tpLimWiderBWChannelSwitchInfo; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 596 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 597 | // Enums used when stopping the Tx. |
| 598 | typedef enum eLimQuietTxMode |
| 599 | { |
| 600 | eLIM_TX_ALL = 0, /* Stops/resumes the transmission of all stations, Uses the global flag. */ |
| 601 | eLIM_TX_STA, /* Stops/resumes the transmission of specific stations identified by staId. */ |
| 602 | eLIM_TX_BSS, /* Stops/resumes the transmission of all the packets in BSS */ |
| 603 | eLIM_TX_BSS_BUT_BEACON /* Stops/resumes the transmission of all packets except beacons in BSS |
| 604 | * This is used when radar is detected in the current operating channel. |
| 605 | * Beacon has to be sent to notify the stations associated about the |
| 606 | * scheduled channel switch */ |
| 607 | } tLimQuietTxMode; |
| 608 | |
| 609 | typedef enum eLimControlTx |
| 610 | { |
| 611 | eLIM_RESUME_TX = 0, |
| 612 | eLIM_STOP_TX |
| 613 | } tLimControlTx; |
| 614 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 615 | |
| 616 | // -------------------------------------------------------------------- |
| 617 | |
| 618 | typedef __ani_attr_pre_packed struct sLimTspecInfo |
| 619 | { |
| 620 | tANI_U8 inuse; // 0==free, else used |
| 621 | tANI_U8 idx; // index in list |
| 622 | tANI_U8 staAddr[6]; |
| 623 | tANI_U16 assocId; |
| 624 | tSirMacTspecIE tspec; |
| 625 | tANI_U8 numTclas; // number of Tclas elements |
| 626 | tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM]; |
| 627 | tANI_U8 tclasProc; |
| 628 | tANI_U8 tclasProcPresent:1; //tclassProc is valid only if this is set to 1. |
| 629 | } __ani_attr_packed tLimTspecInfo, *tpLimTspecInfo; |
| 630 | |
| 631 | typedef struct sLimAdmitPolicyInfo |
| 632 | { |
| 633 | tANI_U8 type; // admit control policy type |
| 634 | tANI_U8 bw_factor; // oversubscription factor : 0 means nothing is allowed |
| 635 | // valid only when 'type' is set BW_FACTOR |
| 636 | } tLimAdmitPolicyInfo, *tpLimAdmitPolicyInfo; |
| 637 | |
| 638 | |
| 639 | typedef enum eLimWscEnrollState |
| 640 | { |
| 641 | eLIM_WSC_ENROLL_NOOP, |
| 642 | eLIM_WSC_ENROLL_BEGIN, |
| 643 | eLIM_WSC_ENROLL_IN_PROGRESS, |
| 644 | eLIM_WSC_ENROLL_END |
| 645 | |
| 646 | } tLimWscEnrollState; |
| 647 | |
| 648 | #define WSC_PASSWD_ID_PUSH_BUTTON (0x0004) |
| 649 | |
| 650 | typedef struct sLimWscIeInfo |
| 651 | { |
| 652 | tANI_BOOLEAN apSetupLocked; |
| 653 | tANI_BOOLEAN selectedRegistrar; |
| 654 | tANI_U16 selectedRegistrarConfigMethods; |
| 655 | tLimWscEnrollState wscEnrollmentState; |
| 656 | tLimWscEnrollState probeRespWscEnrollmentState; |
| 657 | tANI_U8 reqType; |
| 658 | tANI_U8 respType; |
| 659 | } tLimWscIeInfo, *tpLimWscIeInfo; |
| 660 | |
| 661 | // maximum number of tspec's supported |
Arun Kumar Khandavalli | da71aa3 | 2014-01-07 20:45:13 +0530 | [diff] [blame] | 662 | #define LIM_NUM_TSPEC_MAX 15 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 663 | |
| 664 | |
| 665 | //structure to hold all 11h specific data |
| 666 | typedef struct sLimSpecMgmtInfo |
| 667 | { |
| 668 | tLimQuietStates quietState; |
| 669 | tANI_U32 quietCount; |
| 670 | tANI_U32 quietDuration; /* This is in units of system TICKS */ |
| 671 | tANI_U32 quietDuration_TU; /* This is in units of TU, for over the air transmission */ |
| 672 | tANI_U32 quietTimeoutValue; /* After this timeout, actual quiet starts */ |
| 673 | tANI_BOOLEAN fQuietEnabled; /* Used on AP, if quiet is enabled during learning */ |
| 674 | |
| 675 | tLimDot11hChanSwStates dot11hChanSwState; |
| 676 | |
| 677 | tANI_BOOLEAN fRadarDetCurOperChan; /* Radar detected in cur oper chan on AP */ |
| 678 | tANI_BOOLEAN fRadarIntrConfigured; /* Whether radar interrupt has been configured */ |
| 679 | }tLimSpecMgmtInfo, *tpLimSpecMgmtInfo; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 680 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 681 | #ifdef FEATURE_WLAN_TDLS |
| 682 | /* |
| 683 | * Peer info needed for TDLS setup.. |
| 684 | */ |
| 685 | typedef struct tLimTDLSPeerSta |
| 686 | { |
| 687 | struct tLimTDLSPeerSta *next; |
| 688 | tANI_U8 dialog ; |
| 689 | tSirMacAddr peerMac; |
| 690 | tSirMacCapabilityInfo capabilityInfo; |
| 691 | tSirMacRateSet supportedRates; |
| 692 | tSirMacRateSet extendedRates; |
| 693 | tSirMacQosCapabilityStaIE qosCaps; |
| 694 | tSirMacEdcaParamSetIE edcaParams; |
| 695 | tANI_U8 mcsSet[SIZE_OF_SUPPORTED_MCS_SET]; |
| 696 | tANI_U8 tdls_bIsResponder ; |
| 697 | /* HT Capabilties */ |
| 698 | tDot11fIEHTCaps tdlsPeerHTCaps ; |
| 699 | tDot11fIEExtCap tdlsPeerExtCaps; |
| 700 | tANI_U8 tdls_flags ; |
| 701 | tANI_U8 tdls_link_state ; |
| 702 | tANI_U8 tdls_prev_link_state ; |
| 703 | tANI_U8 tdls_sessionId; |
| 704 | tANI_U8 ExtRatesPresent ; |
| 705 | TX_TIMER gLimTdlsLinkSetupRspTimeoutTimer ; |
| 706 | TX_TIMER gLimTdlsLinkSetupCnfTimeoutTimer ; |
| 707 | }tLimTdlsLinkSetupPeer, *tpLimTdlsLinkSetupPeer ; |
| 708 | |
| 709 | typedef struct tLimTdlsLinkSetupInfo |
| 710 | { |
| 711 | tLimTdlsLinkSetupPeer *tdlsLinkSetupList ; |
| 712 | tANI_U8 num_tdls_peers ; |
| 713 | tANI_U8 tdls_flags ; |
| 714 | tANI_U8 tdls_state ; |
| 715 | tANI_U8 tdls_prev_state ; |
| 716 | }tLimTdlsLinkSetupInfo, *tpLimTdlsLinkSetupInfo ; |
| 717 | |
| 718 | typedef enum tdlsLinkMode |
| 719 | { |
| 720 | TDLS_LINK_MODE_BG, |
| 721 | TDLS_LINK_MODE_N, |
Hoonki Lee | 99e5378 | 2013-02-12 18:07:03 -0800 | [diff] [blame] | 722 | TDLS_LINK_MODE_AC, |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 723 | TDLS_LINK_MODE_NONE |
| 724 | } eLimTdlsLinkMode ; |
| 725 | #endif /* FEATURE_WLAN_TDLS */ |
| 726 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 727 | #endif |