blob: b3c7ab44576139af77301c71bb56325a017359f4 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08002 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21/*
Jeff Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
24 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
25 *
26 *
27 * Permission to use, copy, modify, and/or distribute this software for
28 * any purpose with or without fee is hereby granted, provided that the
29 * above copyright notice and this permission notice appear in all
30 * copies.
31 *
32 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
33 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
35 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
36 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
37 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
38 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39 * PERFORMANCE OF THIS SOFTWARE.
40 */
41
42/*
43 *
44 * Airgo Networks, Inc proprietary. All rights reserved.
45 * This file limApi.h contains the definitions exported by
46 * LIM module.
47 * Author: Chandra Modumudi
48 * Date: 02/11/02
49 * History:-
50 * Date Modified by Modification Information
51 * --------------------------------------------------------------------
52 *
53 */
54#ifndef __LIM_API_H
55#define __LIM_API_H
Jeff Johnson295189b2012-06-20 16:38:30 -070056#include "wniApi.h"
57#include "sirApi.h"
58#include "aniGlobal.h"
59#include "sirMacProtDef.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070060#include "sirCommon.h"
61#include "sirDebug.h"
62#include "schGlobal.h"
63#include "utilsApi.h"
64#include "limGlobal.h"
65#include "halMsgApi.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070066#include "wlan_qct_wdi_ds.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070067#include "wlan_qct_wda.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070068#define LIM_POL_SYS_SCAN_MODE 0
69#define LIM_POL_SYS_LEARN_MODE 1
70
Jeff Johnson295189b2012-06-20 16:38:30 -070071/* Macro to count heartbeat */
Jeff Johnson295189b2012-06-20 16:38:30 -070072#define limResetHBPktCount(psessionEntry) (psessionEntry->LimRxedBeaconCntDuringHB = 0)
73
Jeff Johnson295189b2012-06-20 16:38:30 -070074/* Useful macros for fetching various states in pMac->lim */
75/* gLimSystemRole */
76#define GET_LIM_SYSTEM_ROLE(psessionEntry) (psessionEntry->limSystemRole)
77#define LIM_IS_AP_ROLE(psessionEntry) (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_AP_ROLE)
78#define LIM_IS_STA_ROLE(psessionEntry) (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_STA_ROLE)
79#define LIM_IS_IBSS_ROLE(psessionEntry) (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_STA_IN_IBSS_ROLE)
80/* gLimSmeState */
81#define GET_LIM_SME_STATE(pMac) (pMac->lim.gLimSmeState)
82#define SET_LIM_SME_STATE(pMac, state) (pMac->lim.gLimSmeState = state)
83/* gLimMlmState */
84#define GET_LIM_MLM_STATE(pMac) (pMac->lim.gLimMlmState)
85#define SET_LIM_MLM_STATE(pMac, state) (pMac->lim.gLimMlmState = state)
86/*tpdphHashNode mlmStaContext*/
87#define GET_LIM_STA_CONTEXT_MLM_STATE(pStaDs) (pStaDs->mlmStaContext.mlmState)
88#define SET_LIM_STA_CONTEXT_MLM_STATE(pStaDs, state) (pStaDs->mlmStaContext.mlmState = state)
89/* gLimQuietState */
90#define GET_LIM_QUIET_STATE(pMac) (pMac->lim.gLimSpecMgmt.quietState)
91#define SET_LIM_QUIET_STATE(pMac, state) (pMac->lim.gLimSpecMgmt.quietState = state)
Jeff Johnson295189b2012-06-20 16:38:30 -070092#define LIM_IS_CONNECTION_ACTIVE(psessionEntry) (psessionEntry->LimRxedBeaconCntDuringHB)
Jeff Johnson295189b2012-06-20 16:38:30 -070093/*pMac->lim.gLimProcessDefdMsgs*/
94#define GET_LIM_PROCESS_DEFD_MESGS(pMac) (pMac->lim.gLimProcessDefdMsgs)
95#define SET_LIM_PROCESS_DEFD_MESGS(pMac, val) (pMac->lim.gLimProcessDefdMsgs = val)
96// LIM exported function templates
97//inline tANI_U16
98//limGetNumAniPeersInBss(tpAniSirGlobal pMac)
99//{ return pMac->lim.gLimNumOfAniSTAs; }
100#define LIM_IS_RADAR_DETECTED(pMac) (pMac->lim.gLimSpecMgmt.fRadarDetCurOperChan)
101#define LIM_SET_RADAR_DETECTED(pMac, val) (pMac->lim.gLimSpecMgmt.fRadarDetCurOperChan = val)
102#define LIM_MIN_BCN_PR_LENGTH 12
103#define LIM_BCN_PR_CAPABILITY_OFFSET 10
Jeff Johnson295189b2012-06-20 16:38:30 -0700104typedef enum eMgmtFrmDropReason
105{
106 eMGMT_DROP_NO_DROP,
107 eMGMT_DROP_NOT_LAST_IBSS_BCN,
108 eMGMT_DROP_INFRA_BCN_IN_IBSS,
109 eMGMT_DROP_SCAN_MODE_FRAME,
110 eMGMT_DROP_NON_SCAN_MODE_FRAME,
111 eMGMT_DROP_INVALID_SIZE,
112}tMgmtFrmDropReason;
113
114
Jeff Johnson295189b2012-06-20 16:38:30 -0700115/// During TD ring clean up at HDD in RTAI, will call this call back
116extern void limPostTdDummyPktCallbak(void* pMacGlobals, unsigned int* pBd);
Jeff Johnson295189b2012-06-20 16:38:30 -0700117/**
118 * Function to initialize LIM state machines.
119 * This called upon LIM thread creation.
120 */
121extern tSirRetStatus limInitialize(tpAniSirGlobal);
122tSirRetStatus peOpen(tpAniSirGlobal pMac, tMacOpenParameters *pMacOpenParam);
123tSirRetStatus peClose(tpAniSirGlobal pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -0700124tSirRetStatus limStart(tpAniSirGlobal pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -0700125/**
126 * Function to Initialize radar interrupts.
127 */
128void limRadarInit(tpAniSirGlobal pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -0700129tSirRetStatus peStart(tpAniSirGlobal pMac);
130void peStop(tpAniSirGlobal pMac);
131tSirRetStatus pePostMsgApi(tpAniSirGlobal pMac, tSirMsgQ* pMsg);
132tSirRetStatus peProcessMsg(tpAniSirGlobal pMac, tSirMsgQ* limMsg);
133void limDumpInit(tpAniSirGlobal pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -0700134/**
135 * Function to cleanup LIM state.
136 * This called upon reset/persona change etc
137 */
138extern void limCleanup(tpAniSirGlobal);
Jeff Johnson295189b2012-06-20 16:38:30 -0700139/// Function to post messages to LIM thread
140extern tANI_U32 limPostMsgApi(tpAniSirGlobal, tSirMsgQ *);
Jeff Johnson295189b2012-06-20 16:38:30 -0700141/**
142 * Function to fetch messages posted LIM thread
143 */
144extern void limProcessMessageQueue(tpAniSirGlobal);
Jeff Johnson295189b2012-06-20 16:38:30 -0700145/**
146 * Function to process messages posted to LIM thread
147 * and dispatch to various sub modules within LIM module.
148 */
149extern void limMessageProcessor(tpAniSirGlobal, tpSirMsgQ);
150extern void limProcessMessages(tpAniSirGlobal, tpSirMsgQ); // DT test alt deferred 2
Jeff Johnson295189b2012-06-20 16:38:30 -0700151/**
152 * Function to check the LIM state if system is in Scan/Learn state.
153 */
154extern tANI_U8 limIsSystemInScanState(tpAniSirGlobal);
Jeff Johnson295189b2012-06-20 16:38:30 -0700155/**
156 * Function to handle IBSS coalescing.
157 * Beacon Processing module to call this.
158 */
159extern tSirRetStatus limHandleIBSScoalescing(tpAniSirGlobal,
160 tpSchBeaconStruct,
161 tANI_U8 *,tpPESession);
Jeff Johnson295189b2012-06-20 16:38:30 -0700162/// Function used by other Sirius modules to read global SME state
163 static inline tLimSmeStates
164limGetSmeState(tpAniSirGlobal pMac) { return pMac->lim.gLimSmeState; }
Jeff Johnson295189b2012-06-20 16:38:30 -0700165/// Function used by other Sirius modules to read global system role
166 static inline tLimSystemRole
167limGetSystemRole(tpPESession psessionEntry) { return psessionEntry->limSystemRole; }
Jeff Johnson295189b2012-06-20 16:38:30 -0700168//limGetAID(tpPESession psessionEntry) { return psessionEntry->limAID; }
Jeff Johnson295189b2012-06-20 16:38:30 -0700169extern void limReceivedHBHandler(tpAniSirGlobal, tANI_U8, tpPESession);
170//extern void limResetHBPktCount(tpPESession);
Jeff Johnson295189b2012-06-20 16:38:30 -0700171extern void limCheckAndQuietBSS(tpAniSirGlobal);
Jeff Johnson295189b2012-06-20 16:38:30 -0700172/// Function to send WDS info to WSM if needed
173extern void limProcessWdsInfo(tpAniSirGlobal, tSirPropIEStruct);
Jeff Johnson295189b2012-06-20 16:38:30 -0700174/// Function to initialize WDS info params
175extern void limInitWdsInfoParams(tpAniSirGlobal);
Jeff Johnson295189b2012-06-20 16:38:30 -0700176/// Function that triggers STA context deletion
177extern void limTriggerSTAdeletion(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession psessionEntry);
178
Hoonki Leee6bfe942013-02-05 15:01:19 -0800179#ifdef FEATURE_WLAN_TDLS
180// Function that sends TDLS Del Sta indication to SME
181extern void limSendSmeTDLSDelStaInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession psessionEntry, tANI_U16 reasonCode);
182#endif
183
Jeff Johnson295189b2012-06-20 16:38:30 -0700184/// Function that checks for change in AP's capabilties on STA
185extern void limDetectChangeInApCapabilities(tpAniSirGlobal,
186 tpSirProbeRespBeacon,tpPESession);
187tSirRetStatus limUpdateShortSlot(tpAniSirGlobal pMac,
188 tpSirProbeRespBeacon pBeacon,
189 tpUpdateBeaconParams pBeaconParams,tpPESession);
190
Jeff Johnson295189b2012-06-20 16:38:30 -0700191/// creates an addts request action frame and sends it out to staid
192extern void limSendAddtsReq (tpAniSirGlobal pMac, tANI_U16 staid, tANI_U8 tsid, tANI_U8 userPrio, tANI_U8 wme);
193/// creates a delts request action frame and sends it out to staid
194extern void limSendDeltsReq (tpAniSirGlobal pMac, tANI_U16 staid, tANI_U8 tsid, tANI_U8 userPrio, tANI_U8 wme);
195/// creates a SM Power State Mode update request action frame and sends it out to staid
196extern void limPostStartLearnModeMsgToSch(tpAniSirGlobal pMac);
Jeff Johnsone7245742012-09-05 17:12:55 -0700197#ifdef WLAN_FEATURE_11AC
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700198extern ePhyChanBondState limGet11ACPhyCBState(tpAniSirGlobal pMac, tANI_U8 channel, tANI_U8 htSecondaryChannelOffset, tANI_U8 CenterChan,tpPESession );
Jeff Johnsone7245742012-09-05 17:12:55 -0700199#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700200tANI_U8 limIsSystemInActiveState(tpAniSirGlobal pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -0700201#if 0 /* Currently, this function is not used but keep it around for when we do need it */
202tSirRetStatus limUpdateGlobalChannelBonding(tpAniSirGlobal pMac, tHalBitVal cbBit);
203#endif /* 0 */
204
Jeff Johnson295189b2012-06-20 16:38:30 -0700205void limHandleLowRssiInd(tpAniSirGlobal pMac);
206void limHandleBmpsStatusInd(tpAniSirGlobal pMac);
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -0800207void limHandleMissedBeaconInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg);
Jeff Johnson295189b2012-06-20 16:38:30 -0700208tMgmtFrmDropReason limIsPktCandidateForDrop(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tANI_U32 subType);
209void limMicFailureInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg);
Jeff Johnson295189b2012-06-20 16:38:30 -0700210/* ----------------------------------------------------------------------- */
211// These used to be in DPH
212extern void limSetBssid(tpAniSirGlobal pMac, tANI_U8 *bssId);
213extern void limGetBssid(tpAniSirGlobal pMac, tANI_U8 *bssId);
214extern void limGetMyMacAddr(tpAniSirGlobal pMac, tANI_U8 *mac);
215extern tSirRetStatus limCheckRxSeqNumber(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo);
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -0800216#define limGetQosMode(psessionEntry, pVal) (*(pVal) = (psessionEntry)->limQosEnabled)
217#define limGetWmeMode(psessionEntry, pVal) (*(pVal) = (psessionEntry)->limWmeEnabled)
218#define limGetWsmMode(psessionEntry, pVal) (*(pVal) = (psessionEntry)->limWsmEnabled)
219#define limGet11dMode(psessionEntry, pVal) (*(pVal) = (psessionEntry)->lim11dEnabled)
220#define limGetAckPolicy(pMac, pVal) (*(pVal) = pMac->lim.ackPolicy)
Jeff Johnson295189b2012-06-20 16:38:30 -0700221/* ----------------------------------------------------------------------- */
222static inline void limGetPhyMode(tpAniSirGlobal pMac, tANI_U32 *phyMode, tpPESession psessionEntry)
223{
224 *phyMode = psessionEntry ? psessionEntry->gLimPhyMode : pMac->lim.gLimPhyMode;
225}
226
227/* ----------------------------------------------------------------------- */
228static inline void limGetRfBand(tpAniSirGlobal pMac, tSirRFBand *band, tpPESession psessionEntry)
229{
230 *band = psessionEntry ? psessionEntry->limRFBand : SIR_BAND_UNKNOWN;
231}
232
233/*--------------------------------------------------------------------------
234
235 \brief peProcessMessages() - Message Processor for PE
236
237 Voss calls this function to dispatch the message to PE
238
239 \param pMac - Pointer to Global MAC structure
240 \param pMsg - Pointer to the message structure
241
242 \return tANI_U32 - TX_SUCCESS for success.
243
244 --------------------------------------------------------------------------*/
Jeff Johnson295189b2012-06-20 16:38:30 -0700245tSirRetStatus peProcessMessages(tpAniSirGlobal pMac, tSirMsgQ* pMsg);
Jeff Johnson295189b2012-06-20 16:38:30 -0700246/** -------------------------------------------------------------
247\fn peFreeMsg
248\brief Called by VOS scheduler (function vos_sched_flush_mc_mqs)
249\ to free a given PE message on the TX and MC thread.
250\ This happens when there are messages pending in the PE
251\ queue when system is being stopped and reset.
252\param tpAniSirGlobal pMac
253\param tSirMsgQ pMsg
254\return none
255-----------------------------------------------------------------*/
256v_VOID_t peFreeMsg( tpAniSirGlobal pMac, tSirMsgQ* pMsg);
Jeff Johnson295189b2012-06-20 16:38:30 -0700257/************************************************************/
258#endif /* __LIM_API_H */