blob: 7e3dde67fdc9abcaf1df174264298f8ef193c47c [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#if !defined( __SMEINSIDE_H )
43#define __SMEINSIDE_H
44
45
46/**=========================================================================
47
48 \file smeInside.h
49
50 \brief prototype for SME structures and APIs used insside SME
51
52 Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved.
53
54 Qualcomm Confidential and Proprietary.
55
56 ========================================================================*/
57
58/* $Header$ */
59
60/*--------------------------------------------------------------------------
61 Include Files
62 ------------------------------------------------------------------------*/
63#include "vos_status.h"
64#include "vos_lock.h"
65#include "vos_trace.h"
66#include "vos_memory.h"
67#include "vos_types.h"
68#include "sirApi.h"
69#include "csrInternal.h"
70#include "sme_QosApi.h"
71#include "smeQosInternal.h"
72
73
Jeff Johnsone7245742012-09-05 17:12:55 -070074#ifdef FEATURE_OEM_DATA_SUPPORT
75#include "oemDataInternal.h"
76#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070077
78#if defined WLAN_FEATURE_VOWIFI
79#include "sme_RrmApi.h"
80#endif
81
82
83/*--------------------------------------------------------------------------
84 Type declarations
85 ------------------------------------------------------------------------*/
86
87#define SME_TOTAL_COMMAND 20
88
89
90typedef struct sGenericPmcCmd
91{
92 tANI_U32 size; //sizeof the data in the union, if any
93 tRequestFullPowerReason fullPowerReason;
94 tANI_BOOLEAN fReleaseWhenDone; //if TRUE, the command shall not put back to the queue, free te memory instead.
95 union
96 {
97 tExitBmpsInfo exitBmpsInfo;
98 tSirSmeWowlEnterParams enterWowlInfo;
99 }u;
100} tGenericPmcCmd;
101
102
103typedef struct sGenericQosCmd
104{
105 sme_QosWmmTspecInfo tspecInfo;
106 sme_QosEdcaAcType ac;
107 v_U8_t tspec_mask;
108} tGenericQosCmd;
109
110#ifdef WLAN_FEATURE_P2P
111typedef struct sRemainChlCmd
112{
113 tANI_U8 chn;
114 tANI_U8 phyMode;
115 tANI_U32 duration;
116 void* callback;
117 void* callbackCtx;
118}tRemainChlCmd;
119
120typedef struct sNoACmd
121{
122 tP2pPsConfig NoA;
123} tNoACmd;
124#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800125#ifdef FEATURE_WLAN_TDLS
126typedef struct TdlsSendMgmtInfo
127{
128 tSirMacAddr peerMac;
129 tANI_U8 frameType;
130 tANI_U8 dialog;
131 tANI_U16 statusCode;
132 tANI_U8 *buf;
133 tANI_U8 len;
134} tTdlsSendMgmtCmdInfo;
135
136typedef struct TdlsAddStaInfo
137{
138 tSirMacAddr peerMac;
139} tTdlsAddStaCmdInfo;
140
141typedef struct TdlsDelStaInfo
142{
143 tSirMacAddr peerMac;
144} tTdlsDelStaCmdInfo;
145#ifdef FEATURE_WLAN_TDLS_INTERNAL
146typedef struct TdlsDisReqCmdinfo
147{
148 tSirMacAddr peerMac;
149 tANI_U8 tdlsDisType;
150} tTdlsDisReqCmdinfo;
151
152typedef struct tdlsLinkSetupReqCmdinfo
153{
154 tSirMacAddr peerMac;
155} tTdlsLinkSetupReqCmdinfo;
156
157typedef struct tdlsLinkTeardownCmdinfo
158{
159 tSirMacAddr peerMac;
160} tTdlsLinkTeardownCmdinfo;
161#endif
162/*
163 * TDLS cmd info, CMD from SME to PE.
164 */
165typedef struct s_tdls_cmd
166{
167 tANI_U32 size;
168 union
169 {
170#ifdef FEATURE_WLAN_TDLS_INTERNAL
171 tTdlsDisReqCmdinfo tdlsDisReqCmdInfo ;
172 tTdlsLinkSetupReqCmdinfo tdlsLinkSetupReqCmdInfo ;
173 tTdlsLinkTeardownCmdinfo tdlsLinkTeardownCmdInfo ;
174 //tEnterPeerUAPSDInfo enterUapsdInfo ;
175 //tExitPeerUAPSDinfo exitUapsdInfo ;
176#endif
177 tTdlsSendMgmtCmdInfo tdlsSendMgmtCmdInfo;
178 tTdlsAddStaCmdInfo tdlsAddStaCmdInfo;
179 tTdlsDelStaCmdInfo tdlsDelStaCmdInfo;
180 }u;
181} tTdlsCmd;
182#endif /* FEATURE_WLAN_TDLS */
Jeff Johnson295189b2012-06-20 16:38:30 -0700183
184typedef struct tagSmeCmd
185{
186 tListElem Link;
187 eSmeCommandType command;
188 tANI_U32 sessionId;
189 union
190 {
191 tScanCmd scanCmd;
192 tRoamCmd roamCmd;
193 tWmStatusChangeCmd wmStatusChangeCmd;
194 tSetKeyCmd setKeyCmd;
195 tRemoveKeyCmd removeKeyCmd;
196 tGenericPmcCmd pmcCmd;
197 tGenericQosCmd qosCmd;
Jeff Johnsone7245742012-09-05 17:12:55 -0700198#ifdef FEATURE_OEM_DATA_SUPPORT
199 tOemDataCmd oemDataCmd;
200#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700201#ifdef WLAN_FEATURE_P2P
202 tRemainChlCmd remainChlCmd;
203 tNoACmd NoACmd;
204#endif
205 tAddStaForSessionCmd addStaSessionCmd;
206 tDelStaForSessionCmd delStaSessionCmd;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800207#ifdef FEATURE_WLAN_TDLS
208 tTdlsCmd tdlsCmd;
209#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700210 }u;
211}tSmeCmd;
212
213
214
215/*--------------------------------------------------------------------------
216 Internal to SME
217 ------------------------------------------------------------------------*/
218
219//To get a command buffer
220//Return: NULL if there no more command buffer left
221tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac );
222void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority );
223void smeProcessPendingQueue( tpAniSirGlobal pMac );
224void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd);
225void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId);
226tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac);
227tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
228//this function is used to abort a command where the normal processing of the command
229//is terminated without going through the normal path. it is here to take care of callbacks for
230//the command, if applicable.
231void pmcAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
232tANI_BOOLEAN qosProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
233
234eHalStatus csrProcessScanCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
235eHalStatus csrRoamProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
236void csrRoamProcessWmStatusChangeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
237void csrReinitRoamCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
238void csrReinitWmStatusChangeCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
239void csrReinitSetKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
240void csrReinitRemoveKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
241eHalStatus csrRoamProcessSetKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
242eHalStatus csrRoamProcessRemoveKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
243void csrReleaseCommandSetKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
244void csrReleaseCommandRemoveKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
245//eHalStatus csrRoamIssueSetKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 roamId );
246eHalStatus csrRoamIssueRemoveKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId,
247 tCsrRoamRemoveKey *pRemoveKey, tANI_U32 roamId );
248eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand, tRequestFullPowerReason *pReason,
249 tANI_BOOLEAN *pfNeedPower);
250void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
251
252eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme);
253eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme);
254
Jeff Johnsone7245742012-09-05 17:12:55 -0700255#ifdef FEATURE_OEM_DATA_SUPPORT
256eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand);
257#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700258
259eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
260eHalStatus csrProcessAddStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
261eHalStatus csrProcessDelStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
262eHalStatus csrProcessDelStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
263
264#ifdef WLAN_NS_OFFLOAD
265/* ---------------------------------------------------------------------------
266 \fn pmcSetNSOffload
267 \brief Set the host offload feature.
268 \param hHal - The handle returned by macOpen.
269 \param pRequest - Pointer to the offload request.
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700270 \param sessionId . Session index of the session
Jeff Johnson295189b2012-06-20 16:38:30 -0700271 \return eHalStatus
272 eHAL_STATUS_FAILURE Cannot set the offload.
273 eHAL_STATUS_SUCCESS Request accepted.
274 ---------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700275eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700276#endif //WLAN_NS_OFFLOAD
277
278#ifdef FEATURE_WLAN_SCAN_PNO
279eHalStatus pmcSetPreferredNetworkList(tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, preferredNetworkFoundIndCallback callbackRoutine, void *callbackContext);
280eHalStatus pmcUpdateScanParams(tHalHandle hHal, tCsrConfig *pRequest, tCsrChannel *pChannelList, tANI_U8 b11dResolved);
281eHalStatus pmcSetRssiFilter(tHalHandle hHal, v_U8_t rssiThreshold);
282#endif // FEATURE_WLAN_SCAN_PNO
283eHalStatus pmcSetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams);
284
285tANI_BOOLEAN csrRoamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800286#ifdef FEATURE_WLAN_TDLS
287eHalStatus csrTdlsSendMgmtReq(tHalHandle hHal, tANI_U8 sessionId, tCsrTdlsSendMgmt *tdlsSendMgmt);
288eHalStatus csrTdlsAddPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
289eHalStatus csrTdlsDelPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
290eHalStatus csrTdlsProcessCmd(tpAniSirGlobal pMac,tSmeCmd *pCommand );
291eHalStatus tdlsMsgProcessor(tpAniSirGlobal pMac,v_U16_t msg_type,
292 void *pMsgBuf);
293eHalStatus csrTdlsOpen(tHalHandle hHal);
294tANI_BOOLEAN csrTdlsPowerSaveCheck( void* hHal );
295#ifdef FEATURE_WLAN_TDLS_INTERNAL
296eHalStatus csrTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId,
297 tCsrTdlsDisRequest *tdlsDisReq);
298eHalStatus csrTdlsSetupReq(tHalHandle hHal, tANI_U8 sessionId,
299 tCsrTdlsSetupRequest *tdlsSetupReq);
300eHalStatus csrTdlsTeardownReq(tHalHandle hHal, tANI_U8 sessionId,
301 tCsrTdlsTeardownRequest *teardown);
302#endif
303
304#endif /* FEATURE_WLAN_TDLS */
305
Jeff Johnson295189b2012-06-20 16:38:30 -0700306#endif //#if !defined( __SMEINSIDE_H )