blob: 839b800627d43884649577869d88a7df93ff5551 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08002 * Copyright (c) 2012-2014 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
38 Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved.
39
40 Qualcomm Confidential and Proprietary.
41
42 ========================================================================*/
43
44/* $Header$ */
45
46/*--------------------------------------------------------------------------
47 Include Files
48 ------------------------------------------------------------------------*/
49#include "vos_status.h"
50#include "vos_lock.h"
51#include "vos_trace.h"
52#include "vos_memory.h"
53#include "vos_types.h"
54#include "sirApi.h"
55#include "csrInternal.h"
56#include "sme_QosApi.h"
57#include "smeQosInternal.h"
58
59
Jeff Johnsone7245742012-09-05 17:12:55 -070060#ifdef FEATURE_OEM_DATA_SUPPORT
61#include "oemDataInternal.h"
62#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070063
64#if defined WLAN_FEATURE_VOWIFI
65#include "sme_RrmApi.h"
66#endif
67
68
69/*--------------------------------------------------------------------------
70 Type declarations
71 ------------------------------------------------------------------------*/
72
Gopichand Nakkala976e3252013-01-03 15:45:56 -080073#define SME_TOTAL_COMMAND 30
Jeff Johnson295189b2012-06-20 16:38:30 -070074
75
76typedef struct sGenericPmcCmd
77{
78 tANI_U32 size; //sizeof the data in the union, if any
79 tRequestFullPowerReason fullPowerReason;
80 tANI_BOOLEAN fReleaseWhenDone; //if TRUE, the command shall not put back to the queue, free te memory instead.
81 union
82 {
83 tExitBmpsInfo exitBmpsInfo;
84 tSirSmeWowlEnterParams enterWowlInfo;
85 }u;
86} tGenericPmcCmd;
87
88
89typedef struct sGenericQosCmd
90{
91 sme_QosWmmTspecInfo tspecInfo;
92 sme_QosEdcaAcType ac;
93 v_U8_t tspec_mask;
94} tGenericQosCmd;
95
Jeff Johnson295189b2012-06-20 16:38:30 -070096typedef struct sRemainChlCmd
97{
98 tANI_U8 chn;
99 tANI_U8 phyMode;
100 tANI_U32 duration;
Gopichand Nakkala924e4552013-05-08 19:18:14 +0530101 tANI_U8 isP2PProbeReqAllowed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700102 void* callback;
103 void* callbackCtx;
104}tRemainChlCmd;
105
106typedef struct sNoACmd
107{
108 tP2pPsConfig NoA;
109} tNoACmd;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800110#ifdef FEATURE_WLAN_TDLS
111typedef struct TdlsSendMgmtInfo
112{
113 tSirMacAddr peerMac;
114 tANI_U8 frameType;
115 tANI_U8 dialog;
116 tANI_U16 statusCode;
Hoonki Leea34dd892013-02-05 22:56:02 -0800117 tANI_U8 responder;
Pradeep Reddy POTTETIca171f82014-03-21 14:17:35 +0530118 tANI_U32 peerCapability;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800119 tANI_U8 *buf;
120 tANI_U8 len;
121} tTdlsSendMgmtCmdInfo;
122
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530123typedef struct TdlsLinkEstablishInfo
124{
125 tSirMacAddr peerMac;
126 tANI_U8 uapsdQueues;
127 tANI_U8 maxSp;
128 tANI_U8 isBufSta;
Naresh Jayaramdff88f92014-02-12 21:44:29 +0530129 tANI_U8 isOffChannelSupported;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530130 tANI_U8 isResponder;
Naresh Jayaramdff88f92014-02-12 21:44:29 +0530131 tANI_U8 supportedChannelsLen;
132 tANI_U8 supportedChannels[SIR_MAC_MAX_SUPP_CHANNELS];
133 tANI_U8 supportedOperClassesLen;
134 tANI_U8 supportedOperClasses[SIR_MAC_MAX_SUPP_OPER_CLASSES];
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530135} tTdlsLinkEstablishCmdInfo;
136
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800137typedef struct TdlsAddStaInfo
138{
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800139 eTdlsAddOper tdlsAddOper;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800140 tSirMacAddr peerMac;
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800141 tANI_U16 capability;
142 tANI_U8 extnCapability[SIR_MAC_MAX_EXTN_CAP];
143 tANI_U8 supportedRatesLen;
144 tANI_U8 supportedRates[SIR_MAC_MAX_SUPP_RATES];
Hoonki Lee66b75f32013-04-16 18:30:07 -0700145 tANI_U8 htcap_present;
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800146 tSirHTCap HTCap;
Hoonki Lee66b75f32013-04-16 18:30:07 -0700147 tANI_U8 vhtcap_present;
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800148 tSirVHTCap VHTCap;
149 tANI_U8 uapsdQueues;
150 tANI_U8 maxSp;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800151} tTdlsAddStaCmdInfo;
152
153typedef struct TdlsDelStaInfo
154{
155 tSirMacAddr peerMac;
156} tTdlsDelStaCmdInfo;
157#ifdef FEATURE_WLAN_TDLS_INTERNAL
158typedef struct TdlsDisReqCmdinfo
159{
160 tSirMacAddr peerMac;
161 tANI_U8 tdlsDisType;
162} tTdlsDisReqCmdinfo;
163
164typedef struct tdlsLinkSetupReqCmdinfo
165{
166 tSirMacAddr peerMac;
167} tTdlsLinkSetupReqCmdinfo;
168
169typedef struct tdlsLinkTeardownCmdinfo
170{
171 tSirMacAddr peerMac;
172} tTdlsLinkTeardownCmdinfo;
173#endif
174/*
175 * TDLS cmd info, CMD from SME to PE.
176 */
177typedef struct s_tdls_cmd
178{
179 tANI_U32 size;
180 union
181 {
182#ifdef FEATURE_WLAN_TDLS_INTERNAL
183 tTdlsDisReqCmdinfo tdlsDisReqCmdInfo ;
184 tTdlsLinkSetupReqCmdinfo tdlsLinkSetupReqCmdInfo ;
185 tTdlsLinkTeardownCmdinfo tdlsLinkTeardownCmdInfo ;
186 //tEnterPeerUAPSDInfo enterUapsdInfo ;
187 //tExitPeerUAPSDinfo exitUapsdInfo ;
188#endif
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530189 tTdlsLinkEstablishCmdInfo tdlsLinkEstablishCmdInfo;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800190 tTdlsSendMgmtCmdInfo tdlsSendMgmtCmdInfo;
191 tTdlsAddStaCmdInfo tdlsAddStaCmdInfo;
192 tTdlsDelStaCmdInfo tdlsDelStaCmdInfo;
193 }u;
194} tTdlsCmd;
195#endif /* FEATURE_WLAN_TDLS */
Jeff Johnson295189b2012-06-20 16:38:30 -0700196
197typedef struct tagSmeCmd
198{
199 tListElem Link;
200 eSmeCommandType command;
201 tANI_U32 sessionId;
202 union
203 {
204 tScanCmd scanCmd;
205 tRoamCmd roamCmd;
206 tWmStatusChangeCmd wmStatusChangeCmd;
207 tSetKeyCmd setKeyCmd;
208 tRemoveKeyCmd removeKeyCmd;
209 tGenericPmcCmd pmcCmd;
210 tGenericQosCmd qosCmd;
Jeff Johnsone7245742012-09-05 17:12:55 -0700211#ifdef FEATURE_OEM_DATA_SUPPORT
212 tOemDataCmd oemDataCmd;
213#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700214 tRemainChlCmd remainChlCmd;
215 tNoACmd NoACmd;
Jeff Johnson295189b2012-06-20 16:38:30 -0700216 tAddStaForSessionCmd addStaSessionCmd;
217 tDelStaForSessionCmd delStaSessionCmd;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800218#ifdef FEATURE_WLAN_TDLS
219 tTdlsCmd tdlsCmd;
220#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700221 }u;
222}tSmeCmd;
223
224
225
226/*--------------------------------------------------------------------------
227 Internal to SME
228 ------------------------------------------------------------------------*/
229
230//To get a command buffer
231//Return: NULL if there no more command buffer left
232tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac );
233void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority );
234void smeProcessPendingQueue( tpAniSirGlobal pMac );
235void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd);
Madan Mohan Koyyalamudi21255992013-08-01 18:00:25 +0530236void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId,
237 tDblLinkList *pList);
Jeff Johnson295189b2012-06-20 16:38:30 -0700238tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac);
239tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
240//this function is used to abort a command where the normal processing of the command
241//is terminated without going through the normal path. it is here to take care of callbacks for
242//the command, if applicable.
243void pmcAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
244tANI_BOOLEAN qosProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
245
246eHalStatus csrProcessScanCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
247eHalStatus csrRoamProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
248void csrRoamProcessWmStatusChangeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
249void csrReinitRoamCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
250void csrReinitWmStatusChangeCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
251void csrReinitSetKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
252void csrReinitRemoveKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
253eHalStatus csrRoamProcessSetKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
254eHalStatus csrRoamProcessRemoveKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
255void csrReleaseCommandSetKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
256void csrReleaseCommandRemoveKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
257//eHalStatus csrRoamIssueSetKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 roamId );
258eHalStatus csrRoamIssueRemoveKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId,
259 tCsrRoamRemoveKey *pRemoveKey, tANI_U32 roamId );
260eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand, tRequestFullPowerReason *pReason,
261 tANI_BOOLEAN *pfNeedPower);
262void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
263
264eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme);
265eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme);
266
Jeff Johnsone7245742012-09-05 17:12:55 -0700267#ifdef FEATURE_OEM_DATA_SUPPORT
268eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand);
269#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700270
271eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
272eHalStatus csrProcessAddStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
273eHalStatus csrProcessDelStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
274eHalStatus csrProcessDelStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
275
276#ifdef WLAN_NS_OFFLOAD
277/* ---------------------------------------------------------------------------
278 \fn pmcSetNSOffload
279 \brief Set the host offload feature.
280 \param hHal - The handle returned by macOpen.
281 \param pRequest - Pointer to the offload request.
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700282 \param sessionId . Session index of the session
Jeff Johnson295189b2012-06-20 16:38:30 -0700283 \return eHalStatus
284 eHAL_STATUS_FAILURE Cannot set the offload.
285 eHAL_STATUS_SUCCESS Request accepted.
286 ---------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700287eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700288#endif //WLAN_NS_OFFLOAD
289
290#ifdef FEATURE_WLAN_SCAN_PNO
291eHalStatus pmcSetPreferredNetworkList(tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, preferredNetworkFoundIndCallback callbackRoutine, void *callbackContext);
292eHalStatus pmcUpdateScanParams(tHalHandle hHal, tCsrConfig *pRequest, tCsrChannel *pChannelList, tANI_U8 b11dResolved);
293eHalStatus pmcSetRssiFilter(tHalHandle hHal, v_U8_t rssiThreshold);
294#endif // FEATURE_WLAN_SCAN_PNO
Tushnim Bhattacharyya3a37def2013-02-24 11:11:15 -0800295eHalStatus pmcSetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams, tANI_BOOLEAN forced);
Jeff Johnson295189b2012-06-20 16:38:30 -0700296
297tANI_BOOLEAN csrRoamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800298#ifdef FEATURE_WLAN_TDLS
299eHalStatus csrTdlsSendMgmtReq(tHalHandle hHal, tANI_U8 sessionId, tCsrTdlsSendMgmt *tdlsSendMgmt);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530300VOS_STATUS csrTdlsSendLinkEstablishParams(tHalHandle hHal,
301 tANI_U8 sessionId,
302 tSirMacAddr peerMac,
303 tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800304eHalStatus csrTdlsAddPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800305eHalStatus csrTdlsChangePeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, tCsrStaParams *pstaParams);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800306eHalStatus csrTdlsDelPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
307eHalStatus csrTdlsProcessCmd(tpAniSirGlobal pMac,tSmeCmd *pCommand );
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530308eHalStatus csrTdlsProcessLinkEstablish( tpAniSirGlobal pMac, tSmeCmd *cmd );
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800309eHalStatus tdlsMsgProcessor(tpAniSirGlobal pMac,v_U16_t msg_type,
310 void *pMsgBuf);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800311#ifdef FEATURE_WLAN_TDLS_INTERNAL
312eHalStatus csrTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId,
313 tCsrTdlsDisRequest *tdlsDisReq);
314eHalStatus csrTdlsSetupReq(tHalHandle hHal, tANI_U8 sessionId,
315 tCsrTdlsSetupRequest *tdlsSetupReq);
316eHalStatus csrTdlsTeardownReq(tHalHandle hHal, tANI_U8 sessionId,
317 tCsrTdlsTeardownRequest *teardown);
318#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800319#endif /* FEATURE_WLAN_TDLS */
320
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800321#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700322eHalStatus csrFlushCfgBgScanRoamChannelList(tpAniSirGlobal pMac);
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700323eHalStatus csrCreateBgScanRoamChannelList(tpAniSirGlobal pMac,
324 const tANI_U8 *pChannelList,
325 const tANI_U8 numChannels);
Srinivas Girigowdade697412013-02-14 16:31:48 -0800326eHalStatus csrUpdateBgScanConfigIniChannelList(tpAniSirGlobal pMac, eCsrBand eBand);
Srinivas Girigowdade697412013-02-14 16:31:48 -0800327#endif
328
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800329#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700330eHalStatus csrCreateRoamScanChannelList(tpAniSirGlobal pMac,
331 tANI_U8 *pChannelList,
332 tANI_U8 numChannels,
333 const eCsrBand eBand);
334#endif
Kalikinkar Dharaa4988972013-10-28 13:39:54 -0700335void activeListCmdTimeoutHandle(void *userData);
Srinivas Girigowdade697412013-02-14 16:31:48 -0800336
Jeff Johnson295189b2012-06-20 16:38:30 -0700337#endif //#if !defined( __SMEINSIDE_H )