blob: d93fc964394268ddc6d08de179fe38346d57d25c [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
Jeff Johnson295189b2012-06-20 16:38:30 -0700110typedef struct sRemainChlCmd
111{
112 tANI_U8 chn;
113 tANI_U8 phyMode;
114 tANI_U32 duration;
Gopichand Nakkala924e4552013-05-08 19:18:14 +0530115 tANI_U8 isP2PProbeReqAllowed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700116 void* callback;
117 void* callbackCtx;
118}tRemainChlCmd;
119
120typedef struct sNoACmd
121{
122 tP2pPsConfig NoA;
123} tNoACmd;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800124#ifdef FEATURE_WLAN_TDLS
125typedef struct TdlsSendMgmtInfo
126{
127 tSirMacAddr peerMac;
128 tANI_U8 frameType;
129 tANI_U8 dialog;
130 tANI_U16 statusCode;
Hoonki Leea34dd892013-02-05 22:56:02 -0800131 tANI_U8 responder;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800132 tANI_U8 *buf;
133 tANI_U8 len;
134} tTdlsSendMgmtCmdInfo;
135
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530136typedef struct TdlsLinkEstablishInfo
137{
138 tSirMacAddr peerMac;
139 tANI_U8 uapsdQueues;
140 tANI_U8 maxSp;
141 tANI_U8 isBufSta;
142 tANI_U8 isResponder;
143} tTdlsLinkEstablishCmdInfo;
144
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800145typedef struct TdlsAddStaInfo
146{
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800147 eTdlsAddOper tdlsAddOper;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800148 tSirMacAddr peerMac;
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800149 tANI_U16 capability;
150 tANI_U8 extnCapability[SIR_MAC_MAX_EXTN_CAP];
151 tANI_U8 supportedRatesLen;
152 tANI_U8 supportedRates[SIR_MAC_MAX_SUPP_RATES];
Hoonki Lee66b75f32013-04-16 18:30:07 -0700153 tANI_U8 htcap_present;
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800154 tSirHTCap HTCap;
Hoonki Lee66b75f32013-04-16 18:30:07 -0700155 tANI_U8 vhtcap_present;
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800156 tSirVHTCap VHTCap;
157 tANI_U8 uapsdQueues;
158 tANI_U8 maxSp;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800159} tTdlsAddStaCmdInfo;
160
161typedef struct TdlsDelStaInfo
162{
163 tSirMacAddr peerMac;
164} tTdlsDelStaCmdInfo;
165#ifdef FEATURE_WLAN_TDLS_INTERNAL
166typedef struct TdlsDisReqCmdinfo
167{
168 tSirMacAddr peerMac;
169 tANI_U8 tdlsDisType;
170} tTdlsDisReqCmdinfo;
171
172typedef struct tdlsLinkSetupReqCmdinfo
173{
174 tSirMacAddr peerMac;
175} tTdlsLinkSetupReqCmdinfo;
176
177typedef struct tdlsLinkTeardownCmdinfo
178{
179 tSirMacAddr peerMac;
180} tTdlsLinkTeardownCmdinfo;
181#endif
182/*
183 * TDLS cmd info, CMD from SME to PE.
184 */
185typedef struct s_tdls_cmd
186{
187 tANI_U32 size;
188 union
189 {
190#ifdef FEATURE_WLAN_TDLS_INTERNAL
191 tTdlsDisReqCmdinfo tdlsDisReqCmdInfo ;
192 tTdlsLinkSetupReqCmdinfo tdlsLinkSetupReqCmdInfo ;
193 tTdlsLinkTeardownCmdinfo tdlsLinkTeardownCmdInfo ;
194 //tEnterPeerUAPSDInfo enterUapsdInfo ;
195 //tExitPeerUAPSDinfo exitUapsdInfo ;
196#endif
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530197 tTdlsLinkEstablishCmdInfo tdlsLinkEstablishCmdInfo;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800198 tTdlsSendMgmtCmdInfo tdlsSendMgmtCmdInfo;
199 tTdlsAddStaCmdInfo tdlsAddStaCmdInfo;
200 tTdlsDelStaCmdInfo tdlsDelStaCmdInfo;
201 }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
Jeff Johnson295189b2012-06-20 16:38:30 -0700229 }u;
230}tSmeCmd;
231
232
233
234/*--------------------------------------------------------------------------
235 Internal to SME
236 ------------------------------------------------------------------------*/
237
238//To get a command buffer
239//Return: NULL if there no more command buffer left
240tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac );
241void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority );
242void smeProcessPendingQueue( tpAniSirGlobal pMac );
243void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd);
Madan Mohan Koyyalamudi21255992013-08-01 18:00:25 +0530244void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId,
245 tDblLinkList *pList);
Jeff Johnson295189b2012-06-20 16:38:30 -0700246tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac);
247tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
248//this function is used to abort a command where the normal processing of the command
249//is terminated without going through the normal path. it is here to take care of callbacks for
250//the command, if applicable.
251void pmcAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
252tANI_BOOLEAN qosProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
253
254eHalStatus csrProcessScanCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
255eHalStatus csrRoamProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
256void csrRoamProcessWmStatusChangeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
257void csrReinitRoamCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
258void csrReinitWmStatusChangeCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
259void csrReinitSetKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
260void csrReinitRemoveKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
261eHalStatus csrRoamProcessSetKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
262eHalStatus csrRoamProcessRemoveKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
263void csrReleaseCommandSetKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
264void csrReleaseCommandRemoveKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
265//eHalStatus csrRoamIssueSetKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 roamId );
266eHalStatus csrRoamIssueRemoveKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId,
267 tCsrRoamRemoveKey *pRemoveKey, tANI_U32 roamId );
268eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand, tRequestFullPowerReason *pReason,
269 tANI_BOOLEAN *pfNeedPower);
270void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
271
272eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme);
273eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme);
274
Jeff Johnsone7245742012-09-05 17:12:55 -0700275#ifdef FEATURE_OEM_DATA_SUPPORT
276eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand);
277#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700278
279eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
280eHalStatus csrProcessAddStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
281eHalStatus csrProcessDelStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
282eHalStatus csrProcessDelStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
283
284#ifdef WLAN_NS_OFFLOAD
285/* ---------------------------------------------------------------------------
286 \fn pmcSetNSOffload
287 \brief Set the host offload feature.
288 \param hHal - The handle returned by macOpen.
289 \param pRequest - Pointer to the offload request.
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700290 \param sessionId . Session index of the session
Jeff Johnson295189b2012-06-20 16:38:30 -0700291 \return eHalStatus
292 eHAL_STATUS_FAILURE Cannot set the offload.
293 eHAL_STATUS_SUCCESS Request accepted.
294 ---------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700295eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700296#endif //WLAN_NS_OFFLOAD
297
298#ifdef FEATURE_WLAN_SCAN_PNO
299eHalStatus pmcSetPreferredNetworkList(tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, preferredNetworkFoundIndCallback callbackRoutine, void *callbackContext);
300eHalStatus pmcUpdateScanParams(tHalHandle hHal, tCsrConfig *pRequest, tCsrChannel *pChannelList, tANI_U8 b11dResolved);
301eHalStatus pmcSetRssiFilter(tHalHandle hHal, v_U8_t rssiThreshold);
302#endif // FEATURE_WLAN_SCAN_PNO
Tushnim Bhattacharyya3a37def2013-02-24 11:11:15 -0800303eHalStatus pmcSetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams, tANI_BOOLEAN forced);
Jeff Johnson295189b2012-06-20 16:38:30 -0700304
305tANI_BOOLEAN csrRoamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800306#ifdef FEATURE_WLAN_TDLS
307eHalStatus csrTdlsSendMgmtReq(tHalHandle hHal, tANI_U8 sessionId, tCsrTdlsSendMgmt *tdlsSendMgmt);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530308VOS_STATUS csrTdlsSendLinkEstablishParams(tHalHandle hHal,
309 tANI_U8 sessionId,
310 tSirMacAddr peerMac,
311 tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800312eHalStatus csrTdlsAddPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800313eHalStatus csrTdlsChangePeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, tCsrStaParams *pstaParams);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800314eHalStatus csrTdlsDelPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
315eHalStatus csrTdlsProcessCmd(tpAniSirGlobal pMac,tSmeCmd *pCommand );
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530316eHalStatus csrTdlsProcessLinkEstablish( tpAniSirGlobal pMac, tSmeCmd *cmd );
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800317eHalStatus tdlsMsgProcessor(tpAniSirGlobal pMac,v_U16_t msg_type,
318 void *pMsgBuf);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800319#ifdef FEATURE_WLAN_TDLS_INTERNAL
320eHalStatus csrTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId,
321 tCsrTdlsDisRequest *tdlsDisReq);
322eHalStatus csrTdlsSetupReq(tHalHandle hHal, tANI_U8 sessionId,
323 tCsrTdlsSetupRequest *tdlsSetupReq);
324eHalStatus csrTdlsTeardownReq(tHalHandle hHal, tANI_U8 sessionId,
325 tCsrTdlsTeardownRequest *teardown);
326#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800327#endif /* FEATURE_WLAN_TDLS */
328
Srinivas Girigowdade697412013-02-14 16:31:48 -0800329#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700330eHalStatus csrFlushBgScanRoamChannelList(tpAniSirGlobal pMac);
331eHalStatus csrCreateBgScanRoamChannelList(tpAniSirGlobal pMac,
332 const tANI_U8 *pChannelList,
333 const tANI_U8 numChannels);
Srinivas Girigowdade697412013-02-14 16:31:48 -0800334eHalStatus csrUpdateBgScanConfigIniChannelList(tpAniSirGlobal pMac, eCsrBand eBand);
Srinivas Girigowdade697412013-02-14 16:31:48 -0800335#endif
336
337
Jeff Johnson295189b2012-06-20 16:38:30 -0700338#endif //#if !defined( __SMEINSIDE_H )