blob: c2a828a3158065ed663d6631bb337386cfaa0b34 [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
42/** ------------------------------------------------------------------------- *
43 ------------------------------------------------------------------------- *
44
45
46 \file csrInsideApi.h
47
48 Define interface only used by CSR.
49
50
51 Copyright (C) 2006 Airgo Networks, Incorporated
52 ========================================================================== */
53#ifndef CSR_INSIDE_API_H__
54#define CSR_INSIDE_API_H__
55
56
57#include "csrSupport.h"
58#include "smeInside.h"
59#include "vos_nvitem.h"
60
61#define CSR_PASSIVE_MAX_CHANNEL_TIME 110
62#define CSR_PASSIVE_MIN_CHANNEL_TIME 60
63
64#define CSR_ACTIVE_MAX_CHANNEL_TIME 40
65#define CSR_ACTIVE_MIN_CHANNEL_TIME 20
66
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -080067#define CSR_ACTIVE_MAX_CHANNEL_TIME_BTC 120
68#define CSR_ACTIVE_MIN_CHANNEL_TIME_BTC 60
69
Jeff Johnson295189b2012-06-20 16:38:30 -070070#ifdef WLAN_AP_STA_CONCURRENCY
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -070071#define CSR_PASSIVE_MAX_CHANNEL_TIME_CONC 110
72#define CSR_PASSIVE_MIN_CHANNEL_TIME_CONC 60
73
Jeff Johnson295189b2012-06-20 16:38:30 -070074#define CSR_ACTIVE_MAX_CHANNEL_TIME_CONC 27
75#define CSR_ACTIVE_MIN_CHANNEL_TIME_CONC 20
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -070076
Madan Mohan Koyyalamudi4805fa82012-11-09 17:53:39 -080077#define CSR_REST_TIME_CONC 100
Vinay Malekal05fdc812012-12-17 13:04:30 -080078
Sudhir Sattayappa Kohallieb97d502013-05-22 23:16:42 -070079#define CSR_NUM_STA_CHAN_COMBINED_CONC 3
80#define CSR_NUM_P2P_CHAN_COMBINED_CONC 1
Jeff Johnson295189b2012-06-20 16:38:30 -070081#endif
82
83#define CSR_MAX_NUM_SUPPORTED_CHANNELS 55
84
Jeff Johnsone7245742012-09-05 17:12:55 -070085#define CSR_MAX_2_4_GHZ_SUPPORTED_CHANNELS 14
86
Madan Mohan Koyyalamudiceb8f252012-12-03 16:41:42 -080087#define CSR_MAX_BSS_SUPPORT 250
Srinivas Girigowda5cecb202013-10-08 09:13:25 -070088#define SYSTEM_TIME_MSEC_TO_USEC 1000
Jeff Johnson295189b2012-06-20 16:38:30 -070089
90//This number minus 1 means the number of times a channel is scanned before a BSS is remvoed from
91//cache scan result
92#define CSR_AGING_COUNT 3
93//The following defines are used by palTimer
94//This is used for palTimer when request to imps fails
95#define CSR_IDLE_SCAN_WAIT_TIME (1 * PAL_TIMER_TO_SEC_UNIT) //1 second
96//This is used for palTimer when imps ps is disabled
97//This number shall not be smaller than 5-6 seconds in general because a full scan may take 3-4 seconds
98#define CSR_IDLE_SCAN_NO_PS_INTERVAL (10 * PAL_TIMER_TO_SEC_UNIT) //10 second
99#define CSR_IDLE_SCAN_NO_PS_INTERVAL_MIN (5 * PAL_TIMER_TO_SEC_UNIT)
100#define CSR_SCAN_GET_RESULT_INTERVAL (5 * PAL_TIMER_TO_SEC_UNIT) //5 seconds
Jeff Johnson295189b2012-06-20 16:38:30 -0700101#define CSR_MIC_ERROR_TIMEOUT (60 * PAL_TIMER_TO_SEC_UNIT) //60 seconds
102#define CSR_TKIP_COUNTER_MEASURE_TIMEOUT (60 * PAL_TIMER_TO_SEC_UNIT) //60 seconds
103#define CSR_SCAN_RESULT_AGING_INTERVAL (5 * PAL_TIMER_TO_SEC_UNIT) //5 seconds
Sandeep Puligilla2b6dc632012-12-17 14:44:16 -0800104#define CSR_SCAN_RESULT_CFG_AGING_INTERVAL (PAL_TIMER_TO_SEC_UNIT) // 1 second
Jeff Johnson295189b2012-06-20 16:38:30 -0700105//the following defines are NOT used by palTimer
106#define CSR_SCAN_AGING_TIME_NOT_CONNECT_NO_PS 50 //50 seconds
107#define CSR_SCAN_AGING_TIME_NOT_CONNECT_W_PS 300 //300 seconds
108#define CSR_SCAN_AGING_TIME_CONNECT_NO_PS 150 //150 seconds
109#define CSR_SCAN_AGING_TIME_CONNECT_W_PS 600 //600 seconds
110#define CSR_JOIN_FAILURE_TIMEOUT_DEFAULT ( 3000 )
Jeff Johnsone7245742012-09-05 17:12:55 -0700111#define CSR_JOIN_FAILURE_TIMEOUT_MIN (1000) //minimal value
Jeff Johnson295189b2012-06-20 16:38:30 -0700112//These are going against the signed RSSI (tANI_S8) so it is between -+127
113#define CSR_BEST_RSSI_VALUE (-30) //RSSI >= this is in CAT4
114#define CSR_DEFAULT_RSSI_DB_GAP 30 //every 30 dbm for one category
115#define CSR_BSS_CAP_VALUE_NONE 0 //not much value
116#define CSR_BSS_CAP_VALUE_HT 2
117#define CSR_BSS_CAP_VALUE_WMM 1
118#define CSR_BSS_CAP_VALUE_UAPSD 1
Madan Mohan Koyyalamudid5026072012-11-30 14:56:21 -0800119#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
120#define CSR_BSS_CAP_VALUE_5GHZ 1
121#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700122#define CSR_DEFAULT_ROAMING_TIME 10 //10 seconds
123#define CSR_ROAM_MIN(X, Y) ((X) < (Y) ? (X) : (Y))
124#define CSR_ROAM_MAX(X, Y) ((X) > (Y) ? (X) : (Y))
125
126#ifdef FEATURE_WLAN_BTAMP_UT_RF
127#define CSR_JOIN_MAX_RETRY_COUNT 10
128#define CSR_JOIN_RETRY_TIMEOUT_PERIOD ( 1 * PAL_TIMER_TO_SEC_UNIT ) // 1 second
129#endif
130
131typedef enum
132{
133 eCsrNextScanNothing,
134 eCsrNextLostLinkScan1Success,
135 eCsrNextLostLinkScan1Failed,
136 eCsrNextLostLinkScan2Success,
137 eCsrNextLostLinkScan2Failed,
138 eCsrNextLostLinkScan3Success,
139 eCsrNexteScanForSsidSuccess,
140 eCsrNextLostLinkScan3Failed,
141 eCsrNext11dScan1Failure,
142 eCsrNext11dScan1Success,
143 eCsrNext11dScan2Failure,
144 eCsrNext11dScan2Success,
145 eCsrNext11dScanComplete,
146 eCsrNexteScanForSsidFailure,
147 eCsrNextIdleScanComplete,
148 eCsrNextCapChangeScanComplete,
149
150}eCsrScanCompleteNextCommand;
151
152typedef enum
153{
154 eCsrJoinSuccess,
155 eCsrJoinFailure,
156 eCsrReassocSuccess,
157 eCsrReassocFailure,
158 eCsrNothingToJoin,
159 eCsrStartBssSuccess,
160 eCsrStartBssFailure,
161 eCsrSilentlyStopRoaming,
162 eCsrSilentlyStopRoamingSaveState,
163 eCsrJoinWdsFailure,
Jeff Johnsone7245742012-09-05 17:12:55 -0700164 eCsrJoinFailureDueToConcurrency,
Jeff Johnson295189b2012-06-20 16:38:30 -0700165
166}eCsrRoamCompleteResult;
167
168typedef struct tagScanReqParam
169{
170 tANI_U8 bReturnAfter1stMatch;
171 tANI_U8 fUniqueResult;
172 tANI_U8 freshScan;
173 tANI_U8 hiddenSsid;
174 tANI_U8 reserved;
175}tScanReqParam;
176
177typedef struct tagCsrScanResult
178{
179 tListElem Link;
180 tANI_S32 AgingCount; //This BSS is removed when it reaches 0 or less
181 tANI_U32 preferValue; //The bigger the number, the better the BSS. This value override capValue
182 tANI_U32 capValue; //The biggger the better. This value is in use only if we have equal preferValue
183 //This member must be the last in the structure because the end of tSirBssDescription (inside) is an
184 // array with nonknown size at this time
185
186 eCsrEncryptionType ucEncryptionType; //Preferred Encryption type that matched with profile.
187 eCsrEncryptionType mcEncryptionType;
188 eCsrAuthType authType; //Preferred auth type that matched with the profile.
189
190 tCsrScanResultInfo Result;
191}tCsrScanResult;
192
193typedef struct
194{
195 tDblLinkList List;
196 tListElem *pCurEntry;
197}tScanResultList;
198
199
200
201
202#define CSR_IS_ROAM_REASON( pCmd, reason ) ( (reason) == (pCmd)->roamCmd.roamReason )
203#define CSR_IS_BETTER_PREFER_VALUE(v1, v2) ((v1) > (v2))
204#define CSR_IS_EQUAL_PREFER_VALUE(v1, v2) ((v1) == (v2))
205#define CSR_IS_BETTER_CAP_VALUE(v1, v2) ((v1) > (v2))
206#define CSR_IS_ENC_TYPE_STATIC( encType ) ( ( eCSR_ENCRYPT_TYPE_NONE == (encType) ) || \
207 ( eCSR_ENCRYPT_TYPE_WEP40_STATICKEY == (encType) ) || \
208 ( eCSR_ENCRYPT_TYPE_WEP104_STATICKEY == (encType) ) )
209#define CSR_IS_WAIT_FOR_KEY( pMac, sessionId ) ( CSR_IS_ROAM_JOINED( pMac, sessionId ) && CSR_IS_ROAM_SUBSTATE_WAITFORKEY( pMac, sessionId ) )
210//WIFI has a test case for not using HT rates with TKIP as encryption
211//We may need to add WEP but for now, TKIP only.
212
213#define CSR_IS_11n_ALLOWED( encType ) (( eCSR_ENCRYPT_TYPE_TKIP != (encType) ) && \
214 ( eCSR_ENCRYPT_TYPE_WEP40_STATICKEY != (encType) ) && \
215 ( eCSR_ENCRYPT_TYPE_WEP104_STATICKEY != (encType) ) && \
216 ( eCSR_ENCRYPT_TYPE_WEP40 != (encType) ) && \
217 ( eCSR_ENCRYPT_TYPE_WEP104 != (encType) ) )
218
219eCsrRoamState csrRoamStateChange( tpAniSirGlobal pMac, eCsrRoamState NewRoamState, tANI_U8 sessionId);
220eHalStatus csrScanningStateMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf );
221void csrRoamingStateMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf );
222void csrRoamJoinedStateMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf );
223tANI_BOOLEAN csrScanComplete( tpAniSirGlobal pMac, tSirSmeScanRsp *pScanRsp );
224void csrReleaseCommandRoam(tpAniSirGlobal pMac, tSmeCmd *pCommand);
225void csrReleaseCommandScan(tpAniSirGlobal pMac, tSmeCmd *pCommand);
226void csrReleaseCommandWmStatusChange(tpAniSirGlobal pMac, tSmeCmd *pCommand);
227//pIes2 can be NULL
228tANI_BOOLEAN csrIsDuplicateBssDescription( tpAniSirGlobal pMac, tSirBssDescription *pSirBssDesc1,
Tushnim Bhattacharyya5128d752013-06-26 23:23:18 -0700229 tSirBssDescription *pSirBssDesc2, tDot11fBeaconIEs *pIes2, tANI_BOOLEAN fForced );
Jeff Johnson295189b2012-06-20 16:38:30 -0700230eHalStatus csrRoamSaveConnectedBssDesc( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDescription *pBssDesc );
231tANI_BOOLEAN csrIsNetworkTypeEqual( tSirBssDescription *pSirBssDesc1, tSirBssDescription *pSirBssDesc2 );
232eHalStatus csrScanSmeScanResponse( tpAniSirGlobal pMac, void *pMsgBuf );
233/*
234 Prepare a filter base on a profile for parsing the scan results.
235 Upon successful return, caller MUST call csrFreeScanFilter on
236 pScanFilter when it is done with the filter.
237*/
238eHalStatus csrRoamPrepareFilterFromProfile(tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, tCsrScanResultFilter *pScanFilter);
239eHalStatus csrRoamCopyProfile(tpAniSirGlobal pMac, tCsrRoamProfile *pDstProfile, tCsrRoamProfile *pSrcProfile);
240eHalStatus csrRoamStart(tpAniSirGlobal pMac);
241void csrRoamStop(tpAniSirGlobal pMac, tANI_U32 sessionId);
242void csrRoamStartMICFailureTimer(tpAniSirGlobal pMac);
243void csrRoamStopMICFailureTimer(tpAniSirGlobal pMac);
244void csrRoamStartTKIPCounterMeasureTimer(tpAniSirGlobal pMac);
245void csrRoamStopTKIPCounterMeasureTimer(tpAniSirGlobal pMac);
246
247eHalStatus csrScanOpen(tpAniSirGlobal pMac);
248eHalStatus csrScanClose(tpAniSirGlobal pMac);
249eHalStatus csrScanRequestLostLink1( tpAniSirGlobal pMac, tANI_U32 sessionId );
250eHalStatus csrScanRequestLostLink2( tpAniSirGlobal pMac, tANI_U32 sessionId );
251eHalStatus csrScanRequestLostLink3( tpAniSirGlobal pMac, tANI_U32 sessionId );
252eHalStatus csrScanHandleFailedLostlink1(tpAniSirGlobal pMac, tANI_U32 sessionId);
253eHalStatus csrScanHandleFailedLostlink2(tpAniSirGlobal pMac, tANI_U32 sessionId);
254eHalStatus csrScanHandleFailedLostlink3(tpAniSirGlobal pMac, tANI_U32 sessionId);
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700255tCsrScanResult *csrScanAppendBssDescription( tpAniSirGlobal pMac,
Jeff Johnson295189b2012-06-20 16:38:30 -0700256 tSirBssDescription *pSirBssDescription,
Tushnim Bhattacharyya5128d752013-06-26 23:23:18 -0700257 tDot11fBeaconIEs *pIes, tANI_BOOLEAN fForced);
Jeff Johnson295189b2012-06-20 16:38:30 -0700258void csrScanCallCallback(tpAniSirGlobal pMac, tSmeCmd *pCommand, eCsrScanStatus scanStatus);
259eHalStatus csrScanCopyRequest(tpAniSirGlobal pMac, tCsrScanRequest *pDstReq, tCsrScanRequest *pSrcReq);
260eHalStatus csrScanFreeRequest(tpAniSirGlobal pMac, tCsrScanRequest *pReq);
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700261eHalStatus csrScanCopyResultList(tpAniSirGlobal pMac, tScanResultHandle hIn, tScanResultHandle *phResult);
Jeff Johnson295189b2012-06-20 16:38:30 -0700262void csrInitBGScanChannelList(tpAniSirGlobal pMac);
Varun Reddy Yeturucc661d22013-05-20 11:47:10 -0700263eHalStatus csrScanForSSID(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile, tANI_U32 roamId, tANI_BOOLEAN notify);
Jeff Johnson295189b2012-06-20 16:38:30 -0700264eHalStatus csrScanForCapabilityChange(tpAniSirGlobal pMac, tSirSmeApNewCaps *pNewCaps);
265eHalStatus csrScanStartGetResultTimer(tpAniSirGlobal pMac);
266eHalStatus csrScanStopGetResultTimer(tpAniSirGlobal pMac);
267eHalStatus csrScanStartResultAgingTimer(tpAniSirGlobal pMac);
268eHalStatus csrScanStopResultAgingTimer(tpAniSirGlobal pMac);
Sandeep Puligilla2b6dc632012-12-17 14:44:16 -0800269eHalStatus csrScanStartResultCfgAgingTimer(tpAniSirGlobal pMac);
270eHalStatus csrScanStopResultCfgAgingTimer(tpAniSirGlobal pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -0700271eHalStatus csrScanBGScanEnable(tpAniSirGlobal pMac);
272eHalStatus csrScanStartIdleScanTimer(tpAniSirGlobal pMac, tANI_U32 interval);
273eHalStatus csrScanStopIdleScanTimer(tpAniSirGlobal pMac);
274eHalStatus csrScanStartIdleScan(tpAniSirGlobal pMac);
275//Param: pTimeInterval -- Caller allocated memory in return, if failed, to specify the nxt time interval for
276//idle scan timer interval
277//Return: Not success -- meaning it cannot start IMPS, caller needs to start a timer for idle scan
278eHalStatus csrScanTriggerIdleScan(tpAniSirGlobal pMac, tANI_U32 *pTimeInterval);
279void csrScanCancelIdleScan(tpAniSirGlobal pMac);
280void csrScanStopTimers(tpAniSirGlobal pMac);
281//This function will remove scan commands that are not related to association or IBSS
282tANI_BOOLEAN csrScanRemoveNotRoamingScanCommand(tpAniSirGlobal pMac);
283//To remove fresh scan commands from the pending queue
284tANI_BOOLEAN csrScanRemoveFreshScanCommand(tpAniSirGlobal pMac, tANI_U8 sessionId);
Srinivas, Dasari138af4f2014-02-07 11:13:45 +0530285eHalStatus csrScanAbortMacScan(tpAniSirGlobal pMac, tANI_U8 sessionId,
286 eCsrAbortReason reason);
Jeff Johnson295189b2012-06-20 16:38:30 -0700287void csrRemoveCmdFromPendingList(tpAniSirGlobal pMac, tDblLinkList *pList,
288 eSmeCommandType commandType );
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530289void csrRemoveCmdWithSessionIdFromPendingList(tpAniSirGlobal pMac,
290 tANI_U8 sessionId,
291 tDblLinkList *pList,
292 eSmeCommandType commandType);
293eHalStatus csrScanAbortMacScanNotForConnect(tpAniSirGlobal pMac,
294 tANI_U8 sessionId);
Madan Mohan Koyyalamudide1b5bc2013-07-12 00:56:04 +0530295eHalStatus csrScanGetScanChannelInfo(tpAniSirGlobal pMac, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700296//To age out scan results base. tSmeGetScanChnRsp is a pointer returned by LIM that
297//has the information regarding scanned channels.
298//The logic is that whenever CSR add a BSS to scan result, it set the age count to
299//a value. This function deduct the age count if channelId matches the BSS' channelId
300//The BSS is remove if the count reaches 0.
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700301eHalStatus csrScanAgeResults(tpAniSirGlobal pMac, tSmeGetScanChnRsp *pScanChnInfo);
Jeff Johnson295189b2012-06-20 16:38:30 -0700302
303//If fForce is TRUE we will save the new String that is learn't.
304//Typically it will be true in case of Join or user initiated ioctl
305tANI_BOOLEAN csrLearnCountryInformation( tpAniSirGlobal pMac, tSirBssDescription *pSirBssDesc,
306 tDot11fBeaconIEs *pIes, tANI_BOOLEAN fForce );
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700307void csrApplyCountryInformation( tpAniSirGlobal pMac, tANI_BOOLEAN fForce );
Jeff Johnson295189b2012-06-20 16:38:30 -0700308void csrSetCfgScanControlList( tpAniSirGlobal pMac, tANI_U8 *countryCode, tCsrChannel *pChannelList );
309void csrReinitScanCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
310void csrFreeScanResultEntry( tpAniSirGlobal pMac, tCsrScanResult *pResult );
311
312eHalStatus csrRoamCallCallback(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamInfo *pRoamInfo,
313 tANI_U32 roamId, eRoamCmdStatus u1, eCsrRoamResult u2);
314eHalStatus csrRoamIssueConnect(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
315 tScanResultHandle hBSSList,
316 eCsrRoamReason reason, tANI_U32 roamId,
317 tANI_BOOLEAN fImediate, tANI_BOOLEAN fClearScan);
318eHalStatus csrRoamIssueReassoc(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
319 tCsrRoamModifyProfileFields *pModProfileFields,
320 eCsrRoamReason reason, tANI_U32 roamId, tANI_BOOLEAN fImediate);
321void csrRoamComplete( tpAniSirGlobal pMac, eCsrRoamCompleteResult Result, void *Context );
322eHalStatus csrRoamIssueSetContextReq( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrEncryptionType EncryptType,
323 tSirBssDescription *pBssDescription,
324 tSirMacAddr *bssId, tANI_BOOLEAN addKey,
325 tANI_BOOLEAN fUnicast, tAniKeyDirection aniKeyDirection,
326 tANI_U8 keyId, tANI_U16 keyLength,
327 tANI_U8 *pKey, tANI_U8 paeRole );
328eHalStatus csrRoamProcessDisassocDeauth( tpAniSirGlobal pMac, tSmeCmd *pCommand,
329 tANI_BOOLEAN fDisassoc, tANI_BOOLEAN fMICFailure );
330eHalStatus csrRoamSaveConnectedInfomation(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
331 tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes);
332void csrRoamCheckForLinkStatusChange( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg );
333void csrRoamStatsRspProcessor(tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg);
334eHalStatus csrRoamIssueStartBss( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamStartBssParams *pParam,
335 tCsrRoamProfile *pProfile, tSirBssDescription *pBssDesc, tANI_U32 roamId );
336eHalStatus csrRoamIssueStopBss( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamSubState NewSubstate );
337tANI_BOOLEAN csrIsSameProfile(tpAniSirGlobal pMac, tCsrRoamConnectedProfile *pProfile1, tCsrRoamProfile *pProfile2);
338tANI_BOOLEAN csrIsRoamCommandWaiting(tpAniSirGlobal pMac);
339tANI_BOOLEAN csrIsRoamCommandWaitingForSession(tpAniSirGlobal pMac, tANI_U32 sessionId);
340tANI_BOOLEAN csrIsScanForRoamCommandActive( tpAniSirGlobal pMac );
341eRoamCmdStatus csrGetRoamCompleteStatus(tpAniSirGlobal pMac, tANI_U32 sessionId);
342//pBand can be NULL if caller doesn't need to get it
343//eCsrCfgDot11Mode csrRoamGetPhyModeBandForBss( tpAniSirGlobal pMac, eCsrPhyMode phyModeIn, tANI_U8 operationChn, eCsrBand *pBand );
344eHalStatus csrRoamIssueDisassociateCmd( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamDisconnectReason reason );
345eHalStatus csrRoamDisconnectInternal(tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamDisconnectReason reason);
346//pCommand may be NULL
347void csrRoamRemoveDuplicateCommand(tpAniSirGlobal pMac, tANI_U32 sessionId, tSmeCmd *pCommand, eCsrRoamReason eRoamReason);
348
349eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDescription *pBssDescription,
Srinivas Girigowdac16730e2013-01-16 13:39:39 -0800350 tCsrRoamProfile *pProfile, tDot11fBeaconIEs *pIes, tANI_U16 messageType );
Jeff Johnson295189b2012-06-20 16:38:30 -0700351eHalStatus csrSendMBDisassocReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirMacAddr bssId, tANI_U16 reasonCode );
352eHalStatus csrSendMBDeauthReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirMacAddr bssId, tANI_U16 reasonCode );
353eHalStatus csrSendMBDisassocCnfMsg( tpAniSirGlobal pMac, tpSirSmeDisassocInd pDisassocInd );
354eHalStatus csrSendMBDeauthCnfMsg( tpAniSirGlobal pMac, tpSirSmeDeauthInd pDeauthInd );
355eHalStatus csrSendAssocCnfMsg( tpAniSirGlobal pMac, tpSirSmeAssocInd pAssocInd, eHalStatus status );
Jeff Johnson295189b2012-06-20 16:38:30 -0700356eHalStatus csrSendAssocIndToUpperLayerCnfMsg( tpAniSirGlobal pMac, tpSirSmeAssocInd pAssocInd, eHalStatus Halstatus, tANI_U8 sessionId );
Jeff Johnson295189b2012-06-20 16:38:30 -0700357eHalStatus csrSendMBStartBssReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamBssType bssType,
358 tCsrRoamStartBssParams *pParam, tSirBssDescription *pBssDesc );
359eHalStatus csrSendMBStopBssReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId );
Jeff Johnson295189b2012-06-20 16:38:30 -0700360
361tANI_BOOLEAN csrIsMacAddressEqual( tpAniSirGlobal pMac, tCsrBssid *pMacAddr1, tCsrBssid *pMacAddr2 );
362//Caller should put the BSS' ssid to fiedl bssSsid when comparing SSID for a BSS.
363tANI_BOOLEAN csrIsSsidMatch( tpAniSirGlobal pMac, tANI_U8 *ssid1, tANI_U8 ssid1Len, tANI_U8 *bssSsid,
364 tANI_U8 bssSsidLen, tANI_BOOLEAN fSsidRequired );
365tANI_BOOLEAN csrIsPhyModeMatch( tpAniSirGlobal pMac, tANI_U32 phyMode,
366 tSirBssDescription *pSirBssDesc, tCsrRoamProfile *pProfile,
367 eCsrCfgDot11Mode *pReturnCfgDot11Mode,
368 tDot11fBeaconIEs *pIes);
369tANI_BOOLEAN csrRoamIsChannelValid( tpAniSirGlobal pMac, tANI_U8 channel );
370
371//pNumChan is a caller allocated space with the sizeof pChannels
372eHalStatus csrGetCfgValidChannels(tpAniSirGlobal pMac, tANI_U8 *pChannels, tANI_U32 *pNumChan);
373void csrRoamCcmCfgSetCallback(tHalHandle hHal, tANI_S32 result);
374void csrScanCcmCfgSetCallback(tHalHandle hHal, tANI_S32 result);
375
Kiran4a17ebe2013-01-31 10:43:43 -0800376tPowerdBm csrGetCfgMaxTxPower (tpAniSirGlobal pMac, tANI_U8 channel);
377
Jeff Johnson295189b2012-06-20 16:38:30 -0700378//To free the last roaming profile
379void csrFreeRoamProfile(tpAniSirGlobal pMac, tANI_U32 sessionId);
380void csrFreeConnectBssDesc(tpAniSirGlobal pMac, tANI_U32 sessionId);
381eHalStatus csrMoveBssToHeadFromBSSID(tpAniSirGlobal pMac, tCsrBssid *bssid, tScanResultHandle hScanResult);
382tANI_BOOLEAN csrCheckPSReady(void *pv);
383void csrFullPowerCallback(void *pv, eHalStatus status);
384//to free memory allocated inside the profile structure
385void csrReleaseProfile(tpAniSirGlobal pMac, tCsrRoamProfile *pProfile);
386//To free memory allocated inside scanFilter
387void csrFreeScanFilter(tpAniSirGlobal pMac, tCsrScanResultFilter *pScanFilter);
Jeff Johnson295189b2012-06-20 16:38:30 -0700388eCsrCfgDot11Mode csrGetCfgDot11ModeFromCsrPhyMode(tCsrRoamProfile *pProfile, eCsrPhyMode phyMode, tANI_BOOLEAN fProprietary);
Jeff Johnson295189b2012-06-20 16:38:30 -0700389tANI_U32 csrTranslateToWNICfgDot11Mode(tpAniSirGlobal pMac, eCsrCfgDot11Mode csrDot11Mode);
390void csrSaveChannelPowerForBand( tpAniSirGlobal pMac, tANI_BOOLEAN fPopulate5GBand );
Gopichand Nakkalab9185f22012-12-21 08:03:42 -0800391void csrApplyChannelPowerCountryInfo( tpAniSirGlobal pMac, tCsrChannel *pChannelList, tANI_U8 *countryCode, tANI_BOOLEAN updateRiva);
Jeff Johnsone7245742012-09-05 17:12:55 -0700392void csrApplyPower2Current( tpAniSirGlobal pMac );
Srinivas Girigowda41c7c5f2013-10-21 19:01:38 -0700393void csrAssignRssiForCategory(tpAniSirGlobal pMac, tANI_S8 bestApRssi, tANI_U8 catOffset);
Jeff Johnson295189b2012-06-20 16:38:30 -0700394tANI_BOOLEAN csrIsMacAddressZero( tpAniSirGlobal pMac, tCsrBssid *pMacAddr );
395tANI_BOOLEAN csrIsMacAddressBroadcast( tpAniSirGlobal pMac, tCsrBssid *pMacAddr );
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700396eHalStatus csrRoamRemoveConnectedBssFromScanCache(tpAniSirGlobal pMac, tCsrRoamConnectedProfile *pConnProfile);
Jeff Johnson295189b2012-06-20 16:38:30 -0700397eHalStatus csrRoamStartRoaming(tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamingReason roamingReason);
398//return a boolean to indicate whether roaming completed or continue.
399tANI_BOOLEAN csrRoamCompleteRoaming(tpAniSirGlobal pMac, tANI_U32 sessionId,
400 tANI_BOOLEAN fForce, eCsrRoamResult roamResult);
401void csrRoamCompletion(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamInfo *pRoamInfo, tSmeCmd *pCommand, eCsrRoamResult roamResult, tANI_BOOLEAN fSuccess);
402void csrRoamCancelRoaming(tpAniSirGlobal pMac, tANI_U32 sessionId);
Gopichand Nakkalab9185f22012-12-21 08:03:42 -0800403void csrResetCountryInformation( tpAniSirGlobal pMac, tANI_BOOLEAN fForce, tANI_BOOLEAN updateRiva );
Jeff Johnson295189b2012-06-20 16:38:30 -0700404void csrResetPMKIDCandidateList( tpAniSirGlobal pMac, tANI_U32 sessionId );
405#ifdef FEATURE_WLAN_WAPI
406void csrResetBKIDCandidateList( tpAniSirGlobal pMac, tANI_U32 sessionId );
407#endif /* FEATURE_WLAN_WAPI */
Jeff Johnsone7245742012-09-05 17:12:55 -0700408eHalStatus csrSaveToChannelPower2G_5G( tpAniSirGlobal pMac, tANI_U32 tableSize, tSirMacChanInfo *channelTable );
Jeff Johnson295189b2012-06-20 16:38:30 -0700409//Get the list of the base channels to scan for passively 11d info
410eHalStatus csrScanGetSupportedChannels( tpAniSirGlobal pMac );
411//To check whether a country code matches the one in the IE
412//Only check the first two characters, ignoring in/outdoor
413//pCountry -- caller allocated buffer contain the country code that is checking against
414//the one in pIes. It can be NULL.
415//caller must provide pIes, it cannot be NULL
416//This function always return TRUE if 11d support is not turned on.
417//pIes cannot be NULL
418tANI_BOOLEAN csrMatchCountryCode( tpAniSirGlobal pMac, tANI_U8 *pCountry, tDot11fBeaconIEs *pIes );
419eHalStatus csrRoamSetKey( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 roamId );
Kiran Kumar Lokere0ad5cd32013-06-25 11:26:22 -0700420eHalStatus csrRoamOpenSession(tpAniSirGlobal pMac,
421 csrRoamCompleteCallback callback,
422 void *pContext, tANI_U8 *pSelfMacAddr,
423 tANI_U8 *pbSessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700424//fSync: TRUE means cleanupneeds to handle synchronously.
425eHalStatus csrRoamCloseSession( tpAniSirGlobal pMac, tANI_U32 sessionId,
426 tANI_BOOLEAN fSync,
427 csrRoamSessionCloseCallback callback,
428 void *pContext );
429void csrCleanupSession(tpAniSirGlobal pMac, tANI_U32 sessionId);
430eHalStatus csrRoamGetSessionIdFromBSSID( tpAniSirGlobal pMac, tCsrBssid *bssid, tANI_U32 *pSessionId );
431eCsrCfgDot11Mode csrFindBestPhyMode( tpAniSirGlobal pMac, tANI_U32 phyMode );
432
433/* ---------------------------------------------------------------------------
434 \fn csrScanEnable
435 \brief Enable the scanning feature of CSR. It must be called before any scan request can be performed.
436 \param tHalHandle - HAL context handle
437 \return eHalStatus
438 -------------------------------------------------------------------------------*/
439eHalStatus csrScanEnable(tpAniSirGlobal);
440
441/* ---------------------------------------------------------------------------
442 \fn csrScanDisable
443 \brief Disableing the scanning feature of CSR. After this function return success, no scan is performed until
444a successfull to csrScanEnable
445 \param tHalHandle - HAL context handle
446 \return eHalStatus
447 -------------------------------------------------------------------------------*/
448eHalStatus csrScanDisable(tpAniSirGlobal);
449/* ---------------------------------------------------------------------------
450 \fn csrScanRequest
451 \brief Request a 11d or full scan.
452 \param pScanRequestID - pointer to an object to get back the request ID
453 \param callback - a callback function that scan calls upon finish, will not be called if csrScanRequest returns error
454 \param pContext - a pointer passed in for the callback
455 \return eHalStatus
456 -------------------------------------------------------------------------------*/
457eHalStatus csrScanRequest(tpAniSirGlobal, tANI_U16, tCsrScanRequest *,
458 tANI_U32 *pScanRequestID, csrScanCompleteCallback callback,
459 void *pContext);
460
461/* ---------------------------------------------------------------------------
462 \fn csrScanAbort
463 \brief If a scan request is abort, the scan complete callback will be called first before csrScanAbort returns.
464 \param pScanRequestID - The request ID returned from csrScanRequest
465 \return eHalStatus
466 -------------------------------------------------------------------------------*/
467eHalStatus csrScanAbort(tpAniSirGlobal, tANI_U32 scanRequestID);
468
469eHalStatus csrScanSetBGScanparams(tpAniSirGlobal, tCsrBGScanRequest *);
470eHalStatus csrScanBGScanAbort(tpAniSirGlobal);
471
472/* ---------------------------------------------------------------------------
473 \fn csrScanGetResult
474 \brief Return scan results.
475 \param pFilter - If pFilter is NULL, all cached results are returned
476 \param phResult - an object for the result.
477 \return eHalStatus
478 -------------------------------------------------------------------------------*/
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700479eHalStatus csrScanGetResult(tpAniSirGlobal, tCsrScanResultFilter *pFilter, tScanResultHandle *phResult);
Jeff Johnson295189b2012-06-20 16:38:30 -0700480
481/* ---------------------------------------------------------------------------
482 \fn csrScanFlushResult
483 \brief Clear scan results.
484 \return eHalStatus
485 -------------------------------------------------------------------------------*/
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700486eHalStatus csrScanFlushResult(tpAniSirGlobal);
Srinivas, Dasari42bf7702014-02-07 11:29:53 +0530487/* ---------------------------------------------------------------------------
488 * \fn csrScanFilterResults
489 * \brief Filter scan results based on valid channel list.
490 * \return eHalStatus
491 *-------------------------------------------------------------------------------
492 */
493eHalStatus csrScanFilterResults(tpAniSirGlobal pMac);
494
Madan Mohan Koyyalamudi5850f312012-11-27 19:00:25 +0530495eHalStatus csrScanFlushSelectiveResult(tpAniSirGlobal, v_BOOL_t flushP2P);
Jeff Johnson295189b2012-06-20 16:38:30 -0700496/* ---------------------------------------------------------------------------
497 \fn csrScanBGScanGetParam
498 \brief Returns the current background scan settings.
499 \return eHalStatus
500 -------------------------------------------------------------------------------*/
501eHalStatus csrScanBGScanGetParam(tpAniSirGlobal, tCsrBGScanRequest *);
502
503/* ---------------------------------------------------------------------------
504 \fn csrScanResultGetFirst
505 \brief Returns the first element of scan result.
506 \param hScanResult - returned from csrScanGetResult
507 \return tCsrScanResultInfo * - NULL if no result
508 -------------------------------------------------------------------------------*/
509tCsrScanResultInfo *csrScanResultGetFirst(tpAniSirGlobal, tScanResultHandle hScanResult);
510/* ---------------------------------------------------------------------------
511 \fn csrScanResultGetNext
512 \brief Returns the next element of scan result. It can be called without calling csrScanResultGetFirst first
513 \param hScanResult - returned from csrScanGetResult
514 \return Null if no result or reach the end
515 -------------------------------------------------------------------------------*/
516tCsrScanResultInfo *csrScanResultGetNext(tpAniSirGlobal, tScanResultHandle hScanResult);
517
518/* ---------------------------------------------------------------------------
519 \fn csrGetCountryCode
520 \brief this function is to get the country code current being used
521 \param pBuf - Caller allocated buffer with at least 3 bytes, upon success return, this has the country code
522 \param pbLen - Caller allocated, as input, it indicates the length of pBuf. Upon success return,
523 this contains the length of the data in pBuf
524 \return eHalStatus
525 -------------------------------------------------------------------------------*/
526eHalStatus csrGetCountryCode(tpAniSirGlobal pMac, tANI_U8 *pBuf, tANI_U8 *pbLen);
527
528/* ---------------------------------------------------------------------------
529 \fn csrSetCountryCode
530 \brief this function is to set the country code so channel/power setting matches the countrycode and
531 the domain it belongs to.
532 \param pCountry - Caller allocated buffer with at least 3 bytes specifying the country code
533 \param pfRestartNeeded - pointer to a caller allocated space. Upon successful return, it indicates whether
534 a restart is needed to apply the change
535 \return eHalStatus
536 -------------------------------------------------------------------------------*/
537eHalStatus csrSetCountryCode(tpAniSirGlobal pMac, tANI_U8 *pCountry, tANI_BOOLEAN *pfRestartNeeded);
538
539/* ---------------------------------------------------------------------------
540 \fn csrResetCountryCodeInformation
541 \brief this function is to reset the country code current being used back to EEPROM default
542 this includes channel list and power setting.
543 \param pfRestartNeeded - pointer to a caller allocated space. Upon successful return, it indicates whether
544 a restart is needed to apply the change
545 \return eHalStatus
546 -------------------------------------------------------------------------------*/
547eHalStatus csrResetCountryCodeInformation(tpAniSirGlobal pMac, tANI_BOOLEAN *pfRestartNeeded);
548
549/* ---------------------------------------------------------------------------
550 \fn csrGetSupportedCountryCode
551 \brief this function is to get a list of the country code current being supported
552 \param pBuf - Caller allocated buffer with at least 3 bytes, upon success return,
553 this has the country code list. 3 bytes for each country code. This may be NULL if
554 caller wants to know the needed bytes.
555 \param pbLen - Caller allocated, as input, it indicates the length of pBuf. Upon success return,
556 this contains the length of the data in pBuf
557 \return eHalStatus
558 -------------------------------------------------------------------------------*/
559eHalStatus csrGetSupportedCountryCode(tpAniSirGlobal pMac, tANI_U8 *pBuf, tANI_U32 *pbLen);
560
561/* ---------------------------------------------------------------------------
562 \fn csrSetRegulatoryDomain
563 \brief this function is to set the current regulatory domain.
564 This function must be called after CFG is downloaded and all the band/mode setting already passed into
565 CSR.
566 \param domainId - indicate the domain (defined in the driver) needs to set to.
567 See eRegDomainId for definition
568 \param pfRestartNeeded - pointer to a caller allocated space. Upon successful return, it indicates whether
569 a restart is needed to apply the change
570 \return eHalStatus
571 -------------------------------------------------------------------------------*/
572eHalStatus csrSetRegulatoryDomain(tpAniSirGlobal pMac, v_REGDOMAIN_t domainId, tANI_BOOLEAN *pfRestartNeeded);
573
574/* ---------------------------------------------------------------------------
575 \fn csrGetCurrentRegulatoryDomain
576 \brief this function is to get the current regulatory domain.
577 This function must be called after CFG is downloaded and all the band/mode setting already passed into
578 CSR.
579 \return eRegDomainId
580 -------------------------------------------------------------------------------*/
581v_REGDOMAIN_t csrGetCurrentRegulatoryDomain(tpAniSirGlobal pMac);
582
583/* ---------------------------------------------------------------------------
584 \fn csrGetRegulatoryDomainForCountry
585 \brief this function is to get the regulatory domain for a country.
586 This function must be called after CFG is downloaded and all the band/mode setting already passed into
587 CSR.
588 \param pCountry - Caller allocated buffer with at least 3 bytes specifying the country code
589 \param pDomainId - Caller allocated buffer to get the return domain ID upon success return. Can be NULL.
Kiet Lam6c583332013-10-14 05:37:09 +0530590 \param source - the source of country information.
Jeff Johnson295189b2012-06-20 16:38:30 -0700591 \return eHalStatus
592 -------------------------------------------------------------------------------*/
Kiet Lam6c583332013-10-14 05:37:09 +0530593eHalStatus csrGetRegulatoryDomainForCountry(tpAniSirGlobal pMac,
594 tANI_U8 *pCountry,
595 v_REGDOMAIN_t *pDomainId,
596 v_CountryInfoSource_t source);
Jeff Johnson295189b2012-06-20 16:38:30 -0700597
598
599tANI_BOOLEAN csrSave11dCountryString( tpAniSirGlobal pMac, tANI_U8 *pCountryCode, tANI_BOOLEAN fForce );
600
601//some support functions
602tANI_BOOLEAN csrIs11dSupported(tpAniSirGlobal pMac);
603tANI_BOOLEAN csrIs11hSupported(tpAniSirGlobal pMac);
604tANI_BOOLEAN csrIs11eSupported(tpAniSirGlobal pMac);
605tANI_BOOLEAN csrIsWmmSupported(tpAniSirGlobal pMac);
606tANI_BOOLEAN csrIsMCCSupported(tpAniSirGlobal pMac);
607
608//Upper layer to get the list of the base channels to scan for passively 11d info from csr
609eHalStatus csrScanGetBaseChannels( tpAniSirGlobal pMac, tCsrChannelInfo * pChannelInfo );
610//Return SUCCESS is the command is queued, failed
611eHalStatus csrQueueSmeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fHighPriority );
612tSmeCmd *csrGetCommandBuffer( tpAniSirGlobal pMac );
613void csrReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand);
614#ifdef FEATURE_WLAN_WAPI
615tANI_BOOLEAN csrIsProfileWapi( tCsrRoamProfile *pProfile );
616#endif /* FEATURE_WLAN_WAPI */
617
618#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
619
620//Security
621#define WLAN_SECURITY_EVENT_SET_PTK_REQ 1
622#define WLAN_SECURITY_EVENT_SET_PTK_RSP 2
623#define WLAN_SECURITY_EVENT_SET_GTK_REQ 3
624#define WLAN_SECURITY_EVENT_SET_GTK_RSP 4
625#define WLAN_SECURITY_EVENT_REMOVE_KEY_REQ 5
626#define WLAN_SECURITY_EVENT_REMOVE_KEY_RSP 6
627#define WLAN_SECURITY_EVENT_PMKID_CANDIDATE_FOUND 7
628#define WLAN_SECURITY_EVENT_PMKID_UPDATE 8
629#define WLAN_SECURITY_EVENT_MIC_ERROR 9
630
631#define AUTH_OPEN 0
632#define AUTH_SHARED 1
633#define AUTH_WPA_EAP 2
634#define AUTH_WPA_PSK 3
635#define AUTH_WPA2_EAP 4
636#define AUTH_WPA2_PSK 5
637#ifdef FEATURE_WLAN_WAPI
638#define AUTH_WAPI_CERT 6
639#define AUTH_WAPI_PSK 7
640#endif /* FEATURE_WLAN_WAPI */
641
642#define ENC_MODE_OPEN 0
643#define ENC_MODE_WEP40 1
644#define ENC_MODE_WEP104 2
645#define ENC_MODE_TKIP 3
646#define ENC_MODE_AES 4
647#ifdef FEATURE_WLAN_WAPI
648#define ENC_MODE_SMS4 5 //WAPI
649#endif /* FEATURE_WLAN_WAPI */
650
651#define NO_MATCH 0
652#define MATCH 1
653
654#define WLAN_SECURITY_STATUS_SUCCESS 0
655#define WLAN_SECURITY_STATUS_FAILURE 1
656
657//Scan
658#define WLAN_SCAN_EVENT_ACTIVE_SCAN_REQ 1
659#define WLAN_SCAN_EVENT_ACTIVE_SCAN_RSP 2
660#define WLAN_SCAN_EVENT_PASSIVE_SCAN_REQ 3
661#define WLAN_SCAN_EVENT_PASSIVE_SCAN_RSP 4
662#define WLAN_SCAN_EVENT_HO_SCAN_REQ 5
663#define WLAN_SCAN_EVENT_HO_SCAN_RSP 6
664
665#define WLAN_SCAN_STATUS_SUCCESS 0
666#define WLAN_SCAN_STATUS_FAILURE 1
667#define WLAN_SCAN_STATUS_ABORT 2
668
669//Ibss
670#define WLAN_IBSS_EVENT_START_IBSS_REQ 0
671#define WLAN_IBSS_EVENT_START_IBSS_RSP 1
672#define WLAN_IBSS_EVENT_JOIN_IBSS_REQ 2
673#define WLAN_IBSS_EVENT_JOIN_IBSS_RSP 3
674#define WLAN_IBSS_EVENT_COALESCING 4
675#define WLAN_IBSS_EVENT_PEER_JOIN 5
676#define WLAN_IBSS_EVENT_PEER_LEAVE 6
677#define WLAN_IBSS_EVENT_STOP_REQ 7
678#define WLAN_IBSS_EVENT_STOP_RSP 8
679
680#define AUTO_PICK 0
681#define SPECIFIED 1
682
683#define WLAN_IBSS_STATUS_SUCCESS 0
684#define WLAN_IBSS_STATUS_FAILURE 1
685
686//11d
687#define WLAN_80211D_EVENT_COUNTRY_SET 0
688#define WLAN_80211D_EVENT_RESET 1
689
690#define WLAN_80211D_DISABLED 0
691#define WLAN_80211D_SUPPORT_MULTI_DOMAIN 1
692#define WLAN_80211D_NOT_SUPPORT_MULTI_DOMAIN 2
693
694int diagAuthTypeFromCSRType(eCsrAuthType authType);
695int diagEncTypeFromCSRType(eCsrEncryptionType encType);
696#endif //#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
697/* ---------------------------------------------------------------------------
698 \fn csrScanResultPurge
699 \brief remove all items(tCsrScanResult) in the list and free memory for each item
700 \param hScanResult - returned from csrScanGetResult. hScanResult is considered gone by
701 calling this function and even before this function reutrns.
702 \return eHalStatus
703 -------------------------------------------------------------------------------*/
704eHalStatus csrScanResultPurge(tpAniSirGlobal pMac, tScanResultHandle hScanResult);
705
706
707///////////////////////////////////////////Common Scan ends
708
709/* ---------------------------------------------------------------------------
710 \fn csrRoamConnect
711 \brief To inititiate an association
712 \param pProfile - can be NULL to join to any open ones
713 \param hBssListIn - a list of BSS descriptor to roam to. It is returned from csrScanGetResult
714 \param pRoamId - to get back the request ID
715 \return eHalStatus
716 -------------------------------------------------------------------------------*/
717eHalStatus csrRoamConnect(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
718 tScanResultHandle hBssListIn, tANI_U32 *pRoamId);
719
720/* ---------------------------------------------------------------------------
721 \fn csrRoamReassoc
722 \brief To inititiate a re-association
723 \param pProfile - can be NULL to join the currently connected AP. In that
724 case modProfileFields should carry the modified field(s) which could trigger
725 reassoc
726 \param modProfileFields - fields which are part of tCsrRoamConnectedProfile
727 that might need modification dynamically once STA is up & running and this
728 could trigger a reassoc
729 \param pRoamId - to get back the request ID
730 \return eHalStatus
731 -------------------------------------------------------------------------------*/
732eHalStatus csrRoamReassoc(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
733 tCsrRoamModifyProfileFields modProfileFields,
734 tANI_U32 *pRoamId);
735
736
737/* ---------------------------------------------------------------------------
738 \fn csrRoamReconnect
739 \brief To disconnect and reconnect with the same profile
740 \return eHalStatus. It returns fail if currently not connected
741 -------------------------------------------------------------------------------*/
742eHalStatus csrRoamReconnect(tpAniSirGlobal pMac, tANI_U32 sessionId);
743
744/* ---------------------------------------------------------------------------
745 \fn csrRoamSetPMKIDCache
746 \brief return the PMKID candidate list
747 \param pPMKIDCache - caller allocated buffer point to an array of tPmkidCacheInfo
748 \param numItems - a variable that has the number of tPmkidCacheInfo allocated
749 when retruning, this is either the number needed or number of items put into pPMKIDCache
750 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough and pNumItems
751 has the number of tPmkidCacheInfo.
752 \Note: pNumItems is a number of tPmkidCacheInfo, not sizeof(tPmkidCacheInfo) * something
753 -------------------------------------------------------------------------------*/
754eHalStatus csrRoamSetPMKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, tPmkidCacheInfo *pPMKIDCache, tANI_U32 numItems );
755
756/* ---------------------------------------------------------------------------
757 \fn csrRoamGetWpaRsnReqIE
758 \brief return the WPA or RSN IE CSR passes to PE to JOIN request or START_BSS request
759 \param pLen - caller allocated memory that has the length of pBuf as input. Upon returned, *pLen has the
760 needed or IE length in pBuf.
761 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
762 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
763 -------------------------------------------------------------------------------*/
764eHalStatus csrRoamGetWpaRsnReqIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
765
766/* ---------------------------------------------------------------------------
767 \fn csrRoamGetWpaRsnRspIE
768 \brief return the WPA or RSN IE from the beacon or probe rsp if connected
769 \param pLen - caller allocated memory that has the length of pBuf as input. Upon returned, *pLen has the
770 needed or IE length in pBuf.
771 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
772 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
773 -------------------------------------------------------------------------------*/
774eHalStatus csrRoamGetWpaRsnRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
775
776
777/* ---------------------------------------------------------------------------
778 \fn csrRoamGetNumPMKIDCache
779 \brief return number of PMKID cache entries
780 \return tANI_U32 - the number of PMKID cache entries
781 -------------------------------------------------------------------------------*/
782tANI_U32 csrRoamGetNumPMKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId);
783
784/* ---------------------------------------------------------------------------
785 \fn csrRoamGetPMKIDCache
786 \brief return PMKID cache from CSR
787 \param pNum - caller allocated memory that has the space of the number of pBuf tPmkidCacheInfo as input. Upon returned, *pNum has the
788 needed or actually number in tPmkidCacheInfo.
789 \param pPmkidCache - Caller allocated memory that contains PMKID cache, if any, upon return
790 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
791 -------------------------------------------------------------------------------*/
792eHalStatus csrRoamGetPMKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId,
793 tANI_U32 *pNum, tPmkidCacheInfo *pPmkidCache);
794
795/* ---------------------------------------------------------------------------
796 \fn csrRoamGetConnectProfile
797 \brief To return the current connect profile. Caller must call csrRoamFreeConnectProfile
798 after it is done and before reuse for another csrRoamGetConnectProfile call.
799 \param pProfile - pointer to a caller allocated structure tCsrRoamConnectedProfile
800 \return eHalStatus. Failure if not connected
801 -------------------------------------------------------------------------------*/
802eHalStatus csrRoamGetConnectProfile(tpAniSirGlobal pMac, tANI_U32 sessionId,
803 tCsrRoamConnectedProfile *pProfile);
804
805/* ---------------------------------------------------------------------------
806 \fn csrRoamGetConnectState
807 \brief To return the current connect state of Roaming
808 \return eHalStatus
809 -------------------------------------------------------------------------------*/
810eHalStatus csrRoamGetConnectState(tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrConnectState *pState);
811
812/* ---------------------------------------------------------------------------
813 \fn csrRoamFreeConnectProfile
814 \brief To free and reinitialize the profile return previous by csrRoamGetConnectProfile.
815 \param pProfile - pointer to a caller allocated structure tCsrRoamConnectedProfile
816 \return eHalStatus.
817 -------------------------------------------------------------------------------*/
818eHalStatus csrRoamFreeConnectProfile(tpAniSirGlobal pMac, tCsrRoamConnectedProfile *pProfile);
819
820/* ---------------------------------------------------------------------------
821 \fn csrInitChannelList
822 \brief HDD calls this function to set the WNI_CFG_VALID_CHANNEL_LIST base on the band/mode settings.
823 This function must be called after CFG is downloaded and all the band/mode setting already passed into
824 CSR.
825 \return eHalStatus
826 -------------------------------------------------------------------------------*/
827eHalStatus csrInitChannelList( tHalHandle hHal );
828
829/* ---------------------------------------------------------------------------
830 \fn csrChangeConfigParams
831 \brief The CSR API exposed for HDD to provide config params to CSR during
832 SMEs stop -> start sequence.
833 If HDD changed the domain that will cause a reset. This function will
834 provide the new set of 11d information for the new domain. Currrently this
835 API provides info regarding 11d only at reset but we can extend this for
836 other params (PMC, QoS) which needs to be initialized again at reset.
837 \param
838 hHal - Handle to the HAL. The HAL handle is returned by the HAL after it is
839 opened (by calling halOpen).
840 pUpdateConfigParam - a pointer to a structure (tCsrUpdateConfigParam) that
841 currently provides 11d related information like Country code,
842 Regulatory domain, valid channel list, Tx power per channel, a
843 list with active/passive scan allowed per valid channel.
844
845 \return eHalStatus
846 ---------------------------------------------------------------------------*/
847eHalStatus csrChangeConfigParams(tpAniSirGlobal pMac,
848 tCsrUpdateConfigParam *pUpdateConfigParam);
849
850/* ---------------------------------------------------------------------------
851 \fn csrRoamConnectToLastProfile
852 \brief To disconnect and reconnect with the same profile
853 \return eHalStatus. It returns fail if currently connected
854 -------------------------------------------------------------------------------*/
855eHalStatus csrRoamConnectToLastProfile(tpAniSirGlobal pMac, tANI_U32 sessionId);
856
857/* ---------------------------------------------------------------------------
858 \fn csrRoamDisconnect
859 \brief To disconnect from a network
860 \param reason -- To indicate the reason for disconnecting. Currently, only eCSR_DISCONNECT_REASON_MIC_ERROR is meanful.
861 \return eHalStatus
862 -------------------------------------------------------------------------------*/
863eHalStatus csrRoamDisconnect(tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamDisconnectReason reason);
864
865/* ---------------------------------------------------------------------------
866 \fn csrScanGetPMKIDCandidateList
867 \brief return the PMKID candidate list
868 \param pPmkidList - caller allocated buffer point to an array of tPmkidCandidateInfo
869 \param pNumItems - pointer to a variable that has the number of tPmkidCandidateInfo allocated
870 when retruning, this is either the number needed or number of items put into pPmkidList
871 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough and pNumItems
872 has the number of tPmkidCandidateInfo.
873 \Note: pNumItems is a number of tPmkidCandidateInfo, not sizeof(tPmkidCandidateInfo) * something
874 -------------------------------------------------------------------------------*/
875eHalStatus csrScanGetPMKIDCandidateList(tpAniSirGlobal pMac, tANI_U32 sessionId,
876 tPmkidCandidateInfo *pPmkidList, tANI_U32 *pNumItems );
877
878//This function is used to stop a BSS. It is similar of csrRoamIssueDisconnect but this function
879//doesn't have any logic other than blindly trying to stop BSS
880eHalStatus csrRoamIssueStopBssCmd( tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_BOOLEAN fHighPriority );
881
882void csrCallRoamingCompletionCallback(tpAniSirGlobal pMac, tCsrRoamSession *pSession,
883 tCsrRoamInfo *pRoamInfo, tANI_U32 roamId, eCsrRoamResult roamResult);
884
Jeff Johnson295189b2012-06-20 16:38:30 -0700885/* ---------------------------------------------------------------------------
886 \fn csrRoamIssueDisassociateStaCmd
887 \brief csr function that HDD calls to disassociate a associated station
888 \param sessionId - session Id for Soft AP
889 \param pPeerMacAddr - MAC of associated station to delete
890 \param reason - reason code, be one of the tSirMacReasonCodes
891 \return eHalStatus
892 ---------------------------------------------------------------------------*/
893eHalStatus csrRoamIssueDisassociateStaCmd( tpAniSirGlobal pMac,
894 tANI_U32 sessionId,
895 tANI_U8 *pPeerMacAddr,
896 tANI_U32 reason);
897
898/* ---------------------------------------------------------------------------
899 \fn csrRoamIssueDeauthSta
900 \brief csr function that HDD calls to delete a associated station
901 \param sessionId - session Id for Soft AP
902 \param pPeerMacAddr - MAC of associated station to delete
903 \param reason - reason code, be one of the tSirMacReasonCodes
904 \return eHalStatus
905 ---------------------------------------------------------------------------*/
906eHalStatus csrRoamIssueDeauthStaCmd( tpAniSirGlobal pMac,
907 tANI_U32 sessionId,
908 tANI_U8 *pPeerMacAddr,
909 tANI_U32 reason);
910
911/* ---------------------------------------------------------------------------
912 \fn csrRoamIssueTkipCounterMeasures
913 \brief csr function that HDD calls to start and stop tkip countermeasures
914 \param sessionId - session Id for Soft AP
915 \param bEnable - Flag to start/stop countermeasures
916 \return eHalStatus
917 ---------------------------------------------------------------------------*/
918eHalStatus csrRoamIssueTkipCounterMeasures( tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_BOOLEAN bEnable);
919
920eHalStatus csrSendMBTkipCounterMeasuresReqMsg( tpAniSirGlobal pMac, tANI_U32 sessinId, tANI_BOOLEAN bEnable, tSirMacAddr bssId );
921
922/* ---------------------------------------------------------------------------
923 \fn csrRoamGetAssociatedStas
924 \brief csr function that HDD calls to get list of associated stations based on module ID
925 \param sessionId - session Id for Soft AP
926 \param modId - module ID - PE/HAL/TL
927 \param pUsrContext - Opaque HDD context
928 \param pfnSapEventCallback - Sap event callback in HDD
929 \param pAssocStasBuf - Caller allocated memory to be filled with associatd stations info
930 \return eHalStatus
931 ---------------------------------------------------------------------------*/
932eHalStatus csrRoamGetAssociatedStas( tpAniSirGlobal pMac, tANI_U32 sessionId, VOS_MODULE_ID modId,
933 void *pUsrContext, void *pfnSapEventCallback, tANI_U8 *pAssocStasBuf );
934
935eHalStatus csrSendMBGetAssociatedStasReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, VOS_MODULE_ID modId, tSirMacAddr bssId,
936 void *pUsrContext, void *pfnSapEventCallback, tANI_U8 *pAssocStasBuf );
937
938/* ---------------------------------------------------------------------------
939 \fn csrRoamGetWpsSessionOverlap
940 \brief csr function that HDD calls to get WPS PBC session overlap information
941 \param sessionId - session Id for Soft AP
942 \param pUsrContext - Opaque HDD context
943 \param pfnSapEventCallback - Sap event callback in HDD
944 \param pRemoveMac - pointer to MAC address of session to be removed
945 \return eHalStatus
946 ---------------------------------------------------------------------------*/
947eHalStatus csrRoamGetWpsSessionOverlap( tpAniSirGlobal pMac, tANI_U32 sessionId,
948 void *pUsrContext, void *pfnSapEventCallback,v_MACADDR_t pRemoveMac );
949
950eHalStatus csrSendMBGetWPSPBCSessions( tpAniSirGlobal pMac, tANI_U32 sessionId,
951 tSirMacAddr bssId, void *pUsrContext, void *pfnSapEventCallback,v_MACADDR_t pRemoveMac);
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -0800952
953/* ---------------------------------------------------------------------------
954 \fn csrSendChngMCCBeaconInterval
955 \brief csr function that HDD calls to send Update beacon interval
956 \param sessionId - session Id for Soft AP
957 \return eHalStatus
958 ---------------------------------------------------------------------------*/
959eHalStatus
960csrSendChngMCCBeaconInterval(tpAniSirGlobal pMac, tANI_U32 sessionId);
961
Jeff Johnson295189b2012-06-20 16:38:30 -0700962#ifdef FEATURE_WLAN_BTAMP_UT_RF
963eHalStatus csrRoamStartJoinRetryTimer(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 interval);
964eHalStatus csrRoamStopJoinRetryTimer(tpAniSirGlobal pMac, tANI_U32 sessionId);
965#endif
966#ifdef WLAN_FEATURE_VOWIFI_11R
967/* ---------------------------------------------------------------------------
968 \fn csrRoamFTPreAuthRspProcessor
969 \brief csr function that handles pre auth response from LIM
970 ---------------------------------------------------------------------------*/
971void csrRoamFTPreAuthRspProcessor( tHalHandle hHal, tpSirFTPreAuthRsp pFTPreAuthRsp );
972#endif
973
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700974#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -0700975void csrCcxSendAdjacentApRepMsg(tpAniSirGlobal pMac, tCsrRoamSession *pSession);
976#endif
Jeff Johnsond13512a2012-07-17 11:42:19 -0700977
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700978#if defined(FEATURE_WLAN_CCX)
979void UpdateCCKMTSF(tANI_U32 *timeStamp0, tANI_U32 *timeStamp1, tANI_U32 *incr);
980#endif
981
Jeff Johnsond13512a2012-07-17 11:42:19 -0700982eHalStatus csrGetDefaultCountryCodeFrmNv(tpAniSirGlobal pMac, tANI_U8 *pCountry);
983eHalStatus csrGetCurrentCountryCode(tpAniSirGlobal pMac, tANI_U8 *pCountry);
984
Madan Mohan Koyyalamudi286b60e2012-10-11 12:59:07 -0700985
986eHalStatus csrRoamEnqueuePreauth(tpAniSirGlobal pMac, tANI_U32 sessionId, tpSirBssDescription pBssDescription,
987 eCsrRoamReason reason, tANI_BOOLEAN fImmediate);
988eHalStatus csrRoamDequeuePreauth(tpAniSirGlobal pMac);
Madan Mohan Koyyalamudidd3c9662012-11-09 17:39:30 -0800989#ifdef FEATURE_WLAN_LFR
990void csrInitOccupiedChannelsList(tpAniSirGlobal pMac);
991tANI_BOOLEAN csrNeighborRoamIsNewConnectedProfile(tpAniSirGlobal pMac);
992tANI_BOOLEAN csrNeighborRoamConnectedProfileMatch(tpAniSirGlobal pMac, tCsrScanResult *pResult,
993 tDot11fBeaconIEs *pIes);
994#endif
schang86c22c42013-03-13 18:41:24 -0700995eHalStatus csrSetTxPower(tpAniSirGlobal pMac, v_U8_t sessionId, v_U8_t mW);
Sandeep Puligilla332ea912014-02-04 00:16:24 +0530996eHalStatus csrHT40StopOBSSScan(tpAniSirGlobal pMac, v_U8_t sessionId);
Varun Reddy Yeturucc661d22013-05-20 11:47:10 -0700997
998eHalStatus csrScanCreateEntryInScanCache(tpAniSirGlobal pMac, tANI_U32 sessionId,
999 tCsrBssid bssid, tANI_U8 channel);
Gopichand Nakkalaf72a3872013-06-11 17:51:13 +05301000
Leela Venkata Kiran Kumar Reddy Chiralac6663f72014-02-03 21:04:58 -08001001eHalStatus csrUpdateChannelList(tpAniSirGlobal pMac);
Leela Venkata Kiran Kumar Reddy Chiralaede10652013-09-11 18:48:46 -07001002eHalStatus csrRoamDelPMKIDfromCache( tpAniSirGlobal pMac, tANI_U32 sessionId,
1003 tANI_U8 *pBSSId );
Jeff Johnson295189b2012-06-20 16:38:30 -07001004#endif
1005