blob: 440ec1586dd50ef833f7d1740e9d0c285340e788 [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;
Kiran Kumar Lokerec8550fa2013-04-15 22:23:00 -0700649 tSirMacAddr bssId;
Jeff Johnson295189b2012-06-20 16:38:30 -0700650}tCsrRoamJoinStatus;
651
652typedef struct tagCsrOsChannelMask
653{
654 tANI_U8 numChannels;
655 tANI_BOOLEAN scanEnabled[WNI_CFG_VALID_CHANNEL_LIST_LEN];
656 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
657}tCsrOsChannelMask;
658
659
660typedef struct tagCsrScanStruct
661{
662 tScanProfile scanProfile;
663 tANI_U32 nextScanID;
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700664 tDblLinkList scanResultList;
Jeff Johnson295189b2012-06-20 16:38:30 -0700665 tDblLinkList tempScanResults;
666 tANI_BOOLEAN fScanEnable;
667 tANI_BOOLEAN fFullScanIssued;
668 tPalTimerHandle hTimerGetResult;
669#ifdef WLAN_AP_STA_CONCURRENCY
670 tPalTimerHandle hTimerStaApConcTimer;
671#endif
672 tPalTimerHandle hTimerIdleScan;
673 tPalTimerHandle hTimerResultAging;
Sandeep Puligilla2b6dc632012-12-17 14:44:16 -0800674 tPalTimerHandle hTimerResultCfgAging;
Jeff Johnson295189b2012-06-20 16:38:30 -0700675 tPalTimerHandle hTimerBgScan;
676 //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 -0800677 tANI_U8 channelOf11dInfo;
678 tANI_U8 scanResultCfgAgingTime;
Jeff Johnson295189b2012-06-20 16:38:30 -0700679 //changes on every scan, a flag to tell whether conflict 11d info found on each BSS
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800680 tANI_BOOLEAN fAmbiguous11dInfoFound;
Jeff Johnson295189b2012-06-20 16:38:30 -0700681 //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 -0800682 tANI_BOOLEAN fCurrent11dInfoMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700683 tANI_BOOLEAN f11dInfoReset; //to indicate whether the 11d info in CFG is reset to default
684 tSirScanType curScanType;
685 tCsrChannel baseChannels; //This are all the supported channels AND(&) to the current eBand
686 tCsrChannel channels11d;
687 tChannelListWithPower defaultPowerTable[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
688 tChannelListWithPower defaultPowerTable40MHz[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
689 tANI_U32 numChannelsDefault; //total channels of NV
690 tCsrChannel base20MHzChannels; //The channel base to work on
691 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
692 tDblLinkList channelPowerInfoList24;
693 tDblLinkList channelPowerInfoList5G;
694 tANI_U32 nLastAgeTimeOut;
695 tANI_U32 nAgingCountDown;
Gopichand Nakkala114718f2013-03-25 19:19:46 -0700696 tANI_U8 countryCodeDefault[WNI_CFG_COUNTRY_CODE_LEN]; //The country code from NV
697 tANI_U8 countryCodeCurrent[WNI_CFG_COUNTRY_CODE_LEN];
698 tANI_U8 countryCode11d[WNI_CFG_COUNTRY_CODE_LEN];
Jeff Johnson295189b2012-06-20 16:38:30 -0700699 v_REGDOMAIN_t domainIdDefault; //default regulatory domain
700 v_REGDOMAIN_t domainIdCurrent; //current regulatory domain
701 tANI_BOOLEAN f11dInfoApplied;
702 tANI_BOOLEAN fCancelIdleScan;
703#ifdef FEATURE_WLAN_WAPI
704// tANI_U16 NumBkidCandidate;
705// tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED]; /* Move this as part of SessionEntry */
706#endif /* FEATURE_WLAN_WAPI */
707 tANI_U8 numBGScanChannel; //number of valid channels in the bgScanChannelList
708 tANI_U8 bgScanChannelList[WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN];
709 //the ChannelInfo member is not used in this structure.
710 //numBGScanChannel and bgScanChannelList are used for the BG scan channel info
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800711 tCsrBGScanRequest bgScanParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700712 tANI_BOOLEAN fRestartIdleScan;
713 tANI_U32 nIdleScanTimeGap; //the time since last trying to trigger idle scan
714 tCsrOsChannelMask osScanChannelMask;//keep a track of channels to be scnned while in traffic condition
715 tANI_U16 nBssLimit; //the maximum number of BSS in scan cache
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800716 /*channelPowerInfoList24 has been seen corrupted. Set this flag to true trying to
Jeff Johnson295189b2012-06-20 16:38:30 -0700717 * detect when it happens. Adding this into code because we can't reproduce it easily.
718 * We don't know when it happens. */
719 tANI_BOOLEAN fValidateList;
720 /*Customer wants to start with an active scan based on the default country code.
721 * This optimization will minimize the driver load to association time.
722 * Based on this flag we will bypass the initial passive scan needed for 11d
723 * to determine the country code & domain */
724 tANI_BOOLEAN fEnableBypass11d;
725
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800726 /*Customer wants to optimize the scan time. Avoiding scans(passive) on DFS
727 * channels while swipping through both bands can save some time
Jeff Johnson295189b2012-06-20 16:38:30 -0700728 * (apprx 1.3 sec) */
729 tANI_BOOLEAN fEnableDFSChnlScan;
730
Jeff Johnsone7245742012-09-05 17:12:55 -0700731 /*
732 * To enable/disable scanning only 2.4Ghz channels on first scan
733 */
734 tANI_BOOLEAN fFirstScanOnly2GChnl;
735
Jeff Johnson295189b2012-06-20 16:38:30 -0700736 tANI_BOOLEAN fDropScanCmd; //true means we don't accept scan commands
737
738#ifdef WLAN_AP_STA_CONCURRENCY
739 tDblLinkList scanCmdPendingList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800740#endif
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700741 tCsrChannel occupiedChannels; //This includes all channels on which candidate APs are found
Madan Mohan Koyyalamudi3f65e312012-11-06 15:31:12 -0800742
743 tANI_BOOLEAN fIgnore_chan165;
Jeff Johnson295189b2012-06-20 16:38:30 -0700744}tCsrScanStruct;
745
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800746#ifdef FEATURE_WLAN_TDLS_INTERNAL
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800747/*
748 * struct to carry TDLS discovery info..
749 */
750typedef struct sCsrTdlsContext
751{
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800752 tDblLinkList tdlsPotentialPeerList ;
753 tANI_U16 tdlsCommonFlag ;
754 tANI_U16 tdlsCommonState ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800755 tANI_U16 tdlsPeerCount ;
756}tCsrTdlsCtxStruct;
757
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800758typedef struct sCsrTdlsPeerLinkInfo
759{
760 tListElem tdlsPeerStaLink ;
761 tSirTdlsPeerInfo tdlsDisPeerInfo ;
762}tCsrTdlsPeerLinkinfo ;
763#endif
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800764
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800765
766
Jeff Johnson295189b2012-06-20 16:38:30 -0700767
768//Save the connected information. This structure + connectedProfile
769//should contain all information about the connection
770typedef struct tagRoamCsrConnectedInfo
771{
772 tANI_U32 nBeaconLength; //the length, in bytes, of the beacon frame, can be 0
773 tANI_U32 nAssocReqLength; //the length, in bytes, of the assoc req frame, can be 0
774 tANI_U32 nAssocRspLength; //The length, in bytes, of the assoc rsp frame, can be 0
775#ifdef WLAN_FEATURE_VOWIFI_11R
776 tANI_U32 nRICRspLength; //Length of the parsed RIC response IEs received in reassoc response
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800777#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700778#ifdef FEATURE_WLAN_CCX
779 tANI_U32 nTspecIeLength;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800780#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700781 tANI_U8 *pbFrames; //Point to a buffer contain the beacon, assoc req, assoc rsp frame, in that order
782 //user needs to use nBeaconLength, nAssocReqLength, nAssocRspLength to desice where
783 //each frame starts and ends.
784 tANI_U8 staId;
785}tCsrRoamConnectedInfo;
786
787
788typedef struct tagCsrLinkQualityIndInfo
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800789{
Jeff Johnson295189b2012-06-20 16:38:30 -0700790 csrRoamLinkQualityIndCallback callback;
791 void *context;
792}tCsrLinkQualityIndInfo;
793
794typedef struct tagCsrPeStatsReqInfo
795{
796 tListElem link; /* list links */
797 tANI_U32 statsMask;
798 tANI_U32 periodicity;
799 tANI_BOOLEAN rspPending;
800 vos_timer_t hPeStatsTimer;
801 tANI_BOOLEAN timerRunning;
802 tANI_U8 staId;
803 tANI_U8 numClient;
804 tpAniSirGlobal pMac;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800805 /* To remember if the peStats timer is stopped successfully or not */
Jeff Johnson295189b2012-06-20 16:38:30 -0700806 tANI_BOOLEAN timerStopFailed;
807
808}tCsrPeStatsReqInfo;
809
810typedef struct tagCsrStatsClientReqInfo
811{
812 tListElem link; /* list links */
813 eCsrStatsRequesterType requesterId;
814 tCsrStatsCallback callback;
815 tANI_U32 periodicity;
816 void *pContext;
817 tANI_U32 statsMask;
818 tCsrPeStatsReqInfo *pPeStaEntry;
819 tANI_U8 staId;
820 vos_timer_t timer;
821 tANI_BOOLEAN timerExpired;
822 tpAniSirGlobal pMac; // TODO: Confirm this change BTAMP
823}tCsrStatsClientReqInfo;
824
825typedef struct tagCsrTlStatsReqInfo
826{
827 tANI_U32 periodicity;
828 tANI_BOOLEAN timerRunning;
829 tPalTimerHandle hTlStatsTimer;
830 tANI_U8 numClient;
831}tCsrTlStatsReqInfo;
832
833typedef struct tagCsrRoamSession
834{
835 tANI_U8 sessionId; // Session ID
836 tANI_BOOLEAN sessionActive; // TRUE if it is used
837 tCsrBssid selfMacAddr; // For BT-AMP station, this serve as BSSID for self-BSS.
838 csrRoamCompleteCallback callback;
839 void *pContext;
840 eCsrConnectState connectState;
841 tCsrRoamConnectedProfile connectedProfile;
842 tCsrRoamConnectedInfo connectedInfo;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800843 tCsrRoamProfile *pCurRoamProfile;
Jeff Johnson295189b2012-06-20 16:38:30 -0700844 tSirBssDescription *pConnectBssDesc;
845 tANI_U16 NumPmkidCache;
846 tPmkidCacheInfo PmkidCacheInfo[CSR_MAX_PMKID_ALLOWED];
847 tANI_U8 cJoinAttemps;
848 //This may or may not have the up-to-date valid channel list
849 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
850 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
851 tANI_S32 sPendingCommands; //0 means CSR is ok to low power
852#ifdef FEATURE_WLAN_WAPI
853 tANI_U16 NumBkidCache;
854 tBkidCacheInfo BkidCacheInfo[CSR_MAX_BKID_ALLOWED];
855#endif /* FEATURE_WLAN_WAPI */
856 tANI_BOOLEAN fRoaming; //indicate whether CSR is roaming (either via lostlink or dynamic roaming)
857 //to remember some parameters needed for START_BSS.
858 //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 -0800859 tCsrRoamStartBssParams bssParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700860 tANI_U32 nWpaRsnReqIeLength; //the byte count of pWpaRsnIE;
861 tANI_U8 *pWpaRsnReqIE; //this contain the WPA/RSN IE in assoc request or the one sent in beacon (IBSS)
862 tANI_U32 nWpaRsnRspIeLength; //the byte count for pWpaRsnRspIE
863 tANI_U8 *pWpaRsnRspIE; //this contain the WPA/RSN IE in beacon/probe rsp
864#ifdef FEATURE_WLAN_WAPI
865 tANI_U32 nWapiReqIeLength; //the byte count of pWapiReqIE;
866 tANI_U8 *pWapiReqIE; //this contain the WAPI IE in assoc request or the one sent in beacon (IBSS)
867 tANI_U32 nWapiRspIeLength; //the byte count for pWapiRspIE
868 tANI_U8 *pWapiRspIE; //this contain the WAPI IE in beacon/probe rsp
869#endif /* FEATURE_WLAN_WAPI */
870 tANI_U32 nAddIEScanLength; //the byte count of pAddIeScanIE;
871 tANI_U8 *pAddIEScan; //this contains the additional IE in (unicast) probe request at the time of join
872 tANI_U32 nAddIEAssocLength; //the byte count for pAddIeAssocIE
873 tANI_U8 *pAddIEAssoc; //this contains the additional IE in (re) assoc request
874
875 tANI_TIMESTAMP roamingStartTime; //in units of 10ms
876 tCsrTimerInfo roamingTimerInfo;
877 eCsrRoamingReason roamingReason;
878 tANI_BOOLEAN fCancelRoaming;
879 tPalTimerHandle hTimerRoaming;
880 tPalTimerHandle hTimerIbssJoining;
881 tCsrTimerInfo ibssJoinTimerInfo;
882 tANI_BOOLEAN ibss_join_pending;
883 eCsrRoamResult roamResult; //the roamResult that is used when the roaming timer fires
884 tCsrRoamJoinStatus joinFailStatusCode; //This is the reason code for join(assoc) failure
885 //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 -0800886 tANI_U32 roamingStatusCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700887 tANI_U16 NumPmkidCandidate;
888 tPmkidCandidateInfo PmkidCandidateInfo[CSR_MAX_PMKID_ALLOWED];
889 #ifdef FEATURE_WLAN_WAPI
890 tANI_U16 NumBkidCandidate;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800891 tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED];
Jeff Johnson295189b2012-06-20 16:38:30 -0700892#endif
893 tANI_BOOLEAN fWMMConnection;
894#ifdef FEATURE_WLAN_BTAMP_UT_RF
895 //To retry a join later when it fails if so desired
896 tPalTimerHandle hTimerJoinRetry;
897 tCsrTimerInfo joinRetryTimerInfo;
898 tANI_U32 maxRetryCount;
899#endif
900#ifdef FEATURE_WLAN_CCX
901 tCsrCcxCckmInfo ccxCckmInfo;
902 tANI_BOOLEAN isPrevApInfoValid;
903 tSirMacSSid prevApSSID;
904 tCsrBssid prevApBssid;
905 tANI_U8 prevOpChannel;
906 tANI_U16 clientDissSecs;
907 tANI_U32 roamTS1;
908#endif
909 tANI_U8 bRefAssocStartCnt; //Tracking assoc start indication
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800910 /* to force the AP initiate fresh 802.1x authentication after re-association need to clear
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700911 * the PMKID cache. To clear the cache in this particular case this is added
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800912 * it is needed by the HS 2.0 passpoint certification 5.2.a and b testcases */
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700913 tANI_BOOLEAN fIgnorePMKIDCache;
Jeff Johnson295189b2012-06-20 16:38:30 -0700914} tCsrRoamSession;
915
916typedef struct tagCsrRoamStruct
917{
918 tANI_U32 nextRoamId;
919 tDblLinkList roamCmdPendingList;
920 tDblLinkList channelList5G;
921 tDblLinkList channelList24;
922 tCsrConfig configParam;
923 tANI_U32 numChannelsEeprom; //total channels of eeprom
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800924 tCsrChannel base20MHzChannels; //The channel base to work on
925 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
926 eCsrRoamState curState[CSR_ROAM_SESSION_MAX];
Jeff Johnson295189b2012-06-20 16:38:30 -0700927 eCsrRoamSubState curSubState[CSR_ROAM_SESSION_MAX];
928 //This may or may not have the up-to-date valid channel list
929 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
930 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
931 tANI_U32 numValidChannels; //total number of channels in CFG
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800932
Jeff Johnson295189b2012-06-20 16:38:30 -0700933 tANI_S32 sPendingCommands;
Jeff Johnson295189b2012-06-20 16:38:30 -0700934 tPalTimerHandle hTimerWaitForKey; //To support timeout for WaitForKey state
935 tCsrSummaryStatsInfo summaryStatsInfo;
936 tCsrGlobalClassAStatsInfo classAStatsInfo;
937 tCsrGlobalClassBStatsInfo classBStatsInfo;
938 tCsrGlobalClassCStatsInfo classCStatsInfo;
939 tCsrGlobalClassDStatsInfo classDStatsInfo;
940 tCsrPerStaStatsInfo perStaStatsInfo[CSR_MAX_STA];
941 tDblLinkList statsClientReqList;
942 tDblLinkList peStatsReqList;
943 tCsrTlStatsReqInfo tlStatsReqInfo;
944 eCsrRoamLinkQualityInd vccLinkQuality;
945 tCsrLinkQualityIndInfo linkQualityIndInfo;
946 v_CONTEXT_t gVosContext; //used for interaction with TL
947 //To specify whether an association or a IBSS is WMM enabled
948 //This parameter is only valid during a join or start BSS command is being executed
949 //tANI_BOOLEAN fWMMConnection; /* Moving it to be part of roamsession */
950 v_U8_t ucACWeights[WLANTL_MAX_AC];
951 /* TODO : Upto here */
952 tCsrTimerInfo WaitForKeyTimerInfo;
953 tCsrRoamSession *roamSession;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800954 tANI_U32 transactionId; // Current transaction ID for internal use.
955#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
Jeff Johnson295189b2012-06-20 16:38:30 -0700956 tCsrNeighborRoamControlInfo neighborRoamInfo;
957#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700958#ifdef FEATURE_WLAN_LFR
959 tANI_U8 isFastRoamIniFeatureEnabled;
960#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700961#ifdef FEATURE_WLAN_CCX
962 tANI_U8 isCcxIniFeatureEnabled;
963#endif
Jeff Johnson43971f52012-07-17 12:26:56 -0700964#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700965 tANI_U8 RoamRssiDiff;
966 tANI_BOOLEAN isWESModeEnabled;
Jeff Johnson43971f52012-07-17 12:26:56 -0700967#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700968}tCsrRoamStruct;
969
970
971#define GET_NEXT_ROAM_ID(pRoamStruct) (((pRoamStruct)->nextRoamId + 1 == 0) ? 1 : (pRoamStruct)->nextRoamId)
972#define CSR_IS_ROAM_STATE(pMac, state, sessionId) ( (state) == (pMac)->roam.curState[sessionId] )
973
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800974#define CSR_IS_ROAM_STOP(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_STOP, sessionId )
975#define CSR_IS_ROAM_INIT(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_INIT, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -0700976#define CSR_IS_ROAM_SCANNING(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_SCANNING, sessionId )
977#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 -0800978#define CSR_IS_ROAM_IDLE(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_IDLE, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -0700979#define CSR_IS_ROAM_JOINED(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_JOINED, sessionId )
980
981#define CSR_IS_ROAM_SUBSTATE(pMac, subState, sessionId) ((subState) == (pMac)->roam.curSubState[sessionId])
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800982#define CSR_IS_ROAM_SUBSTATE_JOIN_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOIN_REQ, sessionId)
983#define CSR_IS_ROAM_SUBSTATE_AUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_AUTH_REQ, sessionId)
984#define CSR_IS_ROAM_SUBSTATE_REASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_REASSOC_REQ, sessionId)
985#define CSR_IS_ROAM_SUBSTATE_DISASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REQ, sessionId)
986#define CSR_IS_ROAM_SUBSTATE_DISASSOC_NO_JOIN(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN, sessionId)
987#define CSR_IS_ROAM_SUBSTATE_REASSOC_FAIL(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE, sessionId)
988#define CSR_IS_ROAM_SUBSTATE_DISASSOC_FORCED(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_FORCED, sessionId)
989#define CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DEAUTH_REQ, sessionId)
990#define CSR_IS_ROAM_SUBSTATE_START_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_START_BSS_REQ, sessionId)
991#define CSR_IS_ROAM_SUBSTATE_STOP_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_STOP_BSS_REQ, sessionId)
992#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 -0700993#define CSR_IS_ROAM_SUBSTATE_CONFIG(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_CONFIG, sessionId)
994#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 -0800995#define CSR_IS_ROAM_SUBSTATE_DISASSOC_HO(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF, sessionId)
996#define CSR_IS_ROAM_SUBSTATE_HO_NT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC, sessionId)
997#define CSR_IS_ROAM_SUBSTATE_HO_NRT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC, sessionId)
998#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 -0700999
1000#define CSR_IS_PHY_MODE_B_ONLY(pMac) \
1001 ((eCSR_DOT11_MODE_11b == (pMac)->roam.configParam.phyMode) ||\
1002 (eCSR_DOT11_MODE_11b_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001003
Jeff Johnson295189b2012-06-20 16:38:30 -07001004#define CSR_IS_PHY_MODE_G_ONLY(pMac) \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001005 (eCSR_DOT11_MODE_11g == (pMac)->roam.configParam.phyMode || eCSR_DOT11_MODE_11g_ONLY == (pMac)->roam.configParam.phyMode)
1006
Jeff Johnson295189b2012-06-20 16:38:30 -07001007#define CSR_IS_PHY_MODE_A_ONLY(pMac) \
1008 ((eCSR_DOT11_MODE_11a == (pMac)->roam.configParam.phyMode) ||\
1009 (eCSR_DOT11_MODE_11a_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001010
Jeff Johnsone7245742012-09-05 17:12:55 -07001011#ifdef WLAN_FEATURE_11AC
1012#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1013 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1014 (eCSR_DOT11_MODE_11ac & (phyMode)) || \
1015 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1016 (eCSR_DOT11_MODE_AUTO & (phyMode)))
1017#else
Jeff Johnson295189b2012-06-20 16:38:30 -07001018#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1019 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1020 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1021 (eCSR_DOT11_MODE_AUTO & (phyMode)))
Jeff Johnsone7245742012-09-05 17:12:55 -07001022#endif
1023
Jeff Johnson295189b2012-06-20 16:38:30 -07001024
1025// this function returns TRUE if the NIC is operating exclusively in the 2.4 GHz band, meaning
1026// it is NOT operating in the 5.0 GHz band.
1027#define CSR_IS_24_BAND_ONLY(pMac) \
1028 (eCSR_BAND_24 == (pMac)->roam.configParam.eBand)
1029
1030#define CSR_IS_5G_BAND_ONLY(pMac) \
1031 (eCSR_BAND_5G == (pMac)->roam.configParam.eBand)
1032
1033#define CSR_IS_RADIO_DUAL_BAND(pMac) \
1034 (eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability)
1035
1036#define CSR_IS_RADIO_BG_ONLY(pMac) \
1037 (eCSR_BAND_24 == (pMac)->roam.configParam.bandCapability)
1038
1039// this function returns TRUE if the NIC is operating exclusively in the 5.0 GHz band, meaning
1040// it is NOT operating in the 2.4 GHz band
1041#define CSR_IS_RADIO_A_ONLY(pMac) \
1042 (eCSR_BAND_5G == (pMac)->roam.configParam.bandCapability)
1043
1044// this function returns TRUE if the NIC is operating in both bands.
1045#define CSR_IS_OPEARTING_DUAL_BAND(pMac) \
1046 ((eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability) && (eCSR_BAND_ALL == (pMac)->roam.configParam.eBand))
1047
1048// this function returns TRUE if the NIC can operate in the 5.0 GHz band (could operate in the
1049// 2.4 GHz band also).
1050#define CSR_IS_OPERATING_A_BAND(pMac) \
1051 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_A_ONLY((pMac)) || CSR_IS_5G_BAND_ONLY((pMac)))
1052
1053// this function returns TRUE if the NIC can operate in the 2.4 GHz band (could operate in the
1054// 5.0 GHz band also).
1055#define CSR_IS_OPERATING_BG_BAND(pMac) \
1056 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_BG_ONLY((pMac)) || CSR_IS_24_BAND_ONLY((pMac)))
1057
1058#define CSR_IS_CHANNEL_5GHZ(chnNum) \
Jeff Johnsone7245742012-09-05 17:12:55 -07001059 (((chnNum) >= CSR_MIN_5GHz_CHANNEL_NUMBER) && ((chnNum) <= CSR_MAX_5GHz_CHANNEL_NUMBER))
Jeff Johnson295189b2012-06-20 16:38:30 -07001060
Srinivas Girigowdade697412013-02-14 16:31:48 -08001061#define CSR_IS_CHANNEL_DFS(chnNum) \
1062 (NV_CHANNEL_ENABLE != vos_nv_getChannelEnabledState(chnNum))
1063
Jeff Johnson295189b2012-06-20 16:38:30 -07001064#define CSR_IS_CHANNEL_24GHZ(chnNum) \
1065 (((chnNum) > 0) && ((chnNum) <= CSR_MAX_24GHz_CHANNEL_NUMBER))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001066
Jeff Johnson295189b2012-06-20 16:38:30 -07001067#define CSR_IS_SAME_BAND_CHANNELS(ch1, ch2) (CSR_IS_CHANNEL_5GHZ(ch1) == CSR_IS_CHANNEL_5GHZ(ch2))
1068
1069
1070#define CSR_IS_11D_INFO_FOUND(pMac) \
1071 (0 != (pMac)->scan.channelOf11dInfo)
1072// DEAUTHIND
1073#define CSR_IS_ROAMING(pSession) ((CSR_IS_LOSTLINK_ROAMING((pSession)->roamingReason)) || \
1074 (eCsrDynamicRoaming == (pSession)->roamingReason) || \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001075 (eCsrReassocRoaming == (pSession)->roamingReason))
Jeff Johnson295189b2012-06-20 16:38:30 -07001076
1077
1078#define CSR_IS_SET_KEY_COMMAND( pCommand ) ( eSmeCommandSetKey == (pCommand)->command )
1079
1080#define CSR_IS_ADDTS_WHEN_ACMOFF_SUPPORTED(pMac) (pMac->roam.configParam.addTSWhenACMIsOff)
1081// DEAUTHIND
1082#define CSR_IS_LOSTLINK_ROAMING(reason) ((eCsrLostlinkRoamingDisassoc == (reason)) || (eCsrLostlinkRoamingDeauth == (reason)))
1083
Venkata Prathyusha Kuntupalli239278b2013-03-26 15:58:18 -07001084#define CSR_IS_ROAMING_COMMAND(pCommand) ((eCsrLostLink1 == (pCommand)->u.roamCmd.roamReason) ||\
1085 (eCsrLostLink2 == (pCommand)->u.roamCmd.roamReason) ||\
1086 (eCsrLostLink3 == (pCommand)->u.roamCmd.roamReason) )
1087
1088
Jeff Johnson295189b2012-06-20 16:38:30 -07001089//Stop CSR from asking for IMPS, This function doesn't disable IMPS from CSR
1090void csrScanSuspendIMPS( tpAniSirGlobal pMac );
1091//Start CSR from asking for IMPS. This function doesn't trigger CSR to request entering IMPS
1092//because IMPS maybe disabled.
1093void csrScanResumeIMPS( tpAniSirGlobal pMac );
1094
1095eHalStatus csrInitGetChannels(tpAniSirGlobal pMac);
Venkata Prathyusha Kuntupalli316247e2013-03-15 17:45:25 -07001096// Getting the 5GHz Channel list
1097eHalStatus csrGet5GChannels(tpAniSirGlobal pMac);
1098// Getting the 2.4GHz Channel list
1099eHalStatus csrGet24GChannels(tpAniSirGlobal pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001100
1101eHalStatus csrSetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1102 tCsrRoamModifyProfileFields *pModifyProfileFields);
1103/* ---------------------------------------------------------------------------
1104 \fn csrGetModifyProfileFields
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001105 \brief HDD or SME - QOS calls this function to get the current values of
Jeff Johnson295189b2012-06-20 16:38:30 -07001106 connected profile fields changing which can cause reassoc.
1107 This function must be called after CFG is downloaded and STA is in connected
1108 state.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001109 \param pModifyProfileFields - pointer to the connected profile fields
Jeff Johnson295189b2012-06-20 16:38:30 -07001110 changing which can cause reassoc
1111
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001112 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001113 -------------------------------------------------------------------------------*/
1114eHalStatus csrGetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1115 tCsrRoamModifyProfileFields * pModifyProfileFields);
1116void csrSetGlobalCfgs( tpAniSirGlobal pMac );
1117void csrSetDefaultDot11Mode( tpAniSirGlobal pMac );
1118void csrScanSetChannelMask(tpAniSirGlobal pMac, tCsrChannelInfo *pChannelInfo);
1119tANI_BOOLEAN csrIsConnStateDisconnected(tpAniSirGlobal pMac, tANI_U32 sessionId);
1120tANI_BOOLEAN csrIsConnStateConnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1121tANI_BOOLEAN csrIsConnStateDisconnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1122tANI_BOOLEAN csrIsConnStateConnectedInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1123tANI_BOOLEAN csrIsConnStateConnected( tpAniSirGlobal pMac, tANI_U32 sessionId );
1124tANI_BOOLEAN csrIsConnStateInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1125tANI_BOOLEAN csrIsConnStateIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1126tANI_BOOLEAN csrIsConnStateWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1127tANI_BOOLEAN csrIsConnStateConnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1128tANI_BOOLEAN csrIsConnStateDisconnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1129tANI_BOOLEAN csrIsAnySessionInConnectState( tpAniSirGlobal pMac );
1130tANI_BOOLEAN csrIsAllSessionDisconnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudi48081ef2012-12-04 16:49:55 -08001131tANI_BOOLEAN csrIsStaSessionConnected( tpAniSirGlobal pMac );
1132tANI_BOOLEAN csrIsP2pSessionConnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudid3d22592012-09-24 14:01:29 -07001133tANI_BOOLEAN csrIsAnySessionConnected( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001134tANI_BOOLEAN csrIsInfraConnected( tpAniSirGlobal pMac );
1135tANI_BOOLEAN csrIsConcurrentInfraConnected( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001136tANI_BOOLEAN csrIsConcurrentSessionRunning( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001137tANI_BOOLEAN csrIsInfraApStarted( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001138tANI_BOOLEAN csrIsIBSSStarted( tpAniSirGlobal pMac );
1139tANI_BOOLEAN csrIsBTAMPStarted( tpAniSirGlobal pMac );
1140tANI_BOOLEAN csrIsBTAMP( tpAniSirGlobal pMac, tANI_U32 sessionId );
1141eHalStatus csrIsBTAMPAllowed( tpAniSirGlobal pMac, tANI_U32 chnId );
Jeff Johnsone7245742012-09-05 17:12:55 -07001142tANI_BOOLEAN csrIsValidMcConcurrentSession(tpAniSirGlobal pMac, tANI_U32 sessionId,
1143 tSirBssDescription *pBssDesc);
Jeff Johnson295189b2012-06-20 16:38:30 -07001144tANI_BOOLEAN csrIsConnStateConnectedInfraAp( tpAniSirGlobal pMac, tANI_U32 sessionId );
Jeff Johnson295189b2012-06-20 16:38:30 -07001145/*----------------------------------------------------------------------------
1146 \fn csrRoamRegisterLinkQualityIndCallback
1147
1148 \brief
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001149 a CSR function to allow HDD to register a callback handler with CSR for
1150 link quality indications.
Jeff Johnson295189b2012-06-20 16:38:30 -07001151
1152 Only one callback may be registered at any time.
1153 In order to deregister the callback, a NULL cback may be provided.
1154
1155 Registration happens in the task context of the caller.
1156
1157 \param callback - Call back being registered
1158 \param pContext - user data
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001159
Jeff Johnson295189b2012-06-20 16:38:30 -07001160 DEPENDENCIES: After CSR open
1161
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001162 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001163-----------------------------------------------------------------------------*/
1164eHalStatus csrRoamRegisterLinkQualityIndCallback(tpAniSirGlobal pMac,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001165 csrRoamLinkQualityIndCallback callback,
Jeff Johnson295189b2012-06-20 16:38:30 -07001166 void *pContext);
1167/* ---------------------------------------------------------------------------
1168 \fn csrGetStatistics
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001169 \brief csr function that client calls to register a callback to get
1170 different PHY level statistics from CSR.
1171
Jeff Johnson295189b2012-06-20 16:38:30 -07001172 \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc
1173 \param statsMask - The different category/categories of stats requester is looking for
1174 \param callback - SME sends back the requested stats using the callback
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001175 \param periodicity - If requester needs periodic update, 0 means it's an one
Jeff Johnson295189b2012-06-20 16:38:30 -07001176 time request
1177 \param cache - If requester is happy with cached stats
1178 \param staId - The station ID for which the stats is requested for
1179 \param pContext - user context to be passed back along with the callback
1180
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001181 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001182 ---------------------------------------------------------------------------*/
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001183eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requesterId,
1184 tANI_U32 statsMask,
1185 tCsrStatsCallback callback,
1186 tANI_U32 periodicity, tANI_BOOLEAN cache,
Jeff Johnson295189b2012-06-20 16:38:30 -07001187 tANI_U8 staId, void *pContext);
1188
1189
1190eHalStatus csrGetRssi(tpAniSirGlobal pMac,tCsrRssiCallback callback,tANI_U8 staId,tCsrBssid bssId,void * pContext,void * pVosContext);
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08001191#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1192eHalStatus csrGetRoamRssi(tpAniSirGlobal pMac,
1193 tCsrRssiCallback callback,
1194 tANI_U8 staId,
1195 tCsrBssid bssId,
1196 void * pContext,
1197 void * pVosContext);
1198#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001199eHalStatus csrRoamRegisterCallback(tpAniSirGlobal pMac, csrRoamCompleteCallback callback, void *pContext);
1200/* ---------------------------------------------------------------------------
1201 \fn csrGetConfigParam
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001202 \brief HDD calls this function to get the global settings currently maintained by CSR.
Jeff Johnson295189b2012-06-20 16:38:30 -07001203 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001204 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001205 -------------------------------------------------------------------------------*/
1206eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1207
1208/* ---------------------------------------------------------------------------
1209 \fn csrMsgProcessor
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001210 \brief HDD calls this function to change some global settings.
Jeff Johnson295189b2012-06-20 16:38:30 -07001211 caller must set the all fields or call csrGetConfigParam to prefill the fields.
1212 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001213 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001214 -------------------------------------------------------------------------------*/
1215eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1216
1217
1218/* ---------------------------------------------------------------------------
1219 \fn csrMsgProcessor
1220 \brief HDD calls this function for the messages that are handled by CSR.
1221 \param pMsgBuf - a pointer to a buffer that maps to various structures base on the message type.
1222 The beginning of the buffer can always map to tSirSmeRsp.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001223 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001224 -------------------------------------------------------------------------------*/
1225eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf );
1226
1227/* ---------------------------------------------------------------------------
1228 \fn csrOpen
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001229 \brief This function must be called before any API call to CSR.
1230 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001231 -------------------------------------------------------------------------------*/
1232eHalStatus csrOpen(tpAniSirGlobal pMac);
1233/* ---------------------------------------------------------------------------
1234 \fn csrClose
1235 \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 -08001236 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001237 -------------------------------------------------------------------------------*/
1238eHalStatus csrClose(tpAniSirGlobal pMac);
1239/* ---------------------------------------------------------------------------
1240 \fn csrStart
1241 \brief To start CSR.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001242 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001243 -------------------------------------------------------------------------------*/
1244eHalStatus csrStart(tpAniSirGlobal pMac);
1245/* ---------------------------------------------------------------------------
1246 \fn csrStop
1247 \brief To stop CSR. CSR still keeps its current setting.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001248 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001249 -------------------------------------------------------------------------------*/
1250eHalStatus csrStop(tpAniSirGlobal pMac);
1251/* ---------------------------------------------------------------------------
1252 \fn csrReady
1253 \brief To let CSR is ready to operate
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001254 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001255 -------------------------------------------------------------------------------*/
1256eHalStatus csrReady(tpAniSirGlobal pMac);
1257
1258#ifdef FEATURE_WLAN_WAPI
1259eHalStatus csrRoamGetBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pNum,
1260 tBkidCacheInfo *pBkidCache);
1261
1262
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001263eHalStatus csrScanGetBKIDCandidateList(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001264 tBkidCandidateInfo *pBkidList, tANI_U32 *pNumItems );
1265tANI_U32 csrRoamGetNumBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId);
1266eHalStatus csrRoamSetBKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache,
1267 tANI_U32 numItems );
1268/* ---------------------------------------------------------------------------
1269 \fn csrRoamGetWapiReqIE
1270 \brief return the WAPI IE CSR passes to PE to JOIN request or START_BSS request
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001271 \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 -07001272 needed or IE length in pBuf.
1273 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1274 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1275 -------------------------------------------------------------------------------*/
1276eHalStatus csrRoamGetWapiReqIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
1277
1278/* ---------------------------------------------------------------------------
1279 \fn csrRoamGetWapiRspIE
1280 \brief return the WAPI IE from the beacon or probe rsp if connected
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001281 \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 -07001282 needed or IE length in pBuf.
1283 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1284 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1285 -------------------------------------------------------------------------------*/
1286eHalStatus csrRoamGetWapiRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001287tANI_U8 csrConstructWapiIe( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
Jeff Johnson295189b2012-06-20 16:38:30 -07001288 tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes, tCsrWapiIe *pWapiIe );
1289#endif /* FEATURE_WLAN_WAPI */
1290
Jeff Johnson295189b2012-06-20 16:38:30 -07001291eHalStatus csrRoamUpdateAPWPSIE( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirAPWPSIEs *pAPWPSIES );
1292eHalStatus csrRoamUpdateWPARSNIEs( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirRSNie * pAPSirRSNie);
Jeff Johnson295189b2012-06-20 16:38:30 -07001293void csrSetCfgPrivacy( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, tANI_BOOLEAN fPrivacy );
1294tANI_S8 csrGetInfraSessionId( tpAniSirGlobal pMac );
1295tANI_U8 csrGetInfraOperationChannel( tpAniSirGlobal pMac, tANI_U8 sessionId);
1296tANI_U8 csrGetConcurrentOperationChannel( tpAniSirGlobal pMac );
1297
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001298eHalStatus csrRoamCopyConnectProfile(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001299 tCsrRoamConnectedProfile *pProfile);
1300tANI_BOOLEAN csrIsSetKeyAllowed(tpAniSirGlobal pMac, tANI_U32 sessionId);
1301
1302void csrSetOppositeBandChannelInfo( tpAniSirGlobal pMac );
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001303void csrConstructCurrentValidChannelList( tpAniSirGlobal pMac, tDblLinkList *pChannelSetList,
Jeff Johnson295189b2012-06-20 16:38:30 -07001304 tANI_U8 *pChannelList, tANI_U8 bSize, tANI_U8 *pNumChannels );
1305
1306#endif
1307
1308#ifdef WLAN_FEATURE_VOWIFI_11R
1309//Returns whether the current association is a 11r assoc or not
1310tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac);
1311#endif
1312
1313#ifdef FEATURE_WLAN_CCX
1314//Returns whether the current association is a CCX assoc or not
1315tANI_BOOLEAN csrRoamIsCCXAssoc(tpAniSirGlobal pMac);
1316#endif
1317
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001318//Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -07001319//BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnson295189b2012-06-20 16:38:30 -07001320void csrDisconnectAllActiveSessions(tpAniSirGlobal pMac);
Mohit Khanna349bc392012-09-11 17:24:52 -07001321
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001322#ifdef FEATURE_WLAN_LFR
1323//Returns whether "Legacy Fast Roaming" is enabled...or not
Madan Mohan Koyyalamudi03aae5f2012-11-28 01:51:22 +05301324tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac, tANI_U32 sessionId);
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -07001325tANI_BOOLEAN csrIsChannelPresentInList( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
1326VOS_STATUS csrAddToChannelListFront( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001327#endif
1328