blob: f0cfb2ed2e74c1db90e945993a9c570714fc56db [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lamaa8e15a2014-02-11 23:30:06 -08002 * Copyright (c) 2012-2013 Qualcomm Atheros, Inc.
3 * All Rights Reserved.
4 * Qualcomm Atheros Confidential and Proprietary.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08005 */
Jeff Johnson295189b2012-06-20 16:38:30 -07006#if !defined( __SMEINSIDE_H )
7#define __SMEINSIDE_H
8
9
10/**=========================================================================
11
12 \file smeInside.h
13
14 \brief prototype for SME structures and APIs used insside SME
15
16 Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved.
17
18 Qualcomm Confidential and Proprietary.
19
20 ========================================================================*/
21
22/* $Header$ */
23
24/*--------------------------------------------------------------------------
25 Include Files
26 ------------------------------------------------------------------------*/
27#include "vos_status.h"
28#include "vos_lock.h"
29#include "vos_trace.h"
30#include "vos_memory.h"
31#include "vos_types.h"
32#include "sirApi.h"
33#include "csrInternal.h"
34#include "sme_QosApi.h"
35#include "smeQosInternal.h"
36
37
Jeff Johnsone7245742012-09-05 17:12:55 -070038#ifdef FEATURE_OEM_DATA_SUPPORT
39#include "oemDataInternal.h"
40#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070041
42#if defined WLAN_FEATURE_VOWIFI
43#include "sme_RrmApi.h"
44#endif
45
46
47/*--------------------------------------------------------------------------
48 Type declarations
49 ------------------------------------------------------------------------*/
50
Gopichand Nakkala976e3252013-01-03 15:45:56 -080051#define SME_TOTAL_COMMAND 30
Jeff Johnson295189b2012-06-20 16:38:30 -070052
53
54typedef struct sGenericPmcCmd
55{
56 tANI_U32 size; //sizeof the data in the union, if any
57 tRequestFullPowerReason fullPowerReason;
58 tANI_BOOLEAN fReleaseWhenDone; //if TRUE, the command shall not put back to the queue, free te memory instead.
59 union
60 {
61 tExitBmpsInfo exitBmpsInfo;
62 tSirSmeWowlEnterParams enterWowlInfo;
63 }u;
64} tGenericPmcCmd;
65
66
67typedef struct sGenericQosCmd
68{
69 sme_QosWmmTspecInfo tspecInfo;
70 sme_QosEdcaAcType ac;
71 v_U8_t tspec_mask;
72} tGenericQosCmd;
73
Jeff Johnson295189b2012-06-20 16:38:30 -070074typedef struct sRemainChlCmd
75{
76 tANI_U8 chn;
77 tANI_U8 phyMode;
78 tANI_U32 duration;
Gopichand Nakkala924e4552013-05-08 19:18:14 +053079 tANI_U8 isP2PProbeReqAllowed;
Jeff Johnson295189b2012-06-20 16:38:30 -070080 void* callback;
81 void* callbackCtx;
82}tRemainChlCmd;
83
84typedef struct sNoACmd
85{
86 tP2pPsConfig NoA;
87} tNoACmd;
Mohit Khanna698ba2a2012-12-04 15:08:18 -080088#ifdef FEATURE_WLAN_TDLS
89typedef struct TdlsSendMgmtInfo
90{
91 tSirMacAddr peerMac;
92 tANI_U8 frameType;
93 tANI_U8 dialog;
94 tANI_U16 statusCode;
Hoonki Leea34dd892013-02-05 22:56:02 -080095 tANI_U8 responder;
Mohit Khanna698ba2a2012-12-04 15:08:18 -080096 tANI_U8 *buf;
97 tANI_U8 len;
98} tTdlsSendMgmtCmdInfo;
99
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530100typedef struct TdlsLinkEstablishInfo
101{
102 tSirMacAddr peerMac;
103 tANI_U8 uapsdQueues;
104 tANI_U8 maxSp;
105 tANI_U8 isBufSta;
Naresh Jayaramdff88f92014-02-12 21:44:29 +0530106 tANI_U8 isOffChannelSupported;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530107 tANI_U8 isResponder;
Naresh Jayaramdff88f92014-02-12 21:44:29 +0530108 tANI_U8 supportedChannelsLen;
109 tANI_U8 supportedChannels[SIR_MAC_MAX_SUPP_CHANNELS];
110 tANI_U8 supportedOperClassesLen;
111 tANI_U8 supportedOperClasses[SIR_MAC_MAX_SUPP_OPER_CLASSES];
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530112} tTdlsLinkEstablishCmdInfo;
113
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800114typedef struct TdlsAddStaInfo
115{
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800116 eTdlsAddOper tdlsAddOper;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800117 tSirMacAddr peerMac;
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800118 tANI_U16 capability;
119 tANI_U8 extnCapability[SIR_MAC_MAX_EXTN_CAP];
120 tANI_U8 supportedRatesLen;
121 tANI_U8 supportedRates[SIR_MAC_MAX_SUPP_RATES];
Hoonki Lee66b75f32013-04-16 18:30:07 -0700122 tANI_U8 htcap_present;
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800123 tSirHTCap HTCap;
Hoonki Lee66b75f32013-04-16 18:30:07 -0700124 tANI_U8 vhtcap_present;
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800125 tSirVHTCap VHTCap;
126 tANI_U8 uapsdQueues;
127 tANI_U8 maxSp;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800128} tTdlsAddStaCmdInfo;
129
130typedef struct TdlsDelStaInfo
131{
132 tSirMacAddr peerMac;
133} tTdlsDelStaCmdInfo;
134#ifdef FEATURE_WLAN_TDLS_INTERNAL
135typedef struct TdlsDisReqCmdinfo
136{
137 tSirMacAddr peerMac;
138 tANI_U8 tdlsDisType;
139} tTdlsDisReqCmdinfo;
140
141typedef struct tdlsLinkSetupReqCmdinfo
142{
143 tSirMacAddr peerMac;
144} tTdlsLinkSetupReqCmdinfo;
145
146typedef struct tdlsLinkTeardownCmdinfo
147{
148 tSirMacAddr peerMac;
149} tTdlsLinkTeardownCmdinfo;
150#endif
151/*
152 * TDLS cmd info, CMD from SME to PE.
153 */
154typedef struct s_tdls_cmd
155{
156 tANI_U32 size;
157 union
158 {
159#ifdef FEATURE_WLAN_TDLS_INTERNAL
160 tTdlsDisReqCmdinfo tdlsDisReqCmdInfo ;
161 tTdlsLinkSetupReqCmdinfo tdlsLinkSetupReqCmdInfo ;
162 tTdlsLinkTeardownCmdinfo tdlsLinkTeardownCmdInfo ;
163 //tEnterPeerUAPSDInfo enterUapsdInfo ;
164 //tExitPeerUAPSDinfo exitUapsdInfo ;
165#endif
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530166 tTdlsLinkEstablishCmdInfo tdlsLinkEstablishCmdInfo;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800167 tTdlsSendMgmtCmdInfo tdlsSendMgmtCmdInfo;
168 tTdlsAddStaCmdInfo tdlsAddStaCmdInfo;
169 tTdlsDelStaCmdInfo tdlsDelStaCmdInfo;
170 }u;
171} tTdlsCmd;
172#endif /* FEATURE_WLAN_TDLS */
Jeff Johnson295189b2012-06-20 16:38:30 -0700173
174typedef struct tagSmeCmd
175{
176 tListElem Link;
177 eSmeCommandType command;
178 tANI_U32 sessionId;
179 union
180 {
181 tScanCmd scanCmd;
182 tRoamCmd roamCmd;
183 tWmStatusChangeCmd wmStatusChangeCmd;
184 tSetKeyCmd setKeyCmd;
185 tRemoveKeyCmd removeKeyCmd;
186 tGenericPmcCmd pmcCmd;
187 tGenericQosCmd qosCmd;
Jeff Johnsone7245742012-09-05 17:12:55 -0700188#ifdef FEATURE_OEM_DATA_SUPPORT
189 tOemDataCmd oemDataCmd;
190#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700191 tRemainChlCmd remainChlCmd;
192 tNoACmd NoACmd;
Jeff Johnson295189b2012-06-20 16:38:30 -0700193 tAddStaForSessionCmd addStaSessionCmd;
194 tDelStaForSessionCmd delStaSessionCmd;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800195#ifdef FEATURE_WLAN_TDLS
196 tTdlsCmd tdlsCmd;
197#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700198 }u;
199}tSmeCmd;
200
201
202
203/*--------------------------------------------------------------------------
204 Internal to SME
205 ------------------------------------------------------------------------*/
206
207//To get a command buffer
208//Return: NULL if there no more command buffer left
209tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac );
210void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority );
211void smeProcessPendingQueue( tpAniSirGlobal pMac );
212void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd);
Madan Mohan Koyyalamudi21255992013-08-01 18:00:25 +0530213void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId,
214 tDblLinkList *pList);
Jeff Johnson295189b2012-06-20 16:38:30 -0700215tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac);
216tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
217//this function is used to abort a command where the normal processing of the command
218//is terminated without going through the normal path. it is here to take care of callbacks for
219//the command, if applicable.
220void pmcAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
221tANI_BOOLEAN qosProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
222
223eHalStatus csrProcessScanCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
224eHalStatus csrRoamProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
225void csrRoamProcessWmStatusChangeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
226void csrReinitRoamCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
227void csrReinitWmStatusChangeCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
228void csrReinitSetKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
229void csrReinitRemoveKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
230eHalStatus csrRoamProcessSetKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
231eHalStatus csrRoamProcessRemoveKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
232void csrReleaseCommandSetKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
233void csrReleaseCommandRemoveKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
234//eHalStatus csrRoamIssueSetKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 roamId );
235eHalStatus csrRoamIssueRemoveKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId,
236 tCsrRoamRemoveKey *pRemoveKey, tANI_U32 roamId );
237eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand, tRequestFullPowerReason *pReason,
238 tANI_BOOLEAN *pfNeedPower);
239void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
240
241eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme);
242eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme);
243
Jeff Johnsone7245742012-09-05 17:12:55 -0700244#ifdef FEATURE_OEM_DATA_SUPPORT
245eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand);
246#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700247
248eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
249eHalStatus csrProcessAddStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
250eHalStatus csrProcessDelStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
251eHalStatus csrProcessDelStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
252
253#ifdef WLAN_NS_OFFLOAD
254/* ---------------------------------------------------------------------------
255 \fn pmcSetNSOffload
256 \brief Set the host offload feature.
257 \param hHal - The handle returned by macOpen.
258 \param pRequest - Pointer to the offload request.
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700259 \param sessionId . Session index of the session
Jeff Johnson295189b2012-06-20 16:38:30 -0700260 \return eHalStatus
261 eHAL_STATUS_FAILURE Cannot set the offload.
262 eHAL_STATUS_SUCCESS Request accepted.
263 ---------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700264eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700265#endif //WLAN_NS_OFFLOAD
266
267#ifdef FEATURE_WLAN_SCAN_PNO
268eHalStatus pmcSetPreferredNetworkList(tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, preferredNetworkFoundIndCallback callbackRoutine, void *callbackContext);
269eHalStatus pmcUpdateScanParams(tHalHandle hHal, tCsrConfig *pRequest, tCsrChannel *pChannelList, tANI_U8 b11dResolved);
270eHalStatus pmcSetRssiFilter(tHalHandle hHal, v_U8_t rssiThreshold);
271#endif // FEATURE_WLAN_SCAN_PNO
Tushnim Bhattacharyya3a37def2013-02-24 11:11:15 -0800272eHalStatus pmcSetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams, tANI_BOOLEAN forced);
Jeff Johnson295189b2012-06-20 16:38:30 -0700273
274tANI_BOOLEAN csrRoamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800275#ifdef FEATURE_WLAN_TDLS
276eHalStatus csrTdlsSendMgmtReq(tHalHandle hHal, tANI_U8 sessionId, tCsrTdlsSendMgmt *tdlsSendMgmt);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530277VOS_STATUS csrTdlsSendLinkEstablishParams(tHalHandle hHal,
278 tANI_U8 sessionId,
279 tSirMacAddr peerMac,
280 tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800281eHalStatus csrTdlsAddPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800282eHalStatus csrTdlsChangePeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, tCsrStaParams *pstaParams);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800283eHalStatus csrTdlsDelPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
284eHalStatus csrTdlsProcessCmd(tpAniSirGlobal pMac,tSmeCmd *pCommand );
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530285eHalStatus csrTdlsProcessLinkEstablish( tpAniSirGlobal pMac, tSmeCmd *cmd );
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800286eHalStatus tdlsMsgProcessor(tpAniSirGlobal pMac,v_U16_t msg_type,
287 void *pMsgBuf);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800288#ifdef FEATURE_WLAN_TDLS_INTERNAL
289eHalStatus csrTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId,
290 tCsrTdlsDisRequest *tdlsDisReq);
291eHalStatus csrTdlsSetupReq(tHalHandle hHal, tANI_U8 sessionId,
292 tCsrTdlsSetupRequest *tdlsSetupReq);
293eHalStatus csrTdlsTeardownReq(tHalHandle hHal, tANI_U8 sessionId,
294 tCsrTdlsTeardownRequest *teardown);
295#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800296#endif /* FEATURE_WLAN_TDLS */
297
Srinivas Girigowdade697412013-02-14 16:31:48 -0800298#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700299eHalStatus csrFlushCfgBgScanRoamChannelList(tpAniSirGlobal pMac);
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700300eHalStatus csrCreateBgScanRoamChannelList(tpAniSirGlobal pMac,
301 const tANI_U8 *pChannelList,
302 const tANI_U8 numChannels);
Srinivas Girigowdade697412013-02-14 16:31:48 -0800303eHalStatus csrUpdateBgScanConfigIniChannelList(tpAniSirGlobal pMac, eCsrBand eBand);
Srinivas Girigowdade697412013-02-14 16:31:48 -0800304#endif
305
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700306#if defined(FEATURE_WLAN_CCX) && defined(FEATURE_WLAN_CCX_UPLOAD)
307eHalStatus csrCreateRoamScanChannelList(tpAniSirGlobal pMac,
308 tANI_U8 *pChannelList,
309 tANI_U8 numChannels,
310 const eCsrBand eBand);
311#endif
Kalikinkar Dharaa4988972013-10-28 13:39:54 -0700312void activeListCmdTimeoutHandle(void *userData);
Srinivas Girigowdade697412013-02-14 16:31:48 -0800313
Jeff Johnson295189b2012-06-20 16:38:30 -0700314#endif //#if !defined( __SMEINSIDE_H )