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