blob: cbe52a6196dd74910e0f35e8a76f5f6f7264fb0a [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Hanumantha Reddy Pothula28b1e652015-02-02 21:10:13 +05302 * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
Kiet Lam0fb93dd2014-02-19 00:32:59 -08003 *
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.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -080020 */
Kiet Lam0fb93dd2014-02-19 00:32:59 -080021
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
Jeff Johnson295189b2012-06-20 16:38:30 -070028#if !defined( __SMEINSIDE_H )
29#define __SMEINSIDE_H
30
31
32/**=========================================================================
33
34 \file smeInside.h
35
36 \brief prototype for SME structures and APIs used insside SME
37
Jeff Johnson295189b2012-06-20 16:38:30 -070038
39 ========================================================================*/
40
41/* $Header$ */
42
43/*--------------------------------------------------------------------------
44 Include Files
45 ------------------------------------------------------------------------*/
46#include "vos_status.h"
47#include "vos_lock.h"
48#include "vos_trace.h"
49#include "vos_memory.h"
50#include "vos_types.h"
51#include "sirApi.h"
52#include "csrInternal.h"
53#include "sme_QosApi.h"
54#include "smeQosInternal.h"
55
56
Jeff Johnsone7245742012-09-05 17:12:55 -070057#ifdef FEATURE_OEM_DATA_SUPPORT
58#include "oemDataInternal.h"
59#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070060
61#if defined WLAN_FEATURE_VOWIFI
62#include "sme_RrmApi.h"
63#endif
64
65
66/*--------------------------------------------------------------------------
67 Type declarations
68 ------------------------------------------------------------------------*/
69
Gopichand Nakkala976e3252013-01-03 15:45:56 -080070#define SME_TOTAL_COMMAND 30
Jeff Johnson295189b2012-06-20 16:38:30 -070071
72
73typedef struct sGenericPmcCmd
74{
75 tANI_U32 size; //sizeof the data in the union, if any
76 tRequestFullPowerReason fullPowerReason;
77 tANI_BOOLEAN fReleaseWhenDone; //if TRUE, the command shall not put back to the queue, free te memory instead.
78 union
79 {
80 tExitBmpsInfo exitBmpsInfo;
81 tSirSmeWowlEnterParams enterWowlInfo;
82 }u;
83} tGenericPmcCmd;
84
85
86typedef struct sGenericQosCmd
87{
88 sme_QosWmmTspecInfo tspecInfo;
89 sme_QosEdcaAcType ac;
90 v_U8_t tspec_mask;
91} tGenericQosCmd;
92
Jeff Johnson295189b2012-06-20 16:38:30 -070093typedef struct sRemainChlCmd
94{
95 tANI_U8 chn;
96 tANI_U8 phyMode;
97 tANI_U32 duration;
Gopichand Nakkala924e4552013-05-08 19:18:14 +053098 tANI_U8 isP2PProbeReqAllowed;
Jeff Johnson295189b2012-06-20 16:38:30 -070099 void* callback;
100 void* callbackCtx;
101}tRemainChlCmd;
102
103typedef struct sNoACmd
104{
105 tP2pPsConfig NoA;
106} tNoACmd;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800107#ifdef FEATURE_WLAN_TDLS
108typedef struct TdlsSendMgmtInfo
109{
110 tSirMacAddr peerMac;
111 tANI_U8 frameType;
112 tANI_U8 dialog;
113 tANI_U16 statusCode;
Hoonki Leea34dd892013-02-05 22:56:02 -0800114 tANI_U8 responder;
Pradeep Reddy POTTETIca171f82014-03-21 14:17:35 +0530115 tANI_U32 peerCapability;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800116 tANI_U8 *buf;
117 tANI_U8 len;
118} tTdlsSendMgmtCmdInfo;
119
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530120typedef struct TdlsLinkEstablishInfo
121{
122 tSirMacAddr peerMac;
123 tANI_U8 uapsdQueues;
124 tANI_U8 maxSp;
125 tANI_U8 isBufSta;
Naresh Jayaramdff88f92014-02-12 21:44:29 +0530126 tANI_U8 isOffChannelSupported;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530127 tANI_U8 isResponder;
Naresh Jayaramdff88f92014-02-12 21:44:29 +0530128 tANI_U8 supportedChannelsLen;
129 tANI_U8 supportedChannels[SIR_MAC_MAX_SUPP_CHANNELS];
130 tANI_U8 supportedOperClassesLen;
131 tANI_U8 supportedOperClasses[SIR_MAC_MAX_SUPP_OPER_CLASSES];
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530132} tTdlsLinkEstablishCmdInfo;
133
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800134typedef struct TdlsAddStaInfo
135{
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800136 eTdlsAddOper tdlsAddOper;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800137 tSirMacAddr peerMac;
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800138 tANI_U16 capability;
139 tANI_U8 extnCapability[SIR_MAC_MAX_EXTN_CAP];
140 tANI_U8 supportedRatesLen;
141 tANI_U8 supportedRates[SIR_MAC_MAX_SUPP_RATES];
Hoonki Lee66b75f32013-04-16 18:30:07 -0700142 tANI_U8 htcap_present;
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800143 tSirHTCap HTCap;
Hoonki Lee66b75f32013-04-16 18:30:07 -0700144 tANI_U8 vhtcap_present;
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800145 tSirVHTCap VHTCap;
146 tANI_U8 uapsdQueues;
147 tANI_U8 maxSp;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800148} tTdlsAddStaCmdInfo;
149
150typedef struct TdlsDelStaInfo
151{
152 tSirMacAddr peerMac;
153} tTdlsDelStaCmdInfo;
Atul Mittalc0f739f2014-07-31 13:47:47 +0530154
155// tdlsoffchan
156typedef struct TdlsChanSwitchInfo
157{
158 tSirMacAddr peerMac;
159 tANI_U8 tdlsOffCh;
160 tANI_U8 tdlsOffChBwOffset;
161 tANI_U8 tdlsSwMode;
162} tTdlsChanSwitchCmdInfo;
163
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800164#ifdef FEATURE_WLAN_TDLS_INTERNAL
165typedef struct TdlsDisReqCmdinfo
166{
167 tSirMacAddr peerMac;
168 tANI_U8 tdlsDisType;
169} tTdlsDisReqCmdinfo;
170
171typedef struct tdlsLinkSetupReqCmdinfo
172{
173 tSirMacAddr peerMac;
174} tTdlsLinkSetupReqCmdinfo;
175
176typedef struct tdlsLinkTeardownCmdinfo
177{
178 tSirMacAddr peerMac;
179} tTdlsLinkTeardownCmdinfo;
180#endif
181/*
182 * TDLS cmd info, CMD from SME to PE.
183 */
184typedef struct s_tdls_cmd
185{
186 tANI_U32 size;
187 union
188 {
189#ifdef FEATURE_WLAN_TDLS_INTERNAL
190 tTdlsDisReqCmdinfo tdlsDisReqCmdInfo ;
191 tTdlsLinkSetupReqCmdinfo tdlsLinkSetupReqCmdInfo ;
192 tTdlsLinkTeardownCmdinfo tdlsLinkTeardownCmdInfo ;
193 //tEnterPeerUAPSDInfo enterUapsdInfo ;
194 //tExitPeerUAPSDinfo exitUapsdInfo ;
195#endif
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530196 tTdlsLinkEstablishCmdInfo tdlsLinkEstablishCmdInfo;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800197 tTdlsSendMgmtCmdInfo tdlsSendMgmtCmdInfo;
198 tTdlsAddStaCmdInfo tdlsAddStaCmdInfo;
199 tTdlsDelStaCmdInfo tdlsDelStaCmdInfo;
Atul Mittalc0f739f2014-07-31 13:47:47 +0530200 tTdlsChanSwitchCmdInfo tdlsChanSwitchCmdInfo; //tdlsoffchan
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800201 }u;
202} tTdlsCmd;
203#endif /* FEATURE_WLAN_TDLS */
Jeff Johnson295189b2012-06-20 16:38:30 -0700204
205typedef struct tagSmeCmd
206{
207 tListElem Link;
208 eSmeCommandType command;
209 tANI_U32 sessionId;
210 union
211 {
212 tScanCmd scanCmd;
213 tRoamCmd roamCmd;
214 tWmStatusChangeCmd wmStatusChangeCmd;
215 tSetKeyCmd setKeyCmd;
216 tRemoveKeyCmd removeKeyCmd;
217 tGenericPmcCmd pmcCmd;
218 tGenericQosCmd qosCmd;
Jeff Johnsone7245742012-09-05 17:12:55 -0700219#ifdef FEATURE_OEM_DATA_SUPPORT
220 tOemDataCmd oemDataCmd;
221#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700222 tRemainChlCmd remainChlCmd;
223 tNoACmd NoACmd;
Jeff Johnson295189b2012-06-20 16:38:30 -0700224 tAddStaForSessionCmd addStaSessionCmd;
225 tDelStaForSessionCmd delStaSessionCmd;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800226#ifdef FEATURE_WLAN_TDLS
227 tTdlsCmd tdlsCmd;
228#endif
Hanumantha Reddy Pothula28b1e652015-02-02 21:10:13 +0530229 tSirPNOScanReq pnoInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -0700230 }u;
231}tSmeCmd;
232
233
234
235/*--------------------------------------------------------------------------
236 Internal to SME
237 ------------------------------------------------------------------------*/
238
239//To get a command buffer
240//Return: NULL if there no more command buffer left
241tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac );
242void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority );
243void smeProcessPendingQueue( tpAniSirGlobal pMac );
244void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd);
Madan Mohan Koyyalamudi21255992013-08-01 18:00:25 +0530245void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId,
246 tDblLinkList *pList);
Jeff Johnson295189b2012-06-20 16:38:30 -0700247tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac);
248tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
249//this function is used to abort a command where the normal processing of the command
250//is terminated without going through the normal path. it is here to take care of callbacks for
251//the command, if applicable.
252void pmcAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
253tANI_BOOLEAN qosProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
254
255eHalStatus csrProcessScanCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
256eHalStatus csrRoamProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
257void csrRoamProcessWmStatusChangeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
258void csrReinitRoamCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
259void csrReinitWmStatusChangeCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
260void csrReinitSetKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
261void csrReinitRemoveKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
262eHalStatus csrRoamProcessSetKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
263eHalStatus csrRoamProcessRemoveKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
264void csrReleaseCommandSetKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
265void csrReleaseCommandRemoveKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
266//eHalStatus csrRoamIssueSetKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 roamId );
267eHalStatus csrRoamIssueRemoveKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId,
268 tCsrRoamRemoveKey *pRemoveKey, tANI_U32 roamId );
269eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand, tRequestFullPowerReason *pReason,
270 tANI_BOOLEAN *pfNeedPower);
271void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
272
273eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme);
274eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme);
275
Jeff Johnsone7245742012-09-05 17:12:55 -0700276#ifdef FEATURE_OEM_DATA_SUPPORT
277eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand);
278#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700279
280eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
281eHalStatus csrProcessAddStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
282eHalStatus csrProcessDelStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
283eHalStatus csrProcessDelStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
284
285#ifdef WLAN_NS_OFFLOAD
286/* ---------------------------------------------------------------------------
287 \fn pmcSetNSOffload
288 \brief Set the host offload feature.
289 \param hHal - The handle returned by macOpen.
290 \param pRequest - Pointer to the offload request.
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700291 \param sessionId . Session index of the session
Jeff Johnson295189b2012-06-20 16:38:30 -0700292 \return eHalStatus
293 eHAL_STATUS_FAILURE Cannot set the offload.
294 eHAL_STATUS_SUCCESS Request accepted.
295 ---------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700296eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700297#endif //WLAN_NS_OFFLOAD
298
299#ifdef FEATURE_WLAN_SCAN_PNO
300eHalStatus pmcSetPreferredNetworkList(tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, preferredNetworkFoundIndCallback callbackRoutine, void *callbackContext);
301eHalStatus pmcUpdateScanParams(tHalHandle hHal, tCsrConfig *pRequest, tCsrChannel *pChannelList, tANI_U8 b11dResolved);
302eHalStatus pmcSetRssiFilter(tHalHandle hHal, v_U8_t rssiThreshold);
303#endif // FEATURE_WLAN_SCAN_PNO
Tushnim Bhattacharyya3a37def2013-02-24 11:11:15 -0800304eHalStatus pmcSetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams, tANI_BOOLEAN forced);
Jeff Johnson295189b2012-06-20 16:38:30 -0700305
306tANI_BOOLEAN csrRoamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800307#ifdef FEATURE_WLAN_TDLS
308eHalStatus csrTdlsSendMgmtReq(tHalHandle hHal, tANI_U8 sessionId, tCsrTdlsSendMgmt *tdlsSendMgmt);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530309VOS_STATUS csrTdlsSendLinkEstablishParams(tHalHandle hHal,
310 tANI_U8 sessionId,
311 tSirMacAddr peerMac,
312 tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800313eHalStatus csrTdlsAddPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800314eHalStatus csrTdlsChangePeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, tCsrStaParams *pstaParams);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800315eHalStatus csrTdlsDelPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
316eHalStatus csrTdlsProcessCmd(tpAniSirGlobal pMac,tSmeCmd *pCommand );
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530317eHalStatus csrTdlsProcessLinkEstablish( tpAniSirGlobal pMac, tSmeCmd *cmd );
Atul Mittalc0f739f2014-07-31 13:47:47 +0530318eHalStatus csrTdlsProcessChanSwitchReq(tpAniSirGlobal pMac, tSmeCmd *cmd ); //tdlsoffchan
319eHalStatus tdlsMsgProcessor(tpAniSirGlobal pMac,v_U16_t msg_type, void *pMsgBuf);
320VOS_STATUS csrTdlsSendChanSwitchReq(tHalHandle hHal,
321 tANI_U8 sessionId,
322 tSirMacAddr peerMac,
323 tANI_S32 tdlsOffCh,
324 tANI_S32 tdlsOffChBwOffset,
325 tANI_U8 tdlsSwMode);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800326#ifdef FEATURE_WLAN_TDLS_INTERNAL
327eHalStatus csrTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId,
328 tCsrTdlsDisRequest *tdlsDisReq);
329eHalStatus csrTdlsSetupReq(tHalHandle hHal, tANI_U8 sessionId,
330 tCsrTdlsSetupRequest *tdlsSetupReq);
331eHalStatus csrTdlsTeardownReq(tHalHandle hHal, tANI_U8 sessionId,
332 tCsrTdlsTeardownRequest *teardown);
333#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800334#endif /* FEATURE_WLAN_TDLS */
335
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800336#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700337eHalStatus csrFlushCfgBgScanRoamChannelList(tpAniSirGlobal pMac);
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700338eHalStatus csrCreateBgScanRoamChannelList(tpAniSirGlobal pMac,
339 const tANI_U8 *pChannelList,
340 const tANI_U8 numChannels);
Srinivas Girigowdade697412013-02-14 16:31:48 -0800341eHalStatus csrUpdateBgScanConfigIniChannelList(tpAniSirGlobal pMac, eCsrBand eBand);
Srinivas Girigowdade697412013-02-14 16:31:48 -0800342#endif
343
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800344#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700345eHalStatus csrCreateRoamScanChannelList(tpAniSirGlobal pMac,
346 tANI_U8 *pChannelList,
347 tANI_U8 numChannels,
348 const eCsrBand eBand);
349#endif
Kalikinkar Dharaa4988972013-10-28 13:39:54 -0700350void activeListCmdTimeoutHandle(void *userData);
Srinivas Girigowdade697412013-02-14 16:31:48 -0800351
Kanchanapally, Vidyullatha2ed7bde2014-12-29 12:18:36 +0530352void csrGetStaticUapsdMask(tpAniSirGlobal pMac, tANI_U8 *staticUapsdMask);
353
Jeff Johnson295189b2012-06-20 16:38:30 -0700354#endif //#if !defined( __SMEINSIDE_H )