blob: abae34defea83f36d703962dfd1c7eb88a1dcce7 [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
Gopichand Nakkala976e3252013-01-03 15:45:56 -080087#define SME_TOTAL_COMMAND 30
Jeff Johnson295189b2012-06-20 16:38:30 -070088
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;
Hoonki Leea34dd892013-02-05 22:56:02 -0800132 tANI_U8 responder;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800133 tANI_U8 *buf;
134 tANI_U8 len;
135} tTdlsSendMgmtCmdInfo;
136
137typedef struct TdlsAddStaInfo
138{
139 tSirMacAddr peerMac;
140} tTdlsAddStaCmdInfo;
141
142typedef struct TdlsDelStaInfo
143{
144 tSirMacAddr peerMac;
145} tTdlsDelStaCmdInfo;
146#ifdef FEATURE_WLAN_TDLS_INTERNAL
147typedef struct TdlsDisReqCmdinfo
148{
149 tSirMacAddr peerMac;
150 tANI_U8 tdlsDisType;
151} tTdlsDisReqCmdinfo;
152
153typedef struct tdlsLinkSetupReqCmdinfo
154{
155 tSirMacAddr peerMac;
156} tTdlsLinkSetupReqCmdinfo;
157
158typedef struct tdlsLinkTeardownCmdinfo
159{
160 tSirMacAddr peerMac;
161} tTdlsLinkTeardownCmdinfo;
162#endif
163/*
164 * TDLS cmd info, CMD from SME to PE.
165 */
166typedef struct s_tdls_cmd
167{
168 tANI_U32 size;
169 union
170 {
171#ifdef FEATURE_WLAN_TDLS_INTERNAL
172 tTdlsDisReqCmdinfo tdlsDisReqCmdInfo ;
173 tTdlsLinkSetupReqCmdinfo tdlsLinkSetupReqCmdInfo ;
174 tTdlsLinkTeardownCmdinfo tdlsLinkTeardownCmdInfo ;
175 //tEnterPeerUAPSDInfo enterUapsdInfo ;
176 //tExitPeerUAPSDinfo exitUapsdInfo ;
177#endif
178 tTdlsSendMgmtCmdInfo tdlsSendMgmtCmdInfo;
179 tTdlsAddStaCmdInfo tdlsAddStaCmdInfo;
180 tTdlsDelStaCmdInfo tdlsDelStaCmdInfo;
181 }u;
182} tTdlsCmd;
183#endif /* FEATURE_WLAN_TDLS */
Jeff Johnson295189b2012-06-20 16:38:30 -0700184
185typedef struct tagSmeCmd
186{
187 tListElem Link;
188 eSmeCommandType command;
189 tANI_U32 sessionId;
190 union
191 {
192 tScanCmd scanCmd;
193 tRoamCmd roamCmd;
194 tWmStatusChangeCmd wmStatusChangeCmd;
195 tSetKeyCmd setKeyCmd;
196 tRemoveKeyCmd removeKeyCmd;
197 tGenericPmcCmd pmcCmd;
198 tGenericQosCmd qosCmd;
Jeff Johnsone7245742012-09-05 17:12:55 -0700199#ifdef FEATURE_OEM_DATA_SUPPORT
200 tOemDataCmd oemDataCmd;
201#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700202#ifdef WLAN_FEATURE_P2P
203 tRemainChlCmd remainChlCmd;
204 tNoACmd NoACmd;
205#endif
206 tAddStaForSessionCmd addStaSessionCmd;
207 tDelStaForSessionCmd delStaSessionCmd;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800208#ifdef FEATURE_WLAN_TDLS
209 tTdlsCmd tdlsCmd;
210#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700211 }u;
212}tSmeCmd;
213
214
215
216/*--------------------------------------------------------------------------
217 Internal to SME
218 ------------------------------------------------------------------------*/
219
220//To get a command buffer
221//Return: NULL if there no more command buffer left
222tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac );
223void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority );
224void smeProcessPendingQueue( tpAniSirGlobal pMac );
225void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd);
226void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId);
227tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac);
228tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
229//this function is used to abort a command where the normal processing of the command
230//is terminated without going through the normal path. it is here to take care of callbacks for
231//the command, if applicable.
232void pmcAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
233tANI_BOOLEAN qosProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
234
235eHalStatus csrProcessScanCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
236eHalStatus csrRoamProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
237void csrRoamProcessWmStatusChangeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
238void csrReinitRoamCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
239void csrReinitWmStatusChangeCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
240void csrReinitSetKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
241void csrReinitRemoveKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
242eHalStatus csrRoamProcessSetKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
243eHalStatus csrRoamProcessRemoveKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
244void csrReleaseCommandSetKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
245void csrReleaseCommandRemoveKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
246//eHalStatus csrRoamIssueSetKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 roamId );
247eHalStatus csrRoamIssueRemoveKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId,
248 tCsrRoamRemoveKey *pRemoveKey, tANI_U32 roamId );
249eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand, tRequestFullPowerReason *pReason,
250 tANI_BOOLEAN *pfNeedPower);
251void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
252
253eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme);
254eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme);
255
Jeff Johnsone7245742012-09-05 17:12:55 -0700256#ifdef FEATURE_OEM_DATA_SUPPORT
257eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand);
258#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700259
260eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
261eHalStatus csrProcessAddStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
262eHalStatus csrProcessDelStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
263eHalStatus csrProcessDelStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
264
265#ifdef WLAN_NS_OFFLOAD
266/* ---------------------------------------------------------------------------
267 \fn pmcSetNSOffload
268 \brief Set the host offload feature.
269 \param hHal - The handle returned by macOpen.
270 \param pRequest - Pointer to the offload request.
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700271 \param sessionId . Session index of the session
Jeff Johnson295189b2012-06-20 16:38:30 -0700272 \return eHalStatus
273 eHAL_STATUS_FAILURE Cannot set the offload.
274 eHAL_STATUS_SUCCESS Request accepted.
275 ---------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700276eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700277#endif //WLAN_NS_OFFLOAD
278
279#ifdef FEATURE_WLAN_SCAN_PNO
280eHalStatus pmcSetPreferredNetworkList(tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, preferredNetworkFoundIndCallback callbackRoutine, void *callbackContext);
281eHalStatus pmcUpdateScanParams(tHalHandle hHal, tCsrConfig *pRequest, tCsrChannel *pChannelList, tANI_U8 b11dResolved);
282eHalStatus pmcSetRssiFilter(tHalHandle hHal, v_U8_t rssiThreshold);
283#endif // FEATURE_WLAN_SCAN_PNO
284eHalStatus pmcSetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams);
285
286tANI_BOOLEAN csrRoamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800287#ifdef FEATURE_WLAN_TDLS
288eHalStatus csrTdlsSendMgmtReq(tHalHandle hHal, tANI_U8 sessionId, tCsrTdlsSendMgmt *tdlsSendMgmt);
289eHalStatus csrTdlsAddPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
290eHalStatus csrTdlsDelPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
291eHalStatus csrTdlsProcessCmd(tpAniSirGlobal pMac,tSmeCmd *pCommand );
292eHalStatus tdlsMsgProcessor(tpAniSirGlobal pMac,v_U16_t msg_type,
293 void *pMsgBuf);
294eHalStatus csrTdlsOpen(tHalHandle hHal);
295tANI_BOOLEAN csrTdlsPowerSaveCheck( void* hHal );
296#ifdef FEATURE_WLAN_TDLS_INTERNAL
297eHalStatus csrTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId,
298 tCsrTdlsDisRequest *tdlsDisReq);
299eHalStatus csrTdlsSetupReq(tHalHandle hHal, tANI_U8 sessionId,
300 tCsrTdlsSetupRequest *tdlsSetupReq);
301eHalStatus csrTdlsTeardownReq(tHalHandle hHal, tANI_U8 sessionId,
302 tCsrTdlsTeardownRequest *teardown);
303#endif
304
305#endif /* FEATURE_WLAN_TDLS */
306
Jeff Johnson295189b2012-06-20 16:38:30 -0700307#endif //#if !defined( __SMEINSIDE_H )