blob: 742ac7db10c45cbfb93e1cdbf848fcf82dd22776 [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
54
55#if defined WLAN_FEATURE_VOWIFI
56#include "sme_RrmApi.h"
57#endif
58
59
60/*--------------------------------------------------------------------------
61 Type declarations
62 ------------------------------------------------------------------------*/
63
64#define SME_TOTAL_COMMAND 20
65
66
67typedef struct sGenericPmcCmd
68{
69 tANI_U32 size; //sizeof the data in the union, if any
70 tRequestFullPowerReason fullPowerReason;
71 tANI_BOOLEAN fReleaseWhenDone; //if TRUE, the command shall not put back to the queue, free te memory instead.
72 union
73 {
74 tExitBmpsInfo exitBmpsInfo;
75 tSirSmeWowlEnterParams enterWowlInfo;
76 }u;
77} tGenericPmcCmd;
78
79
80typedef struct sGenericQosCmd
81{
82 sme_QosWmmTspecInfo tspecInfo;
83 sme_QosEdcaAcType ac;
84 v_U8_t tspec_mask;
85} tGenericQosCmd;
86
87#ifdef WLAN_FEATURE_P2P
88typedef struct sRemainChlCmd
89{
90 tANI_U8 chn;
91 tANI_U8 phyMode;
92 tANI_U32 duration;
93 void* callback;
94 void* callbackCtx;
95}tRemainChlCmd;
96
97typedef struct sNoACmd
98{
99 tP2pPsConfig NoA;
100} tNoACmd;
101#endif
102
103typedef struct tagSmeCmd
104{
105 tListElem Link;
106 eSmeCommandType command;
107 tANI_U32 sessionId;
108 union
109 {
110 tScanCmd scanCmd;
111 tRoamCmd roamCmd;
112 tWmStatusChangeCmd wmStatusChangeCmd;
113 tSetKeyCmd setKeyCmd;
114 tRemoveKeyCmd removeKeyCmd;
115 tGenericPmcCmd pmcCmd;
116 tGenericQosCmd qosCmd;
117#ifdef WLAN_FEATURE_P2P
118 tRemainChlCmd remainChlCmd;
119 tNoACmd NoACmd;
120#endif
121 tAddStaForSessionCmd addStaSessionCmd;
122 tDelStaForSessionCmd delStaSessionCmd;
123 }u;
124}tSmeCmd;
125
126
127
128/*--------------------------------------------------------------------------
129 Internal to SME
130 ------------------------------------------------------------------------*/
131
132//To get a command buffer
133//Return: NULL if there no more command buffer left
134tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac );
135void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority );
136void smeProcessPendingQueue( tpAniSirGlobal pMac );
137void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd);
138void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId);
139tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac);
140tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
141//this function is used to abort a command where the normal processing of the command
142//is terminated without going through the normal path. it is here to take care of callbacks for
143//the command, if applicable.
144void pmcAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
145tANI_BOOLEAN qosProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
146
147eHalStatus csrProcessScanCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
148eHalStatus csrRoamProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
149void csrRoamProcessWmStatusChangeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
150void csrReinitRoamCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
151void csrReinitWmStatusChangeCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
152void csrReinitSetKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
153void csrReinitRemoveKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
154eHalStatus csrRoamProcessSetKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
155eHalStatus csrRoamProcessRemoveKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
156void csrReleaseCommandSetKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
157void csrReleaseCommandRemoveKey(tpAniSirGlobal pMac, tSmeCmd *pCommand);
158//eHalStatus csrRoamIssueSetKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 roamId );
159eHalStatus csrRoamIssueRemoveKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId,
160 tCsrRoamRemoveKey *pRemoveKey, tANI_U32 roamId );
161eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand, tRequestFullPowerReason *pReason,
162 tANI_BOOLEAN *pfNeedPower);
163void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping );
164
165eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme);
166eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme);
167
168
169eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
170eHalStatus csrProcessAddStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
171eHalStatus csrProcessDelStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
172eHalStatus csrProcessDelStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
173
174#ifdef WLAN_NS_OFFLOAD
175/* ---------------------------------------------------------------------------
176 \fn pmcSetNSOffload
177 \brief Set the host offload feature.
178 \param hHal - The handle returned by macOpen.
179 \param pRequest - Pointer to the offload request.
180 \return eHalStatus
181 eHAL_STATUS_FAILURE Cannot set the offload.
182 eHAL_STATUS_SUCCESS Request accepted.
183 ---------------------------------------------------------------------------*/
184eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest);
185#endif //WLAN_NS_OFFLOAD
186
187#ifdef FEATURE_WLAN_SCAN_PNO
188eHalStatus pmcSetPreferredNetworkList(tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, preferredNetworkFoundIndCallback callbackRoutine, void *callbackContext);
189eHalStatus pmcUpdateScanParams(tHalHandle hHal, tCsrConfig *pRequest, tCsrChannel *pChannelList, tANI_U8 b11dResolved);
190eHalStatus pmcSetRssiFilter(tHalHandle hHal, v_U8_t rssiThreshold);
191#endif // FEATURE_WLAN_SCAN_PNO
192eHalStatus pmcSetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams);
193
194tANI_BOOLEAN csrRoamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac);
195#endif //#if !defined( __SMEINSIDE_H )