blob: c88574464ba30d8e6e05478c3d2b78c3cef12728 [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;
115 void* callback;
116 void* callbackCtx;
117}tRemainChlCmd;
118
119typedef struct sNoACmd
120{
121 tP2pPsConfig NoA;
122} tNoACmd;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800123#ifdef FEATURE_WLAN_TDLS
124typedef struct TdlsSendMgmtInfo
125{
126 tSirMacAddr peerMac;
127 tANI_U8 frameType;
128 tANI_U8 dialog;
129 tANI_U16 statusCode;
Hoonki Leea34dd892013-02-05 22:56:02 -0800130 tANI_U8 responder;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800131 tANI_U8 *buf;
132 tANI_U8 len;
133} tTdlsSendMgmtCmdInfo;
134
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530135typedef struct TdlsLinkEstablishInfo
136{
137 tSirMacAddr peerMac;
138 tANI_U8 uapsdQueues;
139 tANI_U8 maxSp;
140 tANI_U8 isBufSta;
141 tANI_U8 isResponder;
142} tTdlsLinkEstablishCmdInfo;
143
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800144typedef struct TdlsAddStaInfo
145{
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800146 eTdlsAddOper tdlsAddOper;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800147 tSirMacAddr peerMac;
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800148 tANI_U16 capability;
149 tANI_U8 extnCapability[SIR_MAC_MAX_EXTN_CAP];
150 tANI_U8 supportedRatesLen;
151 tANI_U8 supportedRates[SIR_MAC_MAX_SUPP_RATES];
Hoonki Lee66b75f32013-04-16 18:30:07 -0700152 tANI_U8 htcap_present;
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800153 tSirHTCap HTCap;
Hoonki Lee66b75f32013-04-16 18:30:07 -0700154 tANI_U8 vhtcap_present;
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800155 tSirVHTCap VHTCap;
156 tANI_U8 uapsdQueues;
157 tANI_U8 maxSp;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800158} tTdlsAddStaCmdInfo;
159
160typedef struct TdlsDelStaInfo
161{
162 tSirMacAddr peerMac;
163} tTdlsDelStaCmdInfo;
164#ifdef FEATURE_WLAN_TDLS_INTERNAL
165typedef struct TdlsDisReqCmdinfo
166{
167 tSirMacAddr peerMac;
168 tANI_U8 tdlsDisType;
169} tTdlsDisReqCmdinfo;
170
171typedef struct tdlsLinkSetupReqCmdinfo
172{
173 tSirMacAddr peerMac;
174} tTdlsLinkSetupReqCmdinfo;
175
176typedef struct tdlsLinkTeardownCmdinfo
177{
178 tSirMacAddr peerMac;
179} tTdlsLinkTeardownCmdinfo;
180#endif
181/*
182 * TDLS cmd info, CMD from SME to PE.
183 */
184typedef struct s_tdls_cmd
185{
186 tANI_U32 size;
187 union
188 {
189#ifdef FEATURE_WLAN_TDLS_INTERNAL
190 tTdlsDisReqCmdinfo tdlsDisReqCmdInfo ;
191 tTdlsLinkSetupReqCmdinfo tdlsLinkSetupReqCmdInfo ;
192 tTdlsLinkTeardownCmdinfo tdlsLinkTeardownCmdInfo ;
193 //tEnterPeerUAPSDInfo enterUapsdInfo ;
194 //tExitPeerUAPSDinfo exitUapsdInfo ;
195#endif
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530196 tTdlsLinkEstablishCmdInfo tdlsLinkEstablishCmdInfo;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800197 tTdlsSendMgmtCmdInfo tdlsSendMgmtCmdInfo;
198 tTdlsAddStaCmdInfo tdlsAddStaCmdInfo;
199 tTdlsDelStaCmdInfo tdlsDelStaCmdInfo;
200 }u;
201} tTdlsCmd;
202#endif /* FEATURE_WLAN_TDLS */
Jeff Johnson295189b2012-06-20 16:38:30 -0700203
204typedef struct tagSmeCmd
205{
206 tListElem Link;
207 eSmeCommandType command;
208 tANI_U32 sessionId;
209 union
210 {
211 tScanCmd scanCmd;
212 tRoamCmd roamCmd;
213 tWmStatusChangeCmd wmStatusChangeCmd;
214 tSetKeyCmd setKeyCmd;
215 tRemoveKeyCmd removeKeyCmd;
216 tGenericPmcCmd pmcCmd;
217 tGenericQosCmd qosCmd;
Jeff Johnsone7245742012-09-05 17:12:55 -0700218#ifdef FEATURE_OEM_DATA_SUPPORT
219 tOemDataCmd oemDataCmd;
220#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700221 tRemainChlCmd remainChlCmd;
222 tNoACmd NoACmd;
Jeff Johnson295189b2012-06-20 16:38:30 -0700223 tAddStaForSessionCmd addStaSessionCmd;
224 tDelStaForSessionCmd delStaSessionCmd;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800225#ifdef FEATURE_WLAN_TDLS
226 tTdlsCmd tdlsCmd;
227#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700228 }u;
229}tSmeCmd;
230
231
232
233/*--------------------------------------------------------------------------
234 Internal to SME
235 ------------------------------------------------------------------------*/
236
237//To get a command buffer
238//Return: NULL if there no more command buffer left
239tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac );
240void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority );
241void smeProcessPendingQueue( tpAniSirGlobal pMac );
242void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd);
243void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId);
244tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac);
245tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
246//this function is used to abort a command where the normal processing of the command
247//is terminated without going through the normal path. it is here to take care of callbacks for
248//the command, if applicable.
249void pmcAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
250tANI_BOOLEAN qosProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
251
252eHalStatus csrProcessScanCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
253eHalStatus csrRoamProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
254void csrRoamProcessWmStatusChangeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
255void csrReinitRoamCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
256void csrReinitWmStatusChangeCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
257void csrReinitSetKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
258void csrReinitRemoveKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
259eHalStatus csrRoamProcessSetKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
260eHalStatus csrRoamProcessRemoveKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
261void csrReleaseCommandSetKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
262void csrReleaseCommandRemoveKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
263//eHalStatus csrRoamIssueSetKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 roamId );
264eHalStatus csrRoamIssueRemoveKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId,
265 tCsrRoamRemoveKey *pRemoveKey, tANI_U32 roamId );
266eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand, tRequestFullPowerReason *pReason,
267 tANI_BOOLEAN *pfNeedPower);
268void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
269
270eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme);
271eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme);
272
Jeff Johnsone7245742012-09-05 17:12:55 -0700273#ifdef FEATURE_OEM_DATA_SUPPORT
274eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand);
275#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700276
277eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
278eHalStatus csrProcessAddStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
279eHalStatus csrProcessDelStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
280eHalStatus csrProcessDelStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
281
282#ifdef WLAN_NS_OFFLOAD
283/* ---------------------------------------------------------------------------
284 \fn pmcSetNSOffload
285 \brief Set the host offload feature.
286 \param hHal - The handle returned by macOpen.
287 \param pRequest - Pointer to the offload request.
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700288 \param sessionId . Session index of the session
Jeff Johnson295189b2012-06-20 16:38:30 -0700289 \return eHalStatus
290 eHAL_STATUS_FAILURE Cannot set the offload.
291 eHAL_STATUS_SUCCESS Request accepted.
292 ---------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700293eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700294#endif //WLAN_NS_OFFLOAD
295
296#ifdef FEATURE_WLAN_SCAN_PNO
297eHalStatus pmcSetPreferredNetworkList(tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, preferredNetworkFoundIndCallback callbackRoutine, void *callbackContext);
298eHalStatus pmcUpdateScanParams(tHalHandle hHal, tCsrConfig *pRequest, tCsrChannel *pChannelList, tANI_U8 b11dResolved);
299eHalStatus pmcSetRssiFilter(tHalHandle hHal, v_U8_t rssiThreshold);
300#endif // FEATURE_WLAN_SCAN_PNO
Tushnim Bhattacharyya3a37def2013-02-24 11:11:15 -0800301eHalStatus pmcSetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams, tANI_BOOLEAN forced);
Jeff Johnson295189b2012-06-20 16:38:30 -0700302
303tANI_BOOLEAN csrRoamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800304#ifdef FEATURE_WLAN_TDLS
305eHalStatus csrTdlsSendMgmtReq(tHalHandle hHal, tANI_U8 sessionId, tCsrTdlsSendMgmt *tdlsSendMgmt);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530306VOS_STATUS csrTdlsSendLinkEstablishParams(tHalHandle hHal,
307 tANI_U8 sessionId,
308 tSirMacAddr peerMac,
309 tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800310eHalStatus csrTdlsAddPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800311eHalStatus csrTdlsChangePeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, tCsrStaParams *pstaParams);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800312eHalStatus csrTdlsDelPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
313eHalStatus csrTdlsProcessCmd(tpAniSirGlobal pMac,tSmeCmd *pCommand );
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530314eHalStatus csrTdlsProcessLinkEstablish( tpAniSirGlobal pMac, tSmeCmd *cmd );
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800315eHalStatus tdlsMsgProcessor(tpAniSirGlobal pMac,v_U16_t msg_type,
316 void *pMsgBuf);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800317#ifdef FEATURE_WLAN_TDLS_INTERNAL
318eHalStatus csrTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId,
319 tCsrTdlsDisRequest *tdlsDisReq);
320eHalStatus csrTdlsSetupReq(tHalHandle hHal, tANI_U8 sessionId,
321 tCsrTdlsSetupRequest *tdlsSetupReq);
322eHalStatus csrTdlsTeardownReq(tHalHandle hHal, tANI_U8 sessionId,
323 tCsrTdlsTeardownRequest *teardown);
324#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800325#endif /* FEATURE_WLAN_TDLS */
326
Srinivas Girigowdade697412013-02-14 16:31:48 -0800327#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700328eHalStatus csrFlushBgScanRoamChannelList(tpAniSirGlobal pMac);
329eHalStatus csrCreateBgScanRoamChannelList(tpAniSirGlobal pMac,
330 const tANI_U8 *pChannelList,
331 const tANI_U8 numChannels);
Srinivas Girigowdade697412013-02-14 16:31:48 -0800332eHalStatus csrUpdateBgScanConfigIniChannelList(tpAniSirGlobal pMac, eCsrBand eBand);
333eHalStatus csrInitCountryValidChannelList(tpAniSirGlobal pMac, tANI_U8 revision);
334void csr_SetRevision(tpAniSirGlobal pMac, tANI_U8 revision);
335#endif
336
337
Jeff Johnson295189b2012-06-20 16:38:30 -0700338#endif //#if !defined( __SMEINSIDE_H )