blob: 92e030835b978225315ca813e0e9fb2c7d7dbb54 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08002 * 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 Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
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
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -080042/** ------------------------------------------------------------------------- *
43 ------------------------------------------------------------------------- *
Jeff Johnson295189b2012-06-20 16:38:30 -070044
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -080045
Jeff Johnson295189b2012-06-20 16:38:30 -070046 \file csrInternal.h
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -080047
Jeff Johnson295189b2012-06-20 16:38:30 -070048 Define internal data structure for MAC.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -080049
50 Copyright (C) 2006 Airgo Networks, Incorporated
Jeff Johnson295189b2012-06-20 16:38:30 -070051 ========================================================================== */
52#ifndef CSRINTERNAL_H__
53#define CSRINTERNAL_H__
54
Jeff Johnson295189b2012-06-20 16:38:30 -070055#include "vos_status.h"
56#include "vos_lock.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070057
58#include "palTimer.h"
59#include "csrSupport.h"
60#include "vos_nvitem.h"
61#include "wlan_qct_tl.h"
62
63#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
64#include "csrNeighborRoam.h"
65#endif
66
67#define CSR_MAX_STA (HAL_NUM_STA)
68
69#define CSR_SME_SCAN_FLAGS_DELETE_CACHE 0x80
70
71#define CSR_TITAN_MAX_RATE_MIMO_CB 240
72#define CSR_TITAN_MAX_RATE_MIMO 126
73
74//define scan return criteria. LIM should use these define as well
75#define CSR_SCAN_RETURN_AFTER_ALL_CHANNELS ( 0 )
76#define CSR_SCAN_RETURN_AFTER_FIRST_MATCH ( 0x01 )
77#define CSR_SCAN_RETURN_AFTER_5_BAND_11d_FOUND ( 0x80 )
78#define CSR_SCAN_RETURN_AFTER_24_BAND_11d_FOUND ( 0x40 )
79#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 Koyyalamudi4c8c6352012-10-15 16:40:16 -070080#define CSR_NUM_RSSI_CAT 15
Jeff Johnson295189b2012-06-20 16:38:30 -070081#define CSR_MAX_STATISTICS_REQ 10
82
83//Support for multiple session
84#define CSR_SESSION_ID_INVALID 0xFF // session ID invalid
85#define CSR_ROAM_SESSION_MAX 5 // No of sessions to be supported, and a
86 // session is for Infra, IBSS or BT-AMP
87
88#define CSR_IS_SESSION_VALID( pMac, sessionId ) ( ( (sessionId) < CSR_ROAM_SESSION_MAX ) \
89 && ( (pMac)->roam.roamSession[(sessionId)].sessionActive ) )
90#define CSR_GET_SESSION( pMac, sessionId ) \
91( \
92 (sessionId < CSR_ROAM_SESSION_MAX) ? \
93 (&(pMac)->roam.roamSession[(sessionId)]) :\
94 NULL \
95)
96
Madan Mohan Koyyalamudid5026072012-11-30 14:56:21 -080097#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
98#define CSR_IS_ROAM_PREFER_5GHZ( pMac ) \
99( \
100 (((pMac)->roam.configParam.nRoamPrefer5GHz)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
101)
Srinivas Girigowdabbd16eb2013-03-21 12:34:46 -0700102#define CSR_IS_ROAM_INTRA_BAND_ENABLED( pMac ) \
103( \
104 (((pMac)->roam.configParam.nRoamIntraBand)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
105)
Madan Mohan Koyyalamudid5026072012-11-30 14:56:21 -0800106#endif
107
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700108//Support for "Fast roaming" (i.e., CCX, LFR, or 802.11r.)
109#define CSR_BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN 15
Jeff Johnson295189b2012-06-20 16:38:30 -0700110
111typedef enum
112{
113 //eCSR_CFG_DOT11_MODE_BEST = 0,
114 eCSR_CFG_DOT11_MODE_TAURUS = 0,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800115 eCSR_CFG_DOT11_MODE_ABG,
116 eCSR_CFG_DOT11_MODE_11A,
117 eCSR_CFG_DOT11_MODE_11B,
118 eCSR_CFG_DOT11_MODE_11G,
119 eCSR_CFG_DOT11_MODE_11N,
120 eCSR_CFG_DOT11_MODE_POLARIS,
121 eCSR_CFG_DOT11_MODE_TITAN,
Jeff Johnsone7245742012-09-05 17:12:55 -0700122#ifdef WLAN_FEATURE_11AC
123 eCSR_CFG_DOT11_MODE_11AC,
124#endif
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800125 eCSR_CFG_DOT11_MODE_11G_ONLY,
126 eCSR_CFG_DOT11_MODE_11N_ONLY,
Jeff Johnsone7245742012-09-05 17:12:55 -0700127#ifdef WLAN_FEATURE_11AC
128 eCSR_CFG_DOT11_MODE_11AC_ONLY,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800129#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700130 //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
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800134typedef enum etCsrRoamCommands
Jeff Johnson295189b2012-06-20 16:38:30 -0700135{
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800136 eCsrRoamNoCommand,
Jeff Johnson295189b2012-06-20 16:38:30 -0700137 eCsrRoamCommandScan,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800138 eCsrRoamCommandRoam,
139 eCsrRoamCommandWmStatusChange,
Jeff Johnson295189b2012-06-20 16:38:30 -0700140 eCsrRoamCommandSetKey,
141 eCsrRoamCommandRemoveKey,
142
143} eCsrRoamCommands;
144
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800145typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700146{
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)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800169 eCsrScanP2PFindPeer
Jeff Johnson295189b2012-06-20 16:38:30 -0700170}eCsrScanReason;
171
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800172typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700173{
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
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800179 eCsrLostLink2,
Jeff Johnson295189b2012-06-20 16:38:30 -0700180 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 Koyyalamudi286b60e2012-10-11 12:59:07 -0700194 eCsrPerformPreauth,
Venkata Prathyusha Kuntupalli239278b2013-03-26 15:58:18 -0700195 eCsrLostLink1Abort,
196 eCsrLostLink2Abort,
197 eCsrLostLink3Abort,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800198
Jeff Johnson295189b2012-06-20 16:38:30 -0700199}eCsrRoamReason;
200
201typedef enum
202{
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800203 eCSR_ROAM_SUBSTATE_NONE = 0,
204 eCSR_ROAM_SUBSTATE_START_BSS_REQ,
205 eCSR_ROAM_SUBSTATE_JOIN_REQ,
206 eCSR_ROAM_SUBSTATE_REASSOC_REQ,
207 eCSR_ROAM_SUBSTATE_DISASSOC_REQ,
208 eCSR_ROAM_SUBSTATE_STOP_BSS_REQ,
209 eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING, //Continue the current roam command after disconnect
210 eCSR_ROAM_SUBSTATE_AUTH_REQ,
211 eCSR_ROAM_SUBSTATE_CONFIG,
212 eCSR_ROAM_SUBSTATE_DEAUTH_REQ,
213 eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN,
214 eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE,
215 eCSR_ROAM_SUBSTATE_DISASSOC_FORCED,
Jeff Johnson295189b2012-06-20 16:38:30 -0700216 eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY,
217 eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF,
218 eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC,
219 eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC,
220 eCSR_ROAM_SUBSTATE_JOINED_REALTIME_TRAFFIC,
221// max is 15 unless the bitfield is expanded...
222} eCsrRoamSubState;
223
224
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800225typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700226{
227 eCSR_ROAMING_STATE_STOP = 0,
228 eCSR_ROAMING_STATE_IDLE,
229 eCSR_ROAMING_STATE_SCANNING,
230 eCSR_ROAMING_STATE_JOINING,
231 eCSR_ROAMING_STATE_JOINED,
232}eCsrRoamState;
233
234
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800235typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700236{
237 eCsrContinueRoaming,
238 eCsrStopRoaming,
239 eCsrStartIbss,
240 eCsrStartIbssSameIbss,
241 eCsrReassocToSelfNoCapChange,
Jeff Johnsone7245742012-09-05 17:12:55 -0700242 eCsrStopRoamingDueToConcurrency,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800243
Jeff Johnson295189b2012-06-20 16:38:30 -0700244}eCsrJoinState;
245
246typedef enum
247{
248 eCsrNotRoaming,
249 eCsrLostlinkRoamingDisassoc,
250 eCsrLostlinkRoamingDeauth,
251 eCsrDynamicRoaming,
252 eCsrReassocRoaming,
253}eCsrRoamingReason;
254
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800255typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700256{
257 eCsrDisassociated,
258 eCsrDeauthenticated
259
260}eCsrRoamWmStatusChangeTypes;
261
262typedef enum
263{
264 eCsrSummaryStats = 0,
265 eCsrGlobalClassAStats,
266 eCsrGlobalClassBStats,
267 eCsrGlobalClassCStats,
268 eCsrGlobalClassDStats,
269 eCsrPerStaStats,
270 eCsrMaxStats
271}eCsrRoamStatsClassTypes;
272
273#ifdef FEATURE_WLAN_DIAG_SUPPORT
274typedef enum
275{
276 eCSR_WLAN_STATUS_CONNECT =0,
277 eCSR_WLAN_STATUS_DISCONNECT
278
279}eCsrDiagWlanStatusEventSubtype;
280
281typedef enum
282{
283 eCSR_REASON_UNSPECIFIED = 0,
284 eCSR_REASON_USER_REQUESTED,
285 eCSR_REASON_MIC_ERROR,
286 eCSR_REASON_DISASSOC,
287 eCSR_REASON_DEAUTH,
288 eCSR_REASON_HANDOFF,
289
290}eCsrDiagWlanStatusEventReason;
291
292typedef enum
293{
294 eCSR_WLAN_HANDOFF_EVENT =0,
295
296}eCsrDiagWlanHandoffEventSubtype;
297
298typedef enum
299{
300 eCSR_WLAN_VCC_EVENT =0,
301
302}eCsrDiagWlanVccEventSubtype;
303
304#endif //FEATURE_WLAN_DIAG_SUPPORT
305
306typedef struct tagCsrChannel
307{
308 tANI_U8 numChannels;
309 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
310}tCsrChannel;
311
312typedef struct tagScanProfile
313{
314 tANI_U32 minChnTime;
315 tANI_U32 maxChnTime;
316 tANI_U32 restTime; //This is ignored if not associated
317 tANI_U32 numOfChannels;
318 tANI_U8 *pChannelList;
319 tSirScanType scanType; //active or passive
320 eCsrRoamBssType bssType; //BSS or IBSS
321 tANI_U8 ssid[WNI_CFG_SSID_LEN];
322 tANI_U8 bReturnAfter1stMatch;
323 tANI_U8 fUniqueResult;
324 tANI_U8 freshScan;
325 tCsrBssid bssid;
326}tScanProfile;
327
328typedef struct tagBssConfigParam
329{
330 eCsrMediaAccessType qosType;
331 tSirMacSSid SSID;
332 tANI_U32 uRTSThresh;
333 tANI_U32 uDeferThresh; //
334 eCsrCfgDot11Mode uCfgDot11Mode;
335 eCsrBand eBand;
336 tANI_U8 standardRate[CSR_DOT11_SUPPORTED_RATES_MAX];
337 tANI_U8 extendedRate[CSR_DOT11_EXTENDED_SUPPORTED_RATES_MAX];
338 eCsrExposedTxRate txRate;
339 tAniAuthType authType;
340 eCsrEncryptionType encType;
341 tANI_U32 uShortSlotTime;
342 tANI_U32 uHTSupport; //High throughput
343 tANI_U32 uPowerLimit;
344 tANI_U32 uHeartBeatThresh;
345 tANI_U32 uJoinTimeOut;
346 tSirMacCapabilityInfo BssCap;
347 tANI_BOOLEAN f11hSupport;
Jeff Johnsone7245742012-09-05 17:12:55 -0700348 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700349}tBssConfigParam;
350
351
352typedef struct tagCsrRoamStartBssParams
353{
354 tSirMacSSid ssId;
355 tCsrBssid bssid; //this is the BSSID for the party we want to join (only use for IBSS or WDS)
356 tSirNwType sirNwType;
Jeff Johnsone7245742012-09-05 17:12:55 -0700357 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700358 tSirMacRateSet operationalRateSet;
359 tSirMacRateSet extendedRateSet;
360 tANI_U8 operationChn;
361 eCsrCfgDot11Mode uCfgDot11Mode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700362 tANI_U8 privacy;
363 tANI_BOOLEAN fwdWPSPBCProbeReq;
364 tANI_BOOLEAN protEnabled;
365 tANI_BOOLEAN obssProtEnabled;
366 tAniAuthType authType;
367 tANI_U16 beaconInterval; //If this is 0, SME will fill in for caller.
368 tANI_U16 ht_protection;
369 tANI_U32 dtimPeriod;
370 tANI_U8 ApUapsdEnable;
371 tANI_U8 ssidHidden;
372 tANI_U8 wps_state;
Jeff Johnson295189b2012-06-20 16:38:30 -0700373 tVOS_CON_MODE bssPersona;
374 tANI_U16 nRSNIELength; //The byte count in the pRSNIE, if 0, pRSNIE is ignored.
375 tANI_U8 *pRSNIE; //If not null, it has the IE byte stream for RSN
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800376 tANI_BOOLEAN updatebeaconInterval; //Flag used to indicate update
377 // beaconInterval
Jeff Johnson295189b2012-06-20 16:38:30 -0700378}tCsrRoamStartBssParams;
379
380
381typedef struct tagScanCmd
382{
383 tANI_U32 scanID;
384 csrScanCompleteCallback callback;
385 void *pContext;
386 eCsrScanReason reason;
387 eCsrRoamState lastRoamState[CSR_ROAM_SESSION_MAX];
388 tCsrRoamProfile *pToRoamProfile;
389 tANI_U32 roamId; //this is the ID related to the pToRoamProfile
390 union
391 {
392 tCsrScanRequest scanRequest;
393 tCsrBGScanRequest bgScanRequest;
394 }u;
395}tScanCmd;
396
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800397typedef struct tagRoamCmd
Jeff Johnson295189b2012-06-20 16:38:30 -0700398{
399 tANI_U32 roamId;
400 eCsrRoamReason roamReason;
401 tCsrRoamProfile roamProfile;
402 tScanResultHandle hBSSList; //BSS list fits the profile
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800403 tListElem *pRoamBssEntry; //point to the current BSS in the list that is roaming. It starts from head to tail
Jeff Johnson295189b2012-06-20 16:38:30 -0700404 tSirBssDescription *pLastRoamBss; //the last BSS we try and failed
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800405 tANI_BOOLEAN fReleaseBssList; //whether to free hBSSList
Jeff Johnson295189b2012-06-20 16:38:30 -0700406 tANI_BOOLEAN fReleaseProfile; //whether to free roamProfile
407 tANI_BOOLEAN fReassoc; //whether this command is for reassociation
408 tANI_BOOLEAN fUpdateCurRoamProfile; //whether pMac->roam.pCurRoamProfile needs to be updated
409 //this is for CSR internal used only. And it should not be assigned when creating the command
410 //This causes the roam command not to do anything.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800411 tANI_BOOLEAN fReassocToSelfNoCapChange;
Jeff Johnson295189b2012-06-20 16:38:30 -0700412
413 tANI_BOOLEAN fStopWds;
414 tSirMacAddr peerMac;
415 tSirMacReasonCodes reason;
416}tRoamCmd;
417
418typedef struct tagSetKeyCmd
419{
420 tANI_U32 roamId;
421 eCsrEncryptionType encType;
422 eCsrAuthType authType;
423 tAniKeyDirection keyDirection; //Tx, Rx or Tx-and-Rx
424 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
425 tANI_U8 paeRole; //0 for supplicant
426 tANI_U8 keyId; // Kye index
427 tANI_U8 keyLength; //Number of bytes containing the key in pKey
428 tANI_U8 Key[CSR_MAX_KEY_LEN];
429 tANI_U8 keyRsc[CSR_MAX_RSC_LEN];
430} tSetKeyCmd;
431
432typedef struct tahRemoveKeyCmd
433{
434 tANI_U32 roamId;
435 eCsrEncryptionType encType;
436 eCsrAuthType authType;
437 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
438 tANI_U8 keyId; //key index
439} tRemoveKeyCmd;
440
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800441typedef struct tagWmStatusChangeCmd
Jeff Johnson295189b2012-06-20 16:38:30 -0700442{
443 eCsrRoamWmStatusChangeTypes Type;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800444 union
445 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700446 tSirSmeDeauthInd DeauthIndMsg;
447 tSirSmeDisassocInd DisassocIndMsg;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800448 }u;
Jeff Johnson295189b2012-06-20 16:38:30 -0700449
450}tWmStatusChangeCmd;
451
452typedef struct tagAddStaForSessionCmd
453{
454 //Session self mac addr
455 tSirMacAddr selfMacAddr;
456}tAddStaForSessionCmd;
457
458typedef struct tagDelStaForSessionCmd
459{
460 //Session self mac addr
461 tSirMacAddr selfMacAddr;
462 csrRoamSessionCloseCallback callback;
463 void *pContext;
464}tDelStaForSessionCmd;
465
466//This structure represents one scan request
467typedef struct tagCsrCmd
468{
469 tListElem Link;
470 eCsrRoamCommands command;
471 tANI_U8 sessionId; // Session ID for this command
472 union
473 {
474 tScanCmd scanCmd;
475 tRoamCmd roamCmd;
476 tWmStatusChangeCmd wmStatusChangeCmd;
477 tSetKeyCmd setKeyCmd;
478 tRemoveKeyCmd removeKeyCmd;
479 tAddStaForSessionCmd addStaSessionCmd;
480 tDelStaForSessionCmd delStaSessionCmd;
481 }u;
482}tCsrCmd;
483
484#ifdef WLAN_FEATURE_VOWIFI_11R
485typedef struct tagCsr11rConfig
486{
487 tANI_BOOLEAN IsFTResourceReqSupported;
488} tCsr11rConfig;
489#endif
490
491#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
492typedef struct tagCsrNeighborRoamConfig
493{
494 tANI_U32 nNeighborScanTimerPeriod;
495 tANI_U8 nNeighborLookupRssiThreshold;
496 tANI_U8 nNeighborReassocRssiThreshold;
497 tANI_U16 nNeighborScanMinChanTime;
498 tANI_U16 nNeighborScanMaxChanTime;
499 sCsrChannel neighborScanChanList;
500 tANI_U8 nMaxNeighborRetries;
501 tANI_U16 nNeighborResultsRefreshPeriod;
Srinivas Girigowdade697412013-02-14 16:31:48 -0800502 tANI_U16 nEmptyScanRefreshPeriod;
Jeff Johnson295189b2012-06-20 16:38:30 -0700503}tCsrNeighborRoamConfig;
504#endif
505
506typedef struct tagCsrConfig
507{
508 tANI_U32 agingCount;
509 tANI_U32 FragmentationThreshold;
510 tANI_U32 channelBondingMode24GHz;
511 tANI_U32 channelBondingMode5GHz;
512 tANI_U32 RTSThreshold;
513 eCsrPhyMode phyMode;
514 eCsrCfgDot11Mode uCfgDot11Mode;
515 eCsrBand eBand;
516 tANI_U32 HeartbeatThresh50;
517 tANI_U32 HeartbeatThresh24;
518 tANI_U32 bgScanInterval;
519 eCsrCBChoice cbChoice;
520 eCsrBand bandCapability; //indicate hw capability
521 eCsrRoamWmmUserModeType WMMSupportMode;
522 tANI_BOOLEAN Is11eSupportEnabled;
523 tANI_BOOLEAN Is11dSupportEnabled;
524 tANI_BOOLEAN Is11dSupportEnabledOriginal;
525 tANI_BOOLEAN Is11hSupportEnabled;
526 tANI_BOOLEAN shortSlotTime;
527 tANI_BOOLEAN ProprietaryRatesEnabled;
528 tANI_BOOLEAN fenableMCCMode;
529 tANI_U16 TxRate;
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -0800530 tANI_U8 fAllowMCCGODiffBI;
Jeff Johnson295189b2012-06-20 16:38:30 -0700531 tANI_U8 AdHocChannel24;
532 tANI_U8 AdHocChannel5G;
533 tANI_U32 impsSleepTime; //in units of microseconds
534 tANI_U32 scanAgeTimeNCNPS; //scan result aging time threshold when Not-Connect-No-Power-Save, in seconds
535 tANI_U32 scanAgeTimeNCPS; //scan result aging time threshold when Not-Connect-Power-Save, in seconds
536 tANI_U32 scanAgeTimeCNPS; //scan result aging time threshold when Connect-No-Power-Save, in seconds,
537 tANI_U32 scanAgeTimeCPS; //scan result aging time threshold when Connect-Power-Savein seconds
538 tANI_U32 BssPreferValue[CSR_NUM_RSSI_CAT]; //each RSSI category has one value
539 int RSSICat[CSR_NUM_RSSI_CAT];
540 tANI_U8 bCatRssiOffset; //to set the RSSI difference for each category
541 tANI_U32 nRoamingTime; //In seconds, CSR will try this long before gives up, 0 means no roaming
542 //Whether to limit the channels to the ones set in Csr11dInfo. If true, the opertaional
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800543 //channels are limited to the default channel list. It is an "AND" operation between the
Jeff Johnson295189b2012-06-20 16:38:30 -0700544 //default channels and the channels in the 802.11d IE.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800545 tANI_BOOLEAN fEnforce11dChannels;
Jeff Johnson295189b2012-06-20 16:38:30 -0700546 //Country Code Priority
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800547 //0 = 802.11D > Configured Country > NV
Jeff Johnson295189b2012-06-20 16:38:30 -0700548 //1 = Configured Country > 802.11D > NV
549 tANI_BOOLEAN fSupplicantCountryCodeHasPriority;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800550 //When true, AP with unknown country code won't be see.
551 //"Unknown country code" means either Ap doesn't have 11d IE or we cannot
Jeff Johnson295189b2012-06-20 16:38:30 -0700552 //find a domain for the country code in its 11d IE.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800553 tANI_BOOLEAN fEnforceCountryCodeMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700554 //When true, only APs in the default domain can be seen. If the Ap has "unknown country
555 //code", or the doamin of the country code doesn't match the default domain, the Ap is
556 //not acceptable.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800557 tANI_BOOLEAN fEnforceDefaultDomain;
Jeff Johnson295189b2012-06-20 16:38:30 -0700558
559 tANI_U16 vccRssiThreshold;
560 tANI_U32 vccUlMacLossThreshold;
561
562 tANI_U32 nPassiveMinChnTime; //in units of milliseconds
563 tANI_U32 nPassiveMaxChnTime; //in units of milliseconds
564 tANI_U32 nActiveMinChnTime; //in units of milliseconds
565 tANI_U32 nActiveMaxChnTime; //in units of milliseconds
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800566
567 tANI_U32 nActiveMinChnTimeBtc; //in units of milliseconds
568 tANI_U32 nActiveMaxChnTimeBtc; //in units of milliseconds
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -0700569#ifdef WLAN_AP_STA_CONCURRENCY
570 tANI_U32 nPassiveMinChnTimeConc; //in units of milliseconds
571 tANI_U32 nPassiveMaxChnTimeConc; //in units of milliseconds
572 tANI_U32 nActiveMinChnTimeConc; //in units of milliseconds
573 tANI_U32 nActiveMaxChnTimeConc; //in units of milliseconds
574 tANI_U32 nRestTimeConc; //in units of milliseconds
Vinay Malekal05fdc812012-12-17 13:04:30 -0800575 tANI_U8 nNumChanCombinedConc; //number of channels combined
576 //in each split scan operation
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -0700577#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700578
579 tANI_BOOLEAN IsIdleScanEnabled;
580 //in dBm, the maximum TX power
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800581 //The actual TX power is the lesser of this value and 11d.
Jeff Johnson295189b2012-06-20 16:38:30 -0700582 //If 11d is disable, the lesser of this and default setting.
583 tANI_U8 nTxPowerCap;
584 tANI_U32 statsReqPeriodicity; //stats request frequency from PE while in full power
585 tANI_U32 statsReqPeriodicityInPS;//stats request frequency from PE while in power save
Jeff Johnson295189b2012-06-20 16:38:30 -0700586 tANI_U32 dtimPeriod;
587 tANI_BOOLEAN ssidHidden;
Jeff Johnson295189b2012-06-20 16:38:30 -0700588
589#ifdef WLAN_FEATURE_VOWIFI_11R
590 tCsr11rConfig csr11rConfig;
591#endif
592
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700593#ifdef FEATURE_WLAN_LFR
594 tANI_U8 isFastRoamIniFeatureEnabled;
595#endif
596
Jeff Johnson295189b2012-06-20 16:38:30 -0700597#ifdef FEATURE_WLAN_CCX
598 tANI_U8 isCcxIniFeatureEnabled;
599#endif
600
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700601#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Jeff Johnson295189b2012-06-20 16:38:30 -0700602 tANI_U8 isFastTransitionEnabled;
Jeff Johnson43971f52012-07-17 12:26:56 -0700603 tANI_U8 RoamRssiDiff;
Madan Mohan Koyyalamudi62b55b02012-12-03 16:45:39 -0800604 tANI_U8 nImmediateRoamRssiDiff;
Madan Mohan Koyyalamudid5026072012-11-30 14:56:21 -0800605 tANI_BOOLEAN nRoamPrefer5GHz;
Srinivas Girigowdabbd16eb2013-03-21 12:34:46 -0700606 tANI_BOOLEAN nRoamIntraBand;
Jeff Johnson295189b2012-06-20 16:38:30 -0700607#endif
608
609#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
610 tCsrNeighborRoamConfig neighborRoamConfig;
611#endif
612
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800613 /* Instead of Reassoc, send ADDTS/DELTS even when ACM is off for that AC
Jeff Johnson295189b2012-06-20 16:38:30 -0700614 * This is mandated by WMM-AC certification */
615 tANI_BOOLEAN addTSWhenACMIsOff;
616
617 tANI_BOOLEAN fValidateList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800618 //Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700619 //BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnsone7245742012-09-05 17:12:55 -0700620 tANI_BOOLEAN doBMPSWorkaround;
Jeff Johnson295189b2012-06-20 16:38:30 -0700621
622 //To enable/disable scanning 2.4Ghz channels twice on a single scan request from HDD
623 tANI_BOOLEAN fScanTwice;
Jeff Johnsone7245742012-09-05 17:12:55 -0700624#ifdef WLAN_FEATURE_11AC
625 tANI_U32 nVhtChannelWidth;
Shailender Karmuchi08f87c22013-01-17 12:51:24 -0800626 tANI_U8 txBFEnable;
Shailender Karmuchicc3fe442013-02-16 18:18:33 -0800627 tANI_U8 txBFCsnValue;
Jeff Johnsone7245742012-09-05 17:12:55 -0700628#endif
Gopichand Nakkalab2d2c312013-01-04 11:41:02 -0800629 tANI_U8 txLdpcEnable;
Jeff Johnson295189b2012-06-20 16:38:30 -0700630
631}tCsrConfig;
632
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800633typedef struct tagCsrChannelPowerInfo
Jeff Johnson295189b2012-06-20 16:38:30 -0700634{
635 tListElem link;
636 tANI_U8 firstChannel;
637 tANI_U8 numChannels;
638 tANI_U8 txPower;
639 tANI_U8 interChannelOffset;
640}tCsrChannelPowerInfo;
641
642typedef struct tagRoamJoinStatus
643{
644 tSirResultCodes statusCode;
645 //this is set to unspecified if statusCode indicates timeout. Or it is the failed reason from the other BSS(per 802.11 spec)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800646 tANI_U32 reasonCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700647}tCsrRoamJoinStatus;
648
649typedef struct tagCsrOsChannelMask
650{
651 tANI_U8 numChannels;
652 tANI_BOOLEAN scanEnabled[WNI_CFG_VALID_CHANNEL_LIST_LEN];
653 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
654}tCsrOsChannelMask;
655
656
657typedef struct tagCsrScanStruct
658{
659 tScanProfile scanProfile;
660 tANI_U32 nextScanID;
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700661 tDblLinkList scanResultList;
Jeff Johnson295189b2012-06-20 16:38:30 -0700662 tDblLinkList tempScanResults;
663 tANI_BOOLEAN fScanEnable;
664 tANI_BOOLEAN fFullScanIssued;
665 tPalTimerHandle hTimerGetResult;
666#ifdef WLAN_AP_STA_CONCURRENCY
667 tPalTimerHandle hTimerStaApConcTimer;
668#endif
669 tPalTimerHandle hTimerIdleScan;
670 tPalTimerHandle hTimerResultAging;
Sandeep Puligilla2b6dc632012-12-17 14:44:16 -0800671 tPalTimerHandle hTimerResultCfgAging;
Jeff Johnson295189b2012-06-20 16:38:30 -0700672 tPalTimerHandle hTimerBgScan;
673 //changes on every scan, it is used as a flag for whether 11d info is found on every scan
Sandeep Puligilla2b6dc632012-12-17 14:44:16 -0800674 tANI_U8 channelOf11dInfo;
675 tANI_U8 scanResultCfgAgingTime;
Jeff Johnson295189b2012-06-20 16:38:30 -0700676 //changes on every scan, a flag to tell whether conflict 11d info found on each BSS
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800677 tANI_BOOLEAN fAmbiguous11dInfoFound;
Jeff Johnson295189b2012-06-20 16:38:30 -0700678 //Tush: changes on every scan, a flag to tell whether the applied 11d info present in one of the scan results
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800679 tANI_BOOLEAN fCurrent11dInfoMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700680 tANI_BOOLEAN f11dInfoReset; //to indicate whether the 11d info in CFG is reset to default
681 tSirScanType curScanType;
682 tCsrChannel baseChannels; //This are all the supported channels AND(&) to the current eBand
683 tCsrChannel channels11d;
684 tChannelListWithPower defaultPowerTable[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
685 tChannelListWithPower defaultPowerTable40MHz[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
686 tANI_U32 numChannelsDefault; //total channels of NV
687 tCsrChannel base20MHzChannels; //The channel base to work on
688 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
689 tDblLinkList channelPowerInfoList24;
690 tDblLinkList channelPowerInfoList5G;
691 tANI_U32 nLastAgeTimeOut;
692 tANI_U32 nAgingCountDown;
Gopichand Nakkala114718f2013-03-25 19:19:46 -0700693 tANI_U8 countryCodeDefault[WNI_CFG_COUNTRY_CODE_LEN]; //The country code from NV
694 tANI_U8 countryCodeCurrent[WNI_CFG_COUNTRY_CODE_LEN];
695 tANI_U8 countryCode11d[WNI_CFG_COUNTRY_CODE_LEN];
Jeff Johnson295189b2012-06-20 16:38:30 -0700696 v_REGDOMAIN_t domainIdDefault; //default regulatory domain
697 v_REGDOMAIN_t domainIdCurrent; //current regulatory domain
698 tANI_BOOLEAN f11dInfoApplied;
699 tANI_BOOLEAN fCancelIdleScan;
700#ifdef FEATURE_WLAN_WAPI
701// tANI_U16 NumBkidCandidate;
702// tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED]; /* Move this as part of SessionEntry */
703#endif /* FEATURE_WLAN_WAPI */
704 tANI_U8 numBGScanChannel; //number of valid channels in the bgScanChannelList
705 tANI_U8 bgScanChannelList[WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN];
706 //the ChannelInfo member is not used in this structure.
707 //numBGScanChannel and bgScanChannelList are used for the BG scan channel info
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800708 tCsrBGScanRequest bgScanParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700709 tANI_BOOLEAN fRestartIdleScan;
710 tANI_U32 nIdleScanTimeGap; //the time since last trying to trigger idle scan
711 tCsrOsChannelMask osScanChannelMask;//keep a track of channels to be scnned while in traffic condition
712 tANI_U16 nBssLimit; //the maximum number of BSS in scan cache
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800713 /*channelPowerInfoList24 has been seen corrupted. Set this flag to true trying to
Jeff Johnson295189b2012-06-20 16:38:30 -0700714 * detect when it happens. Adding this into code because we can't reproduce it easily.
715 * We don't know when it happens. */
716 tANI_BOOLEAN fValidateList;
717 /*Customer wants to start with an active scan based on the default country code.
718 * This optimization will minimize the driver load to association time.
719 * Based on this flag we will bypass the initial passive scan needed for 11d
720 * to determine the country code & domain */
721 tANI_BOOLEAN fEnableBypass11d;
722
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800723 /*Customer wants to optimize the scan time. Avoiding scans(passive) on DFS
724 * channels while swipping through both bands can save some time
Jeff Johnson295189b2012-06-20 16:38:30 -0700725 * (apprx 1.3 sec) */
726 tANI_BOOLEAN fEnableDFSChnlScan;
727
Jeff Johnsone7245742012-09-05 17:12:55 -0700728 /*
729 * To enable/disable scanning only 2.4Ghz channels on first scan
730 */
731 tANI_BOOLEAN fFirstScanOnly2GChnl;
732
Jeff Johnson295189b2012-06-20 16:38:30 -0700733 tANI_BOOLEAN fDropScanCmd; //true means we don't accept scan commands
734
735#ifdef WLAN_AP_STA_CONCURRENCY
736 tDblLinkList scanCmdPendingList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800737#endif
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700738 tCsrChannel occupiedChannels; //This includes all channels on which candidate APs are found
Madan Mohan Koyyalamudi3f65e312012-11-06 15:31:12 -0800739
740 tANI_BOOLEAN fIgnore_chan165;
Jeff Johnson295189b2012-06-20 16:38:30 -0700741}tCsrScanStruct;
742
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800743#ifdef FEATURE_WLAN_TDLS_INTERNAL
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800744/*
745 * struct to carry TDLS discovery info..
746 */
747typedef struct sCsrTdlsContext
748{
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800749 tDblLinkList tdlsPotentialPeerList ;
750 tANI_U16 tdlsCommonFlag ;
751 tANI_U16 tdlsCommonState ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800752 tANI_U16 tdlsPeerCount ;
753}tCsrTdlsCtxStruct;
754
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800755typedef struct sCsrTdlsPeerLinkInfo
756{
757 tListElem tdlsPeerStaLink ;
758 tSirTdlsPeerInfo tdlsDisPeerInfo ;
759}tCsrTdlsPeerLinkinfo ;
760#endif
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800761
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800762
763
Jeff Johnson295189b2012-06-20 16:38:30 -0700764
765//Save the connected information. This structure + connectedProfile
766//should contain all information about the connection
767typedef 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
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800774#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700775#ifdef FEATURE_WLAN_CCX
776 tANI_U32 nTspecIeLength;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800777#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700778 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
785typedef struct tagCsrLinkQualityIndInfo
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800786{
Jeff Johnson295189b2012-06-20 16:38:30 -0700787 csrRoamLinkQualityIndCallback callback;
788 void *context;
789}tCsrLinkQualityIndInfo;
790
791typedef 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;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800802 /* To remember if the peStats timer is stopped successfully or not */
Jeff Johnson295189b2012-06-20 16:38:30 -0700803 tANI_BOOLEAN timerStopFailed;
804
805}tCsrPeStatsReqInfo;
806
807typedef 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
822typedef struct tagCsrTlStatsReqInfo
823{
824 tANI_U32 periodicity;
825 tANI_BOOLEAN timerRunning;
826 tPalTimerHandle hTlStatsTimer;
827 tANI_U8 numClient;
828}tCsrTlStatsReqInfo;
829
830typedef 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;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800840 tCsrRoamProfile *pCurRoamProfile;
Jeff Johnson295189b2012-06-20 16:38:30 -0700841 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
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800856 tCsrRoamStartBssParams bssParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700857 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
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800883 tANI_U32 roamingStatusCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700884 tANI_U16 NumPmkidCandidate;
885 tPmkidCandidateInfo PmkidCandidateInfo[CSR_MAX_PMKID_ALLOWED];
886 #ifdef FEATURE_WLAN_WAPI
887 tANI_U16 NumBkidCandidate;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800888 tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED];
Jeff Johnson295189b2012-06-20 16:38:30 -0700889#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
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800907 /* to force the AP initiate fresh 802.1x authentication after re-association need to clear
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700908 * the PMKID cache. To clear the cache in this particular case this is added
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800909 * it is needed by the HS 2.0 passpoint certification 5.2.a and b testcases */
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700910 tANI_BOOLEAN fIgnorePMKIDCache;
Jeff Johnson295189b2012-06-20 16:38:30 -0700911} tCsrRoamSession;
912
913typedef 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
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800921 tCsrChannel base20MHzChannels; //The channel base to work on
922 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
923 eCsrRoamState curState[CSR_ROAM_SESSION_MAX];
Jeff Johnson295189b2012-06-20 16:38:30 -0700924 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
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800929
Jeff Johnson295189b2012-06-20 16:38:30 -0700930 tANI_S32 sPendingCommands;
Jeff Johnson295189b2012-06-20 16:38:30 -0700931 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;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800951 tANI_U32 transactionId; // Current transaction ID for internal use.
952#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
Jeff Johnson295189b2012-06-20 16:38:30 -0700953 tCsrNeighborRoamControlInfo neighborRoamInfo;
954#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700955#ifdef FEATURE_WLAN_LFR
956 tANI_U8 isFastRoamIniFeatureEnabled;
957#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700958#ifdef FEATURE_WLAN_CCX
959 tANI_U8 isCcxIniFeatureEnabled;
960#endif
Jeff Johnson43971f52012-07-17 12:26:56 -0700961#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
962 tANI_U8 RoamRssiDiff;
963#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700964}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
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800970#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 )
Jeff Johnson295189b2012-06-20 16:38:30 -0700972#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 )
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800974#define CSR_IS_ROAM_IDLE(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_IDLE, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -0700975#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])
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800978#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)
Jeff Johnson295189b2012-06-20 16:38:30 -0700989#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)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800991#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)
Jeff Johnson295189b2012-06-20 16:38:30 -0700995
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))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800999
Jeff Johnson295189b2012-06-20 16:38:30 -07001000#define CSR_IS_PHY_MODE_G_ONLY(pMac) \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001001 (eCSR_DOT11_MODE_11g == (pMac)->roam.configParam.phyMode || eCSR_DOT11_MODE_11g_ONLY == (pMac)->roam.configParam.phyMode)
1002
Jeff Johnson295189b2012-06-20 16:38:30 -07001003#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))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001006
Jeff Johnsone7245742012-09-05 17:12:55 -07001007#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 Johnson295189b2012-06-20 16:38:30 -07001014#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 Johnsone7245742012-09-05 17:12:55 -07001018#endif
1019
Jeff Johnson295189b2012-06-20 16:38:30 -07001020
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 Johnsone7245742012-09-05 17:12:55 -07001055 (((chnNum) >= CSR_MIN_5GHz_CHANNEL_NUMBER) && ((chnNum) <= CSR_MAX_5GHz_CHANNEL_NUMBER))
Jeff Johnson295189b2012-06-20 16:38:30 -07001056
Srinivas Girigowdade697412013-02-14 16:31:48 -08001057#define CSR_IS_CHANNEL_DFS(chnNum) \
1058 (NV_CHANNEL_ENABLE != vos_nv_getChannelEnabledState(chnNum))
1059
Jeff Johnson295189b2012-06-20 16:38:30 -07001060#define CSR_IS_CHANNEL_24GHZ(chnNum) \
1061 (((chnNum) > 0) && ((chnNum) <= CSR_MAX_24GHz_CHANNEL_NUMBER))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001062
Jeff Johnson295189b2012-06-20 16:38:30 -07001063#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) || \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001071 (eCsrReassocRoaming == (pSession)->roamingReason))
Jeff Johnson295189b2012-06-20 16:38:30 -07001072
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
Venkata Prathyusha Kuntupalli239278b2013-03-26 15:58:18 -07001080#define CSR_IS_ROAMING_COMMAND(pCommand) ((eCsrLostLink1 == (pCommand)->u.roamCmd.roamReason) ||\
1081 (eCsrLostLink2 == (pCommand)->u.roamCmd.roamReason) ||\
1082 (eCsrLostLink3 == (pCommand)->u.roamCmd.roamReason) )
1083
1084
Jeff Johnson295189b2012-06-20 16:38:30 -07001085//Stop CSR from asking for IMPS, This function doesn't disable IMPS from CSR
1086void csrScanSuspendIMPS( tpAniSirGlobal pMac );
1087//Start CSR from asking for IMPS. This function doesn't trigger CSR to request entering IMPS
1088//because IMPS maybe disabled.
1089void csrScanResumeIMPS( tpAniSirGlobal pMac );
1090
1091eHalStatus csrInitGetChannels(tpAniSirGlobal pMac);
Venkata Prathyusha Kuntupalli316247e2013-03-15 17:45:25 -07001092// Getting the 5GHz Channel list
1093eHalStatus csrGet5GChannels(tpAniSirGlobal pMac);
1094// Getting the 2.4GHz Channel list
1095eHalStatus csrGet24GChannels(tpAniSirGlobal pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001096
1097eHalStatus csrSetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1098 tCsrRoamModifyProfileFields *pModifyProfileFields);
1099/* ---------------------------------------------------------------------------
1100 \fn csrGetModifyProfileFields
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001101 \brief HDD or SME - QOS calls this function to get the current values of
Jeff Johnson295189b2012-06-20 16:38:30 -07001102 connected profile fields changing which can cause reassoc.
1103 This function must be called after CFG is downloaded and STA is in connected
1104 state.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001105 \param pModifyProfileFields - pointer to the connected profile fields
Jeff Johnson295189b2012-06-20 16:38:30 -07001106 changing which can cause reassoc
1107
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001108 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001109 -------------------------------------------------------------------------------*/
1110eHalStatus csrGetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1111 tCsrRoamModifyProfileFields * pModifyProfileFields);
1112void csrSetGlobalCfgs( tpAniSirGlobal pMac );
1113void csrSetDefaultDot11Mode( tpAniSirGlobal pMac );
1114void csrScanSetChannelMask(tpAniSirGlobal pMac, tCsrChannelInfo *pChannelInfo);
1115tANI_BOOLEAN csrIsConnStateDisconnected(tpAniSirGlobal pMac, tANI_U32 sessionId);
1116tANI_BOOLEAN csrIsConnStateConnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1117tANI_BOOLEAN csrIsConnStateDisconnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1118tANI_BOOLEAN csrIsConnStateConnectedInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1119tANI_BOOLEAN csrIsConnStateConnected( tpAniSirGlobal pMac, tANI_U32 sessionId );
1120tANI_BOOLEAN csrIsConnStateInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1121tANI_BOOLEAN csrIsConnStateIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1122tANI_BOOLEAN csrIsConnStateWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1123tANI_BOOLEAN csrIsConnStateConnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1124tANI_BOOLEAN csrIsConnStateDisconnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1125tANI_BOOLEAN csrIsAnySessionInConnectState( tpAniSirGlobal pMac );
1126tANI_BOOLEAN csrIsAllSessionDisconnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudi48081ef2012-12-04 16:49:55 -08001127tANI_BOOLEAN csrIsStaSessionConnected( tpAniSirGlobal pMac );
1128tANI_BOOLEAN csrIsP2pSessionConnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudid3d22592012-09-24 14:01:29 -07001129tANI_BOOLEAN csrIsAnySessionConnected( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001130tANI_BOOLEAN csrIsInfraConnected( tpAniSirGlobal pMac );
1131tANI_BOOLEAN csrIsConcurrentInfraConnected( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001132tANI_BOOLEAN csrIsConcurrentSessionRunning( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001133tANI_BOOLEAN csrIsInfraApStarted( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001134tANI_BOOLEAN csrIsIBSSStarted( tpAniSirGlobal pMac );
1135tANI_BOOLEAN csrIsBTAMPStarted( tpAniSirGlobal pMac );
1136tANI_BOOLEAN csrIsBTAMP( tpAniSirGlobal pMac, tANI_U32 sessionId );
1137eHalStatus csrIsBTAMPAllowed( tpAniSirGlobal pMac, tANI_U32 chnId );
Jeff Johnsone7245742012-09-05 17:12:55 -07001138tANI_BOOLEAN csrIsValidMcConcurrentSession(tpAniSirGlobal pMac, tANI_U32 sessionId,
1139 tSirBssDescription *pBssDesc);
Jeff Johnson295189b2012-06-20 16:38:30 -07001140tANI_BOOLEAN csrIsConnStateConnectedInfraAp( tpAniSirGlobal pMac, tANI_U32 sessionId );
Jeff Johnson295189b2012-06-20 16:38:30 -07001141/*----------------------------------------------------------------------------
1142 \fn csrRoamRegisterLinkQualityIndCallback
1143
1144 \brief
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001145 a CSR function to allow HDD to register a callback handler with CSR for
1146 link quality indications.
Jeff Johnson295189b2012-06-20 16:38:30 -07001147
1148 Only one callback may be registered at any time.
1149 In order to deregister the callback, a NULL cback may be provided.
1150
1151 Registration happens in the task context of the caller.
1152
1153 \param callback - Call back being registered
1154 \param pContext - user data
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001155
Jeff Johnson295189b2012-06-20 16:38:30 -07001156 DEPENDENCIES: After CSR open
1157
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001158 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001159-----------------------------------------------------------------------------*/
1160eHalStatus csrRoamRegisterLinkQualityIndCallback(tpAniSirGlobal pMac,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001161 csrRoamLinkQualityIndCallback callback,
Jeff Johnson295189b2012-06-20 16:38:30 -07001162 void *pContext);
1163/* ---------------------------------------------------------------------------
1164 \fn csrGetStatistics
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001165 \brief csr function that client calls to register a callback to get
1166 different PHY level statistics from CSR.
1167
Jeff Johnson295189b2012-06-20 16:38:30 -07001168 \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc
1169 \param statsMask - The different category/categories of stats requester is looking for
1170 \param callback - SME sends back the requested stats using the callback
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001171 \param periodicity - If requester needs periodic update, 0 means it's an one
Jeff Johnson295189b2012-06-20 16:38:30 -07001172 time request
1173 \param cache - If requester is happy with cached stats
1174 \param staId - The station ID for which the stats is requested for
1175 \param pContext - user context to be passed back along with the callback
1176
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001177 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001178 ---------------------------------------------------------------------------*/
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001179eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requesterId,
1180 tANI_U32 statsMask,
1181 tCsrStatsCallback callback,
1182 tANI_U32 periodicity, tANI_BOOLEAN cache,
Jeff Johnson295189b2012-06-20 16:38:30 -07001183 tANI_U8 staId, void *pContext);
1184
1185
1186eHalStatus csrGetRssi(tpAniSirGlobal pMac,tCsrRssiCallback callback,tANI_U8 staId,tCsrBssid bssId,void * pContext,void * pVosContext);
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08001187#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1188eHalStatus csrGetRoamRssi(tpAniSirGlobal pMac,
1189 tCsrRssiCallback callback,
1190 tANI_U8 staId,
1191 tCsrBssid bssId,
1192 void * pContext,
1193 void * pVosContext);
1194#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001195eHalStatus csrRoamRegisterCallback(tpAniSirGlobal pMac, csrRoamCompleteCallback callback, void *pContext);
1196/* ---------------------------------------------------------------------------
1197 \fn csrGetConfigParam
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001198 \brief HDD calls this function to get the global settings currently maintained by CSR.
Jeff Johnson295189b2012-06-20 16:38:30 -07001199 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001200 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001201 -------------------------------------------------------------------------------*/
1202eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1203
1204/* ---------------------------------------------------------------------------
1205 \fn csrMsgProcessor
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001206 \brief HDD calls this function to change some global settings.
Jeff Johnson295189b2012-06-20 16:38:30 -07001207 caller must set the all fields or call csrGetConfigParam to prefill the fields.
1208 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001209 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001210 -------------------------------------------------------------------------------*/
1211eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1212
1213
1214/* ---------------------------------------------------------------------------
1215 \fn csrMsgProcessor
1216 \brief HDD calls this function for the messages that are handled by CSR.
1217 \param pMsgBuf - a pointer to a buffer that maps to various structures base on the message type.
1218 The beginning of the buffer can always map to tSirSmeRsp.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001219 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001220 -------------------------------------------------------------------------------*/
1221eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf );
1222
1223/* ---------------------------------------------------------------------------
1224 \fn csrOpen
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001225 \brief This function must be called before any API call to CSR.
1226 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001227 -------------------------------------------------------------------------------*/
1228eHalStatus csrOpen(tpAniSirGlobal pMac);
1229/* ---------------------------------------------------------------------------
1230 \fn csrClose
1231 \brief To close down CSR module. There should not be any API call into CSR after calling this function.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001232 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001233 -------------------------------------------------------------------------------*/
1234eHalStatus csrClose(tpAniSirGlobal pMac);
1235/* ---------------------------------------------------------------------------
1236 \fn csrStart
1237 \brief To start CSR.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001238 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001239 -------------------------------------------------------------------------------*/
1240eHalStatus csrStart(tpAniSirGlobal pMac);
1241/* ---------------------------------------------------------------------------
1242 \fn csrStop
1243 \brief To stop CSR. CSR still keeps its current setting.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001244 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001245 -------------------------------------------------------------------------------*/
1246eHalStatus csrStop(tpAniSirGlobal pMac);
1247/* ---------------------------------------------------------------------------
1248 \fn csrReady
1249 \brief To let CSR is ready to operate
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001250 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001251 -------------------------------------------------------------------------------*/
1252eHalStatus csrReady(tpAniSirGlobal pMac);
1253
1254#ifdef FEATURE_WLAN_WAPI
1255eHalStatus csrRoamGetBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pNum,
1256 tBkidCacheInfo *pBkidCache);
1257
1258
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001259eHalStatus csrScanGetBKIDCandidateList(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001260 tBkidCandidateInfo *pBkidList, tANI_U32 *pNumItems );
1261tANI_U32 csrRoamGetNumBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId);
1262eHalStatus csrRoamSetBKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache,
1263 tANI_U32 numItems );
1264/* ---------------------------------------------------------------------------
1265 \fn csrRoamGetWapiReqIE
1266 \brief return the WAPI IE CSR passes to PE to JOIN request or START_BSS request
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001267 \param pLen - caller allocated memory that has the length of pBuf as input. Upon returned, *pLen has the
Jeff Johnson295189b2012-06-20 16:38:30 -07001268 needed or IE length in pBuf.
1269 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1270 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1271 -------------------------------------------------------------------------------*/
1272eHalStatus csrRoamGetWapiReqIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
1273
1274/* ---------------------------------------------------------------------------
1275 \fn csrRoamGetWapiRspIE
1276 \brief return the WAPI IE from the beacon or probe rsp if connected
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001277 \param pLen - caller allocated memory that has the length of pBuf as input. Upon returned, *pLen has the
Jeff Johnson295189b2012-06-20 16:38:30 -07001278 needed or IE length in pBuf.
1279 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1280 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1281 -------------------------------------------------------------------------------*/
1282eHalStatus csrRoamGetWapiRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001283tANI_U8 csrConstructWapiIe( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
Jeff Johnson295189b2012-06-20 16:38:30 -07001284 tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes, tCsrWapiIe *pWapiIe );
1285#endif /* FEATURE_WLAN_WAPI */
1286
Jeff Johnson295189b2012-06-20 16:38:30 -07001287eHalStatus csrRoamUpdateAPWPSIE( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirAPWPSIEs *pAPWPSIES );
1288eHalStatus csrRoamUpdateWPARSNIEs( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirRSNie * pAPSirRSNie);
Jeff Johnson295189b2012-06-20 16:38:30 -07001289void csrSetCfgPrivacy( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, tANI_BOOLEAN fPrivacy );
1290tANI_S8 csrGetInfraSessionId( tpAniSirGlobal pMac );
1291tANI_U8 csrGetInfraOperationChannel( tpAniSirGlobal pMac, tANI_U8 sessionId);
1292tANI_U8 csrGetConcurrentOperationChannel( tpAniSirGlobal pMac );
1293
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001294eHalStatus csrRoamCopyConnectProfile(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001295 tCsrRoamConnectedProfile *pProfile);
1296tANI_BOOLEAN csrIsSetKeyAllowed(tpAniSirGlobal pMac, tANI_U32 sessionId);
1297
1298void csrSetOppositeBandChannelInfo( tpAniSirGlobal pMac );
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001299void csrConstructCurrentValidChannelList( tpAniSirGlobal pMac, tDblLinkList *pChannelSetList,
Jeff Johnson295189b2012-06-20 16:38:30 -07001300 tANI_U8 *pChannelList, tANI_U8 bSize, tANI_U8 *pNumChannels );
1301
1302#endif
1303
1304#ifdef WLAN_FEATURE_VOWIFI_11R
1305//Returns whether the current association is a 11r assoc or not
1306tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac);
1307#endif
1308
1309#ifdef FEATURE_WLAN_CCX
1310//Returns whether the current association is a CCX assoc or not
1311tANI_BOOLEAN csrRoamIsCCXAssoc(tpAniSirGlobal pMac);
1312#endif
1313
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001314//Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -07001315//BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnson295189b2012-06-20 16:38:30 -07001316void csrDisconnectAllActiveSessions(tpAniSirGlobal pMac);
Mohit Khanna349bc392012-09-11 17:24:52 -07001317
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001318#ifdef FEATURE_WLAN_LFR
1319//Returns whether "Legacy Fast Roaming" is enabled...or not
Madan Mohan Koyyalamudi03aae5f2012-11-28 01:51:22 +05301320tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac, tANI_U32 sessionId);
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -07001321tANI_BOOLEAN csrIsChannelPresentInList( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
1322VOS_STATUS csrAddToChannelListFront( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001323#endif
1324