Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Gopichand Nakkala | 9c070ad | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
| 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. |
| 20 | */ |
| 21 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 22 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23 | * |
| 24 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 25 | * |
| 26 | * |
| 27 | * Permission to use, copy, modify, and/or distribute this software for |
| 28 | * any purpose with or without fee is hereby granted, provided that the |
| 29 | * above copyright notice and this permission notice appear in all |
| 30 | * copies. |
| 31 | * |
| 32 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 33 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 34 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 35 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 36 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 37 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 38 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 39 | * PERFORMANCE OF THIS SOFTWARE. |
| 40 | */ |
| 41 | |
| 42 | /** ------------------------------------------------------------------------- * |
| 43 | ------------------------------------------------------------------------- * |
| 44 | |
| 45 | |
| 46 | \file csrInternal.h |
| 47 | |
| 48 | Define internal data structure for MAC. |
| 49 | |
| 50 | Copyright (C) 2006 Airgo Networks, Incorporated |
| 51 | ========================================================================== */ |
| 52 | #ifndef CSRINTERNAL_H__ |
| 53 | #define CSRINTERNAL_H__ |
| 54 | |
| 55 | #if defined(VOSS_ENABLED) |
| 56 | #include "vos_status.h" |
| 57 | #include "vos_lock.h" |
| 58 | #endif //#if defined(VOSS_ENABLED) |
| 59 | |
| 60 | #include "palTimer.h" |
| 61 | #include "csrSupport.h" |
| 62 | #include "vos_nvitem.h" |
| 63 | #include "wlan_qct_tl.h" |
| 64 | |
| 65 | #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING |
| 66 | #include "csrNeighborRoam.h" |
| 67 | #endif |
| 68 | |
| 69 | #define CSR_MAX_STA (HAL_NUM_STA) |
| 70 | |
| 71 | #define CSR_SME_SCAN_FLAGS_DELETE_CACHE 0x80 |
| 72 | |
| 73 | #define CSR_TITAN_MAX_RATE_MIMO_CB 240 |
| 74 | #define CSR_TITAN_MAX_RATE_MIMO 126 |
| 75 | |
| 76 | //define scan return criteria. LIM should use these define as well |
| 77 | #define CSR_SCAN_RETURN_AFTER_ALL_CHANNELS ( 0 ) |
| 78 | #define CSR_SCAN_RETURN_AFTER_FIRST_MATCH ( 0x01 ) |
| 79 | #define CSR_SCAN_RETURN_AFTER_5_BAND_11d_FOUND ( 0x80 ) |
| 80 | #define CSR_SCAN_RETURN_AFTER_24_BAND_11d_FOUND ( 0x40 ) |
| 81 | #define CSR_SCAN_RETURN_AFTER_EITHER_BAND_11d_FOUND ( CSR_SCAN_RETURN_AFTER_5_BAND_11d_FOUND | CSR_SCAN_RETURN_AFTER_24_BAND_11d_FOUND ) |
Madan Mohan Koyyalamudi | 4c8c635 | 2012-10-15 16:40:16 -0700 | [diff] [blame] | 82 | #define CSR_NUM_RSSI_CAT 15 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 83 | #define CSR_MAX_STATISTICS_REQ 10 |
| 84 | |
| 85 | //Support for multiple session |
| 86 | #define CSR_SESSION_ID_INVALID 0xFF // session ID invalid |
| 87 | #define CSR_ROAM_SESSION_MAX 5 // No of sessions to be supported, and a |
| 88 | // session is for Infra, IBSS or BT-AMP |
| 89 | |
| 90 | #define CSR_IS_SESSION_VALID( pMac, sessionId ) ( ( (sessionId) < CSR_ROAM_SESSION_MAX ) \ |
| 91 | && ( (pMac)->roam.roamSession[(sessionId)].sessionActive ) ) |
| 92 | #define CSR_GET_SESSION( pMac, sessionId ) \ |
| 93 | ( \ |
| 94 | (sessionId < CSR_ROAM_SESSION_MAX) ? \ |
| 95 | (&(pMac)->roam.roamSession[(sessionId)]) :\ |
| 96 | NULL \ |
| 97 | ) |
| 98 | |
Madan Mohan Koyyalamudi | c4c0117 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 99 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) |
| 100 | #define CSR_IS_ROAM_PREFER_5GHZ( pMac ) \ |
| 101 | ( \ |
| 102 | (((pMac)->roam.configParam.nRoamPrefer5GHz)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \ |
| 103 | ) |
| 104 | #endif |
| 105 | |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 106 | //Support for "Fast roaming" (i.e., CCX, LFR, or 802.11r.) |
| 107 | #define CSR_BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN 15 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 108 | |
| 109 | typedef enum |
| 110 | { |
| 111 | //eCSR_CFG_DOT11_MODE_BEST = 0, |
| 112 | eCSR_CFG_DOT11_MODE_TAURUS = 0, |
| 113 | eCSR_CFG_DOT11_MODE_ABG, |
| 114 | eCSR_CFG_DOT11_MODE_11A, |
| 115 | eCSR_CFG_DOT11_MODE_11B, |
| 116 | eCSR_CFG_DOT11_MODE_11G, |
| 117 | eCSR_CFG_DOT11_MODE_11N, |
| 118 | eCSR_CFG_DOT11_MODE_POLARIS, |
| 119 | eCSR_CFG_DOT11_MODE_TITAN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 120 | #ifdef WLAN_FEATURE_11AC |
| 121 | eCSR_CFG_DOT11_MODE_11AC, |
| 122 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 123 | #ifdef WLAN_SOFTAP_FEATURE |
| 124 | eCSR_CFG_DOT11_MODE_11G_ONLY, |
| 125 | eCSR_CFG_DOT11_MODE_11N_ONLY, |
| 126 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 127 | #ifdef WLAN_FEATURE_11AC |
| 128 | eCSR_CFG_DOT11_MODE_11AC_ONLY, |
| 129 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 130 | //This value can never set to CFG. It is for CSR's internal use |
| 131 | eCSR_CFG_DOT11_MODE_AUTO, |
| 132 | }eCsrCfgDot11Mode; //Used to determine what to set to the WNI_CFG_DOT11_MODE |
| 133 | |
| 134 | typedef enum etCsrRoamCommands |
| 135 | { |
| 136 | eCsrRoamNoCommand, |
| 137 | eCsrRoamCommandScan, |
| 138 | eCsrRoamCommandRoam, |
| 139 | eCsrRoamCommandWmStatusChange, |
| 140 | eCsrRoamCommandSetKey, |
| 141 | eCsrRoamCommandRemoveKey, |
| 142 | |
| 143 | } eCsrRoamCommands; |
| 144 | |
| 145 | typedef enum |
| 146 | { |
| 147 | eCsrScanOther = 1, |
| 148 | eCsrScanLostLink1, |
| 149 | eCsrScanLostLink2, |
| 150 | eCsrScanLostLink3, |
| 151 | eCsrScanLostLink4, |
| 152 | eCsrScan11d1, //First 11d scan |
| 153 | eCsrScan11d2, //First 11d scan has failed |
| 154 | eCsrScan11dDone, //11d scan succeeded, try the rest of the channel |
| 155 | eCsrScanUserRequest, |
| 156 | eCsrScanGetResult, |
| 157 | eCsrScanSetBGScanParam, //used for HO too - bg scan request in NT Handoff sub-state |
| 158 | eCsrScanForSsid, |
| 159 | eCsrScanForCapsChange, |
| 160 | eCsrScanBGScanAbort, |
| 161 | eCsrScanBGScanEnable, |
| 162 | eCsrScanIdleScan, |
| 163 | eCsrScanGetScanChnInfo, //To get the list of channels scanned |
| 164 | |
| 165 | eCsrScanBgScan, // bg scan request in NRT & RT Handoff sub-states |
| 166 | eCsrScanProbeBss, // directed probe on an entry from the candidate list - HO |
| 167 | eCsrScanAbortBgScan, //aborting a BG scan (meaning the scan is triggered by LIM timer) |
| 168 | eCsrScanAbortNormalScan, //aborting a normal scan (the scan is trigger by eWNI_SME_SCAN_REQ) |
| 169 | eCsrScanP2PFindPeer |
| 170 | }eCsrScanReason; |
| 171 | |
| 172 | typedef enum |
| 173 | { |
| 174 | eCsrNoConnection, // Roaming because we have not established the initial connection. |
| 175 | eCsrCapsChange, // roaming because LIM reported a Capability change in the associated AP. |
| 176 | eCsrForcedDisassoc, // roaming becuase someone asked us to Disassoc and stay disassociated. |
| 177 | eCsrHddIssued, // roaming because an 802.11 request was issued to the driver. |
| 178 | eCsrLostLink1, // roaming because we lost link to an associated AP |
| 179 | eCsrLostLink2, |
| 180 | eCsrLostLink3, |
| 181 | eCsrForcedDisassocMICFailure, // roaming because we need to force a Disassoc due to MIC failure |
| 182 | eCsrHddIssuedReassocToSameAP, |
| 183 | eCsrSmeIssuedReassocToSameAP, |
| 184 | eCsrSmeIssuedReassocToDiffAP, |
| 185 | eCsrForcedDeauth, // roaming becuase someone asked us to deauth and stay disassociated. |
| 186 | eCsrSmeIssuedDisassocForHandoff, // will be issued by Handoff logic to disconect from current AP |
| 187 | eCsrSmeIssuedAssocToSimilarAP, // will be issued by Handoff logic to join a new AP with same profile |
| 188 | eCsrSmeIssuedIbssJoinFailure, // ibss join timer fired before any perr showed up, so shut down the network |
| 189 | eCsrForcedIbssLeave, |
| 190 | eCsrStopBss, |
| 191 | eCsrSmeIssuedFTReassoc, |
| 192 | eCsrForcedDisassocSta, |
| 193 | eCsrForcedDeauthSta, |
Madan Mohan Koyyalamudi | 286b60e | 2012-10-11 12:59:07 -0700 | [diff] [blame] | 194 | eCsrPerformPreauth, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 195 | |
| 196 | }eCsrRoamReason; |
| 197 | |
| 198 | typedef enum |
| 199 | { |
| 200 | eCSR_ROAM_SUBSTATE_NONE = 0, |
| 201 | eCSR_ROAM_SUBSTATE_START_BSS_REQ, |
| 202 | eCSR_ROAM_SUBSTATE_JOIN_REQ, |
| 203 | eCSR_ROAM_SUBSTATE_REASSOC_REQ, |
| 204 | eCSR_ROAM_SUBSTATE_DISASSOC_REQ, |
| 205 | eCSR_ROAM_SUBSTATE_STOP_BSS_REQ, |
| 206 | eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING, //Continue the current roam command after disconnect |
| 207 | eCSR_ROAM_SUBSTATE_AUTH_REQ, |
| 208 | eCSR_ROAM_SUBSTATE_CONFIG, |
| 209 | eCSR_ROAM_SUBSTATE_DEAUTH_REQ, |
| 210 | eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN, |
| 211 | eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE, |
| 212 | eCSR_ROAM_SUBSTATE_DISASSOC_FORCED, |
| 213 | eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY, |
| 214 | eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF, |
| 215 | eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC, |
| 216 | eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC, |
| 217 | eCSR_ROAM_SUBSTATE_JOINED_REALTIME_TRAFFIC, |
| 218 | // max is 15 unless the bitfield is expanded... |
| 219 | } eCsrRoamSubState; |
| 220 | |
| 221 | |
| 222 | typedef enum |
| 223 | { |
| 224 | eCSR_ROAMING_STATE_STOP = 0, |
| 225 | eCSR_ROAMING_STATE_IDLE, |
| 226 | eCSR_ROAMING_STATE_SCANNING, |
| 227 | eCSR_ROAMING_STATE_JOINING, |
| 228 | eCSR_ROAMING_STATE_JOINED, |
| 229 | }eCsrRoamState; |
| 230 | |
| 231 | |
| 232 | typedef enum |
| 233 | { |
| 234 | eCsrContinueRoaming, |
| 235 | eCsrStopRoaming, |
| 236 | eCsrStartIbss, |
| 237 | eCsrStartIbssSameIbss, |
| 238 | eCsrReassocToSelfNoCapChange, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 239 | eCsrStopRoamingDueToConcurrency, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 240 | |
| 241 | }eCsrJoinState; |
| 242 | |
| 243 | typedef enum |
| 244 | { |
| 245 | eCsrNotRoaming, |
| 246 | eCsrLostlinkRoamingDisassoc, |
| 247 | eCsrLostlinkRoamingDeauth, |
| 248 | eCsrDynamicRoaming, |
| 249 | eCsrReassocRoaming, |
| 250 | }eCsrRoamingReason; |
| 251 | |
| 252 | typedef enum |
| 253 | { |
| 254 | eCsrDisassociated, |
| 255 | eCsrDeauthenticated |
| 256 | |
| 257 | }eCsrRoamWmStatusChangeTypes; |
| 258 | |
| 259 | typedef enum |
| 260 | { |
| 261 | eCsrSummaryStats = 0, |
| 262 | eCsrGlobalClassAStats, |
| 263 | eCsrGlobalClassBStats, |
| 264 | eCsrGlobalClassCStats, |
| 265 | eCsrGlobalClassDStats, |
| 266 | eCsrPerStaStats, |
| 267 | eCsrMaxStats |
| 268 | }eCsrRoamStatsClassTypes; |
| 269 | |
| 270 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 271 | typedef enum |
| 272 | { |
| 273 | eCSR_WLAN_STATUS_CONNECT =0, |
| 274 | eCSR_WLAN_STATUS_DISCONNECT |
| 275 | |
| 276 | }eCsrDiagWlanStatusEventSubtype; |
| 277 | |
| 278 | typedef enum |
| 279 | { |
| 280 | eCSR_REASON_UNSPECIFIED = 0, |
| 281 | eCSR_REASON_USER_REQUESTED, |
| 282 | eCSR_REASON_MIC_ERROR, |
| 283 | eCSR_REASON_DISASSOC, |
| 284 | eCSR_REASON_DEAUTH, |
| 285 | eCSR_REASON_HANDOFF, |
| 286 | |
| 287 | }eCsrDiagWlanStatusEventReason; |
| 288 | |
| 289 | typedef enum |
| 290 | { |
| 291 | eCSR_WLAN_HANDOFF_EVENT =0, |
| 292 | |
| 293 | }eCsrDiagWlanHandoffEventSubtype; |
| 294 | |
| 295 | typedef enum |
| 296 | { |
| 297 | eCSR_WLAN_VCC_EVENT =0, |
| 298 | |
| 299 | }eCsrDiagWlanVccEventSubtype; |
| 300 | |
| 301 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 302 | |
| 303 | typedef struct tagCsrChannel |
| 304 | { |
| 305 | tANI_U8 numChannels; |
| 306 | tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN]; |
| 307 | }tCsrChannel; |
| 308 | |
| 309 | typedef struct tagScanProfile |
| 310 | { |
| 311 | tANI_U32 minChnTime; |
| 312 | tANI_U32 maxChnTime; |
| 313 | tANI_U32 restTime; //This is ignored if not associated |
| 314 | tANI_U32 numOfChannels; |
| 315 | tANI_U8 *pChannelList; |
| 316 | tSirScanType scanType; //active or passive |
| 317 | eCsrRoamBssType bssType; //BSS or IBSS |
| 318 | tANI_U8 ssid[WNI_CFG_SSID_LEN]; |
| 319 | tANI_U8 bReturnAfter1stMatch; |
| 320 | tANI_U8 fUniqueResult; |
| 321 | tANI_U8 freshScan; |
| 322 | tCsrBssid bssid; |
| 323 | }tScanProfile; |
| 324 | |
| 325 | typedef struct tagBssConfigParam |
| 326 | { |
| 327 | eCsrMediaAccessType qosType; |
| 328 | tSirMacSSid SSID; |
| 329 | tANI_U32 uRTSThresh; |
| 330 | tANI_U32 uDeferThresh; // |
| 331 | eCsrCfgDot11Mode uCfgDot11Mode; |
| 332 | eCsrBand eBand; |
| 333 | tANI_U8 standardRate[CSR_DOT11_SUPPORTED_RATES_MAX]; |
| 334 | tANI_U8 extendedRate[CSR_DOT11_EXTENDED_SUPPORTED_RATES_MAX]; |
| 335 | eCsrExposedTxRate txRate; |
| 336 | tAniAuthType authType; |
| 337 | eCsrEncryptionType encType; |
| 338 | tANI_U32 uShortSlotTime; |
| 339 | tANI_U32 uHTSupport; //High throughput |
| 340 | tANI_U32 uPowerLimit; |
| 341 | tANI_U32 uHeartBeatThresh; |
| 342 | tANI_U32 uJoinTimeOut; |
| 343 | tSirMacCapabilityInfo BssCap; |
| 344 | tANI_BOOLEAN f11hSupport; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 345 | ePhyChanBondState cbMode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 346 | }tBssConfigParam; |
| 347 | |
| 348 | |
| 349 | typedef struct tagCsrRoamStartBssParams |
| 350 | { |
| 351 | tSirMacSSid ssId; |
| 352 | tCsrBssid bssid; //this is the BSSID for the party we want to join (only use for IBSS or WDS) |
| 353 | tSirNwType sirNwType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 354 | ePhyChanBondState cbMode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 355 | tSirMacRateSet operationalRateSet; |
| 356 | tSirMacRateSet extendedRateSet; |
| 357 | tANI_U8 operationChn; |
| 358 | eCsrCfgDot11Mode uCfgDot11Mode; |
| 359 | #ifdef WLAN_SOFTAP_FEATURE |
| 360 | tANI_U8 privacy; |
| 361 | tANI_BOOLEAN fwdWPSPBCProbeReq; |
| 362 | tANI_BOOLEAN protEnabled; |
| 363 | tANI_BOOLEAN obssProtEnabled; |
| 364 | tAniAuthType authType; |
| 365 | tANI_U16 beaconInterval; //If this is 0, SME will fill in for caller. |
| 366 | tANI_U16 ht_protection; |
| 367 | tANI_U32 dtimPeriod; |
| 368 | tANI_U8 ApUapsdEnable; |
| 369 | tANI_U8 ssidHidden; |
| 370 | tANI_U8 wps_state; |
| 371 | #endif |
| 372 | tVOS_CON_MODE bssPersona; |
| 373 | tANI_U16 nRSNIELength; //The byte count in the pRSNIE, if 0, pRSNIE is ignored. |
| 374 | tANI_U8 *pRSNIE; //If not null, it has the IE byte stream for RSN |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 375 | tANI_BOOLEAN updatebeaconInterval; //Flag used to indicate update |
| 376 | // beaconInterval |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 377 | }tCsrRoamStartBssParams; |
| 378 | |
| 379 | |
| 380 | typedef struct tagScanCmd |
| 381 | { |
| 382 | tANI_U32 scanID; |
| 383 | csrScanCompleteCallback callback; |
| 384 | void *pContext; |
| 385 | eCsrScanReason reason; |
| 386 | eCsrRoamState lastRoamState[CSR_ROAM_SESSION_MAX]; |
| 387 | tCsrRoamProfile *pToRoamProfile; |
| 388 | tANI_U32 roamId; //this is the ID related to the pToRoamProfile |
| 389 | union |
| 390 | { |
| 391 | tCsrScanRequest scanRequest; |
| 392 | tCsrBGScanRequest bgScanRequest; |
| 393 | }u; |
| 394 | }tScanCmd; |
| 395 | |
| 396 | typedef struct tagRoamCmd |
| 397 | { |
| 398 | tANI_U32 roamId; |
| 399 | eCsrRoamReason roamReason; |
| 400 | tCsrRoamProfile roamProfile; |
| 401 | tScanResultHandle hBSSList; //BSS list fits the profile |
| 402 | tListElem *pRoamBssEntry; //point to the current BSS in the list that is roaming. It starts from head to tail |
| 403 | tSirBssDescription *pLastRoamBss; //the last BSS we try and failed |
| 404 | tANI_BOOLEAN fReleaseBssList; //whether to free hBSSList |
| 405 | tANI_BOOLEAN fReleaseProfile; //whether to free roamProfile |
| 406 | tANI_BOOLEAN fReassoc; //whether this command is for reassociation |
| 407 | tANI_BOOLEAN fUpdateCurRoamProfile; //whether pMac->roam.pCurRoamProfile needs to be updated |
| 408 | //this is for CSR internal used only. And it should not be assigned when creating the command |
| 409 | //This causes the roam command not to do anything. |
| 410 | tANI_BOOLEAN fReassocToSelfNoCapChange; |
| 411 | |
| 412 | tANI_BOOLEAN fStopWds; |
| 413 | tSirMacAddr peerMac; |
| 414 | tSirMacReasonCodes reason; |
| 415 | }tRoamCmd; |
| 416 | |
| 417 | typedef struct tagSetKeyCmd |
| 418 | { |
| 419 | tANI_U32 roamId; |
| 420 | eCsrEncryptionType encType; |
| 421 | eCsrAuthType authType; |
| 422 | tAniKeyDirection keyDirection; //Tx, Rx or Tx-and-Rx |
| 423 | tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key |
| 424 | tANI_U8 paeRole; //0 for supplicant |
| 425 | tANI_U8 keyId; // Kye index |
| 426 | tANI_U8 keyLength; //Number of bytes containing the key in pKey |
| 427 | tANI_U8 Key[CSR_MAX_KEY_LEN]; |
| 428 | tANI_U8 keyRsc[CSR_MAX_RSC_LEN]; |
| 429 | } tSetKeyCmd; |
| 430 | |
| 431 | typedef struct tahRemoveKeyCmd |
| 432 | { |
| 433 | tANI_U32 roamId; |
| 434 | eCsrEncryptionType encType; |
| 435 | eCsrAuthType authType; |
| 436 | tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key |
| 437 | tANI_U8 keyId; //key index |
| 438 | } tRemoveKeyCmd; |
| 439 | |
| 440 | typedef struct tagWmStatusChangeCmd |
| 441 | { |
| 442 | eCsrRoamWmStatusChangeTypes Type; |
| 443 | union |
| 444 | { |
| 445 | tSirSmeDeauthInd DeauthIndMsg; |
| 446 | tSirSmeDisassocInd DisassocIndMsg; |
| 447 | }u; |
| 448 | |
| 449 | }tWmStatusChangeCmd; |
| 450 | |
| 451 | typedef struct tagAddStaForSessionCmd |
| 452 | { |
| 453 | //Session self mac addr |
| 454 | tSirMacAddr selfMacAddr; |
| 455 | }tAddStaForSessionCmd; |
| 456 | |
| 457 | typedef struct tagDelStaForSessionCmd |
| 458 | { |
| 459 | //Session self mac addr |
| 460 | tSirMacAddr selfMacAddr; |
| 461 | csrRoamSessionCloseCallback callback; |
| 462 | void *pContext; |
| 463 | }tDelStaForSessionCmd; |
| 464 | |
| 465 | //This structure represents one scan request |
| 466 | typedef struct tagCsrCmd |
| 467 | { |
| 468 | tListElem Link; |
| 469 | eCsrRoamCommands command; |
| 470 | tANI_U8 sessionId; // Session ID for this command |
| 471 | union |
| 472 | { |
| 473 | tScanCmd scanCmd; |
| 474 | tRoamCmd roamCmd; |
| 475 | tWmStatusChangeCmd wmStatusChangeCmd; |
| 476 | tSetKeyCmd setKeyCmd; |
| 477 | tRemoveKeyCmd removeKeyCmd; |
| 478 | tAddStaForSessionCmd addStaSessionCmd; |
| 479 | tDelStaForSessionCmd delStaSessionCmd; |
| 480 | }u; |
| 481 | }tCsrCmd; |
| 482 | |
| 483 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 484 | typedef struct tagCsr11rConfig |
| 485 | { |
| 486 | tANI_BOOLEAN IsFTResourceReqSupported; |
| 487 | } tCsr11rConfig; |
| 488 | #endif |
| 489 | |
| 490 | #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING |
| 491 | typedef struct tagCsrNeighborRoamConfig |
| 492 | { |
| 493 | tANI_U32 nNeighborScanTimerPeriod; |
| 494 | tANI_U8 nNeighborLookupRssiThreshold; |
| 495 | tANI_U8 nNeighborReassocRssiThreshold; |
| 496 | tANI_U16 nNeighborScanMinChanTime; |
| 497 | tANI_U16 nNeighborScanMaxChanTime; |
| 498 | sCsrChannel neighborScanChanList; |
| 499 | tANI_U8 nMaxNeighborRetries; |
| 500 | tANI_U16 nNeighborResultsRefreshPeriod; |
Srinivas Girigowda | 6fa5866 | 2013-02-14 16:31:48 -0800 | [diff] [blame^] | 501 | tANI_U16 nEmptyScanRefreshPeriod; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 502 | }tCsrNeighborRoamConfig; |
| 503 | #endif |
| 504 | |
| 505 | typedef struct tagCsrConfig |
| 506 | { |
| 507 | tANI_U32 agingCount; |
| 508 | tANI_U32 FragmentationThreshold; |
| 509 | tANI_U32 channelBondingMode24GHz; |
| 510 | tANI_U32 channelBondingMode5GHz; |
| 511 | tANI_U32 RTSThreshold; |
| 512 | eCsrPhyMode phyMode; |
| 513 | eCsrCfgDot11Mode uCfgDot11Mode; |
| 514 | eCsrBand eBand; |
| 515 | tANI_U32 HeartbeatThresh50; |
| 516 | tANI_U32 HeartbeatThresh24; |
| 517 | tANI_U32 bgScanInterval; |
| 518 | eCsrCBChoice cbChoice; |
| 519 | eCsrBand bandCapability; //indicate hw capability |
| 520 | eCsrRoamWmmUserModeType WMMSupportMode; |
| 521 | tANI_BOOLEAN Is11eSupportEnabled; |
| 522 | tANI_BOOLEAN Is11dSupportEnabled; |
| 523 | tANI_BOOLEAN Is11dSupportEnabledOriginal; |
| 524 | tANI_BOOLEAN Is11hSupportEnabled; |
| 525 | tANI_BOOLEAN shortSlotTime; |
| 526 | tANI_BOOLEAN ProprietaryRatesEnabled; |
| 527 | tANI_BOOLEAN fenableMCCMode; |
| 528 | tANI_U16 TxRate; |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 529 | tANI_U8 fAllowMCCGODiffBI; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 530 | tANI_U8 AdHocChannel24; |
| 531 | tANI_U8 AdHocChannel5G; |
| 532 | tANI_U32 impsSleepTime; //in units of microseconds |
| 533 | tANI_U32 scanAgeTimeNCNPS; //scan result aging time threshold when Not-Connect-No-Power-Save, in seconds |
| 534 | tANI_U32 scanAgeTimeNCPS; //scan result aging time threshold when Not-Connect-Power-Save, in seconds |
| 535 | tANI_U32 scanAgeTimeCNPS; //scan result aging time threshold when Connect-No-Power-Save, in seconds, |
| 536 | tANI_U32 scanAgeTimeCPS; //scan result aging time threshold when Connect-Power-Savein seconds |
| 537 | tANI_U32 BssPreferValue[CSR_NUM_RSSI_CAT]; //each RSSI category has one value |
| 538 | int RSSICat[CSR_NUM_RSSI_CAT]; |
| 539 | tANI_U8 bCatRssiOffset; //to set the RSSI difference for each category |
| 540 | tANI_U32 nRoamingTime; //In seconds, CSR will try this long before gives up, 0 means no roaming |
| 541 | //Whether to limit the channels to the ones set in Csr11dInfo. If true, the opertaional |
| 542 | //channels are limited to the default channel list. It is an "AND" operation between the |
| 543 | //default channels and the channels in the 802.11d IE. |
| 544 | tANI_BOOLEAN fEnforce11dChannels; |
| 545 | //Country Code Priority |
| 546 | //0 = 802.11D > Configured Country > NV |
| 547 | //1 = Configured Country > 802.11D > NV |
| 548 | tANI_BOOLEAN fSupplicantCountryCodeHasPriority; |
| 549 | //When true, AP with unknown country code won't be see. |
| 550 | //"Unknown country code" means either Ap doesn't have 11d IE or we cannot |
| 551 | //find a domain for the country code in its 11d IE. |
| 552 | tANI_BOOLEAN fEnforceCountryCodeMatch; |
| 553 | //When true, only APs in the default domain can be seen. If the Ap has "unknown country |
| 554 | //code", or the doamin of the country code doesn't match the default domain, the Ap is |
| 555 | //not acceptable. |
| 556 | tANI_BOOLEAN fEnforceDefaultDomain; |
| 557 | |
| 558 | tANI_U16 vccRssiThreshold; |
| 559 | tANI_U32 vccUlMacLossThreshold; |
| 560 | |
| 561 | tANI_U32 nPassiveMinChnTime; //in units of milliseconds |
| 562 | tANI_U32 nPassiveMaxChnTime; //in units of milliseconds |
| 563 | tANI_U32 nActiveMinChnTime; //in units of milliseconds |
| 564 | tANI_U32 nActiveMaxChnTime; //in units of milliseconds |
Madan Mohan Koyyalamudi | 4ff9cd6 | 2012-10-30 17:48:57 -0700 | [diff] [blame] | 565 | #ifdef WLAN_AP_STA_CONCURRENCY |
| 566 | tANI_U32 nPassiveMinChnTimeConc; //in units of milliseconds |
| 567 | tANI_U32 nPassiveMaxChnTimeConc; //in units of milliseconds |
| 568 | tANI_U32 nActiveMinChnTimeConc; //in units of milliseconds |
| 569 | tANI_U32 nActiveMaxChnTimeConc; //in units of milliseconds |
| 570 | tANI_U32 nRestTimeConc; //in units of milliseconds |
Madan Mohan Koyyalamudi | 8591f09 | 2012-12-17 13:04:30 -0800 | [diff] [blame] | 571 | tANI_U8 nNumChanCombinedConc; //number of channels combined |
| 572 | //in each split scan operation |
Madan Mohan Koyyalamudi | 4ff9cd6 | 2012-10-30 17:48:57 -0700 | [diff] [blame] | 573 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 574 | |
| 575 | tANI_BOOLEAN IsIdleScanEnabled; |
| 576 | //in dBm, the maximum TX power |
| 577 | //The actual TX power is the lesser of this value and 11d. |
| 578 | //If 11d is disable, the lesser of this and default setting. |
| 579 | tANI_U8 nTxPowerCap; |
| 580 | tANI_U32 statsReqPeriodicity; //stats request frequency from PE while in full power |
| 581 | tANI_U32 statsReqPeriodicityInPS;//stats request frequency from PE while in power save |
| 582 | #ifdef WLAN_SOFTAP_FEATURE |
| 583 | tANI_U32 dtimPeriod; |
| 584 | tANI_BOOLEAN ssidHidden; |
| 585 | #endif |
| 586 | |
| 587 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 588 | tCsr11rConfig csr11rConfig; |
| 589 | #endif |
| 590 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 591 | #ifdef FEATURE_WLAN_LFR |
| 592 | tANI_U8 isFastRoamIniFeatureEnabled; |
| 593 | #endif |
| 594 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 595 | #ifdef FEATURE_WLAN_CCX |
| 596 | tANI_U8 isCcxIniFeatureEnabled; |
| 597 | #endif |
| 598 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 599 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 600 | tANI_U8 isFastTransitionEnabled; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 601 | tANI_U8 RoamRssiDiff; |
Madan Mohan Koyyalamudi | f4289db | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 602 | tANI_U8 nImmediateRoamRssiDiff; |
Madan Mohan Koyyalamudi | c4c0117 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 603 | tANI_BOOLEAN nRoamPrefer5GHz; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 604 | #endif |
| 605 | |
| 606 | #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING |
| 607 | tCsrNeighborRoamConfig neighborRoamConfig; |
| 608 | #endif |
| 609 | |
| 610 | /* Instead of Reassoc, send ADDTS/DELTS even when ACM is off for that AC |
| 611 | * This is mandated by WMM-AC certification */ |
| 612 | tANI_BOOLEAN addTSWhenACMIsOff; |
| 613 | |
| 614 | tANI_BOOLEAN fValidateList; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 615 | //Remove this code once SLM_Sessionization is supported |
| 616 | //BMPS_WORKAROUND_NOT_NEEDED |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 617 | tANI_BOOLEAN doBMPSWorkaround; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 618 | |
| 619 | //To enable/disable scanning 2.4Ghz channels twice on a single scan request from HDD |
| 620 | tANI_BOOLEAN fScanTwice; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 621 | #ifdef WLAN_FEATURE_11AC |
| 622 | tANI_U32 nVhtChannelWidth; |
Shailender Karmuchi | 31f9ebe | 2013-01-17 12:51:24 -0800 | [diff] [blame] | 623 | tANI_U8 txBFEnable; |
Shailender Karmuchi | 95934c3 | 2013-02-16 18:18:33 -0800 | [diff] [blame] | 624 | tANI_U8 txBFCsnValue; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 625 | #endif |
Gopichand Nakkala | b7ed0a6 | 2013-01-04 11:41:02 -0800 | [diff] [blame] | 626 | tANI_U8 txLdpcEnable; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 627 | |
| 628 | }tCsrConfig; |
| 629 | |
| 630 | typedef struct tagCsrChannelPowerInfo |
| 631 | { |
| 632 | tListElem link; |
| 633 | tANI_U8 firstChannel; |
| 634 | tANI_U8 numChannels; |
| 635 | tANI_U8 txPower; |
| 636 | tANI_U8 interChannelOffset; |
| 637 | }tCsrChannelPowerInfo; |
| 638 | |
| 639 | typedef struct tagRoamJoinStatus |
| 640 | { |
| 641 | tSirResultCodes statusCode; |
| 642 | //this is set to unspecified if statusCode indicates timeout. Or it is the failed reason from the other BSS(per 802.11 spec) |
| 643 | tANI_U32 reasonCode; |
| 644 | }tCsrRoamJoinStatus; |
| 645 | |
| 646 | typedef struct tagCsrOsChannelMask |
| 647 | { |
| 648 | tANI_U8 numChannels; |
| 649 | tANI_BOOLEAN scanEnabled[WNI_CFG_VALID_CHANNEL_LIST_LEN]; |
| 650 | tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN]; |
| 651 | }tCsrOsChannelMask; |
| 652 | |
| 653 | |
| 654 | typedef struct tagCsrScanStruct |
| 655 | { |
| 656 | tScanProfile scanProfile; |
| 657 | tANI_U32 nextScanID; |
Madan Mohan Koyyalamudi | ca43cdf | 2012-09-24 13:15:49 -0700 | [diff] [blame] | 658 | tDblLinkList scanResultList; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 659 | tDblLinkList tempScanResults; |
| 660 | tANI_BOOLEAN fScanEnable; |
| 661 | tANI_BOOLEAN fFullScanIssued; |
| 662 | tPalTimerHandle hTimerGetResult; |
| 663 | #ifdef WLAN_AP_STA_CONCURRENCY |
| 664 | tPalTimerHandle hTimerStaApConcTimer; |
| 665 | #endif |
| 666 | tPalTimerHandle hTimerIdleScan; |
| 667 | tPalTimerHandle hTimerResultAging; |
Madan Mohan Koyyalamudi | 7da2fd7 | 2012-12-17 14:44:16 -0800 | [diff] [blame] | 668 | tPalTimerHandle hTimerResultCfgAging; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 669 | tPalTimerHandle hTimerBgScan; |
| 670 | //changes on every scan, it is used as a flag for whether 11d info is found on every scan |
Madan Mohan Koyyalamudi | 7da2fd7 | 2012-12-17 14:44:16 -0800 | [diff] [blame] | 671 | tANI_U8 channelOf11dInfo; |
| 672 | tANI_U8 scanResultCfgAgingTime; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 673 | //changes on every scan, a flag to tell whether conflict 11d info found on each BSS |
| 674 | tANI_BOOLEAN fAmbiguous11dInfoFound; |
| 675 | //Tush: changes on every scan, a flag to tell whether the applied 11d info present in one of the scan results |
| 676 | tANI_BOOLEAN fCurrent11dInfoMatch; |
| 677 | tANI_BOOLEAN f11dInfoReset; //to indicate whether the 11d info in CFG is reset to default |
| 678 | tSirScanType curScanType; |
| 679 | tCsrChannel baseChannels; //This are all the supported channels AND(&) to the current eBand |
| 680 | tCsrChannel channels11d; |
| 681 | tChannelListWithPower defaultPowerTable[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV |
| 682 | tChannelListWithPower defaultPowerTable40MHz[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV |
| 683 | tANI_U32 numChannelsDefault; //total channels of NV |
| 684 | tCsrChannel base20MHzChannels; //The channel base to work on |
| 685 | tCsrChannel base40MHzChannels; //center channels for 40MHz channels |
| 686 | tDblLinkList channelPowerInfoList24; |
| 687 | tDblLinkList channelPowerInfoList5G; |
| 688 | tANI_U32 nLastAgeTimeOut; |
| 689 | tANI_U32 nAgingCountDown; |
| 690 | tANI_U8 countryCodeDefault[WNI_CFG_COUNTRY_CODE_LEN+1]; //The country code from NV |
| 691 | tANI_U8 countryCodeCurrent[WNI_CFG_COUNTRY_CODE_LEN+1]; |
| 692 | tANI_U8 countryCode11d[WNI_CFG_COUNTRY_CODE_LEN+1]; |
| 693 | v_REGDOMAIN_t domainIdDefault; //default regulatory domain |
| 694 | v_REGDOMAIN_t domainIdCurrent; //current regulatory domain |
| 695 | tANI_BOOLEAN f11dInfoApplied; |
| 696 | tANI_BOOLEAN fCancelIdleScan; |
| 697 | #ifdef FEATURE_WLAN_WAPI |
| 698 | // tANI_U16 NumBkidCandidate; |
| 699 | // tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED]; /* Move this as part of SessionEntry */ |
| 700 | #endif /* FEATURE_WLAN_WAPI */ |
| 701 | tANI_U8 numBGScanChannel; //number of valid channels in the bgScanChannelList |
| 702 | tANI_U8 bgScanChannelList[WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN]; |
| 703 | //the ChannelInfo member is not used in this structure. |
| 704 | //numBGScanChannel and bgScanChannelList are used for the BG scan channel info |
| 705 | tCsrBGScanRequest bgScanParams; |
| 706 | tANI_BOOLEAN fRestartIdleScan; |
| 707 | tANI_U32 nIdleScanTimeGap; //the time since last trying to trigger idle scan |
| 708 | tCsrOsChannelMask osScanChannelMask;//keep a track of channels to be scnned while in traffic condition |
| 709 | tANI_U16 nBssLimit; //the maximum number of BSS in scan cache |
| 710 | /*channelPowerInfoList24 has been seen corrupted. Set this flag to true trying to |
| 711 | * detect when it happens. Adding this into code because we can't reproduce it easily. |
| 712 | * We don't know when it happens. */ |
| 713 | tANI_BOOLEAN fValidateList; |
| 714 | /*Customer wants to start with an active scan based on the default country code. |
| 715 | * This optimization will minimize the driver load to association time. |
| 716 | * Based on this flag we will bypass the initial passive scan needed for 11d |
| 717 | * to determine the country code & domain */ |
| 718 | tANI_BOOLEAN fEnableBypass11d; |
| 719 | |
| 720 | /*Customer wants to optimize the scan time. Avoiding scans(passive) on DFS |
| 721 | * channels while swipping through both bands can save some time |
| 722 | * (apprx 1.3 sec) */ |
| 723 | tANI_BOOLEAN fEnableDFSChnlScan; |
| 724 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 725 | /* |
| 726 | * To enable/disable scanning only 2.4Ghz channels on first scan |
| 727 | */ |
| 728 | tANI_BOOLEAN fFirstScanOnly2GChnl; |
| 729 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 730 | tANI_BOOLEAN fDropScanCmd; //true means we don't accept scan commands |
| 731 | |
| 732 | #ifdef WLAN_AP_STA_CONCURRENCY |
| 733 | tDblLinkList scanCmdPendingList; |
| 734 | #endif |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 735 | tCsrChannel occupiedChannels; //This includes all channels on which candidate APs are found |
Madan Mohan Koyyalamudi | 3f65e31 | 2012-11-06 15:31:12 -0800 | [diff] [blame] | 736 | |
| 737 | tANI_BOOLEAN fIgnore_chan165; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 738 | }tCsrScanStruct; |
| 739 | |
Mohit Khanna | c0b992f | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 740 | #ifdef FEATURE_WLAN_TDLS |
| 741 | /* |
| 742 | * struct to carry TDLS discovery info.. |
| 743 | */ |
| 744 | typedef struct sCsrTdlsContext |
| 745 | { |
| 746 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 747 | tDblLinkList tdlsPotentialPeerList ; |
| 748 | tANI_U16 tdlsCommonFlag ; |
| 749 | tANI_U16 tdlsCommonState ; |
| 750 | #endif |
| 751 | tANI_U16 tdlsPeerCount ; |
| 752 | }tCsrTdlsCtxStruct; |
| 753 | |
| 754 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 755 | typedef struct sCsrTdlsPeerLinkInfo |
| 756 | { |
| 757 | tListElem tdlsPeerStaLink ; |
| 758 | tSirTdlsPeerInfo tdlsDisPeerInfo ; |
| 759 | }tCsrTdlsPeerLinkinfo ; |
| 760 | #endif |
| 761 | #endif |
| 762 | |
| 763 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 764 | |
| 765 | //Save the connected information. This structure + connectedProfile |
| 766 | //should contain all information about the connection |
| 767 | typedef struct tagRoamCsrConnectedInfo |
| 768 | { |
| 769 | tANI_U32 nBeaconLength; //the length, in bytes, of the beacon frame, can be 0 |
| 770 | tANI_U32 nAssocReqLength; //the length, in bytes, of the assoc req frame, can be 0 |
| 771 | tANI_U32 nAssocRspLength; //The length, in bytes, of the assoc rsp frame, can be 0 |
| 772 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 773 | tANI_U32 nRICRspLength; //Length of the parsed RIC response IEs received in reassoc response |
| 774 | #endif |
| 775 | #ifdef FEATURE_WLAN_CCX |
| 776 | tANI_U32 nTspecIeLength; |
| 777 | #endif |
| 778 | tANI_U8 *pbFrames; //Point to a buffer contain the beacon, assoc req, assoc rsp frame, in that order |
| 779 | //user needs to use nBeaconLength, nAssocReqLength, nAssocRspLength to desice where |
| 780 | //each frame starts and ends. |
| 781 | tANI_U8 staId; |
| 782 | }tCsrRoamConnectedInfo; |
| 783 | |
| 784 | |
| 785 | typedef struct tagCsrLinkQualityIndInfo |
| 786 | { |
| 787 | csrRoamLinkQualityIndCallback callback; |
| 788 | void *context; |
| 789 | }tCsrLinkQualityIndInfo; |
| 790 | |
| 791 | typedef struct tagCsrPeStatsReqInfo |
| 792 | { |
| 793 | tListElem link; /* list links */ |
| 794 | tANI_U32 statsMask; |
| 795 | tANI_U32 periodicity; |
| 796 | tANI_BOOLEAN rspPending; |
| 797 | vos_timer_t hPeStatsTimer; |
| 798 | tANI_BOOLEAN timerRunning; |
| 799 | tANI_U8 staId; |
| 800 | tANI_U8 numClient; |
| 801 | tpAniSirGlobal pMac; |
| 802 | /* To remember if the peStats timer is stopped successfully or not */ |
| 803 | tANI_BOOLEAN timerStopFailed; |
| 804 | |
| 805 | }tCsrPeStatsReqInfo; |
| 806 | |
| 807 | typedef struct tagCsrStatsClientReqInfo |
| 808 | { |
| 809 | tListElem link; /* list links */ |
| 810 | eCsrStatsRequesterType requesterId; |
| 811 | tCsrStatsCallback callback; |
| 812 | tANI_U32 periodicity; |
| 813 | void *pContext; |
| 814 | tANI_U32 statsMask; |
| 815 | tCsrPeStatsReqInfo *pPeStaEntry; |
| 816 | tANI_U8 staId; |
| 817 | vos_timer_t timer; |
| 818 | tANI_BOOLEAN timerExpired; |
| 819 | tpAniSirGlobal pMac; // TODO: Confirm this change BTAMP |
| 820 | }tCsrStatsClientReqInfo; |
| 821 | |
| 822 | typedef struct tagCsrTlStatsReqInfo |
| 823 | { |
| 824 | tANI_U32 periodicity; |
| 825 | tANI_BOOLEAN timerRunning; |
| 826 | tPalTimerHandle hTlStatsTimer; |
| 827 | tANI_U8 numClient; |
| 828 | }tCsrTlStatsReqInfo; |
| 829 | |
| 830 | typedef struct tagCsrRoamSession |
| 831 | { |
| 832 | tANI_U8 sessionId; // Session ID |
| 833 | tANI_BOOLEAN sessionActive; // TRUE if it is used |
| 834 | tCsrBssid selfMacAddr; // For BT-AMP station, this serve as BSSID for self-BSS. |
| 835 | csrRoamCompleteCallback callback; |
| 836 | void *pContext; |
| 837 | eCsrConnectState connectState; |
| 838 | tCsrRoamConnectedProfile connectedProfile; |
| 839 | tCsrRoamConnectedInfo connectedInfo; |
| 840 | tCsrRoamProfile *pCurRoamProfile; |
| 841 | tSirBssDescription *pConnectBssDesc; |
| 842 | tANI_U16 NumPmkidCache; |
| 843 | tPmkidCacheInfo PmkidCacheInfo[CSR_MAX_PMKID_ALLOWED]; |
| 844 | tANI_U8 cJoinAttemps; |
| 845 | //This may or may not have the up-to-date valid channel list |
| 846 | //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time |
| 847 | tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN]; |
| 848 | tANI_S32 sPendingCommands; //0 means CSR is ok to low power |
| 849 | #ifdef FEATURE_WLAN_WAPI |
| 850 | tANI_U16 NumBkidCache; |
| 851 | tBkidCacheInfo BkidCacheInfo[CSR_MAX_BKID_ALLOWED]; |
| 852 | #endif /* FEATURE_WLAN_WAPI */ |
| 853 | tANI_BOOLEAN fRoaming; //indicate whether CSR is roaming (either via lostlink or dynamic roaming) |
| 854 | //to remember some parameters needed for START_BSS. |
| 855 | //All member must be set every time we try to join or start an IBSS or BT-AMP |
| 856 | tCsrRoamStartBssParams bssParams; |
| 857 | tANI_U32 nWpaRsnReqIeLength; //the byte count of pWpaRsnIE; |
| 858 | tANI_U8 *pWpaRsnReqIE; //this contain the WPA/RSN IE in assoc request or the one sent in beacon (IBSS) |
| 859 | tANI_U32 nWpaRsnRspIeLength; //the byte count for pWpaRsnRspIE |
| 860 | tANI_U8 *pWpaRsnRspIE; //this contain the WPA/RSN IE in beacon/probe rsp |
| 861 | #ifdef FEATURE_WLAN_WAPI |
| 862 | tANI_U32 nWapiReqIeLength; //the byte count of pWapiReqIE; |
| 863 | tANI_U8 *pWapiReqIE; //this contain the WAPI IE in assoc request or the one sent in beacon (IBSS) |
| 864 | tANI_U32 nWapiRspIeLength; //the byte count for pWapiRspIE |
| 865 | tANI_U8 *pWapiRspIE; //this contain the WAPI IE in beacon/probe rsp |
| 866 | #endif /* FEATURE_WLAN_WAPI */ |
| 867 | tANI_U32 nAddIEScanLength; //the byte count of pAddIeScanIE; |
| 868 | tANI_U8 *pAddIEScan; //this contains the additional IE in (unicast) probe request at the time of join |
| 869 | tANI_U32 nAddIEAssocLength; //the byte count for pAddIeAssocIE |
| 870 | tANI_U8 *pAddIEAssoc; //this contains the additional IE in (re) assoc request |
| 871 | |
| 872 | tANI_TIMESTAMP roamingStartTime; //in units of 10ms |
| 873 | tCsrTimerInfo roamingTimerInfo; |
| 874 | eCsrRoamingReason roamingReason; |
| 875 | tANI_BOOLEAN fCancelRoaming; |
| 876 | tPalTimerHandle hTimerRoaming; |
| 877 | tPalTimerHandle hTimerIbssJoining; |
| 878 | tCsrTimerInfo ibssJoinTimerInfo; |
| 879 | tANI_BOOLEAN ibss_join_pending; |
| 880 | eCsrRoamResult roamResult; //the roamResult that is used when the roaming timer fires |
| 881 | tCsrRoamJoinStatus joinFailStatusCode; //This is the reason code for join(assoc) failure |
| 882 | //The status code returned from PE for deauth or disassoc (in case of lostlink), or our own dynamic roaming |
| 883 | tANI_U32 roamingStatusCode; |
| 884 | tANI_U16 NumPmkidCandidate; |
| 885 | tPmkidCandidateInfo PmkidCandidateInfo[CSR_MAX_PMKID_ALLOWED]; |
| 886 | #ifdef FEATURE_WLAN_WAPI |
| 887 | tANI_U16 NumBkidCandidate; |
| 888 | tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED]; |
| 889 | #endif |
| 890 | tANI_BOOLEAN fWMMConnection; |
| 891 | #ifdef FEATURE_WLAN_BTAMP_UT_RF |
| 892 | //To retry a join later when it fails if so desired |
| 893 | tPalTimerHandle hTimerJoinRetry; |
| 894 | tCsrTimerInfo joinRetryTimerInfo; |
| 895 | tANI_U32 maxRetryCount; |
| 896 | #endif |
| 897 | #ifdef FEATURE_WLAN_CCX |
| 898 | tCsrCcxCckmInfo ccxCckmInfo; |
| 899 | tANI_BOOLEAN isPrevApInfoValid; |
| 900 | tSirMacSSid prevApSSID; |
| 901 | tCsrBssid prevApBssid; |
| 902 | tANI_U8 prevOpChannel; |
| 903 | tANI_U16 clientDissSecs; |
| 904 | tANI_U32 roamTS1; |
| 905 | #endif |
| 906 | tANI_U8 bRefAssocStartCnt; //Tracking assoc start indication |
Madan Mohan Koyyalamudi | ea22cdc | 2012-10-18 21:02:23 -0700 | [diff] [blame] | 907 | /* to force the AP initiate fresh 802.1x authentication after re-association need to clear |
| 908 | * the PMKID cache. To clear the cache in this particular case this is added |
| 909 | * it is needed by the HS 2.0 passpoint certification 5.2.a and b testcases */ |
| 910 | tANI_BOOLEAN fIgnorePMKIDCache; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 911 | } tCsrRoamSession; |
| 912 | |
| 913 | typedef struct tagCsrRoamStruct |
| 914 | { |
| 915 | tANI_U32 nextRoamId; |
| 916 | tDblLinkList roamCmdPendingList; |
| 917 | tDblLinkList channelList5G; |
| 918 | tDblLinkList channelList24; |
| 919 | tCsrConfig configParam; |
| 920 | tANI_U32 numChannelsEeprom; //total channels of eeprom |
| 921 | tCsrChannel base20MHzChannels; //The channel base to work on |
| 922 | tCsrChannel base40MHzChannels; //center channels for 40MHz channels |
| 923 | eCsrRoamState curState[CSR_ROAM_SESSION_MAX]; |
| 924 | eCsrRoamSubState curSubState[CSR_ROAM_SESSION_MAX]; |
| 925 | //This may or may not have the up-to-date valid channel list |
| 926 | //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time |
| 927 | tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN]; |
| 928 | tANI_U32 numValidChannels; //total number of channels in CFG |
| 929 | |
| 930 | tANI_S32 sPendingCommands; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 931 | tPalTimerHandle hTimerWaitForKey; //To support timeout for WaitForKey state |
| 932 | tCsrSummaryStatsInfo summaryStatsInfo; |
| 933 | tCsrGlobalClassAStatsInfo classAStatsInfo; |
| 934 | tCsrGlobalClassBStatsInfo classBStatsInfo; |
| 935 | tCsrGlobalClassCStatsInfo classCStatsInfo; |
| 936 | tCsrGlobalClassDStatsInfo classDStatsInfo; |
| 937 | tCsrPerStaStatsInfo perStaStatsInfo[CSR_MAX_STA]; |
| 938 | tDblLinkList statsClientReqList; |
| 939 | tDblLinkList peStatsReqList; |
| 940 | tCsrTlStatsReqInfo tlStatsReqInfo; |
| 941 | eCsrRoamLinkQualityInd vccLinkQuality; |
| 942 | tCsrLinkQualityIndInfo linkQualityIndInfo; |
| 943 | v_CONTEXT_t gVosContext; //used for interaction with TL |
| 944 | //To specify whether an association or a IBSS is WMM enabled |
| 945 | //This parameter is only valid during a join or start BSS command is being executed |
| 946 | //tANI_BOOLEAN fWMMConnection; /* Moving it to be part of roamsession */ |
| 947 | v_U8_t ucACWeights[WLANTL_MAX_AC]; |
| 948 | /* TODO : Upto here */ |
| 949 | tCsrTimerInfo WaitForKeyTimerInfo; |
| 950 | tCsrRoamSession *roamSession; |
| 951 | tANI_U32 transactionId; // Current transaction ID for internal use. |
| 952 | #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING |
| 953 | tCsrNeighborRoamControlInfo neighborRoamInfo; |
| 954 | #endif |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 955 | #ifdef FEATURE_WLAN_LFR |
| 956 | tANI_U8 isFastRoamIniFeatureEnabled; |
| 957 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 958 | #ifdef FEATURE_WLAN_CCX |
| 959 | tANI_U8 isCcxIniFeatureEnabled; |
| 960 | #endif |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 961 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) |
| 962 | tANI_U8 RoamRssiDiff; |
| 963 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 964 | }tCsrRoamStruct; |
| 965 | |
| 966 | |
| 967 | #define GET_NEXT_ROAM_ID(pRoamStruct) (((pRoamStruct)->nextRoamId + 1 == 0) ? 1 : (pRoamStruct)->nextRoamId) |
| 968 | #define CSR_IS_ROAM_STATE(pMac, state, sessionId) ( (state) == (pMac)->roam.curState[sessionId] ) |
| 969 | |
| 970 | #define CSR_IS_ROAM_STOP(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_STOP, sessionId ) |
| 971 | #define CSR_IS_ROAM_INIT(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_INIT, sessionId ) |
| 972 | #define CSR_IS_ROAM_SCANNING(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_SCANNING, sessionId ) |
| 973 | #define CSR_IS_ROAM_JOINING(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_JOINING, sessionId ) |
| 974 | #define CSR_IS_ROAM_IDLE(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_IDLE, sessionId ) |
| 975 | #define CSR_IS_ROAM_JOINED(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_JOINED, sessionId ) |
| 976 | |
| 977 | #define CSR_IS_ROAM_SUBSTATE(pMac, subState, sessionId) ((subState) == (pMac)->roam.curSubState[sessionId]) |
| 978 | #define CSR_IS_ROAM_SUBSTATE_JOIN_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOIN_REQ, sessionId) |
| 979 | #define CSR_IS_ROAM_SUBSTATE_AUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_AUTH_REQ, sessionId) |
| 980 | #define CSR_IS_ROAM_SUBSTATE_REASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_REASSOC_REQ, sessionId) |
| 981 | #define CSR_IS_ROAM_SUBSTATE_DISASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REQ, sessionId) |
| 982 | #define CSR_IS_ROAM_SUBSTATE_DISASSOC_NO_JOIN(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN, sessionId) |
| 983 | #define CSR_IS_ROAM_SUBSTATE_REASSOC_FAIL(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE, sessionId) |
| 984 | #define CSR_IS_ROAM_SUBSTATE_DISASSOC_FORCED(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_FORCED, sessionId) |
| 985 | #define CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DEAUTH_REQ, sessionId) |
| 986 | #define CSR_IS_ROAM_SUBSTATE_START_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_START_BSS_REQ, sessionId) |
| 987 | #define CSR_IS_ROAM_SUBSTATE_STOP_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_STOP_BSS_REQ, sessionId) |
| 988 | #define CSR_IS_ROAM_SUBSTATE_DISCONNECT_CONTINUE(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING, sessionId) |
| 989 | #define CSR_IS_ROAM_SUBSTATE_CONFIG(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_CONFIG, sessionId) |
| 990 | #define CSR_IS_ROAM_SUBSTATE_WAITFORKEY(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY, sessionId) |
| 991 | #define CSR_IS_ROAM_SUBSTATE_DISASSOC_HO(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF, sessionId) |
| 992 | #define CSR_IS_ROAM_SUBSTATE_HO_NT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC, sessionId) |
| 993 | #define CSR_IS_ROAM_SUBSTATE_HO_NRT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC, sessionId) |
| 994 | #define CSR_IS_ROAM_SUBSTATE_HO_RT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_REALTIME_TRAFFIC, sessionId) |
| 995 | |
| 996 | #define CSR_IS_PHY_MODE_B_ONLY(pMac) \ |
| 997 | ((eCSR_DOT11_MODE_11b == (pMac)->roam.configParam.phyMode) ||\ |
| 998 | (eCSR_DOT11_MODE_11b_ONLY == (pMac)->roam.configParam.phyMode)) |
| 999 | |
| 1000 | #define CSR_IS_PHY_MODE_G_ONLY(pMac) \ |
| 1001 | (eCSR_DOT11_MODE_11g == (pMac)->roam.configParam.phyMode || eCSR_DOT11_MODE_11g_ONLY == (pMac)->roam.configParam.phyMode) |
| 1002 | |
| 1003 | #define CSR_IS_PHY_MODE_A_ONLY(pMac) \ |
| 1004 | ((eCSR_DOT11_MODE_11a == (pMac)->roam.configParam.phyMode) ||\ |
| 1005 | (eCSR_DOT11_MODE_11a_ONLY == (pMac)->roam.configParam.phyMode)) |
| 1006 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1007 | #ifdef WLAN_FEATURE_11AC |
| 1008 | #define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \ |
| 1009 | ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \ |
| 1010 | (eCSR_DOT11_MODE_11ac & (phyMode)) || \ |
| 1011 | (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \ |
| 1012 | (eCSR_DOT11_MODE_AUTO & (phyMode))) |
| 1013 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1014 | #define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \ |
| 1015 | ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \ |
| 1016 | (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \ |
| 1017 | (eCSR_DOT11_MODE_AUTO & (phyMode))) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1018 | #endif |
| 1019 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1020 | |
| 1021 | // this function returns TRUE if the NIC is operating exclusively in the 2.4 GHz band, meaning |
| 1022 | // it is NOT operating in the 5.0 GHz band. |
| 1023 | #define CSR_IS_24_BAND_ONLY(pMac) \ |
| 1024 | (eCSR_BAND_24 == (pMac)->roam.configParam.eBand) |
| 1025 | |
| 1026 | #define CSR_IS_5G_BAND_ONLY(pMac) \ |
| 1027 | (eCSR_BAND_5G == (pMac)->roam.configParam.eBand) |
| 1028 | |
| 1029 | #define CSR_IS_RADIO_DUAL_BAND(pMac) \ |
| 1030 | (eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability) |
| 1031 | |
| 1032 | #define CSR_IS_RADIO_BG_ONLY(pMac) \ |
| 1033 | (eCSR_BAND_24 == (pMac)->roam.configParam.bandCapability) |
| 1034 | |
| 1035 | // this function returns TRUE if the NIC is operating exclusively in the 5.0 GHz band, meaning |
| 1036 | // it is NOT operating in the 2.4 GHz band |
| 1037 | #define CSR_IS_RADIO_A_ONLY(pMac) \ |
| 1038 | (eCSR_BAND_5G == (pMac)->roam.configParam.bandCapability) |
| 1039 | |
| 1040 | // this function returns TRUE if the NIC is operating in both bands. |
| 1041 | #define CSR_IS_OPEARTING_DUAL_BAND(pMac) \ |
| 1042 | ((eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability) && (eCSR_BAND_ALL == (pMac)->roam.configParam.eBand)) |
| 1043 | |
| 1044 | // this function returns TRUE if the NIC can operate in the 5.0 GHz band (could operate in the |
| 1045 | // 2.4 GHz band also). |
| 1046 | #define CSR_IS_OPERATING_A_BAND(pMac) \ |
| 1047 | (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_A_ONLY((pMac)) || CSR_IS_5G_BAND_ONLY((pMac))) |
| 1048 | |
| 1049 | // this function returns TRUE if the NIC can operate in the 2.4 GHz band (could operate in the |
| 1050 | // 5.0 GHz band also). |
| 1051 | #define CSR_IS_OPERATING_BG_BAND(pMac) \ |
| 1052 | (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_BG_ONLY((pMac)) || CSR_IS_24_BAND_ONLY((pMac))) |
| 1053 | |
| 1054 | #define CSR_IS_CHANNEL_5GHZ(chnNum) \ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1055 | (((chnNum) >= CSR_MIN_5GHz_CHANNEL_NUMBER) && ((chnNum) <= CSR_MAX_5GHz_CHANNEL_NUMBER)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1056 | |
Srinivas Girigowda | 6fa5866 | 2013-02-14 16:31:48 -0800 | [diff] [blame^] | 1057 | #define CSR_IS_CHANNEL_DFS(chnNum) \ |
| 1058 | (NV_CHANNEL_ENABLE != vos_nv_getChannelEnabledState(chnNum)) |
| 1059 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1060 | #define CSR_IS_CHANNEL_24GHZ(chnNum) \ |
| 1061 | (((chnNum) > 0) && ((chnNum) <= CSR_MAX_24GHz_CHANNEL_NUMBER)) |
| 1062 | |
| 1063 | #define CSR_IS_SAME_BAND_CHANNELS(ch1, ch2) (CSR_IS_CHANNEL_5GHZ(ch1) == CSR_IS_CHANNEL_5GHZ(ch2)) |
| 1064 | |
| 1065 | |
| 1066 | #define CSR_IS_11D_INFO_FOUND(pMac) \ |
| 1067 | (0 != (pMac)->scan.channelOf11dInfo) |
| 1068 | // DEAUTHIND |
| 1069 | #define CSR_IS_ROAMING(pSession) ((CSR_IS_LOSTLINK_ROAMING((pSession)->roamingReason)) || \ |
| 1070 | (eCsrDynamicRoaming == (pSession)->roamingReason) || \ |
| 1071 | (eCsrReassocRoaming == (pSession)->roamingReason)) |
| 1072 | |
| 1073 | |
| 1074 | #define CSR_IS_SET_KEY_COMMAND( pCommand ) ( eSmeCommandSetKey == (pCommand)->command ) |
| 1075 | |
| 1076 | #define CSR_IS_ADDTS_WHEN_ACMOFF_SUPPORTED(pMac) (pMac->roam.configParam.addTSWhenACMIsOff) |
| 1077 | // DEAUTHIND |
| 1078 | #define CSR_IS_LOSTLINK_ROAMING(reason) ((eCsrLostlinkRoamingDisassoc == (reason)) || (eCsrLostlinkRoamingDeauth == (reason))) |
| 1079 | |
| 1080 | //Stop CSR from asking for IMPS, This function doesn't disable IMPS from CSR |
| 1081 | void csrScanSuspendIMPS( tpAniSirGlobal pMac ); |
| 1082 | //Start CSR from asking for IMPS. This function doesn't trigger CSR to request entering IMPS |
| 1083 | //because IMPS maybe disabled. |
| 1084 | void csrScanResumeIMPS( tpAniSirGlobal pMac ); |
| 1085 | |
| 1086 | eHalStatus csrInitGetChannels(tpAniSirGlobal pMac); |
| 1087 | |
| 1088 | eHalStatus csrSetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId, |
| 1089 | tCsrRoamModifyProfileFields *pModifyProfileFields); |
| 1090 | /* --------------------------------------------------------------------------- |
| 1091 | \fn csrGetModifyProfileFields |
| 1092 | \brief HDD or SME - QOS calls this function to get the current values of |
| 1093 | connected profile fields changing which can cause reassoc. |
| 1094 | This function must be called after CFG is downloaded and STA is in connected |
| 1095 | state. |
| 1096 | \param pModifyProfileFields - pointer to the connected profile fields |
| 1097 | changing which can cause reassoc |
| 1098 | |
| 1099 | \return eHalStatus |
| 1100 | -------------------------------------------------------------------------------*/ |
| 1101 | eHalStatus csrGetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId, |
| 1102 | tCsrRoamModifyProfileFields * pModifyProfileFields); |
| 1103 | void csrSetGlobalCfgs( tpAniSirGlobal pMac ); |
| 1104 | void csrSetDefaultDot11Mode( tpAniSirGlobal pMac ); |
| 1105 | void csrScanSetChannelMask(tpAniSirGlobal pMac, tCsrChannelInfo *pChannelInfo); |
| 1106 | tANI_BOOLEAN csrIsConnStateDisconnected(tpAniSirGlobal pMac, tANI_U32 sessionId); |
| 1107 | tANI_BOOLEAN csrIsConnStateConnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId ); |
| 1108 | tANI_BOOLEAN csrIsConnStateDisconnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId ); |
| 1109 | tANI_BOOLEAN csrIsConnStateConnectedInfra( tpAniSirGlobal pMac, tANI_U32 sessionId ); |
| 1110 | tANI_BOOLEAN csrIsConnStateConnected( tpAniSirGlobal pMac, tANI_U32 sessionId ); |
| 1111 | tANI_BOOLEAN csrIsConnStateInfra( tpAniSirGlobal pMac, tANI_U32 sessionId ); |
| 1112 | tANI_BOOLEAN csrIsConnStateIbss( tpAniSirGlobal pMac, tANI_U32 sessionId ); |
| 1113 | tANI_BOOLEAN csrIsConnStateWds( tpAniSirGlobal pMac, tANI_U32 sessionId ); |
| 1114 | tANI_BOOLEAN csrIsConnStateConnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId ); |
| 1115 | tANI_BOOLEAN csrIsConnStateDisconnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId ); |
| 1116 | tANI_BOOLEAN csrIsAnySessionInConnectState( tpAniSirGlobal pMac ); |
| 1117 | tANI_BOOLEAN csrIsAllSessionDisconnected( tpAniSirGlobal pMac ); |
Madan Mohan Koyyalamudi | e8d6440 | 2012-12-04 16:49:55 -0800 | [diff] [blame] | 1118 | tANI_BOOLEAN csrIsStaSessionConnected( tpAniSirGlobal pMac ); |
| 1119 | tANI_BOOLEAN csrIsP2pSessionConnected( tpAniSirGlobal pMac ); |
Madan Mohan Koyyalamudi | d3d2259 | 2012-09-24 14:01:29 -0700 | [diff] [blame] | 1120 | tANI_BOOLEAN csrIsAnySessionConnected( tpAniSirGlobal pMac ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1121 | tANI_BOOLEAN csrIsInfraConnected( tpAniSirGlobal pMac ); |
| 1122 | tANI_BOOLEAN csrIsConcurrentInfraConnected( tpAniSirGlobal pMac ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1123 | tANI_BOOLEAN csrIsConcurrentSessionRunning( tpAniSirGlobal pMac ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1124 | tANI_BOOLEAN csrIsInfraApStarted( tpAniSirGlobal pMac ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1125 | tANI_BOOLEAN csrIsIBSSStarted( tpAniSirGlobal pMac ); |
| 1126 | tANI_BOOLEAN csrIsBTAMPStarted( tpAniSirGlobal pMac ); |
| 1127 | tANI_BOOLEAN csrIsBTAMP( tpAniSirGlobal pMac, tANI_U32 sessionId ); |
| 1128 | eHalStatus csrIsBTAMPAllowed( tpAniSirGlobal pMac, tANI_U32 chnId ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1129 | tANI_BOOLEAN csrIsValidMcConcurrentSession(tpAniSirGlobal pMac, tANI_U32 sessionId, |
| 1130 | tSirBssDescription *pBssDesc); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1131 | #ifdef WLAN_SOFTAP_FEATURE |
| 1132 | tANI_BOOLEAN csrIsConnStateConnectedInfraAp( tpAniSirGlobal pMac, tANI_U32 sessionId ); |
| 1133 | #endif |
| 1134 | /*---------------------------------------------------------------------------- |
| 1135 | \fn csrRoamRegisterLinkQualityIndCallback |
| 1136 | |
| 1137 | \brief |
| 1138 | a CSR function to allow HDD to register a callback handler with CSR for |
| 1139 | link quality indications. |
| 1140 | |
| 1141 | Only one callback may be registered at any time. |
| 1142 | In order to deregister the callback, a NULL cback may be provided. |
| 1143 | |
| 1144 | Registration happens in the task context of the caller. |
| 1145 | |
| 1146 | \param callback - Call back being registered |
| 1147 | \param pContext - user data |
| 1148 | |
| 1149 | DEPENDENCIES: After CSR open |
| 1150 | |
| 1151 | \return eHalStatus |
| 1152 | -----------------------------------------------------------------------------*/ |
| 1153 | eHalStatus csrRoamRegisterLinkQualityIndCallback(tpAniSirGlobal pMac, |
| 1154 | csrRoamLinkQualityIndCallback callback, |
| 1155 | void *pContext); |
| 1156 | /* --------------------------------------------------------------------------- |
| 1157 | \fn csrGetStatistics |
| 1158 | \brief csr function that client calls to register a callback to get |
| 1159 | different PHY level statistics from CSR. |
| 1160 | |
| 1161 | \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc |
| 1162 | \param statsMask - The different category/categories of stats requester is looking for |
| 1163 | \param callback - SME sends back the requested stats using the callback |
| 1164 | \param periodicity - If requester needs periodic update, 0 means it's an one |
| 1165 | time request |
| 1166 | \param cache - If requester is happy with cached stats |
| 1167 | \param staId - The station ID for which the stats is requested for |
| 1168 | \param pContext - user context to be passed back along with the callback |
| 1169 | |
| 1170 | \return eHalStatus |
| 1171 | ---------------------------------------------------------------------------*/ |
| 1172 | eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requesterId, |
| 1173 | tANI_U32 statsMask, |
| 1174 | tCsrStatsCallback callback, |
| 1175 | tANI_U32 periodicity, tANI_BOOLEAN cache, |
| 1176 | tANI_U8 staId, void *pContext); |
| 1177 | |
| 1178 | |
| 1179 | eHalStatus csrGetRssi(tpAniSirGlobal pMac,tCsrRssiCallback callback,tANI_U8 staId,tCsrBssid bssId,void * pContext,void * pVosContext); |
| 1180 | eHalStatus csrRoamRegisterCallback(tpAniSirGlobal pMac, csrRoamCompleteCallback callback, void *pContext); |
| 1181 | /* --------------------------------------------------------------------------- |
| 1182 | \fn csrGetConfigParam |
| 1183 | \brief HDD calls this function to get the global settings currently maintained by CSR. |
| 1184 | \param pParam - caller allocated memory |
| 1185 | \return eHalStatus |
| 1186 | -------------------------------------------------------------------------------*/ |
| 1187 | eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam); |
| 1188 | |
| 1189 | /* --------------------------------------------------------------------------- |
| 1190 | \fn csrMsgProcessor |
| 1191 | \brief HDD calls this function to change some global settings. |
| 1192 | caller must set the all fields or call csrGetConfigParam to prefill the fields. |
| 1193 | \param pParam - caller allocated memory |
| 1194 | \return eHalStatus |
| 1195 | -------------------------------------------------------------------------------*/ |
| 1196 | eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam); |
| 1197 | |
| 1198 | |
| 1199 | /* --------------------------------------------------------------------------- |
| 1200 | \fn csrMsgProcessor |
| 1201 | \brief HDD calls this function for the messages that are handled by CSR. |
| 1202 | \param pMsgBuf - a pointer to a buffer that maps to various structures base on the message type. |
| 1203 | The beginning of the buffer can always map to tSirSmeRsp. |
| 1204 | \return eHalStatus |
| 1205 | -------------------------------------------------------------------------------*/ |
| 1206 | eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf ); |
| 1207 | |
| 1208 | /* --------------------------------------------------------------------------- |
| 1209 | \fn csrOpen |
| 1210 | \brief This function must be called before any API call to CSR. |
| 1211 | \return eHalStatus |
| 1212 | -------------------------------------------------------------------------------*/ |
| 1213 | eHalStatus csrOpen(tpAniSirGlobal pMac); |
| 1214 | /* --------------------------------------------------------------------------- |
| 1215 | \fn csrClose |
| 1216 | \brief To close down CSR module. There should not be any API call into CSR after calling this function. |
| 1217 | \return eHalStatus |
| 1218 | -------------------------------------------------------------------------------*/ |
| 1219 | eHalStatus csrClose(tpAniSirGlobal pMac); |
| 1220 | /* --------------------------------------------------------------------------- |
| 1221 | \fn csrStart |
| 1222 | \brief To start CSR. |
| 1223 | \return eHalStatus |
| 1224 | -------------------------------------------------------------------------------*/ |
| 1225 | eHalStatus csrStart(tpAniSirGlobal pMac); |
| 1226 | /* --------------------------------------------------------------------------- |
| 1227 | \fn csrStop |
| 1228 | \brief To stop CSR. CSR still keeps its current setting. |
| 1229 | \return eHalStatus |
| 1230 | -------------------------------------------------------------------------------*/ |
| 1231 | eHalStatus csrStop(tpAniSirGlobal pMac); |
| 1232 | /* --------------------------------------------------------------------------- |
| 1233 | \fn csrReady |
| 1234 | \brief To let CSR is ready to operate |
| 1235 | \return eHalStatus |
| 1236 | -------------------------------------------------------------------------------*/ |
| 1237 | eHalStatus csrReady(tpAniSirGlobal pMac); |
| 1238 | |
| 1239 | #ifdef FEATURE_WLAN_WAPI |
| 1240 | eHalStatus csrRoamGetBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pNum, |
| 1241 | tBkidCacheInfo *pBkidCache); |
| 1242 | |
| 1243 | |
| 1244 | eHalStatus csrScanGetBKIDCandidateList(tpAniSirGlobal pMac, tANI_U32 sessionId, |
| 1245 | tBkidCandidateInfo *pBkidList, tANI_U32 *pNumItems ); |
| 1246 | tANI_U32 csrRoamGetNumBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId); |
| 1247 | eHalStatus csrRoamSetBKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache, |
| 1248 | tANI_U32 numItems ); |
| 1249 | /* --------------------------------------------------------------------------- |
| 1250 | \fn csrRoamGetWapiReqIE |
| 1251 | \brief return the WAPI IE CSR passes to PE to JOIN request or START_BSS request |
| 1252 | \param pLen - caller allocated memory that has the length of pBuf as input. Upon returned, *pLen has the |
| 1253 | needed or IE length in pBuf. |
| 1254 | \param pBuf - Caller allocated memory that contain the IE field, if any, upon return |
| 1255 | \return eHalStatus - when fail, it usually means the buffer allocated is not big enough |
| 1256 | -------------------------------------------------------------------------------*/ |
| 1257 | eHalStatus csrRoamGetWapiReqIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf); |
| 1258 | |
| 1259 | /* --------------------------------------------------------------------------- |
| 1260 | \fn csrRoamGetWapiRspIE |
| 1261 | \brief return the WAPI IE from the beacon or probe rsp if connected |
| 1262 | \param pLen - caller allocated memory that has the length of pBuf as input. Upon returned, *pLen has the |
| 1263 | needed or IE length in pBuf. |
| 1264 | \param pBuf - Caller allocated memory that contain the IE field, if any, upon return |
| 1265 | \return eHalStatus - when fail, it usually means the buffer allocated is not big enough |
| 1266 | -------------------------------------------------------------------------------*/ |
| 1267 | eHalStatus csrRoamGetWapiRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf); |
| 1268 | tANI_U8 csrConstructWapiIe( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile, |
| 1269 | tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes, tCsrWapiIe *pWapiIe ); |
| 1270 | #endif /* FEATURE_WLAN_WAPI */ |
| 1271 | |
| 1272 | #ifdef WLAN_SOFTAP_FEATURE |
| 1273 | eHalStatus csrRoamUpdateAPWPSIE( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirAPWPSIEs *pAPWPSIES ); |
| 1274 | eHalStatus csrRoamUpdateWPARSNIEs( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirRSNie * pAPSirRSNie); |
| 1275 | #endif |
| 1276 | void csrSetCfgPrivacy( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, tANI_BOOLEAN fPrivacy ); |
| 1277 | tANI_S8 csrGetInfraSessionId( tpAniSirGlobal pMac ); |
| 1278 | tANI_U8 csrGetInfraOperationChannel( tpAniSirGlobal pMac, tANI_U8 sessionId); |
| 1279 | tANI_U8 csrGetConcurrentOperationChannel( tpAniSirGlobal pMac ); |
| 1280 | |
| 1281 | eHalStatus csrRoamCopyConnectProfile(tpAniSirGlobal pMac, tANI_U32 sessionId, |
| 1282 | tCsrRoamConnectedProfile *pProfile); |
| 1283 | tANI_BOOLEAN csrIsSetKeyAllowed(tpAniSirGlobal pMac, tANI_U32 sessionId); |
| 1284 | |
| 1285 | void csrSetOppositeBandChannelInfo( tpAniSirGlobal pMac ); |
| 1286 | void csrConstructCurrentValidChannelList( tpAniSirGlobal pMac, tDblLinkList *pChannelSetList, |
| 1287 | tANI_U8 *pChannelList, tANI_U8 bSize, tANI_U8 *pNumChannels ); |
| 1288 | |
| 1289 | #endif |
| 1290 | |
| 1291 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1292 | //Returns whether the current association is a 11r assoc or not |
| 1293 | tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac); |
| 1294 | #endif |
| 1295 | |
| 1296 | #ifdef FEATURE_WLAN_CCX |
| 1297 | //Returns whether the current association is a CCX assoc or not |
| 1298 | tANI_BOOLEAN csrRoamIsCCXAssoc(tpAniSirGlobal pMac); |
| 1299 | #endif |
| 1300 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 1301 | //Remove this code once SLM_Sessionization is supported |
| 1302 | //BMPS_WORKAROUND_NOT_NEEDED |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1303 | void csrDisconnectAllActiveSessions(tpAniSirGlobal pMac); |
Mohit Khanna | 349bc39 | 2012-09-11 17:24:52 -0700 | [diff] [blame] | 1304 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 1305 | #ifdef FEATURE_WLAN_LFR |
| 1306 | //Returns whether "Legacy Fast Roaming" is enabled...or not |
Madan Mohan Koyyalamudi | 03aae5f | 2012-11-28 01:51:22 +0530 | [diff] [blame] | 1307 | tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac, tANI_U32 sessionId); |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 1308 | tANI_BOOLEAN csrIsChannelPresentInList( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel ); |
| 1309 | VOS_STATUS csrAddToChannelListFront( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel ); |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 1310 | #endif |
| 1311 | |