blob: bc4631d00789063d4d0701acf9f3251772dcaf88 [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)
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700602 tANI_U8 isFastTransitionEnabled;
603 tANI_U8 RoamRssiDiff;
604 tANI_U8 nImmediateRoamRssiDiff;
605 tANI_BOOLEAN nRoamPrefer5GHz;
606 tANI_BOOLEAN nRoamIntraBand;
607 tANI_BOOLEAN isWESModeEnabled;
608 tANI_BOOLEAN nRoamScanControl;
Jeff Johnson295189b2012-06-20 16:38:30 -0700609#endif
610
611#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
612 tCsrNeighborRoamConfig neighborRoamConfig;
613#endif
614
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800615 /* Instead of Reassoc, send ADDTS/DELTS even when ACM is off for that AC
Jeff Johnson295189b2012-06-20 16:38:30 -0700616 * This is mandated by WMM-AC certification */
617 tANI_BOOLEAN addTSWhenACMIsOff;
618
619 tANI_BOOLEAN fValidateList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800620 //Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700621 //BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnsone7245742012-09-05 17:12:55 -0700622 tANI_BOOLEAN doBMPSWorkaround;
Jeff Johnson295189b2012-06-20 16:38:30 -0700623
624 //To enable/disable scanning 2.4Ghz channels twice on a single scan request from HDD
625 tANI_BOOLEAN fScanTwice;
Jeff Johnsone7245742012-09-05 17:12:55 -0700626#ifdef WLAN_FEATURE_11AC
627 tANI_U32 nVhtChannelWidth;
Shailender Karmuchi08f87c22013-01-17 12:51:24 -0800628 tANI_U8 txBFEnable;
Shailender Karmuchicc3fe442013-02-16 18:18:33 -0800629 tANI_U8 txBFCsnValue;
Jeff Johnsone7245742012-09-05 17:12:55 -0700630#endif
Gopichand Nakkalab2d2c312013-01-04 11:41:02 -0800631 tANI_U8 txLdpcEnable;
Jeff Johnson295189b2012-06-20 16:38:30 -0700632
633}tCsrConfig;
634
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800635typedef struct tagCsrChannelPowerInfo
Jeff Johnson295189b2012-06-20 16:38:30 -0700636{
637 tListElem link;
638 tANI_U8 firstChannel;
639 tANI_U8 numChannels;
640 tANI_U8 txPower;
641 tANI_U8 interChannelOffset;
642}tCsrChannelPowerInfo;
643
644typedef struct tagRoamJoinStatus
645{
646 tSirResultCodes statusCode;
647 //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 -0800648 tANI_U32 reasonCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700649}tCsrRoamJoinStatus;
650
651typedef struct tagCsrOsChannelMask
652{
653 tANI_U8 numChannels;
654 tANI_BOOLEAN scanEnabled[WNI_CFG_VALID_CHANNEL_LIST_LEN];
655 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
656}tCsrOsChannelMask;
657
658
659typedef struct tagCsrScanStruct
660{
661 tScanProfile scanProfile;
662 tANI_U32 nextScanID;
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700663 tDblLinkList scanResultList;
Jeff Johnson295189b2012-06-20 16:38:30 -0700664 tDblLinkList tempScanResults;
665 tANI_BOOLEAN fScanEnable;
666 tANI_BOOLEAN fFullScanIssued;
667 tPalTimerHandle hTimerGetResult;
668#ifdef WLAN_AP_STA_CONCURRENCY
669 tPalTimerHandle hTimerStaApConcTimer;
670#endif
671 tPalTimerHandle hTimerIdleScan;
672 tPalTimerHandle hTimerResultAging;
Sandeep Puligilla2b6dc632012-12-17 14:44:16 -0800673 tPalTimerHandle hTimerResultCfgAging;
Jeff Johnson295189b2012-06-20 16:38:30 -0700674 tPalTimerHandle hTimerBgScan;
675 //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 -0800676 tANI_U8 channelOf11dInfo;
677 tANI_U8 scanResultCfgAgingTime;
Jeff Johnson295189b2012-06-20 16:38:30 -0700678 //changes on every scan, a flag to tell whether conflict 11d info found on each BSS
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800679 tANI_BOOLEAN fAmbiguous11dInfoFound;
Jeff Johnson295189b2012-06-20 16:38:30 -0700680 //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 -0800681 tANI_BOOLEAN fCurrent11dInfoMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700682 tANI_BOOLEAN f11dInfoReset; //to indicate whether the 11d info in CFG is reset to default
683 tSirScanType curScanType;
684 tCsrChannel baseChannels; //This are all the supported channels AND(&) to the current eBand
685 tCsrChannel channels11d;
686 tChannelListWithPower defaultPowerTable[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
687 tChannelListWithPower defaultPowerTable40MHz[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
688 tANI_U32 numChannelsDefault; //total channels of NV
689 tCsrChannel base20MHzChannels; //The channel base to work on
690 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
691 tDblLinkList channelPowerInfoList24;
692 tDblLinkList channelPowerInfoList5G;
693 tANI_U32 nLastAgeTimeOut;
694 tANI_U32 nAgingCountDown;
Gopichand Nakkala114718f2013-03-25 19:19:46 -0700695 tANI_U8 countryCodeDefault[WNI_CFG_COUNTRY_CODE_LEN]; //The country code from NV
696 tANI_U8 countryCodeCurrent[WNI_CFG_COUNTRY_CODE_LEN];
697 tANI_U8 countryCode11d[WNI_CFG_COUNTRY_CODE_LEN];
Jeff Johnson295189b2012-06-20 16:38:30 -0700698 v_REGDOMAIN_t domainIdDefault; //default regulatory domain
699 v_REGDOMAIN_t domainIdCurrent; //current regulatory domain
700 tANI_BOOLEAN f11dInfoApplied;
701 tANI_BOOLEAN fCancelIdleScan;
702#ifdef FEATURE_WLAN_WAPI
703// tANI_U16 NumBkidCandidate;
704// tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED]; /* Move this as part of SessionEntry */
705#endif /* FEATURE_WLAN_WAPI */
706 tANI_U8 numBGScanChannel; //number of valid channels in the bgScanChannelList
707 tANI_U8 bgScanChannelList[WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN];
708 //the ChannelInfo member is not used in this structure.
709 //numBGScanChannel and bgScanChannelList are used for the BG scan channel info
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800710 tCsrBGScanRequest bgScanParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700711 tANI_BOOLEAN fRestartIdleScan;
712 tANI_U32 nIdleScanTimeGap; //the time since last trying to trigger idle scan
713 tCsrOsChannelMask osScanChannelMask;//keep a track of channels to be scnned while in traffic condition
714 tANI_U16 nBssLimit; //the maximum number of BSS in scan cache
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800715 /*channelPowerInfoList24 has been seen corrupted. Set this flag to true trying to
Jeff Johnson295189b2012-06-20 16:38:30 -0700716 * detect when it happens. Adding this into code because we can't reproduce it easily.
717 * We don't know when it happens. */
718 tANI_BOOLEAN fValidateList;
719 /*Customer wants to start with an active scan based on the default country code.
720 * This optimization will minimize the driver load to association time.
721 * Based on this flag we will bypass the initial passive scan needed for 11d
722 * to determine the country code & domain */
723 tANI_BOOLEAN fEnableBypass11d;
724
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800725 /*Customer wants to optimize the scan time. Avoiding scans(passive) on DFS
726 * channels while swipping through both bands can save some time
Jeff Johnson295189b2012-06-20 16:38:30 -0700727 * (apprx 1.3 sec) */
728 tANI_BOOLEAN fEnableDFSChnlScan;
729
Jeff Johnsone7245742012-09-05 17:12:55 -0700730 /*
731 * To enable/disable scanning only 2.4Ghz channels on first scan
732 */
733 tANI_BOOLEAN fFirstScanOnly2GChnl;
734
Jeff Johnson295189b2012-06-20 16:38:30 -0700735 tANI_BOOLEAN fDropScanCmd; //true means we don't accept scan commands
736
737#ifdef WLAN_AP_STA_CONCURRENCY
738 tDblLinkList scanCmdPendingList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800739#endif
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700740 tCsrChannel occupiedChannels; //This includes all channels on which candidate APs are found
Madan Mohan Koyyalamudi3f65e312012-11-06 15:31:12 -0800741
742 tANI_BOOLEAN fIgnore_chan165;
Jeff Johnson295189b2012-06-20 16:38:30 -0700743}tCsrScanStruct;
744
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800745#ifdef FEATURE_WLAN_TDLS_INTERNAL
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800746/*
747 * struct to carry TDLS discovery info..
748 */
749typedef struct sCsrTdlsContext
750{
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800751 tDblLinkList tdlsPotentialPeerList ;
752 tANI_U16 tdlsCommonFlag ;
753 tANI_U16 tdlsCommonState ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800754 tANI_U16 tdlsPeerCount ;
755}tCsrTdlsCtxStruct;
756
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800757typedef struct sCsrTdlsPeerLinkInfo
758{
759 tListElem tdlsPeerStaLink ;
760 tSirTdlsPeerInfo tdlsDisPeerInfo ;
761}tCsrTdlsPeerLinkinfo ;
762#endif
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800763
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800764
765
Jeff Johnson295189b2012-06-20 16:38:30 -0700766
767//Save the connected information. This structure + connectedProfile
768//should contain all information about the connection
769typedef struct tagRoamCsrConnectedInfo
770{
771 tANI_U32 nBeaconLength; //the length, in bytes, of the beacon frame, can be 0
772 tANI_U32 nAssocReqLength; //the length, in bytes, of the assoc req frame, can be 0
773 tANI_U32 nAssocRspLength; //The length, in bytes, of the assoc rsp frame, can be 0
774#ifdef WLAN_FEATURE_VOWIFI_11R
775 tANI_U32 nRICRspLength; //Length of the parsed RIC response IEs received in reassoc response
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800776#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700777#ifdef FEATURE_WLAN_CCX
778 tANI_U32 nTspecIeLength;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800779#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700780 tANI_U8 *pbFrames; //Point to a buffer contain the beacon, assoc req, assoc rsp frame, in that order
781 //user needs to use nBeaconLength, nAssocReqLength, nAssocRspLength to desice where
782 //each frame starts and ends.
783 tANI_U8 staId;
784}tCsrRoamConnectedInfo;
785
786
787typedef struct tagCsrLinkQualityIndInfo
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800788{
Jeff Johnson295189b2012-06-20 16:38:30 -0700789 csrRoamLinkQualityIndCallback callback;
790 void *context;
791}tCsrLinkQualityIndInfo;
792
793typedef struct tagCsrPeStatsReqInfo
794{
795 tListElem link; /* list links */
796 tANI_U32 statsMask;
797 tANI_U32 periodicity;
798 tANI_BOOLEAN rspPending;
799 vos_timer_t hPeStatsTimer;
800 tANI_BOOLEAN timerRunning;
801 tANI_U8 staId;
802 tANI_U8 numClient;
803 tpAniSirGlobal pMac;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800804 /* To remember if the peStats timer is stopped successfully or not */
Jeff Johnson295189b2012-06-20 16:38:30 -0700805 tANI_BOOLEAN timerStopFailed;
806
807}tCsrPeStatsReqInfo;
808
809typedef struct tagCsrStatsClientReqInfo
810{
811 tListElem link; /* list links */
812 eCsrStatsRequesterType requesterId;
813 tCsrStatsCallback callback;
814 tANI_U32 periodicity;
815 void *pContext;
816 tANI_U32 statsMask;
817 tCsrPeStatsReqInfo *pPeStaEntry;
818 tANI_U8 staId;
819 vos_timer_t timer;
820 tANI_BOOLEAN timerExpired;
821 tpAniSirGlobal pMac; // TODO: Confirm this change BTAMP
822}tCsrStatsClientReqInfo;
823
824typedef struct tagCsrTlStatsReqInfo
825{
826 tANI_U32 periodicity;
827 tANI_BOOLEAN timerRunning;
828 tPalTimerHandle hTlStatsTimer;
829 tANI_U8 numClient;
830}tCsrTlStatsReqInfo;
831
832typedef struct tagCsrRoamSession
833{
834 tANI_U8 sessionId; // Session ID
835 tANI_BOOLEAN sessionActive; // TRUE if it is used
836 tCsrBssid selfMacAddr; // For BT-AMP station, this serve as BSSID for self-BSS.
837 csrRoamCompleteCallback callback;
838 void *pContext;
839 eCsrConnectState connectState;
840 tCsrRoamConnectedProfile connectedProfile;
841 tCsrRoamConnectedInfo connectedInfo;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800842 tCsrRoamProfile *pCurRoamProfile;
Jeff Johnson295189b2012-06-20 16:38:30 -0700843 tSirBssDescription *pConnectBssDesc;
844 tANI_U16 NumPmkidCache;
845 tPmkidCacheInfo PmkidCacheInfo[CSR_MAX_PMKID_ALLOWED];
846 tANI_U8 cJoinAttemps;
847 //This may or may not have the up-to-date valid channel list
848 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
849 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
850 tANI_S32 sPendingCommands; //0 means CSR is ok to low power
851#ifdef FEATURE_WLAN_WAPI
852 tANI_U16 NumBkidCache;
853 tBkidCacheInfo BkidCacheInfo[CSR_MAX_BKID_ALLOWED];
854#endif /* FEATURE_WLAN_WAPI */
855 tANI_BOOLEAN fRoaming; //indicate whether CSR is roaming (either via lostlink or dynamic roaming)
856 //to remember some parameters needed for START_BSS.
857 //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 -0800858 tCsrRoamStartBssParams bssParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700859 tANI_U32 nWpaRsnReqIeLength; //the byte count of pWpaRsnIE;
860 tANI_U8 *pWpaRsnReqIE; //this contain the WPA/RSN IE in assoc request or the one sent in beacon (IBSS)
861 tANI_U32 nWpaRsnRspIeLength; //the byte count for pWpaRsnRspIE
862 tANI_U8 *pWpaRsnRspIE; //this contain the WPA/RSN IE in beacon/probe rsp
863#ifdef FEATURE_WLAN_WAPI
864 tANI_U32 nWapiReqIeLength; //the byte count of pWapiReqIE;
865 tANI_U8 *pWapiReqIE; //this contain the WAPI IE in assoc request or the one sent in beacon (IBSS)
866 tANI_U32 nWapiRspIeLength; //the byte count for pWapiRspIE
867 tANI_U8 *pWapiRspIE; //this contain the WAPI IE in beacon/probe rsp
868#endif /* FEATURE_WLAN_WAPI */
869 tANI_U32 nAddIEScanLength; //the byte count of pAddIeScanIE;
870 tANI_U8 *pAddIEScan; //this contains the additional IE in (unicast) probe request at the time of join
871 tANI_U32 nAddIEAssocLength; //the byte count for pAddIeAssocIE
872 tANI_U8 *pAddIEAssoc; //this contains the additional IE in (re) assoc request
873
874 tANI_TIMESTAMP roamingStartTime; //in units of 10ms
875 tCsrTimerInfo roamingTimerInfo;
876 eCsrRoamingReason roamingReason;
877 tANI_BOOLEAN fCancelRoaming;
878 tPalTimerHandle hTimerRoaming;
879 tPalTimerHandle hTimerIbssJoining;
880 tCsrTimerInfo ibssJoinTimerInfo;
881 tANI_BOOLEAN ibss_join_pending;
882 eCsrRoamResult roamResult; //the roamResult that is used when the roaming timer fires
883 tCsrRoamJoinStatus joinFailStatusCode; //This is the reason code for join(assoc) failure
884 //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 -0800885 tANI_U32 roamingStatusCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700886 tANI_U16 NumPmkidCandidate;
887 tPmkidCandidateInfo PmkidCandidateInfo[CSR_MAX_PMKID_ALLOWED];
888 #ifdef FEATURE_WLAN_WAPI
889 tANI_U16 NumBkidCandidate;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800890 tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED];
Jeff Johnson295189b2012-06-20 16:38:30 -0700891#endif
892 tANI_BOOLEAN fWMMConnection;
893#ifdef FEATURE_WLAN_BTAMP_UT_RF
894 //To retry a join later when it fails if so desired
895 tPalTimerHandle hTimerJoinRetry;
896 tCsrTimerInfo joinRetryTimerInfo;
897 tANI_U32 maxRetryCount;
898#endif
899#ifdef FEATURE_WLAN_CCX
900 tCsrCcxCckmInfo ccxCckmInfo;
901 tANI_BOOLEAN isPrevApInfoValid;
902 tSirMacSSid prevApSSID;
903 tCsrBssid prevApBssid;
904 tANI_U8 prevOpChannel;
905 tANI_U16 clientDissSecs;
906 tANI_U32 roamTS1;
907#endif
908 tANI_U8 bRefAssocStartCnt; //Tracking assoc start indication
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800909 /* to force the AP initiate fresh 802.1x authentication after re-association need to clear
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700910 * the PMKID cache. To clear the cache in this particular case this is added
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800911 * it is needed by the HS 2.0 passpoint certification 5.2.a and b testcases */
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700912 tANI_BOOLEAN fIgnorePMKIDCache;
Jeff Johnson295189b2012-06-20 16:38:30 -0700913} tCsrRoamSession;
914
915typedef struct tagCsrRoamStruct
916{
917 tANI_U32 nextRoamId;
918 tDblLinkList roamCmdPendingList;
919 tDblLinkList channelList5G;
920 tDblLinkList channelList24;
921 tCsrConfig configParam;
922 tANI_U32 numChannelsEeprom; //total channels of eeprom
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800923 tCsrChannel base20MHzChannels; //The channel base to work on
924 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
925 eCsrRoamState curState[CSR_ROAM_SESSION_MAX];
Jeff Johnson295189b2012-06-20 16:38:30 -0700926 eCsrRoamSubState curSubState[CSR_ROAM_SESSION_MAX];
927 //This may or may not have the up-to-date valid channel list
928 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
929 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
930 tANI_U32 numValidChannels; //total number of channels in CFG
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800931
Jeff Johnson295189b2012-06-20 16:38:30 -0700932 tANI_S32 sPendingCommands;
Jeff Johnson295189b2012-06-20 16:38:30 -0700933 tPalTimerHandle hTimerWaitForKey; //To support timeout for WaitForKey state
934 tCsrSummaryStatsInfo summaryStatsInfo;
935 tCsrGlobalClassAStatsInfo classAStatsInfo;
936 tCsrGlobalClassBStatsInfo classBStatsInfo;
937 tCsrGlobalClassCStatsInfo classCStatsInfo;
938 tCsrGlobalClassDStatsInfo classDStatsInfo;
939 tCsrPerStaStatsInfo perStaStatsInfo[CSR_MAX_STA];
940 tDblLinkList statsClientReqList;
941 tDblLinkList peStatsReqList;
942 tCsrTlStatsReqInfo tlStatsReqInfo;
943 eCsrRoamLinkQualityInd vccLinkQuality;
944 tCsrLinkQualityIndInfo linkQualityIndInfo;
945 v_CONTEXT_t gVosContext; //used for interaction with TL
946 //To specify whether an association or a IBSS is WMM enabled
947 //This parameter is only valid during a join or start BSS command is being executed
948 //tANI_BOOLEAN fWMMConnection; /* Moving it to be part of roamsession */
949 v_U8_t ucACWeights[WLANTL_MAX_AC];
950 /* TODO : Upto here */
951 tCsrTimerInfo WaitForKeyTimerInfo;
952 tCsrRoamSession *roamSession;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800953 tANI_U32 transactionId; // Current transaction ID for internal use.
954#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
Jeff Johnson295189b2012-06-20 16:38:30 -0700955 tCsrNeighborRoamControlInfo neighborRoamInfo;
956#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700957#ifdef FEATURE_WLAN_LFR
958 tANI_U8 isFastRoamIniFeatureEnabled;
959#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700960#ifdef FEATURE_WLAN_CCX
961 tANI_U8 isCcxIniFeatureEnabled;
962#endif
Jeff Johnson43971f52012-07-17 12:26:56 -0700963#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700964 tANI_U8 RoamRssiDiff;
965 tANI_BOOLEAN isWESModeEnabled;
Jeff Johnson43971f52012-07-17 12:26:56 -0700966#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700967}tCsrRoamStruct;
968
969
970#define GET_NEXT_ROAM_ID(pRoamStruct) (((pRoamStruct)->nextRoamId + 1 == 0) ? 1 : (pRoamStruct)->nextRoamId)
971#define CSR_IS_ROAM_STATE(pMac, state, sessionId) ( (state) == (pMac)->roam.curState[sessionId] )
972
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800973#define CSR_IS_ROAM_STOP(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_STOP, sessionId )
974#define CSR_IS_ROAM_INIT(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_INIT, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -0700975#define CSR_IS_ROAM_SCANNING(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_SCANNING, sessionId )
976#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 -0800977#define CSR_IS_ROAM_IDLE(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_IDLE, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -0700978#define CSR_IS_ROAM_JOINED(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_JOINED, sessionId )
979
980#define CSR_IS_ROAM_SUBSTATE(pMac, subState, sessionId) ((subState) == (pMac)->roam.curSubState[sessionId])
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800981#define CSR_IS_ROAM_SUBSTATE_JOIN_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOIN_REQ, sessionId)
982#define CSR_IS_ROAM_SUBSTATE_AUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_AUTH_REQ, sessionId)
983#define CSR_IS_ROAM_SUBSTATE_REASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_REASSOC_REQ, sessionId)
984#define CSR_IS_ROAM_SUBSTATE_DISASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REQ, sessionId)
985#define CSR_IS_ROAM_SUBSTATE_DISASSOC_NO_JOIN(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN, sessionId)
986#define CSR_IS_ROAM_SUBSTATE_REASSOC_FAIL(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE, sessionId)
987#define CSR_IS_ROAM_SUBSTATE_DISASSOC_FORCED(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_FORCED, sessionId)
988#define CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DEAUTH_REQ, sessionId)
989#define CSR_IS_ROAM_SUBSTATE_START_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_START_BSS_REQ, sessionId)
990#define CSR_IS_ROAM_SUBSTATE_STOP_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_STOP_BSS_REQ, sessionId)
991#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 -0700992#define CSR_IS_ROAM_SUBSTATE_CONFIG(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_CONFIG, sessionId)
993#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 -0800994#define CSR_IS_ROAM_SUBSTATE_DISASSOC_HO(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF, sessionId)
995#define CSR_IS_ROAM_SUBSTATE_HO_NT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC, sessionId)
996#define CSR_IS_ROAM_SUBSTATE_HO_NRT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC, sessionId)
997#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 -0700998
999#define CSR_IS_PHY_MODE_B_ONLY(pMac) \
1000 ((eCSR_DOT11_MODE_11b == (pMac)->roam.configParam.phyMode) ||\
1001 (eCSR_DOT11_MODE_11b_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001002
Jeff Johnson295189b2012-06-20 16:38:30 -07001003#define CSR_IS_PHY_MODE_G_ONLY(pMac) \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001004 (eCSR_DOT11_MODE_11g == (pMac)->roam.configParam.phyMode || eCSR_DOT11_MODE_11g_ONLY == (pMac)->roam.configParam.phyMode)
1005
Jeff Johnson295189b2012-06-20 16:38:30 -07001006#define CSR_IS_PHY_MODE_A_ONLY(pMac) \
1007 ((eCSR_DOT11_MODE_11a == (pMac)->roam.configParam.phyMode) ||\
1008 (eCSR_DOT11_MODE_11a_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001009
Jeff Johnsone7245742012-09-05 17:12:55 -07001010#ifdef WLAN_FEATURE_11AC
1011#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1012 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1013 (eCSR_DOT11_MODE_11ac & (phyMode)) || \
1014 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1015 (eCSR_DOT11_MODE_AUTO & (phyMode)))
1016#else
Jeff Johnson295189b2012-06-20 16:38:30 -07001017#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1018 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1019 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1020 (eCSR_DOT11_MODE_AUTO & (phyMode)))
Jeff Johnsone7245742012-09-05 17:12:55 -07001021#endif
1022
Jeff Johnson295189b2012-06-20 16:38:30 -07001023
1024// this function returns TRUE if the NIC is operating exclusively in the 2.4 GHz band, meaning
1025// it is NOT operating in the 5.0 GHz band.
1026#define CSR_IS_24_BAND_ONLY(pMac) \
1027 (eCSR_BAND_24 == (pMac)->roam.configParam.eBand)
1028
1029#define CSR_IS_5G_BAND_ONLY(pMac) \
1030 (eCSR_BAND_5G == (pMac)->roam.configParam.eBand)
1031
1032#define CSR_IS_RADIO_DUAL_BAND(pMac) \
1033 (eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability)
1034
1035#define CSR_IS_RADIO_BG_ONLY(pMac) \
1036 (eCSR_BAND_24 == (pMac)->roam.configParam.bandCapability)
1037
1038// this function returns TRUE if the NIC is operating exclusively in the 5.0 GHz band, meaning
1039// it is NOT operating in the 2.4 GHz band
1040#define CSR_IS_RADIO_A_ONLY(pMac) \
1041 (eCSR_BAND_5G == (pMac)->roam.configParam.bandCapability)
1042
1043// this function returns TRUE if the NIC is operating in both bands.
1044#define CSR_IS_OPEARTING_DUAL_BAND(pMac) \
1045 ((eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability) && (eCSR_BAND_ALL == (pMac)->roam.configParam.eBand))
1046
1047// this function returns TRUE if the NIC can operate in the 5.0 GHz band (could operate in the
1048// 2.4 GHz band also).
1049#define CSR_IS_OPERATING_A_BAND(pMac) \
1050 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_A_ONLY((pMac)) || CSR_IS_5G_BAND_ONLY((pMac)))
1051
1052// this function returns TRUE if the NIC can operate in the 2.4 GHz band (could operate in the
1053// 5.0 GHz band also).
1054#define CSR_IS_OPERATING_BG_BAND(pMac) \
1055 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_BG_ONLY((pMac)) || CSR_IS_24_BAND_ONLY((pMac)))
1056
1057#define CSR_IS_CHANNEL_5GHZ(chnNum) \
Jeff Johnsone7245742012-09-05 17:12:55 -07001058 (((chnNum) >= CSR_MIN_5GHz_CHANNEL_NUMBER) && ((chnNum) <= CSR_MAX_5GHz_CHANNEL_NUMBER))
Jeff Johnson295189b2012-06-20 16:38:30 -07001059
Srinivas Girigowdade697412013-02-14 16:31:48 -08001060#define CSR_IS_CHANNEL_DFS(chnNum) \
1061 (NV_CHANNEL_ENABLE != vos_nv_getChannelEnabledState(chnNum))
1062
Jeff Johnson295189b2012-06-20 16:38:30 -07001063#define CSR_IS_CHANNEL_24GHZ(chnNum) \
1064 (((chnNum) > 0) && ((chnNum) <= CSR_MAX_24GHz_CHANNEL_NUMBER))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001065
Jeff Johnson295189b2012-06-20 16:38:30 -07001066#define CSR_IS_SAME_BAND_CHANNELS(ch1, ch2) (CSR_IS_CHANNEL_5GHZ(ch1) == CSR_IS_CHANNEL_5GHZ(ch2))
1067
1068
1069#define CSR_IS_11D_INFO_FOUND(pMac) \
1070 (0 != (pMac)->scan.channelOf11dInfo)
1071// DEAUTHIND
1072#define CSR_IS_ROAMING(pSession) ((CSR_IS_LOSTLINK_ROAMING((pSession)->roamingReason)) || \
1073 (eCsrDynamicRoaming == (pSession)->roamingReason) || \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001074 (eCsrReassocRoaming == (pSession)->roamingReason))
Jeff Johnson295189b2012-06-20 16:38:30 -07001075
1076
1077#define CSR_IS_SET_KEY_COMMAND( pCommand ) ( eSmeCommandSetKey == (pCommand)->command )
1078
1079#define CSR_IS_ADDTS_WHEN_ACMOFF_SUPPORTED(pMac) (pMac->roam.configParam.addTSWhenACMIsOff)
1080// DEAUTHIND
1081#define CSR_IS_LOSTLINK_ROAMING(reason) ((eCsrLostlinkRoamingDisassoc == (reason)) || (eCsrLostlinkRoamingDeauth == (reason)))
1082
Venkata Prathyusha Kuntupalli239278b2013-03-26 15:58:18 -07001083#define CSR_IS_ROAMING_COMMAND(pCommand) ((eCsrLostLink1 == (pCommand)->u.roamCmd.roamReason) ||\
1084 (eCsrLostLink2 == (pCommand)->u.roamCmd.roamReason) ||\
1085 (eCsrLostLink3 == (pCommand)->u.roamCmd.roamReason) )
1086
1087
Jeff Johnson295189b2012-06-20 16:38:30 -07001088//Stop CSR from asking for IMPS, This function doesn't disable IMPS from CSR
1089void csrScanSuspendIMPS( tpAniSirGlobal pMac );
1090//Start CSR from asking for IMPS. This function doesn't trigger CSR to request entering IMPS
1091//because IMPS maybe disabled.
1092void csrScanResumeIMPS( tpAniSirGlobal pMac );
1093
1094eHalStatus csrInitGetChannels(tpAniSirGlobal pMac);
Venkata Prathyusha Kuntupalli316247e2013-03-15 17:45:25 -07001095// Getting the 5GHz Channel list
1096eHalStatus csrGet5GChannels(tpAniSirGlobal pMac);
1097// Getting the 2.4GHz Channel list
1098eHalStatus csrGet24GChannels(tpAniSirGlobal pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001099
1100eHalStatus csrSetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1101 tCsrRoamModifyProfileFields *pModifyProfileFields);
1102/* ---------------------------------------------------------------------------
1103 \fn csrGetModifyProfileFields
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001104 \brief HDD or SME - QOS calls this function to get the current values of
Jeff Johnson295189b2012-06-20 16:38:30 -07001105 connected profile fields changing which can cause reassoc.
1106 This function must be called after CFG is downloaded and STA is in connected
1107 state.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001108 \param pModifyProfileFields - pointer to the connected profile fields
Jeff Johnson295189b2012-06-20 16:38:30 -07001109 changing which can cause reassoc
1110
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001111 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001112 -------------------------------------------------------------------------------*/
1113eHalStatus csrGetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1114 tCsrRoamModifyProfileFields * pModifyProfileFields);
1115void csrSetGlobalCfgs( tpAniSirGlobal pMac );
1116void csrSetDefaultDot11Mode( tpAniSirGlobal pMac );
1117void csrScanSetChannelMask(tpAniSirGlobal pMac, tCsrChannelInfo *pChannelInfo);
1118tANI_BOOLEAN csrIsConnStateDisconnected(tpAniSirGlobal pMac, tANI_U32 sessionId);
1119tANI_BOOLEAN csrIsConnStateConnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1120tANI_BOOLEAN csrIsConnStateDisconnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1121tANI_BOOLEAN csrIsConnStateConnectedInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1122tANI_BOOLEAN csrIsConnStateConnected( tpAniSirGlobal pMac, tANI_U32 sessionId );
1123tANI_BOOLEAN csrIsConnStateInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1124tANI_BOOLEAN csrIsConnStateIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1125tANI_BOOLEAN csrIsConnStateWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1126tANI_BOOLEAN csrIsConnStateConnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1127tANI_BOOLEAN csrIsConnStateDisconnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1128tANI_BOOLEAN csrIsAnySessionInConnectState( tpAniSirGlobal pMac );
1129tANI_BOOLEAN csrIsAllSessionDisconnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudi48081ef2012-12-04 16:49:55 -08001130tANI_BOOLEAN csrIsStaSessionConnected( tpAniSirGlobal pMac );
1131tANI_BOOLEAN csrIsP2pSessionConnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudid3d22592012-09-24 14:01:29 -07001132tANI_BOOLEAN csrIsAnySessionConnected( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001133tANI_BOOLEAN csrIsInfraConnected( tpAniSirGlobal pMac );
1134tANI_BOOLEAN csrIsConcurrentInfraConnected( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001135tANI_BOOLEAN csrIsConcurrentSessionRunning( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001136tANI_BOOLEAN csrIsInfraApStarted( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001137tANI_BOOLEAN csrIsIBSSStarted( tpAniSirGlobal pMac );
1138tANI_BOOLEAN csrIsBTAMPStarted( tpAniSirGlobal pMac );
1139tANI_BOOLEAN csrIsBTAMP( tpAniSirGlobal pMac, tANI_U32 sessionId );
1140eHalStatus csrIsBTAMPAllowed( tpAniSirGlobal pMac, tANI_U32 chnId );
Jeff Johnsone7245742012-09-05 17:12:55 -07001141tANI_BOOLEAN csrIsValidMcConcurrentSession(tpAniSirGlobal pMac, tANI_U32 sessionId,
1142 tSirBssDescription *pBssDesc);
Jeff Johnson295189b2012-06-20 16:38:30 -07001143tANI_BOOLEAN csrIsConnStateConnectedInfraAp( tpAniSirGlobal pMac, tANI_U32 sessionId );
Jeff Johnson295189b2012-06-20 16:38:30 -07001144/*----------------------------------------------------------------------------
1145 \fn csrRoamRegisterLinkQualityIndCallback
1146
1147 \brief
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001148 a CSR function to allow HDD to register a callback handler with CSR for
1149 link quality indications.
Jeff Johnson295189b2012-06-20 16:38:30 -07001150
1151 Only one callback may be registered at any time.
1152 In order to deregister the callback, a NULL cback may be provided.
1153
1154 Registration happens in the task context of the caller.
1155
1156 \param callback - Call back being registered
1157 \param pContext - user data
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001158
Jeff Johnson295189b2012-06-20 16:38:30 -07001159 DEPENDENCIES: After CSR open
1160
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001161 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001162-----------------------------------------------------------------------------*/
1163eHalStatus csrRoamRegisterLinkQualityIndCallback(tpAniSirGlobal pMac,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001164 csrRoamLinkQualityIndCallback callback,
Jeff Johnson295189b2012-06-20 16:38:30 -07001165 void *pContext);
1166/* ---------------------------------------------------------------------------
1167 \fn csrGetStatistics
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001168 \brief csr function that client calls to register a callback to get
1169 different PHY level statistics from CSR.
1170
Jeff Johnson295189b2012-06-20 16:38:30 -07001171 \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc
1172 \param statsMask - The different category/categories of stats requester is looking for
1173 \param callback - SME sends back the requested stats using the callback
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001174 \param periodicity - If requester needs periodic update, 0 means it's an one
Jeff Johnson295189b2012-06-20 16:38:30 -07001175 time request
1176 \param cache - If requester is happy with cached stats
1177 \param staId - The station ID for which the stats is requested for
1178 \param pContext - user context to be passed back along with the callback
1179
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001180 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001181 ---------------------------------------------------------------------------*/
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001182eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requesterId,
1183 tANI_U32 statsMask,
1184 tCsrStatsCallback callback,
1185 tANI_U32 periodicity, tANI_BOOLEAN cache,
Jeff Johnson295189b2012-06-20 16:38:30 -07001186 tANI_U8 staId, void *pContext);
1187
1188
1189eHalStatus csrGetRssi(tpAniSirGlobal pMac,tCsrRssiCallback callback,tANI_U8 staId,tCsrBssid bssId,void * pContext,void * pVosContext);
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08001190#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1191eHalStatus csrGetRoamRssi(tpAniSirGlobal pMac,
1192 tCsrRssiCallback callback,
1193 tANI_U8 staId,
1194 tCsrBssid bssId,
1195 void * pContext,
1196 void * pVosContext);
1197#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001198eHalStatus csrRoamRegisterCallback(tpAniSirGlobal pMac, csrRoamCompleteCallback callback, void *pContext);
1199/* ---------------------------------------------------------------------------
1200 \fn csrGetConfigParam
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001201 \brief HDD calls this function to get the global settings currently maintained by CSR.
Jeff Johnson295189b2012-06-20 16:38:30 -07001202 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001203 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001204 -------------------------------------------------------------------------------*/
1205eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1206
1207/* ---------------------------------------------------------------------------
1208 \fn csrMsgProcessor
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001209 \brief HDD calls this function to change some global settings.
Jeff Johnson295189b2012-06-20 16:38:30 -07001210 caller must set the all fields or call csrGetConfigParam to prefill the fields.
1211 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001212 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001213 -------------------------------------------------------------------------------*/
1214eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1215
1216
1217/* ---------------------------------------------------------------------------
1218 \fn csrMsgProcessor
1219 \brief HDD calls this function for the messages that are handled by CSR.
1220 \param pMsgBuf - a pointer to a buffer that maps to various structures base on the message type.
1221 The beginning of the buffer can always map to tSirSmeRsp.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001222 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001223 -------------------------------------------------------------------------------*/
1224eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf );
1225
1226/* ---------------------------------------------------------------------------
1227 \fn csrOpen
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001228 \brief This function must be called before any API call to CSR.
1229 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001230 -------------------------------------------------------------------------------*/
1231eHalStatus csrOpen(tpAniSirGlobal pMac);
1232/* ---------------------------------------------------------------------------
1233 \fn csrClose
1234 \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 -08001235 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001236 -------------------------------------------------------------------------------*/
1237eHalStatus csrClose(tpAniSirGlobal pMac);
1238/* ---------------------------------------------------------------------------
1239 \fn csrStart
1240 \brief To start CSR.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001241 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001242 -------------------------------------------------------------------------------*/
1243eHalStatus csrStart(tpAniSirGlobal pMac);
1244/* ---------------------------------------------------------------------------
1245 \fn csrStop
1246 \brief To stop CSR. CSR still keeps its current setting.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001247 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001248 -------------------------------------------------------------------------------*/
1249eHalStatus csrStop(tpAniSirGlobal pMac);
1250/* ---------------------------------------------------------------------------
1251 \fn csrReady
1252 \brief To let CSR is ready to operate
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001253 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001254 -------------------------------------------------------------------------------*/
1255eHalStatus csrReady(tpAniSirGlobal pMac);
1256
1257#ifdef FEATURE_WLAN_WAPI
1258eHalStatus csrRoamGetBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pNum,
1259 tBkidCacheInfo *pBkidCache);
1260
1261
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001262eHalStatus csrScanGetBKIDCandidateList(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001263 tBkidCandidateInfo *pBkidList, tANI_U32 *pNumItems );
1264tANI_U32 csrRoamGetNumBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId);
1265eHalStatus csrRoamSetBKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache,
1266 tANI_U32 numItems );
1267/* ---------------------------------------------------------------------------
1268 \fn csrRoamGetWapiReqIE
1269 \brief return the WAPI IE CSR passes to PE to JOIN request or START_BSS request
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001270 \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 -07001271 needed or IE length in pBuf.
1272 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1273 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1274 -------------------------------------------------------------------------------*/
1275eHalStatus csrRoamGetWapiReqIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
1276
1277/* ---------------------------------------------------------------------------
1278 \fn csrRoamGetWapiRspIE
1279 \brief return the WAPI IE from the beacon or probe rsp if connected
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001280 \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 -07001281 needed or IE length in pBuf.
1282 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1283 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1284 -------------------------------------------------------------------------------*/
1285eHalStatus csrRoamGetWapiRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001286tANI_U8 csrConstructWapiIe( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
Jeff Johnson295189b2012-06-20 16:38:30 -07001287 tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes, tCsrWapiIe *pWapiIe );
1288#endif /* FEATURE_WLAN_WAPI */
1289
Jeff Johnson295189b2012-06-20 16:38:30 -07001290eHalStatus csrRoamUpdateAPWPSIE( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirAPWPSIEs *pAPWPSIES );
1291eHalStatus csrRoamUpdateWPARSNIEs( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirRSNie * pAPSirRSNie);
Jeff Johnson295189b2012-06-20 16:38:30 -07001292void csrSetCfgPrivacy( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, tANI_BOOLEAN fPrivacy );
1293tANI_S8 csrGetInfraSessionId( tpAniSirGlobal pMac );
1294tANI_U8 csrGetInfraOperationChannel( tpAniSirGlobal pMac, tANI_U8 sessionId);
1295tANI_U8 csrGetConcurrentOperationChannel( tpAniSirGlobal pMac );
1296
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001297eHalStatus csrRoamCopyConnectProfile(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001298 tCsrRoamConnectedProfile *pProfile);
1299tANI_BOOLEAN csrIsSetKeyAllowed(tpAniSirGlobal pMac, tANI_U32 sessionId);
1300
1301void csrSetOppositeBandChannelInfo( tpAniSirGlobal pMac );
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001302void csrConstructCurrentValidChannelList( tpAniSirGlobal pMac, tDblLinkList *pChannelSetList,
Jeff Johnson295189b2012-06-20 16:38:30 -07001303 tANI_U8 *pChannelList, tANI_U8 bSize, tANI_U8 *pNumChannels );
1304
1305#endif
1306
1307#ifdef WLAN_FEATURE_VOWIFI_11R
1308//Returns whether the current association is a 11r assoc or not
1309tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac);
1310#endif
1311
1312#ifdef FEATURE_WLAN_CCX
1313//Returns whether the current association is a CCX assoc or not
1314tANI_BOOLEAN csrRoamIsCCXAssoc(tpAniSirGlobal pMac);
1315#endif
1316
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001317//Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -07001318//BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnson295189b2012-06-20 16:38:30 -07001319void csrDisconnectAllActiveSessions(tpAniSirGlobal pMac);
Mohit Khanna349bc392012-09-11 17:24:52 -07001320
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001321#ifdef FEATURE_WLAN_LFR
1322//Returns whether "Legacy Fast Roaming" is enabled...or not
Madan Mohan Koyyalamudi03aae5f2012-11-28 01:51:22 +05301323tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac, tANI_U32 sessionId);
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -07001324tANI_BOOLEAN csrIsChannelPresentInList( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
1325VOS_STATUS csrAddToChannelListFront( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001326#endif
1327