Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 2 | * 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 Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 22 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23 | * |
| 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 Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 74 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 75 | #include "oemDataInternal.h" |
| 76 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 77 | |
| 78 | #if defined WLAN_FEATURE_VOWIFI |
| 79 | #include "sme_RrmApi.h" |
| 80 | #endif |
| 81 | |
| 82 | |
| 83 | /*-------------------------------------------------------------------------- |
| 84 | Type declarations |
| 85 | ------------------------------------------------------------------------*/ |
| 86 | |
Gopichand Nakkala | 976e325 | 2013-01-03 15:45:56 -0800 | [diff] [blame] | 87 | #define SME_TOTAL_COMMAND 30 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 88 | |
| 89 | |
| 90 | typedef 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 | |
| 103 | typedef struct sGenericQosCmd |
| 104 | { |
| 105 | sme_QosWmmTspecInfo tspecInfo; |
| 106 | sme_QosEdcaAcType ac; |
| 107 | v_U8_t tspec_mask; |
| 108 | } tGenericQosCmd; |
| 109 | |
| 110 | #ifdef WLAN_FEATURE_P2P |
| 111 | typedef struct sRemainChlCmd |
| 112 | { |
| 113 | tANI_U8 chn; |
| 114 | tANI_U8 phyMode; |
| 115 | tANI_U32 duration; |
| 116 | void* callback; |
| 117 | void* callbackCtx; |
| 118 | }tRemainChlCmd; |
| 119 | |
| 120 | typedef struct sNoACmd |
| 121 | { |
| 122 | tP2pPsConfig NoA; |
| 123 | } tNoACmd; |
| 124 | #endif |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 125 | #ifdef FEATURE_WLAN_TDLS |
| 126 | typedef struct TdlsSendMgmtInfo |
| 127 | { |
| 128 | tSirMacAddr peerMac; |
| 129 | tANI_U8 frameType; |
| 130 | tANI_U8 dialog; |
| 131 | tANI_U16 statusCode; |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 132 | tANI_U8 responder; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 133 | tANI_U8 *buf; |
| 134 | tANI_U8 len; |
| 135 | } tTdlsSendMgmtCmdInfo; |
| 136 | |
| 137 | typedef struct TdlsAddStaInfo |
| 138 | { |
| 139 | tSirMacAddr peerMac; |
| 140 | } tTdlsAddStaCmdInfo; |
| 141 | |
| 142 | typedef struct TdlsDelStaInfo |
| 143 | { |
| 144 | tSirMacAddr peerMac; |
| 145 | } tTdlsDelStaCmdInfo; |
| 146 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 147 | typedef struct TdlsDisReqCmdinfo |
| 148 | { |
| 149 | tSirMacAddr peerMac; |
| 150 | tANI_U8 tdlsDisType; |
| 151 | } tTdlsDisReqCmdinfo; |
| 152 | |
| 153 | typedef struct tdlsLinkSetupReqCmdinfo |
| 154 | { |
| 155 | tSirMacAddr peerMac; |
| 156 | } tTdlsLinkSetupReqCmdinfo; |
| 157 | |
| 158 | typedef struct tdlsLinkTeardownCmdinfo |
| 159 | { |
| 160 | tSirMacAddr peerMac; |
| 161 | } tTdlsLinkTeardownCmdinfo; |
| 162 | #endif |
| 163 | /* |
| 164 | * TDLS cmd info, CMD from SME to PE. |
| 165 | */ |
| 166 | typedef struct s_tdls_cmd |
| 167 | { |
| 168 | tANI_U32 size; |
| 169 | union |
| 170 | { |
| 171 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 172 | tTdlsDisReqCmdinfo tdlsDisReqCmdInfo ; |
| 173 | tTdlsLinkSetupReqCmdinfo tdlsLinkSetupReqCmdInfo ; |
| 174 | tTdlsLinkTeardownCmdinfo tdlsLinkTeardownCmdInfo ; |
| 175 | //tEnterPeerUAPSDInfo enterUapsdInfo ; |
| 176 | //tExitPeerUAPSDinfo exitUapsdInfo ; |
| 177 | #endif |
| 178 | tTdlsSendMgmtCmdInfo tdlsSendMgmtCmdInfo; |
| 179 | tTdlsAddStaCmdInfo tdlsAddStaCmdInfo; |
| 180 | tTdlsDelStaCmdInfo tdlsDelStaCmdInfo; |
| 181 | }u; |
| 182 | } tTdlsCmd; |
| 183 | #endif /* FEATURE_WLAN_TDLS */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 184 | |
| 185 | typedef struct tagSmeCmd |
| 186 | { |
| 187 | tListElem Link; |
| 188 | eSmeCommandType command; |
| 189 | tANI_U32 sessionId; |
| 190 | union |
| 191 | { |
| 192 | tScanCmd scanCmd; |
| 193 | tRoamCmd roamCmd; |
| 194 | tWmStatusChangeCmd wmStatusChangeCmd; |
| 195 | tSetKeyCmd setKeyCmd; |
| 196 | tRemoveKeyCmd removeKeyCmd; |
| 197 | tGenericPmcCmd pmcCmd; |
| 198 | tGenericQosCmd qosCmd; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 199 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 200 | tOemDataCmd oemDataCmd; |
| 201 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 202 | #ifdef WLAN_FEATURE_P2P |
| 203 | tRemainChlCmd remainChlCmd; |
| 204 | tNoACmd NoACmd; |
| 205 | #endif |
| 206 | tAddStaForSessionCmd addStaSessionCmd; |
| 207 | tDelStaForSessionCmd delStaSessionCmd; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 208 | #ifdef FEATURE_WLAN_TDLS |
| 209 | tTdlsCmd tdlsCmd; |
| 210 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 211 | }u; |
| 212 | }tSmeCmd; |
| 213 | |
| 214 | |
| 215 | |
| 216 | /*-------------------------------------------------------------------------- |
| 217 | Internal to SME |
| 218 | ------------------------------------------------------------------------*/ |
| 219 | |
| 220 | //To get a command buffer |
| 221 | //Return: NULL if there no more command buffer left |
| 222 | tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac ); |
| 223 | void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority ); |
| 224 | void smeProcessPendingQueue( tpAniSirGlobal pMac ); |
| 225 | void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd); |
| 226 | void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId); |
| 227 | tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac); |
| 228 | tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 229 | //this function is used to abort a command where the normal processing of the command |
| 230 | //is terminated without going through the normal path. it is here to take care of callbacks for |
| 231 | //the command, if applicable. |
| 232 | void pmcAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping ); |
| 233 | tANI_BOOLEAN qosProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 234 | |
| 235 | eHalStatus csrProcessScanCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 236 | eHalStatus csrRoamProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 237 | void csrRoamProcessWmStatusChangeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 238 | void csrReinitRoamCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand); |
| 239 | void csrReinitWmStatusChangeCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand); |
| 240 | void csrReinitSetKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand); |
| 241 | void csrReinitRemoveKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand); |
| 242 | eHalStatus csrRoamProcessSetKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 243 | eHalStatus csrRoamProcessRemoveKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 244 | void csrReleaseCommandSetKey(tpAniSirGlobal pMac, tSmeCmd *pCommand); |
| 245 | void csrReleaseCommandRemoveKey(tpAniSirGlobal pMac, tSmeCmd *pCommand); |
| 246 | //eHalStatus csrRoamIssueSetKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 roamId ); |
| 247 | eHalStatus csrRoamIssueRemoveKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId, |
| 248 | tCsrRoamRemoveKey *pRemoveKey, tANI_U32 roamId ); |
| 249 | eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand, tRequestFullPowerReason *pReason, |
| 250 | tANI_BOOLEAN *pfNeedPower); |
| 251 | void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping ); |
| 252 | |
| 253 | eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme); |
| 254 | eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme); |
| 255 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 256 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 257 | eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand); |
| 258 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 259 | |
| 260 | eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 261 | eHalStatus csrProcessAddStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg); |
| 262 | eHalStatus csrProcessDelStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 263 | eHalStatus csrProcessDelStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg); |
| 264 | |
| 265 | #ifdef WLAN_NS_OFFLOAD |
| 266 | /* --------------------------------------------------------------------------- |
| 267 | \fn pmcSetNSOffload |
| 268 | \brief Set the host offload feature. |
| 269 | \param hHal - The handle returned by macOpen. |
| 270 | \param pRequest - Pointer to the offload request. |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 271 | \param sessionId . Session index of the session |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 272 | \return eHalStatus |
| 273 | eHAL_STATUS_FAILURE Cannot set the offload. |
| 274 | eHAL_STATUS_SUCCESS Request accepted. |
| 275 | ---------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 276 | eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, tANI_U8 sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 277 | #endif //WLAN_NS_OFFLOAD |
| 278 | |
| 279 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 280 | eHalStatus pmcSetPreferredNetworkList(tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, preferredNetworkFoundIndCallback callbackRoutine, void *callbackContext); |
| 281 | eHalStatus pmcUpdateScanParams(tHalHandle hHal, tCsrConfig *pRequest, tCsrChannel *pChannelList, tANI_U8 b11dResolved); |
| 282 | eHalStatus pmcSetRssiFilter(tHalHandle hHal, v_U8_t rssiThreshold); |
| 283 | #endif // FEATURE_WLAN_SCAN_PNO |
| 284 | eHalStatus pmcSetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams); |
| 285 | |
| 286 | tANI_BOOLEAN csrRoamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 287 | #ifdef FEATURE_WLAN_TDLS |
| 288 | eHalStatus csrTdlsSendMgmtReq(tHalHandle hHal, tANI_U8 sessionId, tCsrTdlsSendMgmt *tdlsSendMgmt); |
| 289 | eHalStatus csrTdlsAddPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac); |
| 290 | eHalStatus csrTdlsDelPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac); |
| 291 | eHalStatus csrTdlsProcessCmd(tpAniSirGlobal pMac,tSmeCmd *pCommand ); |
| 292 | eHalStatus tdlsMsgProcessor(tpAniSirGlobal pMac,v_U16_t msg_type, |
| 293 | void *pMsgBuf); |
| 294 | eHalStatus csrTdlsOpen(tHalHandle hHal); |
| 295 | tANI_BOOLEAN csrTdlsPowerSaveCheck( void* hHal ); |
| 296 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 297 | eHalStatus csrTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId, |
| 298 | tCsrTdlsDisRequest *tdlsDisReq); |
| 299 | eHalStatus csrTdlsSetupReq(tHalHandle hHal, tANI_U8 sessionId, |
| 300 | tCsrTdlsSetupRequest *tdlsSetupReq); |
| 301 | eHalStatus csrTdlsTeardownReq(tHalHandle hHal, tANI_U8 sessionId, |
| 302 | tCsrTdlsTeardownRequest *teardown); |
| 303 | #endif |
| 304 | |
| 305 | #endif /* FEATURE_WLAN_TDLS */ |
| 306 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 307 | #endif //#if !defined( __SMEINSIDE_H ) |