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