blob: d617d8ccba7f56bc9b0b2600a5967ce8888ac3de [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala9c070ad2013-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 Lokere30b07722013-02-24 22:21:28 -080042/** ------------------------------------------------------------------------- *
43 ------------------------------------------------------------------------- *
Jeff Johnson295189b2012-06-20 16:38:30 -070044
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -080045
Jeff Johnson295189b2012-06-20 16:38:30 -070046 \file csrInternal.h
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -080047
Jeff Johnson295189b2012-06-20 16:38:30 -070048 Define internal data structure for MAC.
Kiran Kumar Lokere30b07722013-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
55#if defined(VOSS_ENABLED)
56#include "vos_status.h"
57#include "vos_lock.h"
58#endif //#if defined(VOSS_ENABLED)
59
60#include "palTimer.h"
61#include "csrSupport.h"
62#include "vos_nvitem.h"
63#include "wlan_qct_tl.h"
64
65#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
66#include "csrNeighborRoam.h"
67#endif
68
69#define CSR_MAX_STA (HAL_NUM_STA)
70
71#define CSR_SME_SCAN_FLAGS_DELETE_CACHE 0x80
72
73#define CSR_TITAN_MAX_RATE_MIMO_CB 240
74#define CSR_TITAN_MAX_RATE_MIMO 126
75
76//define scan return criteria. LIM should use these define as well
77#define CSR_SCAN_RETURN_AFTER_ALL_CHANNELS ( 0 )
78#define CSR_SCAN_RETURN_AFTER_FIRST_MATCH ( 0x01 )
79#define CSR_SCAN_RETURN_AFTER_5_BAND_11d_FOUND ( 0x80 )
80#define CSR_SCAN_RETURN_AFTER_24_BAND_11d_FOUND ( 0x40 )
81#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 -070082#define CSR_NUM_RSSI_CAT 15
Jeff Johnson295189b2012-06-20 16:38:30 -070083#define CSR_MAX_STATISTICS_REQ 10
84
85//Support for multiple session
86#define CSR_SESSION_ID_INVALID 0xFF // session ID invalid
87#define CSR_ROAM_SESSION_MAX 5 // No of sessions to be supported, and a
88 // session is for Infra, IBSS or BT-AMP
89
90#define CSR_IS_SESSION_VALID( pMac, sessionId ) ( ( (sessionId) < CSR_ROAM_SESSION_MAX ) \
91 && ( (pMac)->roam.roamSession[(sessionId)].sessionActive ) )
92#define CSR_GET_SESSION( pMac, sessionId ) \
93( \
94 (sessionId < CSR_ROAM_SESSION_MAX) ? \
95 (&(pMac)->roam.roamSession[(sessionId)]) :\
96 NULL \
97)
98
Madan Mohan Koyyalamudic4c01172012-11-30 14:56:21 -080099#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
100#define CSR_IS_ROAM_PREFER_5GHZ( pMac ) \
101( \
102 (((pMac)->roam.configParam.nRoamPrefer5GHz)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
103)
104#endif
105
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700106//Support for "Fast roaming" (i.e., CCX, LFR, or 802.11r.)
107#define CSR_BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN 15
Jeff Johnson295189b2012-06-20 16:38:30 -0700108
109typedef enum
110{
111 //eCSR_CFG_DOT11_MODE_BEST = 0,
112 eCSR_CFG_DOT11_MODE_TAURUS = 0,
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800113 eCSR_CFG_DOT11_MODE_ABG,
114 eCSR_CFG_DOT11_MODE_11A,
115 eCSR_CFG_DOT11_MODE_11B,
116 eCSR_CFG_DOT11_MODE_11G,
117 eCSR_CFG_DOT11_MODE_11N,
118 eCSR_CFG_DOT11_MODE_POLARIS,
119 eCSR_CFG_DOT11_MODE_TITAN,
Jeff Johnsone7245742012-09-05 17:12:55 -0700120#ifdef WLAN_FEATURE_11AC
121 eCSR_CFG_DOT11_MODE_11AC,
122#endif
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800123 eCSR_CFG_DOT11_MODE_11G_ONLY,
124 eCSR_CFG_DOT11_MODE_11N_ONLY,
Jeff Johnsone7245742012-09-05 17:12:55 -0700125#ifdef WLAN_FEATURE_11AC
126 eCSR_CFG_DOT11_MODE_11AC_ONLY,
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800127#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700128 //This value can never set to CFG. It is for CSR's internal use
129 eCSR_CFG_DOT11_MODE_AUTO,
130}eCsrCfgDot11Mode; //Used to determine what to set to the WNI_CFG_DOT11_MODE
131
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800132typedef enum etCsrRoamCommands
Jeff Johnson295189b2012-06-20 16:38:30 -0700133{
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800134 eCsrRoamNoCommand,
Jeff Johnson295189b2012-06-20 16:38:30 -0700135 eCsrRoamCommandScan,
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800136 eCsrRoamCommandRoam,
137 eCsrRoamCommandWmStatusChange,
Jeff Johnson295189b2012-06-20 16:38:30 -0700138 eCsrRoamCommandSetKey,
139 eCsrRoamCommandRemoveKey,
140
141} eCsrRoamCommands;
142
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800143typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700144{
145 eCsrScanOther = 1,
146 eCsrScanLostLink1,
147 eCsrScanLostLink2,
148 eCsrScanLostLink3,
149 eCsrScanLostLink4,
150 eCsrScan11d1, //First 11d scan
151 eCsrScan11d2, //First 11d scan has failed
152 eCsrScan11dDone, //11d scan succeeded, try the rest of the channel
153 eCsrScanUserRequest,
154 eCsrScanGetResult,
155 eCsrScanSetBGScanParam, //used for HO too - bg scan request in NT Handoff sub-state
156 eCsrScanForSsid,
157 eCsrScanForCapsChange,
158 eCsrScanBGScanAbort,
159 eCsrScanBGScanEnable,
160 eCsrScanIdleScan,
161 eCsrScanGetScanChnInfo, //To get the list of channels scanned
162
163 eCsrScanBgScan, // bg scan request in NRT & RT Handoff sub-states
164 eCsrScanProbeBss, // directed probe on an entry from the candidate list - HO
165 eCsrScanAbortBgScan, //aborting a BG scan (meaning the scan is triggered by LIM timer)
166 eCsrScanAbortNormalScan, //aborting a normal scan (the scan is trigger by eWNI_SME_SCAN_REQ)
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800167 eCsrScanP2PFindPeer
Jeff Johnson295189b2012-06-20 16:38:30 -0700168}eCsrScanReason;
169
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800170typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700171{
172 eCsrNoConnection, // Roaming because we have not established the initial connection.
173 eCsrCapsChange, // roaming because LIM reported a Capability change in the associated AP.
174 eCsrForcedDisassoc, // roaming becuase someone asked us to Disassoc and stay disassociated.
175 eCsrHddIssued, // roaming because an 802.11 request was issued to the driver.
176 eCsrLostLink1, // roaming because we lost link to an associated AP
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800177 eCsrLostLink2,
Jeff Johnson295189b2012-06-20 16:38:30 -0700178 eCsrLostLink3,
179 eCsrForcedDisassocMICFailure, // roaming because we need to force a Disassoc due to MIC failure
180 eCsrHddIssuedReassocToSameAP,
181 eCsrSmeIssuedReassocToSameAP,
182 eCsrSmeIssuedReassocToDiffAP,
183 eCsrForcedDeauth, // roaming becuase someone asked us to deauth and stay disassociated.
184 eCsrSmeIssuedDisassocForHandoff, // will be issued by Handoff logic to disconect from current AP
185 eCsrSmeIssuedAssocToSimilarAP, // will be issued by Handoff logic to join a new AP with same profile
186 eCsrSmeIssuedIbssJoinFailure, // ibss join timer fired before any perr showed up, so shut down the network
187 eCsrForcedIbssLeave,
188 eCsrStopBss,
189 eCsrSmeIssuedFTReassoc,
190 eCsrForcedDisassocSta,
191 eCsrForcedDeauthSta,
Madan Mohan Koyyalamudi286b60e2012-10-11 12:59:07 -0700192 eCsrPerformPreauth,
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800193
Jeff Johnson295189b2012-06-20 16:38:30 -0700194}eCsrRoamReason;
195
196typedef enum
197{
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800198 eCSR_ROAM_SUBSTATE_NONE = 0,
199 eCSR_ROAM_SUBSTATE_START_BSS_REQ,
200 eCSR_ROAM_SUBSTATE_JOIN_REQ,
201 eCSR_ROAM_SUBSTATE_REASSOC_REQ,
202 eCSR_ROAM_SUBSTATE_DISASSOC_REQ,
203 eCSR_ROAM_SUBSTATE_STOP_BSS_REQ,
204 eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING, //Continue the current roam command after disconnect
205 eCSR_ROAM_SUBSTATE_AUTH_REQ,
206 eCSR_ROAM_SUBSTATE_CONFIG,
207 eCSR_ROAM_SUBSTATE_DEAUTH_REQ,
208 eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN,
209 eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE,
210 eCSR_ROAM_SUBSTATE_DISASSOC_FORCED,
Jeff Johnson295189b2012-06-20 16:38:30 -0700211 eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY,
212 eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF,
213 eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC,
214 eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC,
215 eCSR_ROAM_SUBSTATE_JOINED_REALTIME_TRAFFIC,
216// max is 15 unless the bitfield is expanded...
217} eCsrRoamSubState;
218
219
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800220typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700221{
222 eCSR_ROAMING_STATE_STOP = 0,
223 eCSR_ROAMING_STATE_IDLE,
224 eCSR_ROAMING_STATE_SCANNING,
225 eCSR_ROAMING_STATE_JOINING,
226 eCSR_ROAMING_STATE_JOINED,
227}eCsrRoamState;
228
229
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800230typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700231{
232 eCsrContinueRoaming,
233 eCsrStopRoaming,
234 eCsrStartIbss,
235 eCsrStartIbssSameIbss,
236 eCsrReassocToSelfNoCapChange,
Jeff Johnsone7245742012-09-05 17:12:55 -0700237 eCsrStopRoamingDueToConcurrency,
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800238
Jeff Johnson295189b2012-06-20 16:38:30 -0700239}eCsrJoinState;
240
241typedef enum
242{
243 eCsrNotRoaming,
244 eCsrLostlinkRoamingDisassoc,
245 eCsrLostlinkRoamingDeauth,
246 eCsrDynamicRoaming,
247 eCsrReassocRoaming,
248}eCsrRoamingReason;
249
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800250typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700251{
252 eCsrDisassociated,
253 eCsrDeauthenticated
254
255}eCsrRoamWmStatusChangeTypes;
256
257typedef enum
258{
259 eCsrSummaryStats = 0,
260 eCsrGlobalClassAStats,
261 eCsrGlobalClassBStats,
262 eCsrGlobalClassCStats,
263 eCsrGlobalClassDStats,
264 eCsrPerStaStats,
265 eCsrMaxStats
266}eCsrRoamStatsClassTypes;
267
268#ifdef FEATURE_WLAN_DIAG_SUPPORT
269typedef enum
270{
271 eCSR_WLAN_STATUS_CONNECT =0,
272 eCSR_WLAN_STATUS_DISCONNECT
273
274}eCsrDiagWlanStatusEventSubtype;
275
276typedef enum
277{
278 eCSR_REASON_UNSPECIFIED = 0,
279 eCSR_REASON_USER_REQUESTED,
280 eCSR_REASON_MIC_ERROR,
281 eCSR_REASON_DISASSOC,
282 eCSR_REASON_DEAUTH,
283 eCSR_REASON_HANDOFF,
284
285}eCsrDiagWlanStatusEventReason;
286
287typedef enum
288{
289 eCSR_WLAN_HANDOFF_EVENT =0,
290
291}eCsrDiagWlanHandoffEventSubtype;
292
293typedef enum
294{
295 eCSR_WLAN_VCC_EVENT =0,
296
297}eCsrDiagWlanVccEventSubtype;
298
299#endif //FEATURE_WLAN_DIAG_SUPPORT
300
301typedef struct tagCsrChannel
302{
303 tANI_U8 numChannels;
304 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
305}tCsrChannel;
306
307typedef struct tagScanProfile
308{
309 tANI_U32 minChnTime;
310 tANI_U32 maxChnTime;
311 tANI_U32 restTime; //This is ignored if not associated
312 tANI_U32 numOfChannels;
313 tANI_U8 *pChannelList;
314 tSirScanType scanType; //active or passive
315 eCsrRoamBssType bssType; //BSS or IBSS
316 tANI_U8 ssid[WNI_CFG_SSID_LEN];
317 tANI_U8 bReturnAfter1stMatch;
318 tANI_U8 fUniqueResult;
319 tANI_U8 freshScan;
320 tCsrBssid bssid;
321}tScanProfile;
322
323typedef struct tagBssConfigParam
324{
325 eCsrMediaAccessType qosType;
326 tSirMacSSid SSID;
327 tANI_U32 uRTSThresh;
328 tANI_U32 uDeferThresh; //
329 eCsrCfgDot11Mode uCfgDot11Mode;
330 eCsrBand eBand;
331 tANI_U8 standardRate[CSR_DOT11_SUPPORTED_RATES_MAX];
332 tANI_U8 extendedRate[CSR_DOT11_EXTENDED_SUPPORTED_RATES_MAX];
333 eCsrExposedTxRate txRate;
334 tAniAuthType authType;
335 eCsrEncryptionType encType;
336 tANI_U32 uShortSlotTime;
337 tANI_U32 uHTSupport; //High throughput
338 tANI_U32 uPowerLimit;
339 tANI_U32 uHeartBeatThresh;
340 tANI_U32 uJoinTimeOut;
341 tSirMacCapabilityInfo BssCap;
342 tANI_BOOLEAN f11hSupport;
Jeff Johnsone7245742012-09-05 17:12:55 -0700343 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700344}tBssConfigParam;
345
346
347typedef struct tagCsrRoamStartBssParams
348{
349 tSirMacSSid ssId;
350 tCsrBssid bssid; //this is the BSSID for the party we want to join (only use for IBSS or WDS)
351 tSirNwType sirNwType;
Jeff Johnsone7245742012-09-05 17:12:55 -0700352 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700353 tSirMacRateSet operationalRateSet;
354 tSirMacRateSet extendedRateSet;
355 tANI_U8 operationChn;
356 eCsrCfgDot11Mode uCfgDot11Mode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700357 tANI_U8 privacy;
358 tANI_BOOLEAN fwdWPSPBCProbeReq;
359 tANI_BOOLEAN protEnabled;
360 tANI_BOOLEAN obssProtEnabled;
361 tAniAuthType authType;
362 tANI_U16 beaconInterval; //If this is 0, SME will fill in for caller.
363 tANI_U16 ht_protection;
364 tANI_U32 dtimPeriod;
365 tANI_U8 ApUapsdEnable;
366 tANI_U8 ssidHidden;
367 tANI_U8 wps_state;
Jeff Johnson295189b2012-06-20 16:38:30 -0700368 tVOS_CON_MODE bssPersona;
369 tANI_U16 nRSNIELength; //The byte count in the pRSNIE, if 0, pRSNIE is ignored.
370 tANI_U8 *pRSNIE; //If not null, it has the IE byte stream for RSN
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800371 tANI_BOOLEAN updatebeaconInterval; //Flag used to indicate update
372 // beaconInterval
Jeff Johnson295189b2012-06-20 16:38:30 -0700373}tCsrRoamStartBssParams;
374
375
376typedef struct tagScanCmd
377{
378 tANI_U32 scanID;
379 csrScanCompleteCallback callback;
380 void *pContext;
381 eCsrScanReason reason;
382 eCsrRoamState lastRoamState[CSR_ROAM_SESSION_MAX];
383 tCsrRoamProfile *pToRoamProfile;
384 tANI_U32 roamId; //this is the ID related to the pToRoamProfile
385 union
386 {
387 tCsrScanRequest scanRequest;
388 tCsrBGScanRequest bgScanRequest;
389 }u;
390}tScanCmd;
391
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800392typedef struct tagRoamCmd
Jeff Johnson295189b2012-06-20 16:38:30 -0700393{
394 tANI_U32 roamId;
395 eCsrRoamReason roamReason;
396 tCsrRoamProfile roamProfile;
397 tScanResultHandle hBSSList; //BSS list fits the profile
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800398 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 -0700399 tSirBssDescription *pLastRoamBss; //the last BSS we try and failed
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800400 tANI_BOOLEAN fReleaseBssList; //whether to free hBSSList
Jeff Johnson295189b2012-06-20 16:38:30 -0700401 tANI_BOOLEAN fReleaseProfile; //whether to free roamProfile
402 tANI_BOOLEAN fReassoc; //whether this command is for reassociation
403 tANI_BOOLEAN fUpdateCurRoamProfile; //whether pMac->roam.pCurRoamProfile needs to be updated
404 //this is for CSR internal used only. And it should not be assigned when creating the command
405 //This causes the roam command not to do anything.
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800406 tANI_BOOLEAN fReassocToSelfNoCapChange;
Jeff Johnson295189b2012-06-20 16:38:30 -0700407
408 tANI_BOOLEAN fStopWds;
409 tSirMacAddr peerMac;
410 tSirMacReasonCodes reason;
411}tRoamCmd;
412
413typedef struct tagSetKeyCmd
414{
415 tANI_U32 roamId;
416 eCsrEncryptionType encType;
417 eCsrAuthType authType;
418 tAniKeyDirection keyDirection; //Tx, Rx or Tx-and-Rx
419 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
420 tANI_U8 paeRole; //0 for supplicant
421 tANI_U8 keyId; // Kye index
422 tANI_U8 keyLength; //Number of bytes containing the key in pKey
423 tANI_U8 Key[CSR_MAX_KEY_LEN];
424 tANI_U8 keyRsc[CSR_MAX_RSC_LEN];
425} tSetKeyCmd;
426
427typedef struct tahRemoveKeyCmd
428{
429 tANI_U32 roamId;
430 eCsrEncryptionType encType;
431 eCsrAuthType authType;
432 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
433 tANI_U8 keyId; //key index
434} tRemoveKeyCmd;
435
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800436typedef struct tagWmStatusChangeCmd
Jeff Johnson295189b2012-06-20 16:38:30 -0700437{
438 eCsrRoamWmStatusChangeTypes Type;
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800439 union
440 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700441 tSirSmeDeauthInd DeauthIndMsg;
442 tSirSmeDisassocInd DisassocIndMsg;
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800443 }u;
Jeff Johnson295189b2012-06-20 16:38:30 -0700444
445}tWmStatusChangeCmd;
446
447typedef struct tagAddStaForSessionCmd
448{
449 //Session self mac addr
450 tSirMacAddr selfMacAddr;
451}tAddStaForSessionCmd;
452
453typedef struct tagDelStaForSessionCmd
454{
455 //Session self mac addr
456 tSirMacAddr selfMacAddr;
457 csrRoamSessionCloseCallback callback;
458 void *pContext;
459}tDelStaForSessionCmd;
460
461//This structure represents one scan request
462typedef struct tagCsrCmd
463{
464 tListElem Link;
465 eCsrRoamCommands command;
466 tANI_U8 sessionId; // Session ID for this command
467 union
468 {
469 tScanCmd scanCmd;
470 tRoamCmd roamCmd;
471 tWmStatusChangeCmd wmStatusChangeCmd;
472 tSetKeyCmd setKeyCmd;
473 tRemoveKeyCmd removeKeyCmd;
474 tAddStaForSessionCmd addStaSessionCmd;
475 tDelStaForSessionCmd delStaSessionCmd;
476 }u;
477}tCsrCmd;
478
479#ifdef WLAN_FEATURE_VOWIFI_11R
480typedef struct tagCsr11rConfig
481{
482 tANI_BOOLEAN IsFTResourceReqSupported;
483} tCsr11rConfig;
484#endif
485
486#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
487typedef struct tagCsrNeighborRoamConfig
488{
489 tANI_U32 nNeighborScanTimerPeriod;
490 tANI_U8 nNeighborLookupRssiThreshold;
491 tANI_U8 nNeighborReassocRssiThreshold;
492 tANI_U16 nNeighborScanMinChanTime;
493 tANI_U16 nNeighborScanMaxChanTime;
494 sCsrChannel neighborScanChanList;
495 tANI_U8 nMaxNeighborRetries;
496 tANI_U16 nNeighborResultsRefreshPeriod;
Srinivas Girigowda6fa58662013-02-14 16:31:48 -0800497 tANI_U16 nEmptyScanRefreshPeriod;
Jeff Johnson295189b2012-06-20 16:38:30 -0700498}tCsrNeighborRoamConfig;
499#endif
500
501typedef struct tagCsrConfig
502{
503 tANI_U32 agingCount;
504 tANI_U32 FragmentationThreshold;
505 tANI_U32 channelBondingMode24GHz;
506 tANI_U32 channelBondingMode5GHz;
507 tANI_U32 RTSThreshold;
508 eCsrPhyMode phyMode;
509 eCsrCfgDot11Mode uCfgDot11Mode;
510 eCsrBand eBand;
511 tANI_U32 HeartbeatThresh50;
512 tANI_U32 HeartbeatThresh24;
513 tANI_U32 bgScanInterval;
514 eCsrCBChoice cbChoice;
515 eCsrBand bandCapability; //indicate hw capability
516 eCsrRoamWmmUserModeType WMMSupportMode;
517 tANI_BOOLEAN Is11eSupportEnabled;
518 tANI_BOOLEAN Is11dSupportEnabled;
519 tANI_BOOLEAN Is11dSupportEnabledOriginal;
520 tANI_BOOLEAN Is11hSupportEnabled;
521 tANI_BOOLEAN shortSlotTime;
522 tANI_BOOLEAN ProprietaryRatesEnabled;
523 tANI_BOOLEAN fenableMCCMode;
524 tANI_U16 TxRate;
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -0800525 tANI_U8 fAllowMCCGODiffBI;
Jeff Johnson295189b2012-06-20 16:38:30 -0700526 tANI_U8 AdHocChannel24;
527 tANI_U8 AdHocChannel5G;
528 tANI_U32 impsSleepTime; //in units of microseconds
529 tANI_U32 scanAgeTimeNCNPS; //scan result aging time threshold when Not-Connect-No-Power-Save, in seconds
530 tANI_U32 scanAgeTimeNCPS; //scan result aging time threshold when Not-Connect-Power-Save, in seconds
531 tANI_U32 scanAgeTimeCNPS; //scan result aging time threshold when Connect-No-Power-Save, in seconds,
532 tANI_U32 scanAgeTimeCPS; //scan result aging time threshold when Connect-Power-Savein seconds
533 tANI_U32 BssPreferValue[CSR_NUM_RSSI_CAT]; //each RSSI category has one value
534 int RSSICat[CSR_NUM_RSSI_CAT];
535 tANI_U8 bCatRssiOffset; //to set the RSSI difference for each category
536 tANI_U32 nRoamingTime; //In seconds, CSR will try this long before gives up, 0 means no roaming
537 //Whether to limit the channels to the ones set in Csr11dInfo. If true, the opertaional
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800538 //channels are limited to the default channel list. It is an "AND" operation between the
Jeff Johnson295189b2012-06-20 16:38:30 -0700539 //default channels and the channels in the 802.11d IE.
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800540 tANI_BOOLEAN fEnforce11dChannels;
Jeff Johnson295189b2012-06-20 16:38:30 -0700541 //Country Code Priority
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800542 //0 = 802.11D > Configured Country > NV
Jeff Johnson295189b2012-06-20 16:38:30 -0700543 //1 = Configured Country > 802.11D > NV
544 tANI_BOOLEAN fSupplicantCountryCodeHasPriority;
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800545 //When true, AP with unknown country code won't be see.
546 //"Unknown country code" means either Ap doesn't have 11d IE or we cannot
Jeff Johnson295189b2012-06-20 16:38:30 -0700547 //find a domain for the country code in its 11d IE.
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800548 tANI_BOOLEAN fEnforceCountryCodeMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700549 //When true, only APs in the default domain can be seen. If the Ap has "unknown country
550 //code", or the doamin of the country code doesn't match the default domain, the Ap is
551 //not acceptable.
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800552 tANI_BOOLEAN fEnforceDefaultDomain;
Jeff Johnson295189b2012-06-20 16:38:30 -0700553
554 tANI_U16 vccRssiThreshold;
555 tANI_U32 vccUlMacLossThreshold;
556
557 tANI_U32 nPassiveMinChnTime; //in units of milliseconds
558 tANI_U32 nPassiveMaxChnTime; //in units of milliseconds
559 tANI_U32 nActiveMinChnTime; //in units of milliseconds
560 tANI_U32 nActiveMaxChnTime; //in units of milliseconds
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800561
562 tANI_U32 nActiveMinChnTimeBtc; //in units of milliseconds
563 tANI_U32 nActiveMaxChnTimeBtc; //in units of milliseconds
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -0700564#ifdef WLAN_AP_STA_CONCURRENCY
565 tANI_U32 nPassiveMinChnTimeConc; //in units of milliseconds
566 tANI_U32 nPassiveMaxChnTimeConc; //in units of milliseconds
567 tANI_U32 nActiveMinChnTimeConc; //in units of milliseconds
568 tANI_U32 nActiveMaxChnTimeConc; //in units of milliseconds
569 tANI_U32 nRestTimeConc; //in units of milliseconds
Madan Mohan Koyyalamudi8591f092012-12-17 13:04:30 -0800570 tANI_U8 nNumChanCombinedConc; //number of channels combined
571 //in each split scan operation
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -0700572#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700573
574 tANI_BOOLEAN IsIdleScanEnabled;
575 //in dBm, the maximum TX power
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800576 //The actual TX power is the lesser of this value and 11d.
Jeff Johnson295189b2012-06-20 16:38:30 -0700577 //If 11d is disable, the lesser of this and default setting.
578 tANI_U8 nTxPowerCap;
579 tANI_U32 statsReqPeriodicity; //stats request frequency from PE while in full power
580 tANI_U32 statsReqPeriodicityInPS;//stats request frequency from PE while in power save
Jeff Johnson295189b2012-06-20 16:38:30 -0700581 tANI_U32 dtimPeriod;
582 tANI_BOOLEAN ssidHidden;
Jeff Johnson295189b2012-06-20 16:38:30 -0700583
584#ifdef WLAN_FEATURE_VOWIFI_11R
585 tCsr11rConfig csr11rConfig;
586#endif
587
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700588#ifdef FEATURE_WLAN_LFR
589 tANI_U8 isFastRoamIniFeatureEnabled;
590#endif
591
Jeff Johnson295189b2012-06-20 16:38:30 -0700592#ifdef FEATURE_WLAN_CCX
593 tANI_U8 isCcxIniFeatureEnabled;
594#endif
595
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700596#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Jeff Johnson295189b2012-06-20 16:38:30 -0700597 tANI_U8 isFastTransitionEnabled;
Jeff Johnson43971f52012-07-17 12:26:56 -0700598 tANI_U8 RoamRssiDiff;
Madan Mohan Koyyalamudif4289db2012-12-03 16:45:39 -0800599 tANI_U8 nImmediateRoamRssiDiff;
Madan Mohan Koyyalamudic4c01172012-11-30 14:56:21 -0800600 tANI_BOOLEAN nRoamPrefer5GHz;
Jeff Johnson295189b2012-06-20 16:38:30 -0700601#endif
602
603#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
604 tCsrNeighborRoamConfig neighborRoamConfig;
605#endif
606
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800607 /* Instead of Reassoc, send ADDTS/DELTS even when ACM is off for that AC
Jeff Johnson295189b2012-06-20 16:38:30 -0700608 * This is mandated by WMM-AC certification */
609 tANI_BOOLEAN addTSWhenACMIsOff;
610
611 tANI_BOOLEAN fValidateList;
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800612 //Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700613 //BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnsone7245742012-09-05 17:12:55 -0700614 tANI_BOOLEAN doBMPSWorkaround;
Jeff Johnson295189b2012-06-20 16:38:30 -0700615
616 //To enable/disable scanning 2.4Ghz channels twice on a single scan request from HDD
617 tANI_BOOLEAN fScanTwice;
Jeff Johnsone7245742012-09-05 17:12:55 -0700618#ifdef WLAN_FEATURE_11AC
619 tANI_U32 nVhtChannelWidth;
Shailender Karmuchi31f9ebe2013-01-17 12:51:24 -0800620 tANI_U8 txBFEnable;
Shailender Karmuchi95934c32013-02-16 18:18:33 -0800621 tANI_U8 txBFCsnValue;
Jeff Johnsone7245742012-09-05 17:12:55 -0700622#endif
Gopichand Nakkalab7ed0a62013-01-04 11:41:02 -0800623 tANI_U8 txLdpcEnable;
Jeff Johnson295189b2012-06-20 16:38:30 -0700624
625}tCsrConfig;
626
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800627typedef struct tagCsrChannelPowerInfo
Jeff Johnson295189b2012-06-20 16:38:30 -0700628{
629 tListElem link;
630 tANI_U8 firstChannel;
631 tANI_U8 numChannels;
632 tANI_U8 txPower;
633 tANI_U8 interChannelOffset;
634}tCsrChannelPowerInfo;
635
636typedef struct tagRoamJoinStatus
637{
638 tSirResultCodes statusCode;
639 //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 Lokere30b07722013-02-24 22:21:28 -0800640 tANI_U32 reasonCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700641}tCsrRoamJoinStatus;
642
643typedef struct tagCsrOsChannelMask
644{
645 tANI_U8 numChannels;
646 tANI_BOOLEAN scanEnabled[WNI_CFG_VALID_CHANNEL_LIST_LEN];
647 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
648}tCsrOsChannelMask;
649
650
651typedef struct tagCsrScanStruct
652{
653 tScanProfile scanProfile;
654 tANI_U32 nextScanID;
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700655 tDblLinkList scanResultList;
Jeff Johnson295189b2012-06-20 16:38:30 -0700656 tDblLinkList tempScanResults;
657 tANI_BOOLEAN fScanEnable;
658 tANI_BOOLEAN fFullScanIssued;
659 tPalTimerHandle hTimerGetResult;
660#ifdef WLAN_AP_STA_CONCURRENCY
661 tPalTimerHandle hTimerStaApConcTimer;
662#endif
663 tPalTimerHandle hTimerIdleScan;
664 tPalTimerHandle hTimerResultAging;
Madan Mohan Koyyalamudi7da2fd72012-12-17 14:44:16 -0800665 tPalTimerHandle hTimerResultCfgAging;
Jeff Johnson295189b2012-06-20 16:38:30 -0700666 tPalTimerHandle hTimerBgScan;
667 //changes on every scan, it is used as a flag for whether 11d info is found on every scan
Madan Mohan Koyyalamudi7da2fd72012-12-17 14:44:16 -0800668 tANI_U8 channelOf11dInfo;
669 tANI_U8 scanResultCfgAgingTime;
Jeff Johnson295189b2012-06-20 16:38:30 -0700670 //changes on every scan, a flag to tell whether conflict 11d info found on each BSS
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800671 tANI_BOOLEAN fAmbiguous11dInfoFound;
Jeff Johnson295189b2012-06-20 16:38:30 -0700672 //Tush: changes on every scan, a flag to tell whether the applied 11d info present in one of the scan results
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800673 tANI_BOOLEAN fCurrent11dInfoMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700674 tANI_BOOLEAN f11dInfoReset; //to indicate whether the 11d info in CFG is reset to default
675 tSirScanType curScanType;
676 tCsrChannel baseChannels; //This are all the supported channels AND(&) to the current eBand
677 tCsrChannel channels11d;
678 tChannelListWithPower defaultPowerTable[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
679 tChannelListWithPower defaultPowerTable40MHz[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
680 tANI_U32 numChannelsDefault; //total channels of NV
681 tCsrChannel base20MHzChannels; //The channel base to work on
682 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
683 tDblLinkList channelPowerInfoList24;
684 tDblLinkList channelPowerInfoList5G;
685 tANI_U32 nLastAgeTimeOut;
686 tANI_U32 nAgingCountDown;
687 tANI_U8 countryCodeDefault[WNI_CFG_COUNTRY_CODE_LEN+1]; //The country code from NV
688 tANI_U8 countryCodeCurrent[WNI_CFG_COUNTRY_CODE_LEN+1];
689 tANI_U8 countryCode11d[WNI_CFG_COUNTRY_CODE_LEN+1];
690 v_REGDOMAIN_t domainIdDefault; //default regulatory domain
691 v_REGDOMAIN_t domainIdCurrent; //current regulatory domain
692 tANI_BOOLEAN f11dInfoApplied;
693 tANI_BOOLEAN fCancelIdleScan;
694#ifdef FEATURE_WLAN_WAPI
695// tANI_U16 NumBkidCandidate;
696// tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED]; /* Move this as part of SessionEntry */
697#endif /* FEATURE_WLAN_WAPI */
698 tANI_U8 numBGScanChannel; //number of valid channels in the bgScanChannelList
699 tANI_U8 bgScanChannelList[WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN];
700 //the ChannelInfo member is not used in this structure.
701 //numBGScanChannel and bgScanChannelList are used for the BG scan channel info
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800702 tCsrBGScanRequest bgScanParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700703 tANI_BOOLEAN fRestartIdleScan;
704 tANI_U32 nIdleScanTimeGap; //the time since last trying to trigger idle scan
705 tCsrOsChannelMask osScanChannelMask;//keep a track of channels to be scnned while in traffic condition
706 tANI_U16 nBssLimit; //the maximum number of BSS in scan cache
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800707 /*channelPowerInfoList24 has been seen corrupted. Set this flag to true trying to
Jeff Johnson295189b2012-06-20 16:38:30 -0700708 * detect when it happens. Adding this into code because we can't reproduce it easily.
709 * We don't know when it happens. */
710 tANI_BOOLEAN fValidateList;
711 /*Customer wants to start with an active scan based on the default country code.
712 * This optimization will minimize the driver load to association time.
713 * Based on this flag we will bypass the initial passive scan needed for 11d
714 * to determine the country code & domain */
715 tANI_BOOLEAN fEnableBypass11d;
716
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800717 /*Customer wants to optimize the scan time. Avoiding scans(passive) on DFS
718 * channels while swipping through both bands can save some time
Jeff Johnson295189b2012-06-20 16:38:30 -0700719 * (apprx 1.3 sec) */
720 tANI_BOOLEAN fEnableDFSChnlScan;
721
Jeff Johnsone7245742012-09-05 17:12:55 -0700722 /*
723 * To enable/disable scanning only 2.4Ghz channels on first scan
724 */
725 tANI_BOOLEAN fFirstScanOnly2GChnl;
726
Jeff Johnson295189b2012-06-20 16:38:30 -0700727 tANI_BOOLEAN fDropScanCmd; //true means we don't accept scan commands
728
729#ifdef WLAN_AP_STA_CONCURRENCY
730 tDblLinkList scanCmdPendingList;
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800731#endif
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700732 tCsrChannel occupiedChannels; //This includes all channels on which candidate APs are found
Madan Mohan Koyyalamudi3f65e312012-11-06 15:31:12 -0800733
734 tANI_BOOLEAN fIgnore_chan165;
Jeff Johnson295189b2012-06-20 16:38:30 -0700735}tCsrScanStruct;
736
Gopichand Nakkalaf8d84812013-02-18 19:15:09 -0800737#ifdef FEATURE_WLAN_TDLS_INTERNAL
Mohit Khannac0b992f2012-12-04 15:08:18 -0800738/*
739 * struct to carry TDLS discovery info..
740 */
741typedef struct sCsrTdlsContext
742{
Mohit Khannac0b992f2012-12-04 15:08:18 -0800743 tDblLinkList tdlsPotentialPeerList ;
744 tANI_U16 tdlsCommonFlag ;
745 tANI_U16 tdlsCommonState ;
Mohit Khannac0b992f2012-12-04 15:08:18 -0800746 tANI_U16 tdlsPeerCount ;
747}tCsrTdlsCtxStruct;
748
Mohit Khannac0b992f2012-12-04 15:08:18 -0800749typedef struct sCsrTdlsPeerLinkInfo
750{
751 tListElem tdlsPeerStaLink ;
752 tSirTdlsPeerInfo tdlsDisPeerInfo ;
753}tCsrTdlsPeerLinkinfo ;
754#endif
Gopichand Nakkalaf8d84812013-02-18 19:15:09 -0800755
Mohit Khannac0b992f2012-12-04 15:08:18 -0800756
757
Jeff Johnson295189b2012-06-20 16:38:30 -0700758
759//Save the connected information. This structure + connectedProfile
760//should contain all information about the connection
761typedef struct tagRoamCsrConnectedInfo
762{
763 tANI_U32 nBeaconLength; //the length, in bytes, of the beacon frame, can be 0
764 tANI_U32 nAssocReqLength; //the length, in bytes, of the assoc req frame, can be 0
765 tANI_U32 nAssocRspLength; //The length, in bytes, of the assoc rsp frame, can be 0
766#ifdef WLAN_FEATURE_VOWIFI_11R
767 tANI_U32 nRICRspLength; //Length of the parsed RIC response IEs received in reassoc response
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800768#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700769#ifdef FEATURE_WLAN_CCX
770 tANI_U32 nTspecIeLength;
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800771#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700772 tANI_U8 *pbFrames; //Point to a buffer contain the beacon, assoc req, assoc rsp frame, in that order
773 //user needs to use nBeaconLength, nAssocReqLength, nAssocRspLength to desice where
774 //each frame starts and ends.
775 tANI_U8 staId;
776}tCsrRoamConnectedInfo;
777
778
779typedef struct tagCsrLinkQualityIndInfo
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800780{
Jeff Johnson295189b2012-06-20 16:38:30 -0700781 csrRoamLinkQualityIndCallback callback;
782 void *context;
783}tCsrLinkQualityIndInfo;
784
785typedef struct tagCsrPeStatsReqInfo
786{
787 tListElem link; /* list links */
788 tANI_U32 statsMask;
789 tANI_U32 periodicity;
790 tANI_BOOLEAN rspPending;
791 vos_timer_t hPeStatsTimer;
792 tANI_BOOLEAN timerRunning;
793 tANI_U8 staId;
794 tANI_U8 numClient;
795 tpAniSirGlobal pMac;
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800796 /* To remember if the peStats timer is stopped successfully or not */
Jeff Johnson295189b2012-06-20 16:38:30 -0700797 tANI_BOOLEAN timerStopFailed;
798
799}tCsrPeStatsReqInfo;
800
801typedef struct tagCsrStatsClientReqInfo
802{
803 tListElem link; /* list links */
804 eCsrStatsRequesterType requesterId;
805 tCsrStatsCallback callback;
806 tANI_U32 periodicity;
807 void *pContext;
808 tANI_U32 statsMask;
809 tCsrPeStatsReqInfo *pPeStaEntry;
810 tANI_U8 staId;
811 vos_timer_t timer;
812 tANI_BOOLEAN timerExpired;
813 tpAniSirGlobal pMac; // TODO: Confirm this change BTAMP
814}tCsrStatsClientReqInfo;
815
816typedef struct tagCsrTlStatsReqInfo
817{
818 tANI_U32 periodicity;
819 tANI_BOOLEAN timerRunning;
820 tPalTimerHandle hTlStatsTimer;
821 tANI_U8 numClient;
822}tCsrTlStatsReqInfo;
823
824typedef struct tagCsrRoamSession
825{
826 tANI_U8 sessionId; // Session ID
827 tANI_BOOLEAN sessionActive; // TRUE if it is used
828 tCsrBssid selfMacAddr; // For BT-AMP station, this serve as BSSID for self-BSS.
829 csrRoamCompleteCallback callback;
830 void *pContext;
831 eCsrConnectState connectState;
832 tCsrRoamConnectedProfile connectedProfile;
833 tCsrRoamConnectedInfo connectedInfo;
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800834 tCsrRoamProfile *pCurRoamProfile;
Jeff Johnson295189b2012-06-20 16:38:30 -0700835 tSirBssDescription *pConnectBssDesc;
836 tANI_U16 NumPmkidCache;
837 tPmkidCacheInfo PmkidCacheInfo[CSR_MAX_PMKID_ALLOWED];
838 tANI_U8 cJoinAttemps;
839 //This may or may not have the up-to-date valid channel list
840 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
841 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
842 tANI_S32 sPendingCommands; //0 means CSR is ok to low power
843#ifdef FEATURE_WLAN_WAPI
844 tANI_U16 NumBkidCache;
845 tBkidCacheInfo BkidCacheInfo[CSR_MAX_BKID_ALLOWED];
846#endif /* FEATURE_WLAN_WAPI */
847 tANI_BOOLEAN fRoaming; //indicate whether CSR is roaming (either via lostlink or dynamic roaming)
848 //to remember some parameters needed for START_BSS.
849 //All member must be set every time we try to join or start an IBSS or BT-AMP
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800850 tCsrRoamStartBssParams bssParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700851 tANI_U32 nWpaRsnReqIeLength; //the byte count of pWpaRsnIE;
852 tANI_U8 *pWpaRsnReqIE; //this contain the WPA/RSN IE in assoc request or the one sent in beacon (IBSS)
853 tANI_U32 nWpaRsnRspIeLength; //the byte count for pWpaRsnRspIE
854 tANI_U8 *pWpaRsnRspIE; //this contain the WPA/RSN IE in beacon/probe rsp
855#ifdef FEATURE_WLAN_WAPI
856 tANI_U32 nWapiReqIeLength; //the byte count of pWapiReqIE;
857 tANI_U8 *pWapiReqIE; //this contain the WAPI IE in assoc request or the one sent in beacon (IBSS)
858 tANI_U32 nWapiRspIeLength; //the byte count for pWapiRspIE
859 tANI_U8 *pWapiRspIE; //this contain the WAPI IE in beacon/probe rsp
860#endif /* FEATURE_WLAN_WAPI */
861 tANI_U32 nAddIEScanLength; //the byte count of pAddIeScanIE;
862 tANI_U8 *pAddIEScan; //this contains the additional IE in (unicast) probe request at the time of join
863 tANI_U32 nAddIEAssocLength; //the byte count for pAddIeAssocIE
864 tANI_U8 *pAddIEAssoc; //this contains the additional IE in (re) assoc request
865
866 tANI_TIMESTAMP roamingStartTime; //in units of 10ms
867 tCsrTimerInfo roamingTimerInfo;
868 eCsrRoamingReason roamingReason;
869 tANI_BOOLEAN fCancelRoaming;
870 tPalTimerHandle hTimerRoaming;
871 tPalTimerHandle hTimerIbssJoining;
872 tCsrTimerInfo ibssJoinTimerInfo;
873 tANI_BOOLEAN ibss_join_pending;
874 eCsrRoamResult roamResult; //the roamResult that is used when the roaming timer fires
875 tCsrRoamJoinStatus joinFailStatusCode; //This is the reason code for join(assoc) failure
876 //The status code returned from PE for deauth or disassoc (in case of lostlink), or our own dynamic roaming
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800877 tANI_U32 roamingStatusCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700878 tANI_U16 NumPmkidCandidate;
879 tPmkidCandidateInfo PmkidCandidateInfo[CSR_MAX_PMKID_ALLOWED];
880 #ifdef FEATURE_WLAN_WAPI
881 tANI_U16 NumBkidCandidate;
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800882 tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED];
Jeff Johnson295189b2012-06-20 16:38:30 -0700883#endif
884 tANI_BOOLEAN fWMMConnection;
885#ifdef FEATURE_WLAN_BTAMP_UT_RF
886 //To retry a join later when it fails if so desired
887 tPalTimerHandle hTimerJoinRetry;
888 tCsrTimerInfo joinRetryTimerInfo;
889 tANI_U32 maxRetryCount;
890#endif
891#ifdef FEATURE_WLAN_CCX
892 tCsrCcxCckmInfo ccxCckmInfo;
893 tANI_BOOLEAN isPrevApInfoValid;
894 tSirMacSSid prevApSSID;
895 tCsrBssid prevApBssid;
896 tANI_U8 prevOpChannel;
897 tANI_U16 clientDissSecs;
898 tANI_U32 roamTS1;
899#endif
900 tANI_U8 bRefAssocStartCnt; //Tracking assoc start indication
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800901 /* to force the AP initiate fresh 802.1x authentication after re-association need to clear
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700902 * the PMKID cache. To clear the cache in this particular case this is added
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800903 * it is needed by the HS 2.0 passpoint certification 5.2.a and b testcases */
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700904 tANI_BOOLEAN fIgnorePMKIDCache;
Jeff Johnson295189b2012-06-20 16:38:30 -0700905} tCsrRoamSession;
906
907typedef struct tagCsrRoamStruct
908{
909 tANI_U32 nextRoamId;
910 tDblLinkList roamCmdPendingList;
911 tDblLinkList channelList5G;
912 tDblLinkList channelList24;
913 tCsrConfig configParam;
914 tANI_U32 numChannelsEeprom; //total channels of eeprom
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800915 tCsrChannel base20MHzChannels; //The channel base to work on
916 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
917 eCsrRoamState curState[CSR_ROAM_SESSION_MAX];
Jeff Johnson295189b2012-06-20 16:38:30 -0700918 eCsrRoamSubState curSubState[CSR_ROAM_SESSION_MAX];
919 //This may or may not have the up-to-date valid channel list
920 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
921 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
922 tANI_U32 numValidChannels; //total number of channels in CFG
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800923
Jeff Johnson295189b2012-06-20 16:38:30 -0700924 tANI_S32 sPendingCommands;
Jeff Johnson295189b2012-06-20 16:38:30 -0700925 tPalTimerHandle hTimerWaitForKey; //To support timeout for WaitForKey state
926 tCsrSummaryStatsInfo summaryStatsInfo;
927 tCsrGlobalClassAStatsInfo classAStatsInfo;
928 tCsrGlobalClassBStatsInfo classBStatsInfo;
929 tCsrGlobalClassCStatsInfo classCStatsInfo;
930 tCsrGlobalClassDStatsInfo classDStatsInfo;
931 tCsrPerStaStatsInfo perStaStatsInfo[CSR_MAX_STA];
932 tDblLinkList statsClientReqList;
933 tDblLinkList peStatsReqList;
934 tCsrTlStatsReqInfo tlStatsReqInfo;
935 eCsrRoamLinkQualityInd vccLinkQuality;
936 tCsrLinkQualityIndInfo linkQualityIndInfo;
937 v_CONTEXT_t gVosContext; //used for interaction with TL
938 //To specify whether an association or a IBSS is WMM enabled
939 //This parameter is only valid during a join or start BSS command is being executed
940 //tANI_BOOLEAN fWMMConnection; /* Moving it to be part of roamsession */
941 v_U8_t ucACWeights[WLANTL_MAX_AC];
942 /* TODO : Upto here */
943 tCsrTimerInfo WaitForKeyTimerInfo;
944 tCsrRoamSession *roamSession;
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800945 tANI_U32 transactionId; // Current transaction ID for internal use.
946#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
Jeff Johnson295189b2012-06-20 16:38:30 -0700947 tCsrNeighborRoamControlInfo neighborRoamInfo;
948#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700949#ifdef FEATURE_WLAN_LFR
950 tANI_U8 isFastRoamIniFeatureEnabled;
951#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700952#ifdef FEATURE_WLAN_CCX
953 tANI_U8 isCcxIniFeatureEnabled;
954#endif
Jeff Johnson43971f52012-07-17 12:26:56 -0700955#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
956 tANI_U8 RoamRssiDiff;
957#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700958}tCsrRoamStruct;
959
960
961#define GET_NEXT_ROAM_ID(pRoamStruct) (((pRoamStruct)->nextRoamId + 1 == 0) ? 1 : (pRoamStruct)->nextRoamId)
962#define CSR_IS_ROAM_STATE(pMac, state, sessionId) ( (state) == (pMac)->roam.curState[sessionId] )
963
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800964#define CSR_IS_ROAM_STOP(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_STOP, sessionId )
965#define CSR_IS_ROAM_INIT(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_INIT, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -0700966#define CSR_IS_ROAM_SCANNING(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_SCANNING, sessionId )
967#define CSR_IS_ROAM_JOINING(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_JOINING, sessionId )
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800968#define CSR_IS_ROAM_IDLE(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_IDLE, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -0700969#define CSR_IS_ROAM_JOINED(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_JOINED, sessionId )
970
971#define CSR_IS_ROAM_SUBSTATE(pMac, subState, sessionId) ((subState) == (pMac)->roam.curSubState[sessionId])
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800972#define CSR_IS_ROAM_SUBSTATE_JOIN_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOIN_REQ, sessionId)
973#define CSR_IS_ROAM_SUBSTATE_AUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_AUTH_REQ, sessionId)
974#define CSR_IS_ROAM_SUBSTATE_REASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_REASSOC_REQ, sessionId)
975#define CSR_IS_ROAM_SUBSTATE_DISASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REQ, sessionId)
976#define CSR_IS_ROAM_SUBSTATE_DISASSOC_NO_JOIN(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN, sessionId)
977#define CSR_IS_ROAM_SUBSTATE_REASSOC_FAIL(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE, sessionId)
978#define CSR_IS_ROAM_SUBSTATE_DISASSOC_FORCED(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_FORCED, sessionId)
979#define CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DEAUTH_REQ, sessionId)
980#define CSR_IS_ROAM_SUBSTATE_START_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_START_BSS_REQ, sessionId)
981#define CSR_IS_ROAM_SUBSTATE_STOP_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_STOP_BSS_REQ, sessionId)
982#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 -0700983#define CSR_IS_ROAM_SUBSTATE_CONFIG(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_CONFIG, sessionId)
984#define CSR_IS_ROAM_SUBSTATE_WAITFORKEY(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY, sessionId)
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800985#define CSR_IS_ROAM_SUBSTATE_DISASSOC_HO(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF, sessionId)
986#define CSR_IS_ROAM_SUBSTATE_HO_NT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC, sessionId)
987#define CSR_IS_ROAM_SUBSTATE_HO_NRT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC, sessionId)
988#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 -0700989
990#define CSR_IS_PHY_MODE_B_ONLY(pMac) \
991 ((eCSR_DOT11_MODE_11b == (pMac)->roam.configParam.phyMode) ||\
992 (eCSR_DOT11_MODE_11b_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800993
Jeff Johnson295189b2012-06-20 16:38:30 -0700994#define CSR_IS_PHY_MODE_G_ONLY(pMac) \
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -0800995 (eCSR_DOT11_MODE_11g == (pMac)->roam.configParam.phyMode || eCSR_DOT11_MODE_11g_ONLY == (pMac)->roam.configParam.phyMode)
996
Jeff Johnson295189b2012-06-20 16:38:30 -0700997#define CSR_IS_PHY_MODE_A_ONLY(pMac) \
998 ((eCSR_DOT11_MODE_11a == (pMac)->roam.configParam.phyMode) ||\
999 (eCSR_DOT11_MODE_11a_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001000
Jeff Johnsone7245742012-09-05 17:12:55 -07001001#ifdef WLAN_FEATURE_11AC
1002#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1003 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1004 (eCSR_DOT11_MODE_11ac & (phyMode)) || \
1005 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1006 (eCSR_DOT11_MODE_AUTO & (phyMode)))
1007#else
Jeff Johnson295189b2012-06-20 16:38:30 -07001008#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1009 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1010 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1011 (eCSR_DOT11_MODE_AUTO & (phyMode)))
Jeff Johnsone7245742012-09-05 17:12:55 -07001012#endif
1013
Jeff Johnson295189b2012-06-20 16:38:30 -07001014
1015// this function returns TRUE if the NIC is operating exclusively in the 2.4 GHz band, meaning
1016// it is NOT operating in the 5.0 GHz band.
1017#define CSR_IS_24_BAND_ONLY(pMac) \
1018 (eCSR_BAND_24 == (pMac)->roam.configParam.eBand)
1019
1020#define CSR_IS_5G_BAND_ONLY(pMac) \
1021 (eCSR_BAND_5G == (pMac)->roam.configParam.eBand)
1022
1023#define CSR_IS_RADIO_DUAL_BAND(pMac) \
1024 (eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability)
1025
1026#define CSR_IS_RADIO_BG_ONLY(pMac) \
1027 (eCSR_BAND_24 == (pMac)->roam.configParam.bandCapability)
1028
1029// this function returns TRUE if the NIC is operating exclusively in the 5.0 GHz band, meaning
1030// it is NOT operating in the 2.4 GHz band
1031#define CSR_IS_RADIO_A_ONLY(pMac) \
1032 (eCSR_BAND_5G == (pMac)->roam.configParam.bandCapability)
1033
1034// this function returns TRUE if the NIC is operating in both bands.
1035#define CSR_IS_OPEARTING_DUAL_BAND(pMac) \
1036 ((eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability) && (eCSR_BAND_ALL == (pMac)->roam.configParam.eBand))
1037
1038// this function returns TRUE if the NIC can operate in the 5.0 GHz band (could operate in the
1039// 2.4 GHz band also).
1040#define CSR_IS_OPERATING_A_BAND(pMac) \
1041 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_A_ONLY((pMac)) || CSR_IS_5G_BAND_ONLY((pMac)))
1042
1043// this function returns TRUE if the NIC can operate in the 2.4 GHz band (could operate in the
1044// 5.0 GHz band also).
1045#define CSR_IS_OPERATING_BG_BAND(pMac) \
1046 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_BG_ONLY((pMac)) || CSR_IS_24_BAND_ONLY((pMac)))
1047
1048#define CSR_IS_CHANNEL_5GHZ(chnNum) \
Jeff Johnsone7245742012-09-05 17:12:55 -07001049 (((chnNum) >= CSR_MIN_5GHz_CHANNEL_NUMBER) && ((chnNum) <= CSR_MAX_5GHz_CHANNEL_NUMBER))
Jeff Johnson295189b2012-06-20 16:38:30 -07001050
Srinivas Girigowda6fa58662013-02-14 16:31:48 -08001051#define CSR_IS_CHANNEL_DFS(chnNum) \
1052 (NV_CHANNEL_ENABLE != vos_nv_getChannelEnabledState(chnNum))
1053
Jeff Johnson295189b2012-06-20 16:38:30 -07001054#define CSR_IS_CHANNEL_24GHZ(chnNum) \
1055 (((chnNum) > 0) && ((chnNum) <= CSR_MAX_24GHz_CHANNEL_NUMBER))
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001056
Jeff Johnson295189b2012-06-20 16:38:30 -07001057#define CSR_IS_SAME_BAND_CHANNELS(ch1, ch2) (CSR_IS_CHANNEL_5GHZ(ch1) == CSR_IS_CHANNEL_5GHZ(ch2))
1058
1059
1060#define CSR_IS_11D_INFO_FOUND(pMac) \
1061 (0 != (pMac)->scan.channelOf11dInfo)
1062// DEAUTHIND
1063#define CSR_IS_ROAMING(pSession) ((CSR_IS_LOSTLINK_ROAMING((pSession)->roamingReason)) || \
1064 (eCsrDynamicRoaming == (pSession)->roamingReason) || \
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001065 (eCsrReassocRoaming == (pSession)->roamingReason))
Jeff Johnson295189b2012-06-20 16:38:30 -07001066
1067
1068#define CSR_IS_SET_KEY_COMMAND( pCommand ) ( eSmeCommandSetKey == (pCommand)->command )
1069
1070#define CSR_IS_ADDTS_WHEN_ACMOFF_SUPPORTED(pMac) (pMac->roam.configParam.addTSWhenACMIsOff)
1071// DEAUTHIND
1072#define CSR_IS_LOSTLINK_ROAMING(reason) ((eCsrLostlinkRoamingDisassoc == (reason)) || (eCsrLostlinkRoamingDeauth == (reason)))
1073
1074//Stop CSR from asking for IMPS, This function doesn't disable IMPS from CSR
1075void csrScanSuspendIMPS( tpAniSirGlobal pMac );
1076//Start CSR from asking for IMPS. This function doesn't trigger CSR to request entering IMPS
1077//because IMPS maybe disabled.
1078void csrScanResumeIMPS( tpAniSirGlobal pMac );
1079
1080eHalStatus csrInitGetChannels(tpAniSirGlobal pMac);
1081
1082eHalStatus csrSetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1083 tCsrRoamModifyProfileFields *pModifyProfileFields);
1084/* ---------------------------------------------------------------------------
1085 \fn csrGetModifyProfileFields
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001086 \brief HDD or SME - QOS calls this function to get the current values of
Jeff Johnson295189b2012-06-20 16:38:30 -07001087 connected profile fields changing which can cause reassoc.
1088 This function must be called after CFG is downloaded and STA is in connected
1089 state.
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001090 \param pModifyProfileFields - pointer to the connected profile fields
Jeff Johnson295189b2012-06-20 16:38:30 -07001091 changing which can cause reassoc
1092
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001093 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001094 -------------------------------------------------------------------------------*/
1095eHalStatus csrGetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1096 tCsrRoamModifyProfileFields * pModifyProfileFields);
1097void csrSetGlobalCfgs( tpAniSirGlobal pMac );
1098void csrSetDefaultDot11Mode( tpAniSirGlobal pMac );
1099void csrScanSetChannelMask(tpAniSirGlobal pMac, tCsrChannelInfo *pChannelInfo);
1100tANI_BOOLEAN csrIsConnStateDisconnected(tpAniSirGlobal pMac, tANI_U32 sessionId);
1101tANI_BOOLEAN csrIsConnStateConnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1102tANI_BOOLEAN csrIsConnStateDisconnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1103tANI_BOOLEAN csrIsConnStateConnectedInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1104tANI_BOOLEAN csrIsConnStateConnected( tpAniSirGlobal pMac, tANI_U32 sessionId );
1105tANI_BOOLEAN csrIsConnStateInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1106tANI_BOOLEAN csrIsConnStateIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1107tANI_BOOLEAN csrIsConnStateWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1108tANI_BOOLEAN csrIsConnStateConnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1109tANI_BOOLEAN csrIsConnStateDisconnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1110tANI_BOOLEAN csrIsAnySessionInConnectState( tpAniSirGlobal pMac );
1111tANI_BOOLEAN csrIsAllSessionDisconnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudie8d64402012-12-04 16:49:55 -08001112tANI_BOOLEAN csrIsStaSessionConnected( tpAniSirGlobal pMac );
1113tANI_BOOLEAN csrIsP2pSessionConnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudid3d22592012-09-24 14:01:29 -07001114tANI_BOOLEAN csrIsAnySessionConnected( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001115tANI_BOOLEAN csrIsInfraConnected( tpAniSirGlobal pMac );
1116tANI_BOOLEAN csrIsConcurrentInfraConnected( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001117tANI_BOOLEAN csrIsConcurrentSessionRunning( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001118tANI_BOOLEAN csrIsInfraApStarted( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001119tANI_BOOLEAN csrIsIBSSStarted( tpAniSirGlobal pMac );
1120tANI_BOOLEAN csrIsBTAMPStarted( tpAniSirGlobal pMac );
1121tANI_BOOLEAN csrIsBTAMP( tpAniSirGlobal pMac, tANI_U32 sessionId );
1122eHalStatus csrIsBTAMPAllowed( tpAniSirGlobal pMac, tANI_U32 chnId );
Jeff Johnsone7245742012-09-05 17:12:55 -07001123tANI_BOOLEAN csrIsValidMcConcurrentSession(tpAniSirGlobal pMac, tANI_U32 sessionId,
1124 tSirBssDescription *pBssDesc);
Jeff Johnson295189b2012-06-20 16:38:30 -07001125tANI_BOOLEAN csrIsConnStateConnectedInfraAp( tpAniSirGlobal pMac, tANI_U32 sessionId );
Jeff Johnson295189b2012-06-20 16:38:30 -07001126/*----------------------------------------------------------------------------
1127 \fn csrRoamRegisterLinkQualityIndCallback
1128
1129 \brief
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001130 a CSR function to allow HDD to register a callback handler with CSR for
1131 link quality indications.
Jeff Johnson295189b2012-06-20 16:38:30 -07001132
1133 Only one callback may be registered at any time.
1134 In order to deregister the callback, a NULL cback may be provided.
1135
1136 Registration happens in the task context of the caller.
1137
1138 \param callback - Call back being registered
1139 \param pContext - user data
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001140
Jeff Johnson295189b2012-06-20 16:38:30 -07001141 DEPENDENCIES: After CSR open
1142
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001143 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001144-----------------------------------------------------------------------------*/
1145eHalStatus csrRoamRegisterLinkQualityIndCallback(tpAniSirGlobal pMac,
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001146 csrRoamLinkQualityIndCallback callback,
Jeff Johnson295189b2012-06-20 16:38:30 -07001147 void *pContext);
1148/* ---------------------------------------------------------------------------
1149 \fn csrGetStatistics
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001150 \brief csr function that client calls to register a callback to get
1151 different PHY level statistics from CSR.
1152
Jeff Johnson295189b2012-06-20 16:38:30 -07001153 \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc
1154 \param statsMask - The different category/categories of stats requester is looking for
1155 \param callback - SME sends back the requested stats using the callback
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001156 \param periodicity - If requester needs periodic update, 0 means it's an one
Jeff Johnson295189b2012-06-20 16:38:30 -07001157 time request
1158 \param cache - If requester is happy with cached stats
1159 \param staId - The station ID for which the stats is requested for
1160 \param pContext - user context to be passed back along with the callback
1161
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001162 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001163 ---------------------------------------------------------------------------*/
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001164eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requesterId,
1165 tANI_U32 statsMask,
1166 tCsrStatsCallback callback,
1167 tANI_U32 periodicity, tANI_BOOLEAN cache,
Jeff Johnson295189b2012-06-20 16:38:30 -07001168 tANI_U8 staId, void *pContext);
1169
1170
1171eHalStatus csrGetRssi(tpAniSirGlobal pMac,tCsrRssiCallback callback,tANI_U8 staId,tCsrBssid bssId,void * pContext,void * pVosContext);
1172eHalStatus csrRoamRegisterCallback(tpAniSirGlobal pMac, csrRoamCompleteCallback callback, void *pContext);
1173/* ---------------------------------------------------------------------------
1174 \fn csrGetConfigParam
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001175 \brief HDD calls this function to get the global settings currently maintained by CSR.
Jeff Johnson295189b2012-06-20 16:38:30 -07001176 \param pParam - caller allocated memory
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001177 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001178 -------------------------------------------------------------------------------*/
1179eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1180
1181/* ---------------------------------------------------------------------------
1182 \fn csrMsgProcessor
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001183 \brief HDD calls this function to change some global settings.
Jeff Johnson295189b2012-06-20 16:38:30 -07001184 caller must set the all fields or call csrGetConfigParam to prefill the fields.
1185 \param pParam - caller allocated memory
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001186 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001187 -------------------------------------------------------------------------------*/
1188eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1189
1190
1191/* ---------------------------------------------------------------------------
1192 \fn csrMsgProcessor
1193 \brief HDD calls this function for the messages that are handled by CSR.
1194 \param pMsgBuf - a pointer to a buffer that maps to various structures base on the message type.
1195 The beginning of the buffer can always map to tSirSmeRsp.
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001196 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001197 -------------------------------------------------------------------------------*/
1198eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf );
1199
1200/* ---------------------------------------------------------------------------
1201 \fn csrOpen
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001202 \brief This function must be called before any API call to CSR.
1203 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001204 -------------------------------------------------------------------------------*/
1205eHalStatus csrOpen(tpAniSirGlobal pMac);
1206/* ---------------------------------------------------------------------------
1207 \fn csrClose
1208 \brief To close down CSR module. There should not be any API call into CSR after calling this function.
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001209 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001210 -------------------------------------------------------------------------------*/
1211eHalStatus csrClose(tpAniSirGlobal pMac);
1212/* ---------------------------------------------------------------------------
1213 \fn csrStart
1214 \brief To start CSR.
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001215 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001216 -------------------------------------------------------------------------------*/
1217eHalStatus csrStart(tpAniSirGlobal pMac);
1218/* ---------------------------------------------------------------------------
1219 \fn csrStop
1220 \brief To stop CSR. CSR still keeps its current setting.
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001221 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001222 -------------------------------------------------------------------------------*/
1223eHalStatus csrStop(tpAniSirGlobal pMac);
1224/* ---------------------------------------------------------------------------
1225 \fn csrReady
1226 \brief To let CSR is ready to operate
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001227 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001228 -------------------------------------------------------------------------------*/
1229eHalStatus csrReady(tpAniSirGlobal pMac);
1230
1231#ifdef FEATURE_WLAN_WAPI
1232eHalStatus csrRoamGetBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pNum,
1233 tBkidCacheInfo *pBkidCache);
1234
1235
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001236eHalStatus csrScanGetBKIDCandidateList(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001237 tBkidCandidateInfo *pBkidList, tANI_U32 *pNumItems );
1238tANI_U32 csrRoamGetNumBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId);
1239eHalStatus csrRoamSetBKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache,
1240 tANI_U32 numItems );
1241/* ---------------------------------------------------------------------------
1242 \fn csrRoamGetWapiReqIE
1243 \brief return the WAPI IE CSR passes to PE to JOIN request or START_BSS request
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001244 \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 -07001245 needed or IE length in pBuf.
1246 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1247 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1248 -------------------------------------------------------------------------------*/
1249eHalStatus csrRoamGetWapiReqIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
1250
1251/* ---------------------------------------------------------------------------
1252 \fn csrRoamGetWapiRspIE
1253 \brief return the WAPI IE from the beacon or probe rsp if connected
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001254 \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 -07001255 needed or IE length in pBuf.
1256 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1257 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1258 -------------------------------------------------------------------------------*/
1259eHalStatus csrRoamGetWapiRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001260tANI_U8 csrConstructWapiIe( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
Jeff Johnson295189b2012-06-20 16:38:30 -07001261 tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes, tCsrWapiIe *pWapiIe );
1262#endif /* FEATURE_WLAN_WAPI */
1263
Jeff Johnson295189b2012-06-20 16:38:30 -07001264eHalStatus csrRoamUpdateAPWPSIE( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirAPWPSIEs *pAPWPSIES );
1265eHalStatus csrRoamUpdateWPARSNIEs( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirRSNie * pAPSirRSNie);
Jeff Johnson295189b2012-06-20 16:38:30 -07001266void csrSetCfgPrivacy( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, tANI_BOOLEAN fPrivacy );
1267tANI_S8 csrGetInfraSessionId( tpAniSirGlobal pMac );
1268tANI_U8 csrGetInfraOperationChannel( tpAniSirGlobal pMac, tANI_U8 sessionId);
1269tANI_U8 csrGetConcurrentOperationChannel( tpAniSirGlobal pMac );
1270
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001271eHalStatus csrRoamCopyConnectProfile(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001272 tCsrRoamConnectedProfile *pProfile);
1273tANI_BOOLEAN csrIsSetKeyAllowed(tpAniSirGlobal pMac, tANI_U32 sessionId);
1274
1275void csrSetOppositeBandChannelInfo( tpAniSirGlobal pMac );
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001276void csrConstructCurrentValidChannelList( tpAniSirGlobal pMac, tDblLinkList *pChannelSetList,
Jeff Johnson295189b2012-06-20 16:38:30 -07001277 tANI_U8 *pChannelList, tANI_U8 bSize, tANI_U8 *pNumChannels );
1278
1279#endif
1280
1281#ifdef WLAN_FEATURE_VOWIFI_11R
1282//Returns whether the current association is a 11r assoc or not
1283tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac);
1284#endif
1285
1286#ifdef FEATURE_WLAN_CCX
1287//Returns whether the current association is a CCX assoc or not
1288tANI_BOOLEAN csrRoamIsCCXAssoc(tpAniSirGlobal pMac);
1289#endif
1290
Kiran Kumar Lokere30b07722013-02-24 22:21:28 -08001291//Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -07001292//BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnson295189b2012-06-20 16:38:30 -07001293void csrDisconnectAllActiveSessions(tpAniSirGlobal pMac);
Mohit Khanna349bc392012-09-11 17:24:52 -07001294
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001295#ifdef FEATURE_WLAN_LFR
1296//Returns whether "Legacy Fast Roaming" is enabled...or not
Madan Mohan Koyyalamudi03aae5f2012-11-28 01:51:22 +05301297tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac, tANI_U32 sessionId);
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -07001298tANI_BOOLEAN csrIsChannelPresentInList( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
1299VOS_STATUS csrAddToChannelListFront( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001300#endif
1301