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