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