blob: 83a3b8ecac5fb73fead2f5f885d935541993bba7 [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,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800195
Jeff Johnson295189b2012-06-20 16:38:30 -0700196}eCsrRoamReason;
197
198typedef enum
199{
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800200 eCSR_ROAM_SUBSTATE_NONE = 0,
201 eCSR_ROAM_SUBSTATE_START_BSS_REQ,
202 eCSR_ROAM_SUBSTATE_JOIN_REQ,
203 eCSR_ROAM_SUBSTATE_REASSOC_REQ,
204 eCSR_ROAM_SUBSTATE_DISASSOC_REQ,
205 eCSR_ROAM_SUBSTATE_STOP_BSS_REQ,
206 eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING, //Continue the current roam command after disconnect
207 eCSR_ROAM_SUBSTATE_AUTH_REQ,
208 eCSR_ROAM_SUBSTATE_CONFIG,
209 eCSR_ROAM_SUBSTATE_DEAUTH_REQ,
210 eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN,
211 eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE,
212 eCSR_ROAM_SUBSTATE_DISASSOC_FORCED,
Jeff Johnson295189b2012-06-20 16:38:30 -0700213 eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY,
214 eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF,
215 eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC,
216 eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC,
217 eCSR_ROAM_SUBSTATE_JOINED_REALTIME_TRAFFIC,
218// max is 15 unless the bitfield is expanded...
219} eCsrRoamSubState;
220
221
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800222typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700223{
224 eCSR_ROAMING_STATE_STOP = 0,
225 eCSR_ROAMING_STATE_IDLE,
226 eCSR_ROAMING_STATE_SCANNING,
227 eCSR_ROAMING_STATE_JOINING,
228 eCSR_ROAMING_STATE_JOINED,
229}eCsrRoamState;
230
231
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800232typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700233{
234 eCsrContinueRoaming,
235 eCsrStopRoaming,
236 eCsrStartIbss,
237 eCsrStartIbssSameIbss,
238 eCsrReassocToSelfNoCapChange,
Jeff Johnsone7245742012-09-05 17:12:55 -0700239 eCsrStopRoamingDueToConcurrency,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800240
Jeff Johnson295189b2012-06-20 16:38:30 -0700241}eCsrJoinState;
242
243typedef enum
244{
245 eCsrNotRoaming,
246 eCsrLostlinkRoamingDisassoc,
247 eCsrLostlinkRoamingDeauth,
248 eCsrDynamicRoaming,
249 eCsrReassocRoaming,
250}eCsrRoamingReason;
251
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800252typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700253{
254 eCsrDisassociated,
255 eCsrDeauthenticated
256
257}eCsrRoamWmStatusChangeTypes;
258
259typedef enum
260{
261 eCsrSummaryStats = 0,
262 eCsrGlobalClassAStats,
263 eCsrGlobalClassBStats,
264 eCsrGlobalClassCStats,
265 eCsrGlobalClassDStats,
266 eCsrPerStaStats,
267 eCsrMaxStats
268}eCsrRoamStatsClassTypes;
269
270#ifdef FEATURE_WLAN_DIAG_SUPPORT
271typedef enum
272{
273 eCSR_WLAN_STATUS_CONNECT =0,
274 eCSR_WLAN_STATUS_DISCONNECT
275
276}eCsrDiagWlanStatusEventSubtype;
277
278typedef enum
279{
280 eCSR_REASON_UNSPECIFIED = 0,
281 eCSR_REASON_USER_REQUESTED,
282 eCSR_REASON_MIC_ERROR,
283 eCSR_REASON_DISASSOC,
284 eCSR_REASON_DEAUTH,
285 eCSR_REASON_HANDOFF,
286
287}eCsrDiagWlanStatusEventReason;
288
289typedef enum
290{
291 eCSR_WLAN_HANDOFF_EVENT =0,
292
293}eCsrDiagWlanHandoffEventSubtype;
294
295typedef enum
296{
297 eCSR_WLAN_VCC_EVENT =0,
298
299}eCsrDiagWlanVccEventSubtype;
300
301#endif //FEATURE_WLAN_DIAG_SUPPORT
302
303typedef struct tagCsrChannel
304{
305 tANI_U8 numChannels;
306 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
307}tCsrChannel;
308
309typedef struct tagScanProfile
310{
311 tANI_U32 minChnTime;
312 tANI_U32 maxChnTime;
313 tANI_U32 restTime; //This is ignored if not associated
314 tANI_U32 numOfChannels;
315 tANI_U8 *pChannelList;
316 tSirScanType scanType; //active or passive
317 eCsrRoamBssType bssType; //BSS or IBSS
318 tANI_U8 ssid[WNI_CFG_SSID_LEN];
319 tANI_U8 bReturnAfter1stMatch;
320 tANI_U8 fUniqueResult;
321 tANI_U8 freshScan;
322 tCsrBssid bssid;
323}tScanProfile;
324
325typedef struct tagBssConfigParam
326{
327 eCsrMediaAccessType qosType;
328 tSirMacSSid SSID;
329 tANI_U32 uRTSThresh;
330 tANI_U32 uDeferThresh; //
331 eCsrCfgDot11Mode uCfgDot11Mode;
332 eCsrBand eBand;
333 tANI_U8 standardRate[CSR_DOT11_SUPPORTED_RATES_MAX];
334 tANI_U8 extendedRate[CSR_DOT11_EXTENDED_SUPPORTED_RATES_MAX];
335 eCsrExposedTxRate txRate;
336 tAniAuthType authType;
337 eCsrEncryptionType encType;
338 tANI_U32 uShortSlotTime;
339 tANI_U32 uHTSupport; //High throughput
340 tANI_U32 uPowerLimit;
341 tANI_U32 uHeartBeatThresh;
342 tANI_U32 uJoinTimeOut;
343 tSirMacCapabilityInfo BssCap;
344 tANI_BOOLEAN f11hSupport;
Jeff Johnsone7245742012-09-05 17:12:55 -0700345 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700346}tBssConfigParam;
347
348
349typedef struct tagCsrRoamStartBssParams
350{
351 tSirMacSSid ssId;
352 tCsrBssid bssid; //this is the BSSID for the party we want to join (only use for IBSS or WDS)
353 tSirNwType sirNwType;
Jeff Johnsone7245742012-09-05 17:12:55 -0700354 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700355 tSirMacRateSet operationalRateSet;
356 tSirMacRateSet extendedRateSet;
357 tANI_U8 operationChn;
358 eCsrCfgDot11Mode uCfgDot11Mode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700359 tANI_U8 privacy;
360 tANI_BOOLEAN fwdWPSPBCProbeReq;
361 tANI_BOOLEAN protEnabled;
362 tANI_BOOLEAN obssProtEnabled;
363 tAniAuthType authType;
364 tANI_U16 beaconInterval; //If this is 0, SME will fill in for caller.
365 tANI_U16 ht_protection;
366 tANI_U32 dtimPeriod;
367 tANI_U8 ApUapsdEnable;
368 tANI_U8 ssidHidden;
369 tANI_U8 wps_state;
Jeff Johnson295189b2012-06-20 16:38:30 -0700370 tVOS_CON_MODE bssPersona;
371 tANI_U16 nRSNIELength; //The byte count in the pRSNIE, if 0, pRSNIE is ignored.
372 tANI_U8 *pRSNIE; //If not null, it has the IE byte stream for RSN
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800373 tANI_BOOLEAN updatebeaconInterval; //Flag used to indicate update
374 // beaconInterval
Jeff Johnson295189b2012-06-20 16:38:30 -0700375}tCsrRoamStartBssParams;
376
377
378typedef struct tagScanCmd
379{
380 tANI_U32 scanID;
381 csrScanCompleteCallback callback;
382 void *pContext;
383 eCsrScanReason reason;
384 eCsrRoamState lastRoamState[CSR_ROAM_SESSION_MAX];
385 tCsrRoamProfile *pToRoamProfile;
386 tANI_U32 roamId; //this is the ID related to the pToRoamProfile
387 union
388 {
389 tCsrScanRequest scanRequest;
390 tCsrBGScanRequest bgScanRequest;
391 }u;
392}tScanCmd;
393
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800394typedef struct tagRoamCmd
Jeff Johnson295189b2012-06-20 16:38:30 -0700395{
396 tANI_U32 roamId;
397 eCsrRoamReason roamReason;
398 tCsrRoamProfile roamProfile;
399 tScanResultHandle hBSSList; //BSS list fits the profile
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800400 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 -0700401 tSirBssDescription *pLastRoamBss; //the last BSS we try and failed
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800402 tANI_BOOLEAN fReleaseBssList; //whether to free hBSSList
Jeff Johnson295189b2012-06-20 16:38:30 -0700403 tANI_BOOLEAN fReleaseProfile; //whether to free roamProfile
404 tANI_BOOLEAN fReassoc; //whether this command is for reassociation
405 tANI_BOOLEAN fUpdateCurRoamProfile; //whether pMac->roam.pCurRoamProfile needs to be updated
406 //this is for CSR internal used only. And it should not be assigned when creating the command
407 //This causes the roam command not to do anything.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800408 tANI_BOOLEAN fReassocToSelfNoCapChange;
Jeff Johnson295189b2012-06-20 16:38:30 -0700409
410 tANI_BOOLEAN fStopWds;
411 tSirMacAddr peerMac;
412 tSirMacReasonCodes reason;
413}tRoamCmd;
414
415typedef struct tagSetKeyCmd
416{
417 tANI_U32 roamId;
418 eCsrEncryptionType encType;
419 eCsrAuthType authType;
420 tAniKeyDirection keyDirection; //Tx, Rx or Tx-and-Rx
421 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
422 tANI_U8 paeRole; //0 for supplicant
423 tANI_U8 keyId; // Kye index
424 tANI_U8 keyLength; //Number of bytes containing the key in pKey
425 tANI_U8 Key[CSR_MAX_KEY_LEN];
426 tANI_U8 keyRsc[CSR_MAX_RSC_LEN];
427} tSetKeyCmd;
428
429typedef struct tahRemoveKeyCmd
430{
431 tANI_U32 roamId;
432 eCsrEncryptionType encType;
433 eCsrAuthType authType;
434 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
435 tANI_U8 keyId; //key index
436} tRemoveKeyCmd;
437
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800438typedef struct tagWmStatusChangeCmd
Jeff Johnson295189b2012-06-20 16:38:30 -0700439{
440 eCsrRoamWmStatusChangeTypes Type;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800441 union
442 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700443 tSirSmeDeauthInd DeauthIndMsg;
444 tSirSmeDisassocInd DisassocIndMsg;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800445 }u;
Jeff Johnson295189b2012-06-20 16:38:30 -0700446
447}tWmStatusChangeCmd;
448
449typedef struct tagAddStaForSessionCmd
450{
451 //Session self mac addr
452 tSirMacAddr selfMacAddr;
453}tAddStaForSessionCmd;
454
455typedef struct tagDelStaForSessionCmd
456{
457 //Session self mac addr
458 tSirMacAddr selfMacAddr;
459 csrRoamSessionCloseCallback callback;
460 void *pContext;
461}tDelStaForSessionCmd;
462
463//This structure represents one scan request
464typedef struct tagCsrCmd
465{
466 tListElem Link;
467 eCsrRoamCommands command;
468 tANI_U8 sessionId; // Session ID for this command
469 union
470 {
471 tScanCmd scanCmd;
472 tRoamCmd roamCmd;
473 tWmStatusChangeCmd wmStatusChangeCmd;
474 tSetKeyCmd setKeyCmd;
475 tRemoveKeyCmd removeKeyCmd;
476 tAddStaForSessionCmd addStaSessionCmd;
477 tDelStaForSessionCmd delStaSessionCmd;
478 }u;
479}tCsrCmd;
480
481#ifdef WLAN_FEATURE_VOWIFI_11R
482typedef struct tagCsr11rConfig
483{
484 tANI_BOOLEAN IsFTResourceReqSupported;
485} tCsr11rConfig;
486#endif
487
488#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
489typedef struct tagCsrNeighborRoamConfig
490{
491 tANI_U32 nNeighborScanTimerPeriod;
492 tANI_U8 nNeighborLookupRssiThreshold;
493 tANI_U8 nNeighborReassocRssiThreshold;
494 tANI_U16 nNeighborScanMinChanTime;
495 tANI_U16 nNeighborScanMaxChanTime;
496 sCsrChannel neighborScanChanList;
497 tANI_U8 nMaxNeighborRetries;
498 tANI_U16 nNeighborResultsRefreshPeriod;
Srinivas Girigowdade697412013-02-14 16:31:48 -0800499 tANI_U16 nEmptyScanRefreshPeriod;
Jeff Johnson295189b2012-06-20 16:38:30 -0700500}tCsrNeighborRoamConfig;
501#endif
502
503typedef struct tagCsrConfig
504{
505 tANI_U32 agingCount;
506 tANI_U32 FragmentationThreshold;
507 tANI_U32 channelBondingMode24GHz;
508 tANI_U32 channelBondingMode5GHz;
509 tANI_U32 RTSThreshold;
510 eCsrPhyMode phyMode;
511 eCsrCfgDot11Mode uCfgDot11Mode;
512 eCsrBand eBand;
513 tANI_U32 HeartbeatThresh50;
514 tANI_U32 HeartbeatThresh24;
515 tANI_U32 bgScanInterval;
516 eCsrCBChoice cbChoice;
517 eCsrBand bandCapability; //indicate hw capability
518 eCsrRoamWmmUserModeType WMMSupportMode;
519 tANI_BOOLEAN Is11eSupportEnabled;
520 tANI_BOOLEAN Is11dSupportEnabled;
521 tANI_BOOLEAN Is11dSupportEnabledOriginal;
522 tANI_BOOLEAN Is11hSupportEnabled;
523 tANI_BOOLEAN shortSlotTime;
524 tANI_BOOLEAN ProprietaryRatesEnabled;
525 tANI_BOOLEAN fenableMCCMode;
526 tANI_U16 TxRate;
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -0800527 tANI_U8 fAllowMCCGODiffBI;
Jeff Johnson295189b2012-06-20 16:38:30 -0700528 tANI_U8 AdHocChannel24;
529 tANI_U8 AdHocChannel5G;
530 tANI_U32 impsSleepTime; //in units of microseconds
531 tANI_U32 scanAgeTimeNCNPS; //scan result aging time threshold when Not-Connect-No-Power-Save, in seconds
532 tANI_U32 scanAgeTimeNCPS; //scan result aging time threshold when Not-Connect-Power-Save, in seconds
533 tANI_U32 scanAgeTimeCNPS; //scan result aging time threshold when Connect-No-Power-Save, in seconds,
534 tANI_U32 scanAgeTimeCPS; //scan result aging time threshold when Connect-Power-Savein seconds
535 tANI_U32 BssPreferValue[CSR_NUM_RSSI_CAT]; //each RSSI category has one value
536 int RSSICat[CSR_NUM_RSSI_CAT];
537 tANI_U8 bCatRssiOffset; //to set the RSSI difference for each category
538 tANI_U32 nRoamingTime; //In seconds, CSR will try this long before gives up, 0 means no roaming
539 //Whether to limit the channels to the ones set in Csr11dInfo. If true, the opertaional
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800540 //channels are limited to the default channel list. It is an "AND" operation between the
Jeff Johnson295189b2012-06-20 16:38:30 -0700541 //default channels and the channels in the 802.11d IE.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800542 tANI_BOOLEAN fEnforce11dChannels;
Jeff Johnson295189b2012-06-20 16:38:30 -0700543 //Country Code Priority
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800544 //0 = 802.11D > Configured Country > NV
Jeff Johnson295189b2012-06-20 16:38:30 -0700545 //1 = Configured Country > 802.11D > NV
546 tANI_BOOLEAN fSupplicantCountryCodeHasPriority;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800547 //When true, AP with unknown country code won't be see.
548 //"Unknown country code" means either Ap doesn't have 11d IE or we cannot
Jeff Johnson295189b2012-06-20 16:38:30 -0700549 //find a domain for the country code in its 11d IE.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800550 tANI_BOOLEAN fEnforceCountryCodeMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700551 //When true, only APs in the default domain can be seen. If the Ap has "unknown country
552 //code", or the doamin of the country code doesn't match the default domain, the Ap is
553 //not acceptable.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800554 tANI_BOOLEAN fEnforceDefaultDomain;
Jeff Johnson295189b2012-06-20 16:38:30 -0700555
556 tANI_U16 vccRssiThreshold;
557 tANI_U32 vccUlMacLossThreshold;
558
559 tANI_U32 nPassiveMinChnTime; //in units of milliseconds
560 tANI_U32 nPassiveMaxChnTime; //in units of milliseconds
561 tANI_U32 nActiveMinChnTime; //in units of milliseconds
562 tANI_U32 nActiveMaxChnTime; //in units of milliseconds
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800563
564 tANI_U32 nActiveMinChnTimeBtc; //in units of milliseconds
565 tANI_U32 nActiveMaxChnTimeBtc; //in units of milliseconds
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -0700566#ifdef WLAN_AP_STA_CONCURRENCY
567 tANI_U32 nPassiveMinChnTimeConc; //in units of milliseconds
568 tANI_U32 nPassiveMaxChnTimeConc; //in units of milliseconds
569 tANI_U32 nActiveMinChnTimeConc; //in units of milliseconds
570 tANI_U32 nActiveMaxChnTimeConc; //in units of milliseconds
571 tANI_U32 nRestTimeConc; //in units of milliseconds
Vinay Malekal05fdc812012-12-17 13:04:30 -0800572 tANI_U8 nNumChanCombinedConc; //number of channels combined
573 //in each split scan operation
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -0700574#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700575
576 tANI_BOOLEAN IsIdleScanEnabled;
577 //in dBm, the maximum TX power
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800578 //The actual TX power is the lesser of this value and 11d.
Jeff Johnson295189b2012-06-20 16:38:30 -0700579 //If 11d is disable, the lesser of this and default setting.
580 tANI_U8 nTxPowerCap;
581 tANI_U32 statsReqPeriodicity; //stats request frequency from PE while in full power
582 tANI_U32 statsReqPeriodicityInPS;//stats request frequency from PE while in power save
Jeff Johnson295189b2012-06-20 16:38:30 -0700583 tANI_U32 dtimPeriod;
584 tANI_BOOLEAN ssidHidden;
Jeff Johnson295189b2012-06-20 16:38:30 -0700585
586#ifdef WLAN_FEATURE_VOWIFI_11R
587 tCsr11rConfig csr11rConfig;
588#endif
589
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700590#ifdef FEATURE_WLAN_LFR
591 tANI_U8 isFastRoamIniFeatureEnabled;
592#endif
593
Jeff Johnson295189b2012-06-20 16:38:30 -0700594#ifdef FEATURE_WLAN_CCX
595 tANI_U8 isCcxIniFeatureEnabled;
596#endif
597
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700598#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Jeff Johnson295189b2012-06-20 16:38:30 -0700599 tANI_U8 isFastTransitionEnabled;
Jeff Johnson43971f52012-07-17 12:26:56 -0700600 tANI_U8 RoamRssiDiff;
Madan Mohan Koyyalamudi62b55b02012-12-03 16:45:39 -0800601 tANI_U8 nImmediateRoamRssiDiff;
Madan Mohan Koyyalamudid5026072012-11-30 14:56:21 -0800602 tANI_BOOLEAN nRoamPrefer5GHz;
Srinivas Girigowdabbd16eb2013-03-21 12:34:46 -0700603 tANI_BOOLEAN nRoamIntraBand;
Jeff Johnson295189b2012-06-20 16:38:30 -0700604#endif
605
606#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
607 tCsrNeighborRoamConfig neighborRoamConfig;
608#endif
609
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800610 /* Instead of Reassoc, send ADDTS/DELTS even when ACM is off for that AC
Jeff Johnson295189b2012-06-20 16:38:30 -0700611 * This is mandated by WMM-AC certification */
612 tANI_BOOLEAN addTSWhenACMIsOff;
613
614 tANI_BOOLEAN fValidateList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800615 //Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700616 //BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnsone7245742012-09-05 17:12:55 -0700617 tANI_BOOLEAN doBMPSWorkaround;
Jeff Johnson295189b2012-06-20 16:38:30 -0700618
619 //To enable/disable scanning 2.4Ghz channels twice on a single scan request from HDD
620 tANI_BOOLEAN fScanTwice;
Jeff Johnsone7245742012-09-05 17:12:55 -0700621#ifdef WLAN_FEATURE_11AC
622 tANI_U32 nVhtChannelWidth;
Shailender Karmuchi08f87c22013-01-17 12:51:24 -0800623 tANI_U8 txBFEnable;
Shailender Karmuchicc3fe442013-02-16 18:18:33 -0800624 tANI_U8 txBFCsnValue;
Jeff Johnsone7245742012-09-05 17:12:55 -0700625#endif
Gopichand Nakkalab2d2c312013-01-04 11:41:02 -0800626 tANI_U8 txLdpcEnable;
Jeff Johnson295189b2012-06-20 16:38:30 -0700627
628}tCsrConfig;
629
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800630typedef struct tagCsrChannelPowerInfo
Jeff Johnson295189b2012-06-20 16:38:30 -0700631{
632 tListElem link;
633 tANI_U8 firstChannel;
634 tANI_U8 numChannels;
635 tANI_U8 txPower;
636 tANI_U8 interChannelOffset;
637}tCsrChannelPowerInfo;
638
639typedef struct tagRoamJoinStatus
640{
641 tSirResultCodes statusCode;
642 //this is set to unspecified if statusCode indicates timeout. Or it is the failed reason from the other BSS(per 802.11 spec)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800643 tANI_U32 reasonCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700644}tCsrRoamJoinStatus;
645
646typedef struct tagCsrOsChannelMask
647{
648 tANI_U8 numChannels;
649 tANI_BOOLEAN scanEnabled[WNI_CFG_VALID_CHANNEL_LIST_LEN];
650 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
651}tCsrOsChannelMask;
652
653
654typedef struct tagCsrScanStruct
655{
656 tScanProfile scanProfile;
657 tANI_U32 nextScanID;
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700658 tDblLinkList scanResultList;
Jeff Johnson295189b2012-06-20 16:38:30 -0700659 tDblLinkList tempScanResults;
660 tANI_BOOLEAN fScanEnable;
661 tANI_BOOLEAN fFullScanIssued;
662 tPalTimerHandle hTimerGetResult;
663#ifdef WLAN_AP_STA_CONCURRENCY
664 tPalTimerHandle hTimerStaApConcTimer;
665#endif
666 tPalTimerHandle hTimerIdleScan;
667 tPalTimerHandle hTimerResultAging;
Sandeep Puligilla2b6dc632012-12-17 14:44:16 -0800668 tPalTimerHandle hTimerResultCfgAging;
Jeff Johnson295189b2012-06-20 16:38:30 -0700669 tPalTimerHandle hTimerBgScan;
670 //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 -0800671 tANI_U8 channelOf11dInfo;
672 tANI_U8 scanResultCfgAgingTime;
Jeff Johnson295189b2012-06-20 16:38:30 -0700673 //changes on every scan, a flag to tell whether conflict 11d info found on each BSS
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800674 tANI_BOOLEAN fAmbiguous11dInfoFound;
Jeff Johnson295189b2012-06-20 16:38:30 -0700675 //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 -0800676 tANI_BOOLEAN fCurrent11dInfoMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700677 tANI_BOOLEAN f11dInfoReset; //to indicate whether the 11d info in CFG is reset to default
678 tSirScanType curScanType;
679 tCsrChannel baseChannels; //This are all the supported channels AND(&) to the current eBand
680 tCsrChannel channels11d;
681 tChannelListWithPower defaultPowerTable[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
682 tChannelListWithPower defaultPowerTable40MHz[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
683 tANI_U32 numChannelsDefault; //total channels of NV
684 tCsrChannel base20MHzChannels; //The channel base to work on
685 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
686 tDblLinkList channelPowerInfoList24;
687 tDblLinkList channelPowerInfoList5G;
688 tANI_U32 nLastAgeTimeOut;
689 tANI_U32 nAgingCountDown;
Gopichand Nakkala114718f2013-03-25 19:19:46 -0700690 tANI_U8 countryCodeDefault[WNI_CFG_COUNTRY_CODE_LEN]; //The country code from NV
691 tANI_U8 countryCodeCurrent[WNI_CFG_COUNTRY_CODE_LEN];
692 tANI_U8 countryCode11d[WNI_CFG_COUNTRY_CODE_LEN];
Jeff Johnson295189b2012-06-20 16:38:30 -0700693 v_REGDOMAIN_t domainIdDefault; //default regulatory domain
694 v_REGDOMAIN_t domainIdCurrent; //current regulatory domain
695 tANI_BOOLEAN f11dInfoApplied;
696 tANI_BOOLEAN fCancelIdleScan;
697#ifdef FEATURE_WLAN_WAPI
698// tANI_U16 NumBkidCandidate;
699// tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED]; /* Move this as part of SessionEntry */
700#endif /* FEATURE_WLAN_WAPI */
701 tANI_U8 numBGScanChannel; //number of valid channels in the bgScanChannelList
702 tANI_U8 bgScanChannelList[WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN];
703 //the ChannelInfo member is not used in this structure.
704 //numBGScanChannel and bgScanChannelList are used for the BG scan channel info
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800705 tCsrBGScanRequest bgScanParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700706 tANI_BOOLEAN fRestartIdleScan;
707 tANI_U32 nIdleScanTimeGap; //the time since last trying to trigger idle scan
708 tCsrOsChannelMask osScanChannelMask;//keep a track of channels to be scnned while in traffic condition
709 tANI_U16 nBssLimit; //the maximum number of BSS in scan cache
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800710 /*channelPowerInfoList24 has been seen corrupted. Set this flag to true trying to
Jeff Johnson295189b2012-06-20 16:38:30 -0700711 * detect when it happens. Adding this into code because we can't reproduce it easily.
712 * We don't know when it happens. */
713 tANI_BOOLEAN fValidateList;
714 /*Customer wants to start with an active scan based on the default country code.
715 * This optimization will minimize the driver load to association time.
716 * Based on this flag we will bypass the initial passive scan needed for 11d
717 * to determine the country code & domain */
718 tANI_BOOLEAN fEnableBypass11d;
719
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800720 /*Customer wants to optimize the scan time. Avoiding scans(passive) on DFS
721 * channels while swipping through both bands can save some time
Jeff Johnson295189b2012-06-20 16:38:30 -0700722 * (apprx 1.3 sec) */
723 tANI_BOOLEAN fEnableDFSChnlScan;
724
Jeff Johnsone7245742012-09-05 17:12:55 -0700725 /*
726 * To enable/disable scanning only 2.4Ghz channels on first scan
727 */
728 tANI_BOOLEAN fFirstScanOnly2GChnl;
729
Jeff Johnson295189b2012-06-20 16:38:30 -0700730 tANI_BOOLEAN fDropScanCmd; //true means we don't accept scan commands
731
732#ifdef WLAN_AP_STA_CONCURRENCY
733 tDblLinkList scanCmdPendingList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800734#endif
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700735 tCsrChannel occupiedChannels; //This includes all channels on which candidate APs are found
Madan Mohan Koyyalamudi3f65e312012-11-06 15:31:12 -0800736
737 tANI_BOOLEAN fIgnore_chan165;
Jeff Johnson295189b2012-06-20 16:38:30 -0700738}tCsrScanStruct;
739
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800740#ifdef FEATURE_WLAN_TDLS_INTERNAL
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800741/*
742 * struct to carry TDLS discovery info..
743 */
744typedef struct sCsrTdlsContext
745{
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800746 tDblLinkList tdlsPotentialPeerList ;
747 tANI_U16 tdlsCommonFlag ;
748 tANI_U16 tdlsCommonState ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800749 tANI_U16 tdlsPeerCount ;
750}tCsrTdlsCtxStruct;
751
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800752typedef struct sCsrTdlsPeerLinkInfo
753{
754 tListElem tdlsPeerStaLink ;
755 tSirTdlsPeerInfo tdlsDisPeerInfo ;
756}tCsrTdlsPeerLinkinfo ;
757#endif
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800758
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800759
760
Jeff Johnson295189b2012-06-20 16:38:30 -0700761
762//Save the connected information. This structure + connectedProfile
763//should contain all information about the connection
764typedef struct tagRoamCsrConnectedInfo
765{
766 tANI_U32 nBeaconLength; //the length, in bytes, of the beacon frame, can be 0
767 tANI_U32 nAssocReqLength; //the length, in bytes, of the assoc req frame, can be 0
768 tANI_U32 nAssocRspLength; //The length, in bytes, of the assoc rsp frame, can be 0
769#ifdef WLAN_FEATURE_VOWIFI_11R
770 tANI_U32 nRICRspLength; //Length of the parsed RIC response IEs received in reassoc response
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800771#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700772#ifdef FEATURE_WLAN_CCX
773 tANI_U32 nTspecIeLength;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800774#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700775 tANI_U8 *pbFrames; //Point to a buffer contain the beacon, assoc req, assoc rsp frame, in that order
776 //user needs to use nBeaconLength, nAssocReqLength, nAssocRspLength to desice where
777 //each frame starts and ends.
778 tANI_U8 staId;
779}tCsrRoamConnectedInfo;
780
781
782typedef struct tagCsrLinkQualityIndInfo
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800783{
Jeff Johnson295189b2012-06-20 16:38:30 -0700784 csrRoamLinkQualityIndCallback callback;
785 void *context;
786}tCsrLinkQualityIndInfo;
787
788typedef struct tagCsrPeStatsReqInfo
789{
790 tListElem link; /* list links */
791 tANI_U32 statsMask;
792 tANI_U32 periodicity;
793 tANI_BOOLEAN rspPending;
794 vos_timer_t hPeStatsTimer;
795 tANI_BOOLEAN timerRunning;
796 tANI_U8 staId;
797 tANI_U8 numClient;
798 tpAniSirGlobal pMac;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800799 /* To remember if the peStats timer is stopped successfully or not */
Jeff Johnson295189b2012-06-20 16:38:30 -0700800 tANI_BOOLEAN timerStopFailed;
801
802}tCsrPeStatsReqInfo;
803
804typedef struct tagCsrStatsClientReqInfo
805{
806 tListElem link; /* list links */
807 eCsrStatsRequesterType requesterId;
808 tCsrStatsCallback callback;
809 tANI_U32 periodicity;
810 void *pContext;
811 tANI_U32 statsMask;
812 tCsrPeStatsReqInfo *pPeStaEntry;
813 tANI_U8 staId;
814 vos_timer_t timer;
815 tANI_BOOLEAN timerExpired;
816 tpAniSirGlobal pMac; // TODO: Confirm this change BTAMP
817}tCsrStatsClientReqInfo;
818
819typedef struct tagCsrTlStatsReqInfo
820{
821 tANI_U32 periodicity;
822 tANI_BOOLEAN timerRunning;
823 tPalTimerHandle hTlStatsTimer;
824 tANI_U8 numClient;
825}tCsrTlStatsReqInfo;
826
827typedef struct tagCsrRoamSession
828{
829 tANI_U8 sessionId; // Session ID
830 tANI_BOOLEAN sessionActive; // TRUE if it is used
831 tCsrBssid selfMacAddr; // For BT-AMP station, this serve as BSSID for self-BSS.
832 csrRoamCompleteCallback callback;
833 void *pContext;
834 eCsrConnectState connectState;
835 tCsrRoamConnectedProfile connectedProfile;
836 tCsrRoamConnectedInfo connectedInfo;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800837 tCsrRoamProfile *pCurRoamProfile;
Jeff Johnson295189b2012-06-20 16:38:30 -0700838 tSirBssDescription *pConnectBssDesc;
839 tANI_U16 NumPmkidCache;
840 tPmkidCacheInfo PmkidCacheInfo[CSR_MAX_PMKID_ALLOWED];
841 tANI_U8 cJoinAttemps;
842 //This may or may not have the up-to-date valid channel list
843 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
844 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
845 tANI_S32 sPendingCommands; //0 means CSR is ok to low power
846#ifdef FEATURE_WLAN_WAPI
847 tANI_U16 NumBkidCache;
848 tBkidCacheInfo BkidCacheInfo[CSR_MAX_BKID_ALLOWED];
849#endif /* FEATURE_WLAN_WAPI */
850 tANI_BOOLEAN fRoaming; //indicate whether CSR is roaming (either via lostlink or dynamic roaming)
851 //to remember some parameters needed for START_BSS.
852 //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 -0800853 tCsrRoamStartBssParams bssParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700854 tANI_U32 nWpaRsnReqIeLength; //the byte count of pWpaRsnIE;
855 tANI_U8 *pWpaRsnReqIE; //this contain the WPA/RSN IE in assoc request or the one sent in beacon (IBSS)
856 tANI_U32 nWpaRsnRspIeLength; //the byte count for pWpaRsnRspIE
857 tANI_U8 *pWpaRsnRspIE; //this contain the WPA/RSN IE in beacon/probe rsp
858#ifdef FEATURE_WLAN_WAPI
859 tANI_U32 nWapiReqIeLength; //the byte count of pWapiReqIE;
860 tANI_U8 *pWapiReqIE; //this contain the WAPI IE in assoc request or the one sent in beacon (IBSS)
861 tANI_U32 nWapiRspIeLength; //the byte count for pWapiRspIE
862 tANI_U8 *pWapiRspIE; //this contain the WAPI IE in beacon/probe rsp
863#endif /* FEATURE_WLAN_WAPI */
864 tANI_U32 nAddIEScanLength; //the byte count of pAddIeScanIE;
865 tANI_U8 *pAddIEScan; //this contains the additional IE in (unicast) probe request at the time of join
866 tANI_U32 nAddIEAssocLength; //the byte count for pAddIeAssocIE
867 tANI_U8 *pAddIEAssoc; //this contains the additional IE in (re) assoc request
868
869 tANI_TIMESTAMP roamingStartTime; //in units of 10ms
870 tCsrTimerInfo roamingTimerInfo;
871 eCsrRoamingReason roamingReason;
872 tANI_BOOLEAN fCancelRoaming;
873 tPalTimerHandle hTimerRoaming;
874 tPalTimerHandle hTimerIbssJoining;
875 tCsrTimerInfo ibssJoinTimerInfo;
876 tANI_BOOLEAN ibss_join_pending;
877 eCsrRoamResult roamResult; //the roamResult that is used when the roaming timer fires
878 tCsrRoamJoinStatus joinFailStatusCode; //This is the reason code for join(assoc) failure
879 //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 -0800880 tANI_U32 roamingStatusCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700881 tANI_U16 NumPmkidCandidate;
882 tPmkidCandidateInfo PmkidCandidateInfo[CSR_MAX_PMKID_ALLOWED];
883 #ifdef FEATURE_WLAN_WAPI
884 tANI_U16 NumBkidCandidate;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800885 tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED];
Jeff Johnson295189b2012-06-20 16:38:30 -0700886#endif
887 tANI_BOOLEAN fWMMConnection;
888#ifdef FEATURE_WLAN_BTAMP_UT_RF
889 //To retry a join later when it fails if so desired
890 tPalTimerHandle hTimerJoinRetry;
891 tCsrTimerInfo joinRetryTimerInfo;
892 tANI_U32 maxRetryCount;
893#endif
894#ifdef FEATURE_WLAN_CCX
895 tCsrCcxCckmInfo ccxCckmInfo;
896 tANI_BOOLEAN isPrevApInfoValid;
897 tSirMacSSid prevApSSID;
898 tCsrBssid prevApBssid;
899 tANI_U8 prevOpChannel;
900 tANI_U16 clientDissSecs;
901 tANI_U32 roamTS1;
902#endif
903 tANI_U8 bRefAssocStartCnt; //Tracking assoc start indication
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800904 /* to force the AP initiate fresh 802.1x authentication after re-association need to clear
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700905 * the PMKID cache. To clear the cache in this particular case this is added
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800906 * it is needed by the HS 2.0 passpoint certification 5.2.a and b testcases */
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700907 tANI_BOOLEAN fIgnorePMKIDCache;
Jeff Johnson295189b2012-06-20 16:38:30 -0700908} tCsrRoamSession;
909
910typedef struct tagCsrRoamStruct
911{
912 tANI_U32 nextRoamId;
913 tDblLinkList roamCmdPendingList;
914 tDblLinkList channelList5G;
915 tDblLinkList channelList24;
916 tCsrConfig configParam;
917 tANI_U32 numChannelsEeprom; //total channels of eeprom
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800918 tCsrChannel base20MHzChannels; //The channel base to work on
919 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
920 eCsrRoamState curState[CSR_ROAM_SESSION_MAX];
Jeff Johnson295189b2012-06-20 16:38:30 -0700921 eCsrRoamSubState curSubState[CSR_ROAM_SESSION_MAX];
922 //This may or may not have the up-to-date valid channel list
923 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
924 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
925 tANI_U32 numValidChannels; //total number of channels in CFG
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800926
Jeff Johnson295189b2012-06-20 16:38:30 -0700927 tANI_S32 sPendingCommands;
Jeff Johnson295189b2012-06-20 16:38:30 -0700928 tPalTimerHandle hTimerWaitForKey; //To support timeout for WaitForKey state
929 tCsrSummaryStatsInfo summaryStatsInfo;
930 tCsrGlobalClassAStatsInfo classAStatsInfo;
931 tCsrGlobalClassBStatsInfo classBStatsInfo;
932 tCsrGlobalClassCStatsInfo classCStatsInfo;
933 tCsrGlobalClassDStatsInfo classDStatsInfo;
934 tCsrPerStaStatsInfo perStaStatsInfo[CSR_MAX_STA];
935 tDblLinkList statsClientReqList;
936 tDblLinkList peStatsReqList;
937 tCsrTlStatsReqInfo tlStatsReqInfo;
938 eCsrRoamLinkQualityInd vccLinkQuality;
939 tCsrLinkQualityIndInfo linkQualityIndInfo;
940 v_CONTEXT_t gVosContext; //used for interaction with TL
941 //To specify whether an association or a IBSS is WMM enabled
942 //This parameter is only valid during a join or start BSS command is being executed
943 //tANI_BOOLEAN fWMMConnection; /* Moving it to be part of roamsession */
944 v_U8_t ucACWeights[WLANTL_MAX_AC];
945 /* TODO : Upto here */
946 tCsrTimerInfo WaitForKeyTimerInfo;
947 tCsrRoamSession *roamSession;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800948 tANI_U32 transactionId; // Current transaction ID for internal use.
949#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
Jeff Johnson295189b2012-06-20 16:38:30 -0700950 tCsrNeighborRoamControlInfo neighborRoamInfo;
951#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700952#ifdef FEATURE_WLAN_LFR
953 tANI_U8 isFastRoamIniFeatureEnabled;
954#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700955#ifdef FEATURE_WLAN_CCX
956 tANI_U8 isCcxIniFeatureEnabled;
957#endif
Jeff Johnson43971f52012-07-17 12:26:56 -0700958#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
959 tANI_U8 RoamRssiDiff;
960#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700961}tCsrRoamStruct;
962
963
964#define GET_NEXT_ROAM_ID(pRoamStruct) (((pRoamStruct)->nextRoamId + 1 == 0) ? 1 : (pRoamStruct)->nextRoamId)
965#define CSR_IS_ROAM_STATE(pMac, state, sessionId) ( (state) == (pMac)->roam.curState[sessionId] )
966
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800967#define CSR_IS_ROAM_STOP(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_STOP, sessionId )
968#define CSR_IS_ROAM_INIT(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_INIT, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -0700969#define CSR_IS_ROAM_SCANNING(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_SCANNING, sessionId )
970#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 -0800971#define CSR_IS_ROAM_IDLE(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_IDLE, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -0700972#define CSR_IS_ROAM_JOINED(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_JOINED, sessionId )
973
974#define CSR_IS_ROAM_SUBSTATE(pMac, subState, sessionId) ((subState) == (pMac)->roam.curSubState[sessionId])
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800975#define CSR_IS_ROAM_SUBSTATE_JOIN_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOIN_REQ, sessionId)
976#define CSR_IS_ROAM_SUBSTATE_AUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_AUTH_REQ, sessionId)
977#define CSR_IS_ROAM_SUBSTATE_REASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_REASSOC_REQ, sessionId)
978#define CSR_IS_ROAM_SUBSTATE_DISASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REQ, sessionId)
979#define CSR_IS_ROAM_SUBSTATE_DISASSOC_NO_JOIN(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN, sessionId)
980#define CSR_IS_ROAM_SUBSTATE_REASSOC_FAIL(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE, sessionId)
981#define CSR_IS_ROAM_SUBSTATE_DISASSOC_FORCED(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_FORCED, sessionId)
982#define CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DEAUTH_REQ, sessionId)
983#define CSR_IS_ROAM_SUBSTATE_START_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_START_BSS_REQ, sessionId)
984#define CSR_IS_ROAM_SUBSTATE_STOP_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_STOP_BSS_REQ, sessionId)
985#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 -0700986#define CSR_IS_ROAM_SUBSTATE_CONFIG(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_CONFIG, sessionId)
987#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 -0800988#define CSR_IS_ROAM_SUBSTATE_DISASSOC_HO(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF, sessionId)
989#define CSR_IS_ROAM_SUBSTATE_HO_NT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC, sessionId)
990#define CSR_IS_ROAM_SUBSTATE_HO_NRT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC, sessionId)
991#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 -0700992
993#define CSR_IS_PHY_MODE_B_ONLY(pMac) \
994 ((eCSR_DOT11_MODE_11b == (pMac)->roam.configParam.phyMode) ||\
995 (eCSR_DOT11_MODE_11b_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800996
Jeff Johnson295189b2012-06-20 16:38:30 -0700997#define CSR_IS_PHY_MODE_G_ONLY(pMac) \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800998 (eCSR_DOT11_MODE_11g == (pMac)->roam.configParam.phyMode || eCSR_DOT11_MODE_11g_ONLY == (pMac)->roam.configParam.phyMode)
999
Jeff Johnson295189b2012-06-20 16:38:30 -07001000#define CSR_IS_PHY_MODE_A_ONLY(pMac) \
1001 ((eCSR_DOT11_MODE_11a == (pMac)->roam.configParam.phyMode) ||\
1002 (eCSR_DOT11_MODE_11a_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001003
Jeff Johnsone7245742012-09-05 17:12:55 -07001004#ifdef WLAN_FEATURE_11AC
1005#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1006 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1007 (eCSR_DOT11_MODE_11ac & (phyMode)) || \
1008 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1009 (eCSR_DOT11_MODE_AUTO & (phyMode)))
1010#else
Jeff Johnson295189b2012-06-20 16:38:30 -07001011#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1012 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1013 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1014 (eCSR_DOT11_MODE_AUTO & (phyMode)))
Jeff Johnsone7245742012-09-05 17:12:55 -07001015#endif
1016
Jeff Johnson295189b2012-06-20 16:38:30 -07001017
1018// this function returns TRUE if the NIC is operating exclusively in the 2.4 GHz band, meaning
1019// it is NOT operating in the 5.0 GHz band.
1020#define CSR_IS_24_BAND_ONLY(pMac) \
1021 (eCSR_BAND_24 == (pMac)->roam.configParam.eBand)
1022
1023#define CSR_IS_5G_BAND_ONLY(pMac) \
1024 (eCSR_BAND_5G == (pMac)->roam.configParam.eBand)
1025
1026#define CSR_IS_RADIO_DUAL_BAND(pMac) \
1027 (eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability)
1028
1029#define CSR_IS_RADIO_BG_ONLY(pMac) \
1030 (eCSR_BAND_24 == (pMac)->roam.configParam.bandCapability)
1031
1032// this function returns TRUE if the NIC is operating exclusively in the 5.0 GHz band, meaning
1033// it is NOT operating in the 2.4 GHz band
1034#define CSR_IS_RADIO_A_ONLY(pMac) \
1035 (eCSR_BAND_5G == (pMac)->roam.configParam.bandCapability)
1036
1037// this function returns TRUE if the NIC is operating in both bands.
1038#define CSR_IS_OPEARTING_DUAL_BAND(pMac) \
1039 ((eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability) && (eCSR_BAND_ALL == (pMac)->roam.configParam.eBand))
1040
1041// this function returns TRUE if the NIC can operate in the 5.0 GHz band (could operate in the
1042// 2.4 GHz band also).
1043#define CSR_IS_OPERATING_A_BAND(pMac) \
1044 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_A_ONLY((pMac)) || CSR_IS_5G_BAND_ONLY((pMac)))
1045
1046// this function returns TRUE if the NIC can operate in the 2.4 GHz band (could operate in the
1047// 5.0 GHz band also).
1048#define CSR_IS_OPERATING_BG_BAND(pMac) \
1049 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_BG_ONLY((pMac)) || CSR_IS_24_BAND_ONLY((pMac)))
1050
1051#define CSR_IS_CHANNEL_5GHZ(chnNum) \
Jeff Johnsone7245742012-09-05 17:12:55 -07001052 (((chnNum) >= CSR_MIN_5GHz_CHANNEL_NUMBER) && ((chnNum) <= CSR_MAX_5GHz_CHANNEL_NUMBER))
Jeff Johnson295189b2012-06-20 16:38:30 -07001053
Srinivas Girigowdade697412013-02-14 16:31:48 -08001054#define CSR_IS_CHANNEL_DFS(chnNum) \
1055 (NV_CHANNEL_ENABLE != vos_nv_getChannelEnabledState(chnNum))
1056
Jeff Johnson295189b2012-06-20 16:38:30 -07001057#define CSR_IS_CHANNEL_24GHZ(chnNum) \
1058 (((chnNum) > 0) && ((chnNum) <= CSR_MAX_24GHz_CHANNEL_NUMBER))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001059
Jeff Johnson295189b2012-06-20 16:38:30 -07001060#define CSR_IS_SAME_BAND_CHANNELS(ch1, ch2) (CSR_IS_CHANNEL_5GHZ(ch1) == CSR_IS_CHANNEL_5GHZ(ch2))
1061
1062
1063#define CSR_IS_11D_INFO_FOUND(pMac) \
1064 (0 != (pMac)->scan.channelOf11dInfo)
1065// DEAUTHIND
1066#define CSR_IS_ROAMING(pSession) ((CSR_IS_LOSTLINK_ROAMING((pSession)->roamingReason)) || \
1067 (eCsrDynamicRoaming == (pSession)->roamingReason) || \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001068 (eCsrReassocRoaming == (pSession)->roamingReason))
Jeff Johnson295189b2012-06-20 16:38:30 -07001069
1070
1071#define CSR_IS_SET_KEY_COMMAND( pCommand ) ( eSmeCommandSetKey == (pCommand)->command )
1072
1073#define CSR_IS_ADDTS_WHEN_ACMOFF_SUPPORTED(pMac) (pMac->roam.configParam.addTSWhenACMIsOff)
1074// DEAUTHIND
1075#define CSR_IS_LOSTLINK_ROAMING(reason) ((eCsrLostlinkRoamingDisassoc == (reason)) || (eCsrLostlinkRoamingDeauth == (reason)))
1076
1077//Stop CSR from asking for IMPS, This function doesn't disable IMPS from CSR
1078void csrScanSuspendIMPS( tpAniSirGlobal pMac );
1079//Start CSR from asking for IMPS. This function doesn't trigger CSR to request entering IMPS
1080//because IMPS maybe disabled.
1081void csrScanResumeIMPS( tpAniSirGlobal pMac );
1082
1083eHalStatus csrInitGetChannels(tpAniSirGlobal pMac);
Venkata Prathyusha Kuntupalli316247e2013-03-15 17:45:25 -07001084// Getting the 5GHz Channel list
1085eHalStatus csrGet5GChannels(tpAniSirGlobal pMac);
1086// Getting the 2.4GHz Channel list
1087eHalStatus csrGet24GChannels(tpAniSirGlobal pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001088
1089eHalStatus csrSetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1090 tCsrRoamModifyProfileFields *pModifyProfileFields);
1091/* ---------------------------------------------------------------------------
1092 \fn csrGetModifyProfileFields
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001093 \brief HDD or SME - QOS calls this function to get the current values of
Jeff Johnson295189b2012-06-20 16:38:30 -07001094 connected profile fields changing which can cause reassoc.
1095 This function must be called after CFG is downloaded and STA is in connected
1096 state.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001097 \param pModifyProfileFields - pointer to the connected profile fields
Jeff Johnson295189b2012-06-20 16:38:30 -07001098 changing which can cause reassoc
1099
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001100 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001101 -------------------------------------------------------------------------------*/
1102eHalStatus csrGetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1103 tCsrRoamModifyProfileFields * pModifyProfileFields);
1104void csrSetGlobalCfgs( tpAniSirGlobal pMac );
1105void csrSetDefaultDot11Mode( tpAniSirGlobal pMac );
1106void csrScanSetChannelMask(tpAniSirGlobal pMac, tCsrChannelInfo *pChannelInfo);
1107tANI_BOOLEAN csrIsConnStateDisconnected(tpAniSirGlobal pMac, tANI_U32 sessionId);
1108tANI_BOOLEAN csrIsConnStateConnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1109tANI_BOOLEAN csrIsConnStateDisconnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1110tANI_BOOLEAN csrIsConnStateConnectedInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1111tANI_BOOLEAN csrIsConnStateConnected( tpAniSirGlobal pMac, tANI_U32 sessionId );
1112tANI_BOOLEAN csrIsConnStateInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1113tANI_BOOLEAN csrIsConnStateIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1114tANI_BOOLEAN csrIsConnStateWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1115tANI_BOOLEAN csrIsConnStateConnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1116tANI_BOOLEAN csrIsConnStateDisconnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1117tANI_BOOLEAN csrIsAnySessionInConnectState( tpAniSirGlobal pMac );
1118tANI_BOOLEAN csrIsAllSessionDisconnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudi48081ef2012-12-04 16:49:55 -08001119tANI_BOOLEAN csrIsStaSessionConnected( tpAniSirGlobal pMac );
1120tANI_BOOLEAN csrIsP2pSessionConnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudid3d22592012-09-24 14:01:29 -07001121tANI_BOOLEAN csrIsAnySessionConnected( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001122tANI_BOOLEAN csrIsInfraConnected( tpAniSirGlobal pMac );
1123tANI_BOOLEAN csrIsConcurrentInfraConnected( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001124tANI_BOOLEAN csrIsConcurrentSessionRunning( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001125tANI_BOOLEAN csrIsInfraApStarted( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001126tANI_BOOLEAN csrIsIBSSStarted( tpAniSirGlobal pMac );
1127tANI_BOOLEAN csrIsBTAMPStarted( tpAniSirGlobal pMac );
1128tANI_BOOLEAN csrIsBTAMP( tpAniSirGlobal pMac, tANI_U32 sessionId );
1129eHalStatus csrIsBTAMPAllowed( tpAniSirGlobal pMac, tANI_U32 chnId );
Jeff Johnsone7245742012-09-05 17:12:55 -07001130tANI_BOOLEAN csrIsValidMcConcurrentSession(tpAniSirGlobal pMac, tANI_U32 sessionId,
1131 tSirBssDescription *pBssDesc);
Jeff Johnson295189b2012-06-20 16:38:30 -07001132tANI_BOOLEAN csrIsConnStateConnectedInfraAp( tpAniSirGlobal pMac, tANI_U32 sessionId );
Jeff Johnson295189b2012-06-20 16:38:30 -07001133/*----------------------------------------------------------------------------
1134 \fn csrRoamRegisterLinkQualityIndCallback
1135
1136 \brief
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001137 a CSR function to allow HDD to register a callback handler with CSR for
1138 link quality indications.
Jeff Johnson295189b2012-06-20 16:38:30 -07001139
1140 Only one callback may be registered at any time.
1141 In order to deregister the callback, a NULL cback may be provided.
1142
1143 Registration happens in the task context of the caller.
1144
1145 \param callback - Call back being registered
1146 \param pContext - user data
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001147
Jeff Johnson295189b2012-06-20 16:38:30 -07001148 DEPENDENCIES: After CSR open
1149
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001150 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001151-----------------------------------------------------------------------------*/
1152eHalStatus csrRoamRegisterLinkQualityIndCallback(tpAniSirGlobal pMac,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001153 csrRoamLinkQualityIndCallback callback,
Jeff Johnson295189b2012-06-20 16:38:30 -07001154 void *pContext);
1155/* ---------------------------------------------------------------------------
1156 \fn csrGetStatistics
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001157 \brief csr function that client calls to register a callback to get
1158 different PHY level statistics from CSR.
1159
Jeff Johnson295189b2012-06-20 16:38:30 -07001160 \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc
1161 \param statsMask - The different category/categories of stats requester is looking for
1162 \param callback - SME sends back the requested stats using the callback
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001163 \param periodicity - If requester needs periodic update, 0 means it's an one
Jeff Johnson295189b2012-06-20 16:38:30 -07001164 time request
1165 \param cache - If requester is happy with cached stats
1166 \param staId - The station ID for which the stats is requested for
1167 \param pContext - user context to be passed back along with the callback
1168
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001169 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001170 ---------------------------------------------------------------------------*/
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001171eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requesterId,
1172 tANI_U32 statsMask,
1173 tCsrStatsCallback callback,
1174 tANI_U32 periodicity, tANI_BOOLEAN cache,
Jeff Johnson295189b2012-06-20 16:38:30 -07001175 tANI_U8 staId, void *pContext);
1176
1177
1178eHalStatus csrGetRssi(tpAniSirGlobal pMac,tCsrRssiCallback callback,tANI_U8 staId,tCsrBssid bssId,void * pContext,void * pVosContext);
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08001179#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1180eHalStatus csrGetRoamRssi(tpAniSirGlobal pMac,
1181 tCsrRssiCallback callback,
1182 tANI_U8 staId,
1183 tCsrBssid bssId,
1184 void * pContext,
1185 void * pVosContext);
1186#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001187eHalStatus csrRoamRegisterCallback(tpAniSirGlobal pMac, csrRoamCompleteCallback callback, void *pContext);
1188/* ---------------------------------------------------------------------------
1189 \fn csrGetConfigParam
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001190 \brief HDD calls this function to get the global settings currently maintained by CSR.
Jeff Johnson295189b2012-06-20 16:38:30 -07001191 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001192 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001193 -------------------------------------------------------------------------------*/
1194eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1195
1196/* ---------------------------------------------------------------------------
1197 \fn csrMsgProcessor
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001198 \brief HDD calls this function to change some global settings.
Jeff Johnson295189b2012-06-20 16:38:30 -07001199 caller must set the all fields or call csrGetConfigParam to prefill the fields.
1200 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001201 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001202 -------------------------------------------------------------------------------*/
1203eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1204
1205
1206/* ---------------------------------------------------------------------------
1207 \fn csrMsgProcessor
1208 \brief HDD calls this function for the messages that are handled by CSR.
1209 \param pMsgBuf - a pointer to a buffer that maps to various structures base on the message type.
1210 The beginning of the buffer can always map to tSirSmeRsp.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001211 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001212 -------------------------------------------------------------------------------*/
1213eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf );
1214
1215/* ---------------------------------------------------------------------------
1216 \fn csrOpen
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001217 \brief This function must be called before any API call to CSR.
1218 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001219 -------------------------------------------------------------------------------*/
1220eHalStatus csrOpen(tpAniSirGlobal pMac);
1221/* ---------------------------------------------------------------------------
1222 \fn csrClose
1223 \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 -08001224 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001225 -------------------------------------------------------------------------------*/
1226eHalStatus csrClose(tpAniSirGlobal pMac);
1227/* ---------------------------------------------------------------------------
1228 \fn csrStart
1229 \brief To start CSR.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001230 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001231 -------------------------------------------------------------------------------*/
1232eHalStatus csrStart(tpAniSirGlobal pMac);
1233/* ---------------------------------------------------------------------------
1234 \fn csrStop
1235 \brief To stop CSR. CSR still keeps its current setting.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001236 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001237 -------------------------------------------------------------------------------*/
1238eHalStatus csrStop(tpAniSirGlobal pMac);
1239/* ---------------------------------------------------------------------------
1240 \fn csrReady
1241 \brief To let CSR is ready to operate
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001242 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001243 -------------------------------------------------------------------------------*/
1244eHalStatus csrReady(tpAniSirGlobal pMac);
1245
1246#ifdef FEATURE_WLAN_WAPI
1247eHalStatus csrRoamGetBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pNum,
1248 tBkidCacheInfo *pBkidCache);
1249
1250
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001251eHalStatus csrScanGetBKIDCandidateList(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001252 tBkidCandidateInfo *pBkidList, tANI_U32 *pNumItems );
1253tANI_U32 csrRoamGetNumBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId);
1254eHalStatus csrRoamSetBKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache,
1255 tANI_U32 numItems );
1256/* ---------------------------------------------------------------------------
1257 \fn csrRoamGetWapiReqIE
1258 \brief return the WAPI IE CSR passes to PE to JOIN request or START_BSS request
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001259 \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 -07001260 needed or IE length in pBuf.
1261 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1262 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1263 -------------------------------------------------------------------------------*/
1264eHalStatus csrRoamGetWapiReqIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
1265
1266/* ---------------------------------------------------------------------------
1267 \fn csrRoamGetWapiRspIE
1268 \brief return the WAPI IE from the beacon or probe rsp if connected
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001269 \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 -07001270 needed or IE length in pBuf.
1271 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1272 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1273 -------------------------------------------------------------------------------*/
1274eHalStatus csrRoamGetWapiRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001275tANI_U8 csrConstructWapiIe( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
Jeff Johnson295189b2012-06-20 16:38:30 -07001276 tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes, tCsrWapiIe *pWapiIe );
1277#endif /* FEATURE_WLAN_WAPI */
1278
Jeff Johnson295189b2012-06-20 16:38:30 -07001279eHalStatus csrRoamUpdateAPWPSIE( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirAPWPSIEs *pAPWPSIES );
1280eHalStatus csrRoamUpdateWPARSNIEs( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirRSNie * pAPSirRSNie);
Jeff Johnson295189b2012-06-20 16:38:30 -07001281void csrSetCfgPrivacy( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, tANI_BOOLEAN fPrivacy );
1282tANI_S8 csrGetInfraSessionId( tpAniSirGlobal pMac );
1283tANI_U8 csrGetInfraOperationChannel( tpAniSirGlobal pMac, tANI_U8 sessionId);
1284tANI_U8 csrGetConcurrentOperationChannel( tpAniSirGlobal pMac );
1285
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001286eHalStatus csrRoamCopyConnectProfile(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001287 tCsrRoamConnectedProfile *pProfile);
1288tANI_BOOLEAN csrIsSetKeyAllowed(tpAniSirGlobal pMac, tANI_U32 sessionId);
1289
1290void csrSetOppositeBandChannelInfo( tpAniSirGlobal pMac );
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001291void csrConstructCurrentValidChannelList( tpAniSirGlobal pMac, tDblLinkList *pChannelSetList,
Jeff Johnson295189b2012-06-20 16:38:30 -07001292 tANI_U8 *pChannelList, tANI_U8 bSize, tANI_U8 *pNumChannels );
1293
1294#endif
1295
1296#ifdef WLAN_FEATURE_VOWIFI_11R
1297//Returns whether the current association is a 11r assoc or not
1298tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac);
1299#endif
1300
1301#ifdef FEATURE_WLAN_CCX
1302//Returns whether the current association is a CCX assoc or not
1303tANI_BOOLEAN csrRoamIsCCXAssoc(tpAniSirGlobal pMac);
1304#endif
1305
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001306//Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -07001307//BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnson295189b2012-06-20 16:38:30 -07001308void csrDisconnectAllActiveSessions(tpAniSirGlobal pMac);
Mohit Khanna349bc392012-09-11 17:24:52 -07001309
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001310#ifdef FEATURE_WLAN_LFR
1311//Returns whether "Legacy Fast Roaming" is enabled...or not
Madan Mohan Koyyalamudi03aae5f2012-11-28 01:51:22 +05301312tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac, tANI_U32 sessionId);
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -07001313tANI_BOOLEAN csrIsChannelPresentInList( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
1314VOS_STATUS csrAddToChannelListFront( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001315#endif
1316