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