blob: 4f19afd67cbe2013af6ddbc1637f834631dbec38 [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 * Airgo Networks, Inc proprietary. All rights reserved.
24 * This file limUtils.h contains the utility definitions
25 * LIM uses.
26 * Author: Chandra Modumudi
27 * Date: 02/13/02
28 * History:-
29 * Date Modified by Modification Information
30 * --------------------------------------------------------------------
31 */
32#ifndef __LIM_UTILS_H
33#define __LIM_UTILS_H
34
35#include "sirApi.h"
36#include "sirDebug.h"
37#include "cfgApi.h"
38
39#include "limTypes.h"
40#include "limScanResultUtils.h"
41#include "limTimerUtils.h"
42#include "limTrace.h"
43typedef enum
44{
45 ONE_BYTE = 1,
46 TWO_BYTE = 2
47} eSizeOfLenField;
48
49#define LIM_STA_ID_MASK 0x00FF
50#define LIM_AID_MASK 0xC000
51#define LIM_SPECTRUM_MANAGEMENT_BIT_MASK 0x0100
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -070052#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
53#define LIM_MAX_REASSOC_RETRY_LIMIT 2
54#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070055
56// classifier ID is coded as 0-3: tsid, 4-5:direction
57#define LIM_MAKE_CLSID(tsid, dir) (((tsid) & 0x0F) | (((dir) & 0x03) << 4))
58
59#define LIM_SET_STA_BA_STATE(pSta, tid, newVal) \
60{\
61 pSta->baState = ((pSta->baState | (0x3 << tid*2)) & ((newVal << tid*2) | ~(0x3 << tid*2)));\
62}
63
64#define LIM_GET_STA_BA_STATE(pSta, tid, pCurVal)\
65{\
66 *pCurVal = (tLimBAState)(((pSta->baState >> tid*2) & 0x3));\
67}
68
69#if defined( FEATURE_WLAN_INTEGRATED_SOC )
70typedef struct sAddBaInfo
71{
72 tANI_U16 fBaEnable : 1;
73 tANI_U16 startingSeqNum: 12;
74 tANI_U16 reserved : 3;
75}tAddBaInfo, *tpAddBaInfo;
76
77typedef struct sAddBaCandidate
78{
79 tSirMacAddr staAddr;
80 tAddBaInfo baInfo[STACFG_MAX_TC];
81}tAddBaCandidate, *tpAddBaCandidate;
82#endif /* FEATURE_WLAN_INTEGRATED_SOC */
83
84// LIM utilility functions
85void limGetBssidFromPkt(tpAniSirGlobal, tANI_U8 *, tANI_U8 *, tANI_U32 *);
86char * limMlmStateStr(tLimMlmStates state);
87char * limSmeStateStr(tLimSmeStates state);
88char * limMsgStr(tANI_U32 msgType);
89char * limResultCodeStr(tSirResultCodes resultCode);
90char* limDot11ModeStr(tpAniSirGlobal pMac, tANI_U8 dot11Mode);
91char* limStaOpRateModeStr(tStaRateMode opRateMode);
92void limPrintMlmState(tpAniSirGlobal pMac, tANI_U16 logLevel, tLimMlmStates state);
93void limPrintSmeState(tpAniSirGlobal pMac, tANI_U16 logLevel, tLimSmeStates state);
94void limPrintMsgName(tpAniSirGlobal pMac, tANI_U16 logLevel, tANI_U32 msgType);
95void limPrintMsgInfo(tpAniSirGlobal pMac, tANI_U16 logLevel, tSirMsgQ *msg);
96char* limBssTypeStr(tSirBssType bssType);
97
98#if defined FEATURE_WLAN_CCX || defined WLAN_FEATURE_VOWIFI
99extern tSirRetStatus limSendSetMaxTxPowerReq ( tpAniSirGlobal pMac,
100 tPowerdBm txPower,
101 tpPESession pSessionEntry );
Madan Mohan Koyyalamudi3282c572012-11-09 17:01:41 -0800102extern tANI_U8 limGetMaxTxPower(tPowerdBm regMax, tPowerdBm apTxPower, tANI_U8 iniTxPower);
Jeff Johnson295189b2012-06-20 16:38:30 -0700103#endif
104
105tANI_U32 limPostMsgApiNoWait(tpAniSirGlobal, tSirMsgQ *);
106tANI_U8 limIsAddrBC(tSirMacAddr);
107tANI_U8 limIsGroupAddr(tSirMacAddr);
108
109// check for type of scan allowed
110tANI_U8 limActiveScanAllowed(tpAniSirGlobal, tANI_U8);
111
112// AID pool management functions
113void limInitAIDpool(tpAniSirGlobal,tpPESession);
114tANI_U16 limAssignAID(tpAniSirGlobal);
115
116void limEnableOverlap11gProtection(tpAniSirGlobal pMac, tpUpdateBeaconParams pBeaconParams, tpSirMacMgmtHdr pMh,tpPESession psessionEntry);
117void limUpdateOverlapStaParam(tpAniSirGlobal pMac, tSirMacAddr bssId, tpLimProtStaParams pStaParams);
118void limUpdateShortPreamble(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry);
119void limUpdateShortSlotTime(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry);
120
121/*
122 * The below 'product' check tobe removed if 'Association' is
123 * allowed in IBSS.
124 */
125void limReleaseAID(tpAniSirGlobal, tANI_U16);
126
127#if (WNI_POLARIS_FW_PRODUCT == AP)
128// LIM informs WSM that radar is detected
129void limDetectRadar(tpAniSirGlobal, tANI_U32 *);
130#endif
131
132#ifdef WLAN_SOFTAP_FEATURE
133void limDecideApProtection(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tpUpdateBeaconParams pBeaconParams,tpPESession);
134void
135limDecideApProtectionOnDelete(tpAniSirGlobal pMac,
136 tpDphHashNode pStaDs, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry);
137#else
138void limDecideApProtection(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tpUpdateBeaconParams pBeaconParams);
139#endif
140
141extern tSirRetStatus limEnable11aProtection(tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession);
142extern tSirRetStatus limEnable11gProtection(tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry);
143extern tSirRetStatus limEnableHtProtectionFrom11g(tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry);
144extern tSirRetStatus limEnableHT20Protection(tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession sessionEntry);
145extern tSirRetStatus limEnableHTNonGfProtection(tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession);
146extern tSirRetStatus limEnableHtRifsProtection(tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry);
147extern tSirRetStatus limEnableHTLsigTxopProtection(tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession);
148#ifdef WLAN_SOFTAP_FEATURE
149extern tSirRetStatus limEnableShortPreamble(tpAniSirGlobal pMac, tANI_U8 enable, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry);
150#else
151extern tSirRetStatus limEnableShortPreamble(tpAniSirGlobal pMac, tANI_U8 enable, tpUpdateBeaconParams pBeaconParams);
152#endif
153extern tSirRetStatus limEnableHtOBSSProtection (tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams, tpPESession);
154void limDecideStaProtection(tpAniSirGlobal pMac, tpSchBeaconStruct pBeaconStruct, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry);
155void limDecideStaProtectionOnAssoc(tpAniSirGlobal pMac, tpSchBeaconStruct pBeaconStruct, tpPESession psessionEntry);
156void limUpdateStaRunTimeHTSwitchChnlParams(tpAniSirGlobal pMac, tDot11fIEHTInfo * pHTInfo, tANI_U8 bssIdx, tpPESession psessionEntry);
157// Print MAC address utility function
158void limPrintMacAddr(tpAniSirGlobal, tSirMacAddr, tANI_U8);
159
160
161
162// Deferred Message Queue read/write
163tANI_U8 limWriteDeferredMsgQ(tpAniSirGlobal pMac, tpSirMsgQ limMsg);
164tSirMsgQ* limReadDeferredMsgQ(tpAniSirGlobal pMac);
165void limHandleDeferMsgError(tpAniSirGlobal pMac, tpSirMsgQ pLimMsg);
166
167// Deferred Message Queue Reset
168void limResetDeferredMsgQ(tpAniSirGlobal pMac);
169
170tSirRetStatus limSysProcessMmhMsgApi(tpAniSirGlobal, tSirMsgQ*, tANI_U8);
171
172#ifdef WLAN_SOFTAP_FEATURE
173void limHandleUpdateOlbcCache(tpAniSirGlobal pMac);
174#endif
175
176tANI_U8 limIsNullSsid( tSirMacSSid *pSsid );
177
178void limProcessAddtsRspTimeout(tpAniSirGlobal pMac, tANI_U32 param);
179
180// 11h Support
181#ifdef ANI_PRODUCT_TYPE_AP
182tANI_U32 computeChannelSwitchCount(tpAniSirGlobal, tANI_U32);
183#endif
184void limStopTxAndSwitchChannel(tpAniSirGlobal pMac, tANI_U8 sessionId);
185void limProcessChannelSwitchTimeout(tpAniSirGlobal);
186tSirRetStatus limStartChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry);
187void limUpdateChannelSwitch(tpAniSirGlobal, tpSirProbeRespBeacon, tpPESession psessionEntry);
188void limProcessQuietTimeout(tpAniSirGlobal);
189void limProcessQuietBssTimeout(tpAniSirGlobal);
190
191#ifdef WLAN_SOFTAP_FEATURE
192#if 0
193void limProcessWPSOverlapTimeout(tpAniSirGlobal pMac);
194#endif
195#endif
196
197void limStartQuietTimer(tpAniSirGlobal pMac, tANI_U8 sessionId);
198void limUpdateQuietIEFromBeacon(tpAniSirGlobal, tDot11fIEQuiet *, tpPESession);
Jeff Johnson295189b2012-06-20 16:38:30 -0700199void limSwitchPrimaryChannel(tpAniSirGlobal, tANI_U8,tpPESession);
Jeff Johnsone7245742012-09-05 17:12:55 -0700200void limSwitchPrimarySecondaryChannel(tpAniSirGlobal, tpPESession, tANI_U8, ePhyChanBondState);
Jeff Johnson295189b2012-06-20 16:38:30 -0700201tAniBool limTriggerBackgroundScanDuringQuietBss(tpAniSirGlobal);
202void limUpdateStaRunTimeHTSwtichChnlParams(tpAniSirGlobal pMac, tDot11fIEHTInfo *pRcvdHTInfo, tANI_U8 bssIdx);
203void limUpdateStaRunTimeHTCapability(tpAniSirGlobal pMac, tDot11fIEHTCaps *pHTCaps);
204void limUpdateStaRunTimeHTInfo(struct sAniSirGlobal *pMac, tDot11fIEHTInfo *pRcvdHTInfo, tpPESession psessionEntry);
205void limCancelDot11hChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry);
206void limCancelDot11hQuiet(tpAniSirGlobal pMac, tpPESession psessionEntry);
207tAniBool limIsChannelValidForChannelSwitch(tpAniSirGlobal pMac, tANI_U8 channel);
208void limFrameTransmissionControl(tpAniSirGlobal pMac, tLimQuietTxMode type, tLimControlTx mode);
209tSirRetStatus limRestorePreChannelSwitchState(tpAniSirGlobal pMac, tpPESession psessionEntry);
Jeff Johnsone7245742012-09-05 17:12:55 -0700210tSirRetStatus limRestorePreQuietState(tpAniSirGlobal pMac, tpPESession psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -0700211
212void limPrepareFor11hChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry);
213void limSwitchChannelCback(tpAniSirGlobal pMac, eHalStatus status,
214 tANI_U32 *data, tpPESession psessionEntry);
215
216static inline tSirRFBand limGetRFBand(tANI_U8 channel)
217{
218 if ((channel >= SIR_11A_CHANNEL_BEGIN) &&
219 (channel <= SIR_11A_CHANNEL_END))
220 return SIR_BAND_5_GHZ;
221
222 if ((channel >= SIR_11B_CHANNEL_BEGIN) &&
223 (channel <= SIR_11B_CHANNEL_END))
224 return SIR_BAND_2_4_GHZ;
225
226 return SIR_BAND_UNKNOWN;
227}
228
229
230static inline tSirRetStatus
231limGetMgmtStaid(tpAniSirGlobal pMac, tANI_U16 *staid, tpPESession psessionEntry)
232{
233 if (psessionEntry->limSystemRole == eLIM_AP_ROLE)
234 *staid = 1;
235 else if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
236 *staid = 0;
237 else
238 return eSIR_FAILURE;
239
240 return eSIR_SUCCESS;
241}
242
243static inline tANI_U8
244limIsSystemInSetMimopsState(tpAniSirGlobal pMac)
245{
246 if (pMac->lim.gLimMlmState == eLIM_MLM_WT_SET_MIMOPS_STATE)
247 return true;
248 return false;
249}
250
251static inline tANI_U8
252 isEnteringMimoPS(tSirMacHTMIMOPowerSaveState curState, tSirMacHTMIMOPowerSaveState newState)
253 {
254 if (curState == eSIR_HT_MIMO_PS_NO_LIMIT &&
255 (newState == eSIR_HT_MIMO_PS_DYNAMIC ||newState == eSIR_HT_MIMO_PS_STATIC))
256 return TRUE;
257 return FALSE;
258}
259
260/// ANI peer station count management and associated actions
261void limUtilCountStaAdd(tpAniSirGlobal pMac, tpDphHashNode pSta, tpPESession psessionEntry);
262void limUtilCountStaDel(tpAniSirGlobal pMac, tpDphHashNode pSta, tpPESession psessionEntry);
263
264#ifdef WLAN_SOFTAP_FEATURE
265tANI_U8 limGetHTCapability( tpAniSirGlobal, tANI_U32, tpPESession);
266#else
267tANI_U8 limGetHTCapability( tpAniSirGlobal, tANI_U32 );
268#endif
269void limTxComplete( tHalHandle hHal, void *pData );
270
271/**********Admit Control***************************************/
272
273//callback function for HAL to issue DelTS request to PE.
274//This function will be registered with HAL for callback when TSPEC inactivity timer fires.
275
276void limProcessDelTsInd(tpAniSirGlobal pMac, tpSirMsgQ limMsg);
277tSirRetStatus limProcessHalIndMessages(tpAniSirGlobal pMac, tANI_U32 mesgId, void *mesgParam );
278tSirRetStatus limValidateDeltsReq(tpAniSirGlobal pMac, tpSirDeltsReq pDeltsReq, tSirMacAddr peerMacAddr,tpPESession psessionEntry);
279/**********************************************************/
280
281//callback function registration to HAL for any indication.
282void limRegisterHalIndCallBack(tpAniSirGlobal pMac);
283void limPktFree (
284 tpAniSirGlobal pMac,
285 eFrameType frmType,
286 tANI_U8 *pBD,
287 void *body);
288
289
290
291void limGetBDfromRxPacket(tpAniSirGlobal pMac, void *body, tANI_U32 **pBD);
292
293/**
294 * \brief Given a base(X) and power(Y), this API will return
295 * the result of base raised to power - (X ^ Y)
296 *
297 * \sa utilsPowerXY
298 *
299 * \param base Base value
300 *
301 * \param power Base raised to this Power value
302 *
303 * \return Result of X^Y
304 *
305 */
306static inline tANI_U32 utilsPowerXY( tANI_U16 base, tANI_U16 power )
307{
308tANI_U32 result = 1, i;
309
310 for( i = 0; i < power; i++ )
311 result *= base;
312
313 return result;
314}
315
316
317
318tSirRetStatus limPostMlmAddBAReq( tpAniSirGlobal pMac,
319 tpDphHashNode pStaDs,
320 tANI_U8 tid, tANI_U16 startingSeqNum,tpPESession psessionEntry);
321tSirRetStatus limPostMlmAddBARsp( tpAniSirGlobal pMac,
322 tSirMacAddr peerMacAddr,
323 tSirMacStatusCodes baStatusCode,
324 tANI_U8 baDialogToken,
325 tANI_U8 baTID,
326 tANI_U8 baPolicy,
327 tANI_U16 baBufferSize,
328 tANI_U16 baTimeout,
329 tpPESession psessionEntry);
330tSirRetStatus limPostMlmDelBAReq( tpAniSirGlobal pMac,
331 tpDphHashNode pSta,
332 tANI_U8 baDirection,
333 tANI_U8 baTID,
334 tSirMacReasonCodes baReasonCode ,
335 tpPESession psessionEntry);
336tSirRetStatus limPostMsgAddBAReq( tpAniSirGlobal pMac,
337 tpDphHashNode pSta,
338 tANI_U8 baDialogToken,
339 tANI_U8 baTID,
340 tANI_U8 baPolicy,
341 tANI_U16 baBufferSize,
342 tANI_U16 baTimeout,
343 tANI_U16 baSSN,
344 tANI_U8 baDirection,
345 tpPESession psessionEntry);
346tSirRetStatus limPostMsgDelBAInd( tpAniSirGlobal pMac,
347 tpDphHashNode pSta,
348 tANI_U8 baTID,
349 tANI_U8 baDirection,
350 tpPESession psessionEntry);
351
352tSirRetStatus limPostSMStateUpdate(tpAniSirGlobal pMac,
353 tANI_U16 StaIdx,
354 tSirMacHTMIMOPowerSaveState MIMOPSState);
355
356void limDeleteStaContext(tpAniSirGlobal pMac, tpSirMsgQ limMsg);
357void limProcessAddBaInd(tpAniSirGlobal pMac, tpSirMsgQ limMsg);
358void limDelAllBASessions(tpAniSirGlobal pMac);
359void limDeleteDialogueTokenList(tpAniSirGlobal pMac);
360tSirRetStatus limSearchAndDeleteDialogueToken(tpAniSirGlobal pMac, tANI_U8 token, tANI_U16 assocId, tANI_U16 tid);
361void limRessetScanChannelInfo(tpAniSirGlobal pMac);
362void limAddScanChannelInfo(tpAniSirGlobal pMac, tANI_U8 channelId);
363
364tANI_U8 limGetChannelFromBeacon(tpAniSirGlobal pMac, tpSchBeaconStruct pBeacon);
365tSirNwType limGetNwType(tpAniSirGlobal pMac, tANI_U8 channelNum, tANI_U32 type, tpSchBeaconStruct pBeacon);
366void limSetTspecUapsdMask(tpAniSirGlobal pMac, tSirMacTSInfo *pTsInfo, tANI_U32 action);
367void limHandleHeartBeatTimeout(tpAniSirGlobal pMac);
368//void limProcessBtampAddBssRsp(tpAniSirGlobal pMac,tpSirMsgQ pMsgQ,tpPESession peSession);
369void limProcessAddStaRsp(tpAniSirGlobal pMac,tpSirMsgQ pMsgQ);
370
371void limUpdateBeacon(tpAniSirGlobal pMac);
372
373void limProcessBtAmpApMlmAddStaRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ, tpPESession psessionEntry);
374void limProcessBtAmpApMlmDelBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry);
375
376void limProcessBtAmpApMlmDelStaRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ,tpPESession psessionEntry);
377tpPESession limIsIBSSSessionActive(tpAniSirGlobal pMac);
378tpPESession limIsApSessionActive(tpAniSirGlobal pMac);
379void limHandleHeartBeatFailureTimeout(tpAniSirGlobal pMac);
380
381void limProcessDelStaSelfRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ);
382void limProcessAddStaSelfRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ);
383v_U8_t* limGetIEPtr(tpAniSirGlobal pMac, v_U8_t *pIes, int length, v_U8_t eid,eSizeOfLenField size_of_len_field);
384
385tANI_U8 limUnmapChannel(tANI_U8 mapChannel);
386
387#define limGetWscIEPtr(pMac, ie, ie_len) \
388 limGetVendorIEOuiPtr(pMac, SIR_MAC_WSC_OUI, SIR_MAC_WSC_OUI_SIZE, ie, ie_len)
389
390#ifdef WLAN_FEATURE_P2P
391#define limGetP2pIEPtr(pMac, ie, ie_len) \
392 limGetVendorIEOuiPtr(pMac, SIR_MAC_P2P_OUI, SIR_MAC_P2P_OUI_SIZE, ie, ie_len)
393
394v_U8_t limGetNoaAttrStreamInMultP2pIes(tpAniSirGlobal pMac,v_U8_t* noaStream,v_U8_t noaLen,v_U8_t overFlowLen);
395v_U8_t limGetNoaAttrStream(tpAniSirGlobal pMac, v_U8_t*pNoaStream,tpPESession psessionEntry);
396
397v_U8_t limBuildP2pIe(tpAniSirGlobal pMac, tANI_U8 *ie, tANI_U8 *data, tANI_U8 ie_len);
398#endif
399v_U8_t* limGetVendorIEOuiPtr(tpAniSirGlobal pMac, tANI_U8 *oui, tANI_U8 oui_size, tANI_U8 *ie, tANI_U16 ie_len);
400tANI_BOOLEAN limIsconnectedOnDFSChannel(tANI_U8 currentChannel);
401tANI_U8 limGetCurrentOperatingChannel(tpAniSirGlobal pMac);
402
Mohit Khanna4a70d262012-09-11 16:30:12 -0700403#ifdef WLAN_FEATURE_11AC
404tANI_BOOLEAN limCheckVHTOpModeChange( tpAniSirGlobal pMac,
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700405 tpPESession psessionEntry, tANI_U8 chanWidth, tANI_U8 staId);
Mohit Khanna4a70d262012-09-11 16:30:12 -0700406#endif
407
Jeff Johnson295189b2012-06-20 16:38:30 -0700408#ifdef FEATURE_WLAN_DIAG_SUPPORT
409
410typedef enum
411{
412 WLAN_PE_DIAG_SCAN_REQ_EVENT = 0,
413 WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT,
414 WLAN_PE_DIAG_SCAN_RSP_EVENT,
415 WLAN_PE_DIAG_JOIN_REQ_EVENT,
416 WLAN_PE_DIAG_JOIN_RSP_EVENT,
417 WLAN_PE_DIAG_SETCONTEXT_REQ_EVENT,
418 WLAN_PE_DIAG_SETCONTEXT_RSP_EVENT,
419 WLAN_PE_DIAG_REASSOC_REQ_EVENT,
420 WLAN_PE_DIAG_REASSOC_RSP_EVENT,
421 WLAN_PE_DIAG_AUTH_REQ_EVENT,
422 WLAN_PE_DIAG_AUTH_RSP_EVENT,
423 WLAN_PE_DIAG_DISASSOC_REQ_EVENT,
424 WLAN_PE_DIAG_DISASSOC_RSP_EVENT,
425 WLAN_PE_DIAG_DISASSOC_IND_EVENT,
426 WLAN_PE_DIAG_DISASSOC_CNF_EVENT,
427 WLAN_PE_DIAG_DEAUTH_REQ_EVENT,
428 WLAN_PE_DIAG_DEAUTH_RSP_EVENT,
429 WLAN_PE_DIAG_DEAUTH_IND_EVENT,
430 WLAN_PE_DIAG_START_BSS_REQ_EVENT,
431 WLAN_PE_DIAG_START_BSS_RSP_EVENT,
432 WLAN_PE_DIAG_AUTH_IND_EVENT,
433 WLAN_PE_DIAG_ASSOC_IND_EVENT,
434 WLAN_PE_DIAG_ASSOC_CNF_EVENT,
435 WLAN_PE_DIAG_REASSOC_IND_EVENT,
436 WLAN_PE_DIAG_SWITCH_CHL_REQ_EVENT,
437 WLAN_PE_DIAG_SWITCH_CHL_RSP_EVENT,
438 WLAN_PE_DIAG_STOP_BSS_REQ_EVENT,
439 WLAN_PE_DIAG_STOP_BSS_RSP_EVENT,
440 WLAN_PE_DIAG_DEAUTH_CNF_EVENT,
441 WLAN_PE_DIAG_ADDTS_REQ_EVENT,
442 WLAN_PE_DIAG_ADDTS_RSP_EVENT,
443 WLAN_PE_DIAG_DELTS_REQ_EVENT,
444 WLAN_PE_DIAG_DELTS_RSP_EVENT,
445 WLAN_PE_DIAG_DELTS_IND_EVENT,
446 WLAN_PE_DIAG_ENTER_BMPS_REQ_EVENT,
447 WLAN_PE_DIAG_ENTER_BMPS_RSP_EVENT,
448 WLAN_PE_DIAG_EXIT_BMPS_REQ_EVENT,
449 WLAN_PE_DIAG_EXIT_BMPS_RSP_EVENT,
450 WLAN_PE_DIAG_EXIT_BMPS_IND_EVENT,
451 WLAN_PE_DIAG_ENTER_IMPS_REQ_EVENT,
452 WLAN_PE_DIAG_ENTER_IMPS_RSP_EVENT,
453 WLAN_PE_DIAG_EXIT_IMPS_REQ_EVENT,
454 WLAN_PE_DIAG_EXIT_IMPS_RSP_EVENT,
455 WLAN_PE_DIAG_ENTER_UAPSD_REQ_EVENT,
456 WLAN_PE_DIAG_ENTER_UAPSD_RSP_EVENT,
457 WLAN_PE_DIAG_EXIT_UAPSD_REQ_EVENT,
458 WLAN_PE_DIAG_EXIT_UAPSD_RSP_EVENT,
459 WLAN_PE_DIAG_WOWL_ADD_BCAST_PTRN_EVENT,
460 WLAN_PE_DIAG_WOWL_DEL_BCAST_PTRN_EVENT,
461 WLAN_PE_DIAG_ENTER_WOWL_REQ_EVENT,
462 WLAN_PE_DIAG_ENTER_WOWL_RSP_EVENT,
463 WLAN_PE_DIAG_EXIT_WOWL_REQ_EVENT,
464 WLAN_PE_DIAG_EXIT_WOWL_RSP_EVENT,
465 WLAN_PE_DIAG_HAL_ADDBA_REQ_EVENT,
466 WLAN_PE_DIAG_HAL_ADDBA_RSP_EVENT,
467 WLAN_PE_DIAG_HAL_DELBA_IND_EVENT,
468}WLAN_PE_DIAG_EVENT_TYPE;
469
470void limDiagEventReport(tpAniSirGlobal pMac, tANI_U16 eventType, tpPESession pSessionEntry, tANI_U16 status, tANI_U16 reasonCode);
471#endif /* FEATURE_WLAN_DIAG_SUPPORT */
472
Jeff Johnsone7245742012-09-05 17:12:55 -0700473void peSetResumeChannel(tpAniSirGlobal pMac, tANI_U16 channel, ePhyChanBondState cbState);
Jeff Johnson295189b2012-06-20 16:38:30 -0700474/*--------------------------------------------------------------------------
475
476 \brief peGetResumeChannel() - Returns the channel number for scanning, from a valid session.
477
Jeff Johnsone7245742012-09-05 17:12:55 -0700478 This function returns the channel to resume to during link resume. channel id of 0 means HAL will
479 resume to previous channel before link suspend
Jeff Johnson295189b2012-06-20 16:38:30 -0700480
481 \param pMac - pointer to global adapter context
482 \return - channel to scan from valid session else zero.
483
484 \sa
485
486 --------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700487void peGetResumeChannel(tpAniSirGlobal pMac, tANI_U8* resumeChannel, ePhyChanBondState* resumePhyCbState);
Jeff Johnson295189b2012-06-20 16:38:30 -0700488
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800489#ifdef FEATURE_WLAN_TDLS_INTERNAL
490tANI_U8 limTdlsFindLinkPeer(tpAniSirGlobal pMac, tSirMacAddr peerMac, tLimTdlsLinkSetupPeer **setupPeer);
491void limTdlsDelLinkPeer(tpAniSirGlobal pMac, tSirMacAddr peerMac);
492void limStartTdlsTimer(tpAniSirGlobal pMac, tANI_U8 sessionId, TX_TIMER *timer, tANI_U32 timerId,
493 tANI_U16 timerType, tANI_U32 timerMsg);
494#endif
Madan Mohan Koyyalamudi6db7ad12012-10-29 16:14:41 -0700495tANI_U8 limGetShortSlotFromPhyMode(tpAniSirGlobal pMac, tpPESession psessionEntry, tANI_U32 phyMode);
496
Madan Mohan Koyyalamudia67d4332012-11-29 11:35:23 -0800497void limCleanUpDisassocDeauthReq(tpAniSirGlobal pMac, tANI_U8 *staMac, tANI_BOOLEAN cleanRxPath);
498
Madan Mohan Koyyalamudi25b6f8b2012-12-04 16:17:31 -0800499tANI_BOOLEAN limCheckDisassocDeauthAckPending(tpAniSirGlobal pMac, tANI_U8 *staMac);
500
Jeff Johnson295189b2012-06-20 16:38:30 -0700501#endif /* __LIM_UTILS_H */