blob: f2428517a094f4c8032afd1c02c85ed69954a96d [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
135typedef struct TdlsAddStaInfo
136{
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800137 eTdlsAddOper tdlsAddOper;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800138 tSirMacAddr peerMac;
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800139 tANI_U16 capability;
140 tANI_U8 extnCapability[SIR_MAC_MAX_EXTN_CAP];
141 tANI_U8 supportedRatesLen;
142 tANI_U8 supportedRates[SIR_MAC_MAX_SUPP_RATES];
143 tSirHTCap HTCap;
144 tSirVHTCap VHTCap;
145 tANI_U8 uapsdQueues;
146 tANI_U8 maxSp;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800147} tTdlsAddStaCmdInfo;
148
149typedef struct TdlsDelStaInfo
150{
151 tSirMacAddr peerMac;
152} tTdlsDelStaCmdInfo;
153#ifdef FEATURE_WLAN_TDLS_INTERNAL
154typedef struct TdlsDisReqCmdinfo
155{
156 tSirMacAddr peerMac;
157 tANI_U8 tdlsDisType;
158} tTdlsDisReqCmdinfo;
159
160typedef struct tdlsLinkSetupReqCmdinfo
161{
162 tSirMacAddr peerMac;
163} tTdlsLinkSetupReqCmdinfo;
164
165typedef struct tdlsLinkTeardownCmdinfo
166{
167 tSirMacAddr peerMac;
168} tTdlsLinkTeardownCmdinfo;
169#endif
170/*
171 * TDLS cmd info, CMD from SME to PE.
172 */
173typedef struct s_tdls_cmd
174{
175 tANI_U32 size;
176 union
177 {
178#ifdef FEATURE_WLAN_TDLS_INTERNAL
179 tTdlsDisReqCmdinfo tdlsDisReqCmdInfo ;
180 tTdlsLinkSetupReqCmdinfo tdlsLinkSetupReqCmdInfo ;
181 tTdlsLinkTeardownCmdinfo tdlsLinkTeardownCmdInfo ;
182 //tEnterPeerUAPSDInfo enterUapsdInfo ;
183 //tExitPeerUAPSDinfo exitUapsdInfo ;
184#endif
185 tTdlsSendMgmtCmdInfo tdlsSendMgmtCmdInfo;
186 tTdlsAddStaCmdInfo tdlsAddStaCmdInfo;
187 tTdlsDelStaCmdInfo tdlsDelStaCmdInfo;
188 }u;
189} tTdlsCmd;
190#endif /* FEATURE_WLAN_TDLS */
Jeff Johnson295189b2012-06-20 16:38:30 -0700191
192typedef struct tagSmeCmd
193{
194 tListElem Link;
195 eSmeCommandType command;
196 tANI_U32 sessionId;
197 union
198 {
199 tScanCmd scanCmd;
200 tRoamCmd roamCmd;
201 tWmStatusChangeCmd wmStatusChangeCmd;
202 tSetKeyCmd setKeyCmd;
203 tRemoveKeyCmd removeKeyCmd;
204 tGenericPmcCmd pmcCmd;
205 tGenericQosCmd qosCmd;
Jeff Johnsone7245742012-09-05 17:12:55 -0700206#ifdef FEATURE_OEM_DATA_SUPPORT
207 tOemDataCmd oemDataCmd;
208#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700209 tRemainChlCmd remainChlCmd;
210 tNoACmd NoACmd;
Jeff Johnson295189b2012-06-20 16:38:30 -0700211 tAddStaForSessionCmd addStaSessionCmd;
212 tDelStaForSessionCmd delStaSessionCmd;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800213#ifdef FEATURE_WLAN_TDLS
214 tTdlsCmd tdlsCmd;
215#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700216 }u;
217}tSmeCmd;
218
219
220
221/*--------------------------------------------------------------------------
222 Internal to SME
223 ------------------------------------------------------------------------*/
224
225//To get a command buffer
226//Return: NULL if there no more command buffer left
227tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac );
228void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority );
229void smeProcessPendingQueue( tpAniSirGlobal pMac );
230void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd);
231void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId);
232tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac);
233tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
234//this function is used to abort a command where the normal processing of the command
235//is terminated without going through the normal path. it is here to take care of callbacks for
236//the command, if applicable.
237void pmcAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
238tANI_BOOLEAN qosProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
239
240eHalStatus csrProcessScanCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
241eHalStatus csrRoamProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
242void csrRoamProcessWmStatusChangeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
243void csrReinitRoamCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
244void csrReinitWmStatusChangeCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
245void csrReinitSetKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
246void csrReinitRemoveKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
247eHalStatus csrRoamProcessSetKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
248eHalStatus csrRoamProcessRemoveKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
249void csrReleaseCommandSetKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
250void csrReleaseCommandRemoveKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
251//eHalStatus csrRoamIssueSetKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 roamId );
252eHalStatus csrRoamIssueRemoveKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId,
253 tCsrRoamRemoveKey *pRemoveKey, tANI_U32 roamId );
254eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand, tRequestFullPowerReason *pReason,
255 tANI_BOOLEAN *pfNeedPower);
256void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
257
258eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme);
259eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme);
260
Jeff Johnsone7245742012-09-05 17:12:55 -0700261#ifdef FEATURE_OEM_DATA_SUPPORT
262eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand);
263#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700264
265eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
266eHalStatus csrProcessAddStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
267eHalStatus csrProcessDelStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
268eHalStatus csrProcessDelStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
269
270#ifdef WLAN_NS_OFFLOAD
271/* ---------------------------------------------------------------------------
272 \fn pmcSetNSOffload
273 \brief Set the host offload feature.
274 \param hHal - The handle returned by macOpen.
275 \param pRequest - Pointer to the offload request.
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700276 \param sessionId . Session index of the session
Jeff Johnson295189b2012-06-20 16:38:30 -0700277 \return eHalStatus
278 eHAL_STATUS_FAILURE Cannot set the offload.
279 eHAL_STATUS_SUCCESS Request accepted.
280 ---------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700281eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700282#endif //WLAN_NS_OFFLOAD
283
284#ifdef FEATURE_WLAN_SCAN_PNO
285eHalStatus pmcSetPreferredNetworkList(tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, preferredNetworkFoundIndCallback callbackRoutine, void *callbackContext);
286eHalStatus pmcUpdateScanParams(tHalHandle hHal, tCsrConfig *pRequest, tCsrChannel *pChannelList, tANI_U8 b11dResolved);
287eHalStatus pmcSetRssiFilter(tHalHandle hHal, v_U8_t rssiThreshold);
288#endif // FEATURE_WLAN_SCAN_PNO
Tushnim Bhattacharyya3a37def2013-02-24 11:11:15 -0800289eHalStatus pmcSetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams, tANI_BOOLEAN forced);
Jeff Johnson295189b2012-06-20 16:38:30 -0700290
291tANI_BOOLEAN csrRoamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800292#ifdef FEATURE_WLAN_TDLS
293eHalStatus csrTdlsSendMgmtReq(tHalHandle hHal, tANI_U8 sessionId, tCsrTdlsSendMgmt *tdlsSendMgmt);
294eHalStatus csrTdlsAddPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
Gopichand Nakkala681989c2013-03-06 22:27:48 -0800295eHalStatus csrTdlsChangePeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, tCsrStaParams *pstaParams);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800296eHalStatus csrTdlsDelPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac);
297eHalStatus csrTdlsProcessCmd(tpAniSirGlobal pMac,tSmeCmd *pCommand );
298eHalStatus tdlsMsgProcessor(tpAniSirGlobal pMac,v_U16_t msg_type,
299 void *pMsgBuf);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800300#ifdef FEATURE_WLAN_TDLS_INTERNAL
301eHalStatus csrTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId,
302 tCsrTdlsDisRequest *tdlsDisReq);
303eHalStatus csrTdlsSetupReq(tHalHandle hHal, tANI_U8 sessionId,
304 tCsrTdlsSetupRequest *tdlsSetupReq);
305eHalStatus csrTdlsTeardownReq(tHalHandle hHal, tANI_U8 sessionId,
306 tCsrTdlsTeardownRequest *teardown);
307#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800308#endif /* FEATURE_WLAN_TDLS */
309
Srinivas Girigowdade697412013-02-14 16:31:48 -0800310#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700311eHalStatus csrFlushBgScanRoamChannelList(tpAniSirGlobal pMac);
312eHalStatus csrCreateBgScanRoamChannelList(tpAniSirGlobal pMac,
313 const tANI_U8 *pChannelList,
314 const tANI_U8 numChannels);
Srinivas Girigowdade697412013-02-14 16:31:48 -0800315eHalStatus csrUpdateBgScanConfigIniChannelList(tpAniSirGlobal pMac, eCsrBand eBand);
316eHalStatus csrInitCountryValidChannelList(tpAniSirGlobal pMac, tANI_U8 revision);
317void csr_SetRevision(tpAniSirGlobal pMac, tANI_U8 revision);
318#endif
319
320
Jeff Johnson295189b2012-06-20 16:38:30 -0700321#endif //#if !defined( __SMEINSIDE_H )