blob: c89f4eb3b95763854c1f7e13f5a79adcfa9cf2be [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
2 * Copyright (c) 2012, Code Aurora Forum. 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
22#if !defined( __SMEINSIDE_H )
23#define __SMEINSIDE_H
24
25
26/**=========================================================================
27
28 \file smeInside.h
29
30 \brief prototype for SME structures and APIs used insside SME
31
32 Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved.
33
34 Qualcomm Confidential and Proprietary.
35
36 ========================================================================*/
37
38/* $Header$ */
39
40/*--------------------------------------------------------------------------
41 Include Files
42 ------------------------------------------------------------------------*/
43#include "vos_status.h"
44#include "vos_lock.h"
45#include "vos_trace.h"
46#include "vos_memory.h"
47#include "vos_types.h"
48#include "sirApi.h"
49#include "csrInternal.h"
50#include "sme_QosApi.h"
51#include "smeQosInternal.h"
52
53
Jeff Johnsone7245742012-09-05 17:12:55 -070054#ifdef FEATURE_OEM_DATA_SUPPORT
55#include "oemDataInternal.h"
56#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070057
58#if defined WLAN_FEATURE_VOWIFI
59#include "sme_RrmApi.h"
60#endif
61
62
63/*--------------------------------------------------------------------------
64 Type declarations
65 ------------------------------------------------------------------------*/
66
67#define SME_TOTAL_COMMAND 20
68
69
70typedef struct sGenericPmcCmd
71{
72 tANI_U32 size; //sizeof the data in the union, if any
73 tRequestFullPowerReason fullPowerReason;
74 tANI_BOOLEAN fReleaseWhenDone; //if TRUE, the command shall not put back to the queue, free te memory instead.
75 union
76 {
77 tExitBmpsInfo exitBmpsInfo;
78 tSirSmeWowlEnterParams enterWowlInfo;
79 }u;
80} tGenericPmcCmd;
81
82
83typedef struct sGenericQosCmd
84{
85 sme_QosWmmTspecInfo tspecInfo;
86 sme_QosEdcaAcType ac;
87 v_U8_t tspec_mask;
88} tGenericQosCmd;
89
90#ifdef WLAN_FEATURE_P2P
91typedef struct sRemainChlCmd
92{
93 tANI_U8 chn;
94 tANI_U8 phyMode;
95 tANI_U32 duration;
96 void* callback;
97 void* callbackCtx;
98}tRemainChlCmd;
99
100typedef struct sNoACmd
101{
102 tP2pPsConfig NoA;
103} tNoACmd;
104#endif
105
106typedef struct tagSmeCmd
107{
108 tListElem Link;
109 eSmeCommandType command;
110 tANI_U32 sessionId;
111 union
112 {
113 tScanCmd scanCmd;
114 tRoamCmd roamCmd;
115 tWmStatusChangeCmd wmStatusChangeCmd;
116 tSetKeyCmd setKeyCmd;
117 tRemoveKeyCmd removeKeyCmd;
118 tGenericPmcCmd pmcCmd;
119 tGenericQosCmd qosCmd;
Jeff Johnsone7245742012-09-05 17:12:55 -0700120#ifdef FEATURE_OEM_DATA_SUPPORT
121 tOemDataCmd oemDataCmd;
122#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700123#ifdef WLAN_FEATURE_P2P
124 tRemainChlCmd remainChlCmd;
125 tNoACmd NoACmd;
126#endif
127 tAddStaForSessionCmd addStaSessionCmd;
128 tDelStaForSessionCmd delStaSessionCmd;
129 }u;
130}tSmeCmd;
131
132
133
134/*--------------------------------------------------------------------------
135 Internal to SME
136 ------------------------------------------------------------------------*/
137
138//To get a command buffer
139//Return: NULL if there no more command buffer left
140tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac );
141void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority );
142void smeProcessPendingQueue( tpAniSirGlobal pMac );
143void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd);
144void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId);
145tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac);
146tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
147//this function is used to abort a command where the normal processing of the command
148//is terminated without going through the normal path. it is here to take care of callbacks for
149//the command, if applicable.
150void pmcAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
151tANI_BOOLEAN qosProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
152
153eHalStatus csrProcessScanCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
154eHalStatus csrRoamProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
155void csrRoamProcessWmStatusChangeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
156void csrReinitRoamCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
157void csrReinitWmStatusChangeCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
158void csrReinitSetKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
159void csrReinitRemoveKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
160eHalStatus csrRoamProcessSetKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
161eHalStatus csrRoamProcessRemoveKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
162void csrReleaseCommandSetKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
163void csrReleaseCommandRemoveKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
164//eHalStatus csrRoamIssueSetKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 roamId );
165eHalStatus csrRoamIssueRemoveKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId,
166 tCsrRoamRemoveKey *pRemoveKey, tANI_U32 roamId );
167eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand, tRequestFullPowerReason *pReason,
168 tANI_BOOLEAN *pfNeedPower);
169void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
170
171eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme);
172eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme);
173
Jeff Johnsone7245742012-09-05 17:12:55 -0700174#ifdef FEATURE_OEM_DATA_SUPPORT
175eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand);
176#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700177
178eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
179eHalStatus csrProcessAddStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
180eHalStatus csrProcessDelStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
181eHalStatus csrProcessDelStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
182
183#ifdef WLAN_NS_OFFLOAD
184/* ---------------------------------------------------------------------------
185 \fn pmcSetNSOffload
186 \brief Set the host offload feature.
187 \param hHal - The handle returned by macOpen.
188 \param pRequest - Pointer to the offload request.
189 \return eHalStatus
190 eHAL_STATUS_FAILURE Cannot set the offload.
191 eHAL_STATUS_SUCCESS Request accepted.
192 ---------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700193eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, tANI_U8 *bssId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700194#endif //WLAN_NS_OFFLOAD
195
196#ifdef FEATURE_WLAN_SCAN_PNO
197eHalStatus pmcSetPreferredNetworkList(tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, preferredNetworkFoundIndCallback callbackRoutine, void *callbackContext);
198eHalStatus pmcUpdateScanParams(tHalHandle hHal, tCsrConfig *pRequest, tCsrChannel *pChannelList, tANI_U8 b11dResolved);
199eHalStatus pmcSetRssiFilter(tHalHandle hHal, v_U8_t rssiThreshold);
200#endif // FEATURE_WLAN_SCAN_PNO
201eHalStatus pmcSetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams);
202
203tANI_BOOLEAN csrRoamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac);
204#endif //#if !defined( __SMEINSIDE_H )