blob: e2c09c1d7b39159f66022e9ebbcf8b7d04cda4e1 [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);
244void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId);
245tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac);
246tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
247//this function is used to abort a command where the normal processing of the command
248//is terminated without going through the normal path. it is here to take care of callbacks for
249//the command, if applicable.
250void pmcAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
251tANI_BOOLEAN qosProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
252
253eHalStatus csrProcessScanCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
254eHalStatus csrRoamProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
255void csrRoamProcessWmStatusChangeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
256void csrReinitRoamCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
257void csrReinitWmStatusChangeCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
258void csrReinitSetKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
259void csrReinitRemoveKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
260eHalStatus csrRoamProcessSetKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
261eHalStatus csrRoamProcessRemoveKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
262void csrReleaseCommandSetKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
263void csrReleaseCommandRemoveKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
264//eHalStatus csrRoamIssueSetKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 roamId );
265eHalStatus csrRoamIssueRemoveKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId,
266 tCsrRoamRemoveKey *pRemoveKey, tANI_U32 roamId );
267eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand, tRequestFullPowerReason *pReason,
268 tANI_BOOLEAN *pfNeedPower);
269void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
270
271eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme);
272eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme);
273
Jeff Johnsone7245742012-09-05 17:12:55 -0700274#ifdef FEATURE_OEM_DATA_SUPPORT
275eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand);
276#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700277
278eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
279eHalStatus csrProcessAddStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
280eHalStatus csrProcessDelStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
281eHalStatus csrProcessDelStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
282
283#ifdef WLAN_NS_OFFLOAD
284/* ---------------------------------------------------------------------------
285 \fn pmcSetNSOffload
286 \brief Set the host offload feature.
287 \param hHal - The handle returned by macOpen.
288 \param pRequest - Pointer to the offload request.
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700289 \param sessionId . Session index of the session
Jeff Johnson295189b2012-06-20 16:38:30 -0700290 \return eHalStatus
291 eHAL_STATUS_FAILURE Cannot set the offload.
292 eHAL_STATUS_SUCCESS Request accepted.
293 ---------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700294eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700295#endif //WLAN_NS_OFFLOAD
296
297#ifdef FEATURE_WLAN_SCAN_PNO
298eHalStatus pmcSetPreferredNetworkList(tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, preferredNetworkFoundIndCallback callbackRoutine, void *callbackContext);
299eHalStatus pmcUpdateScanParams(tHalHandle hHal, tCsrConfig *pRequest, tCsrChannel *pChannelList, tANI_U8 b11dResolved);
300eHalStatus pmcSetRssiFilter(tHalHandle hHal, v_U8_t rssiThreshold);
301#endif // FEATURE_WLAN_SCAN_PNO
Tushnim Bhattacharyya3a37def2013-02-24 11:11:15 -0800302eHalStatus pmcSetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams, tANI_BOOLEAN forced);
Jeff Johnson295189b2012-06-20 16:38:30 -0700303
304tANI_BOOLEAN csrRoamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800305#ifdef FEATURE_WLAN_TDLS
306eHalStatus csrTdlsSendMgmtReq(tHalHandle hHal, tANI_U8 sessionId, tCsrTdlsSendMgmt *tdlsSendMgmt);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530307VOS_STATUS csrTdlsSendLinkEstablishParams(tHalHandle hHal,
308 tANI_U8 sessionId,
309 tSirMacAddr peerMac,
310 tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800311eHalStatus csrTdlsAddPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800312eHalStatus csrTdlsChangePeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, tCsrStaParams *pstaParams);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800313eHalStatus csrTdlsDelPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
314eHalStatus csrTdlsProcessCmd(tpAniSirGlobal pMac,tSmeCmd *pCommand );
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530315eHalStatus csrTdlsProcessLinkEstablish( tpAniSirGlobal pMac, tSmeCmd *cmd );
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800316eHalStatus tdlsMsgProcessor(tpAniSirGlobal pMac,v_U16_t msg_type,
317 void *pMsgBuf);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800318#ifdef FEATURE_WLAN_TDLS_INTERNAL
319eHalStatus csrTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId,
320 tCsrTdlsDisRequest *tdlsDisReq);
321eHalStatus csrTdlsSetupReq(tHalHandle hHal, tANI_U8 sessionId,
322 tCsrTdlsSetupRequest *tdlsSetupReq);
323eHalStatus csrTdlsTeardownReq(tHalHandle hHal, tANI_U8 sessionId,
324 tCsrTdlsTeardownRequest *teardown);
325#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800326#endif /* FEATURE_WLAN_TDLS */
327
Srinivas Girigowdade697412013-02-14 16:31:48 -0800328#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700329eHalStatus csrFlushBgScanRoamChannelList(tpAniSirGlobal pMac);
330eHalStatus csrCreateBgScanRoamChannelList(tpAniSirGlobal pMac,
331 const tANI_U8 *pChannelList,
332 const tANI_U8 numChannels);
Srinivas Girigowdade697412013-02-14 16:31:48 -0800333eHalStatus csrUpdateBgScanConfigIniChannelList(tpAniSirGlobal pMac, eCsrBand eBand);
334eHalStatus csrInitCountryValidChannelList(tpAniSirGlobal pMac, tANI_U8 revision);
335void csr_SetRevision(tpAniSirGlobal pMac, tANI_U8 revision);
336#endif
337
338
Jeff Johnson295189b2012-06-20 16:38:30 -0700339#endif //#if !defined( __SMEINSIDE_H )