blob: 55592ae3c2a7fb608026688f9ce2e2145fb2c7b1 [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
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700108#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
109#define CSR_IS_ROAM_SCAN_OFFLOAD_ENABLED( pMac ) \
110( \
111 (((pMac)->roam.configParam.isRoamOffloadScanEnabled)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
112)
113#endif
114
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700115//Support for "Fast roaming" (i.e., CCX, LFR, or 802.11r.)
116#define CSR_BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN 15
Jeff Johnson295189b2012-06-20 16:38:30 -0700117
118typedef enum
119{
120 //eCSR_CFG_DOT11_MODE_BEST = 0,
121 eCSR_CFG_DOT11_MODE_TAURUS = 0,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800122 eCSR_CFG_DOT11_MODE_ABG,
123 eCSR_CFG_DOT11_MODE_11A,
124 eCSR_CFG_DOT11_MODE_11B,
125 eCSR_CFG_DOT11_MODE_11G,
126 eCSR_CFG_DOT11_MODE_11N,
127 eCSR_CFG_DOT11_MODE_POLARIS,
128 eCSR_CFG_DOT11_MODE_TITAN,
Jeff Johnsone7245742012-09-05 17:12:55 -0700129#ifdef WLAN_FEATURE_11AC
130 eCSR_CFG_DOT11_MODE_11AC,
131#endif
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800132 eCSR_CFG_DOT11_MODE_11G_ONLY,
133 eCSR_CFG_DOT11_MODE_11N_ONLY,
Jeff Johnsone7245742012-09-05 17:12:55 -0700134#ifdef WLAN_FEATURE_11AC
135 eCSR_CFG_DOT11_MODE_11AC_ONLY,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800136#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700137 //This value can never set to CFG. It is for CSR's internal use
138 eCSR_CFG_DOT11_MODE_AUTO,
139}eCsrCfgDot11Mode; //Used to determine what to set to the WNI_CFG_DOT11_MODE
140
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800141typedef enum etCsrRoamCommands
Jeff Johnson295189b2012-06-20 16:38:30 -0700142{
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800143 eCsrRoamNoCommand,
Jeff Johnson295189b2012-06-20 16:38:30 -0700144 eCsrRoamCommandScan,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800145 eCsrRoamCommandRoam,
146 eCsrRoamCommandWmStatusChange,
Jeff Johnson295189b2012-06-20 16:38:30 -0700147 eCsrRoamCommandSetKey,
148 eCsrRoamCommandRemoveKey,
149
150} eCsrRoamCommands;
151
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800152typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700153{
154 eCsrScanOther = 1,
155 eCsrScanLostLink1,
156 eCsrScanLostLink2,
157 eCsrScanLostLink3,
158 eCsrScanLostLink4,
159 eCsrScan11d1, //First 11d scan
160 eCsrScan11d2, //First 11d scan has failed
161 eCsrScan11dDone, //11d scan succeeded, try the rest of the channel
162 eCsrScanUserRequest,
163 eCsrScanGetResult,
164 eCsrScanSetBGScanParam, //used for HO too - bg scan request in NT Handoff sub-state
165 eCsrScanForSsid,
166 eCsrScanForCapsChange,
167 eCsrScanBGScanAbort,
168 eCsrScanBGScanEnable,
169 eCsrScanIdleScan,
170 eCsrScanGetScanChnInfo, //To get the list of channels scanned
171
172 eCsrScanBgScan, // bg scan request in NRT & RT Handoff sub-states
173 eCsrScanProbeBss, // directed probe on an entry from the candidate list - HO
174 eCsrScanAbortBgScan, //aborting a BG scan (meaning the scan is triggered by LIM timer)
175 eCsrScanAbortNormalScan, //aborting a normal scan (the scan is trigger by eWNI_SME_SCAN_REQ)
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700176 eCsrScanP2PFindPeer,
177 eCsrScanGetLfrResult, // get the LFR candidates from PE scan cache
Jeff Johnson295189b2012-06-20 16:38:30 -0700178}eCsrScanReason;
179
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800180typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700181{
182 eCsrNoConnection, // Roaming because we have not established the initial connection.
183 eCsrCapsChange, // roaming because LIM reported a Capability change in the associated AP.
184 eCsrForcedDisassoc, // roaming becuase someone asked us to Disassoc and stay disassociated.
185 eCsrHddIssued, // roaming because an 802.11 request was issued to the driver.
186 eCsrLostLink1, // roaming because we lost link to an associated AP
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800187 eCsrLostLink2,
Jeff Johnson295189b2012-06-20 16:38:30 -0700188 eCsrLostLink3,
189 eCsrForcedDisassocMICFailure, // roaming because we need to force a Disassoc due to MIC failure
190 eCsrHddIssuedReassocToSameAP,
191 eCsrSmeIssuedReassocToSameAP,
192 eCsrSmeIssuedReassocToDiffAP,
193 eCsrForcedDeauth, // roaming becuase someone asked us to deauth and stay disassociated.
194 eCsrSmeIssuedDisassocForHandoff, // will be issued by Handoff logic to disconect from current AP
195 eCsrSmeIssuedAssocToSimilarAP, // will be issued by Handoff logic to join a new AP with same profile
196 eCsrSmeIssuedIbssJoinFailure, // ibss join timer fired before any perr showed up, so shut down the network
197 eCsrForcedIbssLeave,
198 eCsrStopBss,
199 eCsrSmeIssuedFTReassoc,
200 eCsrForcedDisassocSta,
201 eCsrForcedDeauthSta,
Madan Mohan Koyyalamudi286b60e2012-10-11 12:59:07 -0700202 eCsrPerformPreauth,
Venkata Prathyusha Kuntupalli239278b2013-03-26 15:58:18 -0700203 eCsrLostLink1Abort,
204 eCsrLostLink2Abort,
205 eCsrLostLink3Abort,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800206
Jeff Johnson295189b2012-06-20 16:38:30 -0700207}eCsrRoamReason;
208
209typedef enum
210{
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800211 eCSR_ROAM_SUBSTATE_NONE = 0,
212 eCSR_ROAM_SUBSTATE_START_BSS_REQ,
213 eCSR_ROAM_SUBSTATE_JOIN_REQ,
214 eCSR_ROAM_SUBSTATE_REASSOC_REQ,
215 eCSR_ROAM_SUBSTATE_DISASSOC_REQ,
216 eCSR_ROAM_SUBSTATE_STOP_BSS_REQ,
217 eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING, //Continue the current roam command after disconnect
218 eCSR_ROAM_SUBSTATE_AUTH_REQ,
219 eCSR_ROAM_SUBSTATE_CONFIG,
220 eCSR_ROAM_SUBSTATE_DEAUTH_REQ,
221 eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN,
222 eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE,
223 eCSR_ROAM_SUBSTATE_DISASSOC_FORCED,
Jeff Johnson295189b2012-06-20 16:38:30 -0700224 eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY,
225 eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF,
226 eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC,
227 eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC,
228 eCSR_ROAM_SUBSTATE_JOINED_REALTIME_TRAFFIC,
229// max is 15 unless the bitfield is expanded...
230} eCsrRoamSubState;
231
232
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800233typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700234{
235 eCSR_ROAMING_STATE_STOP = 0,
236 eCSR_ROAMING_STATE_IDLE,
237 eCSR_ROAMING_STATE_SCANNING,
238 eCSR_ROAMING_STATE_JOINING,
239 eCSR_ROAMING_STATE_JOINED,
240}eCsrRoamState;
241
242
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800243typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700244{
245 eCsrContinueRoaming,
246 eCsrStopRoaming,
247 eCsrStartIbss,
248 eCsrStartIbssSameIbss,
249 eCsrReassocToSelfNoCapChange,
Jeff Johnsone7245742012-09-05 17:12:55 -0700250 eCsrStopRoamingDueToConcurrency,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800251
Jeff Johnson295189b2012-06-20 16:38:30 -0700252}eCsrJoinState;
253
254typedef enum
255{
256 eCsrNotRoaming,
257 eCsrLostlinkRoamingDisassoc,
258 eCsrLostlinkRoamingDeauth,
259 eCsrDynamicRoaming,
260 eCsrReassocRoaming,
261}eCsrRoamingReason;
262
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800263typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700264{
265 eCsrDisassociated,
266 eCsrDeauthenticated
267
268}eCsrRoamWmStatusChangeTypes;
269
270typedef enum
271{
272 eCsrSummaryStats = 0,
273 eCsrGlobalClassAStats,
274 eCsrGlobalClassBStats,
275 eCsrGlobalClassCStats,
276 eCsrGlobalClassDStats,
277 eCsrPerStaStats,
278 eCsrMaxStats
279}eCsrRoamStatsClassTypes;
280
281#ifdef FEATURE_WLAN_DIAG_SUPPORT
282typedef enum
283{
284 eCSR_WLAN_STATUS_CONNECT =0,
285 eCSR_WLAN_STATUS_DISCONNECT
286
287}eCsrDiagWlanStatusEventSubtype;
288
289typedef enum
290{
291 eCSR_REASON_UNSPECIFIED = 0,
292 eCSR_REASON_USER_REQUESTED,
293 eCSR_REASON_MIC_ERROR,
294 eCSR_REASON_DISASSOC,
295 eCSR_REASON_DEAUTH,
296 eCSR_REASON_HANDOFF,
297
298}eCsrDiagWlanStatusEventReason;
299
300typedef enum
301{
302 eCSR_WLAN_HANDOFF_EVENT =0,
303
304}eCsrDiagWlanHandoffEventSubtype;
305
306typedef enum
307{
308 eCSR_WLAN_VCC_EVENT =0,
309
310}eCsrDiagWlanVccEventSubtype;
311
312#endif //FEATURE_WLAN_DIAG_SUPPORT
313
314typedef struct tagCsrChannel
315{
316 tANI_U8 numChannels;
317 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
318}tCsrChannel;
319
320typedef struct tagScanProfile
321{
322 tANI_U32 minChnTime;
323 tANI_U32 maxChnTime;
324 tANI_U32 restTime; //This is ignored if not associated
325 tANI_U32 numOfChannels;
326 tANI_U8 *pChannelList;
327 tSirScanType scanType; //active or passive
328 eCsrRoamBssType bssType; //BSS or IBSS
329 tANI_U8 ssid[WNI_CFG_SSID_LEN];
330 tANI_U8 bReturnAfter1stMatch;
331 tANI_U8 fUniqueResult;
332 tANI_U8 freshScan;
333 tCsrBssid bssid;
334}tScanProfile;
335
336typedef struct tagBssConfigParam
337{
338 eCsrMediaAccessType qosType;
339 tSirMacSSid SSID;
340 tANI_U32 uRTSThresh;
341 tANI_U32 uDeferThresh; //
342 eCsrCfgDot11Mode uCfgDot11Mode;
343 eCsrBand eBand;
344 tANI_U8 standardRate[CSR_DOT11_SUPPORTED_RATES_MAX];
345 tANI_U8 extendedRate[CSR_DOT11_EXTENDED_SUPPORTED_RATES_MAX];
346 eCsrExposedTxRate txRate;
347 tAniAuthType authType;
348 eCsrEncryptionType encType;
349 tANI_U32 uShortSlotTime;
350 tANI_U32 uHTSupport; //High throughput
351 tANI_U32 uPowerLimit;
352 tANI_U32 uHeartBeatThresh;
353 tANI_U32 uJoinTimeOut;
354 tSirMacCapabilityInfo BssCap;
355 tANI_BOOLEAN f11hSupport;
Jeff Johnsone7245742012-09-05 17:12:55 -0700356 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700357}tBssConfigParam;
358
359
360typedef struct tagCsrRoamStartBssParams
361{
362 tSirMacSSid ssId;
363 tCsrBssid bssid; //this is the BSSID for the party we want to join (only use for IBSS or WDS)
364 tSirNwType sirNwType;
Jeff Johnsone7245742012-09-05 17:12:55 -0700365 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700366 tSirMacRateSet operationalRateSet;
367 tSirMacRateSet extendedRateSet;
368 tANI_U8 operationChn;
369 eCsrCfgDot11Mode uCfgDot11Mode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700370 tANI_U8 privacy;
371 tANI_BOOLEAN fwdWPSPBCProbeReq;
372 tANI_BOOLEAN protEnabled;
373 tANI_BOOLEAN obssProtEnabled;
374 tAniAuthType authType;
375 tANI_U16 beaconInterval; //If this is 0, SME will fill in for caller.
376 tANI_U16 ht_protection;
377 tANI_U32 dtimPeriod;
378 tANI_U8 ApUapsdEnable;
379 tANI_U8 ssidHidden;
380 tANI_U8 wps_state;
Jeff Johnson295189b2012-06-20 16:38:30 -0700381 tVOS_CON_MODE bssPersona;
382 tANI_U16 nRSNIELength; //The byte count in the pRSNIE, if 0, pRSNIE is ignored.
383 tANI_U8 *pRSNIE; //If not null, it has the IE byte stream for RSN
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800384 tANI_BOOLEAN updatebeaconInterval; //Flag used to indicate update
385 // beaconInterval
Jeff Johnson295189b2012-06-20 16:38:30 -0700386}tCsrRoamStartBssParams;
387
388
389typedef struct tagScanCmd
390{
391 tANI_U32 scanID;
392 csrScanCompleteCallback callback;
393 void *pContext;
394 eCsrScanReason reason;
395 eCsrRoamState lastRoamState[CSR_ROAM_SESSION_MAX];
396 tCsrRoamProfile *pToRoamProfile;
397 tANI_U32 roamId; //this is the ID related to the pToRoamProfile
398 union
399 {
400 tCsrScanRequest scanRequest;
401 tCsrBGScanRequest bgScanRequest;
402 }u;
403}tScanCmd;
404
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800405typedef struct tagRoamCmd
Jeff Johnson295189b2012-06-20 16:38:30 -0700406{
407 tANI_U32 roamId;
408 eCsrRoamReason roamReason;
409 tCsrRoamProfile roamProfile;
410 tScanResultHandle hBSSList; //BSS list fits the profile
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800411 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 -0700412 tSirBssDescription *pLastRoamBss; //the last BSS we try and failed
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800413 tANI_BOOLEAN fReleaseBssList; //whether to free hBSSList
Jeff Johnson295189b2012-06-20 16:38:30 -0700414 tANI_BOOLEAN fReleaseProfile; //whether to free roamProfile
415 tANI_BOOLEAN fReassoc; //whether this command is for reassociation
416 tANI_BOOLEAN fUpdateCurRoamProfile; //whether pMac->roam.pCurRoamProfile needs to be updated
417 //this is for CSR internal used only. And it should not be assigned when creating the command
418 //This causes the roam command not to do anything.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800419 tANI_BOOLEAN fReassocToSelfNoCapChange;
Jeff Johnson295189b2012-06-20 16:38:30 -0700420
421 tANI_BOOLEAN fStopWds;
422 tSirMacAddr peerMac;
423 tSirMacReasonCodes reason;
424}tRoamCmd;
425
426typedef struct tagSetKeyCmd
427{
428 tANI_U32 roamId;
429 eCsrEncryptionType encType;
430 eCsrAuthType authType;
431 tAniKeyDirection keyDirection; //Tx, Rx or Tx-and-Rx
432 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
433 tANI_U8 paeRole; //0 for supplicant
434 tANI_U8 keyId; // Kye index
435 tANI_U8 keyLength; //Number of bytes containing the key in pKey
436 tANI_U8 Key[CSR_MAX_KEY_LEN];
437 tANI_U8 keyRsc[CSR_MAX_RSC_LEN];
438} tSetKeyCmd;
439
440typedef struct tahRemoveKeyCmd
441{
442 tANI_U32 roamId;
443 eCsrEncryptionType encType;
444 eCsrAuthType authType;
445 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
446 tANI_U8 keyId; //key index
447} tRemoveKeyCmd;
448
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800449typedef struct tagWmStatusChangeCmd
Jeff Johnson295189b2012-06-20 16:38:30 -0700450{
451 eCsrRoamWmStatusChangeTypes Type;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800452 union
453 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700454 tSirSmeDeauthInd DeauthIndMsg;
455 tSirSmeDisassocInd DisassocIndMsg;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800456 }u;
Jeff Johnson295189b2012-06-20 16:38:30 -0700457
458}tWmStatusChangeCmd;
459
460typedef struct tagAddStaForSessionCmd
461{
462 //Session self mac addr
463 tSirMacAddr selfMacAddr;
464}tAddStaForSessionCmd;
465
466typedef struct tagDelStaForSessionCmd
467{
468 //Session self mac addr
469 tSirMacAddr selfMacAddr;
470 csrRoamSessionCloseCallback callback;
471 void *pContext;
472}tDelStaForSessionCmd;
473
474//This structure represents one scan request
475typedef struct tagCsrCmd
476{
477 tListElem Link;
478 eCsrRoamCommands command;
479 tANI_U8 sessionId; // Session ID for this command
480 union
481 {
482 tScanCmd scanCmd;
483 tRoamCmd roamCmd;
484 tWmStatusChangeCmd wmStatusChangeCmd;
485 tSetKeyCmd setKeyCmd;
486 tRemoveKeyCmd removeKeyCmd;
487 tAddStaForSessionCmd addStaSessionCmd;
488 tDelStaForSessionCmd delStaSessionCmd;
489 }u;
490}tCsrCmd;
491
492#ifdef WLAN_FEATURE_VOWIFI_11R
493typedef struct tagCsr11rConfig
494{
495 tANI_BOOLEAN IsFTResourceReqSupported;
496} tCsr11rConfig;
497#endif
498
499#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
500typedef struct tagCsrNeighborRoamConfig
501{
502 tANI_U32 nNeighborScanTimerPeriod;
503 tANI_U8 nNeighborLookupRssiThreshold;
504 tANI_U8 nNeighborReassocRssiThreshold;
505 tANI_U16 nNeighborScanMinChanTime;
506 tANI_U16 nNeighborScanMaxChanTime;
507 sCsrChannel neighborScanChanList;
508 tANI_U8 nMaxNeighborRetries;
509 tANI_U16 nNeighborResultsRefreshPeriod;
Srinivas Girigowdade697412013-02-14 16:31:48 -0800510 tANI_U16 nEmptyScanRefreshPeriod;
Jeff Johnson295189b2012-06-20 16:38:30 -0700511}tCsrNeighborRoamConfig;
512#endif
513
514typedef struct tagCsrConfig
515{
516 tANI_U32 agingCount;
517 tANI_U32 FragmentationThreshold;
518 tANI_U32 channelBondingMode24GHz;
519 tANI_U32 channelBondingMode5GHz;
520 tANI_U32 RTSThreshold;
521 eCsrPhyMode phyMode;
522 eCsrCfgDot11Mode uCfgDot11Mode;
523 eCsrBand eBand;
524 tANI_U32 HeartbeatThresh50;
525 tANI_U32 HeartbeatThresh24;
526 tANI_U32 bgScanInterval;
527 eCsrCBChoice cbChoice;
528 eCsrBand bandCapability; //indicate hw capability
529 eCsrRoamWmmUserModeType WMMSupportMode;
530 tANI_BOOLEAN Is11eSupportEnabled;
531 tANI_BOOLEAN Is11dSupportEnabled;
532 tANI_BOOLEAN Is11dSupportEnabledOriginal;
533 tANI_BOOLEAN Is11hSupportEnabled;
534 tANI_BOOLEAN shortSlotTime;
535 tANI_BOOLEAN ProprietaryRatesEnabled;
536 tANI_BOOLEAN fenableMCCMode;
537 tANI_U16 TxRate;
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -0800538 tANI_U8 fAllowMCCGODiffBI;
Jeff Johnson295189b2012-06-20 16:38:30 -0700539 tANI_U8 AdHocChannel24;
540 tANI_U8 AdHocChannel5G;
541 tANI_U32 impsSleepTime; //in units of microseconds
542 tANI_U32 scanAgeTimeNCNPS; //scan result aging time threshold when Not-Connect-No-Power-Save, in seconds
543 tANI_U32 scanAgeTimeNCPS; //scan result aging time threshold when Not-Connect-Power-Save, in seconds
544 tANI_U32 scanAgeTimeCNPS; //scan result aging time threshold when Connect-No-Power-Save, in seconds,
545 tANI_U32 scanAgeTimeCPS; //scan result aging time threshold when Connect-Power-Savein seconds
546 tANI_U32 BssPreferValue[CSR_NUM_RSSI_CAT]; //each RSSI category has one value
547 int RSSICat[CSR_NUM_RSSI_CAT];
548 tANI_U8 bCatRssiOffset; //to set the RSSI difference for each category
549 tANI_U32 nRoamingTime; //In seconds, CSR will try this long before gives up, 0 means no roaming
550 //Whether to limit the channels to the ones set in Csr11dInfo. If true, the opertaional
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800551 //channels are limited to the default channel list. It is an "AND" operation between the
Jeff Johnson295189b2012-06-20 16:38:30 -0700552 //default channels and the channels in the 802.11d IE.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800553 tANI_BOOLEAN fEnforce11dChannels;
Jeff Johnson295189b2012-06-20 16:38:30 -0700554 //Country Code Priority
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800555 //0 = 802.11D > Configured Country > NV
Jeff Johnson295189b2012-06-20 16:38:30 -0700556 //1 = Configured Country > 802.11D > NV
557 tANI_BOOLEAN fSupplicantCountryCodeHasPriority;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800558 //When true, AP with unknown country code won't be see.
559 //"Unknown country code" means either Ap doesn't have 11d IE or we cannot
Jeff Johnson295189b2012-06-20 16:38:30 -0700560 //find a domain for the country code in its 11d IE.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800561 tANI_BOOLEAN fEnforceCountryCodeMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700562 //When true, only APs in the default domain can be seen. If the Ap has "unknown country
563 //code", or the doamin of the country code doesn't match the default domain, the Ap is
564 //not acceptable.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800565 tANI_BOOLEAN fEnforceDefaultDomain;
Jeff Johnson295189b2012-06-20 16:38:30 -0700566
567 tANI_U16 vccRssiThreshold;
568 tANI_U32 vccUlMacLossThreshold;
569
570 tANI_U32 nPassiveMinChnTime; //in units of milliseconds
571 tANI_U32 nPassiveMaxChnTime; //in units of milliseconds
572 tANI_U32 nActiveMinChnTime; //in units of milliseconds
573 tANI_U32 nActiveMaxChnTime; //in units of milliseconds
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800574
575 tANI_U32 nActiveMinChnTimeBtc; //in units of milliseconds
576 tANI_U32 nActiveMaxChnTimeBtc; //in units of milliseconds
Kiran Kumar Lokerec1641f52013-05-29 14:29:43 -0700577 tANI_U8 disableAggWithBtc;
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -0700578#ifdef WLAN_AP_STA_CONCURRENCY
579 tANI_U32 nPassiveMinChnTimeConc; //in units of milliseconds
580 tANI_U32 nPassiveMaxChnTimeConc; //in units of milliseconds
581 tANI_U32 nActiveMinChnTimeConc; //in units of milliseconds
582 tANI_U32 nActiveMaxChnTimeConc; //in units of milliseconds
583 tANI_U32 nRestTimeConc; //in units of milliseconds
Sudhir Sattayappa Kohallieb97d502013-05-22 23:16:42 -0700584 tANI_U8 nNumStaChanCombinedConc; //number of channels combined for
585 //Sta in each split scan operation
586 tANI_U8 nNumP2PChanCombinedConc; //number of channels combined for
587 //P2P in each split scan operation
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -0700588#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700589
590 tANI_BOOLEAN IsIdleScanEnabled;
591 //in dBm, the maximum TX power
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800592 //The actual TX power is the lesser of this value and 11d.
Jeff Johnson295189b2012-06-20 16:38:30 -0700593 //If 11d is disable, the lesser of this and default setting.
594 tANI_U8 nTxPowerCap;
595 tANI_U32 statsReqPeriodicity; //stats request frequency from PE while in full power
596 tANI_U32 statsReqPeriodicityInPS;//stats request frequency from PE while in power save
Jeff Johnson295189b2012-06-20 16:38:30 -0700597 tANI_U32 dtimPeriod;
598 tANI_BOOLEAN ssidHidden;
Jeff Johnson295189b2012-06-20 16:38:30 -0700599
600#ifdef WLAN_FEATURE_VOWIFI_11R
601 tCsr11rConfig csr11rConfig;
602#endif
603
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700604#ifdef FEATURE_WLAN_LFR
605 tANI_U8 isFastRoamIniFeatureEnabled;
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700606#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
607 tANI_U8 isRoamOffloadScanEnabled;
608#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700609#endif
610
Jeff Johnson295189b2012-06-20 16:38:30 -0700611#ifdef FEATURE_WLAN_CCX
612 tANI_U8 isCcxIniFeatureEnabled;
613#endif
614
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700615#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700616 tANI_U8 isFastTransitionEnabled;
617 tANI_U8 RoamRssiDiff;
618 tANI_U8 nImmediateRoamRssiDiff;
619 tANI_BOOLEAN nRoamPrefer5GHz;
620 tANI_BOOLEAN nRoamIntraBand;
621 tANI_BOOLEAN isWESModeEnabled;
622 tANI_BOOLEAN nRoamScanControl;
Varun Reddy Yeturu920df212013-05-22 08:07:23 -0700623 tANI_U8 nProbes;
624 tANI_U16 nRoamScanHomeAwayTime;
Jeff Johnson295189b2012-06-20 16:38:30 -0700625#endif
626
627#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
628 tCsrNeighborRoamConfig neighborRoamConfig;
629#endif
630
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800631 /* Instead of Reassoc, send ADDTS/DELTS even when ACM is off for that AC
Jeff Johnson295189b2012-06-20 16:38:30 -0700632 * This is mandated by WMM-AC certification */
633 tANI_BOOLEAN addTSWhenACMIsOff;
634
635 tANI_BOOLEAN fValidateList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800636 //Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700637 //BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnsone7245742012-09-05 17:12:55 -0700638 tANI_BOOLEAN doBMPSWorkaround;
Jeff Johnson295189b2012-06-20 16:38:30 -0700639
640 //To enable/disable scanning 2.4Ghz channels twice on a single scan request from HDD
641 tANI_BOOLEAN fScanTwice;
Jeff Johnsone7245742012-09-05 17:12:55 -0700642#ifdef WLAN_FEATURE_11AC
643 tANI_U32 nVhtChannelWidth;
Shailender Karmuchi08f87c22013-01-17 12:51:24 -0800644 tANI_U8 txBFEnable;
Shailender Karmuchicc3fe442013-02-16 18:18:33 -0800645 tANI_U8 txBFCsnValue;
Jeff Johnsone7245742012-09-05 17:12:55 -0700646#endif
Gopichand Nakkalab2d2c312013-01-04 11:41:02 -0800647 tANI_U8 txLdpcEnable;
Jeff Johnson295189b2012-06-20 16:38:30 -0700648
649}tCsrConfig;
650
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800651typedef struct tagCsrChannelPowerInfo
Jeff Johnson295189b2012-06-20 16:38:30 -0700652{
653 tListElem link;
654 tANI_U8 firstChannel;
655 tANI_U8 numChannels;
656 tANI_U8 txPower;
657 tANI_U8 interChannelOffset;
658}tCsrChannelPowerInfo;
659
660typedef struct tagRoamJoinStatus
661{
662 tSirResultCodes statusCode;
663 //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 -0800664 tANI_U32 reasonCode;
Kiran Kumar Lokerec8550fa2013-04-15 22:23:00 -0700665 tSirMacAddr bssId;
Jeff Johnson295189b2012-06-20 16:38:30 -0700666}tCsrRoamJoinStatus;
667
668typedef struct tagCsrOsChannelMask
669{
670 tANI_U8 numChannels;
671 tANI_BOOLEAN scanEnabled[WNI_CFG_VALID_CHANNEL_LIST_LEN];
672 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
673}tCsrOsChannelMask;
674
675
676typedef struct tagCsrScanStruct
677{
678 tScanProfile scanProfile;
679 tANI_U32 nextScanID;
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700680 tDblLinkList scanResultList;
Jeff Johnson295189b2012-06-20 16:38:30 -0700681 tDblLinkList tempScanResults;
682 tANI_BOOLEAN fScanEnable;
683 tANI_BOOLEAN fFullScanIssued;
684 tPalTimerHandle hTimerGetResult;
685#ifdef WLAN_AP_STA_CONCURRENCY
686 tPalTimerHandle hTimerStaApConcTimer;
687#endif
688 tPalTimerHandle hTimerIdleScan;
689 tPalTimerHandle hTimerResultAging;
Sandeep Puligilla2b6dc632012-12-17 14:44:16 -0800690 tPalTimerHandle hTimerResultCfgAging;
Jeff Johnson295189b2012-06-20 16:38:30 -0700691 tPalTimerHandle hTimerBgScan;
692 //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 -0800693 tANI_U8 channelOf11dInfo;
694 tANI_U8 scanResultCfgAgingTime;
Jeff Johnson295189b2012-06-20 16:38:30 -0700695 //changes on every scan, a flag to tell whether conflict 11d info found on each BSS
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800696 tANI_BOOLEAN fAmbiguous11dInfoFound;
Jeff Johnson295189b2012-06-20 16:38:30 -0700697 //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 -0800698 tANI_BOOLEAN fCurrent11dInfoMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700699 tANI_BOOLEAN f11dInfoReset; //to indicate whether the 11d info in CFG is reset to default
700 tSirScanType curScanType;
701 tCsrChannel baseChannels; //This are all the supported channels AND(&) to the current eBand
702 tCsrChannel channels11d;
703 tChannelListWithPower defaultPowerTable[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
704 tChannelListWithPower defaultPowerTable40MHz[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
705 tANI_U32 numChannelsDefault; //total channels of NV
706 tCsrChannel base20MHzChannels; //The channel base to work on
707 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
708 tDblLinkList channelPowerInfoList24;
709 tDblLinkList channelPowerInfoList5G;
710 tANI_U32 nLastAgeTimeOut;
711 tANI_U32 nAgingCountDown;
Gopichand Nakkala114718f2013-03-25 19:19:46 -0700712 tANI_U8 countryCodeDefault[WNI_CFG_COUNTRY_CODE_LEN]; //The country code from NV
713 tANI_U8 countryCodeCurrent[WNI_CFG_COUNTRY_CODE_LEN];
714 tANI_U8 countryCode11d[WNI_CFG_COUNTRY_CODE_LEN];
Jeff Johnson295189b2012-06-20 16:38:30 -0700715 v_REGDOMAIN_t domainIdDefault; //default regulatory domain
716 v_REGDOMAIN_t domainIdCurrent; //current regulatory domain
717 tANI_BOOLEAN f11dInfoApplied;
718 tANI_BOOLEAN fCancelIdleScan;
719#ifdef FEATURE_WLAN_WAPI
720// tANI_U16 NumBkidCandidate;
721// tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED]; /* Move this as part of SessionEntry */
722#endif /* FEATURE_WLAN_WAPI */
723 tANI_U8 numBGScanChannel; //number of valid channels in the bgScanChannelList
724 tANI_U8 bgScanChannelList[WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN];
725 //the ChannelInfo member is not used in this structure.
726 //numBGScanChannel and bgScanChannelList are used for the BG scan channel info
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800727 tCsrBGScanRequest bgScanParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700728 tANI_BOOLEAN fRestartIdleScan;
729 tANI_U32 nIdleScanTimeGap; //the time since last trying to trigger idle scan
730 tCsrOsChannelMask osScanChannelMask;//keep a track of channels to be scnned while in traffic condition
731 tANI_U16 nBssLimit; //the maximum number of BSS in scan cache
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800732 /*channelPowerInfoList24 has been seen corrupted. Set this flag to true trying to
Jeff Johnson295189b2012-06-20 16:38:30 -0700733 * detect when it happens. Adding this into code because we can't reproduce it easily.
734 * We don't know when it happens. */
735 tANI_BOOLEAN fValidateList;
736 /*Customer wants to start with an active scan based on the default country code.
737 * This optimization will minimize the driver load to association time.
738 * Based on this flag we will bypass the initial passive scan needed for 11d
739 * to determine the country code & domain */
740 tANI_BOOLEAN fEnableBypass11d;
741
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800742 /*Customer wants to optimize the scan time. Avoiding scans(passive) on DFS
743 * channels while swipping through both bands can save some time
Jeff Johnson295189b2012-06-20 16:38:30 -0700744 * (apprx 1.3 sec) */
745 tANI_BOOLEAN fEnableDFSChnlScan;
746
Jeff Johnsone7245742012-09-05 17:12:55 -0700747 /*
748 * To enable/disable scanning only 2.4Ghz channels on first scan
749 */
750 tANI_BOOLEAN fFirstScanOnly2GChnl;
751
Jeff Johnson295189b2012-06-20 16:38:30 -0700752 tANI_BOOLEAN fDropScanCmd; //true means we don't accept scan commands
753
754#ifdef WLAN_AP_STA_CONCURRENCY
755 tDblLinkList scanCmdPendingList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800756#endif
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700757 tCsrChannel occupiedChannels; //This includes all channels on which candidate APs are found
Jeff Johnson295189b2012-06-20 16:38:30 -0700758}tCsrScanStruct;
759
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800760#ifdef FEATURE_WLAN_TDLS_INTERNAL
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800761/*
762 * struct to carry TDLS discovery info..
763 */
764typedef struct sCsrTdlsContext
765{
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800766 tDblLinkList tdlsPotentialPeerList ;
767 tANI_U16 tdlsCommonFlag ;
768 tANI_U16 tdlsCommonState ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800769 tANI_U16 tdlsPeerCount ;
770}tCsrTdlsCtxStruct;
771
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800772typedef struct sCsrTdlsPeerLinkInfo
773{
774 tListElem tdlsPeerStaLink ;
775 tSirTdlsPeerInfo tdlsDisPeerInfo ;
776}tCsrTdlsPeerLinkinfo ;
777#endif
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800778
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800779
780
Jeff Johnson295189b2012-06-20 16:38:30 -0700781
782//Save the connected information. This structure + connectedProfile
783//should contain all information about the connection
784typedef struct tagRoamCsrConnectedInfo
785{
786 tANI_U32 nBeaconLength; //the length, in bytes, of the beacon frame, can be 0
787 tANI_U32 nAssocReqLength; //the length, in bytes, of the assoc req frame, can be 0
788 tANI_U32 nAssocRspLength; //The length, in bytes, of the assoc rsp frame, can be 0
789#ifdef WLAN_FEATURE_VOWIFI_11R
790 tANI_U32 nRICRspLength; //Length of the parsed RIC response IEs received in reassoc response
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800791#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700792#ifdef FEATURE_WLAN_CCX
793 tANI_U32 nTspecIeLength;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800794#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700795 tANI_U8 *pbFrames; //Point to a buffer contain the beacon, assoc req, assoc rsp frame, in that order
796 //user needs to use nBeaconLength, nAssocReqLength, nAssocRspLength to desice where
797 //each frame starts and ends.
798 tANI_U8 staId;
799}tCsrRoamConnectedInfo;
800
801
802typedef struct tagCsrLinkQualityIndInfo
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800803{
Jeff Johnson295189b2012-06-20 16:38:30 -0700804 csrRoamLinkQualityIndCallback callback;
805 void *context;
806}tCsrLinkQualityIndInfo;
807
808typedef struct tagCsrPeStatsReqInfo
809{
810 tListElem link; /* list links */
811 tANI_U32 statsMask;
812 tANI_U32 periodicity;
813 tANI_BOOLEAN rspPending;
814 vos_timer_t hPeStatsTimer;
815 tANI_BOOLEAN timerRunning;
816 tANI_U8 staId;
817 tANI_U8 numClient;
818 tpAniSirGlobal pMac;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800819 /* To remember if the peStats timer is stopped successfully or not */
Jeff Johnson295189b2012-06-20 16:38:30 -0700820 tANI_BOOLEAN timerStopFailed;
821
822}tCsrPeStatsReqInfo;
823
824typedef struct tagCsrStatsClientReqInfo
825{
826 tListElem link; /* list links */
827 eCsrStatsRequesterType requesterId;
828 tCsrStatsCallback callback;
829 tANI_U32 periodicity;
830 void *pContext;
831 tANI_U32 statsMask;
832 tCsrPeStatsReqInfo *pPeStaEntry;
833 tANI_U8 staId;
834 vos_timer_t timer;
835 tANI_BOOLEAN timerExpired;
836 tpAniSirGlobal pMac; // TODO: Confirm this change BTAMP
837}tCsrStatsClientReqInfo;
838
839typedef struct tagCsrTlStatsReqInfo
840{
841 tANI_U32 periodicity;
842 tANI_BOOLEAN timerRunning;
843 tPalTimerHandle hTlStatsTimer;
844 tANI_U8 numClient;
845}tCsrTlStatsReqInfo;
846
847typedef struct tagCsrRoamSession
848{
849 tANI_U8 sessionId; // Session ID
850 tANI_BOOLEAN sessionActive; // TRUE if it is used
851 tCsrBssid selfMacAddr; // For BT-AMP station, this serve as BSSID for self-BSS.
852 csrRoamCompleteCallback callback;
853 void *pContext;
854 eCsrConnectState connectState;
855 tCsrRoamConnectedProfile connectedProfile;
856 tCsrRoamConnectedInfo connectedInfo;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800857 tCsrRoamProfile *pCurRoamProfile;
Jeff Johnson295189b2012-06-20 16:38:30 -0700858 tSirBssDescription *pConnectBssDesc;
859 tANI_U16 NumPmkidCache;
860 tPmkidCacheInfo PmkidCacheInfo[CSR_MAX_PMKID_ALLOWED];
861 tANI_U8 cJoinAttemps;
862 //This may or may not have the up-to-date valid channel list
863 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
864 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
865 tANI_S32 sPendingCommands; //0 means CSR is ok to low power
866#ifdef FEATURE_WLAN_WAPI
867 tANI_U16 NumBkidCache;
868 tBkidCacheInfo BkidCacheInfo[CSR_MAX_BKID_ALLOWED];
869#endif /* FEATURE_WLAN_WAPI */
870 tANI_BOOLEAN fRoaming; //indicate whether CSR is roaming (either via lostlink or dynamic roaming)
871 //to remember some parameters needed for START_BSS.
872 //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 -0800873 tCsrRoamStartBssParams bssParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700874 tANI_U32 nWpaRsnReqIeLength; //the byte count of pWpaRsnIE;
875 tANI_U8 *pWpaRsnReqIE; //this contain the WPA/RSN IE in assoc request or the one sent in beacon (IBSS)
876 tANI_U32 nWpaRsnRspIeLength; //the byte count for pWpaRsnRspIE
877 tANI_U8 *pWpaRsnRspIE; //this contain the WPA/RSN IE in beacon/probe rsp
878#ifdef FEATURE_WLAN_WAPI
879 tANI_U32 nWapiReqIeLength; //the byte count of pWapiReqIE;
880 tANI_U8 *pWapiReqIE; //this contain the WAPI IE in assoc request or the one sent in beacon (IBSS)
881 tANI_U32 nWapiRspIeLength; //the byte count for pWapiRspIE
882 tANI_U8 *pWapiRspIE; //this contain the WAPI IE in beacon/probe rsp
883#endif /* FEATURE_WLAN_WAPI */
884 tANI_U32 nAddIEScanLength; //the byte count of pAddIeScanIE;
885 tANI_U8 *pAddIEScan; //this contains the additional IE in (unicast) probe request at the time of join
886 tANI_U32 nAddIEAssocLength; //the byte count for pAddIeAssocIE
887 tANI_U8 *pAddIEAssoc; //this contains the additional IE in (re) assoc request
888
889 tANI_TIMESTAMP roamingStartTime; //in units of 10ms
890 tCsrTimerInfo roamingTimerInfo;
891 eCsrRoamingReason roamingReason;
892 tANI_BOOLEAN fCancelRoaming;
893 tPalTimerHandle hTimerRoaming;
894 tPalTimerHandle hTimerIbssJoining;
895 tCsrTimerInfo ibssJoinTimerInfo;
896 tANI_BOOLEAN ibss_join_pending;
897 eCsrRoamResult roamResult; //the roamResult that is used when the roaming timer fires
898 tCsrRoamJoinStatus joinFailStatusCode; //This is the reason code for join(assoc) failure
899 //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 -0800900 tANI_U32 roamingStatusCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700901 tANI_U16 NumPmkidCandidate;
902 tPmkidCandidateInfo PmkidCandidateInfo[CSR_MAX_PMKID_ALLOWED];
903 #ifdef FEATURE_WLAN_WAPI
904 tANI_U16 NumBkidCandidate;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800905 tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED];
Jeff Johnson295189b2012-06-20 16:38:30 -0700906#endif
907 tANI_BOOLEAN fWMMConnection;
908#ifdef FEATURE_WLAN_BTAMP_UT_RF
909 //To retry a join later when it fails if so desired
910 tPalTimerHandle hTimerJoinRetry;
911 tCsrTimerInfo joinRetryTimerInfo;
912 tANI_U32 maxRetryCount;
913#endif
914#ifdef FEATURE_WLAN_CCX
915 tCsrCcxCckmInfo ccxCckmInfo;
916 tANI_BOOLEAN isPrevApInfoValid;
917 tSirMacSSid prevApSSID;
918 tCsrBssid prevApBssid;
919 tANI_U8 prevOpChannel;
920 tANI_U16 clientDissSecs;
921 tANI_U32 roamTS1;
922#endif
923 tANI_U8 bRefAssocStartCnt; //Tracking assoc start indication
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800924 /* to force the AP initiate fresh 802.1x authentication after re-association need to clear
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700925 * the PMKID cache. To clear the cache in this particular case this is added
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800926 * it is needed by the HS 2.0 passpoint certification 5.2.a and b testcases */
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700927 tANI_BOOLEAN fIgnorePMKIDCache;
Jeff Johnson295189b2012-06-20 16:38:30 -0700928} tCsrRoamSession;
929
930typedef struct tagCsrRoamStruct
931{
932 tANI_U32 nextRoamId;
933 tDblLinkList roamCmdPendingList;
934 tDblLinkList channelList5G;
935 tDblLinkList channelList24;
936 tCsrConfig configParam;
937 tANI_U32 numChannelsEeprom; //total channels of eeprom
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800938 tCsrChannel base20MHzChannels; //The channel base to work on
939 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
940 eCsrRoamState curState[CSR_ROAM_SESSION_MAX];
Jeff Johnson295189b2012-06-20 16:38:30 -0700941 eCsrRoamSubState curSubState[CSR_ROAM_SESSION_MAX];
942 //This may or may not have the up-to-date valid channel list
943 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
944 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
945 tANI_U32 numValidChannels; //total number of channels in CFG
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800946
Jeff Johnson295189b2012-06-20 16:38:30 -0700947 tANI_S32 sPendingCommands;
Jeff Johnson295189b2012-06-20 16:38:30 -0700948 tPalTimerHandle hTimerWaitForKey; //To support timeout for WaitForKey state
949 tCsrSummaryStatsInfo summaryStatsInfo;
950 tCsrGlobalClassAStatsInfo classAStatsInfo;
951 tCsrGlobalClassBStatsInfo classBStatsInfo;
952 tCsrGlobalClassCStatsInfo classCStatsInfo;
953 tCsrGlobalClassDStatsInfo classDStatsInfo;
954 tCsrPerStaStatsInfo perStaStatsInfo[CSR_MAX_STA];
955 tDblLinkList statsClientReqList;
956 tDblLinkList peStatsReqList;
957 tCsrTlStatsReqInfo tlStatsReqInfo;
958 eCsrRoamLinkQualityInd vccLinkQuality;
959 tCsrLinkQualityIndInfo linkQualityIndInfo;
960 v_CONTEXT_t gVosContext; //used for interaction with TL
961 //To specify whether an association or a IBSS is WMM enabled
962 //This parameter is only valid during a join or start BSS command is being executed
963 //tANI_BOOLEAN fWMMConnection; /* Moving it to be part of roamsession */
964 v_U8_t ucACWeights[WLANTL_MAX_AC];
965 /* TODO : Upto here */
966 tCsrTimerInfo WaitForKeyTimerInfo;
967 tCsrRoamSession *roamSession;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800968 tANI_U32 transactionId; // Current transaction ID for internal use.
969#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
Jeff Johnson295189b2012-06-20 16:38:30 -0700970 tCsrNeighborRoamControlInfo neighborRoamInfo;
971#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700972#ifdef FEATURE_WLAN_LFR
973 tANI_U8 isFastRoamIniFeatureEnabled;
974#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700975#ifdef FEATURE_WLAN_CCX
976 tANI_U8 isCcxIniFeatureEnabled;
977#endif
Jeff Johnson43971f52012-07-17 12:26:56 -0700978#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700979 tANI_U8 RoamRssiDiff;
980 tANI_BOOLEAN isWESModeEnabled;
Jeff Johnson43971f52012-07-17 12:26:56 -0700981#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700982}tCsrRoamStruct;
983
984
985#define GET_NEXT_ROAM_ID(pRoamStruct) (((pRoamStruct)->nextRoamId + 1 == 0) ? 1 : (pRoamStruct)->nextRoamId)
986#define CSR_IS_ROAM_STATE(pMac, state, sessionId) ( (state) == (pMac)->roam.curState[sessionId] )
987
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800988#define CSR_IS_ROAM_STOP(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_STOP, sessionId )
989#define CSR_IS_ROAM_INIT(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_INIT, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -0700990#define CSR_IS_ROAM_SCANNING(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_SCANNING, sessionId )
991#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 -0800992#define CSR_IS_ROAM_IDLE(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_IDLE, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -0700993#define CSR_IS_ROAM_JOINED(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_JOINED, sessionId )
994
995#define CSR_IS_ROAM_SUBSTATE(pMac, subState, sessionId) ((subState) == (pMac)->roam.curSubState[sessionId])
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800996#define CSR_IS_ROAM_SUBSTATE_JOIN_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOIN_REQ, sessionId)
997#define CSR_IS_ROAM_SUBSTATE_AUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_AUTH_REQ, sessionId)
998#define CSR_IS_ROAM_SUBSTATE_REASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_REASSOC_REQ, sessionId)
999#define CSR_IS_ROAM_SUBSTATE_DISASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REQ, sessionId)
1000#define CSR_IS_ROAM_SUBSTATE_DISASSOC_NO_JOIN(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN, sessionId)
1001#define CSR_IS_ROAM_SUBSTATE_REASSOC_FAIL(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE, sessionId)
1002#define CSR_IS_ROAM_SUBSTATE_DISASSOC_FORCED(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_FORCED, sessionId)
1003#define CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DEAUTH_REQ, sessionId)
1004#define CSR_IS_ROAM_SUBSTATE_START_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_START_BSS_REQ, sessionId)
1005#define CSR_IS_ROAM_SUBSTATE_STOP_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_STOP_BSS_REQ, sessionId)
1006#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 -07001007#define CSR_IS_ROAM_SUBSTATE_CONFIG(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_CONFIG, sessionId)
1008#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 -08001009#define CSR_IS_ROAM_SUBSTATE_DISASSOC_HO(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF, sessionId)
1010#define CSR_IS_ROAM_SUBSTATE_HO_NT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC, sessionId)
1011#define CSR_IS_ROAM_SUBSTATE_HO_NRT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC, sessionId)
1012#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 -07001013
1014#define CSR_IS_PHY_MODE_B_ONLY(pMac) \
1015 ((eCSR_DOT11_MODE_11b == (pMac)->roam.configParam.phyMode) ||\
1016 (eCSR_DOT11_MODE_11b_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001017
Jeff Johnson295189b2012-06-20 16:38:30 -07001018#define CSR_IS_PHY_MODE_G_ONLY(pMac) \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001019 (eCSR_DOT11_MODE_11g == (pMac)->roam.configParam.phyMode || eCSR_DOT11_MODE_11g_ONLY == (pMac)->roam.configParam.phyMode)
1020
Jeff Johnson295189b2012-06-20 16:38:30 -07001021#define CSR_IS_PHY_MODE_A_ONLY(pMac) \
1022 ((eCSR_DOT11_MODE_11a == (pMac)->roam.configParam.phyMode) ||\
1023 (eCSR_DOT11_MODE_11a_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001024
Jeff Johnsone7245742012-09-05 17:12:55 -07001025#ifdef WLAN_FEATURE_11AC
1026#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1027 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1028 (eCSR_DOT11_MODE_11ac & (phyMode)) || \
1029 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1030 (eCSR_DOT11_MODE_AUTO & (phyMode)))
1031#else
Jeff Johnson295189b2012-06-20 16:38:30 -07001032#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1033 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1034 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1035 (eCSR_DOT11_MODE_AUTO & (phyMode)))
Jeff Johnsone7245742012-09-05 17:12:55 -07001036#endif
1037
Jeff Johnson295189b2012-06-20 16:38:30 -07001038
1039// this function returns TRUE if the NIC is operating exclusively in the 2.4 GHz band, meaning
1040// it is NOT operating in the 5.0 GHz band.
1041#define CSR_IS_24_BAND_ONLY(pMac) \
1042 (eCSR_BAND_24 == (pMac)->roam.configParam.eBand)
1043
1044#define CSR_IS_5G_BAND_ONLY(pMac) \
1045 (eCSR_BAND_5G == (pMac)->roam.configParam.eBand)
1046
1047#define CSR_IS_RADIO_DUAL_BAND(pMac) \
1048 (eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability)
1049
1050#define CSR_IS_RADIO_BG_ONLY(pMac) \
1051 (eCSR_BAND_24 == (pMac)->roam.configParam.bandCapability)
1052
1053// this function returns TRUE if the NIC is operating exclusively in the 5.0 GHz band, meaning
1054// it is NOT operating in the 2.4 GHz band
1055#define CSR_IS_RADIO_A_ONLY(pMac) \
1056 (eCSR_BAND_5G == (pMac)->roam.configParam.bandCapability)
1057
1058// this function returns TRUE if the NIC is operating in both bands.
1059#define CSR_IS_OPEARTING_DUAL_BAND(pMac) \
1060 ((eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability) && (eCSR_BAND_ALL == (pMac)->roam.configParam.eBand))
1061
1062// this function returns TRUE if the NIC can operate in the 5.0 GHz band (could operate in the
1063// 2.4 GHz band also).
1064#define CSR_IS_OPERATING_A_BAND(pMac) \
1065 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_A_ONLY((pMac)) || CSR_IS_5G_BAND_ONLY((pMac)))
1066
1067// this function returns TRUE if the NIC can operate in the 2.4 GHz band (could operate in the
1068// 5.0 GHz band also).
1069#define CSR_IS_OPERATING_BG_BAND(pMac) \
1070 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_BG_ONLY((pMac)) || CSR_IS_24_BAND_ONLY((pMac)))
1071
1072#define CSR_IS_CHANNEL_5GHZ(chnNum) \
Jeff Johnsone7245742012-09-05 17:12:55 -07001073 (((chnNum) >= CSR_MIN_5GHz_CHANNEL_NUMBER) && ((chnNum) <= CSR_MAX_5GHz_CHANNEL_NUMBER))
Jeff Johnson295189b2012-06-20 16:38:30 -07001074
Srinivas Girigowdade697412013-02-14 16:31:48 -08001075#define CSR_IS_CHANNEL_DFS(chnNum) \
1076 (NV_CHANNEL_ENABLE != vos_nv_getChannelEnabledState(chnNum))
1077
Jeff Johnson295189b2012-06-20 16:38:30 -07001078#define CSR_IS_CHANNEL_24GHZ(chnNum) \
1079 (((chnNum) > 0) && ((chnNum) <= CSR_MAX_24GHz_CHANNEL_NUMBER))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001080
Jeff Johnson295189b2012-06-20 16:38:30 -07001081#define CSR_IS_SAME_BAND_CHANNELS(ch1, ch2) (CSR_IS_CHANNEL_5GHZ(ch1) == CSR_IS_CHANNEL_5GHZ(ch2))
1082
1083
1084#define CSR_IS_11D_INFO_FOUND(pMac) \
1085 (0 != (pMac)->scan.channelOf11dInfo)
1086// DEAUTHIND
1087#define CSR_IS_ROAMING(pSession) ((CSR_IS_LOSTLINK_ROAMING((pSession)->roamingReason)) || \
1088 (eCsrDynamicRoaming == (pSession)->roamingReason) || \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001089 (eCsrReassocRoaming == (pSession)->roamingReason))
Jeff Johnson295189b2012-06-20 16:38:30 -07001090
1091
1092#define CSR_IS_SET_KEY_COMMAND( pCommand ) ( eSmeCommandSetKey == (pCommand)->command )
1093
1094#define CSR_IS_ADDTS_WHEN_ACMOFF_SUPPORTED(pMac) (pMac->roam.configParam.addTSWhenACMIsOff)
1095// DEAUTHIND
1096#define CSR_IS_LOSTLINK_ROAMING(reason) ((eCsrLostlinkRoamingDisassoc == (reason)) || (eCsrLostlinkRoamingDeauth == (reason)))
1097
Venkata Prathyusha Kuntupalli239278b2013-03-26 15:58:18 -07001098#define CSR_IS_ROAMING_COMMAND(pCommand) ((eCsrLostLink1 == (pCommand)->u.roamCmd.roamReason) ||\
1099 (eCsrLostLink2 == (pCommand)->u.roamCmd.roamReason) ||\
1100 (eCsrLostLink3 == (pCommand)->u.roamCmd.roamReason) )
1101
1102
Jeff Johnson295189b2012-06-20 16:38:30 -07001103//Stop CSR from asking for IMPS, This function doesn't disable IMPS from CSR
1104void csrScanSuspendIMPS( tpAniSirGlobal pMac );
1105//Start CSR from asking for IMPS. This function doesn't trigger CSR to request entering IMPS
1106//because IMPS maybe disabled.
1107void csrScanResumeIMPS( tpAniSirGlobal pMac );
1108
1109eHalStatus csrInitGetChannels(tpAniSirGlobal pMac);
Venkata Prathyusha Kuntupalli316247e2013-03-15 17:45:25 -07001110// Getting the 5GHz Channel list
1111eHalStatus csrGet5GChannels(tpAniSirGlobal pMac);
1112// Getting the 2.4GHz Channel list
1113eHalStatus csrGet24GChannels(tpAniSirGlobal pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001114
1115eHalStatus csrSetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1116 tCsrRoamModifyProfileFields *pModifyProfileFields);
1117/* ---------------------------------------------------------------------------
1118 \fn csrGetModifyProfileFields
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001119 \brief HDD or SME - QOS calls this function to get the current values of
Jeff Johnson295189b2012-06-20 16:38:30 -07001120 connected profile fields changing which can cause reassoc.
1121 This function must be called after CFG is downloaded and STA is in connected
1122 state.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001123 \param pModifyProfileFields - pointer to the connected profile fields
Jeff Johnson295189b2012-06-20 16:38:30 -07001124 changing which can cause reassoc
1125
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001126 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001127 -------------------------------------------------------------------------------*/
1128eHalStatus csrGetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1129 tCsrRoamModifyProfileFields * pModifyProfileFields);
1130void csrSetGlobalCfgs( tpAniSirGlobal pMac );
1131void csrSetDefaultDot11Mode( tpAniSirGlobal pMac );
1132void csrScanSetChannelMask(tpAniSirGlobal pMac, tCsrChannelInfo *pChannelInfo);
1133tANI_BOOLEAN csrIsConnStateDisconnected(tpAniSirGlobal pMac, tANI_U32 sessionId);
1134tANI_BOOLEAN csrIsConnStateConnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1135tANI_BOOLEAN csrIsConnStateDisconnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1136tANI_BOOLEAN csrIsConnStateConnectedInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1137tANI_BOOLEAN csrIsConnStateConnected( tpAniSirGlobal pMac, tANI_U32 sessionId );
1138tANI_BOOLEAN csrIsConnStateInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1139tANI_BOOLEAN csrIsConnStateIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1140tANI_BOOLEAN csrIsConnStateWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1141tANI_BOOLEAN csrIsConnStateConnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1142tANI_BOOLEAN csrIsConnStateDisconnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1143tANI_BOOLEAN csrIsAnySessionInConnectState( tpAniSirGlobal pMac );
1144tANI_BOOLEAN csrIsAllSessionDisconnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudi48081ef2012-12-04 16:49:55 -08001145tANI_BOOLEAN csrIsStaSessionConnected( tpAniSirGlobal pMac );
1146tANI_BOOLEAN csrIsP2pSessionConnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudid3d22592012-09-24 14:01:29 -07001147tANI_BOOLEAN csrIsAnySessionConnected( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001148tANI_BOOLEAN csrIsInfraConnected( tpAniSirGlobal pMac );
1149tANI_BOOLEAN csrIsConcurrentInfraConnected( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001150tANI_BOOLEAN csrIsConcurrentSessionRunning( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001151tANI_BOOLEAN csrIsInfraApStarted( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001152tANI_BOOLEAN csrIsIBSSStarted( tpAniSirGlobal pMac );
1153tANI_BOOLEAN csrIsBTAMPStarted( tpAniSirGlobal pMac );
1154tANI_BOOLEAN csrIsBTAMP( tpAniSirGlobal pMac, tANI_U32 sessionId );
1155eHalStatus csrIsBTAMPAllowed( tpAniSirGlobal pMac, tANI_U32 chnId );
Jeff Johnsone7245742012-09-05 17:12:55 -07001156tANI_BOOLEAN csrIsValidMcConcurrentSession(tpAniSirGlobal pMac, tANI_U32 sessionId,
1157 tSirBssDescription *pBssDesc);
Jeff Johnson295189b2012-06-20 16:38:30 -07001158tANI_BOOLEAN csrIsConnStateConnectedInfraAp( tpAniSirGlobal pMac, tANI_U32 sessionId );
Jeff Johnson295189b2012-06-20 16:38:30 -07001159/*----------------------------------------------------------------------------
1160 \fn csrRoamRegisterLinkQualityIndCallback
1161
1162 \brief
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001163 a CSR function to allow HDD to register a callback handler with CSR for
1164 link quality indications.
Jeff Johnson295189b2012-06-20 16:38:30 -07001165
1166 Only one callback may be registered at any time.
1167 In order to deregister the callback, a NULL cback may be provided.
1168
1169 Registration happens in the task context of the caller.
1170
1171 \param callback - Call back being registered
1172 \param pContext - user data
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001173
Jeff Johnson295189b2012-06-20 16:38:30 -07001174 DEPENDENCIES: After CSR open
1175
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001176 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001177-----------------------------------------------------------------------------*/
1178eHalStatus csrRoamRegisterLinkQualityIndCallback(tpAniSirGlobal pMac,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001179 csrRoamLinkQualityIndCallback callback,
Jeff Johnson295189b2012-06-20 16:38:30 -07001180 void *pContext);
1181/* ---------------------------------------------------------------------------
1182 \fn csrGetStatistics
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001183 \brief csr function that client calls to register a callback to get
1184 different PHY level statistics from CSR.
1185
Jeff Johnson295189b2012-06-20 16:38:30 -07001186 \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc
1187 \param statsMask - The different category/categories of stats requester is looking for
1188 \param callback - SME sends back the requested stats using the callback
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001189 \param periodicity - If requester needs periodic update, 0 means it's an one
Jeff Johnson295189b2012-06-20 16:38:30 -07001190 time request
1191 \param cache - If requester is happy with cached stats
1192 \param staId - The station ID for which the stats is requested for
1193 \param pContext - user context to be passed back along with the callback
1194
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001195 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001196 ---------------------------------------------------------------------------*/
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001197eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requesterId,
1198 tANI_U32 statsMask,
1199 tCsrStatsCallback callback,
1200 tANI_U32 periodicity, tANI_BOOLEAN cache,
Jeff Johnson295189b2012-06-20 16:38:30 -07001201 tANI_U8 staId, void *pContext);
1202
1203
1204eHalStatus csrGetRssi(tpAniSirGlobal pMac,tCsrRssiCallback callback,tANI_U8 staId,tCsrBssid bssId,void * pContext,void * pVosContext);
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08001205#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1206eHalStatus csrGetRoamRssi(tpAniSirGlobal pMac,
1207 tCsrRssiCallback callback,
1208 tANI_U8 staId,
1209 tCsrBssid bssId,
1210 void * pContext,
1211 void * pVosContext);
1212#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001213eHalStatus csrRoamRegisterCallback(tpAniSirGlobal pMac, csrRoamCompleteCallback callback, void *pContext);
1214/* ---------------------------------------------------------------------------
1215 \fn csrGetConfigParam
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001216 \brief HDD calls this function to get the global settings currently maintained by CSR.
Jeff Johnson295189b2012-06-20 16:38:30 -07001217 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001218 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001219 -------------------------------------------------------------------------------*/
1220eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1221
1222/* ---------------------------------------------------------------------------
1223 \fn csrMsgProcessor
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001224 \brief HDD calls this function to change some global settings.
Jeff Johnson295189b2012-06-20 16:38:30 -07001225 caller must set the all fields or call csrGetConfigParam to prefill the fields.
1226 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001227 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001228 -------------------------------------------------------------------------------*/
1229eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1230
1231
1232/* ---------------------------------------------------------------------------
1233 \fn csrMsgProcessor
1234 \brief HDD calls this function for the messages that are handled by CSR.
1235 \param pMsgBuf - a pointer to a buffer that maps to various structures base on the message type.
1236 The beginning of the buffer can always map to tSirSmeRsp.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001237 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001238 -------------------------------------------------------------------------------*/
1239eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf );
1240
1241/* ---------------------------------------------------------------------------
1242 \fn csrOpen
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001243 \brief This function must be called before any API call to CSR.
1244 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001245 -------------------------------------------------------------------------------*/
1246eHalStatus csrOpen(tpAniSirGlobal pMac);
1247/* ---------------------------------------------------------------------------
1248 \fn csrClose
1249 \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 -08001250 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001251 -------------------------------------------------------------------------------*/
1252eHalStatus csrClose(tpAniSirGlobal pMac);
1253/* ---------------------------------------------------------------------------
1254 \fn csrStart
1255 \brief To start CSR.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001256 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001257 -------------------------------------------------------------------------------*/
1258eHalStatus csrStart(tpAniSirGlobal pMac);
1259/* ---------------------------------------------------------------------------
1260 \fn csrStop
1261 \brief To stop CSR. CSR still keeps its current setting.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001262 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001263 -------------------------------------------------------------------------------*/
1264eHalStatus csrStop(tpAniSirGlobal pMac);
1265/* ---------------------------------------------------------------------------
1266 \fn csrReady
1267 \brief To let CSR is ready to operate
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001268 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001269 -------------------------------------------------------------------------------*/
1270eHalStatus csrReady(tpAniSirGlobal pMac);
1271
1272#ifdef FEATURE_WLAN_WAPI
1273eHalStatus csrRoamGetBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pNum,
1274 tBkidCacheInfo *pBkidCache);
1275
1276
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001277eHalStatus csrScanGetBKIDCandidateList(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001278 tBkidCandidateInfo *pBkidList, tANI_U32 *pNumItems );
1279tANI_U32 csrRoamGetNumBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId);
1280eHalStatus csrRoamSetBKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache,
1281 tANI_U32 numItems );
1282/* ---------------------------------------------------------------------------
1283 \fn csrRoamGetWapiReqIE
1284 \brief return the WAPI IE CSR passes to PE to JOIN request or START_BSS request
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001285 \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 -07001286 needed or IE length in pBuf.
1287 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1288 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1289 -------------------------------------------------------------------------------*/
1290eHalStatus csrRoamGetWapiReqIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
1291
1292/* ---------------------------------------------------------------------------
1293 \fn csrRoamGetWapiRspIE
1294 \brief return the WAPI IE from the beacon or probe rsp if connected
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001295 \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 -07001296 needed or IE length in pBuf.
1297 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1298 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1299 -------------------------------------------------------------------------------*/
1300eHalStatus csrRoamGetWapiRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001301tANI_U8 csrConstructWapiIe( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
Jeff Johnson295189b2012-06-20 16:38:30 -07001302 tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes, tCsrWapiIe *pWapiIe );
1303#endif /* FEATURE_WLAN_WAPI */
1304
Jeff Johnson295189b2012-06-20 16:38:30 -07001305eHalStatus csrRoamUpdateAPWPSIE( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirAPWPSIEs *pAPWPSIES );
1306eHalStatus csrRoamUpdateWPARSNIEs( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirRSNie * pAPSirRSNie);
Jeff Johnson295189b2012-06-20 16:38:30 -07001307void csrSetCfgPrivacy( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, tANI_BOOLEAN fPrivacy );
1308tANI_S8 csrGetInfraSessionId( tpAniSirGlobal pMac );
1309tANI_U8 csrGetInfraOperationChannel( tpAniSirGlobal pMac, tANI_U8 sessionId);
1310tANI_U8 csrGetConcurrentOperationChannel( tpAniSirGlobal pMac );
1311
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001312eHalStatus csrRoamCopyConnectProfile(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001313 tCsrRoamConnectedProfile *pProfile);
1314tANI_BOOLEAN csrIsSetKeyAllowed(tpAniSirGlobal pMac, tANI_U32 sessionId);
1315
1316void csrSetOppositeBandChannelInfo( tpAniSirGlobal pMac );
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001317void csrConstructCurrentValidChannelList( tpAniSirGlobal pMac, tDblLinkList *pChannelSetList,
Jeff Johnson295189b2012-06-20 16:38:30 -07001318 tANI_U8 *pChannelList, tANI_U8 bSize, tANI_U8 *pNumChannels );
Srikant Kuppa066904f2013-05-07 13:56:02 -07001319eHalStatus csrScanSavePreferredNetworkFound(tpAniSirGlobal pMac,
1320 tSirPrefNetworkFoundInd *pPrefNetworkFoundInd);
Jeff Johnson295189b2012-06-20 16:38:30 -07001321#endif
1322
1323#ifdef WLAN_FEATURE_VOWIFI_11R
1324//Returns whether the current association is a 11r assoc or not
1325tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac);
1326#endif
1327
1328#ifdef FEATURE_WLAN_CCX
1329//Returns whether the current association is a CCX assoc or not
1330tANI_BOOLEAN csrRoamIsCCXAssoc(tpAniSirGlobal pMac);
1331#endif
1332
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001333//Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -07001334//BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnson295189b2012-06-20 16:38:30 -07001335void csrDisconnectAllActiveSessions(tpAniSirGlobal pMac);
Mohit Khanna349bc392012-09-11 17:24:52 -07001336
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001337#ifdef FEATURE_WLAN_LFR
1338//Returns whether "Legacy Fast Roaming" is enabled...or not
Madan Mohan Koyyalamudi03aae5f2012-11-28 01:51:22 +05301339tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac, tANI_U32 sessionId);
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07001340#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
1341tANI_BOOLEAN csrRoamIsRoamOffloadScanEnabled(tpAniSirGlobal pMac);
1342#endif
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -07001343tANI_BOOLEAN csrIsChannelPresentInList( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
1344VOS_STATUS csrAddToChannelListFront( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07001345#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
1346eHalStatus csrScanRequestLfrResult(tpAniSirGlobal pMac, tANI_U32 sessionId,
1347 csrScanCompleteCallback callback, void *pContext);
Varun Reddy Yeturucc661d22013-05-20 11:47:10 -07001348eHalStatus csrRoamOffloadScanRspHdlr(tpAniSirGlobal pMac, tANI_U8 reason);
1349eHalStatus csrHandoffRequest(tpAniSirGlobal pMac, tCsrHandoffRequest *pHandoffInfo);
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07001350#endif
1351tANI_BOOLEAN csrRoamIsStaMode(tpAniSirGlobal pMac, tANI_U32 sessionId);
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001352#endif
1353