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