Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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 Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 54 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 55 | #include "oemDataInternal.h" |
| 56 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 57 | |
| 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 | |
| 70 | typedef 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 | |
| 83 | typedef 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 |
| 91 | typedef struct sRemainChlCmd |
| 92 | { |
| 93 | tANI_U8 chn; |
| 94 | tANI_U8 phyMode; |
| 95 | tANI_U32 duration; |
| 96 | void* callback; |
| 97 | void* callbackCtx; |
| 98 | }tRemainChlCmd; |
| 99 | |
| 100 | typedef struct sNoACmd |
| 101 | { |
| 102 | tP2pPsConfig NoA; |
| 103 | } tNoACmd; |
| 104 | #endif |
| 105 | |
| 106 | typedef 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 Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 120 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 121 | tOemDataCmd oemDataCmd; |
| 122 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 123 | #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 |
| 140 | tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac ); |
| 141 | void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority ); |
| 142 | void smeProcessPendingQueue( tpAniSirGlobal pMac ); |
| 143 | void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd); |
| 144 | void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId); |
| 145 | tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac); |
| 146 | tANI_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. |
| 150 | void pmcAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping ); |
| 151 | tANI_BOOLEAN qosProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 152 | |
| 153 | eHalStatus csrProcessScanCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 154 | eHalStatus csrRoamProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 155 | void csrRoamProcessWmStatusChangeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 156 | void csrReinitRoamCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand); |
| 157 | void csrReinitWmStatusChangeCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand); |
| 158 | void csrReinitSetKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand); |
| 159 | void csrReinitRemoveKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand); |
| 160 | eHalStatus csrRoamProcessSetKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 161 | eHalStatus csrRoamProcessRemoveKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 162 | void csrReleaseCommandSetKey(tpAniSirGlobal pMac, tSmeCmd *pCommand); |
| 163 | void csrReleaseCommandRemoveKey(tpAniSirGlobal pMac, tSmeCmd *pCommand); |
| 164 | //eHalStatus csrRoamIssueSetKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 roamId ); |
| 165 | eHalStatus csrRoamIssueRemoveKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId, |
| 166 | tCsrRoamRemoveKey *pRemoveKey, tANI_U32 roamId ); |
| 167 | eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand, tRequestFullPowerReason *pReason, |
| 168 | tANI_BOOLEAN *pfNeedPower); |
| 169 | void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping ); |
| 170 | |
| 171 | eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme); |
| 172 | eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme); |
| 173 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 174 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 175 | eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand); |
| 176 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 177 | |
| 178 | eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 179 | eHalStatus csrProcessAddStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg); |
| 180 | eHalStatus csrProcessDelStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 181 | eHalStatus 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 Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 193 | eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, tANI_U8 *bssId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 194 | #endif //WLAN_NS_OFFLOAD |
| 195 | |
| 196 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 197 | eHalStatus pmcSetPreferredNetworkList(tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, preferredNetworkFoundIndCallback callbackRoutine, void *callbackContext); |
| 198 | eHalStatus pmcUpdateScanParams(tHalHandle hHal, tCsrConfig *pRequest, tCsrChannel *pChannelList, tANI_U8 b11dResolved); |
| 199 | eHalStatus pmcSetRssiFilter(tHalHandle hHal, v_U8_t rssiThreshold); |
| 200 | #endif // FEATURE_WLAN_SCAN_PNO |
| 201 | eHalStatus pmcSetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams); |
| 202 | |
| 203 | tANI_BOOLEAN csrRoamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac); |
| 204 | #endif //#if !defined( __SMEINSIDE_H ) |