Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Padma, Santhosh Kumar | ee7c3d2 | 2016-01-25 10:36:08 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. |
Kiet Lam | 0fb93dd | 2014-02-19 00:32:59 -0800 | [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 | /* |
Kiet Lam | a7f454d | 2014-07-24 12:04:06 -0700 | [diff] [blame] | 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 26 | */ |
Kiet Lam | 0fb93dd | 2014-02-19 00:32:59 -0800 | [diff] [blame] | 27 | |
| 28 | |
Kiet Lam | a7f454d | 2014-07-24 12:04:06 -0700 | [diff] [blame] | 29 | |
| 30 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 31 | /**========================================================================= |
| 32 | |
| 33 | \file smeApi.c |
| 34 | |
| 35 | \brief Definitions for SME APIs |
| 36 | |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame] | 37 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 38 | ========================================================================*/ |
| 39 | |
| 40 | /*=========================================================================== |
| 41 | |
| 42 | EDIT HISTORY FOR FILE |
| 43 | |
| 44 | |
| 45 | This section contains comments describing changes made to the module. |
| 46 | Notice that changes are listed in reverse chronological order. |
| 47 | |
| 48 | |
| 49 | |
| 50 | when who what, where, why |
| 51 | ---------- --- -------------------------------------------------------- |
| 52 | 06/03/10 js Added support to hostapd driven |
| 53 | * deauth/disassoc/mic failure |
| 54 | |
| 55 | ===========================================================================*/ |
| 56 | |
| 57 | /*-------------------------------------------------------------------------- |
| 58 | Include Files |
| 59 | ------------------------------------------------------------------------*/ |
| 60 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 61 | |
| 62 | #include "smsDebug.h" |
| 63 | #include "sme_Api.h" |
| 64 | #include "csrInsideApi.h" |
| 65 | #include "smeInside.h" |
| 66 | #include "csrInternal.h" |
| 67 | #include "wlan_qct_wda.h" |
| 68 | #include "halMsgApi.h" |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 69 | #include "vos_trace.h" |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 70 | #include "sme_Trace.h" |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 71 | #include "vos_types.h" |
| 72 | #include "vos_trace.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 73 | #include "sapApi.h" |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 74 | #include "macTrace.h" |
Mukul Sharma | be91e2f | 2014-06-29 22:09:20 +0530 | [diff] [blame] | 75 | #include "vos_utils.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 76 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 77 | extern tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); |
| 78 | |
| 79 | #include <wlan_qct_pal_api.h> |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 80 | #define LOG_SIZE 256 |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 81 | #define READ_MEMORY_DUMP_CMD 9 |
Madan Mohan Koyyalamudi | 8af9b40 | 2013-07-11 14:59:10 +0530 | [diff] [blame] | 82 | #define TL_INIT_STATE 0 |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 83 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 84 | |
| 85 | #define CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE 1000*30 //30s |
| 86 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 87 | // TxMB Functions |
| 88 | extern eHalStatus pmcPrepareCommand( tpAniSirGlobal pMac, eSmeCommandType cmdType, void *pvParam, |
| 89 | tANI_U32 size, tSmeCmd **ppCmd ); |
| 90 | extern void pmcReleaseCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 91 | extern void qosReleaseCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
Sushant Kaushik | 298a859 | 2014-12-09 17:34:07 +0530 | [diff] [blame] | 92 | extern void csrReleaseRocReqCommand( tpAniSirGlobal pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 93 | extern eHalStatus p2pProcessRemainOnChannelCmd(tpAniSirGlobal pMac, tSmeCmd *p2pRemainonChn); |
| 94 | extern eHalStatus sme_remainOnChnRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 95 | extern eHalStatus sme_remainOnChnReady( tHalHandle hHal, tANI_U8* pMsg); |
| 96 | extern eHalStatus sme_sendActionCnf( tHalHandle hHal, tANI_U8* pMsg); |
| 97 | extern eHalStatus p2pProcessNoAReq(tpAniSirGlobal pMac, tSmeCmd *pNoACmd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 98 | |
| 99 | static eHalStatus initSmeCmdList(tpAniSirGlobal pMac); |
| 100 | static void smeAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping ); |
| 101 | |
| 102 | eCsrPhyMode sme_GetPhyMode(tHalHandle hHal); |
| 103 | |
| 104 | eHalStatus sme_HandleChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf); |
| 105 | |
Sushant Kaushik | 1d73256 | 2014-05-21 14:15:37 +0530 | [diff] [blame] | 106 | void sme_DisconnectConnectedSessions(tpAniSirGlobal pMac); |
| 107 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 108 | eHalStatus sme_HandleGenericChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf); |
| 109 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 110 | eHalStatus sme_HandlePreChannelSwitchInd(tHalHandle hHal); |
| 111 | |
| 112 | eHalStatus sme_HandlePostChannelSwitchInd(tHalHandle hHal); |
| 113 | |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 114 | #ifdef FEATURE_WLAN_LFR |
| 115 | tANI_BOOLEAN csrIsScanAllowed(tpAniSirGlobal pMac); |
| 116 | #endif |
| 117 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 118 | #ifdef WLAN_FEATURE_11W |
| 119 | eHalStatus sme_UnprotectedMgmtFrmInd( tHalHandle hHal, |
| 120 | tpSirSmeUnprotMgmtFrameInd pSmeMgmtFrm ); |
| 121 | #endif |
| 122 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 123 | //Internal SME APIs |
| 124 | eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme) |
| 125 | { |
| 126 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 127 | |
| 128 | if(psSme) |
| 129 | { |
| 130 | if( VOS_IS_STATUS_SUCCESS( vos_lock_acquire( &psSme->lkSmeGlobalLock) ) ) |
| 131 | { |
| 132 | status = eHAL_STATUS_SUCCESS; |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | return (status); |
| 137 | } |
| 138 | |
| 139 | |
| 140 | eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme) |
| 141 | { |
| 142 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 143 | |
| 144 | if(psSme) |
| 145 | { |
| 146 | if( VOS_IS_STATUS_SUCCESS( vos_lock_release( &psSme->lkSmeGlobalLock) ) ) |
| 147 | { |
| 148 | status = eHAL_STATUS_SUCCESS; |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | return (status); |
| 153 | } |
| 154 | |
| 155 | |
| 156 | |
| 157 | static eHalStatus initSmeCmdList(tpAniSirGlobal pMac) |
| 158 | { |
| 159 | eHalStatus status; |
| 160 | tSmeCmd *pCmd; |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 161 | tANI_U32 cmd_idx; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 162 | VOS_STATUS vosStatus; |
| 163 | vos_timer_t* cmdTimeoutTimer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 164 | |
| 165 | pMac->sme.totalSmeCmd = SME_TOTAL_COMMAND; |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 166 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 167 | &pMac->sme.smeCmdActiveList))) |
| 168 | goto end; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 169 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 170 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 171 | &pMac->sme.smeCmdPendingList))) |
| 172 | goto end; |
| 173 | |
| 174 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 175 | &pMac->sme.smeScanCmdActiveList))) |
| 176 | goto end; |
| 177 | |
| 178 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 179 | &pMac->sme.smeScanCmdPendingList))) |
| 180 | goto end; |
| 181 | |
| 182 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 183 | &pMac->sme.smeCmdFreeList))) |
| 184 | goto end; |
| 185 | |
Hanumantha Reddy Pothula | 7234295 | 2015-02-26 14:43:54 +0530 | [diff] [blame] | 186 | pCmd = (tSmeCmd *) vos_mem_vmalloc(sizeof(tSmeCmd) * pMac->sme.totalSmeCmd); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 187 | if ( NULL == pCmd ) |
Hanumantha Reddy Pothula | 7234295 | 2015-02-26 14:43:54 +0530 | [diff] [blame] | 188 | { |
| 189 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 190 | FL("fail to allocate memory %lu"), |
| 191 | (unsigned long)(sizeof(tSmeCmd) * pMac->sme.totalSmeCmd)); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 192 | status = eHAL_STATUS_FAILURE; |
Hanumantha Reddy Pothula | 7234295 | 2015-02-26 14:43:54 +0530 | [diff] [blame] | 193 | } |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 194 | else |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 195 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 196 | status = eHAL_STATUS_SUCCESS; |
| 197 | |
| 198 | vos_mem_set(pCmd, sizeof(tSmeCmd) * pMac->sme.totalSmeCmd, 0); |
| 199 | pMac->sme.pSmeCmdBufAddr = pCmd; |
| 200 | |
| 201 | for (cmd_idx = 0; cmd_idx < pMac->sme.totalSmeCmd; cmd_idx++) |
| 202 | { |
| 203 | csrLLInsertTail(&pMac->sme.smeCmdFreeList, |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 204 | &pCmd[cmd_idx].Link, LL_ACCESS_LOCK); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 205 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 206 | } |
| 207 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 208 | /* This timer is only to debug the active list command timeout */ |
| 209 | |
| 210 | cmdTimeoutTimer = (vos_timer_t*)vos_mem_malloc(sizeof(vos_timer_t)); |
| 211 | if (cmdTimeoutTimer) |
| 212 | { |
| 213 | pMac->sme.smeCmdActiveList.cmdTimeoutTimer = cmdTimeoutTimer; |
| 214 | vosStatus = |
| 215 | vos_timer_init( pMac->sme.smeCmdActiveList.cmdTimeoutTimer, |
| 216 | VOS_TIMER_TYPE_SW, |
| 217 | activeListCmdTimeoutHandle, |
| 218 | (void*) pMac); |
| 219 | |
| 220 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 221 | { |
| 222 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 223 | "Init Timer fail for active list command process time out"); |
| 224 | vos_mem_free(pMac->sme.smeCmdActiveList.cmdTimeoutTimer); |
| 225 | } |
| 226 | else |
| 227 | { |
| 228 | pMac->sme.smeCmdActiveList.cmdTimeoutDuration = |
| 229 | CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE; |
| 230 | } |
| 231 | } |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 232 | end: |
| 233 | if (!HAL_STATUS_SUCCESS(status)) |
| 234 | smsLog(pMac, LOGE, "failed to initialize sme command list:%d\n", |
| 235 | status); |
| 236 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 237 | return (status); |
| 238 | } |
| 239 | |
| 240 | |
| 241 | void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd) |
| 242 | { |
| 243 | pCmd->command = eSmeNoCommand; |
| 244 | csrLLInsertTail(&pMac->sme.smeCmdFreeList, &pCmd->Link, LL_ACCESS_LOCK); |
| 245 | } |
| 246 | |
| 247 | |
| 248 | |
| 249 | static void smeReleaseCmdList(tpAniSirGlobal pMac, tDblLinkList *pList) |
| 250 | { |
| 251 | tListElem *pEntry; |
| 252 | tSmeCmd *pCommand; |
| 253 | |
| 254 | while((pEntry = csrLLRemoveHead(pList, LL_ACCESS_LOCK)) != NULL) |
| 255 | { |
| 256 | //TODO: base on command type to call release functions |
| 257 | //reinitialize different command types so they can be reused |
| 258 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 259 | smeAbortCommand(pMac, pCommand, eANI_BOOLEAN_TRUE); |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | static void purgeSmeCmdList(tpAniSirGlobal pMac) |
| 264 | { |
| 265 | //release any out standing commands back to free command list |
| 266 | smeReleaseCmdList(pMac, &pMac->sme.smeCmdPendingList); |
| 267 | smeReleaseCmdList(pMac, &pMac->sme.smeCmdActiveList); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 268 | smeReleaseCmdList(pMac, &pMac->sme.smeScanCmdPendingList); |
| 269 | smeReleaseCmdList(pMac, &pMac->sme.smeScanCmdActiveList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 270 | } |
| 271 | |
Madan Mohan Koyyalamudi | 2125599 | 2013-08-01 18:00:25 +0530 | [diff] [blame] | 272 | void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId, |
Abhishek Singh | 7b2d081 | 2016-04-28 11:44:29 +0530 | [diff] [blame] | 273 | tDblLinkList *pList, bool flush_all) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 274 | { |
| 275 | //release any out standing commands back to free command list |
| 276 | tListElem *pEntry, *pNext; |
| 277 | tSmeCmd *pCommand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 278 | tDblLinkList localList; |
| 279 | |
| 280 | vos_mem_zero(&localList, sizeof(tDblLinkList)); |
| 281 | if(!HAL_STATUS_SUCCESS(csrLLOpen(pMac->hHdd, &localList))) |
| 282 | { |
| 283 | smsLog(pMac, LOGE, FL(" failed to open list")); |
| 284 | return; |
| 285 | } |
| 286 | |
| 287 | csrLLLock(pList); |
| 288 | pEntry = csrLLPeekHead(pList, LL_ACCESS_NOLOCK); |
| 289 | while(pEntry != NULL) |
| 290 | { |
| 291 | pNext = csrLLNext(pList, pEntry, LL_ACCESS_NOLOCK); |
| 292 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Abhishek Singh | 7b2d081 | 2016-04-28 11:44:29 +0530 | [diff] [blame] | 293 | if (!flush_all && |
| 294 | csr_is_disconnect_full_power_cmd(pCommand)) { |
| 295 | smsLog(pMac, LOGW, FL(" Ignore disconnect")); |
| 296 | pEntry = pNext; |
| 297 | continue; |
| 298 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 299 | if(pCommand->sessionId == sessionId) |
| 300 | { |
| 301 | if(csrLLRemoveEntry(pList, pEntry, LL_ACCESS_NOLOCK)) |
| 302 | { |
| 303 | csrLLInsertTail(&localList, pEntry, LL_ACCESS_NOLOCK); |
| 304 | } |
| 305 | } |
| 306 | pEntry = pNext; |
| 307 | } |
| 308 | csrLLUnlock(pList); |
| 309 | |
| 310 | while( (pEntry = csrLLRemoveHead(&localList, LL_ACCESS_NOLOCK)) ) |
| 311 | { |
| 312 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 313 | smeAbortCommand(pMac, pCommand, eANI_BOOLEAN_TRUE); |
| 314 | } |
| 315 | csrLLClose(&localList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 316 | } |
| 317 | |
| 318 | |
| 319 | static eHalStatus freeSmeCmdList(tpAniSirGlobal pMac) |
| 320 | { |
| 321 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 322 | |
| 323 | purgeSmeCmdList(pMac); |
| 324 | csrLLClose(&pMac->sme.smeCmdPendingList); |
| 325 | csrLLClose(&pMac->sme.smeCmdActiveList); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 326 | csrLLClose(&pMac->sme.smeScanCmdPendingList); |
| 327 | csrLLClose(&pMac->sme.smeScanCmdActiveList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 328 | csrLLClose(&pMac->sme.smeCmdFreeList); |
| 329 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 330 | /*destroy active list command time out timer */ |
| 331 | vos_timer_destroy(pMac->sme.smeCmdActiveList.cmdTimeoutTimer); |
| 332 | vos_mem_free(pMac->sme.smeCmdActiveList.cmdTimeoutTimer); |
| 333 | pMac->sme.smeCmdActiveList.cmdTimeoutTimer = NULL; |
| 334 | |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 335 | status = vos_lock_acquire(&pMac->sme.lkSmeGlobalLock); |
| 336 | if(status != eHAL_STATUS_SUCCESS) |
| 337 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 338 | smsLog(pMac, LOGE, |
| 339 | FL("Failed to acquire the lock status = %d"), status); |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 340 | goto done; |
| 341 | } |
| 342 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 343 | if(NULL != pMac->sme.pSmeCmdBufAddr) |
| 344 | { |
Hanumantha Reddy Pothula | 7234295 | 2015-02-26 14:43:54 +0530 | [diff] [blame] | 345 | vos_mem_vfree(pMac->sme.pSmeCmdBufAddr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 346 | pMac->sme.pSmeCmdBufAddr = NULL; |
| 347 | } |
| 348 | |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 349 | status = vos_lock_release(&pMac->sme.lkSmeGlobalLock); |
| 350 | if(status != eHAL_STATUS_SUCCESS) |
| 351 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 352 | smsLog(pMac, LOGE, |
| 353 | FL("Failed to release the lock status = %d"), status); |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 354 | } |
| 355 | done: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 356 | return (status); |
| 357 | } |
| 358 | |
| 359 | |
| 360 | void dumpCsrCommandInfo(tpAniSirGlobal pMac, tSmeCmd *pCmd) |
| 361 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 362 | switch( pCmd->command ) |
| 363 | { |
| 364 | case eSmeCommandScan: |
| 365 | smsLog( pMac, LOGE, " scan command reason is %d", pCmd->u.scanCmd.reason ); |
| 366 | break; |
| 367 | |
| 368 | case eSmeCommandRoam: |
| 369 | smsLog( pMac, LOGE, " roam command reason is %d", pCmd->u.roamCmd.roamReason ); |
| 370 | break; |
| 371 | |
| 372 | case eSmeCommandWmStatusChange: |
| 373 | smsLog( pMac, LOGE, " WMStatusChange command type is %d", pCmd->u.wmStatusChangeCmd.Type ); |
| 374 | break; |
| 375 | |
| 376 | case eSmeCommandSetKey: |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 377 | smsLog( pMac, LOGE, " setKey command auth(%d) enc(%d)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 378 | pCmd->u.setKeyCmd.authType, pCmd->u.setKeyCmd.encType ); |
| 379 | break; |
| 380 | |
| 381 | case eSmeCommandRemoveKey: |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 382 | smsLog( pMac, LOGE, " removeKey command auth(%d) enc(%d)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 383 | pCmd->u.removeKeyCmd.authType, pCmd->u.removeKeyCmd.encType ); |
| 384 | break; |
| 385 | |
| 386 | default: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 387 | smsLog( pMac, LOGE, " default: Unhandled command %d", |
| 388 | pCmd->command); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 389 | break; |
| 390 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 391 | } |
| 392 | |
| 393 | tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac ) |
| 394 | { |
| 395 | tSmeCmd *pRetCmd = NULL, *pTempCmd = NULL; |
| 396 | tListElem *pEntry; |
Sushant Kaushik | c9d0f42 | 2014-06-23 18:59:30 +0530 | [diff] [blame] | 397 | static int smeCommandQueueFull = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 398 | pEntry = csrLLRemoveHead( &pMac->sme.smeCmdFreeList, LL_ACCESS_LOCK ); |
| 399 | |
| 400 | // If we can get another MS Msg buffer, then we are ok. Just link |
| 401 | // the entry onto the linked list. (We are using the linked list |
| 402 | // to keep track of tfhe message buffers). |
| 403 | if ( pEntry ) |
| 404 | { |
| 405 | pRetCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Sushant Kaushik | c9d0f42 | 2014-06-23 18:59:30 +0530 | [diff] [blame] | 406 | /* reset when free list is available */ |
| 407 | smeCommandQueueFull = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 408 | } |
Padma, Santhosh Kumar | 0a35058 | 2015-06-12 15:23:49 +0530 | [diff] [blame] | 409 | else |
| 410 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 411 | int idx = 1; |
| 412 | |
| 413 | //Cannot change pRetCmd here since it needs to return later. |
| 414 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK ); |
| 415 | if( pEntry ) |
| 416 | { |
| 417 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 418 | } |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 419 | smsLog( pMac, LOGE, "Out of command buffer.... command (0x%X) stuck", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 420 | (pTempCmd) ? pTempCmd->command : eSmeNoCommand ); |
| 421 | if(pTempCmd) |
| 422 | { |
| 423 | if( eSmeCsrCommandMask & pTempCmd->command ) |
| 424 | { |
| 425 | //CSR command is stuck. See what the reason code is for that command |
| 426 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 427 | } |
| 428 | } //if(pTempCmd) |
| 429 | |
| 430 | //dump what is in the pending queue |
| 431 | csrLLLock(&pMac->sme.smeCmdPendingList); |
| 432 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK ); |
Sushant Kaushik | c9d0f42 | 2014-06-23 18:59:30 +0530 | [diff] [blame] | 433 | while(pEntry && !smeCommandQueueFull) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 434 | { |
| 435 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Sushant Kaushik | c9d0f42 | 2014-06-23 18:59:30 +0530 | [diff] [blame] | 436 | /* Print only 1st five commands from pending queue. */ |
| 437 | if (idx <= 5) |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 438 | smsLog( pMac, LOGE, "Out of command buffer.... SME pending command #%d (0x%X)", |
Sushant Kaushik | c9d0f42 | 2014-06-23 18:59:30 +0530 | [diff] [blame] | 439 | idx, pTempCmd->command ); |
| 440 | idx++; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 441 | if( eSmeCsrCommandMask & pTempCmd->command ) |
| 442 | { |
| 443 | //CSR command is stuck. See what the reason code is for that command |
| 444 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 445 | } |
| 446 | pEntry = csrLLNext( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_NOLOCK ); |
| 447 | } |
| 448 | csrLLUnlock(&pMac->sme.smeCmdPendingList); |
| 449 | |
Padma, Santhosh Kumar | 0a35058 | 2015-06-12 15:23:49 +0530 | [diff] [blame] | 450 | idx = 1; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 451 | //There may be some more command in CSR's own pending queue |
| 452 | csrLLLock(&pMac->roam.roamCmdPendingList); |
| 453 | pEntry = csrLLPeekHead( &pMac->roam.roamCmdPendingList, LL_ACCESS_NOLOCK ); |
Padma, Santhosh Kumar | 0a35058 | 2015-06-12 15:23:49 +0530 | [diff] [blame] | 454 | while(pEntry && !smeCommandQueueFull) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 455 | { |
| 456 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Padma, Santhosh Kumar | 0a35058 | 2015-06-12 15:23:49 +0530 | [diff] [blame] | 457 | /* Print only 1st five commands from CSR pending queue */ |
| 458 | if (idx <= 5) |
| 459 | smsLog( pMac, LOGE, |
| 460 | "Out of command buffer...CSR pending command #%d (0x%X)", |
| 461 | idx, pTempCmd->command ); |
| 462 | idx++; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 463 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 464 | pEntry = csrLLNext( &pMac->roam.roamCmdPendingList, pEntry, LL_ACCESS_NOLOCK ); |
| 465 | } |
Padma, Santhosh Kumar | 0a35058 | 2015-06-12 15:23:49 +0530 | [diff] [blame] | 466 | /* |
| 467 | * Increament static variable so that it prints pending command |
| 468 | * only once |
| 469 | */ |
| 470 | smeCommandQueueFull++; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 471 | csrLLUnlock(&pMac->roam.roamCmdPendingList); |
Padma, Santhosh Kumar | 0a35058 | 2015-06-12 15:23:49 +0530 | [diff] [blame] | 472 | |
Padma, Santhosh Kumar | 9093b20 | 2015-07-21 15:37:38 +0530 | [diff] [blame] | 473 | vos_state_info_dump_all(); |
| 474 | |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 475 | if (pMac->roam.configParam.enableFatalEvent) |
| 476 | { |
| 477 | vos_fatal_event_logs_req(WLAN_LOG_TYPE_FATAL, |
| 478 | WLAN_LOG_INDICATOR_HOST_DRIVER, |
| 479 | WLAN_LOG_REASON_SME_OUT_OF_CMD_BUF, |
Abhishek Singh | 4eaf679 | 2016-02-04 12:36:39 +0530 | [diff] [blame] | 480 | FALSE, FALSE); |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 481 | } |
| 482 | else |
| 483 | { |
Abhishek Singh | 84fc751 | 2015-10-06 14:27:25 +0530 | [diff] [blame] | 484 | /* Trigger SSR */ |
| 485 | vos_wlanRestart(); |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 486 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 487 | } |
| 488 | |
Masti, Narayanraddi | 5240fbe | 2015-02-05 16:51:28 +0530 | [diff] [blame] | 489 | if( pRetCmd ) |
| 490 | { |
| 491 | vos_mem_set((tANI_U8 *)&pRetCmd->command, sizeof(pRetCmd->command), 0); |
| 492 | vos_mem_set((tANI_U8 *)&pRetCmd->sessionId, sizeof(pRetCmd->sessionId), 0); |
| 493 | vos_mem_set((tANI_U8 *)&pRetCmd->u, sizeof(pRetCmd->u), 0); |
| 494 | } |
| 495 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 496 | return( pRetCmd ); |
| 497 | } |
| 498 | |
| 499 | |
| 500 | void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority ) |
| 501 | { |
Sushant Kaushik | 4928e54 | 2014-12-29 15:25:54 +0530 | [diff] [blame] | 502 | if (!SME_IS_START(pMac)) |
| 503 | { |
| 504 | smsLog( pMac, LOGE, FL("Sme in stop state")); |
| 505 | return; |
| 506 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 507 | if ( fHighPriority ) |
| 508 | { |
| 509 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pCmd->Link, LL_ACCESS_LOCK ); |
| 510 | } |
| 511 | else |
| 512 | { |
| 513 | csrLLInsertTail( &pMac->sme.smeCmdPendingList, &pCmd->Link, LL_ACCESS_LOCK ); |
| 514 | } |
| 515 | |
| 516 | // process the command queue... |
| 517 | smeProcessPendingQueue( pMac ); |
| 518 | |
| 519 | return; |
| 520 | } |
| 521 | |
| 522 | |
| 523 | static eSmeCommandType smeIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand ) |
| 524 | { |
| 525 | eSmeCommandType pmcCommand = eSmeNoCommand; |
| 526 | tANI_BOOLEAN fFullPowerNeeded = eANI_BOOLEAN_FALSE; |
| 527 | tPmcState pmcState; |
| 528 | eHalStatus status; |
| 529 | |
| 530 | do |
| 531 | { |
| 532 | pmcState = pmcGetPmcState(pMac); |
| 533 | |
| 534 | status = csrIsFullPowerNeeded( pMac, pCommand, NULL, &fFullPowerNeeded ); |
| 535 | if( !HAL_STATUS_SUCCESS(status) ) |
| 536 | { |
| 537 | //PMC state is not right for the command, drop it |
| 538 | return ( eSmeDropCommand ); |
| 539 | } |
| 540 | if( fFullPowerNeeded ) break; |
| 541 | fFullPowerNeeded = ( ( eSmeCommandAddTs == pCommand->command ) || |
| 542 | ( eSmeCommandDelTs == pCommand->command ) ); |
| 543 | if( fFullPowerNeeded ) break; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 544 | #ifdef FEATURE_OEM_DATA_SUPPORT |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 545 | fFullPowerNeeded = (pmcState == IMPS && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 546 | eSmeCommandOemDataReq == pCommand->command); |
| 547 | if(fFullPowerNeeded) break; |
| 548 | #endif |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 549 | fFullPowerNeeded = (pmcState == IMPS && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 550 | eSmeCommandRemainOnChannel == pCommand->command); |
| 551 | if(fFullPowerNeeded) break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 552 | } while(0); |
| 553 | |
| 554 | if( fFullPowerNeeded ) |
| 555 | { |
| 556 | switch( pmcState ) |
| 557 | { |
| 558 | case IMPS: |
| 559 | case STANDBY: |
| 560 | pmcCommand = eSmeCommandExitImps; |
| 561 | break; |
| 562 | |
| 563 | case BMPS: |
| 564 | pmcCommand = eSmeCommandExitBmps; |
| 565 | break; |
| 566 | |
| 567 | case UAPSD: |
| 568 | pmcCommand = eSmeCommandExitUapsd; |
| 569 | break; |
| 570 | |
| 571 | case WOWL: |
| 572 | pmcCommand = eSmeCommandExitWowl; |
| 573 | break; |
| 574 | |
| 575 | default: |
| 576 | break; |
| 577 | } |
| 578 | } |
| 579 | |
| 580 | return ( pmcCommand ); |
| 581 | } |
| 582 | |
| 583 | |
| 584 | //For commands that need to do extra cleanup. |
| 585 | static void smeAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping ) |
| 586 | { |
| 587 | if( eSmePmcCommandMask & pCommand->command ) |
| 588 | { |
| 589 | pmcAbortCommand( pMac, pCommand, fStopping ); |
| 590 | } |
| 591 | else if ( eSmeCsrCommandMask & pCommand->command ) |
| 592 | { |
| 593 | csrAbortCommand( pMac, pCommand, fStopping ); |
| 594 | } |
| 595 | else |
| 596 | { |
| 597 | switch( pCommand->command ) |
| 598 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 599 | case eSmeCommandRemainOnChannel: |
| 600 | if (NULL != pCommand->u.remainChlCmd.callback) |
| 601 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 602 | remainOnChanCallback callback = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 603 | pCommand->u.remainChlCmd.callback; |
| 604 | /* process the msg */ |
| 605 | if( callback ) |
| 606 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 607 | callback(pMac, pCommand->u.remainChlCmd.callbackCtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 608 | eCSR_SCAN_ABORT ); |
| 609 | } |
| 610 | } |
| 611 | smeReleaseCommand( pMac, pCommand ); |
| 612 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 613 | default: |
| 614 | smeReleaseCommand( pMac, pCommand ); |
| 615 | break; |
| 616 | } |
| 617 | } |
| 618 | } |
| 619 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 620 | tListElem *csrGetCmdToProcess(tpAniSirGlobal pMac, tDblLinkList *pList, |
| 621 | tANI_U8 sessionId, tANI_BOOLEAN fInterlocked) |
| 622 | { |
| 623 | tListElem *pCurEntry = NULL; |
| 624 | tSmeCmd *pCommand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 625 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 626 | /* Go through the list and return the command whose session id is not |
| 627 | * matching with the current ongoing scan cmd sessionId */ |
| 628 | pCurEntry = csrLLPeekHead( pList, LL_ACCESS_LOCK ); |
| 629 | while (pCurEntry) |
| 630 | { |
| 631 | pCommand = GET_BASE_ADDR(pCurEntry, tSmeCmd, Link); |
| 632 | if (pCommand->sessionId != sessionId) |
| 633 | { |
| 634 | smsLog(pMac, LOG1, "selected the command with different sessionId"); |
| 635 | return pCurEntry; |
| 636 | } |
| 637 | |
| 638 | pCurEntry = csrLLNext(pList, pCurEntry, fInterlocked); |
| 639 | } |
| 640 | |
| 641 | smsLog(pMac, LOG1, "No command pending with different sessionId"); |
| 642 | return NULL; |
| 643 | } |
| 644 | |
| 645 | tANI_BOOLEAN smeProcessScanQueue(tpAniSirGlobal pMac) |
| 646 | { |
| 647 | tListElem *pEntry; |
| 648 | tSmeCmd *pCommand; |
| 649 | tListElem *pSmeEntry; |
| 650 | tSmeCmd *pSmeCommand; |
| 651 | tANI_BOOLEAN status = eANI_BOOLEAN_TRUE; |
| 652 | |
| 653 | csrLLLock( &pMac->sme.smeScanCmdActiveList ); |
| 654 | if (csrLLIsListEmpty( &pMac->sme.smeScanCmdActiveList, |
| 655 | LL_ACCESS_NOLOCK )) |
| 656 | { |
| 657 | if (!csrLLIsListEmpty(&pMac->sme.smeScanCmdPendingList, |
| 658 | LL_ACCESS_LOCK)) |
| 659 | { |
| 660 | pEntry = csrLLPeekHead( &pMac->sme.smeScanCmdPendingList, |
| 661 | LL_ACCESS_LOCK ); |
| 662 | if (pEntry) |
| 663 | { |
| 664 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 665 | //We cannot execute any command in wait-for-key state until setKey is through. |
| 666 | if (CSR_IS_WAIT_FOR_KEY( pMac, pCommand->sessionId)) |
| 667 | { |
| 668 | if (!CSR_IS_SET_KEY_COMMAND(pCommand)) |
| 669 | { |
| 670 | smsLog(pMac, LOGE, |
| 671 | " Cannot process command(%d) while waiting for key", |
| 672 | pCommand->command); |
| 673 | status = eANI_BOOLEAN_FALSE; |
| 674 | goto end; |
| 675 | } |
| 676 | } |
| 677 | |
| 678 | if ((!csrLLIsListEmpty(&pMac->sme.smeCmdActiveList, |
| 679 | LL_ACCESS_LOCK ))) |
| 680 | { |
| 681 | pSmeEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, |
| 682 | LL_ACCESS_LOCK); |
| 683 | if (pEntry) |
| 684 | { |
| 685 | pSmeCommand = GET_BASE_ADDR(pEntry, tSmeCmd, |
| 686 | Link) ; |
| 687 | |
| 688 | /* if scan is running on one interface and SME recei |
| 689 | ves the next command on the same interface then |
| 690 | dont the allow the command to be queued to |
| 691 | smeCmdPendingList. If next scan is allowed on |
| 692 | the same interface the CSR state machine will |
| 693 | get screwed up. */ |
| 694 | if (pSmeCommand->sessionId == pCommand->sessionId) |
| 695 | { |
| 696 | status = eANI_BOOLEAN_FALSE; |
| 697 | goto end; |
| 698 | } |
| 699 | } |
| 700 | } |
| 701 | if ( csrLLRemoveEntry( &pMac->sme.smeScanCmdPendingList, |
| 702 | pEntry, LL_ACCESS_LOCK ) ) |
| 703 | { |
| 704 | csrLLInsertHead( &pMac->sme.smeScanCmdActiveList, |
| 705 | &pCommand->Link, LL_ACCESS_NOLOCK ); |
| 706 | |
| 707 | switch (pCommand->command) |
| 708 | { |
| 709 | case eSmeCommandScan: |
| 710 | smsLog(pMac, LOG1, |
| 711 | " Processing scan offload command "); |
| 712 | csrProcessScanCommand( pMac, pCommand ); |
| 713 | break; |
| 714 | default: |
| 715 | smsLog(pMac, LOGE, |
| 716 | " Something wrong, wrong command enqueued" |
| 717 | " to smeScanCmdPendingList"); |
| 718 | pEntry = csrLLRemoveHead( |
| 719 | &pMac->sme.smeScanCmdActiveList, |
| 720 | LL_ACCESS_NOLOCK ); |
| 721 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 722 | smeReleaseCommand( pMac, pCommand ); |
| 723 | break; |
| 724 | } |
| 725 | } |
| 726 | } |
| 727 | } |
| 728 | } |
| 729 | end: |
| 730 | csrLLUnlock(&pMac->sme.smeScanCmdActiveList); |
| 731 | return status; |
| 732 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 733 | |
Hanumantha Reddy Pothula | 28b1e65 | 2015-02-02 21:10:13 +0530 | [diff] [blame] | 734 | eHalStatus smeProcessPnoCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd) |
| 735 | { |
| 736 | tpSirPNOScanReq pnoReqBuf; |
| 737 | tSirMsgQ msgQ; |
| 738 | |
| 739 | pnoReqBuf = vos_mem_malloc(sizeof(tSirPNOScanReq)); |
| 740 | if ( NULL == pnoReqBuf ) |
| 741 | { |
| 742 | smsLog(pMac, LOGE, FL("failed to allocate memory")); |
| 743 | return eHAL_STATUS_FAILURE; |
| 744 | } |
| 745 | |
| 746 | vos_mem_copy(pnoReqBuf, &(pCmd->u.pnoInfo), sizeof(tSirPNOScanReq)); |
| 747 | |
| 748 | smsLog(pMac, LOG1, FL("post WDA_SET_PNO_REQ comamnd")); |
| 749 | msgQ.type = WDA_SET_PNO_REQ; |
| 750 | msgQ.reserved = 0; |
| 751 | msgQ.bodyptr = pnoReqBuf; |
| 752 | msgQ.bodyval = 0; |
| 753 | wdaPostCtrlMsg( pMac, &msgQ); |
| 754 | |
| 755 | return eHAL_STATUS_SUCCESS; |
| 756 | } |
| 757 | |
Abhishek Singh | 99a31be | 2015-12-10 10:37:44 +0530 | [diff] [blame] | 758 | /** |
| 759 | * sme_process_set_max_tx_power() - Set the Maximum Transmit Power |
| 760 | * |
| 761 | * @pMac: mac pointer. |
| 762 | * @command: cmd param containing bssid, self mac |
| 763 | * and power in db |
| 764 | * |
| 765 | * Set the maximum transmit power dynamically. |
| 766 | * |
| 767 | * Return: eHalStatus |
| 768 | * |
| 769 | */ |
| 770 | eHalStatus sme_process_set_max_tx_power(tpAniSirGlobal pMac, |
| 771 | tSmeCmd *command) |
| 772 | { |
| 773 | vos_msg_t msg; |
| 774 | tMaxTxPowerParams *max_tx_params = NULL; |
| 775 | |
| 776 | max_tx_params = vos_mem_malloc(sizeof(*max_tx_params)); |
| 777 | if (NULL == max_tx_params) |
| 778 | { |
| 779 | smsLog(pMac, LOGE, FL("fail to allocate memory for max_tx_params")); |
| 780 | return eHAL_STATUS_FAILURE; |
| 781 | } |
| 782 | |
| 783 | vos_mem_copy(max_tx_params->bssId, |
| 784 | command->u.set_tx_max_pwr.bssid, SIR_MAC_ADDR_LENGTH); |
| 785 | vos_mem_copy(max_tx_params->selfStaMacAddr, |
| 786 | command->u.set_tx_max_pwr.self_sta_mac_addr, |
| 787 | SIR_MAC_ADDR_LENGTH); |
| 788 | max_tx_params->power = |
| 789 | command->u.set_tx_max_pwr.power; |
| 790 | |
| 791 | msg.type = WDA_SET_MAX_TX_POWER_REQ; |
| 792 | msg.reserved = 0; |
| 793 | msg.bodyptr = max_tx_params; |
| 794 | |
| 795 | if(VOS_STATUS_SUCCESS != |
| 796 | vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 797 | { |
| 798 | smsLog(pMac, LOGE, |
| 799 | FL("Not able to post WDA_SET_MAX_TX_POWER_REQ message to WDA")); |
| 800 | vos_mem_free(max_tx_params); |
| 801 | return eHAL_STATUS_FAILURE; |
| 802 | } |
| 803 | return eHAL_STATUS_SUCCESS; |
| 804 | } |
| 805 | |
Padma, Santhosh Kumar | 98b5d25 | 2016-10-17 17:30:41 +0530 | [diff] [blame] | 806 | /** |
| 807 | * sme_process_set_max_tx_power_per_band() - Set the Maximum Transmit Power |
| 808 | * specific to band dynamically |
| 809 | * @mac_ctx: mac context |
| 810 | * @command: cmd param containing band, and power in db |
| 811 | * |
| 812 | * Set the maximum transmit power dynamically per band |
| 813 | * |
| 814 | * Return: eHalStatus |
| 815 | */ |
| 816 | eHalStatus sme_process_set_max_tx_power_per_band(tpAniSirGlobal mac_ctx, |
| 817 | tSmeCmd *command) |
| 818 | { |
| 819 | vos_msg_t msg; |
| 820 | tMaxTxPowerPerBandParams *max_tx_params_per_band; |
| 821 | |
| 822 | max_tx_params_per_band = |
| 823 | vos_mem_malloc(sizeof(*max_tx_params_per_band)); |
| 824 | if (max_tx_params_per_band == NULL) { |
| 825 | smsLog(mac_ctx, LOGE, |
| 826 | FL("fail to allocate memory")); |
| 827 | return eHAL_STATUS_FAILURE; |
| 828 | } |
| 829 | |
| 830 | max_tx_params_per_band->bandInfo = |
| 831 | command->u.set_tx_max_pwr_per_band.band; |
| 832 | max_tx_params_per_band->power = |
| 833 | command->u.set_tx_max_pwr_per_band.power; |
| 834 | |
| 835 | msg.type = WDA_SET_MAX_TX_POWER_PER_BAND_REQ; |
| 836 | msg.reserved = 0; |
| 837 | msg.bodyptr = max_tx_params_per_band; |
| 838 | |
| 839 | if (VOS_STATUS_SUCCESS != |
| 840 | vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { |
| 841 | smsLog(mac_ctx, LOGE, |
| 842 | FL("Unable to post message to WDA")); |
| 843 | vos_mem_free(max_tx_params_per_band); |
| 844 | return eHAL_STATUS_FAILURE; |
| 845 | } |
| 846 | return eHAL_STATUS_SUCCESS; |
| 847 | } |
| 848 | |
Padma, Santhosh Kumar | 11567cd | 2016-11-10 18:14:53 +0530 | [diff] [blame] | 849 | |
| 850 | /** |
| 851 | * sme_process_update_channel_list() - Update channel list |
| 852 | * @mac_ctx: mac context |
| 853 | * @command: cmd param containing band, and power in db |
| 854 | * |
| 855 | * Return: eHalStatus |
| 856 | */ |
| 857 | eHalStatus sme_process_update_channel_list(tpAniSirGlobal mac_ctx, |
| 858 | tSmeCmd *command) |
| 859 | { |
| 860 | vos_msg_t msg; |
| 861 | |
| 862 | msg.type = WDA_UPDATE_CHAN_LIST_REQ; |
| 863 | msg.reserved = 0; |
| 864 | msg.bodyptr = command->u.chan_list; |
| 865 | |
| 866 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 867 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); |
| 868 | |
| 869 | if (VOS_STATUS_SUCCESS != |
| 870 | vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { |
| 871 | smsLog(mac_ctx, LOGE, |
| 872 | FL("Unable to post message to WDA")); |
| 873 | vos_mem_free(command->u.chan_list); |
| 874 | return eHAL_STATUS_FAILURE; |
| 875 | } |
| 876 | return eHAL_STATUS_SUCCESS; |
| 877 | } |
| 878 | |
Srinivas Dasari | a3f11c0 | 2015-03-20 13:15:20 +0530 | [diff] [blame] | 879 | static void smeProcessNanReq(tpAniSirGlobal pMac, tSmeCmd *pCommand ) |
| 880 | { |
| 881 | tSirMsgQ msgQ; |
| 882 | tSirRetStatus retCode = eSIR_SUCCESS; |
| 883 | |
| 884 | msgQ.type = WDA_NAN_REQUEST; |
| 885 | msgQ.reserved = 0; |
| 886 | msgQ.bodyptr = pCommand->u.pNanReq; |
| 887 | msgQ.bodyval = 0; |
| 888 | |
| 889 | retCode = wdaPostCtrlMsg( pMac, &msgQ ); |
| 890 | if( eSIR_SUCCESS != retCode) |
| 891 | { |
| 892 | vos_mem_free(pCommand->u.pNanReq); |
| 893 | smsLog( pMac, LOGE, |
| 894 | FL("Posting WDA_NAN_REQUEST to WDA failed, reason=%X"), |
| 895 | retCode ); |
| 896 | } |
| 897 | else |
| 898 | { |
| 899 | smsLog(pMac, LOG1, FL("posted WDA_NAN_REQUEST command")); |
| 900 | } |
| 901 | } |
| 902 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 903 | tANI_BOOLEAN smeProcessCommand( tpAniSirGlobal pMac ) |
| 904 | { |
| 905 | tANI_BOOLEAN fContinue = eANI_BOOLEAN_FALSE; |
| 906 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 907 | tListElem *pEntry; |
| 908 | tSmeCmd *pCommand; |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 909 | tListElem *pSmeEntry; |
| 910 | tSmeCmd *pSmeCommand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 911 | eSmeCommandType pmcCommand = eSmeNoCommand; |
| 912 | |
| 913 | // if the ActiveList is empty, then nothing is active so we can process a |
| 914 | // pending command... |
| 915 | //alwasy lock active list before locking pending list |
| 916 | csrLLLock( &pMac->sme.smeCmdActiveList ); |
| 917 | if ( csrLLIsListEmpty( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ) ) |
| 918 | { |
| 919 | if(!csrLLIsListEmpty(&pMac->sme.smeCmdPendingList, LL_ACCESS_LOCK)) |
| 920 | { |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 921 | /* If scan command is pending in the smeScanCmdActive list |
| 922 | * then pick the command from smeCmdPendingList which is |
| 923 | * not matching with the scan command session id. |
| 924 | * At any point of time only one command will be allowed |
| 925 | * on a single session. */ |
| 926 | if ((pMac->fScanOffload) && |
| 927 | (!csrLLIsListEmpty(&pMac->sme.smeScanCmdActiveList, |
| 928 | LL_ACCESS_LOCK))) |
| 929 | { |
| 930 | pSmeEntry = csrLLPeekHead(&pMac->sme.smeScanCmdActiveList, |
| 931 | LL_ACCESS_LOCK); |
| 932 | if (pSmeEntry) |
| 933 | { |
| 934 | pSmeCommand = GET_BASE_ADDR(pSmeEntry, tSmeCmd, Link); |
| 935 | |
| 936 | pEntry = csrGetCmdToProcess(pMac, |
| 937 | &pMac->sme.smeCmdPendingList, |
| 938 | pSmeCommand->sessionId, |
| 939 | LL_ACCESS_LOCK); |
| 940 | goto sme_process_cmd; |
| 941 | } |
| 942 | } |
| 943 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 944 | //Peek the command |
| 945 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdPendingList, LL_ACCESS_LOCK ); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 946 | sme_process_cmd: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 947 | if( pEntry ) |
| 948 | { |
| 949 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 950 | |
Abhishek Singh | f4669da | 2014-05-26 15:07:49 +0530 | [diff] [blame] | 951 | /* Allow only disconnect command |
| 952 | * in wait-for-key state until setKey is through. |
| 953 | */ |
| 954 | if( CSR_IS_WAIT_FOR_KEY( pMac, pCommand->sessionId ) && |
| 955 | !CSR_IS_DISCONNECT_COMMAND( pCommand ) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 956 | { |
| 957 | if( !CSR_IS_SET_KEY_COMMAND( pCommand ) ) |
| 958 | { |
| 959 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
Abhishek Singh | f4669da | 2014-05-26 15:07:49 +0530 | [diff] [blame] | 960 | smsLog(pMac, LOGE, FL("SessionId %d: Cannot process " |
| 961 | "command(%d) while waiting for key"), |
| 962 | pCommand->sessionId, pCommand->command); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 963 | fContinue = eANI_BOOLEAN_FALSE; |
| 964 | goto sme_process_scan_queue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 965 | } |
| 966 | } |
| 967 | pmcCommand = smeIsFullPowerNeeded( pMac, pCommand ); |
| 968 | if( eSmeDropCommand == pmcCommand ) |
| 969 | { |
| 970 | //This command is not ok for current PMC state |
| 971 | if( csrLLRemoveEntry( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_LOCK ) ) |
| 972 | { |
| 973 | smeAbortCommand( pMac, pCommand, eANI_BOOLEAN_FALSE ); |
| 974 | } |
| 975 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 976 | //tell caller to continue |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 977 | fContinue = eANI_BOOLEAN_TRUE; |
| 978 | goto sme_process_scan_queue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 979 | } |
| 980 | else if( eSmeNoCommand != pmcCommand ) |
| 981 | { |
| 982 | tExitBmpsInfo exitBmpsInfo; |
| 983 | void *pv = NULL; |
| 984 | tANI_U32 size = 0; |
| 985 | tSmeCmd *pPmcCmd = NULL; |
| 986 | |
| 987 | if( eSmeCommandExitBmps == pmcCommand ) |
| 988 | { |
| 989 | exitBmpsInfo.exitBmpsReason = eSME_REASON_OTHER; |
| 990 | pv = (void *)&exitBmpsInfo; |
| 991 | size = sizeof(tExitBmpsInfo); |
| 992 | } |
| 993 | //pmcCommand has to be one of the exit power save command |
| 994 | status = pmcPrepareCommand( pMac, pmcCommand, pv, size, &pPmcCmd ); |
| 995 | if( HAL_STATUS_SUCCESS( status ) && pPmcCmd ) |
| 996 | { |
Abhishek Singh | 631dd36 | 2015-07-08 10:46:24 +0530 | [diff] [blame] | 997 | /* Set the time out to 30 sec */ |
| 998 | pMac->sme.smeCmdActiveList.cmdTimeoutDuration = |
| 999 | CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1000 | //Force this command to wake up the chip |
| 1001 | csrLLInsertHead( &pMac->sme.smeCmdActiveList, &pPmcCmd->Link, LL_ACCESS_NOLOCK ); |
Padma, Santhosh Kumar | 0a35058 | 2015-06-12 15:23:49 +0530 | [diff] [blame] | 1002 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 1003 | TRACE_CODE_SME_COMMAND,pPmcCmd->sessionId, |
| 1004 | pPmcCmd->command)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1005 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1006 | fContinue = pmcProcessCommand( pMac, pPmcCmd ); |
| 1007 | if( fContinue ) |
| 1008 | { |
| 1009 | //The command failed, remove it |
| 1010 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, &pPmcCmd->Link, LL_ACCESS_NOLOCK ) ) |
| 1011 | { |
| 1012 | pmcReleaseCommand( pMac, pPmcCmd ); |
| 1013 | } |
| 1014 | } |
| 1015 | } |
| 1016 | else |
| 1017 | { |
| 1018 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1019 | smsLog( pMac, LOGE, FL( "Cannot issue command(0x%X) to wake up the chip. Status = %d"), pmcCommand, status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1020 | //Let it retry |
| 1021 | fContinue = eANI_BOOLEAN_TRUE; |
| 1022 | } |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 1023 | goto sme_process_scan_queue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1024 | } |
| 1025 | if ( csrLLRemoveEntry( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_LOCK ) ) |
| 1026 | { |
| 1027 | // we can reuse the pCommand |
| 1028 | |
Abhishek Singh | 50b7804 | 2015-08-06 13:59:09 +0530 | [diff] [blame] | 1029 | /* For ROC set timeot to 30 *3 as Supplicant can retry |
| 1030 | * P2P Invitation Request 120 times with 500ms interval. |
| 1031 | * For roam command set timeout to 30 * 2 sec. |
Abhishek Singh | 631dd36 | 2015-07-08 10:46:24 +0530 | [diff] [blame] | 1032 | * There are cases where we try to connect to different |
| 1033 | * APs with same SSID one by one until sucessfully conneted |
| 1034 | * and thus roam command might take more time if connection |
| 1035 | * is rejected by too many APs. |
| 1036 | */ |
Abhishek Singh | 50b7804 | 2015-08-06 13:59:09 +0530 | [diff] [blame] | 1037 | if (eSmeCommandRemainOnChannel == pCommand->command) |
| 1038 | pMac->sme.smeCmdActiveList.cmdTimeoutDuration = |
| 1039 | CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE * 3; |
| 1040 | else if ((eSmeCommandRoam == pCommand->command) && |
Abhishek Singh | 631dd36 | 2015-07-08 10:46:24 +0530 | [diff] [blame] | 1041 | (eCsrHddIssued == pCommand->u.roamCmd.roamReason)) |
| 1042 | pMac->sme.smeCmdActiveList.cmdTimeoutDuration = |
| 1043 | CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE * 2; |
| 1044 | else |
| 1045 | pMac->sme.smeCmdActiveList.cmdTimeoutDuration = |
| 1046 | CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1047 | // Insert the command onto the ActiveList... |
| 1048 | csrLLInsertHead( &pMac->sme.smeCmdActiveList, &pCommand->Link, LL_ACCESS_NOLOCK ); |
| 1049 | |
Rashmi Ramanna | 68b309c | 2014-05-20 11:52:22 +0530 | [diff] [blame] | 1050 | if( pMac->deferImps ) |
| 1051 | { |
| 1052 | /* IMPS timer is already running so stop it and |
| 1053 | * it will get restarted when no command is pending |
| 1054 | */ |
| 1055 | csrScanStopIdleScanTimer( pMac ); |
| 1056 | pMac->scan.fRestartIdleScan = eANI_BOOLEAN_TRUE; |
| 1057 | pMac->deferImps = eANI_BOOLEAN_FALSE; |
| 1058 | } |
| 1059 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1060 | // .... and process the command. |
| 1061 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1062 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1063 | TRACE_CODE_SME_COMMAND, pCommand->sessionId, pCommand->command)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1064 | switch ( pCommand->command ) |
| 1065 | { |
| 1066 | |
| 1067 | case eSmeCommandScan: |
| 1068 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1069 | status = csrProcessScanCommand( pMac, pCommand ); |
| 1070 | break; |
| 1071 | |
| 1072 | case eSmeCommandRoam: |
| 1073 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1074 | status = csrRoamProcessCommand( pMac, pCommand ); |
Madan Mohan Koyyalamudi | 59efbe0 | 2013-01-10 15:38:42 -0800 | [diff] [blame] | 1075 | if(!HAL_STATUS_SUCCESS(status)) |
| 1076 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1077 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Madan Mohan Koyyalamudi | 59efbe0 | 2013-01-10 15:38:42 -0800 | [diff] [blame] | 1078 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 1079 | { |
| 1080 | csrReleaseCommandRoam( pMac, pCommand ); |
| 1081 | } |
| 1082 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1083 | break; |
| 1084 | |
| 1085 | case eSmeCommandWmStatusChange: |
| 1086 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1087 | csrRoamProcessWmStatusChangeCommand(pMac, pCommand); |
| 1088 | break; |
| 1089 | |
| 1090 | case eSmeCommandSetKey: |
| 1091 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1092 | status = csrRoamProcessSetKeyCommand( pMac, pCommand ); |
| 1093 | if(!HAL_STATUS_SUCCESS(status)) |
| 1094 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1095 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1096 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 1097 | { |
| 1098 | csrReleaseCommandSetKey( pMac, pCommand ); |
| 1099 | } |
| 1100 | } |
| 1101 | break; |
| 1102 | |
| 1103 | case eSmeCommandRemoveKey: |
| 1104 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1105 | status = csrRoamProcessRemoveKeyCommand( pMac, pCommand ); |
| 1106 | if(!HAL_STATUS_SUCCESS(status)) |
| 1107 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1108 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1109 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 1110 | { |
| 1111 | csrReleaseCommandRemoveKey( pMac, pCommand ); |
| 1112 | } |
| 1113 | } |
| 1114 | break; |
| 1115 | |
| 1116 | case eSmeCommandAddStaSession: |
| 1117 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1118 | csrProcessAddStaSessionCommand( pMac, pCommand ); |
| 1119 | break; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1120 | case eSmeCommandDelStaSession: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1121 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1122 | csrProcessDelStaSessionCommand( pMac, pCommand ); |
| 1123 | break; |
Siddharth Bhal | d8a95e8 | 2015-02-12 20:14:52 +0530 | [diff] [blame] | 1124 | case eSmeCommandMacSpoofRequest: |
| 1125 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1126 | csrProcessMacAddrSpoofCommand( pMac, pCommand ); |
Siddharth Bhal | c3a39b4 | 2015-02-26 15:07:54 +0530 | [diff] [blame] | 1127 | //We need to re-run the command |
| 1128 | fContinue = eANI_BOOLEAN_TRUE; |
| 1129 | |
Siddharth Bhal | d8a95e8 | 2015-02-12 20:14:52 +0530 | [diff] [blame] | 1130 | // No Rsp expected, free cmd from active list |
| 1131 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 1132 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 1133 | { |
| 1134 | csrReleaseCommand( pMac, pCommand ); |
| 1135 | } |
| 1136 | |
| 1137 | break; |
Siddharth Bhal | 6424617 | 2015-02-27 01:04:37 +0530 | [diff] [blame] | 1138 | case eSmeCommandGetFrameLogRequest: |
| 1139 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1140 | csrProcessGetFrameLogCommand( pMac, pCommand ); |
| 1141 | //We need to re-run the command |
| 1142 | fContinue = eANI_BOOLEAN_TRUE; |
| 1143 | // No Rsp expected, free cmd from active list |
| 1144 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 1145 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 1146 | { |
| 1147 | csrReleaseCommand( pMac, pCommand ); |
| 1148 | } |
| 1149 | break; |
Abhishek Singh | 99a31be | 2015-12-10 10:37:44 +0530 | [diff] [blame] | 1150 | case eSmeCommandSetMaxTxPower: |
| 1151 | csrLLUnlock(&pMac->sme.smeCmdActiveList); |
| 1152 | sme_process_set_max_tx_power(pMac, pCommand); |
| 1153 | /* We need to re-run the command */ |
| 1154 | fContinue = eANI_BOOLEAN_TRUE; |
| 1155 | /* No Rsp expected, free cmd from active list */ |
| 1156 | if(csrLLRemoveEntry(&pMac->sme.smeCmdActiveList, |
| 1157 | &pCommand->Link, LL_ACCESS_LOCK)) |
| 1158 | { |
| 1159 | csrReleaseCommand(pMac, pCommand); |
| 1160 | } |
| 1161 | break; |
Padma, Santhosh Kumar | 98b5d25 | 2016-10-17 17:30:41 +0530 | [diff] [blame] | 1162 | case eSmeCommandSetMaxTxPowerPerBand: |
| 1163 | csrLLUnlock(&pMac->sme.smeCmdActiveList); |
| 1164 | sme_process_set_max_tx_power_per_band(pMac, |
| 1165 | pCommand); |
| 1166 | /* We need to re-run the command */ |
| 1167 | fContinue = eANI_BOOLEAN_TRUE; |
| 1168 | /* No Rsp expected, free cmd from active list */ |
| 1169 | if (csrLLRemoveEntry(&pMac->sme.smeCmdActiveList, |
| 1170 | &pCommand->Link, LL_ACCESS_LOCK)) { |
| 1171 | csrReleaseCommand(pMac, pCommand); |
| 1172 | } |
| 1173 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1174 | |
Padma, Santhosh Kumar | 11567cd | 2016-11-10 18:14:53 +0530 | [diff] [blame] | 1175 | case eSmeCommandUpdateChannelList: |
| 1176 | csrLLUnlock(&pMac->sme.smeCmdActiveList); |
| 1177 | sme_process_update_channel_list(pMac, pCommand); |
| 1178 | if (csrLLRemoveEntry(&pMac->sme.smeCmdActiveList, |
| 1179 | &pCommand->Link, LL_ACCESS_LOCK)) { |
| 1180 | csrReleaseCommand(pMac, pCommand); |
| 1181 | } |
| 1182 | smsLog(pMac, LOG1, |
| 1183 | FL("eSmeCommandUpdateChannelList processed")); |
| 1184 | fContinue = eANI_BOOLEAN_TRUE; |
| 1185 | break; |
| 1186 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1187 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1188 | case eSmeCommandOemDataReq: |
| 1189 | csrLLUnlock(&pMac->sme.smeCmdActiveList); |
| 1190 | oemData_ProcessOemDataReqCommand(pMac, pCommand); |
| 1191 | break; |
| 1192 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1193 | case eSmeCommandRemainOnChannel: |
| 1194 | csrLLUnlock(&pMac->sme.smeCmdActiveList); |
| 1195 | p2pProcessRemainOnChannelCmd(pMac, pCommand); |
| 1196 | break; |
| 1197 | case eSmeCommandNoAUpdate: |
| 1198 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1199 | p2pProcessNoAReq(pMac,pCommand); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1200 | case eSmeCommandEnterImps: |
| 1201 | case eSmeCommandExitImps: |
| 1202 | case eSmeCommandEnterBmps: |
| 1203 | case eSmeCommandExitBmps: |
| 1204 | case eSmeCommandEnterUapsd: |
| 1205 | case eSmeCommandExitUapsd: |
| 1206 | case eSmeCommandEnterWowl: |
| 1207 | case eSmeCommandExitWowl: |
| 1208 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1209 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 1210 | if( fContinue ) |
| 1211 | { |
| 1212 | //The command failed, remove it |
| 1213 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 1214 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 1215 | { |
| 1216 | pmcReleaseCommand( pMac, pCommand ); |
| 1217 | } |
| 1218 | } |
| 1219 | break; |
| 1220 | |
| 1221 | //Treat standby differently here because caller may not be able to handle |
| 1222 | //the failure so we do our best here |
| 1223 | case eSmeCommandEnterStandby: |
| 1224 | if( csrIsConnStateDisconnected( pMac, pCommand->sessionId ) ) |
| 1225 | { |
| 1226 | //It can continue |
| 1227 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1228 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 1229 | if( fContinue ) |
| 1230 | { |
| 1231 | //The command failed, remove it |
| 1232 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 1233 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 1234 | { |
| 1235 | pmcReleaseCommand( pMac, pCommand ); |
| 1236 | } |
| 1237 | } |
| 1238 | } |
| 1239 | else |
| 1240 | { |
| 1241 | //Need to issue a disconnect first before processing this command |
| 1242 | tSmeCmd *pNewCmd; |
| 1243 | |
| 1244 | //We need to re-run the command |
| 1245 | fContinue = eANI_BOOLEAN_TRUE; |
| 1246 | //Pull off the standby command first |
| 1247 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 1248 | &pCommand->Link, LL_ACCESS_NOLOCK ) ) |
| 1249 | { |
| 1250 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1251 | //Need to call CSR function here because the disconnect command |
| 1252 | //is handled by CSR |
| 1253 | pNewCmd = csrGetCommandBuffer( pMac ); |
| 1254 | if( NULL != pNewCmd ) |
| 1255 | { |
| 1256 | //Put the standby command to the head of the pending list first |
| 1257 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pCommand->Link, |
| 1258 | LL_ACCESS_LOCK ); |
| 1259 | pNewCmd->command = eSmeCommandRoam; |
| 1260 | pNewCmd->u.roamCmd.roamReason = eCsrForcedDisassoc; |
| 1261 | //Put the disassoc command before the standby command |
| 1262 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pNewCmd->Link, |
| 1263 | LL_ACCESS_LOCK ); |
| 1264 | } |
| 1265 | else |
| 1266 | { |
| 1267 | //Continue the command here |
| 1268 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 1269 | if( fContinue ) |
| 1270 | { |
| 1271 | //The command failed, remove it |
| 1272 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 1273 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 1274 | { |
| 1275 | pmcReleaseCommand( pMac, pCommand ); |
| 1276 | } |
| 1277 | } |
| 1278 | } |
| 1279 | } |
| 1280 | else |
| 1281 | { |
| 1282 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1283 | smsLog( pMac, LOGE, FL(" failed to remove standby command") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1284 | VOS_ASSERT(0); |
| 1285 | } |
| 1286 | } |
| 1287 | break; |
Hanumantha Reddy Pothula | 28b1e65 | 2015-02-02 21:10:13 +0530 | [diff] [blame] | 1288 | case eSmeCommandPnoReq: |
| 1289 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1290 | status = smeProcessPnoCommand(pMac, pCommand); |
| 1291 | if (!HAL_STATUS_SUCCESS(status)){ |
| 1292 | smsLog(pMac, LOGE, |
| 1293 | FL("failed to post SME PNO SCAN %d"), status); |
| 1294 | } |
Mahesh A Saptasagar | bafce5a | 2015-02-26 12:29:22 +0530 | [diff] [blame] | 1295 | //We need to re-run the command |
| 1296 | fContinue = eANI_BOOLEAN_TRUE; |
| 1297 | |
Hanumantha Reddy Pothula | 28b1e65 | 2015-02-02 21:10:13 +0530 | [diff] [blame] | 1298 | if (csrLLRemoveEntry(&pMac->sme.smeCmdActiveList, |
| 1299 | &pCommand->Link, LL_ACCESS_LOCK)) |
| 1300 | { |
| 1301 | csrReleaseCommand(pMac, pCommand); |
| 1302 | } |
| 1303 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1304 | case eSmeCommandAddTs: |
| 1305 | case eSmeCommandDelTs: |
| 1306 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1307 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1308 | fContinue = qosProcessCommand( pMac, pCommand ); |
| 1309 | if( fContinue ) |
| 1310 | { |
| 1311 | //The command failed, remove it |
| 1312 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 1313 | &pCommand->Link, LL_ACCESS_NOLOCK ) ) |
| 1314 | { |
| 1315 | //#ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1316 | qosReleaseCommand( pMac, pCommand ); |
| 1317 | //#endif /* WLAN_MDM_CODE_REDUCTION_OPT*/ |
| 1318 | } |
| 1319 | } |
| 1320 | #endif |
| 1321 | break; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1322 | #ifdef FEATURE_WLAN_TDLS |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1323 | case eSmeCommandTdlsSendMgmt: |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1324 | case eSmeCommandTdlsAddPeer: |
| 1325 | case eSmeCommandTdlsDelPeer: |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1326 | case eSmeCommandTdlsLinkEstablish: |
Atul Mittal | c0f739f | 2014-07-31 13:47:47 +0530 | [diff] [blame] | 1327 | case eSmeCommandTdlsChannelSwitch: // tdlsoffchan |
Abhishek Singh | f50bad8 | 2016-03-02 15:12:44 +0530 | [diff] [blame] | 1328 | smsLog(pMac, LOG1, |
| 1329 | FL("sending TDLS Command 0x%x to PE"), |
| 1330 | pCommand->command); |
| 1331 | csrLLUnlock(&pMac->sme.smeCmdActiveList); |
| 1332 | status = csrTdlsProcessCmd(pMac, pCommand); |
| 1333 | if(!HAL_STATUS_SUCCESS(status)) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1334 | { |
Abhishek Singh | f50bad8 | 2016-03-02 15:12:44 +0530 | [diff] [blame] | 1335 | if(csrLLRemoveEntry(&pMac->sme.smeCmdActiveList, |
| 1336 | &pCommand->Link, LL_ACCESS_LOCK)) |
| 1337 | csrReleaseCommand(pMac, pCommand); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1338 | } |
| 1339 | break ; |
| 1340 | #endif |
Srinivas Dasari | a3f11c0 | 2015-03-20 13:15:20 +0530 | [diff] [blame] | 1341 | case eSmeCommandNanReq: |
| 1342 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1343 | smeProcessNanReq( pMac, pCommand ); |
| 1344 | if (csrLLRemoveEntry(&pMac->sme.smeCmdActiveList, |
| 1345 | &pCommand->Link, LL_ACCESS_LOCK)) |
| 1346 | { |
| 1347 | csrReleaseCommand(pMac, pCommand); |
| 1348 | } |
| 1349 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 1350 | "eSmeCommandNanReq processed"); |
| 1351 | fContinue = eANI_BOOLEAN_TRUE; |
| 1352 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1353 | |
| 1354 | default: |
| 1355 | //something is wrong |
| 1356 | //remove it from the active list |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1357 | smsLog(pMac, LOGE, " csrProcessCommand processes an unknown command %d", pCommand->command); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1358 | pEntry = csrLLRemoveHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ); |
| 1359 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1360 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 1361 | smeReleaseCommand( pMac, pCommand ); |
| 1362 | status = eHAL_STATUS_FAILURE; |
| 1363 | break; |
| 1364 | } |
| 1365 | if(!HAL_STATUS_SUCCESS(status)) |
| 1366 | { |
| 1367 | fContinue = eANI_BOOLEAN_TRUE; |
| 1368 | } |
| 1369 | }//if(pEntry) |
| 1370 | else |
| 1371 | { |
| 1372 | //This is odd. Some one else pull off the command. |
| 1373 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1374 | } |
| 1375 | } |
| 1376 | else |
| 1377 | { |
| 1378 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1379 | } |
| 1380 | } |
| 1381 | else |
| 1382 | { |
| 1383 | //No command waiting |
| 1384 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1385 | //This is only used to restart an idle mode scan, it means at least one other idle scan has finished. |
| 1386 | if(pMac->scan.fRestartIdleScan && eANI_BOOLEAN_FALSE == pMac->scan.fCancelIdleScan) |
| 1387 | { |
| 1388 | tANI_U32 nTime = 0; |
| 1389 | |
| 1390 | pMac->scan.fRestartIdleScan = eANI_BOOLEAN_FALSE; |
| 1391 | if(!HAL_STATUS_SUCCESS(csrScanTriggerIdleScan(pMac, &nTime))) |
| 1392 | { |
| 1393 | csrScanStartIdleScanTimer(pMac, nTime); |
| 1394 | } |
| 1395 | } |
| 1396 | } |
| 1397 | } |
| 1398 | else { |
| 1399 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1400 | } |
| 1401 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 1402 | sme_process_scan_queue: |
| 1403 | if (pMac->fScanOffload && !(smeProcessScanQueue(pMac))) |
| 1404 | fContinue = eANI_BOOLEAN_FALSE; |
| 1405 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1406 | return ( fContinue ); |
| 1407 | } |
| 1408 | |
| 1409 | void smeProcessPendingQueue( tpAniSirGlobal pMac ) |
| 1410 | { |
| 1411 | while( smeProcessCommand( pMac ) ); |
| 1412 | } |
| 1413 | |
| 1414 | |
| 1415 | tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac) |
| 1416 | { |
| 1417 | return ( !csrLLIsListEmpty( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ) || |
| 1418 | !csrLLIsListEmpty(&pMac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK) ); |
| 1419 | } |
| 1420 | |
| 1421 | |
| 1422 | |
| 1423 | //Global APIs |
| 1424 | |
| 1425 | /*-------------------------------------------------------------------------- |
| 1426 | |
| 1427 | \brief sme_Open() - Initialze all SME modules and put them at idle state |
| 1428 | |
| 1429 | The function initializes each module inside SME, PMC, CCM, CSR, etc. . Upon |
| 1430 | successfully return, all modules are at idle state ready to start. |
| 1431 | |
| 1432 | smeOpen must be called before any other SME APIs can be involved. |
| 1433 | smeOpen must be called after macOpen. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1434 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1435 | \param hHal - The handle returned by macOpen. |
| 1436 | |
| 1437 | \return eHAL_STATUS_SUCCESS - SME is successfully initialized. |
| 1438 | |
| 1439 | Other status means SME is failed to be initialized |
| 1440 | \sa |
| 1441 | |
| 1442 | --------------------------------------------------------------------------*/ |
| 1443 | eHalStatus sme_Open(tHalHandle hHal) |
| 1444 | { |
| 1445 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1446 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1447 | |
| 1448 | do { |
| 1449 | pMac->sme.state = SME_STATE_STOP; |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 1450 | pMac->sme.currDeviceMode = VOS_STA_MODE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1451 | if( !VOS_IS_STATUS_SUCCESS( vos_lock_init( &pMac->sme.lkSmeGlobalLock ) ) ) |
| 1452 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1453 | smsLog( pMac, LOGE, "sme_Open failed init lock" ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1454 | status = eHAL_STATUS_FAILURE; |
| 1455 | break; |
| 1456 | } |
| 1457 | |
| 1458 | status = ccmOpen(hHal); |
| 1459 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1460 | smsLog( pMac, LOGE, |
| 1461 | "ccmOpen failed during initialization with status=%d", status ); |
| 1462 | break; |
| 1463 | } |
| 1464 | |
| 1465 | status = csrOpen(pMac); |
| 1466 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1467 | smsLog( pMac, LOGE, |
| 1468 | "csrOpen failed during initialization with status=%d", status ); |
| 1469 | break; |
| 1470 | } |
| 1471 | |
| 1472 | status = pmcOpen(hHal); |
| 1473 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1474 | smsLog( pMac, LOGE, |
| 1475 | "pmcOpen failed during initialization with status=%d", status ); |
| 1476 | break; |
| 1477 | } |
| 1478 | |
Gopichand Nakkala | 34d1b06 | 2013-03-19 15:28:33 -0700 | [diff] [blame] | 1479 | #ifdef FEATURE_WLAN_TDLS |
| 1480 | pMac->isTdlsPowerSaveProhibited = 0; |
| 1481 | #endif |
| 1482 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1483 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1484 | status = sme_QosOpen(pMac); |
| 1485 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1486 | smsLog( pMac, LOGE, |
| 1487 | "Qos open failed during initialization with status=%d", status ); |
| 1488 | break; |
| 1489 | } |
| 1490 | |
| 1491 | status = btcOpen(pMac); |
| 1492 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1493 | smsLog( pMac, LOGE, |
| 1494 | "btcOpen open failed during initialization with status=%d", status ); |
| 1495 | break; |
| 1496 | } |
| 1497 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1498 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1499 | status = oemData_OemDataReqOpen(pMac); |
| 1500 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1501 | smsLog(pMac, LOGE, |
| 1502 | "oemData_OemDataReqOpen failed during initialization with status=%d", status ); |
| 1503 | break; |
| 1504 | } |
| 1505 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1506 | |
| 1507 | if(!HAL_STATUS_SUCCESS((status = initSmeCmdList(pMac)))) |
| 1508 | break; |
| 1509 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1510 | { |
| 1511 | v_PVOID_t pvosGCtx = vos_get_global_context(VOS_MODULE_ID_SAP, NULL); |
| 1512 | if ( NULL == pvosGCtx ){ |
| 1513 | smsLog( pMac, LOGE, "WLANSAP_Open open failed during initialization"); |
| 1514 | status = eHAL_STATUS_FAILURE; |
| 1515 | break; |
| 1516 | } |
| 1517 | |
| 1518 | status = WLANSAP_Open( pvosGCtx ); |
| 1519 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1520 | smsLog( pMac, LOGE, |
| 1521 | "WLANSAP_Open open failed during initialization with status=%d", status ); |
| 1522 | break; |
| 1523 | } |
| 1524 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1525 | #if defined WLAN_FEATURE_VOWIFI |
| 1526 | status = rrmOpen(pMac); |
| 1527 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1528 | smsLog( pMac, LOGE, |
| 1529 | "rrmOpen open failed during initialization with status=%d", status ); |
| 1530 | break; |
| 1531 | } |
| 1532 | #endif |
| 1533 | |
| 1534 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 1535 | sme_FTOpen(pMac); |
| 1536 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1537 | sme_p2pOpen(pMac); |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1538 | smeTraceInit(pMac); |
Padma, Santhosh Kumar | 9093b20 | 2015-07-21 15:37:38 +0530 | [diff] [blame] | 1539 | sme_register_debug_callback(); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1540 | |
| 1541 | }while (0); |
| 1542 | |
| 1543 | return status; |
| 1544 | } |
| 1545 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1546 | /*-------------------------------------------------------------------------- |
| 1547 | |
| 1548 | \brief sme_set11dinfo() - Set the 11d information about valid channels |
| 1549 | and there power using information from nvRAM |
| 1550 | This function is called only for AP. |
| 1551 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1552 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1553 | |
| 1554 | \param hHal - The handle returned by macOpen. |
| 1555 | \Param pSmeConfigParams - a pointer to a caller allocated object of |
| 1556 | typedef struct _smeConfigParams. |
| 1557 | |
| 1558 | \return eHAL_STATUS_SUCCESS - SME update the config parameters successfully. |
| 1559 | |
| 1560 | Other status means SME is failed to update the config parameters. |
| 1561 | \sa |
| 1562 | --------------------------------------------------------------------------*/ |
| 1563 | |
| 1564 | eHalStatus sme_set11dinfo(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) |
| 1565 | { |
| 1566 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1567 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1568 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1569 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1570 | TRACE_CODE_SME_RX_HDD_MSG_SET_11DINFO, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1571 | if (NULL == pSmeConfigParams ) { |
| 1572 | smsLog( pMac, LOGE, |
| 1573 | "Empty config param structure for SME, nothing to update"); |
| 1574 | return status; |
| 1575 | } |
| 1576 | |
| 1577 | status = csrSetChannels(hHal, &pSmeConfigParams->csrConfig ); |
| 1578 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1579 | smsLog( pMac, LOGE, "csrChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1580 | status ); |
| 1581 | } |
| 1582 | return status; |
| 1583 | } |
| 1584 | |
| 1585 | /*-------------------------------------------------------------------------- |
| 1586 | |
| 1587 | \brief sme_getSoftApDomain() - Get the current regulatory domain of softAp. |
| 1588 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1589 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1590 | |
| 1591 | \param hHal - The handle returned by HostapdAdapter. |
| 1592 | \Param v_REGDOMAIN_t - The current Regulatory Domain requested for SoftAp. |
| 1593 | |
| 1594 | \return eHAL_STATUS_SUCCESS - SME successfully completed the request. |
| 1595 | |
| 1596 | Other status means, failed to get the current regulatory domain. |
| 1597 | \sa |
| 1598 | --------------------------------------------------------------------------*/ |
| 1599 | |
| 1600 | eHalStatus sme_getSoftApDomain(tHalHandle hHal, v_REGDOMAIN_t *domainIdSoftAp) |
| 1601 | { |
| 1602 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1603 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1604 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1605 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1606 | TRACE_CODE_SME_RX_HDD_MSG_GET_SOFTAP_DOMAIN, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1607 | if (NULL == domainIdSoftAp ) { |
| 1608 | smsLog( pMac, LOGE, "Uninitialized domain Id"); |
| 1609 | return status; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1610 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1611 | |
| 1612 | *domainIdSoftAp = pMac->scan.domainIdCurrent; |
| 1613 | status = eHAL_STATUS_SUCCESS; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1614 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1615 | return status; |
| 1616 | } |
| 1617 | |
| 1618 | |
| 1619 | eHalStatus sme_setRegInfo(tHalHandle hHal, tANI_U8 *apCntryCode) |
| 1620 | { |
| 1621 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1622 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1623 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1624 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1625 | TRACE_CODE_SME_RX_HDD_MSG_SET_REGINFO, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1626 | if (NULL == apCntryCode ) { |
| 1627 | smsLog( pMac, LOGE, "Empty Country Code, nothing to update"); |
| 1628 | return status; |
| 1629 | } |
| 1630 | |
| 1631 | status = csrSetRegInfo(hHal, apCntryCode ); |
| 1632 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1633 | smsLog( pMac, LOGE, "csrSetRegInfo failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1634 | status ); |
| 1635 | } |
| 1636 | return status; |
| 1637 | } |
| 1638 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1639 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 1640 | /*-------------------------------------------------------------------------- |
| 1641 | |
| 1642 | \brief sme_UpdateChannelConfig() - Update channel configuration in RIVA. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1643 | |
| 1644 | It is used at driver start up to inform RIVA of the default channel |
| 1645 | configuration. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1646 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1647 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1648 | |
| 1649 | \param hHal - The handle returned by macOpen. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1650 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1651 | \return eHAL_STATUS_SUCCESS - SME update the channel config successfully. |
| 1652 | |
| 1653 | Other status means SME is failed to update the channel config. |
| 1654 | \sa |
| 1655 | |
| 1656 | --------------------------------------------------------------------------*/ |
| 1657 | eHalStatus sme_UpdateChannelConfig(tHalHandle hHal) |
| 1658 | { |
| 1659 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1660 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1661 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1662 | TRACE_CODE_SME_RX_HDD_MSG_UPDATE_CHANNEL_CONFIG, NO_SESSION, 0)); |
| 1663 | pmcUpdateScanParams( pMac, &(pMac->roam.configParam), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1664 | &pMac->scan.base20MHzChannels, FALSE); |
| 1665 | return eHAL_STATUS_SUCCESS; |
| 1666 | } |
| 1667 | #endif // FEATURE_WLAN_SCAN_PNLO |
| 1668 | |
Abhishek Singh | f644b27 | 2014-08-21 02:59:39 +0530 | [diff] [blame] | 1669 | eHalStatus sme_UpdateChannelList(tHalHandle hHal) |
| 1670 | { |
| 1671 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1672 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1673 | |
| 1674 | status = csrUpdateChannelList(pMac); |
| 1675 | |
| 1676 | if (eHAL_STATUS_SUCCESS != status) |
| 1677 | { |
| 1678 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1679 | "failed to update the supported channel list"); |
| 1680 | } |
| 1681 | return status; |
| 1682 | } |
| 1683 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1684 | /*-------------------------------------------------------------------------- |
| 1685 | |
| 1686 | \brief sme_UpdateConfig() - Change configurations for all SME moduels |
| 1687 | |
| 1688 | The function updates some configuration for modules in SME, CCM, CSR, etc |
| 1689 | during SMEs close open sequence. |
| 1690 | |
| 1691 | Modules inside SME apply the new configuration at the next transaction. |
| 1692 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1693 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1694 | |
| 1695 | \param hHal - The handle returned by macOpen. |
| 1696 | \Param pSmeConfigParams - a pointer to a caller allocated object of |
| 1697 | typedef struct _smeConfigParams. |
| 1698 | |
| 1699 | \return eHAL_STATUS_SUCCESS - SME update the config parameters successfully. |
| 1700 | |
| 1701 | Other status means SME is failed to update the config parameters. |
| 1702 | \sa |
| 1703 | |
| 1704 | --------------------------------------------------------------------------*/ |
| 1705 | eHalStatus sme_UpdateConfig(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) |
| 1706 | { |
| 1707 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1708 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1709 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1710 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1711 | TRACE_CODE_SME_RX_HDD_MSG_UPDATE_CONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1712 | if (NULL == pSmeConfigParams ) { |
| 1713 | smsLog( pMac, LOGE, |
| 1714 | "Empty config param structure for SME, nothing to update"); |
| 1715 | return status; |
| 1716 | } |
| 1717 | |
| 1718 | status = csrChangeDefaultConfigParam(pMac, &pSmeConfigParams->csrConfig); |
| 1719 | |
| 1720 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1721 | smsLog( pMac, LOGE, "csrChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1722 | status ); |
| 1723 | } |
| 1724 | #if defined WLAN_FEATURE_P2P_INTERNAL |
| 1725 | status = p2pChangeDefaultConfigParam(pMac, &pSmeConfigParams->p2pConfig); |
| 1726 | |
| 1727 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1728 | smsLog( pMac, LOGE, "p2pChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1729 | status ); |
| 1730 | } |
| 1731 | #endif |
| 1732 | #if defined WLAN_FEATURE_VOWIFI |
| 1733 | status = rrmChangeDefaultConfigParam(hHal, &pSmeConfigParams->rrmConfig); |
| 1734 | |
| 1735 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1736 | smsLog( pMac, LOGE, "rrmChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1737 | status ); |
| 1738 | } |
| 1739 | #endif |
| 1740 | //For SOC, CFG is set before start |
| 1741 | //We don't want to apply global CFG in connect state because that may cause some side affect |
| 1742 | if( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1743 | csrIsAllSessionDisconnected( pMac) ) |
| 1744 | { |
| 1745 | csrSetGlobalCfgs(pMac); |
| 1746 | } |
| 1747 | |
Gopichand Nakkala | 86e4266 | 2013-06-11 17:44:11 +0530 | [diff] [blame] | 1748 | /* update the directed scan offload setting */ |
| 1749 | pMac->fScanOffload = pSmeConfigParams->fScanOffload; |
| 1750 | |
Madan Mohan Koyyalamudi | d89feb7 | 2013-07-31 15:47:12 +0530 | [diff] [blame] | 1751 | if (pMac->fScanOffload) |
| 1752 | { |
| 1753 | /* If scan offload is enabled then lim has allow the sending of |
| 1754 | scan request to firmware even in powersave mode. The firmware has |
| 1755 | to take care of exiting from power save mode */ |
| 1756 | status = ccmCfgSetInt(hHal, WNI_CFG_SCAN_IN_POWERSAVE, |
| 1757 | eANI_BOOLEAN_TRUE, NULL, eANI_BOOLEAN_FALSE); |
| 1758 | |
| 1759 | if (eHAL_STATUS_SUCCESS != status) |
| 1760 | { |
| 1761 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1762 | "Could not pass on WNI_CFG_SCAN_IN_POWERSAVE to CCM"); |
| 1763 | } |
| 1764 | } |
krunal soni | e9002db | 2013-11-25 14:24:17 -0800 | [diff] [blame] | 1765 | pMac->isCoalesingInIBSSAllowed = |
| 1766 | pSmeConfigParams->csrConfig.isCoalesingInIBSSAllowed; |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 1767 | pMac->fEnableDebugLog = pSmeConfigParams->fEnableDebugLog; |
Rashmi Ramanna | 68b309c | 2014-05-20 11:52:22 +0530 | [diff] [blame] | 1768 | pMac->fDeferIMPSTime = pSmeConfigParams->fDeferIMPSTime; |
Chandrasekaran, Manishekar | 5cb0acd | 2014-12-23 20:06:52 +0530 | [diff] [blame] | 1769 | pMac->fBtcEnableIndTimerVal = pSmeConfigParams->fBtcEnableIndTimerVal; |
Rashmi Ramanna | 68b309c | 2014-05-20 11:52:22 +0530 | [diff] [blame] | 1770 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1771 | return status; |
| 1772 | } |
| 1773 | |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 1774 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 1775 | void sme_ProcessGetGtkInfoRsp( tHalHandle hHal, |
| 1776 | tpSirGtkOffloadGetInfoRspParams pGtkOffloadGetInfoRsp) |
| 1777 | { |
| 1778 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1779 | |
| 1780 | if (NULL == pMac) |
| 1781 | { |
| 1782 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 1783 | "%s: pMac is null", __func__); |
| 1784 | return ; |
| 1785 | } |
| 1786 | if (pMac->pmc.GtkOffloadGetInfoCB == NULL) |
| 1787 | { |
| 1788 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1789 | "%s: HDD callback is null", __func__); |
| 1790 | return ; |
| 1791 | } |
| 1792 | pMac->pmc.GtkOffloadGetInfoCB(pMac->pmc.GtkOffloadGetInfoCBContext, |
| 1793 | pGtkOffloadGetInfoRsp); |
| 1794 | } |
| 1795 | #endif |
| 1796 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1797 | /* --------------------------------------------------------------------------- |
| 1798 | \fn sme_ChangeConfigParams |
| 1799 | \brief The SME API exposed for HDD to provide config params to SME during |
| 1800 | SMEs stop -> start sequence. |
| 1801 | |
| 1802 | If HDD changed the domain that will cause a reset. This function will |
| 1803 | provide the new set of 11d information for the new domain. Currrently this |
| 1804 | API provides info regarding 11d only at reset but we can extend this for |
| 1805 | other params (PMC, QoS) which needs to be initialized again at reset. |
| 1806 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1807 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1808 | |
| 1809 | \param hHal - The handle returned by macOpen. |
| 1810 | |
| 1811 | \Param |
| 1812 | pUpdateConfigParam - a pointer to a structure (tCsrUpdateConfigParam) that |
| 1813 | currently provides 11d related information like Country code, |
| 1814 | Regulatory domain, valid channel list, Tx power per channel, a |
| 1815 | list with active/passive scan allowed per valid channel. |
| 1816 | |
| 1817 | \return eHalStatus |
| 1818 | ---------------------------------------------------------------------------*/ |
| 1819 | eHalStatus sme_ChangeConfigParams(tHalHandle hHal, |
| 1820 | tCsrUpdateConfigParam *pUpdateConfigParam) |
| 1821 | { |
| 1822 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1823 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1824 | |
| 1825 | if (NULL == pUpdateConfigParam ) { |
| 1826 | smsLog( pMac, LOGE, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1827 | "Empty config param structure for SME, nothing to reset"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1828 | return status; |
| 1829 | } |
| 1830 | |
| 1831 | status = csrChangeConfigParams(pMac, pUpdateConfigParam); |
| 1832 | |
| 1833 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1834 | smsLog( pMac, LOGE, "csrUpdateConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1835 | status ); |
| 1836 | } |
| 1837 | |
| 1838 | return status; |
| 1839 | |
| 1840 | } |
| 1841 | |
| 1842 | /*-------------------------------------------------------------------------- |
| 1843 | |
| 1844 | \brief sme_HDDReadyInd() - SME sends eWNI_SME_SYS_READY_IND to PE to inform |
| 1845 | that the NIC is ready tio run. |
| 1846 | |
| 1847 | The function is called by HDD at the end of initialization stage so PE/HAL can |
| 1848 | enable the NIC to running state. |
| 1849 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1850 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1851 | \param hHal - The handle returned by macOpen. |
| 1852 | |
| 1853 | \return eHAL_STATUS_SUCCESS - eWNI_SME_SYS_READY_IND is sent to PE |
| 1854 | successfully. |
| 1855 | |
| 1856 | Other status means SME failed to send the message to PE. |
| 1857 | \sa |
| 1858 | |
| 1859 | --------------------------------------------------------------------------*/ |
| 1860 | eHalStatus sme_HDDReadyInd(tHalHandle hHal) |
| 1861 | { |
| 1862 | tSirSmeReadyReq Msg; |
| 1863 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1864 | tPmcPowerState powerState; |
| 1865 | tPmcSwitchState hwWlanSwitchState; |
| 1866 | tPmcSwitchState swWlanSwitchState; |
| 1867 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1868 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1869 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1870 | TRACE_CODE_SME_RX_HDD_MSG_HDDREADYIND, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1871 | do |
| 1872 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1873 | |
| 1874 | Msg.messageType = eWNI_SME_SYS_READY_IND; |
| 1875 | Msg.length = sizeof( tSirSmeReadyReq ); |
| 1876 | |
| 1877 | if (eSIR_FAILURE != uMacPostCtrlMsg( hHal, (tSirMbMsg*)&Msg )) |
| 1878 | { |
| 1879 | status = eHAL_STATUS_SUCCESS; |
| 1880 | } |
| 1881 | else |
| 1882 | { |
| 1883 | smsLog( pMac, LOGE, |
| 1884 | "uMacPostCtrlMsg failed to send eWNI_SME_SYS_READY_IND"); |
| 1885 | break; |
| 1886 | } |
| 1887 | |
| 1888 | status = pmcQueryPowerState( hHal, &powerState, |
| 1889 | &hwWlanSwitchState, &swWlanSwitchState ); |
| 1890 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1891 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1892 | smsLog( pMac, LOGE, "pmcQueryPowerState failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1893 | status ); |
| 1894 | break; |
| 1895 | } |
| 1896 | |
| 1897 | if ( (ePMC_SWITCH_OFF != hwWlanSwitchState) && |
| 1898 | (ePMC_SWITCH_OFF != swWlanSwitchState) ) |
| 1899 | { |
| 1900 | status = csrReady(pMac); |
| 1901 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1902 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1903 | smsLog( pMac, LOGE, "csrReady failed with status=%d", status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1904 | break; |
| 1905 | } |
| 1906 | status = pmcReady(hHal); |
| 1907 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1908 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1909 | smsLog( pMac, LOGE, "pmcReady failed with status=%d", status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1910 | break; |
| 1911 | } |
| 1912 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1913 | if(VOS_STATUS_SUCCESS != btcReady(hHal)) |
| 1914 | { |
| 1915 | status = eHAL_STATUS_FAILURE; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1916 | smsLog( pMac, LOGE, "btcReady failed"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1917 | break; |
| 1918 | } |
| 1919 | #endif |
| 1920 | |
| 1921 | #if defined WLAN_FEATURE_VOWIFI |
| 1922 | if(VOS_STATUS_SUCCESS != rrmReady(hHal)) |
| 1923 | { |
| 1924 | status = eHAL_STATUS_FAILURE; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1925 | smsLog( pMac, LOGE, "rrmReady failed"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1926 | break; |
| 1927 | } |
| 1928 | #endif |
| 1929 | } |
| 1930 | pMac->sme.state = SME_STATE_READY; |
| 1931 | } while( 0 ); |
| 1932 | |
| 1933 | return status; |
| 1934 | } |
| 1935 | |
Selvaraj, Sridhar | c045b8b | 2016-04-06 12:22:35 +0530 | [diff] [blame] | 1936 | /** |
| 1937 | * sme_set_allowed_action_frames() - Set allowed action frames to FW |
| 1938 | * |
| 1939 | * @hal: Handler to HAL |
| 1940 | * |
| 1941 | * This function conveys the list of action frames that needs to be forwarded |
| 1942 | * to driver by FW. Rest of the action frames can be dropped in FW.Bitmask is |
| 1943 | * set with ALLOWED_ACTION_FRAMES_BITMAP |
| 1944 | * |
| 1945 | * Return: None |
| 1946 | */ |
| 1947 | static void sme_set_allowed_action_frames(tHalHandle hal) |
| 1948 | { |
| 1949 | eHalStatus status; |
| 1950 | tpAniSirGlobal mac = PMAC_STRUCT(hal); |
| 1951 | vos_msg_t vos_message; |
| 1952 | VOS_STATUS vos_status; |
| 1953 | struct sir_allowed_action_frames *sir_allowed_action_frames; |
| 1954 | |
| 1955 | sir_allowed_action_frames = |
| 1956 | vos_mem_malloc(sizeof(*sir_allowed_action_frames)); |
| 1957 | if (!sir_allowed_action_frames) { |
| 1958 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1959 | "Not able to allocate memory for WDA_SET_ALLOWED_ACTION_FRAMES_IND"); |
| 1960 | return; |
| 1961 | } |
| 1962 | |
| 1963 | vos_mem_zero(sir_allowed_action_frames, sizeof(*sir_allowed_action_frames)); |
| 1964 | sir_allowed_action_frames->bitmask = ALLOWED_ACTION_FRAMES_BITMAP; |
| 1965 | sir_allowed_action_frames->reserved = 0; |
| 1966 | |
| 1967 | status = sme_AcquireGlobalLock(&mac->sme); |
| 1968 | if (status == eHAL_STATUS_SUCCESS) { |
| 1969 | /* serialize the req through MC thread */ |
| 1970 | vos_message.bodyptr = sir_allowed_action_frames; |
| 1971 | vos_message.type = WDA_SET_ALLOWED_ACTION_FRAMES_IND; |
| 1972 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 1973 | TRACE_CODE_SME_TX_WDA_MSG, |
| 1974 | NO_SESSION, vos_message.type)); |
| 1975 | vos_status = vos_mq_post_message(VOS_MQ_ID_WDA, &vos_message); |
| 1976 | if (!VOS_IS_STATUS_SUCCESS(vos_status)) { |
| 1977 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1978 | "Not able to post WDA_SET_ALLOWED_ACTION_FRAMES_IND message to HAL"); |
| 1979 | vos_mem_free(sir_allowed_action_frames); |
| 1980 | } |
| 1981 | |
| 1982 | sme_ReleaseGlobalLock( &mac->sme ); |
| 1983 | } else { |
| 1984 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 1985 | "sme_AcquireGlobalLock error", __func__); |
| 1986 | vos_mem_free(sir_allowed_action_frames); |
| 1987 | } |
| 1988 | return; |
| 1989 | } |
| 1990 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1991 | /*-------------------------------------------------------------------------- |
| 1992 | |
| 1993 | \brief sme_Start() - Put all SME modules at ready state. |
| 1994 | |
| 1995 | The function starts each module in SME, PMC, CCM, CSR, etc. . Upon |
| 1996 | successfully return, all modules are ready to run. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1997 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1998 | \param hHal - The handle returned by macOpen. |
| 1999 | |
| 2000 | \return eHAL_STATUS_SUCCESS - SME is ready. |
| 2001 | |
| 2002 | Other status means SME is failed to start |
| 2003 | \sa |
| 2004 | |
| 2005 | --------------------------------------------------------------------------*/ |
| 2006 | eHalStatus sme_Start(tHalHandle hHal) |
| 2007 | { |
| 2008 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2009 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2010 | |
| 2011 | do |
| 2012 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2013 | status = csrStart(pMac); |
| 2014 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2015 | smsLog( pMac, LOGE, "csrStart failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2016 | status ); |
| 2017 | break; |
| 2018 | } |
| 2019 | |
| 2020 | status = pmcStart(hHal); |
| 2021 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2022 | smsLog( pMac, LOGE, "pmcStart failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2023 | status ); |
| 2024 | break; |
| 2025 | } |
| 2026 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2027 | status = WLANSAP_Start(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 2028 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2029 | smsLog( pMac, LOGE, "WLANSAP_Start failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2030 | status ); |
| 2031 | break; |
| 2032 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2033 | pMac->sme.state = SME_STATE_START; |
| 2034 | }while (0); |
| 2035 | |
Selvaraj, Sridhar | c045b8b | 2016-04-06 12:22:35 +0530 | [diff] [blame] | 2036 | sme_set_allowed_action_frames(hHal); |
| 2037 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2038 | return status; |
| 2039 | } |
| 2040 | |
| 2041 | |
| 2042 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 2043 | /****************************************************************************** |
| 2044 | * |
| 2045 | * Name: sme_PCFilterMatchCountResponseHandler |
| 2046 | * |
| 2047 | * Description: |
| 2048 | * Invoke Packet Coalescing Filter Match Count callback routine |
| 2049 | * |
| 2050 | * Parameters: |
| 2051 | * hHal - HAL handle for device |
| 2052 | * pMsg - Pointer to tRcvFltPktMatchRsp structure |
| 2053 | * |
| 2054 | * Returns: eHalStatus |
| 2055 | * |
| 2056 | ******************************************************************************/ |
| 2057 | eHalStatus sme_PCFilterMatchCountResponseHandler(tHalHandle hHal, void* pMsg) |
| 2058 | { |
| 2059 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 2060 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 2061 | tpSirRcvFltPktMatchRsp pRcvFltPktMatchRsp = (tpSirRcvFltPktMatchRsp)pMsg; |
| 2062 | |
| 2063 | if (NULL == pMsg) |
| 2064 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2065 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2066 | status = eHAL_STATUS_FAILURE; |
| 2067 | } |
| 2068 | else |
| 2069 | { |
| 2070 | smsLog(pMac, LOG2, "SME: entering " |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2071 | "sme_FilterMatchCountResponseHandler"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2072 | |
| 2073 | /* Call Packet Coalescing Filter Match Count callback routine. */ |
| 2074 | if (pMac->pmc.FilterMatchCountCB != NULL) |
| 2075 | pMac->pmc.FilterMatchCountCB(pMac->pmc.FilterMatchCountCBContext, |
| 2076 | pRcvFltPktMatchRsp); |
| 2077 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2078 | smsLog(pMac, LOG1, "%s: status=0x%x", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2079 | pRcvFltPktMatchRsp->status); |
| 2080 | |
| 2081 | pMac->pmc.FilterMatchCountCB = NULL; |
| 2082 | pMac->pmc.FilterMatchCountCBContext = NULL; |
| 2083 | } |
| 2084 | |
| 2085 | return(status); |
| 2086 | } |
| 2087 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 2088 | |
| 2089 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2090 | #ifdef WLAN_FEATURE_11W |
| 2091 | /*------------------------------------------------------------------ |
| 2092 | * |
| 2093 | * Handle the unprotected management frame indication from LIM and |
| 2094 | * forward it to HDD. |
| 2095 | * |
| 2096 | *------------------------------------------------------------------*/ |
| 2097 | |
| 2098 | eHalStatus sme_UnprotectedMgmtFrmInd( tHalHandle hHal, |
| 2099 | tpSirSmeUnprotMgmtFrameInd pSmeMgmtFrm) |
| 2100 | { |
| 2101 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2102 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 2103 | tCsrRoamInfo pRoamInfo = {0}; |
| 2104 | tANI_U32 SessionId = pSmeMgmtFrm->sessionId; |
| 2105 | |
| 2106 | pRoamInfo.nFrameLength = pSmeMgmtFrm->frameLen; |
| 2107 | pRoamInfo.pbFrames = pSmeMgmtFrm->frameBuf; |
| 2108 | pRoamInfo.frameType = pSmeMgmtFrm->frameType; |
| 2109 | |
| 2110 | /* forward the mgmt frame to HDD */ |
| 2111 | csrRoamCallCallback(pMac, SessionId, &pRoamInfo, 0, eCSR_ROAM_UNPROT_MGMT_FRAME_IND, 0); |
| 2112 | |
| 2113 | return status; |
| 2114 | } |
| 2115 | #endif |
| 2116 | |
Hardik Kantilal Patel | 81f7634 | 2014-11-14 12:45:26 -0800 | [diff] [blame] | 2117 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 2118 | /* --------------------------------------------------------------------------- |
| 2119 | \fn sme_HT2040CoexInfoInd |
| 2120 | \brief a Send 20/40 Coex info to SAP layer |
| 2121 | |
| 2122 | \param tpSirHT2040CoexInfoInd - 20/40 Coex info param |
| 2123 | \return eHalStatus |
| 2124 | ---------------------------------------------------------------------------*/ |
| 2125 | |
| 2126 | eHalStatus sme_HT2040CoexInfoInd( tHalHandle hHal, |
| 2127 | tpSirHT2040CoexInfoInd pSmeHT2040CoexInfoInd) |
| 2128 | { |
| 2129 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2130 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 2131 | tANI_U32 SessionId = pSmeHT2040CoexInfoInd->sessionId; |
| 2132 | tCsrRoamInfo roamInfo = {0}; |
| 2133 | |
| 2134 | roamInfo.pSmeHT2040CoexInfoInd = pSmeHT2040CoexInfoInd; |
| 2135 | |
| 2136 | smsLog(pMac, LOGW, FL("HT40MHzIntolerant: %d HT20MHzBssWidthReq: %d"), |
| 2137 | roamInfo.pSmeHT2040CoexInfoInd->HT40MHzIntolerant, |
| 2138 | roamInfo.pSmeHT2040CoexInfoInd->HT20MHzBssWidthReq); |
| 2139 | |
| 2140 | smsLog(pMac, LOGW, FL("Total Intolerant Channel: %d"), |
| 2141 | roamInfo.pSmeHT2040CoexInfoInd->channel_num); |
| 2142 | |
| 2143 | /* forward the 20/40 BSS Coex information to HDD */ |
| 2144 | smsLog(pMac, LOGW, FL("Sending eCSR_ROAM_2040_COEX_INFO_IND" |
| 2145 | " to WLANSAP_RoamCallback ")); |
| 2146 | |
| 2147 | csrRoamCallCallback(pMac, SessionId, &roamInfo, |
| 2148 | 0, eCSR_ROAM_2040_COEX_INFO_IND, 0); |
| 2149 | return status; |
| 2150 | } |
| 2151 | #endif |
| 2152 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2153 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2154 | /*------------------------------------------------------------------ |
| 2155 | * |
| 2156 | * Handle the tsm ie indication from LIM and forward it to HDD. |
| 2157 | * |
| 2158 | *------------------------------------------------------------------*/ |
| 2159 | |
| 2160 | eHalStatus sme_TsmIeInd(tHalHandle hHal, tSirSmeTsmIEInd *pSmeTsmIeInd) |
| 2161 | { |
| 2162 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2163 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 2164 | tCsrRoamInfo pRoamInfo = {0}; |
| 2165 | tANI_U32 SessionId = pSmeTsmIeInd->sessionId; |
| 2166 | |
| 2167 | pRoamInfo.tsmIe.tsid= pSmeTsmIeInd->tsmIe.tsid; |
| 2168 | pRoamInfo.tsmIe.state= pSmeTsmIeInd->tsmIe.state; |
| 2169 | pRoamInfo.tsmIe.msmt_interval= pSmeTsmIeInd->tsmIe.msmt_interval; |
| 2170 | |
| 2171 | /* forward the tsm ie information to HDD */ |
| 2172 | csrRoamCallCallback(pMac, SessionId, &pRoamInfo, 0, eCSR_ROAM_TSM_IE_IND, 0); |
| 2173 | |
| 2174 | return status; |
| 2175 | } |
| 2176 | |
| 2177 | /* --------------------------------------------------------------------------- |
| 2178 | \fn sme_SetCCKMIe |
| 2179 | \brief function to store the CCKM IE passed from supplicant and use it while packing |
| 2180 | reassociation request |
| 2181 | \param hHal - HAL handle for device |
| 2182 | \param pCckmIe - pointer to CCKM IE data |
| 2183 | \param pCckmIeLen - length of the CCKM IE |
| 2184 | \- return Success or failure |
| 2185 | -------------------------------------------------------------------------*/ |
| 2186 | eHalStatus sme_SetCCKMIe(tHalHandle hHal, tANI_U8 sessionId, |
| 2187 | tANI_U8 *pCckmIe, tANI_U8 cckmIeLen) |
| 2188 | { |
| 2189 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2190 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 2191 | |
| 2192 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2193 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2194 | { |
| 2195 | csrSetCCKMIe(pMac, sessionId, pCckmIe, cckmIeLen); |
| 2196 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2197 | } |
| 2198 | return status; |
| 2199 | } |
| 2200 | |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2201 | /* --------------------------------------------------------------------------- |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2202 | \fn sme_SetEseBeaconRequest |
| 2203 | \brief function to set Ese beacon request parameters |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2204 | \param hHal - HAL handle for device |
| 2205 | \param sessionId - Session id |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2206 | \param pEseBcnReq - pointer to Ese beacon request |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2207 | \- return Success or failure |
| 2208 | -------------------------------------------------------------------------*/ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2209 | eHalStatus sme_SetEseBeaconRequest(tHalHandle hHal, const tANI_U8 sessionId, |
| 2210 | const tCsrEseBeaconReq* pEseBcnReq) |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2211 | { |
| 2212 | eHalStatus status = eSIR_SUCCESS; |
| 2213 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2214 | tpSirBeaconReportReqInd pSmeBcnReportReq = NULL; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2215 | tCsrEseBeaconReqParams *pBeaconReq = NULL; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2216 | tANI_U8 counter = 0; |
| 2217 | tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); |
| 2218 | tpRrmSMEContext pSmeRrmContext = &pMac->rrm.rrmSmeContext; |
| 2219 | |
| 2220 | /* Store the info in RRM context */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2221 | vos_mem_copy(&pSmeRrmContext->eseBcnReqInfo, pEseBcnReq, sizeof(tCsrEseBeaconReq)); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2222 | |
| 2223 | //Prepare the request to send to SME. |
| 2224 | pSmeBcnReportReq = vos_mem_malloc(sizeof( tSirBeaconReportReqInd )); |
| 2225 | if(NULL == pSmeBcnReportReq) |
| 2226 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2227 | smsLog(pMac, LOGP, "Memory Allocation Failure!!! Ese BcnReq Ind to SME"); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2228 | return eSIR_FAILURE; |
| 2229 | } |
| 2230 | |
| 2231 | smsLog(pMac, LOGE, "Sending Beacon Report Req to SME"); |
| 2232 | vos_mem_zero( pSmeBcnReportReq, sizeof( tSirBeaconReportReqInd )); |
| 2233 | |
| 2234 | pSmeBcnReportReq->messageType = eWNI_SME_BEACON_REPORT_REQ_IND; |
| 2235 | pSmeBcnReportReq->length = sizeof( tSirBeaconReportReqInd ); |
| 2236 | vos_mem_copy( pSmeBcnReportReq->bssId, pSession->connectedProfile.bssid, sizeof(tSirMacAddr) ); |
| 2237 | pSmeBcnReportReq->channelInfo.channelNum = 255; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2238 | pSmeBcnReportReq->channelList.numChannels = pEseBcnReq->numBcnReqIe; |
| 2239 | pSmeBcnReportReq->msgSource = eRRM_MSG_SOURCE_ESE_UPLOAD; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2240 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2241 | for (counter = 0; counter < pEseBcnReq->numBcnReqIe; counter++) |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2242 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2243 | pBeaconReq = (tCsrEseBeaconReqParams *)&pEseBcnReq->bcnReq[counter]; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2244 | pSmeBcnReportReq->fMeasurementtype[counter] = pBeaconReq->scanMode; |
| 2245 | pSmeBcnReportReq->measurementDuration[counter] = SYS_TU_TO_MS(pBeaconReq->measurementDuration); |
| 2246 | pSmeBcnReportReq->channelList.channelNumber[counter] = pBeaconReq->channel; |
| 2247 | } |
| 2248 | |
| 2249 | sme_RrmProcessBeaconReportReqInd(pMac, pSmeBcnReportReq); |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 2250 | vos_mem_free(pSmeBcnReportReq); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2251 | return status; |
| 2252 | } |
| 2253 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2254 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2255 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2256 | |
Abhishek Singh | 00b7197 | 2016-01-07 10:51:04 +0530 | [diff] [blame] | 2257 | #ifdef WLAN_FEATURE_RMC |
| 2258 | eHalStatus sme_IbssPeerInfoResponseHandleer( tHalHandle hHal, |
| 2259 | tpSirIbssGetPeerInfoRspParams pIbssPeerInfoParams) |
| 2260 | { |
| 2261 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2262 | |
| 2263 | if (NULL == pMac) |
| 2264 | { |
| 2265 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 2266 | "%s: pMac is null", __func__); |
| 2267 | return eHAL_STATUS_FAILURE; |
| 2268 | } |
| 2269 | if (pMac->sme.peerInfoParams.peerInfoCbk == NULL) |
| 2270 | { |
| 2271 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 2272 | "%s: HDD callback is null", __func__); |
| 2273 | return eHAL_STATUS_FAILURE; |
| 2274 | } |
| 2275 | pMac->sme.peerInfoParams.peerInfoCbk(pMac->sme.peerInfoParams.pUserData, |
| 2276 | &pIbssPeerInfoParams->ibssPeerInfoRspParams); |
| 2277 | return eHAL_STATUS_SUCCESS; |
| 2278 | } |
| 2279 | #endif /* WLAN_FEATURE_RMC */ |
| 2280 | |
| 2281 | |
c_hpothu | 9236791 | 2014-05-01 15:18:17 +0530 | [diff] [blame] | 2282 | /* --------------------------------------------------------------------------- |
| 2283 | \fn sme_getBcnMissRate |
| 2284 | \brief function sends 'WDA_GET_BCN_MISS_RATE_REQ' to WDA layer, |
| 2285 | \param hHal - HAL handle for device. |
| 2286 | \param sessionId - session ID. |
| 2287 | \- return Success or Failure. |
| 2288 | -------------------------------------------------------------------------*/ |
| 2289 | |
| 2290 | eHalStatus sme_getBcnMissRate(tHalHandle hHal, tANI_U8 sessionId, void *callback, void *data) |
| 2291 | { |
| 2292 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2293 | VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; |
| 2294 | vos_msg_t vosMessage; |
| 2295 | tSirBcnMissRateReq *pMsg; |
| 2296 | tCsrRoamSession *pSession; |
| 2297 | |
| 2298 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 2299 | { |
| 2300 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 2301 | |
| 2302 | if (!pSession) |
| 2303 | { |
| 2304 | smsLog(pMac, LOGE, FL("session %d not found"), sessionId); |
| 2305 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2306 | return eHAL_STATUS_FAILURE; |
| 2307 | } |
| 2308 | |
c_hpothu | 402de81 | 2014-07-10 15:55:45 +0530 | [diff] [blame] | 2309 | pMsg = (tSirBcnMissRateReq *) vos_mem_malloc(sizeof(tSirBcnMissRateReq)); |
c_hpothu | 9236791 | 2014-05-01 15:18:17 +0530 | [diff] [blame] | 2310 | if (NULL == pMsg) |
| 2311 | { |
| 2312 | smsLog(pMac, LOGE, FL("failed to allocated memory")); |
| 2313 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2314 | return eHAL_STATUS_FAILURE; |
| 2315 | } |
| 2316 | |
| 2317 | vos_mem_copy(pMsg->bssid, pSession->connectedProfile.bssid, |
| 2318 | sizeof(tSirMacAddr)); |
| 2319 | |
| 2320 | pMsg->msgLen = sizeof(tSirBcnMissRateReq); |
| 2321 | pMsg->callback = callback; |
| 2322 | pMsg->data = data; |
| 2323 | |
| 2324 | vosMessage.type = WDA_GET_BCN_MISS_RATE_REQ; |
| 2325 | vosMessage.bodyptr = pMsg; |
| 2326 | vosMessage.reserved = 0; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 2327 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 2328 | TRACE_CODE_SME_TX_WDA_MSG, sessionId, vosMessage.type)); |
c_hpothu | 9236791 | 2014-05-01 15:18:17 +0530 | [diff] [blame] | 2329 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 2330 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 2331 | { |
| 2332 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 2333 | "%s: Post Set TM Level MSG fail", __func__); |
| 2334 | vos_mem_free(pMsg); |
| 2335 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2336 | return eHAL_STATUS_FAILURE; |
| 2337 | } |
| 2338 | sme_ReleaseGlobalLock( &pMac->sme); |
| 2339 | return eHAL_STATUS_SUCCESS; |
| 2340 | } |
| 2341 | return eHAL_STATUS_FAILURE; |
| 2342 | } |
| 2343 | |
Srinivas Dasari | b8fdd42 | 2014-11-27 10:44:20 +0530 | [diff] [blame] | 2344 | eHalStatus sme_EncryptMsgResponseHandler(tHalHandle hHal, |
| 2345 | tpSirEncryptedDataRspParams pEncRspParams) |
| 2346 | { |
| 2347 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2348 | |
| 2349 | if (NULL == pMac) |
| 2350 | { |
| 2351 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 2352 | "%s: pMac is null", __func__); |
| 2353 | return eHAL_STATUS_FAILURE; |
| 2354 | } |
| 2355 | if (pMac->sme.pEncMsgInfoParams.pEncMsgCbk == NULL) |
| 2356 | { |
| 2357 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 2358 | "%s: HDD callback is null", __func__); |
| 2359 | return eHAL_STATUS_FAILURE; |
| 2360 | } |
| 2361 | pMac->sme.pEncMsgInfoParams.pEncMsgCbk(pMac->sme.pEncMsgInfoParams.pUserData, |
| 2362 | &pEncRspParams->encryptedDataRsp); |
| 2363 | return eHAL_STATUS_SUCCESS; |
| 2364 | } |
| 2365 | |
Girish Gowli | a95daca | 2015-02-04 20:31:31 +0530 | [diff] [blame] | 2366 | eHalStatus sme_UpdateMaxRateInd(tHalHandle hHal, |
| 2367 | tSirSmeUpdateMaxRateParams *pSmeUpdateMaxRateParams) |
| 2368 | { |
| 2369 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2370 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 2371 | tANI_U8 sessionId = pSmeUpdateMaxRateParams->smeSessionId; |
| 2372 | |
| 2373 | /* forward the information to HDD */ |
| 2374 | status = csrRoamCallCallback(pMac, sessionId, NULL, 0, |
| 2375 | eCSR_ROAM_UPDATE_MAX_RATE_IND, |
| 2376 | pSmeUpdateMaxRateParams->maxRateFlag); |
| 2377 | return status; |
| 2378 | } |
| 2379 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2380 | /*-------------------------------------------------------------------------- |
| 2381 | |
| 2382 | \brief sme_ProcessMsg() - The main message processor for SME. |
| 2383 | |
| 2384 | The function is called by a message dispatcher when to process a message |
| 2385 | targeted for SME. |
| 2386 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2387 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2388 | \param hHal - The handle returned by macOpen. |
| 2389 | \param pMsg - A pointer to a caller allocated object of tSirMsgQ. |
| 2390 | |
| 2391 | \return eHAL_STATUS_SUCCESS - SME successfully process the message. |
| 2392 | |
| 2393 | Other status means SME failed to process the message to HAL. |
| 2394 | \sa |
| 2395 | |
| 2396 | --------------------------------------------------------------------------*/ |
| 2397 | eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) |
| 2398 | { |
| 2399 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2400 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2401 | |
| 2402 | if (pMsg == NULL) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2403 | smsLog( pMac, LOGE, "Empty message for SME, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2404 | return status; |
| 2405 | } |
| 2406 | |
| 2407 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2408 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2409 | { |
| 2410 | if( SME_IS_START(pMac) ) |
| 2411 | { |
| 2412 | switch (pMsg->type) { // TODO: Will be modified to do a range check for msgs instead of having cases for each msgs |
| 2413 | case eWNI_PMC_ENTER_BMPS_RSP: |
| 2414 | case eWNI_PMC_EXIT_BMPS_RSP: |
| 2415 | case eWNI_PMC_EXIT_BMPS_IND: |
| 2416 | case eWNI_PMC_ENTER_IMPS_RSP: |
| 2417 | case eWNI_PMC_EXIT_IMPS_RSP: |
| 2418 | case eWNI_PMC_SMPS_STATE_IND: |
| 2419 | case eWNI_PMC_ENTER_UAPSD_RSP: |
| 2420 | case eWNI_PMC_EXIT_UAPSD_RSP: |
| 2421 | case eWNI_PMC_ENTER_WOWL_RSP: |
| 2422 | case eWNI_PMC_EXIT_WOWL_RSP: |
| 2423 | //PMC |
| 2424 | if (pMsg->bodyptr) |
| 2425 | { |
| 2426 | pmcMessageProcessor(hHal, pMsg->bodyptr); |
| 2427 | status = eHAL_STATUS_SUCCESS; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2428 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2429 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2430 | smsLog( pMac, LOGE, "Empty rsp message for PMC, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2431 | } |
| 2432 | break; |
| 2433 | |
| 2434 | case WNI_CFG_SET_CNF: |
| 2435 | case WNI_CFG_DNLD_CNF: |
| 2436 | case WNI_CFG_GET_RSP: |
| 2437 | case WNI_CFG_ADD_GRP_ADDR_CNF: |
| 2438 | case WNI_CFG_DEL_GRP_ADDR_CNF: |
| 2439 | //CCM |
| 2440 | if (pMsg->bodyptr) |
| 2441 | { |
| 2442 | ccmCfgCnfMsgHandler(hHal, pMsg->bodyptr); |
| 2443 | status = eHAL_STATUS_SUCCESS; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2444 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2445 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2446 | smsLog( pMac, LOGE, "Empty rsp message for CCM, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2447 | } |
| 2448 | break; |
| 2449 | |
| 2450 | case eWNI_SME_ADDTS_RSP: |
| 2451 | case eWNI_SME_DELTS_RSP: |
| 2452 | case eWNI_SME_DELTS_IND: |
| 2453 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 2454 | case eWNI_SME_FT_AGGR_QOS_RSP: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2455 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2456 | //QoS |
| 2457 | if (pMsg->bodyptr) |
| 2458 | { |
| 2459 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 2460 | status = sme_QosMsgProcessor(pMac, pMsg->type, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2461 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2462 | #endif |
| 2463 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2464 | smsLog( pMac, LOGE, "Empty rsp message for QoS, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2465 | } |
| 2466 | break; |
| 2467 | #if defined WLAN_FEATURE_VOWIFI |
| 2468 | case eWNI_SME_NEIGHBOR_REPORT_IND: |
| 2469 | case eWNI_SME_BEACON_REPORT_REQ_IND: |
| 2470 | #if defined WLAN_VOWIFI_DEBUG |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2471 | smsLog( pMac, LOGE, "Received RRM message. Message Id = %d", pMsg->type ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2472 | #endif |
| 2473 | if ( pMsg->bodyptr ) |
| 2474 | { |
| 2475 | status = sme_RrmMsgProcessor( pMac, pMsg->type, pMsg->bodyptr ); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2476 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2477 | } |
| 2478 | else |
| 2479 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2480 | smsLog( pMac, LOGE, "Empty message for RRM, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2481 | } |
| 2482 | break; |
| 2483 | #endif |
| 2484 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2485 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 2486 | //Handle the eWNI_SME_OEM_DATA_RSP: |
| 2487 | case eWNI_SME_OEM_DATA_RSP: |
| 2488 | if(pMsg->bodyptr) |
| 2489 | { |
| 2490 | status = sme_HandleOemDataRsp(pMac, pMsg->bodyptr); |
| 2491 | vos_mem_free(pMsg->bodyptr); |
| 2492 | } |
| 2493 | else |
| 2494 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2495 | smsLog( pMac, LOGE, "Empty rsp message for oemData_ (eWNI_SME_OEM_DATA_RSP), nothing to process"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2496 | } |
| 2497 | smeProcessPendingQueue( pMac ); |
| 2498 | break; |
| 2499 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2500 | |
| 2501 | case eWNI_SME_ADD_STA_SELF_RSP: |
| 2502 | if(pMsg->bodyptr) |
| 2503 | { |
| 2504 | status = csrProcessAddStaSessionRsp(pMac, pMsg->bodyptr); |
| 2505 | vos_mem_free(pMsg->bodyptr); |
| 2506 | } |
| 2507 | else |
| 2508 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2509 | smsLog( pMac, LOGE, "Empty rsp message for meas (eWNI_SME_ADD_STA_SELF_RSP), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2510 | } |
| 2511 | break; |
| 2512 | case eWNI_SME_DEL_STA_SELF_RSP: |
| 2513 | if(pMsg->bodyptr) |
| 2514 | { |
| 2515 | status = csrProcessDelStaSessionRsp(pMac, pMsg->bodyptr); |
| 2516 | vos_mem_free(pMsg->bodyptr); |
| 2517 | } |
| 2518 | else |
| 2519 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2520 | smsLog( pMac, LOGE, "Empty rsp message for meas (eWNI_SME_DEL_STA_SELF_RSP), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2521 | } |
| 2522 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2523 | case eWNI_SME_REMAIN_ON_CHN_RSP: |
| 2524 | if(pMsg->bodyptr) |
| 2525 | { |
| 2526 | status = sme_remainOnChnRsp(pMac, pMsg->bodyptr); |
| 2527 | vos_mem_free(pMsg->bodyptr); |
| 2528 | } |
| 2529 | else |
| 2530 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2531 | smsLog( pMac, LOGE, "Empty rsp message for meas (eWNI_SME_REMAIN_ON_CHN_RSP), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2532 | } |
| 2533 | break; |
| 2534 | case eWNI_SME_REMAIN_ON_CHN_RDY_IND: |
| 2535 | if(pMsg->bodyptr) |
| 2536 | { |
| 2537 | status = sme_remainOnChnReady(pMac, pMsg->bodyptr); |
| 2538 | vos_mem_free(pMsg->bodyptr); |
| 2539 | } |
| 2540 | else |
| 2541 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2542 | smsLog( pMac, LOGE, "Empty rsp message for meas (eWNI_SME_REMAIN_ON_CHN_RDY_IND), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2543 | } |
| 2544 | break; |
Hardik Kantilal Patel | 81f7634 | 2014-11-14 12:45:26 -0800 | [diff] [blame] | 2545 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 2546 | case eWNI_SME_2040_COEX_IND: |
| 2547 | if(pMsg->bodyptr) |
| 2548 | { |
| 2549 | sme_HT2040CoexInfoInd(pMac, pMsg->bodyptr); |
| 2550 | vos_mem_free(pMsg->bodyptr); |
| 2551 | } |
| 2552 | else |
| 2553 | { |
| 2554 | smsLog( pMac, LOGE, "Empty rsp message for meas (eWNI_SME_2040_COEX_IND), nothing to process"); |
| 2555 | } |
| 2556 | break; |
| 2557 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2558 | case eWNI_SME_ACTION_FRAME_SEND_CNF: |
| 2559 | if(pMsg->bodyptr) |
| 2560 | { |
| 2561 | status = sme_sendActionCnf(pMac, pMsg->bodyptr); |
| 2562 | vos_mem_free(pMsg->bodyptr); |
| 2563 | } |
| 2564 | else |
| 2565 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2566 | smsLog( pMac, LOGE, "Empty rsp message for meas (eWNI_SME_ACTION_FRAME_SEND_CNF), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2567 | } |
| 2568 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2569 | case eWNI_SME_COEX_IND: |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 2570 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 2571 | TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2572 | if(pMsg->bodyptr) |
| 2573 | { |
c_hpothu | 3ba2a51 | 2014-08-06 14:02:54 +0530 | [diff] [blame] | 2574 | tSirSmeCoexInd *pSmeCoexInd = (tSirSmeCoexInd *)pMsg->bodyptr; |
| 2575 | |
| 2576 | if (pSmeCoexInd->coexIndType == SIR_COEX_IND_TYPE_DISABLE_AGGREGATION_IN_2p4) |
| 2577 | { |
| 2578 | smsLog( pMac, LOG1, FL("SIR_COEX_IND_TYPE_DISABLE_AGGREGATION_IN_2p4")); |
| 2579 | sme_RequestFullPower(hHal, NULL, NULL, eSME_REASON_OTHER); |
| 2580 | pMac->isCoexScoIndSet = 1; |
| 2581 | } |
| 2582 | else if (pSmeCoexInd->coexIndType == SIR_COEX_IND_TYPE_ENABLE_AGGREGATION_IN_2p4) |
| 2583 | { |
| 2584 | smsLog( pMac, LOG1, FL("SIR_COEX_IND_TYPE_ENABLE_AGGREGATION_IN_2p4")); |
| 2585 | pMac->isCoexScoIndSet = 0; |
| 2586 | sme_RequestBmps(hHal, NULL, NULL); |
| 2587 | } |
| 2588 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2589 | status = btcHandleCoexInd((void *)pMac, pMsg->bodyptr); |
| 2590 | vos_mem_free(pMsg->bodyptr); |
| 2591 | } |
| 2592 | else |
| 2593 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2594 | smsLog(pMac, LOGE, "Empty rsp message for meas (eWNI_SME_COEX_IND), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2595 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2596 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2597 | |
| 2598 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 2599 | case eWNI_SME_PREF_NETWORK_FOUND_IND: |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 2600 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 2601 | TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2602 | if(pMsg->bodyptr) |
| 2603 | { |
| 2604 | status = sme_PreferredNetworkFoundInd((void *)pMac, pMsg->bodyptr); |
| 2605 | vos_mem_free(pMsg->bodyptr); |
| 2606 | } |
| 2607 | else |
| 2608 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2609 | smsLog(pMac, LOGE, "Empty rsp message for meas (eWNI_SME_PREF_NETWORK_FOUND_IND), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2610 | } |
| 2611 | break; |
| 2612 | #endif // FEATURE_WLAN_SCAN_PNO |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2613 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2614 | case eWNI_SME_TX_PER_HIT_IND: |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 2615 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 2616 | TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2617 | if (pMac->sme.pTxPerHitCallback) |
| 2618 | { |
| 2619 | pMac->sme.pTxPerHitCallback(pMac->sme.pTxPerHitCbContext); |
| 2620 | } |
| 2621 | break; |
| 2622 | |
| 2623 | case eWNI_SME_CHANGE_COUNTRY_CODE: |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 2624 | if(pMsg->bodyptr) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2625 | { |
| 2626 | status = sme_HandleChangeCountryCode((void *)pMac, pMsg->bodyptr); |
| 2627 | vos_mem_free(pMsg->bodyptr); |
| 2628 | } |
| 2629 | else |
| 2630 | { |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 2631 | smsLog(pMac, LOGE, "Empty rsp message for message (eWNI_SME_CHANGE_COUNTRY_CODE), nothing to process"); |
| 2632 | } |
| 2633 | break; |
| 2634 | |
| 2635 | case eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE: |
| 2636 | if (pMsg->bodyptr) |
| 2637 | { |
| 2638 | status = sme_HandleGenericChangeCountryCode((void *)pMac, pMsg->bodyptr); |
| 2639 | vos_mem_free(pMsg->bodyptr); |
| 2640 | } |
| 2641 | else |
| 2642 | { |
| 2643 | smsLog(pMac, LOGE, "Empty rsp message for message (eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2644 | } |
| 2645 | break; |
| 2646 | |
| 2647 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 2648 | case eWNI_PMC_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP: |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 2649 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 2650 | TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2651 | if(pMsg->bodyptr) |
| 2652 | { |
| 2653 | status = sme_PCFilterMatchCountResponseHandler((void *)pMac, pMsg->bodyptr); |
| 2654 | vos_mem_free(pMsg->bodyptr); |
| 2655 | } |
| 2656 | else |
| 2657 | { |
| 2658 | smsLog(pMac, LOGE, "Empty rsp message for meas " |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2659 | "(PACKET_COALESCING_FILTER_MATCH_COUNT_RSP), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2660 | } |
| 2661 | break; |
| 2662 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 2663 | case eWNI_SME_PRE_SWITCH_CHL_IND: |
| 2664 | { |
| 2665 | status = sme_HandlePreChannelSwitchInd(pMac); |
| 2666 | break; |
| 2667 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2668 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2669 | case eWNI_SME_POST_SWITCH_CHL_IND: |
| 2670 | { |
| 2671 | status = sme_HandlePostChannelSwitchInd(pMac); |
| 2672 | break; |
| 2673 | } |
| 2674 | |
| 2675 | #ifdef WLAN_WAKEUP_EVENTS |
| 2676 | case eWNI_SME_WAKE_REASON_IND: |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 2677 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 2678 | TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2679 | if(pMsg->bodyptr) |
| 2680 | { |
| 2681 | status = sme_WakeReasonIndCallback((void *)pMac, pMsg->bodyptr); |
| 2682 | vos_mem_free(pMsg->bodyptr); |
| 2683 | } |
| 2684 | else |
| 2685 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2686 | smsLog(pMac, LOGE, "Empty rsp message for meas (eWNI_SME_WAKE_REASON_IND), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2687 | } |
| 2688 | break; |
| 2689 | #endif // WLAN_WAKEUP_EVENTS |
| 2690 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2691 | #ifdef FEATURE_WLAN_TDLS |
| 2692 | /* |
| 2693 | * command rescived from PE, SME tdls msg processor shall be called |
| 2694 | * to process commands recieved from PE |
| 2695 | */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2696 | case eWNI_SME_TDLS_SEND_MGMT_RSP: |
| 2697 | case eWNI_SME_TDLS_ADD_STA_RSP: |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 2698 | case eWNI_SME_TDLS_DEL_STA_RSP: |
| 2699 | case eWNI_SME_TDLS_DEL_STA_IND: |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2700 | case eWNI_SME_TDLS_DEL_ALL_PEER_IND: |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 2701 | case eWNI_SME_MGMT_FRM_TX_COMPLETION_IND: |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 2702 | case eWNI_SME_TDLS_LINK_ESTABLISH_RSP: |
Atul Mittal | 60bd429 | 2014-08-14 12:19:27 +0530 | [diff] [blame] | 2703 | case eWNI_SME_TDLS_CHANNEL_SWITCH_RSP: |
Deepthi Gowri | 25e2555 | 2015-05-14 12:12:50 +0530 | [diff] [blame] | 2704 | { |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2705 | if (pMsg->bodyptr) |
| 2706 | { |
| 2707 | status = tdlsMsgProcessor(pMac, pMsg->type, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2708 | vos_mem_free(pMsg->bodyptr); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2709 | } |
| 2710 | else |
| 2711 | { |
| 2712 | smsLog( pMac, LOGE, "Empty rsp message for TDLS, \ |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2713 | nothing to process"); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2714 | } |
| 2715 | break; |
| 2716 | } |
| 2717 | #endif |
| 2718 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2719 | #ifdef WLAN_FEATURE_11W |
| 2720 | case eWNI_SME_UNPROT_MGMT_FRM_IND: |
| 2721 | if (pMsg->bodyptr) |
| 2722 | { |
| 2723 | sme_UnprotectedMgmtFrmInd(pMac, pMsg->bodyptr); |
| 2724 | vos_mem_free(pMsg->bodyptr); |
| 2725 | } |
| 2726 | else |
| 2727 | { |
| 2728 | smsLog(pMac, LOGE, "Empty rsp message for meas (eWNI_SME_UNPROT_MGMT_FRM_IND), nothing to process"); |
| 2729 | } |
| 2730 | break; |
| 2731 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2732 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2733 | case eWNI_SME_TSM_IE_IND: |
| 2734 | { |
| 2735 | if (pMsg->bodyptr) |
| 2736 | { |
| 2737 | sme_TsmIeInd(pMac, pMsg->bodyptr); |
| 2738 | vos_mem_free(pMsg->bodyptr); |
| 2739 | } |
| 2740 | else |
| 2741 | { |
| 2742 | smsLog(pMac, LOGE, "Empty rsp message for (eWNI_SME_TSM_IE_IND), nothing to process"); |
| 2743 | } |
| 2744 | break; |
| 2745 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2746 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 2747 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 2748 | case eWNI_SME_ROAM_SCAN_OFFLOAD_RSP: |
| 2749 | status = csrRoamOffloadScanRspHdlr((void *)pMac, pMsg->bodyval); |
| 2750 | break; |
| 2751 | #endif // WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2752 | |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 2753 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 2754 | case eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP: |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 2755 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 2756 | TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 2757 | if (pMsg->bodyptr) |
| 2758 | { |
| 2759 | sme_ProcessGetGtkInfoRsp(pMac, pMsg->bodyptr); |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 2760 | vos_mem_zero(pMsg->bodyptr, |
| 2761 | sizeof(tSirGtkOffloadGetInfoRspParams)); |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 2762 | vos_mem_free(pMsg->bodyptr); |
| 2763 | } |
| 2764 | else |
| 2765 | { |
| 2766 | smsLog(pMac, LOGE, "Empty rsp message for (eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP), nothing to process"); |
| 2767 | } |
| 2768 | break ; |
| 2769 | #endif |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2770 | |
| 2771 | #ifdef FEATURE_WLAN_LPHB |
| 2772 | /* LPHB timeout indication arrived, send IND to client */ |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 2773 | case eWNI_SME_LPHB_IND: |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 2774 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 2775 | TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 2776 | if (pMac->sme.pLphbIndCb) |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2777 | { |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 2778 | pMac->sme.pLphbIndCb(pMac->pAdapter, pMsg->bodyptr); |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2779 | } |
| 2780 | vos_mem_free(pMsg->bodyptr); |
| 2781 | |
| 2782 | break; |
| 2783 | #endif /* FEATURE_WLAN_LPHB */ |
| 2784 | |
Abhishek Singh | 00b7197 | 2016-01-07 10:51:04 +0530 | [diff] [blame] | 2785 | #ifdef WLAN_FEATURE_RMC |
| 2786 | case eWNI_SME_IBSS_PEER_INFO_RSP: |
| 2787 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 2788 | TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); |
| 2789 | if (pMsg->bodyptr) |
| 2790 | { |
| 2791 | sme_IbssPeerInfoResponseHandleer(pMac, pMsg->bodyptr); |
| 2792 | vos_mem_free(pMsg->bodyptr); |
| 2793 | } |
| 2794 | else |
| 2795 | { |
| 2796 | smsLog(pMac, LOGE, |
| 2797 | "Empty rsp message for (eWNI_SME_IBSS_PEER_INFO_RSP)," |
| 2798 | " nothing to process"); |
| 2799 | } |
| 2800 | break ; |
| 2801 | |
| 2802 | #endif /* WLAN_FEATURE_RMC */ |
| 2803 | |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 2804 | #ifdef FEATURE_WLAN_CH_AVOID |
| 2805 | /* LPHB timeout indication arrived, send IND to client */ |
| 2806 | case eWNI_SME_CH_AVOID_IND: |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 2807 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 2808 | TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 2809 | if (pMac->sme.pChAvoidNotificationCb) |
| 2810 | { |
| 2811 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 2812 | "%s: CH avoid notification", __func__); |
| 2813 | pMac->sme.pChAvoidNotificationCb(pMac->pAdapter, pMsg->bodyptr); |
| 2814 | } |
| 2815 | vos_mem_free(pMsg->bodyptr); |
| 2816 | |
| 2817 | break; |
| 2818 | #endif /* FEATURE_WLAN_CH_AVOID */ |
| 2819 | |
Srinivas Dasari | b8fdd42 | 2014-11-27 10:44:20 +0530 | [diff] [blame] | 2820 | case eWNI_SME_ENCRYPT_MSG_RSP: |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 2821 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 2822 | TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); |
Srinivas Dasari | b8fdd42 | 2014-11-27 10:44:20 +0530 | [diff] [blame] | 2823 | if (pMsg->bodyptr) |
| 2824 | { |
| 2825 | sme_EncryptMsgResponseHandler(pMac, pMsg->bodyptr); |
| 2826 | vos_mem_free(pMsg->bodyptr); |
| 2827 | } |
| 2828 | else |
| 2829 | { |
| 2830 | smsLog(pMac, LOGE, |
| 2831 | "Empty rsp message for (eWNI_SME_ENCRYPT_MSG_RSP)," |
| 2832 | " nothing to process"); |
| 2833 | } |
| 2834 | break ; |
| 2835 | |
Girish Gowli | a95daca | 2015-02-04 20:31:31 +0530 | [diff] [blame] | 2836 | case eWNI_SME_UPDATE_MAX_RATE_IND: |
| 2837 | if (pMsg->bodyptr) |
| 2838 | { |
| 2839 | sme_UpdateMaxRateInd(pMac, pMsg->bodyptr); |
| 2840 | vos_mem_free(pMsg->bodyptr); |
| 2841 | } |
| 2842 | else |
| 2843 | { |
| 2844 | smsLog(pMac, LOGE, |
| 2845 | "Empty message for (eWNI_SME_UPDATE_MAX_RATE_IND)," |
| 2846 | " nothing to process"); |
| 2847 | } |
| 2848 | break; |
Srinivas Dasari | b8fdd42 | 2014-11-27 10:44:20 +0530 | [diff] [blame] | 2849 | |
Srinivas Dasari | 030bad3 | 2015-02-18 23:23:54 +0530 | [diff] [blame] | 2850 | case eWNI_SME_NAN_EVENT: |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 2851 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 2852 | TRACE_CODE_SME_RX_WDA_MSG, NO_SESSION, pMsg->type)); |
Srinivas Dasari | 030bad3 | 2015-02-18 23:23:54 +0530 | [diff] [blame] | 2853 | if (pMsg->bodyptr) |
| 2854 | { |
| 2855 | sme_NanEvent(hHal, pMsg->bodyptr); |
| 2856 | vos_mem_free(pMsg->bodyptr); |
| 2857 | } |
| 2858 | else |
| 2859 | { |
| 2860 | smsLog(pMac, LOGE, |
| 2861 | "Empty message for (eWNI_SME_NAN_EVENT)," |
| 2862 | " nothing to process"); |
| 2863 | } |
| 2864 | break; |
| 2865 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2866 | default: |
| 2867 | |
| 2868 | if ( ( pMsg->type >= eWNI_SME_MSG_TYPES_BEGIN ) |
| 2869 | && ( pMsg->type <= eWNI_SME_MSG_TYPES_END ) ) |
| 2870 | { |
| 2871 | //CSR |
| 2872 | if (pMsg->bodyptr) |
| 2873 | { |
| 2874 | status = csrMsgProcessor(hHal, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2875 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2876 | } |
| 2877 | else |
| 2878 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2879 | smsLog( pMac, LOGE, "Empty rsp message for CSR, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2880 | } |
| 2881 | } |
| 2882 | else |
| 2883 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2884 | smsLog( pMac, LOGW, "Unknown message type %d, nothing to process", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2885 | pMsg->type); |
| 2886 | if (pMsg->bodyptr) |
| 2887 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2888 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2889 | } |
| 2890 | } |
| 2891 | }//switch |
| 2892 | } //SME_IS_START |
| 2893 | else |
| 2894 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2895 | smsLog( pMac, LOGW, "message type %d in stop state ignored", pMsg->type); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2896 | if (pMsg->bodyptr) |
| 2897 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2898 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2899 | } |
| 2900 | } |
| 2901 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2902 | } |
| 2903 | else |
| 2904 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2905 | smsLog( pMac, LOGW, "Locking failed, bailing out"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2906 | if (pMsg->bodyptr) |
| 2907 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2908 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2909 | } |
| 2910 | } |
| 2911 | |
| 2912 | return status; |
| 2913 | } |
| 2914 | |
| 2915 | |
| 2916 | //No need to hold the global lock here because this function can only be called |
| 2917 | //after sme_Stop. |
| 2918 | v_VOID_t sme_FreeMsg( tHalHandle hHal, vos_msg_t* pMsg ) |
| 2919 | { |
| 2920 | if( pMsg ) |
| 2921 | { |
| 2922 | if (pMsg->bodyptr) |
| 2923 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2924 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2925 | } |
| 2926 | } |
| 2927 | |
| 2928 | } |
| 2929 | |
| 2930 | |
| 2931 | /*-------------------------------------------------------------------------- |
| 2932 | |
| 2933 | \brief sme_Stop() - Stop all SME modules and put them at idle state |
| 2934 | |
| 2935 | The function stops each module in SME, PMC, CCM, CSR, etc. . Upon |
| 2936 | return, all modules are at idle state ready to start. |
| 2937 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2938 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2939 | \param hHal - The handle returned by macOpen |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2940 | \param tHalStopType - reason for stopping |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2941 | |
| 2942 | \return eHAL_STATUS_SUCCESS - SME is stopped. |
| 2943 | |
| 2944 | Other status means SME is failed to stop but caller should still |
| 2945 | consider SME is stopped. |
| 2946 | \sa |
| 2947 | |
| 2948 | --------------------------------------------------------------------------*/ |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2949 | eHalStatus sme_Stop(tHalHandle hHal, tHalStopType stopType) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2950 | { |
| 2951 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2952 | eHalStatus fail_status = eHAL_STATUS_SUCCESS; |
| 2953 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2954 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2955 | status = WLANSAP_Stop(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 2956 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2957 | smsLog( pMac, LOGE, "WLANSAP_Stop failed during smeStop with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2958 | status ); |
| 2959 | fail_status = status; |
| 2960 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2961 | |
| 2962 | p2pStop(hHal); |
| 2963 | |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2964 | status = pmcStop(hHal); |
| 2965 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 2966 | smsLog( pMac, LOGE, "pmcStop failed during smeStop with status=%d", |
| 2967 | status ); |
| 2968 | fail_status = status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2969 | } |
| 2970 | |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2971 | status = csrStop(pMac, stopType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2972 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2973 | smsLog( pMac, LOGE, "csrStop failed during smeStop with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2974 | status ); |
| 2975 | fail_status = status; |
| 2976 | } |
| 2977 | |
| 2978 | ccmStop(hHal); |
| 2979 | |
| 2980 | purgeSmeCmdList(pMac); |
| 2981 | |
| 2982 | if (!HAL_STATUS_SUCCESS( fail_status )) { |
| 2983 | status = fail_status; |
| 2984 | } |
| 2985 | |
| 2986 | pMac->sme.state = SME_STATE_STOP; |
| 2987 | |
| 2988 | return status; |
| 2989 | } |
| 2990 | |
| 2991 | /*-------------------------------------------------------------------------- |
| 2992 | |
| 2993 | \brief sme_Close() - Release all SME modules and their resources. |
| 2994 | |
| 2995 | The function release each module in SME, PMC, CCM, CSR, etc. . Upon |
| 2996 | return, all modules are at closed state. |
| 2997 | |
| 2998 | No SME APIs can be involved after smeClose except smeOpen. |
| 2999 | smeClose must be called before macClose. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3000 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3001 | \param hHal - The handle returned by macOpen |
| 3002 | |
| 3003 | \return eHAL_STATUS_SUCCESS - SME is successfully close. |
| 3004 | |
| 3005 | Other status means SME is failed to be closed but caller still cannot |
| 3006 | call any other SME functions except smeOpen. |
| 3007 | \sa |
| 3008 | |
| 3009 | --------------------------------------------------------------------------*/ |
| 3010 | eHalStatus sme_Close(tHalHandle hHal) |
| 3011 | { |
| 3012 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3013 | eHalStatus fail_status = eHAL_STATUS_SUCCESS; |
| 3014 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3015 | |
| 3016 | status = csrClose(pMac); |
| 3017 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3018 | smsLog( pMac, LOGE, "csrClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3019 | status ); |
| 3020 | fail_status = status; |
| 3021 | } |
| 3022 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3023 | status = WLANSAP_Close(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 3024 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3025 | smsLog( pMac, LOGE, "WLANSAP_close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3026 | status ); |
| 3027 | fail_status = status; |
| 3028 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3029 | |
| 3030 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 3031 | status = btcClose(hHal); |
| 3032 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3033 | smsLog( pMac, LOGE, "BTC close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3034 | status ); |
| 3035 | fail_status = status; |
| 3036 | } |
| 3037 | |
| 3038 | status = sme_QosClose(pMac); |
| 3039 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3040 | smsLog( pMac, LOGE, "Qos close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3041 | status ); |
| 3042 | fail_status = status; |
| 3043 | } |
| 3044 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3045 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 3046 | status = oemData_OemDataReqClose(hHal); |
| 3047 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3048 | smsLog( pMac, LOGE, "OEM DATA REQ close failed during sme close with status=%d", |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3049 | status ); |
| 3050 | fail_status = status; |
| 3051 | } |
| 3052 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3053 | |
| 3054 | status = ccmClose(hHal); |
| 3055 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3056 | smsLog( pMac, LOGE, "ccmClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3057 | status ); |
| 3058 | fail_status = status; |
| 3059 | } |
| 3060 | |
| 3061 | status = pmcClose(hHal); |
| 3062 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3063 | smsLog( pMac, LOGE, "pmcClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3064 | status ); |
| 3065 | fail_status = status; |
| 3066 | } |
| 3067 | #if defined WLAN_FEATURE_VOWIFI |
| 3068 | status = rrmClose(hHal); |
| 3069 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3070 | smsLog( pMac, LOGE, "RRM close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3071 | status ); |
| 3072 | fail_status = status; |
| 3073 | } |
| 3074 | #endif |
| 3075 | |
| 3076 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 3077 | sme_FTClose(hHal); |
| 3078 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3079 | sme_p2pClose(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3080 | |
| 3081 | freeSmeCmdList(pMac); |
| 3082 | |
| 3083 | if( !VOS_IS_STATUS_SUCCESS( vos_lock_destroy( &pMac->sme.lkSmeGlobalLock ) ) ) |
| 3084 | { |
| 3085 | fail_status = eHAL_STATUS_FAILURE; |
| 3086 | } |
| 3087 | |
| 3088 | if (!HAL_STATUS_SUCCESS( fail_status )) { |
| 3089 | status = fail_status; |
| 3090 | } |
| 3091 | |
| 3092 | pMac->sme.state = SME_STATE_STOP; |
| 3093 | |
| 3094 | return status; |
| 3095 | } |
Hema Aparna Medicharla | a6cf65e | 2015-06-01 16:23:28 +0530 | [diff] [blame] | 3096 | |
| 3097 | v_VOID_t sme_PreClose(tHalHandle hHal) |
| 3098 | { |
| 3099 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3100 | |
mukul sharma | 867a9df | 2015-07-08 13:28:24 +0530 | [diff] [blame] | 3101 | if(!pMac) |
| 3102 | return; |
Hema Aparna Medicharla | a6cf65e | 2015-06-01 16:23:28 +0530 | [diff] [blame] | 3103 | |
mukul sharma | 867a9df | 2015-07-08 13:28:24 +0530 | [diff] [blame] | 3104 | smsLog(pMac, LOGW, FL("Stopping Active CMD List Timer")); |
Hema Aparna Medicharla | a6cf65e | 2015-06-01 16:23:28 +0530 | [diff] [blame] | 3105 | vos_timer_stop( pMac->sme.smeCmdActiveList.cmdTimeoutTimer ); |
| 3106 | |
| 3107 | } |
| 3108 | |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 3109 | #ifdef FEATURE_WLAN_LFR |
| 3110 | tANI_BOOLEAN csrIsScanAllowed(tpAniSirGlobal pMac) |
| 3111 | { |
Madan Mohan Koyyalamudi | fb534bb | 2012-10-24 14:35:45 -0700 | [diff] [blame] | 3112 | #if 0 |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 3113 | switch(pMac->roam.neighborRoamInfo.neighborRoamState) { |
| 3114 | case eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN: |
| 3115 | case eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING: |
| 3116 | case eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE: |
| 3117 | case eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING: |
| 3118 | return eANI_BOOLEAN_FALSE; |
| 3119 | default: |
| 3120 | return eANI_BOOLEAN_TRUE; |
| 3121 | } |
Madan Mohan Koyyalamudi | fb534bb | 2012-10-24 14:35:45 -0700 | [diff] [blame] | 3122 | #else |
| 3123 | /* |
| 3124 | * TODO: always return TRUE for now until |
| 3125 | * we figure out why we could be stuck in |
| 3126 | * one of the roaming states forever. |
| 3127 | */ |
| 3128 | return eANI_BOOLEAN_TRUE; |
| 3129 | #endif |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 3130 | } |
| 3131 | #endif |
c_hpothu | 5890146 | 2014-11-01 16:44:34 +0530 | [diff] [blame] | 3132 | |
| 3133 | /* --------------------------------------------------------------------------- |
| 3134 | \fn sco_isScanAllowed |
| 3135 | \brief check for scan interface connection status |
| 3136 | \param pMac - Pointer to the global MAC parameter structure |
| 3137 | \param pScanReq - scan request structure. |
| 3138 | |
| 3139 | \return tANI_BOOLEAN TRUE to allow scan otherwise FALSE |
| 3140 | ---------------------------------------------------------------------------*/ |
| 3141 | tANI_BOOLEAN sco_isScanAllowed(tpAniSirGlobal pMac, tCsrScanRequest *pscanReq) |
| 3142 | { |
| 3143 | tANI_BOOLEAN ret; |
| 3144 | |
| 3145 | if (pscanReq->p2pSearch) |
| 3146 | ret = csrIsP2pSessionConnected(pMac); |
| 3147 | else |
| 3148 | ret = csrIsStaSessionConnected(pMac); |
| 3149 | |
| 3150 | return !ret; |
| 3151 | } |
| 3152 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3153 | /* --------------------------------------------------------------------------- |
| 3154 | \fn sme_ScanRequest |
| 3155 | \brief a wrapper function to Request a 11d or full scan from CSR. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3156 | This is an asynchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3157 | \param pScanRequestID - pointer to an object to get back the request ID |
| 3158 | \param callback - a callback function that scan calls upon finish, will not |
| 3159 | be called if csrScanRequest returns error |
| 3160 | \param pContext - a pointer passed in for the callback |
| 3161 | \return eHalStatus |
| 3162 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3163 | eHalStatus sme_ScanRequest(tHalHandle hHal, tANI_U8 sessionId, tCsrScanRequest *pscanReq, |
| 3164 | tANI_U32 *pScanRequestID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3165 | csrScanCompleteCallback callback, void *pContext) |
| 3166 | { |
| 3167 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3168 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3169 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3170 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_REQ, sessionId, pscanReq->scanType)); |
Padma, Santhosh Kumar | 3618335 | 2016-11-08 17:48:34 +0530 | [diff] [blame] | 3171 | |
| 3172 | smsLog(pMac, LOG1, |
| 3173 | FL("isCoexScoIndSet %d disable_scan_during_sco %d is_disconnected %d"), |
| 3174 | pMac->isCoexScoIndSet, |
| 3175 | pMac->scan.disable_scan_during_sco, |
| 3176 | csrIsConnStateDisconnected(pMac, sessionId)); |
| 3177 | |
| 3178 | if (pMac->isCoexScoIndSet && pMac->scan.disable_scan_during_sco && |
| 3179 | csrIsConnStateDisconnected(pMac, sessionId)) { |
Padma, Santhosh Kumar | 4ffece4 | 2016-11-15 15:08:53 +0530 | [diff] [blame] | 3180 | csrScanFlushResult(pMac); |
Padma, Santhosh Kumar | 3618335 | 2016-11-08 17:48:34 +0530 | [diff] [blame] | 3181 | pMac->scan.disable_scan_during_sco_timer_info.callback = callback; |
| 3182 | pMac->scan.disable_scan_during_sco_timer_info.dev = pContext; |
| 3183 | pMac->scan.disable_scan_during_sco_timer_info.scan_id= *pScanRequestID; |
| 3184 | |
| 3185 | vos_timer_start(&pMac->scan.disable_scan_during_sco_timer, |
| 3186 | CSR_DISABLE_SCAN_DURING_SCO); |
| 3187 | return eHAL_STATUS_SUCCESS; |
| 3188 | } |
| 3189 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3190 | do |
| 3191 | { |
c_hpothu | 304c052 | 2014-09-30 10:22:57 +0530 | [diff] [blame] | 3192 | if(pMac->scan.fScanEnable && |
c_hpothu | 5890146 | 2014-11-01 16:44:34 +0530 | [diff] [blame] | 3193 | (pMac->isCoexScoIndSet ? sco_isScanAllowed(pMac, pscanReq) : TRUE)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3194 | { |
| 3195 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3196 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3197 | { |
| 3198 | { |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 3199 | #ifdef FEATURE_WLAN_LFR |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3200 | if(csrIsScanAllowed(pMac)) |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 3201 | { |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 3202 | #endif |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 3203 | status = csrScanRequest( hHal, sessionId, pscanReq, |
| 3204 | pScanRequestID, callback, pContext ); |
Vinay Krishna Eranna | 636b7bc | 2013-12-18 20:49:08 +0530 | [diff] [blame] | 3205 | if ( !HAL_STATUS_SUCCESS( status ) ) |
| 3206 | { |
| 3207 | smsLog(pMac, LOGE, FL("csrScanRequest failed" |
| 3208 | " SId=%d"), sessionId); |
| 3209 | } |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 3210 | #ifdef FEATURE_WLAN_LFR |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3211 | } |
| 3212 | else |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 3213 | { |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 3214 | smsLog(pMac, LOGE, FL("Scan denied in state %s" |
Mahesh A Saptasagar | 14addb6 | 2014-02-17 17:17:51 +0530 | [diff] [blame] | 3215 | "(sub-state %s)"), |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 3216 | macTraceGetNeighbourRoamState( |
| 3217 | pMac->roam.neighborRoamInfo.neighborRoamState), |
Mahesh A Saptasagar | 14addb6 | 2014-02-17 17:17:51 +0530 | [diff] [blame] | 3218 | macTraceGetcsrRoamSubState( |
| 3219 | pMac->roam.curSubState[sessionId])); |
Madan Mohan Koyyalamudi | ab4ab0d | 2012-10-24 14:26:50 -0700 | [diff] [blame] | 3220 | /*HandOff is in progress. So schedule this scan later*/ |
| 3221 | status = eHAL_STATUS_RESOURCES; |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 3222 | } |
| 3223 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3224 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3225 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3226 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3227 | } //sme_AcquireGlobalLock success |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 3228 | else |
| 3229 | { |
| 3230 | smsLog(pMac, LOGE, FL("sme_AcquireGlobalLock failed")); |
| 3231 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3232 | } //if(pMac->scan.fScanEnable) |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 3233 | else |
| 3234 | { |
c_hpothu | 3ba2a51 | 2014-08-06 14:02:54 +0530 | [diff] [blame] | 3235 | smsLog(pMac, LOGE, FL("fScanEnable %d isCoexScoIndSet: %d "), |
| 3236 | pMac->scan.fScanEnable, pMac->isCoexScoIndSet); |
Agarwal Ashish | 32bf863 | 2015-02-25 16:02:06 +0530 | [diff] [blame] | 3237 | status = eHAL_STATUS_RESOURCES; |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 3238 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3239 | } while( 0 ); |
| 3240 | |
| 3241 | return (status); |
| 3242 | |
| 3243 | |
| 3244 | } |
| 3245 | |
| 3246 | /* --------------------------------------------------------------------------- |
| 3247 | \fn sme_ScanGetResult |
| 3248 | \brief a wrapper function to request scan results from CSR. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3249 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3250 | \param pFilter - If pFilter is NULL, all cached results are returned |
| 3251 | \param phResult - an object for the result. |
| 3252 | \return eHalStatus |
| 3253 | ---------------------------------------------------------------------------*/ |
| 3254 | eHalStatus sme_ScanGetResult(tHalHandle hHal, tANI_U8 sessionId, tCsrScanResultFilter *pFilter, |
| 3255 | tScanResultHandle *phResult) |
| 3256 | { |
| 3257 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3258 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3259 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3260 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3261 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_GET_RESULTS, sessionId,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3262 | smsLog(pMac, LOG2, FL("enter")); |
| 3263 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3264 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3265 | { |
Madan Mohan Koyyalamudi | ca43cdf | 2012-09-24 13:15:49 -0700 | [diff] [blame] | 3266 | status = csrScanGetResult( hHal, pFilter, phResult ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3267 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3268 | } |
| 3269 | smsLog(pMac, LOG2, FL("exit status %d"), status); |
| 3270 | |
| 3271 | return (status); |
| 3272 | } |
| 3273 | |
| 3274 | |
| 3275 | /* --------------------------------------------------------------------------- |
| 3276 | \fn sme_ScanFlushResult |
| 3277 | \brief a wrapper function to request CSR to clear scan results. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3278 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3279 | \return eHalStatus |
| 3280 | ---------------------------------------------------------------------------*/ |
| 3281 | eHalStatus sme_ScanFlushResult(tHalHandle hHal, tANI_U8 sessionId) |
| 3282 | { |
| 3283 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3284 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3285 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3286 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3287 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_RESULTS, sessionId,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3288 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3289 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3290 | { |
Madan Mohan Koyyalamudi | ca43cdf | 2012-09-24 13:15:49 -0700 | [diff] [blame] | 3291 | status = csrScanFlushResult( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3292 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3293 | } |
| 3294 | |
| 3295 | return (status); |
| 3296 | } |
| 3297 | |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 3298 | /* --------------------------------------------------------------------------- |
| 3299 | \fn sme_FilterScanResults |
| 3300 | \brief a wrapper function to request CSR to clear scan results. |
| 3301 | This is a synchronous call |
| 3302 | \return eHalStatus |
| 3303 | ---------------------------------------------------------------------------*/ |
| 3304 | eHalStatus sme_FilterScanResults(tHalHandle hHal, tANI_U8 sessionId) |
| 3305 | { |
| 3306 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 3307 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3308 | |
| 3309 | MTRACE(macTraceNew(pMac, VOS_MODULE_ID_SME, |
| 3310 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_RESULTS, sessionId,0 )); |
| 3311 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3312 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3313 | { |
| 3314 | csrScanFilterResults(pMac); |
| 3315 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3316 | } |
| 3317 | |
| 3318 | return (status); |
| 3319 | } |
| 3320 | |
Padma, Santhosh Kumar | 778d838 | 2015-03-04 17:41:22 +0530 | [diff] [blame] | 3321 | /* |
| 3322 | * --------------------------------------------------------------------------- |
| 3323 | * \fn sme_FilterScanDFSResults |
| 3324 | * \brief a wrapper function to request CSR to filter BSSIDs on DFS channels |
| 3325 | * from the scan results. |
| 3326 | * \return eHalStatus |
| 3327 | *--------------------------------------------------------------------------- |
| 3328 | */ |
| 3329 | eHalStatus sme_FilterScanDFSResults(tHalHandle hHal) |
| 3330 | { |
| 3331 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 3332 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3333 | |
| 3334 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3335 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3336 | { |
| 3337 | csrScanFilterDFSResults(pMac); |
| 3338 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3339 | } |
| 3340 | |
| 3341 | return (status); |
| 3342 | } |
| 3343 | |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 3344 | eHalStatus sme_ScanFlushP2PResult(tHalHandle hHal, tANI_U8 sessionId) |
| 3345 | { |
| 3346 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3347 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3348 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3349 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3350 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_P2PRESULTS, sessionId,0 )); |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 3351 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3352 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3353 | { |
Madan Mohan Koyyalamudi | 5850f31 | 2012-11-27 19:00:25 +0530 | [diff] [blame] | 3354 | status = csrScanFlushSelectiveResult( hHal, VOS_TRUE ); |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 3355 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3356 | } |
| 3357 | |
| 3358 | return (status); |
| 3359 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3360 | |
| 3361 | /* --------------------------------------------------------------------------- |
| 3362 | \fn sme_ScanResultGetFirst |
| 3363 | \brief a wrapper function to request CSR to returns the first element of |
| 3364 | scan result. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3365 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3366 | \param hScanResult - returned from csrScanGetResult |
| 3367 | \return tCsrScanResultInfo * - NULL if no result |
| 3368 | ---------------------------------------------------------------------------*/ |
| 3369 | tCsrScanResultInfo *sme_ScanResultGetFirst(tHalHandle hHal, |
| 3370 | tScanResultHandle hScanResult) |
| 3371 | { |
| 3372 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3373 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3374 | tCsrScanResultInfo *pRet = NULL; |
| 3375 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3376 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3377 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_GETFIRST, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3378 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3379 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3380 | { |
| 3381 | pRet = csrScanResultGetFirst( pMac, hScanResult ); |
| 3382 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3383 | } |
| 3384 | |
| 3385 | return (pRet); |
| 3386 | } |
| 3387 | |
| 3388 | |
| 3389 | /* --------------------------------------------------------------------------- |
| 3390 | \fn sme_ScanResultGetNext |
| 3391 | \brief a wrapper function to request CSR to returns the next element of |
| 3392 | scan result. It can be called without calling csrScanResultGetFirst |
| 3393 | first |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3394 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3395 | \param hScanResult - returned from csrScanGetResult |
| 3396 | \return Null if no result or reach the end |
| 3397 | ---------------------------------------------------------------------------*/ |
| 3398 | tCsrScanResultInfo *sme_ScanResultGetNext(tHalHandle hHal, |
| 3399 | tScanResultHandle hScanResult) |
| 3400 | { |
| 3401 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3402 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3403 | tCsrScanResultInfo *pRet = NULL; |
| 3404 | |
| 3405 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3406 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3407 | { |
| 3408 | pRet = csrScanResultGetNext( pMac, hScanResult ); |
| 3409 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3410 | } |
| 3411 | |
| 3412 | return (pRet); |
| 3413 | } |
| 3414 | |
| 3415 | |
| 3416 | /* --------------------------------------------------------------------------- |
| 3417 | \fn sme_ScanSetBGScanparams |
| 3418 | \brief a wrapper function to request CSR to set BG scan params in PE |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3419 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3420 | \param pScanReq - BG scan request structure |
| 3421 | \return eHalStatus |
| 3422 | ---------------------------------------------------------------------------*/ |
| 3423 | eHalStatus sme_ScanSetBGScanparams(tHalHandle hHal, tANI_U8 sessionId, tCsrBGScanRequest *pScanReq) |
| 3424 | { |
| 3425 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3426 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3427 | |
| 3428 | if( NULL != pScanReq ) |
| 3429 | { |
| 3430 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3431 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3432 | { |
| 3433 | status = csrScanSetBGScanparams( hHal, pScanReq ); |
| 3434 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3435 | } |
| 3436 | } |
| 3437 | |
| 3438 | return (status); |
| 3439 | } |
| 3440 | |
| 3441 | |
| 3442 | /* --------------------------------------------------------------------------- |
| 3443 | \fn sme_ScanResultPurge |
| 3444 | \brief a wrapper function to request CSR to remove all items(tCsrScanResult) |
| 3445 | in the list and free memory for each item |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3446 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3447 | \param hScanResult - returned from csrScanGetResult. hScanResult is |
| 3448 | considered gone by |
| 3449 | calling this function and even before this function reutrns. |
| 3450 | \return eHalStatus |
| 3451 | ---------------------------------------------------------------------------*/ |
| 3452 | eHalStatus sme_ScanResultPurge(tHalHandle hHal, tScanResultHandle hScanResult) |
| 3453 | { |
| 3454 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3455 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3456 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3457 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3458 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_PURGE, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3459 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3460 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3461 | { |
| 3462 | status = csrScanResultPurge( hHal, hScanResult ); |
| 3463 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3464 | } |
| 3465 | |
| 3466 | return (status); |
| 3467 | } |
| 3468 | |
| 3469 | /* --------------------------------------------------------------------------- |
| 3470 | \fn sme_ScanGetPMKIDCandidateList |
| 3471 | \brief a wrapper function to return the PMKID candidate list |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3472 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3473 | \param pPmkidList - caller allocated buffer point to an array of |
| 3474 | tPmkidCandidateInfo |
| 3475 | \param pNumItems - pointer to a variable that has the number of |
| 3476 | tPmkidCandidateInfo allocated when retruning, this is |
| 3477 | either the number needed or number of items put into |
| 3478 | pPmkidList |
| 3479 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3480 | big enough and pNumItems |
| 3481 | has the number of tPmkidCandidateInfo. |
| 3482 | \Note: pNumItems is a number of tPmkidCandidateInfo, |
| 3483 | not sizeof(tPmkidCandidateInfo) * something |
| 3484 | ---------------------------------------------------------------------------*/ |
| 3485 | eHalStatus sme_ScanGetPMKIDCandidateList(tHalHandle hHal, tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3486 | tPmkidCandidateInfo *pPmkidList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3487 | tANI_U32 *pNumItems ) |
| 3488 | { |
| 3489 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3490 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3491 | |
| 3492 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3493 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3494 | { |
| 3495 | status = csrScanGetPMKIDCandidateList( pMac, sessionId, pPmkidList, pNumItems ); |
| 3496 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3497 | } |
| 3498 | |
| 3499 | return (status); |
| 3500 | } |
| 3501 | |
| 3502 | /*---------------------------------------------------------------------------- |
| 3503 | \fn sme_RoamRegisterLinkQualityIndCallback |
| 3504 | |
| 3505 | \brief |
| 3506 | a wrapper function to allow HDD to register a callback handler with CSR for |
| 3507 | link quality indications. |
| 3508 | |
| 3509 | Only one callback may be registered at any time. |
| 3510 | In order to deregister the callback, a NULL cback may be provided. |
| 3511 | |
| 3512 | Registration happens in the task context of the caller. |
| 3513 | |
| 3514 | \param callback - Call back being registered |
| 3515 | \param pContext - user data |
| 3516 | |
| 3517 | DEPENDENCIES: After CSR open |
| 3518 | |
| 3519 | \return eHalStatus |
| 3520 | -----------------------------------------------------------------------------*/ |
| 3521 | eHalStatus sme_RoamRegisterLinkQualityIndCallback(tHalHandle hHal, tANI_U8 sessionId, |
| 3522 | csrRoamLinkQualityIndCallback callback, |
| 3523 | void *pContext) |
| 3524 | { |
| 3525 | return(csrRoamRegisterLinkQualityIndCallback((tpAniSirGlobal)hHal, callback, pContext)); |
| 3526 | } |
| 3527 | |
| 3528 | /* --------------------------------------------------------------------------- |
| 3529 | \fn sme_RoamRegisterCallback |
| 3530 | \brief a wrapper function to allow HDD to register a callback with CSR. |
| 3531 | Unlike scan, roam has one callback for all the roam requests |
| 3532 | \param callback - a callback function that roam calls upon when state changes |
| 3533 | \param pContext - a pointer passed in for the callback |
| 3534 | \return eHalStatus |
| 3535 | ---------------------------------------------------------------------------*/ |
| 3536 | eHalStatus sme_RoamRegisterCallback(tHalHandle hHal, |
| 3537 | csrRoamCompleteCallback callback, |
| 3538 | void *pContext) |
| 3539 | { |
| 3540 | return(csrRoamRegisterCallback((tpAniSirGlobal)hHal, callback, pContext)); |
| 3541 | } |
| 3542 | |
| 3543 | eCsrPhyMode sme_GetPhyMode(tHalHandle hHal) |
| 3544 | { |
| 3545 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 3546 | return pMac->roam.configParam.phyMode; |
| 3547 | } |
| 3548 | |
| 3549 | /* --------------------------------------------------------------------------- |
Peng Xu | 117eab4 | 2014-09-25 13:33:27 +0530 | [diff] [blame] | 3550 | \fn sme_GetChannelBondingMode5G |
| 3551 | \brief get the channel bonding mode for 5G band |
| 3552 | \param hHal - HAL handle |
| 3553 | \return channel bonding mode for 5G |
| 3554 | ---------------------------------------------------------------------------*/ |
| 3555 | tANI_U32 sme_GetChannelBondingMode5G(tHalHandle hHal) |
| 3556 | { |
| 3557 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 3558 | tSmeConfigParams smeConfig; |
| 3559 | |
| 3560 | sme_GetConfigParam(pMac, &smeConfig); |
| 3561 | |
| 3562 | return smeConfig.csrConfig.channelBondingMode5GHz; |
| 3563 | } |
| 3564 | |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 3565 | #ifdef WLAN_FEATURE_AP_HT40_24G |
Peng Xu | 117eab4 | 2014-09-25 13:33:27 +0530 | [diff] [blame] | 3566 | /* --------------------------------------------------------------------------- |
| 3567 | \fn sme_GetChannelBondingMode24G |
| 3568 | \brief get the channel bonding mode for 2.4G band |
| 3569 | \param hHal - HAL handle |
| 3570 | \return channel bonding mode for 2.4G |
| 3571 | ---------------------------------------------------------------------------*/ |
| 3572 | tANI_U32 sme_GetChannelBondingMode24G(tHalHandle hHal) |
| 3573 | { |
| 3574 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 3575 | tSmeConfigParams smeConfig; |
| 3576 | |
| 3577 | sme_GetConfigParam(pMac, &smeConfig); |
| 3578 | |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 3579 | return smeConfig.csrConfig.channelBondingAPMode24GHz; |
Peng Xu | 117eab4 | 2014-09-25 13:33:27 +0530 | [diff] [blame] | 3580 | } |
| 3581 | |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 3582 | /* --------------------------------------------------------------------------- |
| 3583 | \fn sme_UpdateChannelBondingMode24G |
| 3584 | \brief update the channel bonding mode for 2.4G band |
| 3585 | \param hHal - HAL handle |
| 3586 | \param cbMode - channel bonding mode |
| 3587 | \return |
| 3588 | ---------------------------------------------------------------------------*/ |
| 3589 | void sme_UpdateChannelBondingMode24G(tHalHandle hHal, tANI_U8 cbMode) |
| 3590 | { |
| 3591 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 3592 | tSmeConfigParams smeConfig; |
| 3593 | |
| 3594 | vos_mem_zero(&smeConfig, sizeof (tSmeConfigParams)); |
| 3595 | sme_GetConfigParam(pMac, &smeConfig); |
| 3596 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, |
| 3597 | FL("Previous Channel Bonding : = %d"), |
| 3598 | smeConfig.csrConfig.channelBondingAPMode24GHz); |
| 3599 | |
| 3600 | smeConfig.csrConfig.channelBondingAPMode24GHz = cbMode; |
| 3601 | sme_UpdateConfig(hHal, &smeConfig); |
| 3602 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, |
| 3603 | FL("New Channel Bonding : = %d"), |
| 3604 | sme_GetChannelBondingMode24G(hHal)); |
| 3605 | return; |
| 3606 | } |
Hardik Kantilal Patel | 62a3a76 | 2014-11-21 12:55:57 +0530 | [diff] [blame] | 3607 | |
| 3608 | /* --------------------------------------------------------------------------- |
| 3609 | |
| 3610 | \fn sme_SetHT2040Mode |
| 3611 | |
| 3612 | \brief To update HT Operation beacon IE & Channel Bonding. |
| 3613 | |
| 3614 | \param |
| 3615 | |
| 3616 | \return eHalStatus SUCCESS |
| 3617 | FAILURE or RESOURCES |
| 3618 | The API finished and failed. |
| 3619 | |
| 3620 | -------------------------------------------------------------------------------*/ |
| 3621 | eHalStatus sme_SetHT2040Mode(tHalHandle hHal, tANI_U8 sessionId, tANI_U8 cbMode) |
| 3622 | { |
| 3623 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3624 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3625 | |
| 3626 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 3627 | FL("Channel Bonding =%d"), |
| 3628 | cbMode); |
| 3629 | |
| 3630 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 3631 | if (HAL_STATUS_SUCCESS(status)) |
| 3632 | { |
| 3633 | status = csrSetHT2040Mode(pMac, sessionId, cbMode); |
| 3634 | sme_ReleaseGlobalLock(&pMac->sme ); |
| 3635 | } |
| 3636 | return (status); |
| 3637 | } |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 3638 | #endif |
Peng Xu | 117eab4 | 2014-09-25 13:33:27 +0530 | [diff] [blame] | 3639 | |
| 3640 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3641 | \fn sme_RoamConnect |
| 3642 | \brief a wrapper function to request CSR to inititiate an association |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3643 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3644 | \param sessionId - the sessionId returned by sme_OpenSession. |
| 3645 | \param pProfile - description of the network to which to connect |
| 3646 | \param hBssListIn - a list of BSS descriptor to roam to. It is returned |
| 3647 | from csrScanGetResult |
| 3648 | \param pRoamId - to get back the request ID |
| 3649 | \return eHalStatus |
| 3650 | ---------------------------------------------------------------------------*/ |
| 3651 | eHalStatus sme_RoamConnect(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamProfile *pProfile, |
| 3652 | tANI_U32 *pRoamId) |
| 3653 | { |
| 3654 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3655 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3656 | |
Yue Ma | e36e355 | 2014-03-05 17:06:20 -0800 | [diff] [blame] | 3657 | if (!pMac) |
| 3658 | { |
| 3659 | return eHAL_STATUS_FAILURE; |
| 3660 | } |
| 3661 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3662 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3663 | TRACE_CODE_SME_RX_HDD_MSG_CONNECT, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3664 | smsLog(pMac, LOG2, FL("enter")); |
| 3665 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3666 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3667 | { |
| 3668 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3669 | { |
| 3670 | status = csrRoamConnect( pMac, sessionId, pProfile, NULL, pRoamId ); |
| 3671 | } |
| 3672 | else |
| 3673 | { |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 3674 | smsLog(pMac, LOGE, FL("invalid sessionID %d"), sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3675 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3676 | } |
| 3677 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3678 | } |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 3679 | else |
| 3680 | { |
| 3681 | smsLog(pMac, LOGE, FL("sme_AcquireGlobalLock failed")); |
| 3682 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3683 | |
| 3684 | return (status); |
| 3685 | } |
| 3686 | |
| 3687 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | dacbcb5 | 2013-04-18 16:41:54 +0530 | [diff] [blame] | 3688 | |
| 3689 | \fn sme_SetPhyMode |
| 3690 | |
| 3691 | \brief Changes the PhyMode. |
| 3692 | |
| 3693 | \param hHal - The handle returned by macOpen. |
| 3694 | |
| 3695 | \param phyMode new phyMode which is to set |
| 3696 | |
| 3697 | \return eHalStatus SUCCESS. |
| 3698 | |
| 3699 | -------------------------------------------------------------------------------*/ |
| 3700 | eHalStatus sme_SetPhyMode(tHalHandle hHal, eCsrPhyMode phyMode) |
| 3701 | { |
| 3702 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3703 | |
| 3704 | if (NULL == pMac) |
| 3705 | { |
| 3706 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 3707 | "%s: invalid context", __func__); |
| 3708 | return eHAL_STATUS_FAILURE; |
| 3709 | } |
| 3710 | |
| 3711 | pMac->roam.configParam.phyMode = phyMode; |
| 3712 | pMac->roam.configParam.uCfgDot11Mode = csrGetCfgDot11ModeFromCsrPhyMode(NULL, |
| 3713 | pMac->roam.configParam.phyMode, |
| 3714 | pMac->roam.configParam.ProprietaryRatesEnabled); |
| 3715 | |
| 3716 | return eHAL_STATUS_SUCCESS; |
| 3717 | } |
| 3718 | |
| 3719 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3720 | \fn sme_RoamReassoc |
| 3721 | \brief a wrapper function to request CSR to inititiate a re-association |
| 3722 | \param pProfile - can be NULL to join the currently connected AP. In that |
| 3723 | case modProfileFields should carry the modified field(s) which could trigger |
| 3724 | reassoc |
| 3725 | \param modProfileFields - fields which are part of tCsrRoamConnectedProfile |
| 3726 | that might need modification dynamically once STA is up & running and this |
| 3727 | could trigger a reassoc |
| 3728 | \param pRoamId - to get back the request ID |
| 3729 | \return eHalStatus |
| 3730 | -------------------------------------------------------------------------------*/ |
| 3731 | eHalStatus sme_RoamReassoc(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamProfile *pProfile, |
| 3732 | tCsrRoamModifyProfileFields modProfileFields, |
Madan Mohan Koyyalamudi | ea22cdc | 2012-10-18 21:02:23 -0700 | [diff] [blame] | 3733 | tANI_U32 *pRoamId, v_BOOL_t fForce) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3734 | { |
| 3735 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3736 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3737 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3738 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3739 | TRACE_CODE_SME_RX_HDD_ROAM_REASSOC, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3740 | smsLog(pMac, LOG2, FL("enter")); |
| 3741 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3742 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3743 | { |
| 3744 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3745 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3746 | if((NULL == pProfile) && (fForce == 1)) |
| 3747 | { |
Madan Mohan Koyyalamudi | 0d0e171 | 2012-10-21 12:02:45 -0700 | [diff] [blame] | 3748 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 3749 | /* to force the AP initiate fresh 802.1x authentication need to clear |
| 3750 | * the PMKID cache for that set the following boolean. this is needed |
| 3751 | * by the HS 2.0 passpoint certification 5.2.a and b testcases */ |
| 3752 | pSession->fIgnorePMKIDCache = TRUE; |
Madan Mohan Koyyalamudi | ea22cdc | 2012-10-18 21:02:23 -0700 | [diff] [blame] | 3753 | status = csrReassoc( pMac, sessionId, &modProfileFields, pRoamId , fForce); |
| 3754 | } |
| 3755 | else |
| 3756 | { |
| 3757 | status = csrRoamReassoc( pMac, sessionId, pProfile, modProfileFields, pRoamId ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3758 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3759 | } |
| 3760 | else |
| 3761 | { |
| 3762 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3763 | } |
| 3764 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3765 | } |
| 3766 | |
| 3767 | return (status); |
| 3768 | } |
| 3769 | |
| 3770 | /* --------------------------------------------------------------------------- |
| 3771 | \fn sme_RoamConnectToLastProfile |
| 3772 | \brief a wrapper function to request CSR to disconnect and reconnect with |
| 3773 | the same profile |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3774 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3775 | \return eHalStatus. It returns fail if currently connected |
| 3776 | ---------------------------------------------------------------------------*/ |
| 3777 | eHalStatus sme_RoamConnectToLastProfile(tHalHandle hHal, tANI_U8 sessionId) |
| 3778 | { |
| 3779 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3780 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3781 | |
| 3782 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3783 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3784 | { |
| 3785 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3786 | { |
| 3787 | status = csrRoamConnectToLastProfile( pMac, sessionId ); |
| 3788 | } |
| 3789 | else |
| 3790 | { |
| 3791 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3792 | } |
| 3793 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3794 | } |
| 3795 | |
| 3796 | return (status); |
| 3797 | } |
| 3798 | |
| 3799 | /* --------------------------------------------------------------------------- |
| 3800 | \fn sme_RoamDisconnect |
| 3801 | \brief a wrapper function to request CSR to disconnect from a network |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3802 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3803 | \param reason -- To indicate the reason for disconnecting. Currently, only |
| 3804 | eCSR_DISCONNECT_REASON_MIC_ERROR is meanful. |
| 3805 | \return eHalStatus |
| 3806 | ---------------------------------------------------------------------------*/ |
| 3807 | eHalStatus sme_RoamDisconnect(tHalHandle hHal, tANI_U8 sessionId, eCsrRoamDisconnectReason reason) |
| 3808 | { |
| 3809 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3810 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3811 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3812 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3813 | TRACE_CODE_SME_RX_HDD_ROAM_DISCONNECT, sessionId, reason)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3814 | smsLog(pMac, LOG2, FL("enter")); |
| 3815 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3816 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3817 | { |
| 3818 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3819 | { |
mukul sharma | bab477d | 2015-06-11 17:14:55 +0530 | [diff] [blame] | 3820 | status = csrRoamDisconnect( pMac, sessionId, reason ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3821 | } |
| 3822 | else |
| 3823 | { |
| 3824 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3825 | } |
| 3826 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3827 | } |
| 3828 | |
| 3829 | return (status); |
| 3830 | } |
| 3831 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3832 | /* --------------------------------------------------------------------------- |
Sushant Kaushik | b4834d2 | 2015-07-15 15:29:05 +0530 | [diff] [blame] | 3833 | \fn.sme_abortConnection |
| 3834 | \brief a wrapper function to request CSR to stop from connecting a network |
| 3835 | \retun void. |
| 3836 | ---------------------------------------------------------------------------*/ |
| 3837 | |
| 3838 | void sme_abortConnection(tHalHandle hHal, tANI_U8 sessionId) |
| 3839 | { |
| 3840 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3841 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3842 | |
| 3843 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3844 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3845 | { |
| 3846 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3847 | { |
| 3848 | csr_abortConnection( pMac, sessionId); |
| 3849 | } |
| 3850 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3851 | } |
| 3852 | return; |
| 3853 | } |
| 3854 | |
Abhishek Singh | e0bc099 | 2016-05-20 17:58:18 +0530 | [diff] [blame] | 3855 | /* sme_dhcp_done_ind() - send dhcp done ind |
| 3856 | * @hal: hal context |
| 3857 | * @session_id: session id |
| 3858 | * |
| 3859 | * Return: void. |
| 3860 | */ |
| 3861 | void sme_dhcp_done_ind(tHalHandle hal, uint8_t session_id) |
| 3862 | { |
| 3863 | tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); |
| 3864 | tCsrRoamSession *session; |
| 3865 | |
| 3866 | if (!mac_ctx) |
| 3867 | return; |
| 3868 | |
| 3869 | session = CSR_GET_SESSION(mac_ctx, session_id); |
| 3870 | if(!session) |
| 3871 | { |
| 3872 | smsLog(mac_ctx, LOGE, FL(" session %d not found "), session_id); |
| 3873 | return; |
| 3874 | } |
| 3875 | session->dhcp_done = true; |
| 3876 | } |
| 3877 | |
Sushant Kaushik | b4834d2 | 2015-07-15 15:29:05 +0530 | [diff] [blame] | 3878 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3879 | \fn sme_RoamStopBss |
| 3880 | \brief To stop BSS for Soft AP. This is an asynchronous API. |
| 3881 | \param hHal - Global structure |
| 3882 | \param sessionId - sessionId of SoftAP |
| 3883 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3884 | -------------------------------------------------------------------------------*/ |
| 3885 | eHalStatus sme_RoamStopBss(tHalHandle hHal, tANI_U8 sessionId) |
| 3886 | { |
| 3887 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3888 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3889 | |
| 3890 | smsLog(pMac, LOG2, FL("enter")); |
| 3891 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3892 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3893 | { |
| 3894 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3895 | { |
Gopichand Nakkala | f44bdc5 | 2013-02-16 00:54:45 +0530 | [diff] [blame] | 3896 | status = csrRoamIssueStopBssCmd( pMac, sessionId, eANI_BOOLEAN_FALSE ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3897 | } |
| 3898 | else |
| 3899 | { |
| 3900 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3901 | } |
| 3902 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3903 | } |
| 3904 | |
| 3905 | return (status); |
| 3906 | } |
| 3907 | |
| 3908 | /* --------------------------------------------------------------------------- |
| 3909 | \fn sme_RoamDisconnectSta |
| 3910 | \brief To disassociate a station. This is an asynchronous API. |
| 3911 | \param hHal - Global structure |
| 3912 | \param sessionId - sessionId of SoftAP |
| 3913 | \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) |
| 3914 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3915 | -------------------------------------------------------------------------------*/ |
| 3916 | eHalStatus sme_RoamDisconnectSta(tHalHandle hHal, tANI_U8 sessionId, |
Anand N Sunkad | c205d95 | 2015-07-30 15:36:03 +0530 | [diff] [blame] | 3917 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 3918 | const tANI_U8 *pPeerMacAddr |
| 3919 | #else |
| 3920 | tANI_U8 *pPeerMacAddr |
| 3921 | #endif |
| 3922 | ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3923 | { |
| 3924 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3925 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3926 | |
| 3927 | if ( NULL == pMac ) |
| 3928 | { |
| 3929 | VOS_ASSERT(0); |
| 3930 | return status; |
| 3931 | } |
| 3932 | |
| 3933 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3934 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3935 | { |
| 3936 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3937 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3938 | status = csrRoamIssueDisassociateStaCmd( pMac, sessionId, pPeerMacAddr, |
Madan Mohan Koyyalamudi | 299b486 | 2013-01-30 19:59:23 +0530 | [diff] [blame] | 3939 | eSIR_MAC_DEAUTH_LEAVING_BSS_REASON); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3940 | } |
| 3941 | else |
| 3942 | { |
| 3943 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3944 | } |
| 3945 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3946 | } |
| 3947 | |
| 3948 | return (status); |
| 3949 | } |
| 3950 | |
| 3951 | /* --------------------------------------------------------------------------- |
| 3952 | \fn sme_RoamDeauthSta |
| 3953 | \brief To disassociate a station. This is an asynchronous API. |
| 3954 | \param hHal - Global structure |
| 3955 | \param sessionId - sessionId of SoftAP |
Hanumantha Reddy Pothula | f57da15 | 2014-10-31 13:02:08 +0530 | [diff] [blame] | 3956 | \param pDelStaParams -Pointer to parameters of the station to deauthenticate |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3957 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3958 | -------------------------------------------------------------------------------*/ |
| 3959 | eHalStatus sme_RoamDeauthSta(tHalHandle hHal, tANI_U8 sessionId, |
Hanumantha Reddy Pothula | f57da15 | 2014-10-31 13:02:08 +0530 | [diff] [blame] | 3960 | struct tagCsrDelStaParams *pDelStaParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3961 | { |
| 3962 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3963 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3964 | |
| 3965 | if ( NULL == pMac ) |
| 3966 | { |
| 3967 | VOS_ASSERT(0); |
| 3968 | return status; |
| 3969 | } |
Konamki, Sreelakshmi | 7b464be | 2015-07-14 12:17:01 +0530 | [diff] [blame] | 3970 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 3971 | TRACE_CODE_SME_RX_HDD_MSG_DEAUTH_STA, |
| 3972 | sessionId, pDelStaParams->reason_code)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3973 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3974 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3975 | { |
| 3976 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3977 | { |
Hanumantha Reddy Pothula | f57da15 | 2014-10-31 13:02:08 +0530 | [diff] [blame] | 3978 | status = csrRoamIssueDeauthStaCmd( pMac, sessionId, pDelStaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3979 | } |
| 3980 | else |
| 3981 | { |
| 3982 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3983 | } |
| 3984 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3985 | } |
| 3986 | |
| 3987 | return (status); |
| 3988 | } |
| 3989 | |
| 3990 | /* --------------------------------------------------------------------------- |
| 3991 | \fn sme_RoamTKIPCounterMeasures |
| 3992 | \brief To start or stop TKIP counter measures. This is an asynchronous API. |
| 3993 | \param sessionId - sessionId of SoftAP |
| 3994 | \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) |
| 3995 | \return eHalStatus |
| 3996 | -------------------------------------------------------------------------------*/ |
| 3997 | eHalStatus sme_RoamTKIPCounterMeasures(tHalHandle hHal, tANI_U8 sessionId, |
| 3998 | tANI_BOOLEAN bEnable) |
| 3999 | { |
| 4000 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4001 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4002 | |
| 4003 | if ( NULL == pMac ) |
| 4004 | { |
| 4005 | VOS_ASSERT(0); |
| 4006 | return status; |
| 4007 | } |
| 4008 | |
| 4009 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4010 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4011 | { |
| 4012 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 4013 | { |
| 4014 | status = csrRoamIssueTkipCounterMeasures( pMac, sessionId, bEnable); |
| 4015 | } |
| 4016 | else |
| 4017 | { |
| 4018 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4019 | } |
| 4020 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4021 | } |
| 4022 | |
| 4023 | return (status); |
| 4024 | } |
| 4025 | |
| 4026 | /* --------------------------------------------------------------------------- |
| 4027 | \fn sme_RoamGetAssociatedStas |
| 4028 | \brief To probe the list of associated stations from various modules of CORE stack. |
| 4029 | \This is an asynchronous API. |
| 4030 | \param sessionId - sessionId of SoftAP |
| 4031 | \param modId - Module from whom list of associtated stations is to be probed. |
| 4032 | If an invalid module is passed then by default VOS_MODULE_ID_PE will be probed |
| 4033 | \param pUsrContext - Opaque HDD context |
| 4034 | \param pfnSapEventCallback - Sap event callback in HDD |
| 4035 | \param pAssocBuf - Caller allocated memory to be filled with associatd stations info |
| 4036 | \return eHalStatus |
| 4037 | -------------------------------------------------------------------------------*/ |
| 4038 | eHalStatus sme_RoamGetAssociatedStas(tHalHandle hHal, tANI_U8 sessionId, |
| 4039 | VOS_MODULE_ID modId, void *pUsrContext, |
| 4040 | void *pfnSapEventCallback, tANI_U8 *pAssocStasBuf) |
| 4041 | { |
| 4042 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4043 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4044 | |
| 4045 | if ( NULL == pMac ) |
| 4046 | { |
| 4047 | VOS_ASSERT(0); |
| 4048 | return status; |
| 4049 | } |
| 4050 | |
| 4051 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4052 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4053 | { |
| 4054 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 4055 | { |
| 4056 | status = csrRoamGetAssociatedStas( pMac, sessionId, modId, pUsrContext, pfnSapEventCallback, pAssocStasBuf ); |
| 4057 | } |
| 4058 | else |
| 4059 | { |
| 4060 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4061 | } |
| 4062 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4063 | } |
| 4064 | |
| 4065 | return (status); |
| 4066 | } |
| 4067 | |
| 4068 | /* --------------------------------------------------------------------------- |
| 4069 | \fn sme_RoamGetWpsSessionOverlap |
| 4070 | \brief To get the WPS PBC session overlap information. |
| 4071 | \This is an asynchronous API. |
| 4072 | \param sessionId - sessionId of SoftAP |
| 4073 | \param pUsrContext - Opaque HDD context |
| 4074 | \param pfnSapEventCallback - Sap event callback in HDD |
| 4075 | \pRemoveMac - pointer to Mac address which needs to be removed from session |
| 4076 | \return eHalStatus |
| 4077 | -------------------------------------------------------------------------------*/ |
| 4078 | eHalStatus sme_RoamGetWpsSessionOverlap(tHalHandle hHal, tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4079 | void *pUsrContext, void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4080 | *pfnSapEventCallback, v_MACADDR_t pRemoveMac) |
| 4081 | { |
| 4082 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4083 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4084 | |
| 4085 | if ( NULL == pMac ) |
| 4086 | { |
| 4087 | VOS_ASSERT(0); |
| 4088 | return status; |
| 4089 | } |
| 4090 | |
| 4091 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4092 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4093 | { |
| 4094 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 4095 | { |
| 4096 | status = csrRoamGetWpsSessionOverlap( pMac, sessionId, pUsrContext, pfnSapEventCallback, pRemoveMac); |
| 4097 | } |
| 4098 | else |
| 4099 | { |
| 4100 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4101 | } |
| 4102 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4103 | } |
| 4104 | |
| 4105 | return (status); |
| 4106 | } |
| 4107 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4108 | |
| 4109 | /* --------------------------------------------------------------------------- |
| 4110 | \fn sme_RoamGetConnectState |
| 4111 | \brief a wrapper function to request CSR to return the current connect state |
| 4112 | of Roaming |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4113 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4114 | \return eHalStatus |
| 4115 | ---------------------------------------------------------------------------*/ |
| 4116 | eHalStatus sme_RoamGetConnectState(tHalHandle hHal, tANI_U8 sessionId, eCsrConnectState *pState) |
| 4117 | { |
| 4118 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4119 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4120 | |
| 4121 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4122 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4123 | { |
| 4124 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 4125 | { |
| 4126 | status = csrRoamGetConnectState( pMac, sessionId, pState ); |
| 4127 | } |
| 4128 | else |
| 4129 | { |
| 4130 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4131 | } |
| 4132 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4133 | } |
| 4134 | |
| 4135 | return (status); |
| 4136 | } |
| 4137 | |
| 4138 | /* --------------------------------------------------------------------------- |
| 4139 | \fn sme_RoamGetConnectProfile |
| 4140 | \brief a wrapper function to request CSR to return the current connect |
| 4141 | profile. Caller must call csrRoamFreeConnectProfile after it is done |
| 4142 | and before reuse for another csrRoamGetConnectProfile call. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4143 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4144 | \param pProfile - pointer to a caller allocated structure |
| 4145 | tCsrRoamConnectedProfile |
| 4146 | \return eHalStatus. Failure if not connected |
| 4147 | ---------------------------------------------------------------------------*/ |
| 4148 | eHalStatus sme_RoamGetConnectProfile(tHalHandle hHal, tANI_U8 sessionId, |
| 4149 | tCsrRoamConnectedProfile *pProfile) |
| 4150 | { |
| 4151 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4152 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4153 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4154 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4155 | TRACE_CODE_SME_RX_HDD_ROAM_GET_CONNECTPROFILE, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4156 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4157 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4158 | { |
| 4159 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 4160 | { |
| 4161 | status = csrRoamGetConnectProfile( pMac, sessionId, pProfile ); |
| 4162 | } |
| 4163 | else |
| 4164 | { |
| 4165 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4166 | } |
| 4167 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4168 | } |
| 4169 | |
| 4170 | return (status); |
| 4171 | } |
| 4172 | |
| 4173 | /* --------------------------------------------------------------------------- |
| 4174 | \fn sme_RoamFreeConnectProfile |
| 4175 | \brief a wrapper function to request CSR to free and reinitialize the |
| 4176 | profile returned previously by csrRoamGetConnectProfile. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4177 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4178 | \param pProfile - pointer to a caller allocated structure |
| 4179 | tCsrRoamConnectedProfile |
| 4180 | \return eHalStatus. |
| 4181 | ---------------------------------------------------------------------------*/ |
| 4182 | eHalStatus sme_RoamFreeConnectProfile(tHalHandle hHal, |
| 4183 | tCsrRoamConnectedProfile *pProfile) |
| 4184 | { |
| 4185 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4186 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4187 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4188 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4189 | TRACE_CODE_SME_RX_HDD_ROAM_FREE_CONNECTPROFILE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4190 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4191 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4192 | { |
| 4193 | status = csrRoamFreeConnectProfile( pMac, pProfile ); |
| 4194 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4195 | } |
| 4196 | |
| 4197 | return (status); |
| 4198 | } |
| 4199 | |
| 4200 | /* --------------------------------------------------------------------------- |
| 4201 | \fn sme_RoamSetPMKIDCache |
| 4202 | \brief a wrapper function to request CSR to return the PMKID candidate list |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4203 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4204 | \param pPMKIDCache - caller allocated buffer point to an array of |
| 4205 | tPmkidCacheInfo |
| 4206 | \param numItems - a variable that has the number of tPmkidCacheInfo |
| 4207 | allocated when retruning, this is either the number needed |
| 4208 | or number of items put into pPMKIDCache |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 4209 | \param update_entire_cache - this bool value specifies if the entire pmkid |
| 4210 | cache should be overwritten or should it be |
| 4211 | updated entry by entry. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4212 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 4213 | big enough and pNumItems has the number of |
| 4214 | tPmkidCacheInfo. |
| 4215 | \Note: pNumItems is a number of tPmkidCacheInfo, |
| 4216 | not sizeof(tPmkidCacheInfo) * something |
| 4217 | ---------------------------------------------------------------------------*/ |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 4218 | eHalStatus sme_RoamSetPMKIDCache( tHalHandle hHal, tANI_U8 sessionId, |
| 4219 | tPmkidCacheInfo *pPMKIDCache, |
| 4220 | tANI_U32 numItems, |
| 4221 | tANI_BOOLEAN update_entire_cache ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4222 | { |
| 4223 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4224 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4225 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4226 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4227 | TRACE_CODE_SME_RX_HDD_ROAM_SET_PMKIDCACHE, sessionId, numItems)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4228 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4229 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4230 | { |
| 4231 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 4232 | { |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 4233 | status = csrRoamSetPMKIDCache( pMac, sessionId, pPMKIDCache, |
| 4234 | numItems, update_entire_cache ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4235 | } |
| 4236 | else |
| 4237 | { |
| 4238 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4239 | } |
| 4240 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4241 | } |
| 4242 | |
| 4243 | return (status); |
| 4244 | } |
| 4245 | |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 4246 | eHalStatus sme_RoamDelPMKIDfromCache( tHalHandle hHal, tANI_U8 sessionId, |
Anand N Sunkad | b3ab97d | 2015-07-29 09:58:13 +0530 | [diff] [blame] | 4247 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 4248 | const tANI_U8 *pBSSId, |
| 4249 | #else |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 4250 | tANI_U8 *pBSSId, |
Anand N Sunkad | b3ab97d | 2015-07-29 09:58:13 +0530 | [diff] [blame] | 4251 | #endif |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 4252 | tANI_BOOLEAN flush_cache ) |
Leela Venkata Kiran Kumar Reddy Chirala | ede1065 | 2013-09-11 18:48:46 -0700 | [diff] [blame] | 4253 | { |
| 4254 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4255 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4256 | status = sme_AcquireGlobalLock( &pMac->sme ); |
Konamki, Sreelakshmi | 7b464be | 2015-07-14 12:17:01 +0530 | [diff] [blame] | 4257 | |
| 4258 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 4259 | TRACE_CODE_SME_RX_HDD_ROAM_DEL_PMKIDCACHE, sessionId, flush_cache)); |
Leela Venkata Kiran Kumar Reddy Chirala | ede1065 | 2013-09-11 18:48:46 -0700 | [diff] [blame] | 4260 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4261 | { |
| 4262 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 4263 | { |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 4264 | status = csrRoamDelPMKIDfromCache( pMac, sessionId, |
| 4265 | pBSSId, flush_cache ); |
Leela Venkata Kiran Kumar Reddy Chirala | ede1065 | 2013-09-11 18:48:46 -0700 | [diff] [blame] | 4266 | } |
| 4267 | else |
| 4268 | { |
| 4269 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4270 | } |
| 4271 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4272 | } |
| 4273 | return (status); |
| 4274 | } |
Wilson Yang | 47b5819 | 2013-12-11 11:40:19 -0800 | [diff] [blame] | 4275 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4276 | /* --------------------------------------------------------------------------- |
| 4277 | \fn sme_RoamGetSecurityReqIE |
| 4278 | \brief a wrapper function to request CSR to return the WPA or RSN or WAPI IE CSR |
| 4279 | passes to PE to JOIN request or START_BSS request |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4280 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4281 | \param pLen - caller allocated memory that has the length of pBuf as input. |
| 4282 | Upon returned, *pLen has the needed or IE length in pBuf. |
| 4283 | \param pBuf - Caller allocated memory that contain the IE field, if any, |
| 4284 | upon return |
| 4285 | \param secType - Specifies whether looking for WPA/WPA2/WAPI IE |
| 4286 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 4287 | big enough |
| 4288 | ---------------------------------------------------------------------------*/ |
| 4289 | eHalStatus sme_RoamGetSecurityReqIE(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pLen, |
| 4290 | tANI_U8 *pBuf, eCsrSecurityType secType) |
| 4291 | { |
| 4292 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4293 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4294 | |
| 4295 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4296 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4297 | { |
| 4298 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 4299 | { |
| 4300 | status = csrRoamGetWpaRsnReqIE( hHal, sessionId, pLen, pBuf ); |
| 4301 | } |
| 4302 | else |
| 4303 | { |
| 4304 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4305 | } |
| 4306 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4307 | } |
| 4308 | |
| 4309 | return (status); |
| 4310 | } |
| 4311 | |
| 4312 | /* --------------------------------------------------------------------------- |
| 4313 | \fn sme_RoamGetSecurityRspIE |
| 4314 | \brief a wrapper function to request CSR to return the WPA or RSN or WAPI IE from |
| 4315 | the beacon or probe rsp if connected |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4316 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4317 | \param pLen - caller allocated memory that has the length of pBuf as input. |
| 4318 | Upon returned, *pLen has the needed or IE length in pBuf. |
| 4319 | \param pBuf - Caller allocated memory that contain the IE field, if any, |
| 4320 | upon return |
| 4321 | \param secType - Specifies whether looking for WPA/WPA2/WAPI IE |
| 4322 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 4323 | big enough |
| 4324 | ---------------------------------------------------------------------------*/ |
| 4325 | eHalStatus sme_RoamGetSecurityRspIE(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pLen, |
| 4326 | tANI_U8 *pBuf, eCsrSecurityType secType) |
| 4327 | { |
| 4328 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4329 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4330 | |
| 4331 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4332 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4333 | { |
| 4334 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 4335 | { |
| 4336 | status = csrRoamGetWpaRsnRspIE( pMac, sessionId, pLen, pBuf ); |
| 4337 | } |
| 4338 | else |
| 4339 | { |
| 4340 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4341 | } |
| 4342 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4343 | } |
| 4344 | |
| 4345 | return (status); |
| 4346 | |
| 4347 | } |
| 4348 | |
| 4349 | |
| 4350 | /* --------------------------------------------------------------------------- |
| 4351 | \fn sme_RoamGetNumPMKIDCache |
| 4352 | \brief a wrapper function to request CSR to return number of PMKID cache |
| 4353 | entries |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4354 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4355 | \return tANI_U32 - the number of PMKID cache entries |
| 4356 | ---------------------------------------------------------------------------*/ |
| 4357 | tANI_U32 sme_RoamGetNumPMKIDCache(tHalHandle hHal, tANI_U8 sessionId) |
| 4358 | { |
| 4359 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4360 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4361 | tANI_U32 numPmkidCache = 0; |
| 4362 | |
| 4363 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4364 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4365 | { |
| 4366 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 4367 | { |
| 4368 | numPmkidCache = csrRoamGetNumPMKIDCache( pMac, sessionId ); |
| 4369 | status = eHAL_STATUS_SUCCESS; |
| 4370 | } |
| 4371 | else |
| 4372 | { |
| 4373 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4374 | } |
| 4375 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4376 | } |
| 4377 | |
| 4378 | return (numPmkidCache); |
| 4379 | } |
| 4380 | |
| 4381 | /* --------------------------------------------------------------------------- |
| 4382 | \fn sme_RoamGetPMKIDCache |
| 4383 | \brief a wrapper function to request CSR to return PMKID cache from CSR |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4384 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4385 | \param pNum - caller allocated memory that has the space of the number of |
| 4386 | pBuf tPmkidCacheInfo as input. Upon returned, *pNum has the |
| 4387 | needed or actually number in tPmkidCacheInfo. |
| 4388 | \param pPmkidCache - Caller allocated memory that contains PMKID cache, if |
| 4389 | any, upon return |
| 4390 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 4391 | big enough |
| 4392 | ---------------------------------------------------------------------------*/ |
| 4393 | eHalStatus sme_RoamGetPMKIDCache(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pNum, |
| 4394 | tPmkidCacheInfo *pPmkidCache) |
| 4395 | { |
| 4396 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4397 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4398 | |
| 4399 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4400 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4401 | { |
| 4402 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 4403 | { |
| 4404 | status = csrRoamGetPMKIDCache( pMac, sessionId, pNum, pPmkidCache ); |
| 4405 | } |
| 4406 | else |
| 4407 | { |
| 4408 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4409 | } |
| 4410 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4411 | } |
| 4412 | |
| 4413 | return (status); |
| 4414 | } |
| 4415 | |
| 4416 | |
| 4417 | /* --------------------------------------------------------------------------- |
| 4418 | \fn sme_GetConfigParam |
| 4419 | \brief a wrapper function that HDD calls to get the global settings |
| 4420 | currently maintained by CSR. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4421 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4422 | \param pParam - caller allocated memory |
| 4423 | \return eHalStatus |
| 4424 | ---------------------------------------------------------------------------*/ |
| 4425 | eHalStatus sme_GetConfigParam(tHalHandle hHal, tSmeConfigParams *pParam) |
| 4426 | { |
| 4427 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4428 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4429 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4430 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4431 | TRACE_CODE_SME_RX_HDD_GET_CONFIGPARAM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4432 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4433 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4434 | { |
| 4435 | status = csrGetConfigParam(pMac, &pParam->csrConfig); |
| 4436 | if (status != eHAL_STATUS_SUCCESS) |
| 4437 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4438 | smsLog( pMac, LOGE, "%s csrGetConfigParam failed", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4439 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4440 | return status; |
| 4441 | } |
| 4442 | #if defined WLAN_FEATURE_P2P_INTERNAL |
| 4443 | status = p2pGetConfigParam(pMac, &pParam->p2pConfig); |
| 4444 | if (status != eHAL_STATUS_SUCCESS) |
| 4445 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4446 | smsLog( pMac, LOGE, "%s p2pGetConfigParam failed", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4447 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4448 | return status; |
| 4449 | } |
| 4450 | #endif |
Chandrasekaran, Manishekar | eebd164 | 2015-03-16 10:35:03 +0530 | [diff] [blame] | 4451 | pParam->fBtcEnableIndTimerVal = pMac->fBtcEnableIndTimerVal; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4452 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4453 | } |
| 4454 | |
| 4455 | return (status); |
| 4456 | } |
| 4457 | |
| 4458 | /* --------------------------------------------------------------------------- |
| 4459 | \fn sme_CfgSetInt |
| 4460 | \brief a wrapper function that HDD calls to set parameters in CFG. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4461 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4462 | \param cfgId - Configuration Parameter ID (type) for STA. |
| 4463 | \param ccmValue - The information related to Configuration Parameter ID |
| 4464 | which needs to be saved in CFG |
| 4465 | \param callback - To be registered by CSR with CCM. Once the CFG done with |
| 4466 | saving the information in the database, it notifies CCM & |
| 4467 | then the callback will be invoked to notify. |
| 4468 | \param toBeSaved - To save the request for future reference |
| 4469 | \return eHalStatus |
| 4470 | ---------------------------------------------------------------------------*/ |
| 4471 | eHalStatus sme_CfgSetInt(tHalHandle hHal, tANI_U32 cfgId, tANI_U32 ccmValue, |
| 4472 | tCcmCfgSetCallback callback, eAniBoolean toBeSaved) |
| 4473 | { |
| 4474 | return(ccmCfgSetInt(hHal, cfgId, ccmValue, callback, toBeSaved)); |
| 4475 | } |
| 4476 | |
| 4477 | /* --------------------------------------------------------------------------- |
| 4478 | \fn sme_CfgSetStr |
| 4479 | \brief a wrapper function that HDD calls to set parameters in CFG. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4480 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4481 | \param cfgId - Configuration Parameter ID (type) for STA. |
| 4482 | \param pStr - Pointer to the byte array which carries the information needs |
| 4483 | to be saved in CFG |
| 4484 | \param length - Length of the data to be saved |
| 4485 | \param callback - To be registered by CSR with CCM. Once the CFG done with |
| 4486 | saving the information in the database, it notifies CCM & |
| 4487 | then the callback will be invoked to notify. |
| 4488 | \param toBeSaved - To save the request for future reference |
| 4489 | \return eHalStatus |
| 4490 | ---------------------------------------------------------------------------*/ |
| 4491 | eHalStatus sme_CfgSetStr(tHalHandle hHal, tANI_U32 cfgId, tANI_U8 *pStr, |
| 4492 | tANI_U32 length, tCcmCfgSetCallback callback, |
| 4493 | eAniBoolean toBeSaved) |
| 4494 | { |
| 4495 | return(ccmCfgSetStr(hHal, cfgId, pStr, length, callback, toBeSaved)); |
| 4496 | } |
| 4497 | |
| 4498 | /* --------------------------------------------------------------------------- |
Sandeep Puligilla | a3e7695 | 2014-06-23 15:53:11 +0530 | [diff] [blame] | 4499 | \fn sme_GetModifyProfileFields |
| 4500 | \brief HDD or SME - QOS calls this function to get the current values of |
| 4501 | connected profile fields, changing which can cause reassoc. |
| 4502 | This function must be called after CFG is downloaded and STA is in connected |
| 4503 | state. Also, make sure to call this function to get the current profile |
| 4504 | fields before calling the reassoc. So that pModifyProfileFields will have |
| 4505 | all the latest values plus the one(s) has been updated as part of reassoc |
| 4506 | request. |
| 4507 | \param pModifyProfileFields - pointer to the connected profile fields |
| 4508 | changing which can cause reassoc |
| 4509 | |
| 4510 | \return eHalStatus |
| 4511 | -------------------------------------------------------------------------------*/ |
| 4512 | eHalStatus sme_GetModifyProfileFields(tHalHandle hHal, tANI_U8 sessionId, |
| 4513 | tCsrRoamModifyProfileFields * pModifyProfileFields) |
| 4514 | { |
| 4515 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4516 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4517 | |
| 4518 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 4519 | TRACE_CODE_SME_RX_HDD_GET_MODPROFFIELDS, sessionId, 0)); |
| 4520 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4521 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4522 | { |
| 4523 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 4524 | { |
| 4525 | status = csrGetModifyProfileFields(pMac, sessionId, pModifyProfileFields); |
| 4526 | } |
| 4527 | else |
| 4528 | { |
| 4529 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4530 | } |
| 4531 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4532 | } |
| 4533 | |
| 4534 | return (status); |
| 4535 | } |
| 4536 | |
| 4537 | /* --------------------------------------------------------------------------- |
Sandeep Puligilla | 332ea91 | 2014-02-04 00:16:24 +0530 | [diff] [blame] | 4538 | \fn sme_HT40StopOBSSScan |
| 4539 | \brief HDD or SME - Command to stop the OBSS scan |
| 4540 | THis is implemented only for debugging purpose. |
| 4541 | As per spec while operating in 2.4GHz OBSS scan shouldnt be stopped. |
| 4542 | \param sessionId - sessionId |
| 4543 | changing which can cause reassoc |
| 4544 | |
| 4545 | \return eHalStatus |
| 4546 | -------------------------------------------------------------------------------*/ |
| 4547 | eHalStatus sme_HT40StopOBSSScan(tHalHandle hHal, tANI_U8 sessionId) |
| 4548 | { |
| 4549 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4550 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4551 | |
| 4552 | smsLog(pMac, LOG2, FL("enter")); |
| 4553 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4554 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4555 | { |
| 4556 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 4557 | { |
| 4558 | csrHT40StopOBSSScan( pMac, sessionId ); |
| 4559 | } |
| 4560 | else |
| 4561 | { |
| 4562 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 4563 | "%s: Invalid session sessionId %d", __func__,sessionId); |
| 4564 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4565 | } |
| 4566 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4567 | } |
| 4568 | return (status); |
| 4569 | } |
| 4570 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4571 | /*-------------------------------------------------------------------------- |
| 4572 | \fn sme_SetConfigPowerSave |
| 4573 | \brief Wrapper fn to change power save configuration in SME (PMC) module. |
| 4574 | For BMPS related configuration, this function also updates the CFG |
| 4575 | and sends a message to FW to pick up the new values. Note: Calling |
| 4576 | this function only updates the configuration and does not enable |
| 4577 | the specified power save mode. |
| 4578 | \param hHal - The handle returned by macOpen. |
| 4579 | \param psMode - Power Saving mode being modified |
| 4580 | \param pConfigParams - a pointer to a caller allocated object of type |
| 4581 | tPmcSmpsConfigParams or tPmcBmpsConfigParams or tPmcImpsConfigParams |
| 4582 | \return eHalStatus |
| 4583 | --------------------------------------------------------------------------*/ |
| 4584 | eHalStatus sme_SetConfigPowerSave(tHalHandle hHal, tPmcPowerSavingMode psMode, |
| 4585 | void *pConfigParams) |
| 4586 | { |
| 4587 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4588 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4589 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4590 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4591 | TRACE_CODE_SME_RX_HDD_SET_CONFIG_PWRSAVE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4592 | if (NULL == pConfigParams ) { |
| 4593 | smsLog( pMac, LOGE, "Empty config param structure for PMC, " |
| 4594 | "nothing to update"); |
| 4595 | return eHAL_STATUS_FAILURE; |
| 4596 | } |
| 4597 | |
| 4598 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4599 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4600 | { |
| 4601 | status = pmcSetConfigPowerSave(hHal, psMode, pConfigParams); |
| 4602 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4603 | } |
| 4604 | |
| 4605 | return (status); |
| 4606 | } |
| 4607 | |
| 4608 | /*-------------------------------------------------------------------------- |
| 4609 | \fn sme_GetConfigPowerSave |
| 4610 | \brief Wrapper fn to retrieve power save configuration in SME (PMC) module |
| 4611 | \param hHal - The handle returned by macOpen. |
| 4612 | \param psMode - Power Saving mode |
| 4613 | \param pConfigParams - a pointer to a caller allocated object of type |
| 4614 | tPmcSmpsConfigParams or tPmcBmpsConfigParams or tPmcImpsConfigParams |
| 4615 | \return eHalStatus |
| 4616 | --------------------------------------------------------------------------*/ |
| 4617 | eHalStatus sme_GetConfigPowerSave(tHalHandle hHal, tPmcPowerSavingMode psMode, |
| 4618 | void *pConfigParams) |
| 4619 | { |
| 4620 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4621 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4622 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4623 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4624 | TRACE_CODE_SME_RX_HDD_GET_CONFIG_PWRSAVE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4625 | if (NULL == pConfigParams ) { |
| 4626 | smsLog( pMac, LOGE, "Empty config param structure for PMC, " |
| 4627 | "nothing to update"); |
| 4628 | return eHAL_STATUS_FAILURE; |
| 4629 | } |
| 4630 | |
| 4631 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4632 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4633 | { |
| 4634 | status = pmcGetConfigPowerSave(hHal, psMode, pConfigParams); |
| 4635 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4636 | } |
| 4637 | |
| 4638 | return (status); |
| 4639 | } |
| 4640 | |
| 4641 | /* --------------------------------------------------------------------------- |
| 4642 | \fn sme_SignalPowerEvent |
| 4643 | \brief Signals to PMC that a power event has occurred. Used for putting |
| 4644 | the chip into deep sleep mode. |
| 4645 | \param hHal - The handle returned by macOpen. |
| 4646 | \param event - the event that has occurred |
| 4647 | \return eHalStatus |
| 4648 | ---------------------------------------------------------------------------*/ |
| 4649 | eHalStatus sme_SignalPowerEvent (tHalHandle hHal, tPmcPowerEvent event) |
| 4650 | { |
| 4651 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4652 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4653 | |
| 4654 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4655 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4656 | { |
| 4657 | status = pmcSignalPowerEvent(hHal, event); |
| 4658 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4659 | } |
| 4660 | |
| 4661 | return (status); |
| 4662 | } |
| 4663 | |
| 4664 | /* --------------------------------------------------------------------------- |
| 4665 | \fn sme_EnablePowerSave |
| 4666 | \brief Enables one of the power saving modes. |
| 4667 | \param hHal - The handle returned by macOpen. |
| 4668 | \param psMode - The power saving mode to enable. If BMPS mode is enabled |
| 4669 | while the chip is operating in Full Power, PMC will start |
| 4670 | a timer that will try to put the chip in BMPS mode after |
| 4671 | expiry. |
| 4672 | \return eHalStatus |
| 4673 | ---------------------------------------------------------------------------*/ |
| 4674 | eHalStatus sme_EnablePowerSave (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 4675 | { |
| 4676 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4677 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4678 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4679 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4680 | TRACE_CODE_SME_RX_HDD_ENABLE_PWRSAVE, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4681 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4682 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4683 | { |
| 4684 | status = pmcEnablePowerSave(hHal, psMode); |
| 4685 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4686 | } |
| 4687 | |
| 4688 | return (status); |
| 4689 | } |
| 4690 | |
| 4691 | /* --------------------------------------------------------------------------- |
| 4692 | \fn sme_DisablePowerSave |
| 4693 | \brief Disables one of the power saving modes. |
| 4694 | \param hHal - The handle returned by macOpen. |
| 4695 | \param psMode - The power saving mode to disable. Disabling does not imply |
| 4696 | that device will be brought out of the current PS mode. This |
| 4697 | is purely a configuration API. |
| 4698 | \return eHalStatus |
| 4699 | ---------------------------------------------------------------------------*/ |
| 4700 | eHalStatus sme_DisablePowerSave (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 4701 | { |
| 4702 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4703 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4704 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4705 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4706 | TRACE_CODE_SME_RX_HDD_DISABLE_PWRSAVE, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4707 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4708 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4709 | { |
| 4710 | status = pmcDisablePowerSave(hHal, psMode); |
| 4711 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4712 | } |
| 4713 | |
| 4714 | return (status); |
| 4715 | } |
| 4716 | |
| 4717 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 69b3418 | 2013-01-16 08:51:40 +0530 | [diff] [blame] | 4718 | + \fn sme_SetHostPowerSave |
| 4719 | + \brief Enables BMPS logic to be controlled by User level apps |
| 4720 | + \param hHal - The handle returned by macOpen. |
| 4721 | + \param psMode - The power saving mode to disable. Disabling does not imply |
| 4722 | + that device will be brought out of the current PS mode. This |
| 4723 | + is purely a configuration API. |
| 4724 | + \return eHalStatus |
| 4725 | + ---------------------------------------------------------------------------*/ |
| 4726 | eHalStatus sme_SetHostPowerSave (tHalHandle hHal, v_BOOL_t psMode) |
| 4727 | { |
| 4728 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4729 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4730 | |
| 4731 | pMac->pmc.isHostPsEn = psMode; |
| 4732 | |
| 4733 | return (status); |
| 4734 | } |
| 4735 | |
| 4736 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4737 | \fn sme_StartAutoBmpsTimer |
| 4738 | \brief Starts a timer that periodically polls all the registered |
| 4739 | module for entry into Bmps mode. This timer is started only if BMPS is |
| 4740 | enabled and whenever the device is in full power. |
| 4741 | \param hHal - The handle returned by macOpen. |
| 4742 | \return eHalStatus |
| 4743 | ---------------------------------------------------------------------------*/ |
| 4744 | eHalStatus sme_StartAutoBmpsTimer ( tHalHandle hHal) |
| 4745 | { |
| 4746 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4747 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4748 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4749 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4750 | TRACE_CODE_SME_RX_HDD_START_AUTO_BMPSTIMER, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4751 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4752 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4753 | { |
| 4754 | status = pmcStartAutoBmpsTimer(hHal); |
| 4755 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4756 | } |
| 4757 | |
| 4758 | return (status); |
| 4759 | } |
| 4760 | /* --------------------------------------------------------------------------- |
| 4761 | \fn sme_StopAutoBmpsTimer |
| 4762 | \brief Stops the Auto BMPS Timer that was started using sme_startAutoBmpsTimer |
| 4763 | Stopping the timer does not cause a device state change. Only the timer |
| 4764 | is stopped. If "Full Power" is desired, use the sme_RequestFullPower API |
| 4765 | \param hHal - The handle returned by macOpen. |
| 4766 | \return eHalStatus |
| 4767 | ---------------------------------------------------------------------------*/ |
| 4768 | eHalStatus sme_StopAutoBmpsTimer ( tHalHandle hHal) |
| 4769 | { |
| 4770 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4771 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4772 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4773 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4774 | TRACE_CODE_SME_RX_HDD_STOP_AUTO_BMPSTIMER, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4775 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4776 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4777 | { |
| 4778 | status = pmcStopAutoBmpsTimer(hHal); |
| 4779 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4780 | } |
| 4781 | |
| 4782 | return (status); |
| 4783 | } |
| 4784 | /* --------------------------------------------------------------------------- |
| 4785 | \fn sme_QueryPowerState |
| 4786 | \brief Returns the current power state of the device. |
| 4787 | \param hHal - The handle returned by macOpen. |
| 4788 | \param pPowerState - pointer to location to return power state (LOW or HIGH) |
| 4789 | \param pSwWlanSwitchState - ptr to location to return SW WLAN Switch state |
| 4790 | \return eHalStatus |
| 4791 | ---------------------------------------------------------------------------*/ |
| 4792 | eHalStatus sme_QueryPowerState ( |
| 4793 | tHalHandle hHal, |
| 4794 | tPmcPowerState *pPowerState, |
| 4795 | tPmcSwitchState *pSwWlanSwitchState) |
| 4796 | { |
| 4797 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4798 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4799 | |
| 4800 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4801 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4802 | { |
| 4803 | status = pmcQueryPowerState (hHal, pPowerState, NULL, pSwWlanSwitchState); |
| 4804 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4805 | } |
| 4806 | |
| 4807 | return (status); |
| 4808 | } |
| 4809 | |
| 4810 | /* --------------------------------------------------------------------------- |
| 4811 | \fn sme_IsPowerSaveEnabled |
| 4812 | \brief Checks if the device is able to enter a particular power save mode |
| 4813 | This does not imply that the device is in a particular PS mode |
| 4814 | \param hHal - The handle returned by macOpen. |
| 4815 | \param psMode - the power saving mode |
| 4816 | \return eHalStatus |
| 4817 | ---------------------------------------------------------------------------*/ |
| 4818 | tANI_BOOLEAN sme_IsPowerSaveEnabled (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 4819 | { |
| 4820 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4821 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4822 | tANI_BOOLEAN result = false; |
| 4823 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4824 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4825 | TRACE_CODE_SME_RX_HDD_IS_PWRSAVE_ENABLED, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4826 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4827 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4828 | { |
| 4829 | result = pmcIsPowerSaveEnabled(hHal, psMode); |
| 4830 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4831 | return result; |
| 4832 | } |
| 4833 | |
| 4834 | return false; |
| 4835 | } |
| 4836 | |
| 4837 | /* --------------------------------------------------------------------------- |
| 4838 | \fn sme_RequestFullPower |
| 4839 | \brief Request that the device be brought to full power state. When the |
| 4840 | device enters Full Power PMC will start a BMPS timer if BMPS PS mode |
| 4841 | is enabled. On timer expiry PMC will attempt to put the device in |
| 4842 | BMPS mode if following holds true: |
| 4843 | - BMPS mode is enabled |
| 4844 | - Polling of all modules through the Power Save Check routine passes |
| 4845 | - STA is associated to an access point |
| 4846 | \param hHal - The handle returned by macOpen. |
| 4847 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4848 | \return eHalStatus - status |
| 4849 | eHAL_STATUS_SUCCESS - device brought to full power state |
| 4850 | eHAL_STATUS_FAILURE - device cannot be brought to full power state |
| 4851 | eHAL_STATUS_PMC_PENDING - device is being brought to full power state, |
| 4852 | ---------------------------------------------------------------------------*/ |
| 4853 | eHalStatus sme_RequestFullPower ( |
| 4854 | tHalHandle hHal, |
| 4855 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4856 | void *callbackContext, |
| 4857 | tRequestFullPowerReason fullPowerReason) |
| 4858 | { |
| 4859 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4860 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4861 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4862 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4863 | TRACE_CODE_SME_RX_HDD_REQUEST_FULLPOWER, NO_SESSION, fullPowerReason)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4864 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4865 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4866 | { |
| 4867 | status = pmcRequestFullPower(hHal, callbackRoutine, callbackContext, fullPowerReason); |
| 4868 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4869 | } |
| 4870 | |
| 4871 | return (status); |
| 4872 | } |
| 4873 | |
| 4874 | /* --------------------------------------------------------------------------- |
| 4875 | \fn sme_RequestBmps |
| 4876 | \brief Request that the device be put in BMPS state. Request will be |
| 4877 | accepted only if BMPS mode is enabled and power save check routine |
| 4878 | passes. |
| 4879 | \param hHal - The handle returned by macOpen. |
| 4880 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4881 | \return eHalStatus |
| 4882 | eHAL_STATUS_SUCCESS - device is in BMPS state |
| 4883 | eHAL_STATUS_FAILURE - device cannot be brought to BMPS state |
| 4884 | eHAL_STATUS_PMC_PENDING - device is being brought to BMPS state |
| 4885 | ---------------------------------------------------------------------------*/ |
| 4886 | eHalStatus sme_RequestBmps ( |
| 4887 | tHalHandle hHal, |
| 4888 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4889 | void *callbackContext) |
| 4890 | { |
| 4891 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4892 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4893 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4894 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4895 | TRACE_CODE_SME_RX_HDD_REQUEST_BMPS, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4896 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4897 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4898 | { |
| 4899 | status = pmcRequestBmps(hHal, callbackRoutine, callbackContext); |
| 4900 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4901 | } |
| 4902 | |
| 4903 | return (status); |
| 4904 | } |
| 4905 | |
| 4906 | |
| 4907 | /* --------------------------------------------------------------------------- |
| 4908 | \fn sme_SetDHCPTillPowerActiveFlag |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4909 | \brief Sets/Clears DHCP related flag in PMC to disable/enable auto BMPS |
| 4910 | entry by PMC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4911 | \param hHal - The handle returned by macOpen. |
| 4912 | ---------------------------------------------------------------------------*/ |
| 4913 | void sme_SetDHCPTillPowerActiveFlag(tHalHandle hHal, tANI_U8 flag) |
| 4914 | { |
| 4915 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4916 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4917 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4918 | TRACE_CODE_SME_RX_HDD_SET_DHCP_FLAG, NO_SESSION, flag)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4919 | // Set/Clear the DHCP flag which will disable/enable auto BMPS entery by PMC |
| 4920 | pMac->pmc.remainInPowerActiveTillDHCP = flag; |
| 4921 | } |
| 4922 | |
| 4923 | |
| 4924 | /* --------------------------------------------------------------------------- |
| 4925 | \fn sme_StartUapsd |
| 4926 | \brief Request that the device be put in UAPSD state. If the device is in |
| 4927 | Full Power it will be put in BMPS mode first and then into UAPSD |
| 4928 | mode. |
| 4929 | \param hHal - The handle returned by macOpen. |
| 4930 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4931 | eHAL_STATUS_SUCCESS - device is in UAPSD state |
| 4932 | eHAL_STATUS_FAILURE - device cannot be brought to UAPSD state |
| 4933 | eHAL_STATUS_PMC_PENDING - device is being brought to UAPSD state |
| 4934 | eHAL_STATUS_PMC_DISABLED - UAPSD is disabled or BMPS mode is disabled |
| 4935 | \return eHalStatus |
| 4936 | ---------------------------------------------------------------------------*/ |
| 4937 | eHalStatus sme_StartUapsd ( |
| 4938 | tHalHandle hHal, |
| 4939 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4940 | void *callbackContext) |
| 4941 | { |
| 4942 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4943 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4944 | |
| 4945 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4946 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4947 | { |
| 4948 | status = pmcStartUapsd(hHal, callbackRoutine, callbackContext); |
| 4949 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4950 | } |
| 4951 | |
| 4952 | return (status); |
| 4953 | } |
| 4954 | |
| 4955 | /* --------------------------------------------------------------------------- |
| 4956 | \fn sme_StopUapsd |
| 4957 | \brief Request that the device be put out of UAPSD state. Device will be |
| 4958 | put in in BMPS state after stop UAPSD completes. |
| 4959 | \param hHal - The handle returned by macOpen. |
| 4960 | \return eHalStatus |
| 4961 | eHAL_STATUS_SUCCESS - device is put out of UAPSD and back in BMPS state |
| 4962 | eHAL_STATUS_FAILURE - device cannot be brought out of UAPSD state |
| 4963 | ---------------------------------------------------------------------------*/ |
| 4964 | eHalStatus sme_StopUapsd (tHalHandle hHal) |
| 4965 | { |
| 4966 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4967 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4968 | |
| 4969 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4970 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4971 | { |
| 4972 | status = pmcStopUapsd(hHal); |
| 4973 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4974 | } |
| 4975 | |
| 4976 | return (status); |
| 4977 | } |
| 4978 | |
| 4979 | /* --------------------------------------------------------------------------- |
| 4980 | \fn sme_RequestStandby |
| 4981 | \brief Request that the device be put in standby. It is HDD's responsibility |
| 4982 | to bring the chip to full power and do a disassoc before calling |
| 4983 | this API. |
| 4984 | \param hHal - The handle returned by macOpen. |
| 4985 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4986 | \return eHalStatus |
| 4987 | eHAL_STATUS_SUCCESS - device is in Standby mode |
| 4988 | eHAL_STATUS_FAILURE - device cannot be put in standby mode |
| 4989 | eHAL_STATUS_PMC_PENDING - device is being put in standby mode |
| 4990 | ---------------------------------------------------------------------------*/ |
| 4991 | eHalStatus sme_RequestStandby ( |
| 4992 | tHalHandle hHal, |
| 4993 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4994 | void *callbackContext) |
| 4995 | { |
| 4996 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4997 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4998 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4999 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5000 | TRACE_CODE_SME_RX_HDD_REQUEST_STANDBY, NO_SESSION, 0)); |
Agarwal Ashish | e3cca2a | 2013-07-21 03:01:48 +0530 | [diff] [blame] | 5001 | smsLog( pMac, LOG1, FL(" called") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5002 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5003 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5004 | { |
| 5005 | status = pmcRequestStandby(hHal, callbackRoutine, callbackContext); |
| 5006 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5007 | } |
| 5008 | |
| 5009 | return (status); |
| 5010 | } |
| 5011 | |
| 5012 | /* --------------------------------------------------------------------------- |
| 5013 | \fn sme_RegisterPowerSaveCheck |
| 5014 | \brief Register a power save check routine that is called whenever |
| 5015 | the device is about to enter one of the power save modes. |
| 5016 | \param hHal - The handle returned by macOpen. |
| 5017 | \param checkRoutine - Power save check routine to be registered |
| 5018 | \return eHalStatus |
| 5019 | eHAL_STATUS_SUCCESS - successfully registered |
| 5020 | eHAL_STATUS_FAILURE - not successfully registered |
| 5021 | ---------------------------------------------------------------------------*/ |
| 5022 | eHalStatus sme_RegisterPowerSaveCheck ( |
| 5023 | tHalHandle hHal, |
| 5024 | tANI_BOOLEAN (*checkRoutine) (void *checkContext), void *checkContext) |
| 5025 | { |
| 5026 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5027 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5028 | |
| 5029 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5030 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5031 | { |
| 5032 | status = pmcRegisterPowerSaveCheck (hHal, checkRoutine, checkContext); |
| 5033 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5034 | } |
| 5035 | |
| 5036 | return (status); |
| 5037 | } |
| 5038 | |
| 5039 | /* --------------------------------------------------------------------------- |
Mihir Shete | fc7ff5b | 2014-01-27 11:30:05 +0530 | [diff] [blame] | 5040 | \fn sme_Register11dScanDoneCallback |
| 5041 | \brief Register a routine of type csrScanCompleteCallback which is |
| 5042 | called whenever an 11d scan is done |
| 5043 | \param hHal - The handle returned by macOpen. |
| 5044 | \param callback - 11d scan complete routine to be registered |
| 5045 | \return eHalStatus |
| 5046 | ---------------------------------------------------------------------------*/ |
| 5047 | eHalStatus sme_Register11dScanDoneCallback ( |
| 5048 | tHalHandle hHal, |
| 5049 | csrScanCompleteCallback callback) |
| 5050 | { |
| 5051 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 5052 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5053 | |
| 5054 | pMac->scan.callback11dScanDone = callback; |
| 5055 | |
| 5056 | return (status); |
| 5057 | } |
| 5058 | |
| 5059 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5060 | \fn sme_DeregisterPowerSaveCheck |
| 5061 | \brief Deregister a power save check routine |
| 5062 | \param hHal - The handle returned by macOpen. |
| 5063 | \param checkRoutine - Power save check routine to be deregistered |
| 5064 | \return eHalStatus |
| 5065 | eHAL_STATUS_SUCCESS - successfully deregistered |
| 5066 | eHAL_STATUS_FAILURE - not successfully deregistered |
| 5067 | ---------------------------------------------------------------------------*/ |
| 5068 | eHalStatus sme_DeregisterPowerSaveCheck ( |
| 5069 | tHalHandle hHal, |
| 5070 | tANI_BOOLEAN (*checkRoutine) (void *checkContext)) |
| 5071 | { |
| 5072 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5073 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5074 | |
| 5075 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5076 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5077 | { |
| 5078 | status = pmcDeregisterPowerSaveCheck (hHal, checkRoutine); |
| 5079 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5080 | } |
| 5081 | |
| 5082 | return (status); |
| 5083 | } |
| 5084 | |
| 5085 | /* --------------------------------------------------------------------------- |
| 5086 | \fn sme_RegisterDeviceStateUpdateInd |
| 5087 | \brief Register a callback routine that is called whenever |
| 5088 | the device enters a new device state (Full Power, BMPS, UAPSD) |
| 5089 | \param hHal - The handle returned by macOpen. |
| 5090 | \param callbackRoutine - Callback routine to be registered |
| 5091 | \param callbackContext - Cookie to be passed back during callback |
| 5092 | \return eHalStatus |
| 5093 | eHAL_STATUS_SUCCESS - successfully registered |
| 5094 | eHAL_STATUS_FAILURE - not successfully registered |
| 5095 | ---------------------------------------------------------------------------*/ |
| 5096 | eHalStatus sme_RegisterDeviceStateUpdateInd ( |
| 5097 | tHalHandle hHal, |
| 5098 | void (*callbackRoutine) (void *callbackContext, tPmcState pmcState), |
| 5099 | void *callbackContext) |
| 5100 | { |
| 5101 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5102 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5103 | |
| 5104 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5105 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5106 | { |
| 5107 | status = pmcRegisterDeviceStateUpdateInd (hHal, callbackRoutine, callbackContext); |
| 5108 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5109 | } |
| 5110 | |
| 5111 | return (status); |
| 5112 | } |
| 5113 | |
| 5114 | /* --------------------------------------------------------------------------- |
| 5115 | \fn sme_DeregisterDeviceStateUpdateInd |
| 5116 | \brief Deregister a routine that was registered for device state changes |
| 5117 | \param hHal - The handle returned by macOpen. |
| 5118 | \param callbackRoutine - Callback routine to be deregistered |
| 5119 | \return eHalStatus |
| 5120 | eHAL_STATUS_SUCCESS - successfully deregistered |
| 5121 | eHAL_STATUS_FAILURE - not successfully deregistered |
| 5122 | ---------------------------------------------------------------------------*/ |
| 5123 | eHalStatus sme_DeregisterDeviceStateUpdateInd ( |
| 5124 | tHalHandle hHal, |
| 5125 | void (*callbackRoutine) (void *callbackContext, tPmcState pmcState)) |
| 5126 | { |
| 5127 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5128 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5129 | |
| 5130 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5131 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5132 | { |
| 5133 | status = pmcDeregisterDeviceStateUpdateInd (hHal, callbackRoutine); |
| 5134 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5135 | } |
| 5136 | |
| 5137 | return (status); |
| 5138 | } |
| 5139 | |
| 5140 | /* --------------------------------------------------------------------------- |
| 5141 | \fn sme_WowlAddBcastPattern |
| 5142 | \brief Add a pattern for Pattern Byte Matching in Wowl mode. Firmware will |
| 5143 | do a pattern match on these patterns when Wowl is enabled during BMPS |
| 5144 | mode. Note that Firmware performs the pattern matching only on |
| 5145 | broadcast frames and while Libra is in BMPS mode. |
| 5146 | \param hHal - The handle returned by macOpen. |
| 5147 | \param pattern - Pattern to be added |
| 5148 | \return eHalStatus |
| 5149 | eHAL_STATUS_FAILURE Cannot add pattern |
| 5150 | eHAL_STATUS_SUCCESS Request accepted. |
| 5151 | ---------------------------------------------------------------------------*/ |
| 5152 | eHalStatus sme_WowlAddBcastPattern ( |
| 5153 | tHalHandle hHal, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 5154 | tpSirWowlAddBcastPtrn pattern, |
| 5155 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5156 | { |
| 5157 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5158 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5159 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5160 | TRACE_CODE_SME_RX_HDD_WOWL_ADDBCAST_PATTERN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5161 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5162 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5163 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 5164 | status = pmcWowlAddBcastPattern (hHal, pattern, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5165 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5166 | } |
| 5167 | |
| 5168 | return (status); |
| 5169 | } |
| 5170 | |
| 5171 | /* --------------------------------------------------------------------------- |
| 5172 | \fn sme_WowlDelBcastPattern |
| 5173 | \brief Delete a pattern that was added for Pattern Byte Matching. |
| 5174 | \param hHal - The handle returned by macOpen. |
| 5175 | \param pattern - Pattern to be deleted |
| 5176 | \return eHalStatus |
| 5177 | eHAL_STATUS_FAILURE Cannot delete pattern |
| 5178 | eHAL_STATUS_SUCCESS Request accepted. |
| 5179 | ---------------------------------------------------------------------------*/ |
| 5180 | eHalStatus sme_WowlDelBcastPattern ( |
| 5181 | tHalHandle hHal, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 5182 | tpSirWowlDelBcastPtrn pattern, |
| 5183 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5184 | { |
| 5185 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5186 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5187 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5188 | TRACE_CODE_SME_RX_HDD_WOWL_DELBCAST_PATTERN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5189 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5190 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5191 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 5192 | status = pmcWowlDelBcastPattern (hHal, pattern, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5193 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5194 | } |
| 5195 | |
| 5196 | return (status); |
| 5197 | } |
| 5198 | |
| 5199 | /* --------------------------------------------------------------------------- |
| 5200 | \fn sme_EnterWowl |
| 5201 | \brief This is the SME API exposed to HDD to request enabling of WOWL mode. |
| 5202 | WoWLAN works on top of BMPS mode. If the device is not in BMPS mode, |
| 5203 | SME will will cache the information that WOWL has been enabled and |
| 5204 | attempt to put the device in BMPS. On entry into BMPS, SME will |
| 5205 | enable the WOWL mode. |
| 5206 | Note 1: If we exit BMPS mode (someone requests full power), we |
| 5207 | will NOT resume WOWL when we go back to BMPS again. Request for full |
| 5208 | power (while in WOWL mode) means disable WOWL and go to full power. |
| 5209 | Note 2: Both UAPSD and WOWL work on top of BMPS. On entry into BMPS, SME |
| 5210 | will give priority to UAPSD and enable only UAPSD if both UAPSD and WOWL |
| 5211 | are required. Currently there is no requirement or use case to support |
| 5212 | UAPSD and WOWL at the same time. |
| 5213 | |
| 5214 | \param hHal - The handle returned by macOpen. |
| 5215 | \param enterWowlCallbackRoutine - Callback routine provided by HDD. |
| 5216 | Used for success/failure notification by SME |
| 5217 | \param enterWowlCallbackContext - A cookie passed by HDD, that is passed back to HDD |
| 5218 | at the time of callback. |
| 5219 | \param wakeReasonIndCB - Callback routine provided by HDD. |
| 5220 | Used for Wake Reason Indication by SME |
| 5221 | \param wakeReasonIndCBContext - A cookie passed by HDD, that is passed back to HDD |
| 5222 | at the time of callback. |
| 5223 | \return eHalStatus |
| 5224 | eHAL_STATUS_SUCCESS Device is already in WoWLAN mode |
| 5225 | eHAL_STATUS_FAILURE Device cannot enter WoWLAN mode. |
| 5226 | eHAL_STATUS_PMC_PENDING Request accepted. SME will enable WOWL after |
| 5227 | BMPS mode is entered. |
| 5228 | ---------------------------------------------------------------------------*/ |
| 5229 | eHalStatus sme_EnterWowl ( |
| 5230 | tHalHandle hHal, |
| 5231 | void (*enterWowlCallbackRoutine) (void *callbackContext, eHalStatus status), |
| 5232 | void *enterWowlCallbackContext, |
| 5233 | #ifdef WLAN_WAKEUP_EVENTS |
| 5234 | void (*wakeIndicationCB) (void *callbackContext, tpSirWakeReasonInd pWakeReasonInd), |
| 5235 | void *wakeIndicationCBContext, |
| 5236 | #endif // WLAN_WAKEUP_EVENTS |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 5237 | tpSirSmeWowlEnterParams wowlEnterParams, tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5238 | { |
| 5239 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5240 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5241 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5242 | TRACE_CODE_SME_RX_HDD_ENTER_WOWL, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5243 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5244 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5245 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5246 | status = pmcEnterWowl (hHal, enterWowlCallbackRoutine, enterWowlCallbackContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5247 | #ifdef WLAN_WAKEUP_EVENTS |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5248 | wakeIndicationCB, wakeIndicationCBContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5249 | #endif // WLAN_WAKEUP_EVENTS |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 5250 | wowlEnterParams, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5251 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5252 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5253 | return (status); |
| 5254 | } |
| 5255 | /* --------------------------------------------------------------------------- |
| 5256 | \fn sme_ExitWowl |
| 5257 | \brief This is the SME API exposed to HDD to request exit from WoWLAN mode. |
| 5258 | SME will initiate exit from WoWLAN mode and device will be put in BMPS |
| 5259 | mode. |
| 5260 | \param hHal - The handle returned by macOpen. |
| 5261 | \return eHalStatus |
| 5262 | eHAL_STATUS_FAILURE Device cannot exit WoWLAN mode. |
| 5263 | eHAL_STATUS_SUCCESS Request accepted to exit WoWLAN mode. |
| 5264 | ---------------------------------------------------------------------------*/ |
c_hpothu | 01484c0 | 2014-05-16 14:05:15 +0530 | [diff] [blame] | 5265 | eHalStatus sme_ExitWowl (tHalHandle hHal, tWowlExitSource wowlExitSrc) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5266 | { |
| 5267 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5268 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5269 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5270 | TRACE_CODE_SME_RX_HDD_EXIT_WOWL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5271 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5272 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5273 | { |
c_hpothu | 01484c0 | 2014-05-16 14:05:15 +0530 | [diff] [blame] | 5274 | status = pmcExitWowl (hHal, wowlExitSrc); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5275 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5276 | } |
| 5277 | |
| 5278 | return (status); |
| 5279 | } |
| 5280 | |
| 5281 | /* --------------------------------------------------------------------------- |
| 5282 | |
| 5283 | \fn sme_RoamSetKey |
| 5284 | |
| 5285 | \brief To set encryption key. This function should be called only when connected |
| 5286 | This is an asynchronous API. |
| 5287 | |
| 5288 | \param pSetKeyInfo - pointer to a caller allocated object of tCsrSetContextInfo |
| 5289 | |
| 5290 | \param pRoamId Upon success return, this is the id caller can use to identify the request in roamcallback |
| 5291 | |
| 5292 | \return eHalStatus SUCCESS Roam callback will be called indicate actually results |
| 5293 | |
| 5294 | FAILURE or RESOURCES The API finished and failed. |
| 5295 | |
| 5296 | -------------------------------------------------------------------------------*/ |
| 5297 | eHalStatus sme_RoamSetKey(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 *pRoamId) |
| 5298 | { |
| 5299 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5300 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5301 | tANI_U32 roamId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5302 | tANI_U32 i; |
| 5303 | tCsrRoamSession *pSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5304 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5305 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5306 | TRACE_CODE_SME_RX_HDD_SET_KEY, sessionId, 0)); |
Jeff Johnson | f89f4b5 | 2013-03-27 10:32:44 -0700 | [diff] [blame] | 5307 | if (pSetKey->keyLength > CSR_MAX_KEY_LEN) |
| 5308 | { |
| 5309 | smsLog(pMac, LOGE, FL("Invalid key length %d"), pSetKey->keyLength); |
| 5310 | return eHAL_STATUS_FAILURE; |
| 5311 | } |
Agrawal Ashish | a8e8a72 | 2016-10-18 19:07:45 +0530 | [diff] [blame] | 5312 | #ifdef SAP_AUTH_OFFLOAD |
| 5313 | if (pMac->sap_auth_offload_sec_type) |
| 5314 | { |
| 5315 | smsLog(pMac, LOGW, FL("No set key is required in sap auth offload enable")); |
| 5316 | return eHAL_STATUS_SUCCESS; |
| 5317 | } |
| 5318 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5319 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5320 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5321 | { |
| 5322 | roamId = GET_NEXT_ROAM_ID(&pMac->roam); |
| 5323 | if(pRoamId) |
| 5324 | { |
| 5325 | *pRoamId = roamId; |
| 5326 | } |
| 5327 | |
Jeff Johnson | f89f4b5 | 2013-03-27 10:32:44 -0700 | [diff] [blame] | 5328 | smsLog(pMac, LOG2, FL("keyLength %d"), pSetKey->keyLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5329 | |
| 5330 | for(i=0; i<pSetKey->keyLength; i++) |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5331 | smsLog(pMac, LOG2, FL("%02x"), pSetKey->Key[i]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5332 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5333 | smsLog(pMac, LOG2, "\n sessionId=%d roamId=%d", sessionId, roamId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5334 | |
| 5335 | pSession = CSR_GET_SESSION(pMac, sessionId); |
| 5336 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 5337 | if(!pSession) |
| 5338 | { |
| 5339 | smsLog(pMac, LOGE, FL(" session %d not found "), sessionId); |
Leela Venkata Kiran Kumar Reddy Chirala | 090cc1f | 2013-03-07 17:40:17 -0800 | [diff] [blame] | 5340 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 5341 | return eHAL_STATUS_FAILURE; |
| 5342 | } |
| 5343 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5344 | if(CSR_IS_INFRA_AP(&pSession->connectedProfile)) |
| 5345 | { |
| 5346 | if(pSetKey->keyDirection == eSIR_TX_DEFAULT) |
| 5347 | { |
| 5348 | if ( ( eCSR_ENCRYPT_TYPE_WEP40 == pSetKey->encType ) || |
| 5349 | ( eCSR_ENCRYPT_TYPE_WEP40_STATICKEY == pSetKey->encType )) |
| 5350 | { |
| 5351 | pSession->pCurRoamProfile->negotiatedUCEncryptionType = eCSR_ENCRYPT_TYPE_WEP40_STATICKEY; |
| 5352 | } |
| 5353 | if ( ( eCSR_ENCRYPT_TYPE_WEP104 == pSetKey->encType ) || |
| 5354 | ( eCSR_ENCRYPT_TYPE_WEP104_STATICKEY == pSetKey->encType )) |
| 5355 | { |
| 5356 | pSession->pCurRoamProfile->negotiatedUCEncryptionType = eCSR_ENCRYPT_TYPE_WEP104_STATICKEY; |
| 5357 | } |
| 5358 | } |
| 5359 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5360 | |
| 5361 | status = csrRoamSetKey ( pMac, sessionId, pSetKey, roamId ); |
| 5362 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5363 | } |
Girish Gowli | 1c2fc80 | 2015-01-19 16:18:07 +0530 | [diff] [blame] | 5364 | if (pMac->roam.configParam.roamDelayStatsEnabled) |
Mukul Sharma | be91e2f | 2014-06-29 22:09:20 +0530 | [diff] [blame] | 5365 | { |
Girish Gowli | 1c2fc80 | 2015-01-19 16:18:07 +0530 | [diff] [blame] | 5366 | //Store sent PTK key time |
| 5367 | if(pSetKey->keyDirection == eSIR_TX_RX) |
| 5368 | { |
| 5369 | vos_record_roam_event(e_HDD_SET_PTK_REQ, NULL, 0); |
| 5370 | } |
| 5371 | else if(pSetKey->keyDirection == eSIR_RX_ONLY) |
| 5372 | { |
| 5373 | vos_record_roam_event(e_HDD_SET_GTK_REQ, NULL, 0); |
| 5374 | } |
| 5375 | else |
| 5376 | { |
| 5377 | return (status); |
| 5378 | } |
Mukul Sharma | be91e2f | 2014-06-29 22:09:20 +0530 | [diff] [blame] | 5379 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5380 | |
| 5381 | return (status); |
| 5382 | } |
| 5383 | |
| 5384 | |
| 5385 | /* --------------------------------------------------------------------------- |
| 5386 | |
| 5387 | \fn sme_RoamRemoveKey |
| 5388 | |
| 5389 | \brief To set encryption key. This is an asynchronous API. |
| 5390 | |
| 5391 | \param pRemoveKey - pointer to a caller allocated object of tCsrRoamRemoveKey |
| 5392 | |
| 5393 | \param pRoamId Upon success return, this is the id caller can use to identify the request in roamcallback |
| 5394 | |
| 5395 | \return eHalStatus SUCCESS Roam callback will be called indicate actually results |
| 5396 | |
| 5397 | FAILURE or RESOURCES The API finished and failed. |
| 5398 | |
| 5399 | -------------------------------------------------------------------------------*/ |
| 5400 | eHalStatus sme_RoamRemoveKey(tHalHandle hHal, tANI_U8 sessionId, |
| 5401 | tCsrRoamRemoveKey *pRemoveKey, tANI_U32 *pRoamId) |
| 5402 | { |
| 5403 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5404 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5405 | tANI_U32 roamId; |
| 5406 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5407 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5408 | TRACE_CODE_SME_RX_HDD_REMOVE_KEY, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5409 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5410 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5411 | { |
| 5412 | roamId = GET_NEXT_ROAM_ID(&pMac->roam); |
| 5413 | if(pRoamId) |
| 5414 | { |
| 5415 | *pRoamId = roamId; |
| 5416 | } |
| 5417 | status = csrRoamIssueRemoveKeyCommand( pMac, sessionId, pRemoveKey, roamId ); |
| 5418 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5419 | } |
| 5420 | |
| 5421 | return (status); |
| 5422 | } |
| 5423 | |
| 5424 | /* --------------------------------------------------------------------------- |
| 5425 | \fn sme_GetRssi |
| 5426 | \brief a wrapper function that client calls to register a callback to get RSSI |
| 5427 | |
| 5428 | \param callback - SME sends back the requested stats using the callback |
| 5429 | \param staId - The station ID for which the stats is requested for |
| 5430 | \param pContext - user context to be passed back along with the callback |
| 5431 | \param pVosContext - vos context |
| 5432 | \return eHalStatus |
| 5433 | ---------------------------------------------------------------------------*/ |
| 5434 | eHalStatus sme_GetRssi(tHalHandle hHal, |
| 5435 | tCsrRssiCallback callback, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5436 | tANI_U8 staId, tCsrBssid bssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5437 | void *pContext, void* pVosContext) |
| 5438 | { |
| 5439 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5440 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5441 | |
| 5442 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5443 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5444 | { |
| 5445 | status = csrGetRssi( pMac, callback, |
| 5446 | staId, bssId, pContext, pVosContext); |
| 5447 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5448 | } |
| 5449 | return (status); |
| 5450 | } |
Madan Mohan Koyyalamudi | d9383fd | 2013-08-13 09:27:30 +0530 | [diff] [blame] | 5451 | |
| 5452 | /* --------------------------------------------------------------------------- |
| 5453 | \fn sme_GetSnr |
| 5454 | \brief a wrapper function that client calls to register a callback to |
| 5455 | get SNR |
| 5456 | |
| 5457 | \param callback - SME sends back the requested stats using the callback |
| 5458 | \param staId - The station ID for which the stats is requested for |
| 5459 | \param pContext - user context to be passed back along with the callback |
| 5460 | \param pVosContext - vos context |
| 5461 | \return eHalStatus |
| 5462 | ---------------------------------------------------------------------------*/ |
| 5463 | eHalStatus sme_GetSnr(tHalHandle hHal, |
| 5464 | tCsrSnrCallback callback, |
| 5465 | tANI_U8 staId, tCsrBssid bssId, |
| 5466 | void *pContext) |
| 5467 | { |
| 5468 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5469 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5470 | |
| 5471 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5472 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5473 | { |
| 5474 | status = csrGetSnr(pMac, callback, |
| 5475 | staId, bssId, pContext); |
| 5476 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5477 | } |
| 5478 | return status; |
| 5479 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 5480 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 5481 | /* --------------------------------------------------------------------------- |
| 5482 | \fn sme_GetRoamRssi |
| 5483 | \brief a wrapper function that client calls to register a callback to get Roam RSSI |
| 5484 | |
| 5485 | \param callback - SME sends back the requested stats using the callback |
| 5486 | \param staId - The station ID for which the stats is requested for |
| 5487 | \param pContext - user context to be passed back along with the callback |
| 5488 | \param pVosContext - vos context |
| 5489 | \return eHalStatus |
| 5490 | ---------------------------------------------------------------------------*/ |
| 5491 | eHalStatus sme_GetRoamRssi(tHalHandle hHal, |
| 5492 | tCsrRssiCallback callback, |
| 5493 | tANI_U8 staId, tCsrBssid bssId, |
| 5494 | void *pContext, void* pVosContext) |
| 5495 | { |
| 5496 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5497 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5498 | |
| 5499 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5500 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5501 | { |
| 5502 | status = csrGetRoamRssi( pMac, callback, |
| 5503 | staId, bssId, pContext, pVosContext); |
| 5504 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5505 | } |
| 5506 | return (status); |
| 5507 | } |
| 5508 | #endif |
| 5509 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 5510 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 5511 | /* --------------------------------------------------------------------------- |
| 5512 | \fn sme_GetTsmStats |
| 5513 | \brief a wrapper function that client calls to register a callback to get TSM Stats |
| 5514 | |
| 5515 | \param callback - SME sends back the requested stats using the callback |
| 5516 | \param staId - The station ID for which the stats is requested for |
| 5517 | \param pContext - user context to be passed back along with the callback |
| 5518 | \param pVosContext - vos context |
| 5519 | \return eHalStatus |
| 5520 | ---------------------------------------------------------------------------*/ |
| 5521 | eHalStatus sme_GetTsmStats(tHalHandle hHal, |
| 5522 | tCsrTsmStatsCallback callback, |
| 5523 | tANI_U8 staId, tCsrBssid bssId, |
| 5524 | void *pContext, void* pVosContext, tANI_U8 tid) |
| 5525 | { |
| 5526 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5527 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5528 | |
| 5529 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5530 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5531 | { |
| 5532 | status = csrGetTsmStats( pMac, callback, |
| 5533 | staId, bssId, pContext, pVosContext, tid); |
| 5534 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5535 | } |
| 5536 | return (status); |
| 5537 | } |
| 5538 | #endif |
| 5539 | |
| 5540 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5541 | /* --------------------------------------------------------------------------- |
| 5542 | \fn sme_GetStatistics |
| 5543 | \brief a wrapper function that client calls to register a callback to get |
| 5544 | different PHY level statistics from CSR. |
| 5545 | |
| 5546 | \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc |
| 5547 | \param statsMask - The different category/categories of stats requester is looking for |
| 5548 | \param callback - SME sends back the requested stats using the callback |
| 5549 | \param periodicity - If requester needs periodic update in millisec, 0 means |
| 5550 | it's an one time request |
| 5551 | \param cache - If requester is happy with cached stats |
| 5552 | \param staId - The station ID for which the stats is requested for |
| 5553 | \param pContext - user context to be passed back along with the callback |
| 5554 | \return eHalStatus |
| 5555 | ---------------------------------------------------------------------------*/ |
| 5556 | eHalStatus sme_GetStatistics(tHalHandle hHal, eCsrStatsRequesterType requesterId, |
| 5557 | tANI_U32 statsMask, |
| 5558 | tCsrStatsCallback callback, |
| 5559 | tANI_U32 periodicity, tANI_BOOLEAN cache, |
| 5560 | tANI_U8 staId, void *pContext) |
| 5561 | { |
| 5562 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5563 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5564 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5565 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5566 | TRACE_CODE_SME_RX_HDD_GET_STATS, NO_SESSION, periodicity)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5567 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5568 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5569 | { |
| 5570 | status = csrGetStatistics( pMac, requesterId , statsMask, callback, |
| 5571 | periodicity, cache, staId, pContext); |
| 5572 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5573 | } |
| 5574 | |
| 5575 | return (status); |
| 5576 | |
| 5577 | } |
| 5578 | |
Abhishek Singh | 08aa776 | 2014-12-16 13:59:03 +0530 | [diff] [blame] | 5579 | eHalStatus sme_GetFwStats(tHalHandle hHal, tANI_U32 stats, |
| 5580 | void *pContext, tSirFWStatsCallback callback) |
Abhishek Singh | 3ae443b | 2014-10-08 11:49:27 +0530 | [diff] [blame] | 5581 | { |
| 5582 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5583 | vos_msg_t msg; |
| 5584 | tSirFWStatsGetReq *pGetFWStatsReq; |
| 5585 | |
| 5586 | smsLog(pMac, LOG1, FL(" ENTER stats = %d "),stats); |
| 5587 | |
| 5588 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme )) |
| 5589 | { |
| 5590 | pGetFWStatsReq = (tSirFWStatsGetReq *)vos_mem_malloc(sizeof(tSirFWStatsGetReq)); |
| 5591 | if ( NULL == pGetFWStatsReq) |
| 5592 | { |
| 5593 | smsLog(pMac, LOGE, FL("Not able to allocate memory for " |
| 5594 | "WDA_FW_STATS_GET_REQ")); |
| 5595 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5596 | return eHAL_STATUS_FAILURE; |
| 5597 | } |
| 5598 | pGetFWStatsReq->stats = stats; |
| 5599 | pGetFWStatsReq->callback = (tSirFWStatsCallback)callback; |
Abhishek Singh | 08aa776 | 2014-12-16 13:59:03 +0530 | [diff] [blame] | 5600 | pGetFWStatsReq->data = pContext; |
Abhishek Singh | 3ae443b | 2014-10-08 11:49:27 +0530 | [diff] [blame] | 5601 | |
| 5602 | msg.type = WDA_FW_STATS_GET_REQ; |
| 5603 | msg.reserved = 0; |
| 5604 | msg.bodyptr = pGetFWStatsReq; |
| 5605 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_WDA, &msg)) |
| 5606 | { |
| 5607 | smsLog(pMac, LOGE, |
| 5608 | FL("Not able to post WDA_FW_STATS_GET_REQ message to HAL")); |
| 5609 | vos_mem_free(pGetFWStatsReq); |
| 5610 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5611 | return eHAL_STATUS_FAILURE; |
| 5612 | } |
| 5613 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5614 | return eHAL_STATUS_SUCCESS; |
| 5615 | } |
| 5616 | return eHAL_STATUS_FAILURE; |
| 5617 | } |
| 5618 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5619 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 8af9b40 | 2013-07-11 14:59:10 +0530 | [diff] [blame] | 5620 | \fn smeGetTLSTAState |
| 5621 | \helper function to get the TL STA State whenever the function is called. |
| 5622 | |
| 5623 | \param staId - The staID to be passed to the TL |
| 5624 | to get the relevant TL STA State |
| 5625 | \return the state as tANI_U16 |
| 5626 | ---------------------------------------------------------------------------*/ |
| 5627 | tANI_U16 smeGetTLSTAState(tHalHandle hHal, tANI_U8 staId) |
| 5628 | { |
| 5629 | tANI_U16 tlSTAState = TL_INIT_STATE; |
| 5630 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5631 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5632 | |
| 5633 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5634 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5635 | { |
| 5636 | tlSTAState = csrGetTLSTAState( pMac, staId); |
| 5637 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5638 | } |
| 5639 | |
| 5640 | return tlSTAState; |
| 5641 | } |
| 5642 | |
| 5643 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5644 | |
| 5645 | \fn sme_GetCountryCode |
| 5646 | |
| 5647 | \brief To return the current country code. If no country code is applied, default country code is |
| 5648 | used to fill the buffer. |
| 5649 | If 11d supported is turned off, an error is return and the last applied/default country code is used. |
| 5650 | This is a synchronous API. |
| 5651 | |
| 5652 | \param pBuf - pointer to a caller allocated buffer for returned country code. |
| 5653 | |
| 5654 | \param pbLen For input, this parameter indicates how big is the buffer. |
| 5655 | Upon return, this parameter has the number of bytes for country. If pBuf |
| 5656 | doesn't have enough space, this function returns |
| 5657 | fail status and this parameter contains the number that is needed. |
| 5658 | |
| 5659 | \return eHalStatus SUCCESS. |
| 5660 | |
| 5661 | FAILURE or RESOURCES The API finished and failed. |
| 5662 | |
| 5663 | -------------------------------------------------------------------------------*/ |
| 5664 | eHalStatus sme_GetCountryCode(tHalHandle hHal, tANI_U8 *pBuf, tANI_U8 *pbLen) |
| 5665 | { |
| 5666 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5667 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5668 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5669 | TRACE_CODE_SME_RX_HDD_GET_CNTRYCODE, NO_SESSION, 0)); |
| 5670 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5671 | return ( csrGetCountryCode( pMac, pBuf, pbLen ) ); |
| 5672 | } |
| 5673 | |
| 5674 | |
| 5675 | /* --------------------------------------------------------------------------- |
| 5676 | |
| 5677 | \fn sme_SetCountryCode |
| 5678 | |
| 5679 | \brief To change the current/default country code. |
| 5680 | If 11d supported is turned off, an error is return. |
| 5681 | This is a synchronous API. |
| 5682 | |
| 5683 | \param pCountry - pointer to a caller allocated buffer for the country code. |
| 5684 | |
| 5685 | \param pfRestartNeeded A pointer to caller allocated memory, upon successful return, it indicates |
| 5686 | whether a reset is required. |
| 5687 | |
| 5688 | \return eHalStatus SUCCESS. |
| 5689 | |
| 5690 | FAILURE or RESOURCES The API finished and failed. |
| 5691 | |
| 5692 | -------------------------------------------------------------------------------*/ |
| 5693 | eHalStatus sme_SetCountryCode(tHalHandle hHal, tANI_U8 *pCountry, tANI_BOOLEAN *pfRestartNeeded) |
| 5694 | { |
| 5695 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5696 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5697 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5698 | TRACE_CODE_SME_RX_HDD_SET_CNTRYCODE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5699 | return ( csrSetCountryCode( pMac, pCountry, pfRestartNeeded ) ); |
| 5700 | } |
| 5701 | |
| 5702 | |
| 5703 | /* --------------------------------------------------------------------------- |
| 5704 | \fn sme_ResetCountryCodeInformation |
| 5705 | \brief this function is to reset the country code current being used back to EEPROM default |
| 5706 | this includes channel list and power setting. This is a synchronous API. |
| 5707 | \param pfRestartNeeded - pointer to a caller allocated space. Upon successful return, it indicates whether |
| 5708 | a restart is needed to apply the change |
| 5709 | \return eHalStatus |
| 5710 | -------------------------------------------------------------------------------*/ |
| 5711 | eHalStatus sme_ResetCountryCodeInformation(tHalHandle hHal, tANI_BOOLEAN *pfRestartNeeded) |
| 5712 | { |
| 5713 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5714 | |
| 5715 | return ( csrResetCountryCodeInformation( pMac, pfRestartNeeded ) ); |
| 5716 | } |
| 5717 | |
| 5718 | |
| 5719 | /* --------------------------------------------------------------------------- |
| 5720 | \fn sme_GetSupportedCountryCode |
| 5721 | \brief this function is to get a list of the country code current being supported |
| 5722 | \param pBuf - Caller allocated buffer with at least 3 bytes, upon success return, |
| 5723 | this has the country code list. 3 bytes for each country code. This may be NULL if |
| 5724 | caller wants to know the needed byte count. |
| 5725 | \param pbLen - Caller allocated, as input, it indicates the length of pBuf. Upon success return, |
| 5726 | this contains the length of the data in pBuf. If pbuf is NULL, as input, *pbLen should be 0. |
| 5727 | \return eHalStatus |
| 5728 | -------------------------------------------------------------------------------*/ |
| 5729 | eHalStatus sme_GetSupportedCountryCode(tHalHandle hHal, tANI_U8 *pBuf, tANI_U32 *pbLen) |
| 5730 | { |
| 5731 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5732 | |
| 5733 | return ( csrGetSupportedCountryCode( pMac, pBuf, pbLen ) ); |
| 5734 | } |
| 5735 | |
| 5736 | |
| 5737 | /* --------------------------------------------------------------------------- |
| 5738 | \fn sme_GetCurrentRegulatoryDomain |
| 5739 | \brief this function is to get the current regulatory domain. This is a synchronous API. |
| 5740 | This function must be called after CFG is downloaded and all the band/mode setting already passed into |
| 5741 | SME. The function fails if 11d support is turned off. |
| 5742 | \param pDomain - Caller allocated buffer to return the current domain. |
| 5743 | \return eHalStatus SUCCESS. |
| 5744 | |
| 5745 | FAILURE or RESOURCES The API finished and failed. |
| 5746 | -------------------------------------------------------------------------------*/ |
| 5747 | eHalStatus sme_GetCurrentRegulatoryDomain(tHalHandle hHal, v_REGDOMAIN_t *pDomain) |
| 5748 | { |
| 5749 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5750 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 5751 | |
| 5752 | if( pDomain ) |
| 5753 | { |
| 5754 | if( csrIs11dSupported( pMac ) ) |
| 5755 | { |
| 5756 | *pDomain = csrGetCurrentRegulatoryDomain( pMac ); |
| 5757 | status = eHAL_STATUS_SUCCESS; |
| 5758 | } |
| 5759 | else |
| 5760 | { |
| 5761 | status = eHAL_STATUS_FAILURE; |
| 5762 | } |
| 5763 | } |
| 5764 | |
| 5765 | return ( status ); |
| 5766 | } |
| 5767 | |
| 5768 | |
| 5769 | /* --------------------------------------------------------------------------- |
| 5770 | \fn sme_SetRegulatoryDomain |
| 5771 | \brief this function is to set the current regulatory domain. |
| 5772 | This function must be called after CFG is downloaded and all the band/mode setting already passed into |
| 5773 | SME. This is a synchronous API. |
| 5774 | \param domainId - indicate the domain (defined in the driver) needs to set to. |
| 5775 | See v_REGDOMAIN_t for definition |
| 5776 | \param pfRestartNeeded - pointer to a caller allocated space. Upon successful return, it indicates whether |
| 5777 | a restart is needed to apply the change |
| 5778 | \return eHalStatus |
| 5779 | -------------------------------------------------------------------------------*/ |
| 5780 | eHalStatus sme_SetRegulatoryDomain(tHalHandle hHal, v_REGDOMAIN_t domainId, tANI_BOOLEAN *pfRestartNeeded) |
| 5781 | { |
| 5782 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5783 | |
| 5784 | return ( csrSetRegulatoryDomain( pMac, domainId, pfRestartNeeded ) ); |
| 5785 | } |
| 5786 | |
| 5787 | |
| 5788 | /* --------------------------------------------------------------------------- |
| 5789 | |
| 5790 | \fn sme_GetRegulatoryDomainForCountry |
| 5791 | |
| 5792 | \brief To return a regulatory domain base on a country code. This is a synchronous API. |
| 5793 | |
| 5794 | \param pCountry - pointer to a caller allocated buffer for input country code. |
| 5795 | |
| 5796 | \param pDomainId Upon successful return, it is the domain that country belongs to. |
| 5797 | If it is NULL, returning success means that the country code is known. |
| 5798 | |
| 5799 | \return eHalStatus SUCCESS. |
| 5800 | |
| 5801 | FAILURE or RESOURCES The API finished and failed. |
| 5802 | |
| 5803 | -------------------------------------------------------------------------------*/ |
| 5804 | eHalStatus sme_GetRegulatoryDomainForCountry(tHalHandle hHal, tANI_U8 *pCountry, v_REGDOMAIN_t *pDomainId) |
| 5805 | { |
| 5806 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5807 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 5808 | return csrGetRegulatoryDomainForCountry(pMac, pCountry, pDomainId, |
| 5809 | COUNTRY_QUERY); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5810 | } |
| 5811 | |
| 5812 | |
| 5813 | |
| 5814 | |
| 5815 | /* --------------------------------------------------------------------------- |
| 5816 | |
| 5817 | \fn sme_GetSupportedRegulatoryDomains |
| 5818 | |
| 5819 | \brief To return a list of supported regulatory domains. This is a synchronous API. |
| 5820 | |
| 5821 | \param pDomains - pointer to a caller allocated buffer for returned regulatory domains. |
| 5822 | |
| 5823 | \param pNumDomains For input, this parameter indicates howm many domains pDomains can hold. |
| 5824 | Upon return, this parameter has the number for supported domains. If pDomains |
| 5825 | doesn't have enough space for all the supported domains, this function returns |
| 5826 | fail status and this parameter contains the number that is needed. |
| 5827 | |
| 5828 | \return eHalStatus SUCCESS. |
| 5829 | |
| 5830 | FAILURE or RESOURCES The API finished and failed. |
| 5831 | |
| 5832 | -------------------------------------------------------------------------------*/ |
| 5833 | eHalStatus sme_GetSupportedRegulatoryDomains(tHalHandle hHal, v_REGDOMAIN_t *pDomains, tANI_U32 *pNumDomains) |
| 5834 | { |
| 5835 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 5836 | |
| 5837 | //We support all domains for now |
| 5838 | if( pNumDomains ) |
| 5839 | { |
| 5840 | if( NUM_REG_DOMAINS <= *pNumDomains ) |
| 5841 | { |
| 5842 | status = eHAL_STATUS_SUCCESS; |
| 5843 | } |
| 5844 | *pNumDomains = NUM_REG_DOMAINS; |
| 5845 | } |
| 5846 | if( HAL_STATUS_SUCCESS( status ) ) |
| 5847 | { |
| 5848 | if( pDomains ) |
| 5849 | { |
| 5850 | pDomains[0] = REGDOMAIN_FCC; |
| 5851 | pDomains[1] = REGDOMAIN_ETSI; |
| 5852 | pDomains[2] = REGDOMAIN_JAPAN; |
| 5853 | pDomains[3] = REGDOMAIN_WORLD; |
| 5854 | pDomains[4] = REGDOMAIN_N_AMER_EXC_FCC; |
| 5855 | pDomains[5] = REGDOMAIN_APAC; |
| 5856 | pDomains[6] = REGDOMAIN_KOREA; |
| 5857 | pDomains[7] = REGDOMAIN_HI_5GHZ; |
| 5858 | pDomains[8] = REGDOMAIN_NO_5GHZ; |
| 5859 | } |
| 5860 | else |
| 5861 | { |
| 5862 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 5863 | } |
| 5864 | } |
| 5865 | |
| 5866 | return ( status ); |
| 5867 | } |
| 5868 | |
| 5869 | |
| 5870 | //some support functions |
| 5871 | tANI_BOOLEAN sme_Is11dSupported(tHalHandle hHal) |
| 5872 | { |
| 5873 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5874 | |
| 5875 | return ( csrIs11dSupported( pMac ) ); |
| 5876 | } |
| 5877 | |
| 5878 | |
| 5879 | tANI_BOOLEAN sme_Is11hSupported(tHalHandle hHal) |
| 5880 | { |
| 5881 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5882 | |
| 5883 | return ( csrIs11hSupported( pMac ) ); |
| 5884 | } |
| 5885 | |
| 5886 | |
| 5887 | tANI_BOOLEAN sme_IsWmmSupported(tHalHandle hHal) |
| 5888 | { |
| 5889 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5890 | |
| 5891 | return ( csrIsWmmSupported( pMac ) ); |
| 5892 | } |
| 5893 | |
| 5894 | //Upper layer to get the list of the base channels to scan for passively 11d info from csr |
| 5895 | eHalStatus sme_ScanGetBaseChannels( tHalHandle hHal, tCsrChannelInfo * pChannelInfo ) |
| 5896 | { |
| 5897 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5898 | |
| 5899 | return(csrScanGetBaseChannels(pMac,pChannelInfo) ); |
| 5900 | } |
| 5901 | |
| 5902 | /* --------------------------------------------------------------------------- |
| 5903 | |
| 5904 | \fn sme_ChangeCountryCode |
| 5905 | |
| 5906 | \brief Change Country code from upperlayer during WLAN driver operation. |
| 5907 | This is a synchronous API. |
| 5908 | |
| 5909 | \param hHal - The handle returned by macOpen. |
| 5910 | |
| 5911 | \param pCountry New Country Code String |
| 5912 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 5913 | \param sendRegHint If we want to send reg hint to nl80211 |
| 5914 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5915 | \return eHalStatus SUCCESS. |
| 5916 | |
| 5917 | FAILURE or RESOURCES The API finished and failed. |
| 5918 | |
| 5919 | -------------------------------------------------------------------------------*/ |
| 5920 | eHalStatus sme_ChangeCountryCode( tHalHandle hHal, |
| 5921 | tSmeChangeCountryCallback callback, |
| 5922 | tANI_U8 *pCountry, |
| 5923 | void *pContext, |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 5924 | void* pVosContext, |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 5925 | tAniBool countryFromUserSpace, |
| 5926 | tAniBool sendRegHint ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5927 | { |
| 5928 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5929 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5930 | vos_msg_t msg; |
| 5931 | tAniChangeCountryCodeReq *pMsg; |
| 5932 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5933 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5934 | TRACE_CODE_SME_RX_HDD_CHANGE_CNTRYCODE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5935 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5936 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5937 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5938 | smsLog(pMac, LOG1, FL(" called")); |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 5939 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 5940 | if ((pMac->roam.configParam.Is11dSupportEnabledOriginal == true) && |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 5941 | (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority)) |
| 5942 | { |
| 5943 | |
| 5944 | smsLog(pMac, LOGW, "Set Country Code Fail since the STA is associated and userspace does not have priority "); |
| 5945 | |
| 5946 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5947 | status = eHAL_STATUS_FAILURE; |
| 5948 | return status; |
| 5949 | } |
| 5950 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5951 | pMsg = vos_mem_malloc(sizeof(tAniChangeCountryCodeReq)); |
| 5952 | if ( NULL == pMsg ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5953 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5954 | smsLog(pMac, LOGE, " csrChangeCountryCode: failed to allocate mem for req"); |
Leela Venkata Kiran Kumar Reddy Chirala | 090cc1f | 2013-03-07 17:40:17 -0800 | [diff] [blame] | 5955 | sme_ReleaseGlobalLock( &pMac->sme ); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5956 | return eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5957 | } |
| 5958 | |
| 5959 | pMsg->msgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_CHANGE_COUNTRY_CODE); |
| 5960 | pMsg->msgLen = (tANI_U16)sizeof(tAniChangeCountryCodeReq); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5961 | vos_mem_copy(pMsg->countryCode, pCountry, 3); |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 5962 | pMsg->countryFromUserSpace = countryFromUserSpace; |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 5963 | pMsg->sendRegHint = sendRegHint; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5964 | pMsg->changeCCCallback = callback; |
| 5965 | pMsg->pDevContext = pContext; |
| 5966 | pMsg->pVosContext = pVosContext; |
| 5967 | |
| 5968 | msg.type = eWNI_SME_CHANGE_COUNTRY_CODE; |
| 5969 | msg.bodyptr = pMsg; |
| 5970 | msg.reserved = 0; |
| 5971 | |
| 5972 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg)) |
| 5973 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5974 | smsLog(pMac, LOGE, " sme_ChangeCountryCode failed to post msg to self "); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5975 | vos_mem_free((void *)pMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5976 | status = eHAL_STATUS_FAILURE; |
| 5977 | } |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5978 | smsLog(pMac, LOG1, FL(" returned")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5979 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5980 | } |
| 5981 | |
| 5982 | return (status); |
| 5983 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5984 | |
| 5985 | /*-------------------------------------------------------------------------- |
| 5986 | |
| 5987 | \fn sme_GenericChangeCountryCode |
| 5988 | |
| 5989 | \brief Change Country code from upperlayer during WLAN driver operation. |
| 5990 | This is a synchronous API. |
| 5991 | |
| 5992 | \param hHal - The handle returned by macOpen. |
| 5993 | |
| 5994 | \param pCountry New Country Code String |
| 5995 | |
| 5996 | \param reg_domain regulatory domain |
| 5997 | |
| 5998 | \return eHalStatus SUCCESS. |
| 5999 | |
| 6000 | FAILURE or RESOURCES The API finished and failed. |
| 6001 | |
| 6002 | -----------------------------------------------------------------------------*/ |
| 6003 | eHalStatus sme_GenericChangeCountryCode( tHalHandle hHal, |
| 6004 | tANI_U8 *pCountry, |
| 6005 | v_REGDOMAIN_t reg_domain) |
| 6006 | { |
| 6007 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6008 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6009 | vos_msg_t msg; |
| 6010 | tAniGenericChangeCountryCodeReq *pMsg; |
| 6011 | |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 6012 | if (NULL == pMac) |
| 6013 | { |
| 6014 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 6015 | "%s: pMac is null", __func__); |
| 6016 | return status; |
| 6017 | } |
| 6018 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 6019 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6020 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6021 | { |
| 6022 | smsLog(pMac, LOG1, FL(" called")); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 6023 | pMsg = vos_mem_malloc(sizeof(tAniGenericChangeCountryCodeReq)); |
| 6024 | if (NULL == pMsg) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 6025 | { |
| 6026 | smsLog(pMac, LOGE, " sme_GenericChangeCountryCode: failed to allocate mem for req"); |
| 6027 | sme_ReleaseGlobalLock( &pMac->sme ); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 6028 | return eHAL_STATUS_FAILURE; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 6029 | } |
| 6030 | |
| 6031 | pMsg->msgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE); |
| 6032 | pMsg->msgLen = (tANI_U16)sizeof(tAniGenericChangeCountryCodeReq); |
Sameer Thalappil | 7324e8b | 2014-01-15 10:32:54 -0800 | [diff] [blame] | 6033 | vos_mem_copy(pMsg->countryCode, pCountry, 2); |
Dino Mycle | 6c77a96 | 2014-08-19 15:34:23 +0530 | [diff] [blame] | 6034 | |
| 6035 | pMsg->countryCode[2] = ' '; /* For ASCII space */ |
| 6036 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 6037 | pMsg->domain_index = reg_domain; |
| 6038 | |
| 6039 | msg.type = eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE; |
| 6040 | msg.bodyptr = pMsg; |
| 6041 | msg.reserved = 0; |
| 6042 | |
| 6043 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg)) |
| 6044 | { |
| 6045 | smsLog(pMac, LOGE, "sme_GenericChangeCountryCode failed to post msg to self"); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 6046 | vos_mem_free(pMsg); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 6047 | status = eHAL_STATUS_FAILURE; |
| 6048 | } |
| 6049 | smsLog(pMac, LOG1, FL(" returned")); |
| 6050 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6051 | } |
| 6052 | |
| 6053 | return (status); |
| 6054 | } |
Mihir Shete | e1093ba | 2014-01-21 20:13:32 +0530 | [diff] [blame] | 6055 | |
| 6056 | /* --------------------------------------------------------------------------- |
| 6057 | |
| 6058 | \fn sme_InitChannels |
| 6059 | |
| 6060 | \brief Used to initialize CSR channel lists while driver loading |
| 6061 | |
| 6062 | \param hHal - global pMac structure |
| 6063 | |
| 6064 | \return eHalStatus SUCCESS. |
| 6065 | |
| 6066 | FAILURE or RESOURCES The API finished and failed. |
| 6067 | |
| 6068 | -------------------------------------------------------------------------------*/ |
| 6069 | eHalStatus sme_InitChannels(tHalHandle hHal) |
| 6070 | { |
| 6071 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6072 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6073 | |
| 6074 | if (NULL == pMac) |
| 6075 | { |
| 6076 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 6077 | "%s: pMac is null", __func__); |
| 6078 | return status; |
| 6079 | } |
| 6080 | |
Vinay Krishna Eranna | b9295ae | 2014-05-09 13:43:23 +0530 | [diff] [blame] | 6081 | status = csrInitChannels(pMac); |
| 6082 | |
Mihir Shete | e1093ba | 2014-01-21 20:13:32 +0530 | [diff] [blame] | 6083 | return status; |
| 6084 | } |
| 6085 | |
Mihir Shete | 0420645 | 2014-11-20 17:50:58 +0530 | [diff] [blame] | 6086 | #ifdef CONFIG_ENABLE_LINUX_REG |
Mahesh A Saptasagar | 74289d2 | 2014-05-14 12:43:37 +0530 | [diff] [blame] | 6087 | /*------------------------------------------------------------------------- |
| 6088 | \fn sme_InitChannelsForCC |
| 6089 | |
| 6090 | \brief Used to issue regulatory hint to user |
| 6091 | |
| 6092 | \param hHal - global pMac structure |
| 6093 | |
| 6094 | \return eHalStatus SUCCESS. |
| 6095 | |
| 6096 | FAILURE or RESOURCES The API finished and failed. |
| 6097 | --------------------------------------------------------------------------*/ |
| 6098 | |
Agarwal Ashish | 6db9d53 | 2014-09-30 18:19:10 +0530 | [diff] [blame] | 6099 | eHalStatus sme_InitChannelsForCC(tHalHandle hHal, driver_load_type init) |
Mahesh A Saptasagar | 74289d2 | 2014-05-14 12:43:37 +0530 | [diff] [blame] | 6100 | { |
| 6101 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6102 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6103 | |
| 6104 | if (NULL == pMac) |
| 6105 | { |
| 6106 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 6107 | "%s: pMac is null", __func__); |
| 6108 | return status; |
| 6109 | } |
Agarwal Ashish | 6db9d53 | 2014-09-30 18:19:10 +0530 | [diff] [blame] | 6110 | status = csrInitChannelsForCC(pMac, init); |
Mahesh A Saptasagar | 74289d2 | 2014-05-14 12:43:37 +0530 | [diff] [blame] | 6111 | |
| 6112 | return status; |
| 6113 | } |
Mihir Shete | 0420645 | 2014-11-20 17:50:58 +0530 | [diff] [blame] | 6114 | #endif |
Mahesh A Saptasagar | 74289d2 | 2014-05-14 12:43:37 +0530 | [diff] [blame] | 6115 | |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 6116 | /* --------------------------------------------------------------------------- |
| 6117 | |
| 6118 | \fn sme_DHCPStartInd |
| 6119 | |
| 6120 | \brief API to signal the FW about the DHCP Start event. |
| 6121 | |
| 6122 | \param hHal - HAL handle for device. |
| 6123 | |
| 6124 | \param device_mode - mode(AP,SAP etc) of the device. |
| 6125 | |
| 6126 | \param macAddr - MAC address of the device. |
| 6127 | |
| 6128 | \return eHalStatus SUCCESS. |
| 6129 | |
| 6130 | FAILURE or RESOURCES The API finished and failed. |
| 6131 | --------------------------------------------------------------------------*/ |
| 6132 | eHalStatus sme_DHCPStartInd( tHalHandle hHal, |
| 6133 | tANI_U8 device_mode, |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 6134 | tANI_U8 sessionId ) |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 6135 | { |
| 6136 | eHalStatus status; |
| 6137 | VOS_STATUS vosStatus; |
| 6138 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6139 | vos_msg_t vosMessage; |
| 6140 | tAniDHCPInd *pMsg; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 6141 | tCsrRoamSession *pSession; |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 6142 | |
| 6143 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6144 | if ( eHAL_STATUS_SUCCESS == status) |
| 6145 | { |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 6146 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 6147 | |
| 6148 | if (!pSession) |
| 6149 | { |
| 6150 | smsLog(pMac, LOGE, FL("session %d not found "), sessionId); |
| 6151 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6152 | return eHAL_STATUS_FAILURE; |
| 6153 | } |
Arif Hussain | e709d37 | 2016-12-06 19:49:31 +0530 | [diff] [blame] | 6154 | pSession->dhcp_done = false; |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 6155 | pMsg = (tAniDHCPInd*)vos_mem_malloc(sizeof(tAniDHCPInd)); |
| 6156 | if (NULL == pMsg) |
| 6157 | { |
| 6158 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 6159 | "%s: Not able to allocate memory for dhcp start", __func__); |
| 6160 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6161 | return eHAL_STATUS_FAILURE; |
| 6162 | } |
| 6163 | pMsg->msgType = WDA_DHCP_START_IND; |
| 6164 | pMsg->msgLen = (tANI_U16)sizeof(tAniDHCPInd); |
| 6165 | pMsg->device_mode = device_mode; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 6166 | vos_mem_copy(pMsg->macAddr, pSession->connectedProfile.bssid, |
| 6167 | sizeof(tSirMacAddr)); |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 6168 | vosMessage.type = WDA_DHCP_START_IND; |
| 6169 | vosMessage.bodyptr = pMsg; |
| 6170 | vosMessage.reserved = 0; |
| 6171 | |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 6172 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 6173 | TRACE_CODE_SME_TX_WDA_MSG, sessionId, vosMessage.type)); |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 6174 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 6175 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 6176 | { |
| 6177 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 6178 | "%s: Post DHCP Start MSG fail", __func__); |
| 6179 | vos_mem_free(pMsg); |
| 6180 | status = eHAL_STATUS_FAILURE; |
| 6181 | } |
| 6182 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6183 | } |
| 6184 | return (status); |
| 6185 | } |
| 6186 | /* --------------------------------------------------------------------------- |
| 6187 | \fn sme_DHCPStopInd |
| 6188 | |
| 6189 | \brief API to signal the FW about the DHCP complete event. |
| 6190 | |
| 6191 | \param hHal - HAL handle for device. |
| 6192 | |
| 6193 | \param device_mode - mode(AP, SAP etc) of the device. |
| 6194 | |
| 6195 | \param macAddr - MAC address of the device. |
| 6196 | |
| 6197 | \return eHalStatus SUCCESS. |
| 6198 | FAILURE or RESOURCES The API finished and failed. |
| 6199 | --------------------------------------------------------------------------*/ |
| 6200 | eHalStatus sme_DHCPStopInd( tHalHandle hHal, |
| 6201 | tANI_U8 device_mode, |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 6202 | tANI_U8 sessionId ) |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 6203 | { |
| 6204 | eHalStatus status; |
| 6205 | VOS_STATUS vosStatus; |
| 6206 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6207 | vos_msg_t vosMessage; |
| 6208 | tAniDHCPInd *pMsg; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 6209 | tCsrRoamSession *pSession; |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 6210 | |
| 6211 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6212 | if ( eHAL_STATUS_SUCCESS == status) |
| 6213 | { |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 6214 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 6215 | |
| 6216 | if (!pSession) |
| 6217 | { |
| 6218 | smsLog(pMac, LOGE, FL("session %d not found "), sessionId); |
| 6219 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6220 | return eHAL_STATUS_FAILURE; |
| 6221 | } |
Arif Hussain | e709d37 | 2016-12-06 19:49:31 +0530 | [diff] [blame] | 6222 | pSession->dhcp_done = true; |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 6223 | pMsg = (tAniDHCPInd*)vos_mem_malloc(sizeof(tAniDHCPInd)); |
| 6224 | if (NULL == pMsg) |
| 6225 | { |
| 6226 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 6227 | "%s: Not able to allocate memory for dhcp stop", __func__); |
| 6228 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6229 | return eHAL_STATUS_FAILURE; |
| 6230 | } |
| 6231 | |
| 6232 | pMsg->msgType = WDA_DHCP_STOP_IND; |
| 6233 | pMsg->msgLen = (tANI_U16)sizeof(tAniDHCPInd); |
| 6234 | pMsg->device_mode = device_mode; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 6235 | vos_mem_copy(pMsg->macAddr, pSession->connectedProfile.bssid, |
| 6236 | sizeof(tSirMacAddr)); |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 6237 | |
| 6238 | vosMessage.type = WDA_DHCP_STOP_IND; |
| 6239 | vosMessage.bodyptr = pMsg; |
| 6240 | vosMessage.reserved = 0; |
| 6241 | |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 6242 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 6243 | TRACE_CODE_SME_TX_WDA_MSG, sessionId, vosMessage.type)); |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 6244 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 6245 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 6246 | { |
| 6247 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 6248 | "%s: Post DHCP Stop MSG fail", __func__); |
| 6249 | vos_mem_free(pMsg); |
| 6250 | status = eHAL_STATUS_FAILURE; |
| 6251 | } |
| 6252 | |
| 6253 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6254 | } |
| 6255 | return (status); |
| 6256 | } |
| 6257 | |
Abhishek Singh | 00b7197 | 2016-01-07 10:51:04 +0530 | [diff] [blame] | 6258 | #ifdef WLAN_FEATURE_RMC |
| 6259 | /*--------------------------------------------------------------------------- |
| 6260 | |
| 6261 | \fn sme_TXFailMonitorStopInd |
| 6262 | |
| 6263 | \brief API to signal the FW to start monitoring TX failures |
| 6264 | |
| 6265 | \return eHalStatus SUCCESS. |
| 6266 | |
| 6267 | FAILURE or RESOURCES The API finished and failed. |
| 6268 | --------------------------------------------------------------------------*/ |
| 6269 | eHalStatus sme_TXFailMonitorStartStopInd(tHalHandle hHal, tANI_U8 tx_fail_count, |
| 6270 | void * txFailIndCallback) |
| 6271 | { |
| 6272 | eHalStatus status; |
| 6273 | VOS_STATUS vosStatus; |
| 6274 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6275 | vos_msg_t vosMessage; |
| 6276 | tAniTXFailMonitorInd *pMsg; |
| 6277 | |
| 6278 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6279 | if ( eHAL_STATUS_SUCCESS == status) |
| 6280 | { |
| 6281 | pMsg = (tAniTXFailMonitorInd*) |
| 6282 | vos_mem_malloc(sizeof(tAniTXFailMonitorInd)); |
| 6283 | if (NULL == pMsg) |
| 6284 | { |
| 6285 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 6286 | "%s: Failed to allocate memory", __func__); |
| 6287 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6288 | return eHAL_STATUS_FAILURE; |
| 6289 | } |
| 6290 | |
| 6291 | pMsg->msgType = WDA_TX_FAIL_MONITOR_IND; |
| 6292 | pMsg->msgLen = (tANI_U16)sizeof(tAniTXFailMonitorInd); |
| 6293 | |
| 6294 | //tx_fail_count = 0 should disable the Monitoring in FW |
| 6295 | pMsg->tx_fail_count = tx_fail_count; |
| 6296 | pMsg->txFailIndCallback = txFailIndCallback; |
| 6297 | |
| 6298 | vosMessage.type = WDA_TX_FAIL_MONITOR_IND; |
| 6299 | vosMessage.bodyptr = pMsg; |
| 6300 | vosMessage.reserved = 0; |
| 6301 | |
| 6302 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 6303 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
| 6304 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage ); |
| 6305 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 6306 | { |
| 6307 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 6308 | "%s: Post TX Fail monitor Start MSG fail", __func__); |
| 6309 | vos_mem_free(pMsg); |
| 6310 | status = eHAL_STATUS_FAILURE; |
| 6311 | } |
| 6312 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6313 | } |
| 6314 | return (status); |
| 6315 | } |
| 6316 | #endif /* WLAN_FEATURE_RMC */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6317 | |
Kapil Gupta | 04ab199 | 2016-06-26 13:36:51 +0530 | [diff] [blame] | 6318 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 6319 | void sme_PERRoamScanStartStop(void *hHal, tANI_U8 start) |
| 6320 | { |
| 6321 | eHalStatus status; |
| 6322 | VOS_STATUS vosStatus; |
| 6323 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6324 | vos_msg_t vosMessage; |
| 6325 | tPERRoamScanStart *pMsg; |
| 6326 | |
| 6327 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6328 | if ( eHAL_STATUS_SUCCESS == status) |
| 6329 | { |
| 6330 | pMsg = (tPERRoamScanStart *) |
| 6331 | vos_mem_malloc(sizeof(tPERRoamScanStart)); |
| 6332 | if (NULL == pMsg) |
| 6333 | { |
| 6334 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 6335 | "%s: Failed to allocate memory", __func__); |
| 6336 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6337 | return; |
| 6338 | } |
| 6339 | |
| 6340 | pMsg->msgType = WDA_PER_ROAM_SCAN_TRIGGER_REQ; |
| 6341 | pMsg->msgLen = (tANI_U16)sizeof(*pMsg); |
| 6342 | |
| 6343 | pMsg->start = start; |
| 6344 | |
| 6345 | vosMessage.type = WDA_PER_ROAM_SCAN_TRIGGER_REQ; |
| 6346 | vosMessage.bodyptr = pMsg; |
| 6347 | vosMessage.reserved = 0; |
| 6348 | |
| 6349 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 6350 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
| 6351 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage ); |
| 6352 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 6353 | { |
| 6354 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 6355 | "%s: Post TX Fail monitor Start MSG fail", __func__); |
| 6356 | vos_mem_free(pMsg); |
| 6357 | status = eHAL_STATUS_FAILURE; |
| 6358 | } |
| 6359 | sme_ReleaseGlobalLock(&pMac->sme); |
| 6360 | } |
| 6361 | } |
| 6362 | |
| 6363 | /* sme_set_per_roam_rxconfig : set PER config for Rx monitoring |
| 6364 | * @hHal: hal pointer |
| 6365 | * @staId: station id |
| 6366 | * @minRate : rate at which to start monitoring |
| 6367 | * @maxRate : Rate at which to stop monitoring |
| 6368 | * @minPercentage: minimum % of packets required in minRate to trigger a scan |
| 6369 | * @minPktRequired: minimum number of packets required to trigger a scan |
| 6370 | * @waitPeriodForNextPERScan: time to wait before start monitoring again once |
| 6371 | * roam scan is triggered |
| 6372 | * */ |
| 6373 | |
| 6374 | VOS_STATUS sme_set_per_roam_rxconfig (tHalHandle hHal, v_U8_t staId, |
| 6375 | v_U16_t minRate, v_U16_t maxRate, |
| 6376 | v_U8_t minPercentage, v_U16_t minPktRequired, |
| 6377 | v_U64_t waitPeriodForNextPERScan) |
| 6378 | { |
| 6379 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6380 | v_VOID_t * pVosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 6381 | WLANTL_StartRxRateMonitor(pVosContext, staId, minRate, maxRate, |
| 6382 | minPercentage, minPktRequired, |
| 6383 | (void *) hHal, waitPeriodForNextPERScan, |
| 6384 | sme_PERRoamScanStartStop); |
| 6385 | pMac->PERroamCandidatesCnt = 0; |
| 6386 | return eHAL_STATUS_SUCCESS; |
| 6387 | } |
| 6388 | |
| 6389 | /* sme_unset_per_roam_rxconfig : unset PER config for Rx monitoring |
| 6390 | * */ |
| 6391 | VOS_STATUS sme_unset_per_roam_rxconfig (tHalHandle hHal) |
| 6392 | { |
| 6393 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6394 | v_VOID_t * pVosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 6395 | vos_mem_set(pMac->previousRoamApInfo, |
| 6396 | sizeof(tSirRoamAPInfo) * SIR_PER_ROAM_MAX_CANDIDATE_CNT, 0); |
| 6397 | WLANTL_StopRxRateMonitor(pVosContext); |
| 6398 | return eHAL_STATUS_SUCCESS; |
| 6399 | } |
| 6400 | #endif |
| 6401 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6402 | /* --------------------------------------------------------------------------- |
| 6403 | \fn sme_BtcSignalBtEvent |
| 6404 | \brief API to signal Bluetooth (BT) event to the WLAN driver. Based on the |
| 6405 | BT event type and the current operating mode of Libra (full power, |
| 6406 | BMPS, UAPSD etc), appropriate Bluetooth Coexistence (BTC) strategy |
| 6407 | would be employed. |
| 6408 | \param hHal - The handle returned by macOpen. |
| 6409 | \param pBtEvent - Pointer to a caller allocated object of type tSmeBtEvent |
| 6410 | Caller owns the memory and is responsible for freeing it. |
| 6411 | \return VOS_STATUS |
| 6412 | VOS_STATUS_E_FAILURE BT Event not passed to HAL. This can happen |
| 6413 | if BTC execution mode is set to BTC_WLAN_ONLY |
| 6414 | or BTC_PTA_ONLY. |
| 6415 | VOS_STATUS_SUCCESS BT Event passed to HAL |
| 6416 | ---------------------------------------------------------------------------*/ |
| 6417 | VOS_STATUS sme_BtcSignalBtEvent (tHalHandle hHal, tpSmeBtEvent pBtEvent) |
| 6418 | { |
| 6419 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6420 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6421 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 6422 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6423 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6424 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6425 | TRACE_CODE_SME_RX_HDD_BTC_SIGNALEVENT, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6426 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6427 | { |
| 6428 | status = btcSignalBTEvent (hHal, pBtEvent); |
| 6429 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6430 | } |
| 6431 | #endif |
| 6432 | return (status); |
| 6433 | } |
| 6434 | |
| 6435 | /* --------------------------------------------------------------------------- |
| 6436 | \fn sme_BtcSetConfig |
| 6437 | \brief API to change the current Bluetooth Coexistence (BTC) configuration |
| 6438 | This function should be invoked only after CFG download has completed. |
| 6439 | Calling it after sme_HDDReadyInd is recommended. |
| 6440 | \param hHal - The handle returned by macOpen. |
| 6441 | \param pSmeBtcConfig - Pointer to a caller allocated object of type tSmeBtcConfig. |
| 6442 | Caller owns the memory and is responsible for freeing it. |
| 6443 | \return VOS_STATUS |
| 6444 | VOS_STATUS_E_FAILURE Config not passed to HAL. |
| 6445 | VOS_STATUS_SUCCESS Config passed to HAL |
| 6446 | ---------------------------------------------------------------------------*/ |
| 6447 | VOS_STATUS sme_BtcSetConfig (tHalHandle hHal, tpSmeBtcConfig pSmeBtcConfig) |
| 6448 | { |
| 6449 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 6450 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 6451 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6452 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6453 | TRACE_CODE_SME_RX_HDD_BTC_SETCONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6454 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6455 | { |
| 6456 | status = btcSetConfig (hHal, pSmeBtcConfig); |
| 6457 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6458 | } |
| 6459 | #endif |
| 6460 | return (status); |
| 6461 | } |
| 6462 | |
| 6463 | /* --------------------------------------------------------------------------- |
| 6464 | \fn sme_BtcGetConfig |
| 6465 | \brief API to retrieve the current Bluetooth Coexistence (BTC) configuration |
| 6466 | \param hHal - The handle returned by macOpen. |
| 6467 | \param pSmeBtcConfig - Pointer to a caller allocated object of type |
| 6468 | tSmeBtcConfig. Caller owns the memory and is responsible |
| 6469 | for freeing it. |
| 6470 | \return VOS_STATUS |
| 6471 | VOS_STATUS_E_FAILURE - failure |
| 6472 | VOS_STATUS_SUCCESS success |
| 6473 | ---------------------------------------------------------------------------*/ |
| 6474 | VOS_STATUS sme_BtcGetConfig (tHalHandle hHal, tpSmeBtcConfig pSmeBtcConfig) |
| 6475 | { |
| 6476 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 6477 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 6478 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6479 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6480 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6481 | TRACE_CODE_SME_RX_HDD_BTC_GETCONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6482 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6483 | { |
| 6484 | status = btcGetConfig (hHal, pSmeBtcConfig); |
| 6485 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6486 | } |
| 6487 | #endif |
| 6488 | return (status); |
| 6489 | } |
| 6490 | /* --------------------------------------------------------------------------- |
| 6491 | \fn sme_SetCfgPrivacy |
| 6492 | \brief API to set configure privacy parameters |
| 6493 | \param hHal - The handle returned by macOpen. |
| 6494 | \param pProfile - Pointer CSR Roam profile. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6495 | \param fPrivacy - This parameter indicates status of privacy |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6496 | |
| 6497 | \return void |
| 6498 | ---------------------------------------------------------------------------*/ |
| 6499 | void sme_SetCfgPrivacy( tHalHandle hHal, |
| 6500 | tCsrRoamProfile *pProfile, |
| 6501 | tANI_BOOLEAN fPrivacy |
| 6502 | ) |
| 6503 | { |
| 6504 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6505 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6506 | TRACE_CODE_SME_RX_HDD_SET_CFGPRIVACY, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6507 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6508 | { |
| 6509 | csrSetCfgPrivacy(pMac, pProfile, fPrivacy); |
| 6510 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6511 | } |
| 6512 | } |
| 6513 | |
| 6514 | #if defined WLAN_FEATURE_VOWIFI |
| 6515 | /* --------------------------------------------------------------------------- |
| 6516 | \fn sme_NeighborReportRequest |
| 6517 | \brief API to request neighbor report. |
| 6518 | \param hHal - The handle returned by macOpen. |
| 6519 | \param pRrmNeighborReq - Pointer to a caller allocated object of type |
| 6520 | tRrmNeighborReq. Caller owns the memory and is responsible |
| 6521 | for freeing it. |
| 6522 | \return VOS_STATUS |
| 6523 | VOS_STATUS_E_FAILURE - failure |
| 6524 | VOS_STATUS_SUCCESS success |
| 6525 | ---------------------------------------------------------------------------*/ |
| 6526 | VOS_STATUS sme_NeighborReportRequest (tHalHandle hHal, tANI_U8 sessionId, |
| 6527 | tpRrmNeighborReq pRrmNeighborReq, tpRrmNeighborRspCallbackInfo callbackInfo) |
| 6528 | { |
| 6529 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 6530 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6531 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6532 | TRACE_CODE_SME_RX_HDD_NEIGHBOR_REPORTREQ, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6533 | |
| 6534 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6535 | { |
| 6536 | status = sme_RrmNeighborReportRequest (hHal, sessionId, pRrmNeighborReq, callbackInfo); |
| 6537 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6538 | } |
| 6539 | |
| 6540 | return (status); |
| 6541 | } |
| 6542 | #endif |
| 6543 | |
| 6544 | //The following are debug APIs to support direct read/write register/memory |
| 6545 | //They are placed in SME because HW cannot be access when in LOW_POWER state |
| 6546 | //AND not connected. The knowledge and synchronization is done in SME |
| 6547 | |
| 6548 | //sme_DbgReadRegister |
| 6549 | //Caller needs to validate the input values |
| 6550 | VOS_STATUS sme_DbgReadRegister(tHalHandle hHal, v_U32_t regAddr, v_U32_t *pRegValue) |
| 6551 | { |
| 6552 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 6553 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6554 | tPmcPowerState PowerState; |
| 6555 | tANI_U32 sessionId = 0; |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6556 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6557 | TRACE_CODE_SME_RX_HDD_DBG_READREG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6558 | |
| 6559 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 6560 | |
| 6561 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 6562 | { |
Hoonki Lee | 0af6aaf | 2013-02-08 12:26:44 -0800 | [diff] [blame] | 6563 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgReadRegister(regAddr, pRegValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6564 | { |
| 6565 | return VOS_STATUS_SUCCESS; |
| 6566 | } |
| 6567 | return VOS_STATUS_E_FAILURE; |
| 6568 | } |
| 6569 | |
| 6570 | /* 2) NON FTM mode driver *************************************************/ |
| 6571 | |
| 6572 | /* Acquire SME global lock */ |
| 6573 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 6574 | { |
| 6575 | return VOS_STATUS_E_FAILURE; |
| 6576 | } |
| 6577 | |
| 6578 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 6579 | { |
| 6580 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 6581 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 6582 | { |
Hoonki Lee | 0af6aaf | 2013-02-08 12:26:44 -0800 | [diff] [blame] | 6583 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgReadRegister(regAddr, pRegValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6584 | { |
| 6585 | status = VOS_STATUS_SUCCESS; |
| 6586 | } |
| 6587 | else |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6588 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6589 | status = VOS_STATUS_E_FAILURE; |
| 6590 | } |
| 6591 | } |
| 6592 | else |
| 6593 | { |
| 6594 | status = VOS_STATUS_E_FAILURE; |
| 6595 | } |
| 6596 | } |
| 6597 | |
| 6598 | /* This is a hack for Qualky/pttWniSocket |
| 6599 | Current implementation doesn't allow pttWniSocket to inform Qualky an error */ |
| 6600 | if ( VOS_STATUS_SUCCESS != status ) |
| 6601 | { |
| 6602 | *pRegValue = 0xDEADBEEF; |
| 6603 | status = VOS_STATUS_SUCCESS; |
| 6604 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6605 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6606 | /* Release SME global lock */ |
| 6607 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6608 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6609 | return (status); |
| 6610 | } |
| 6611 | |
| 6612 | |
| 6613 | //sme_DbgWriteRegister |
| 6614 | //Caller needs to validate the input values |
| 6615 | VOS_STATUS sme_DbgWriteRegister(tHalHandle hHal, v_U32_t regAddr, v_U32_t regValue) |
| 6616 | { |
| 6617 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 6618 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6619 | tPmcPowerState PowerState; |
| 6620 | tANI_U32 sessionId = 0; |
| 6621 | |
| 6622 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 6623 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6624 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6625 | TRACE_CODE_SME_RX_HDD_DBG_WRITEREG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6626 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 6627 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6628 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteRegister(regAddr, regValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6629 | { |
| 6630 | return VOS_STATUS_SUCCESS; |
| 6631 | } |
| 6632 | return VOS_STATUS_E_FAILURE; |
| 6633 | } |
| 6634 | |
| 6635 | /* 2) NON FTM mode driver *************************************************/ |
| 6636 | |
| 6637 | /* Acquire SME global lock */ |
| 6638 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 6639 | { |
| 6640 | return VOS_STATUS_E_FAILURE; |
| 6641 | } |
| 6642 | |
| 6643 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 6644 | { |
| 6645 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 6646 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 6647 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6648 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteRegister(regAddr, regValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6649 | { |
| 6650 | status = VOS_STATUS_SUCCESS; |
| 6651 | } |
| 6652 | else |
| 6653 | { |
| 6654 | status = VOS_STATUS_E_FAILURE; |
| 6655 | } |
| 6656 | } |
| 6657 | else |
| 6658 | { |
| 6659 | status = VOS_STATUS_E_FAILURE; |
| 6660 | } |
| 6661 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6662 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6663 | /* Release SME global lock */ |
| 6664 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6665 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6666 | return (status); |
| 6667 | } |
| 6668 | |
| 6669 | |
| 6670 | |
| 6671 | //sme_DbgReadMemory |
| 6672 | //Caller needs to validate the input values |
| 6673 | //pBuf caller allocated buffer has the length of nLen |
| 6674 | VOS_STATUS sme_DbgReadMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U32_t nLen) |
| 6675 | { |
| 6676 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 6677 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6678 | tPmcPowerState PowerState; |
| 6679 | tANI_U32 sessionId = 0; |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 6680 | tANI_U32 cmd = READ_MEMORY_DUMP_CMD; |
| 6681 | tANI_U32 arg1 = memAddr; |
| 6682 | tANI_U32 arg2 = nLen/4; |
| 6683 | tANI_U32 arg3 = 4; |
| 6684 | tANI_U32 arg4 = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6685 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 6686 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6687 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6688 | TRACE_CODE_SME_RX_HDD_DBG_READMEM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6689 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 6690 | { |
Siddharth Bhal | 6811560 | 2015-01-18 20:44:55 +0530 | [diff] [blame] | 6691 | if (VOS_STATUS_SUCCESS == WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, (tANI_U8*)pBuf, 0)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6692 | { |
| 6693 | return VOS_STATUS_SUCCESS; |
| 6694 | } |
| 6695 | return VOS_STATUS_E_FAILURE; |
| 6696 | } |
| 6697 | |
| 6698 | /* 2) NON FTM mode driver *************************************************/ |
| 6699 | |
| 6700 | /* Acquire SME global lock */ |
| 6701 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 6702 | { |
| 6703 | return VOS_STATUS_E_FAILURE; |
| 6704 | } |
| 6705 | |
| 6706 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 6707 | { |
| 6708 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 6709 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 6710 | { |
Siddharth Bhal | 6811560 | 2015-01-18 20:44:55 +0530 | [diff] [blame] | 6711 | if (VOS_STATUS_SUCCESS == WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, (tANI_U8 *)pBuf, 0)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6712 | { |
| 6713 | status = VOS_STATUS_SUCCESS; |
| 6714 | } |
| 6715 | else |
| 6716 | { |
| 6717 | status = VOS_STATUS_E_FAILURE; |
| 6718 | } |
| 6719 | } |
| 6720 | else |
| 6721 | { |
| 6722 | status = VOS_STATUS_E_FAILURE; |
| 6723 | } |
| 6724 | } |
| 6725 | |
| 6726 | /* This is a hack for Qualky/pttWniSocket |
| 6727 | Current implementation doesn't allow pttWniSocket to inform Qualky an error */ |
| 6728 | if (VOS_STATUS_SUCCESS != status) |
| 6729 | { |
| 6730 | vos_mem_set(pBuf, nLen, 0xCD); |
| 6731 | status = VOS_STATUS_SUCCESS; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6732 | smsLog(pMac, LOGE, FL(" filled with 0xCD because it cannot access the hardware")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6733 | } |
| 6734 | |
| 6735 | /* Release SME lock */ |
| 6736 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6737 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6738 | return (status); |
| 6739 | } |
| 6740 | |
| 6741 | |
| 6742 | //sme_DbgWriteMemory |
| 6743 | //Caller needs to validate the input values |
| 6744 | VOS_STATUS sme_DbgWriteMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U32_t nLen) |
| 6745 | { |
| 6746 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 6747 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6748 | tPmcPowerState PowerState; |
| 6749 | tANI_U32 sessionId = 0; |
| 6750 | |
| 6751 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 6752 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6753 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6754 | TRACE_CODE_SME_RX_HDD_DBG_WRITEMEM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6755 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 6756 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6757 | { |
| 6758 | return VOS_STATUS_SUCCESS; |
| 6759 | } |
| 6760 | return VOS_STATUS_E_FAILURE; |
| 6761 | } |
| 6762 | |
| 6763 | /* 2) NON FTM mode driver *************************************************/ |
| 6764 | |
| 6765 | /* Acquire SME global lock */ |
| 6766 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 6767 | { |
| 6768 | return VOS_STATUS_E_FAILURE; |
| 6769 | } |
| 6770 | |
| 6771 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 6772 | { |
| 6773 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 6774 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 6775 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6776 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteMemory(memAddr, (void *)pBuf, nLen)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6777 | { |
| 6778 | status = VOS_STATUS_SUCCESS; |
| 6779 | } |
| 6780 | else |
| 6781 | { |
| 6782 | status = VOS_STATUS_E_FAILURE; |
| 6783 | } |
| 6784 | } |
| 6785 | else |
| 6786 | { |
| 6787 | status = VOS_STATUS_E_FAILURE; |
| 6788 | } |
| 6789 | } |
| 6790 | |
| 6791 | /* Release Global lock */ |
| 6792 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6793 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6794 | return (status); |
| 6795 | } |
| 6796 | |
| 6797 | |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 6798 | void pmcLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString, ...) |
| 6799 | { |
| 6800 | VOS_TRACE_LEVEL vosDebugLevel; |
| 6801 | char logBuffer[LOG_SIZE]; |
| 6802 | va_list marker; |
| 6803 | |
| 6804 | /* getting proper Debug level */ |
| 6805 | vosDebugLevel = getVosDebugLevel(loglevel); |
| 6806 | |
| 6807 | /* extracting arguments from pstring */ |
| 6808 | va_start( marker, pString ); |
| 6809 | vsnprintf(logBuffer, LOG_SIZE, pString, marker); |
| 6810 | |
| 6811 | VOS_TRACE(VOS_MODULE_ID_PMC, vosDebugLevel, "%s", logBuffer); |
| 6812 | va_end( marker ); |
| 6813 | } |
| 6814 | |
| 6815 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6816 | void smsLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString,...) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6817 | { |
| 6818 | #ifdef WLAN_DEBUG |
| 6819 | // Verify against current log level |
| 6820 | if ( loglevel > pMac->utils.gLogDbgLevel[LOG_INDEX_FOR_MODULE( SIR_SMS_MODULE_ID )] ) |
| 6821 | return; |
| 6822 | else |
| 6823 | { |
| 6824 | va_list marker; |
| 6825 | |
| 6826 | va_start( marker, pString ); /* Initialize variable arguments. */ |
| 6827 | |
| 6828 | logDebug(pMac, SIR_SMS_MODULE_ID, loglevel, pString, marker); |
| 6829 | |
| 6830 | va_end( marker ); /* Reset variable arguments. */ |
| 6831 | } |
| 6832 | #endif |
| 6833 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6834 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6835 | /* --------------------------------------------------------------------------- |
| 6836 | \fn sme_GetWcnssWlanCompiledVersion |
| 6837 | \brief This API returns the version of the WCNSS WLAN API with |
| 6838 | which the HOST driver was built |
| 6839 | \param hHal - The handle returned by macOpen. |
| 6840 | \param pVersion - Points to the Version structure to be filled |
| 6841 | \return VOS_STATUS |
| 6842 | VOS_STATUS_E_INVAL - failure |
| 6843 | VOS_STATUS_SUCCESS success |
| 6844 | ---------------------------------------------------------------------------*/ |
| 6845 | VOS_STATUS sme_GetWcnssWlanCompiledVersion(tHalHandle hHal, |
| 6846 | tSirVersionType *pVersion) |
| 6847 | { |
| 6848 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 6849 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6850 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 6851 | |
| 6852 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6853 | { |
| 6854 | if( pVersion != NULL ) |
| 6855 | { |
| 6856 | status = WDA_GetWcnssWlanCompiledVersion(vosContext, pVersion); |
| 6857 | } |
| 6858 | else |
| 6859 | { |
| 6860 | status = VOS_STATUS_E_INVAL; |
| 6861 | } |
| 6862 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6863 | } |
| 6864 | |
| 6865 | return (status); |
| 6866 | } |
| 6867 | |
| 6868 | |
| 6869 | /* --------------------------------------------------------------------------- |
| 6870 | \fn sme_GetWcnssWlanReportedVersion |
| 6871 | \brief This API returns the version of the WCNSS WLAN API with |
| 6872 | which the WCNSS driver reports it was built |
| 6873 | \param hHal - The handle returned by macOpen. |
| 6874 | \param pVersion - Points to the Version structure to be filled |
| 6875 | \return VOS_STATUS |
| 6876 | VOS_STATUS_E_INVAL - failure |
| 6877 | VOS_STATUS_SUCCESS success |
| 6878 | ---------------------------------------------------------------------------*/ |
| 6879 | VOS_STATUS sme_GetWcnssWlanReportedVersion(tHalHandle hHal, |
| 6880 | tSirVersionType *pVersion) |
| 6881 | { |
| 6882 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 6883 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6884 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 6885 | |
| 6886 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6887 | { |
| 6888 | if( pVersion != NULL ) |
| 6889 | { |
| 6890 | status = WDA_GetWcnssWlanReportedVersion(vosContext, pVersion); |
| 6891 | } |
| 6892 | else |
| 6893 | { |
| 6894 | status = VOS_STATUS_E_INVAL; |
| 6895 | } |
| 6896 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6897 | } |
| 6898 | |
| 6899 | return (status); |
| 6900 | } |
| 6901 | |
| 6902 | |
| 6903 | /* --------------------------------------------------------------------------- |
| 6904 | \fn sme_GetWcnssSoftwareVersion |
| 6905 | \brief This API returns the version string of the WCNSS driver |
| 6906 | \param hHal - The handle returned by macOpen. |
| 6907 | \param pVersion - Points to the Version string buffer to be filled |
| 6908 | \param versionBufferSize - THe size of the Version string buffer |
| 6909 | \return VOS_STATUS |
| 6910 | VOS_STATUS_E_INVAL - failure |
| 6911 | VOS_STATUS_SUCCESS success |
| 6912 | ---------------------------------------------------------------------------*/ |
| 6913 | VOS_STATUS sme_GetWcnssSoftwareVersion(tHalHandle hHal, |
| 6914 | tANI_U8 *pVersion, |
| 6915 | tANI_U32 versionBufferSize) |
| 6916 | { |
| 6917 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 6918 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6919 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 6920 | |
| 6921 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6922 | { |
| 6923 | if( pVersion != NULL ) |
| 6924 | { |
| 6925 | status = WDA_GetWcnssSoftwareVersion(vosContext, pVersion, |
| 6926 | versionBufferSize); |
| 6927 | } |
| 6928 | else |
| 6929 | { |
| 6930 | status = VOS_STATUS_E_INVAL; |
| 6931 | } |
| 6932 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6933 | } |
| 6934 | |
| 6935 | return (status); |
| 6936 | } |
| 6937 | |
| 6938 | |
| 6939 | /* --------------------------------------------------------------------------- |
| 6940 | \fn sme_GetWcnssHardwareVersion |
| 6941 | \brief This API returns the version string of the WCNSS hardware |
| 6942 | \param hHal - The handle returned by macOpen. |
| 6943 | \param pVersion - Points to the Version string buffer to be filled |
| 6944 | \param versionBufferSize - THe size of the Version string buffer |
| 6945 | \return VOS_STATUS |
| 6946 | VOS_STATUS_E_INVAL - failure |
| 6947 | VOS_STATUS_SUCCESS success |
| 6948 | ---------------------------------------------------------------------------*/ |
| 6949 | VOS_STATUS sme_GetWcnssHardwareVersion(tHalHandle hHal, |
| 6950 | tANI_U8 *pVersion, |
| 6951 | tANI_U32 versionBufferSize) |
| 6952 | { |
| 6953 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 6954 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6955 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 6956 | |
| 6957 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6958 | { |
| 6959 | if( pVersion != NULL ) |
| 6960 | { |
| 6961 | status = WDA_GetWcnssHardwareVersion(vosContext, pVersion, |
| 6962 | versionBufferSize); |
| 6963 | } |
| 6964 | else |
| 6965 | { |
| 6966 | status = VOS_STATUS_E_INVAL; |
| 6967 | } |
| 6968 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6969 | } |
| 6970 | |
| 6971 | return (status); |
| 6972 | } |
Jeff Johnson | 4824d4c | 2013-02-12 14:23:57 -0800 | [diff] [blame] | 6973 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6974 | |
| 6975 | #ifdef FEATURE_WLAN_WAPI |
| 6976 | /* --------------------------------------------------------------------------- |
| 6977 | \fn sme_RoamSetBKIDCache |
| 6978 | \brief The SME API exposed to HDD to allow HDD to provde SME the BKID |
| 6979 | candidate list. |
| 6980 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 6981 | it is opened (by calling halOpen). |
| 6982 | \param pBKIDCache - caller allocated buffer point to an array of tBkidCacheInfo |
| 6983 | \param numItems - a variable that has the number of tBkidCacheInfo allocated |
| 6984 | when retruning, this is the number of items put into pBKIDCache |
| 6985 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 6986 | big enough and pNumItems has the number of tBkidCacheInfo. |
| 6987 | ---------------------------------------------------------------------------*/ |
| 6988 | eHalStatus sme_RoamSetBKIDCache( tHalHandle hHal, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache, |
| 6989 | tANI_U32 numItems ) |
| 6990 | { |
| 6991 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6992 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6993 | |
| 6994 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6995 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6996 | { |
| 6997 | status = csrRoamSetBKIDCache( pMac, sessionId, pBKIDCache, numItems ); |
| 6998 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6999 | } |
| 7000 | |
| 7001 | return (status); |
| 7002 | } |
| 7003 | |
| 7004 | /* --------------------------------------------------------------------------- |
| 7005 | \fn sme_RoamGetBKIDCache |
| 7006 | \brief The SME API exposed to HDD to allow HDD to request SME to return its |
| 7007 | BKID cache. |
| 7008 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 7009 | it is opened (by calling halOpen). |
| 7010 | \param pNum - caller allocated memory that has the space of the number of |
| 7011 | tBkidCacheInfo as input. Upon returned, *pNum has the needed number of entries |
| 7012 | in SME cache. |
| 7013 | \param pBkidCache - Caller allocated memory that contains BKID cache, if any, |
| 7014 | upon return |
| 7015 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 7016 | big enough. |
| 7017 | ---------------------------------------------------------------------------*/ |
| 7018 | eHalStatus sme_RoamGetBKIDCache(tHalHandle hHal, tANI_U32 *pNum, |
| 7019 | tBkidCacheInfo *pBkidCache) |
| 7020 | { |
| 7021 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7022 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7023 | |
| 7024 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7025 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7026 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7027 | smsLog(pMac, LOGE, FL(" !!!!!!!!!!!!!!!!!!SessionId is hardcoded")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7028 | status = csrRoamGetBKIDCache( pMac, 0, pNum, pBkidCache ); |
| 7029 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7030 | } |
| 7031 | |
| 7032 | return (status); |
| 7033 | } |
| 7034 | |
| 7035 | /* --------------------------------------------------------------------------- |
| 7036 | \fn sme_RoamGetNumBKIDCache |
| 7037 | \brief The SME API exposed to HDD to allow HDD to request SME to return the |
| 7038 | number of BKID cache entries. |
| 7039 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 7040 | it is opened (by calling halOpen). |
| 7041 | \return tANI_U32 - the number of BKID cache entries. |
| 7042 | ---------------------------------------------------------------------------*/ |
| 7043 | tANI_U32 sme_RoamGetNumBKIDCache(tHalHandle hHal, tANI_U32 sessionId) |
| 7044 | { |
| 7045 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7046 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7047 | tANI_U32 numBkidCache = 0; |
| 7048 | |
| 7049 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7050 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7051 | { |
| 7052 | numBkidCache = csrRoamGetNumBKIDCache( pMac, sessionId ); |
| 7053 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7054 | } |
| 7055 | |
| 7056 | return (numBkidCache); |
| 7057 | } |
| 7058 | |
| 7059 | /* --------------------------------------------------------------------------- |
| 7060 | \fn sme_ScanGetBKIDCandidateList |
| 7061 | \brief a wrapper function to return the BKID candidate list |
| 7062 | \param pBkidList - caller allocated buffer point to an array of |
| 7063 | tBkidCandidateInfo |
| 7064 | \param pNumItems - pointer to a variable that has the number of |
| 7065 | tBkidCandidateInfo allocated when retruning, this is |
| 7066 | either the number needed or number of items put into |
| 7067 | pPmkidList |
| 7068 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 7069 | big enough and pNumItems |
| 7070 | has the number of tBkidCandidateInfo. |
| 7071 | \Note: pNumItems is a number of tBkidCandidateInfo, |
| 7072 | not sizeof(tBkidCandidateInfo) * something |
| 7073 | ---------------------------------------------------------------------------*/ |
| 7074 | eHalStatus sme_ScanGetBKIDCandidateList(tHalHandle hHal, tANI_U32 sessionId, |
| 7075 | tBkidCandidateInfo *pBkidList, |
| 7076 | tANI_U32 *pNumItems ) |
| 7077 | { |
| 7078 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7079 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7080 | |
| 7081 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7082 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7083 | { |
| 7084 | status = csrScanGetBKIDCandidateList( pMac, sessionId, pBkidList, pNumItems ); |
| 7085 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7086 | } |
| 7087 | |
| 7088 | return (status); |
| 7089 | } |
| 7090 | #endif /* FEATURE_WLAN_WAPI */ |
| 7091 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7092 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 7093 | |
| 7094 | /***************************************************************************** |
| 7095 | OEM DATA related modifications and function additions |
| 7096 | *****************************************************************************/ |
| 7097 | |
| 7098 | /* --------------------------------------------------------------------------- |
| 7099 | \fn sme_getOemDataRsp |
| 7100 | \brief a wrapper function to obtain the OEM DATA RSP |
| 7101 | \param pOemDataRsp - A pointer to the response object |
| 7102 | \param pContext - a pointer passed in for the callback |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7103 | \return eHalStatus |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7104 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7105 | eHalStatus sme_getOemDataRsp(tHalHandle hHal, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7106 | tOemDataRsp **pOemDataRsp) |
| 7107 | { |
| 7108 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7109 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7110 | |
| 7111 | do |
| 7112 | { |
| 7113 | //acquire the lock for the sme object |
| 7114 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 7115 | |
| 7116 | if(!HAL_STATUS_SUCCESS(status)) |
| 7117 | { |
| 7118 | break; |
| 7119 | } |
| 7120 | |
| 7121 | if(pMac->oemData.pOemDataRsp != NULL) |
| 7122 | { |
| 7123 | *pOemDataRsp = pMac->oemData.pOemDataRsp; |
| 7124 | } |
| 7125 | else |
| 7126 | { |
| 7127 | status = eHAL_STATUS_FAILURE; |
| 7128 | } |
| 7129 | |
| 7130 | //release the lock for the sme object |
| 7131 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7132 | |
| 7133 | } while(0); |
| 7134 | |
| 7135 | return status; |
| 7136 | } |
| 7137 | |
| 7138 | /* --------------------------------------------------------------------------- |
| 7139 | \fn sme_OemDataReq |
| 7140 | \brief a wrapper function for OEM DATA REQ |
| 7141 | \param sessionId - session id to be used. |
| 7142 | \param pOemDataReqId - pointer to an object to get back the request ID |
| 7143 | \param callback - a callback function that is called upon finish |
| 7144 | \param pContext - a pointer passed in for the callback |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7145 | \return eHalStatus |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7146 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7147 | eHalStatus sme_OemDataReq(tHalHandle hHal, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7148 | tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7149 | tOemDataReqConfig *pOemDataReqConfig, |
| 7150 | tANI_U32 *pOemDataReqID, |
| 7151 | oemData_OemDataReqCompleteCallback callback, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7152 | void *pContext) |
| 7153 | { |
| 7154 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7155 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7156 | |
| 7157 | do |
| 7158 | { |
| 7159 | //acquire the lock for the sme object |
| 7160 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 7161 | if(HAL_STATUS_SUCCESS(status)) |
| 7162 | { |
| 7163 | tANI_U32 lOemDataReqId = pMac->oemData.oemDataReqID++; //let it wrap around |
| 7164 | |
| 7165 | if(pOemDataReqID) |
| 7166 | { |
| 7167 | *pOemDataReqID = lOemDataReqId; |
| 7168 | } |
| 7169 | else |
Leela Venkata Kiran Kumar Reddy Chirala | 090cc1f | 2013-03-07 17:40:17 -0800 | [diff] [blame] | 7170 | { |
| 7171 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7172 | return eHAL_STATUS_FAILURE; |
| 7173 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7174 | |
| 7175 | status = oemData_OemDataReq(hHal, sessionId, pOemDataReqConfig, pOemDataReqID, callback, pContext); |
| 7176 | |
| 7177 | //release the lock for the sme object |
| 7178 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7179 | } |
| 7180 | } while(0); |
| 7181 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7182 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7183 | |
| 7184 | return(status); |
| 7185 | } |
| 7186 | |
Padma, Santhosh Kumar | 2ccac21 | 2015-10-20 17:27:27 +0530 | [diff] [blame] | 7187 | /* --------------------------------------------------------------------------- |
| 7188 | \fn sme_OemDataReqNew |
| 7189 | \brief a wrapper function for OEM DATA REQ NEW |
| 7190 | \param pOemDataReqNewConfig - Data to be passed to FW |
| 7191 | ---------------------------------------------------------------------------*/ |
| 7192 | void sme_OemDataReqNew(tHalHandle hHal, |
| 7193 | tOemDataReqNewConfig *pOemDataReqNewConfig) |
| 7194 | { |
| 7195 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7196 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7197 | tOemDataReqNewConfig *pLocalOemDataReqNewConfig; |
| 7198 | vos_msg_t vosMessage = {0}; |
| 7199 | |
| 7200 | pLocalOemDataReqNewConfig = |
| 7201 | vos_mem_malloc(sizeof(*pLocalOemDataReqNewConfig)); |
| 7202 | |
| 7203 | if (!pLocalOemDataReqNewConfig) |
| 7204 | { |
| 7205 | smsLog(pMac, LOGE, |
| 7206 | "Failed to allocate memory for WDA_START_OEM_DATA_REQ_IND_NEW"); |
| 7207 | return; |
| 7208 | } |
| 7209 | |
| 7210 | vos_mem_zero(pLocalOemDataReqNewConfig, sizeof(tOemDataReqNewConfig)); |
| 7211 | vos_mem_copy(pLocalOemDataReqNewConfig, pOemDataReqNewConfig, |
| 7212 | sizeof(tOemDataReqNewConfig)); |
| 7213 | |
| 7214 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 7215 | /* Serialize the req through MC thread */ |
| 7216 | vosMessage.bodyptr = pLocalOemDataReqNewConfig; |
| 7217 | vosMessage.type = WDA_START_OEM_DATA_REQ_IND_NEW; |
| 7218 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 7219 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
| 7220 | |
| 7221 | if(VOS_STATUS_SUCCESS != |
| 7222 | vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage)) { |
| 7223 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s:" |
| 7224 | "Failed to post WDA_START_OEM_DATA_REQ_IND_NEW msg to WDA", |
| 7225 | __func__); |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 7226 | vos_mem_free(pLocalOemDataReqNewConfig); |
Padma, Santhosh Kumar | 2ccac21 | 2015-10-20 17:27:27 +0530 | [diff] [blame] | 7227 | } |
| 7228 | sme_ReleaseGlobalLock(&pMac->sme); |
| 7229 | } |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 7230 | else |
| 7231 | { |
| 7232 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 7233 | "sme_AcquireGlobalLock error", __func__); |
| 7234 | vos_mem_free(pLocalOemDataReqNewConfig); |
| 7235 | } |
Padma, Santhosh Kumar | 2ccac21 | 2015-10-20 17:27:27 +0530 | [diff] [blame] | 7236 | } |
| 7237 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7238 | #endif /*FEATURE_OEM_DATA_SUPPORT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7239 | |
| 7240 | /*-------------------------------------------------------------------------- |
| 7241 | |
| 7242 | \brief sme_OpenSession() - Open a session for scan/roam operation. |
| 7243 | |
| 7244 | This is a synchronous API. |
| 7245 | |
| 7246 | |
| 7247 | \param hHal - The handle returned by macOpen. |
| 7248 | \param callback - A pointer to the function caller specifies for roam/connect status indication |
| 7249 | \param pContext - The context passed with callback |
| 7250 | \param pSelfMacAddr - Caller allocated memory filled with self MAC address (6 bytes) |
| 7251 | \param pbSessionId - pointer to a caller allocated buffer for returned session ID |
| 7252 | |
| 7253 | \return eHAL_STATUS_SUCCESS - session is opened. sessionId returned. |
| 7254 | |
| 7255 | Other status means SME is failed to open the session. |
| 7256 | eHAL_STATUS_RESOURCES - no more session available. |
| 7257 | \sa |
| 7258 | |
| 7259 | --------------------------------------------------------------------------*/ |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 7260 | eHalStatus sme_OpenSession(tHalHandle hHal, csrRoamCompleteCallback callback, |
| 7261 | void *pContext, tANI_U8 *pSelfMacAddr, |
| 7262 | tANI_U8 *pbSessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7263 | { |
| 7264 | eHalStatus status; |
| 7265 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7266 | |
| 7267 | if( NULL == pbSessionId ) |
| 7268 | { |
| 7269 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 7270 | } |
| 7271 | else |
| 7272 | { |
| 7273 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7274 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7275 | { |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 7276 | status = csrRoamOpenSession(pMac, callback, pContext, |
| 7277 | pSelfMacAddr, pbSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7278 | |
| 7279 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7280 | } |
| 7281 | } |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7282 | if( NULL != pbSessionId ) |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7283 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7284 | TRACE_CODE_SME_RX_HDD_OPEN_SESSION,*pbSessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7285 | |
| 7286 | return ( status ); |
| 7287 | } |
| 7288 | |
| 7289 | |
| 7290 | /*-------------------------------------------------------------------------- |
| 7291 | |
| 7292 | \brief sme_CloseSession() - Open a session for scan/roam operation. |
| 7293 | |
| 7294 | This is a synchronous API. |
| 7295 | |
| 7296 | |
| 7297 | \param hHal - The handle returned by macOpen. |
| 7298 | |
| 7299 | \param sessionId - A previous opened session's ID. |
| 7300 | |
| 7301 | \return eHAL_STATUS_SUCCESS - session is closed. |
| 7302 | |
| 7303 | Other status means SME is failed to open the session. |
| 7304 | eHAL_STATUS_INVALID_PARAMETER - session is not opened. |
| 7305 | \sa |
| 7306 | |
| 7307 | --------------------------------------------------------------------------*/ |
| 7308 | eHalStatus sme_CloseSession(tHalHandle hHal, tANI_U8 sessionId, |
Agrawal Ashish | 5a3522c | 2016-03-02 15:08:28 +0530 | [diff] [blame] | 7309 | tANI_BOOLEAN fSync, |
mukul sharma | bab477d | 2015-06-11 17:14:55 +0530 | [diff] [blame] | 7310 | tANI_U8 bPurgeSmeCmdList, |
| 7311 | csrRoamSessionCloseCallback callback, |
| 7312 | void *pContext) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7313 | { |
| 7314 | eHalStatus status; |
| 7315 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7316 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7317 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7318 | TRACE_CODE_SME_RX_HDD_CLOSE_SESSION, sessionId, 0)); |
Agrawal Ashish | 5a3522c | 2016-03-02 15:08:28 +0530 | [diff] [blame] | 7319 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 7320 | if (HAL_STATUS_SUCCESS(status)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7321 | { |
Agrawal Ashish | 5a3522c | 2016-03-02 15:08:28 +0530 | [diff] [blame] | 7322 | status = csrRoamCloseSession(pMac, sessionId, fSync, bPurgeSmeCmdList, |
| 7323 | callback, pContext); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7324 | |
| 7325 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7326 | } |
| 7327 | |
| 7328 | return ( status ); |
| 7329 | } |
| 7330 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7331 | /* --------------------------------------------------------------------------- |
| 7332 | |
| 7333 | \fn sme_RoamUpdateAPWPSIE |
| 7334 | |
| 7335 | \brief To update AP's WPS IE. This function should be called after SME AP session is created |
| 7336 | This is an asynchronous API. |
| 7337 | |
| 7338 | \param pAPWPSIES - pointer to a caller allocated object of tSirAPWPSIEs |
| 7339 | |
| 7340 | \return eHalStatus – SUCCESS – |
| 7341 | |
| 7342 | FAILURE or RESOURCES – The API finished and failed. |
| 7343 | |
| 7344 | -------------------------------------------------------------------------------*/ |
| 7345 | eHalStatus sme_RoamUpdateAPWPSIE(tHalHandle hHal, tANI_U8 sessionId, tSirAPWPSIEs *pAPWPSIES) |
| 7346 | { |
| 7347 | |
| 7348 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7349 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7350 | |
| 7351 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7352 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7353 | { |
| 7354 | |
| 7355 | status = csrRoamUpdateAPWPSIE( pMac, sessionId, pAPWPSIES ); |
| 7356 | |
| 7357 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7358 | } |
| 7359 | |
| 7360 | return (status); |
| 7361 | } |
| 7362 | /* --------------------------------------------------------------------------- |
| 7363 | |
| 7364 | \fn sme_RoamUpdateAPWPARSNIEs |
| 7365 | |
| 7366 | \brief To update AP's WPA/RSN IEs. This function should be called after SME AP session is created |
| 7367 | This is an asynchronous API. |
| 7368 | |
| 7369 | \param pAPSirRSNie - pointer to a caller allocated object of tSirRSNie with WPS/RSN IEs |
| 7370 | |
| 7371 | \return eHalStatus – SUCCESS – |
| 7372 | |
| 7373 | FAILURE or RESOURCES – The API finished and failed. |
| 7374 | |
| 7375 | -------------------------------------------------------------------------------*/ |
| 7376 | eHalStatus sme_RoamUpdateAPWPARSNIEs(tHalHandle hHal, tANI_U8 sessionId, tSirRSNie * pAPSirRSNie) |
| 7377 | { |
| 7378 | |
| 7379 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7380 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7381 | |
| 7382 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7383 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7384 | { |
| 7385 | |
| 7386 | status = csrRoamUpdateWPARSNIEs( pMac, sessionId, pAPSirRSNie); |
| 7387 | |
| 7388 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7389 | } |
| 7390 | |
| 7391 | return (status); |
| 7392 | } |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 7393 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7394 | |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 7395 | \fn sme_ChangeMCCBeaconInterval |
| 7396 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7397 | \brief To update P2P-GO beaconInterval. This function should be called after |
| 7398 | disassociating all the station is done |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 7399 | This is an asynchronous API. |
| 7400 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7401 | \param |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 7402 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7403 | \return eHalStatus SUCCESS |
| 7404 | FAILURE or RESOURCES |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 7405 | The API finished and failed. |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 7406 | |
| 7407 | -------------------------------------------------------------------------------*/ |
| 7408 | eHalStatus sme_ChangeMCCBeaconInterval(tHalHandle hHal, tANI_U8 sessionId) |
| 7409 | { |
| 7410 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7411 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7412 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7413 | smsLog(pMac, LOG1, FL("Update Beacon PARAMS ")); |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 7414 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7415 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7416 | { |
| 7417 | status = csrSendChngMCCBeaconInterval( pMac, sessionId); |
| 7418 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7419 | } |
| 7420 | return (status); |
| 7421 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7422 | |
| 7423 | /*-------------------------------------------------------------------------------* |
| 7424 | |
| 7425 | \fn sme_sendBTAmpEvent |
| 7426 | |
| 7427 | \brief to receive the coex priorty request from BT-AMP PAL |
| 7428 | and send the BT_AMP link state to HAL |
| 7429 | |
| 7430 | \param btAmpEvent - btAmpEvent |
| 7431 | |
Jeff Johnson | feddb2d | 2012-12-10 14:41:22 -0800 | [diff] [blame] | 7432 | \return eHalStatus: SUCCESS : BTAmp event successfully sent to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7433 | |
| 7434 | FAILURE: API failed |
| 7435 | |
| 7436 | -------------------------------------------------------------------------------*/ |
| 7437 | |
| 7438 | eHalStatus sme_sendBTAmpEvent(tHalHandle hHal, tSmeBtAmpEvent btAmpEvent) |
| 7439 | { |
| 7440 | vos_msg_t msg; |
| 7441 | tpSmeBtAmpEvent ptrSmeBtAmpEvent = NULL; |
| 7442 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7443 | |
Leela Venkata Kiran Kumar Reddy Chirala | f7ea543 | 2013-11-15 11:03:04 -0800 | [diff] [blame] | 7444 | ptrSmeBtAmpEvent = vos_mem_malloc(sizeof(tSmeBtAmpEvent)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7445 | if (NULL == ptrSmeBtAmpEvent) |
| 7446 | { |
| 7447 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7448 | "Not able to allocate memory for BTAmp event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7449 | return status; |
| 7450 | } |
| 7451 | |
| 7452 | vos_mem_copy(ptrSmeBtAmpEvent, (void*)&btAmpEvent, sizeof(tSmeBtAmpEvent)); |
| 7453 | msg.type = WDA_SIGNAL_BTAMP_EVENT; |
| 7454 | msg.reserved = 0; |
| 7455 | msg.bodyptr = ptrSmeBtAmpEvent; |
| 7456 | |
| 7457 | //status = halFW_SendBTAmpEventMesg(pMac, event); |
| 7458 | |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 7459 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 7460 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7461 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 7462 | { |
| 7463 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7464 | "Not able to post SIR_HAL_SIGNAL_BTAMP_EVENT message to HAL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7465 | vos_mem_free(ptrSmeBtAmpEvent); |
| 7466 | return status; |
| 7467 | } |
| 7468 | |
| 7469 | return eHAL_STATUS_SUCCESS; |
| 7470 | |
| 7471 | } |
| 7472 | |
| 7473 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 7474 | \fn smeIssueFastRoamNeighborAPEvent |
| 7475 | \brief API to trigger fast BSS roam independent of RSSI triggers |
| 7476 | \param hHal - The handle returned by macOpen. |
| 7477 | \param bssid - Pointer to the BSSID to roam to. |
| 7478 | \param fastRoamTrig - Trigger to Scan or roam |
Mukul Sharma | 9e4e0f9 | 2015-02-13 18:45:20 +0530 | [diff] [blame] | 7479 | \param channel - channel number on which fastroam is requested |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 7480 | \return eHalStatus |
| 7481 | ---------------------------------------------------------------------------*/ |
| 7482 | eHalStatus smeIssueFastRoamNeighborAPEvent (tHalHandle hHal, |
| 7483 | tANI_U8 *bssid, |
Mukul Sharma | 9e4e0f9 | 2015-02-13 18:45:20 +0530 | [diff] [blame] | 7484 | tSmeFastRoamTrigger fastRoamTrig, |
| 7485 | tANI_U8 channel) |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 7486 | { |
| 7487 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7488 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 7489 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 7490 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7491 | |
| 7492 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7493 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7494 | { |
| 7495 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 7496 | "%s: invoked", __func__); |
| 7497 | |
| 7498 | if (eSME_ROAM_TRIGGER_SCAN == fastRoamTrig) |
| 7499 | { |
| 7500 | smsLog(pMac, LOG1, FL("CFG Channel list scan... ")); |
| 7501 | pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_SCAN; |
| 7502 | vos_mem_copy((void *)(&pNeighborRoamInfo->cfgRoambssId), |
| 7503 | (void *)bssid, sizeof(tSirMacAddr)); |
Mukul Sharma | 9e4e0f9 | 2015-02-13 18:45:20 +0530 | [diff] [blame] | 7504 | smsLog(pMac, LOG1, "Calling Roam Look Up down Event BSSID" |
Arif Hussain | a7c8e41 | 2013-11-20 11:06:42 -0800 | [diff] [blame] | 7505 | MAC_ADDRESS_STR, MAC_ADDR_ARRAY(pNeighborRoamInfo->cfgRoambssId)); |
Mukul Sharma | 9e4e0f9 | 2015-02-13 18:45:20 +0530 | [diff] [blame] | 7506 | /* |
| 7507 | * As FastReassoc is based on assumption that roamable AP should be |
| 7508 | * present into the occupied channel list.We shd add i/p channel |
| 7509 | * in occupied channel list if roamable-ap(BSSID in fastreassoc cmd) |
| 7510 | * aged out prior to connection and there is no scan from aged out |
| 7511 | * to till connection indication. |
| 7512 | */ |
| 7513 | csrAddChannelToOccupiedChannelList(pMac, channel); |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 7514 | vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac); |
| 7515 | if (VOS_STATUS_SUCCESS != vosStatus) |
| 7516 | { |
| 7517 | smsLog(pMac, LOGE, |
| 7518 | FL("CFG Channel list scan state failed with status %d "), |
| 7519 | vosStatus); |
| 7520 | } |
| 7521 | } |
| 7522 | else if (eSME_ROAM_TRIGGER_FAST_ROAM == fastRoamTrig) |
| 7523 | { |
| 7524 | vos_mem_copy((void *)(&pNeighborRoamInfo->cfgRoambssId), |
| 7525 | (void *)bssid, sizeof(tSirMacAddr)); |
| 7526 | pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_FAST_ROAM; |
Arif Hussain | a7c8e41 | 2013-11-20 11:06:42 -0800 | [diff] [blame] | 7527 | smsLog(pMac, LOG1, "Roam to BSSID "MAC_ADDRESS_STR, |
| 7528 | MAC_ADDR_ARRAY(pNeighborRoamInfo->cfgRoambssId)); |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 7529 | |
| 7530 | vosStatus = csrNeighborRoamReassocIndCallback(pMac->roam.gVosContext, |
| 7531 | 0, |
| 7532 | pMac, |
| 7533 | 0); |
| 7534 | |
| 7535 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 7536 | { |
| 7537 | smsLog(pMac, |
| 7538 | LOGE, |
| 7539 | FL(" Call to csrNeighborRoamReassocIndCallback failed, status = %d"), |
| 7540 | vosStatus); |
| 7541 | } |
| 7542 | } |
| 7543 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7544 | } |
| 7545 | return vosStatus; |
| 7546 | } |
| 7547 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7548 | \fn sme_SetHostOffload |
| 7549 | \brief API to set the host offload feature. |
| 7550 | \param hHal - The handle returned by macOpen. |
| 7551 | \param pRequest - Pointer to the offload request. |
| 7552 | \return eHalStatus |
| 7553 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7554 | eHalStatus sme_SetHostOffload (tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7555 | tpSirHostOffloadReq pRequest) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7556 | { |
| 7557 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7558 | eHalStatus status = eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7559 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7560 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7561 | TRACE_CODE_SME_RX_HDD_SET_HOSTOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7562 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7563 | { |
| 7564 | #ifdef WLAN_NS_OFFLOAD |
| 7565 | if(SIR_IPV6_NS_OFFLOAD == pRequest->offloadType) |
| 7566 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7567 | status = pmcSetNSOffload( hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7568 | } |
| 7569 | else |
| 7570 | #endif //WLAN_NS_OFFLOAD |
| 7571 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7572 | status = pmcSetHostOffload (hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7573 | } |
| 7574 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7575 | } |
| 7576 | |
| 7577 | return (status); |
| 7578 | } |
| 7579 | |
| 7580 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 7581 | /* --------------------------------------------------------------------------- |
| 7582 | \fn sme_SetGTKOffload |
| 7583 | \brief API to set GTK offload information. |
| 7584 | \param hHal - The handle returned by macOpen. |
| 7585 | \param pRequest - Pointer to the GTK offload request. |
| 7586 | \return eHalStatus |
| 7587 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7588 | eHalStatus sme_SetGTKOffload (tHalHandle hHal, tpSirGtkOffloadParams pRequest, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7589 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7590 | { |
| 7591 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7592 | eHalStatus status; |
| 7593 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7594 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7595 | TRACE_CODE_SME_RX_HDD_SET_GTKOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7596 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7597 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7598 | status = pmcSetGTKOffload( hHal, pRequest, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7599 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7600 | } |
| 7601 | |
| 7602 | return (status); |
| 7603 | } |
| 7604 | |
| 7605 | /* --------------------------------------------------------------------------- |
| 7606 | \fn sme_GetGTKOffload |
| 7607 | \brief API to get GTK offload information. |
| 7608 | \param hHal - The handle returned by macOpen. |
| 7609 | \param pRequest - Pointer to the GTK offload response. |
| 7610 | \return eHalStatus |
| 7611 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7612 | eHalStatus sme_GetGTKOffload (tHalHandle hHal, GTKOffloadGetInfoCallback callbackRoutine, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7613 | void *callbackContext, tANI_U8 sessionId ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7614 | { |
| 7615 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7616 | eHalStatus status; |
| 7617 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7618 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7619 | TRACE_CODE_SME_RX_HDD_GET_GTKOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7620 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7621 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7622 | pmcGetGTKOffload(hHal, callbackRoutine, callbackContext, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7623 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7624 | } |
| 7625 | |
| 7626 | return (status); |
| 7627 | } |
| 7628 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 7629 | |
| 7630 | /* --------------------------------------------------------------------------- |
| 7631 | \fn sme_SetKeepAlive |
| 7632 | \brief API to set the Keep Alive feature. |
| 7633 | \param hHal - The handle returned by macOpen. |
| 7634 | \param pRequest - Pointer to the Keep Alive request. |
| 7635 | \return eHalStatus |
| 7636 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7637 | eHalStatus sme_SetKeepAlive (tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7638 | tpSirKeepAliveReq pRequest) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7639 | { |
| 7640 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7641 | eHalStatus status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7642 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7643 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7644 | status = pmcSetKeepAlive (hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7645 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7646 | } |
| 7647 | |
| 7648 | return (status); |
| 7649 | } |
| 7650 | |
| 7651 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 7652 | /* --------------------------------------------------------------------------- |
| 7653 | \fn sme_SetPreferredNetworkList |
| 7654 | \brief API to set the Preferred Network List Offload feature. |
| 7655 | \param hHal - The handle returned by macOpen. |
| 7656 | \param pRequest - Pointer to the offload request. |
| 7657 | \return eHalStatus |
| 7658 | ---------------------------------------------------------------------------*/ |
| 7659 | eHalStatus sme_SetPreferredNetworkList (tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, void (*callbackRoutine) (void *callbackContext, tSirPrefNetworkFoundInd *pPrefNetworkFoundInd), void *callbackContext ) |
| 7660 | { |
| 7661 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7662 | eHalStatus status; |
| 7663 | |
Konamki, Sreelakshmi | 7b464be | 2015-07-14 12:17:01 +0530 | [diff] [blame] | 7664 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 7665 | TRACE_CODE_SME_RX_HDD_PREF_NET_LIST, |
| 7666 | sessionId, pRequest->ucNetworksCount)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7667 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7668 | { |
| 7669 | pmcSetPreferredNetworkList(hHal, pRequest, sessionId, callbackRoutine, callbackContext); |
| 7670 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7671 | } |
| 7672 | |
| 7673 | return (status); |
| 7674 | } |
| 7675 | |
| 7676 | eHalStatus sme_SetRSSIFilter(tHalHandle hHal, v_U8_t rssiThreshold) |
| 7677 | { |
| 7678 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7679 | eHalStatus status; |
| 7680 | |
| 7681 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7682 | { |
| 7683 | pmcSetRssiFilter(hHal, rssiThreshold); |
| 7684 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7685 | } |
| 7686 | |
| 7687 | return (status); |
| 7688 | } |
| 7689 | |
| 7690 | #endif // FEATURE_WLAN_SCAN_PNO |
| 7691 | |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 7692 | eHalStatus sme_SetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams, tANI_BOOLEAN forced) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7693 | { |
| 7694 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7695 | eHalStatus status; |
| 7696 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7697 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7698 | TRACE_CODE_SME_RX_HDD_SET_POWERPARAMS, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7699 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7700 | { |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 7701 | pmcSetPowerParams(hHal, pwParams, forced); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7702 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7703 | } |
| 7704 | |
| 7705 | return (status); |
| 7706 | } |
| 7707 | |
| 7708 | /* --------------------------------------------------------------------------- |
| 7709 | \fn sme_AbortMacScan |
| 7710 | \brief API to cancel MAC scan. |
| 7711 | \param hHal - The handle returned by macOpen. |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 7712 | \param sessionId - sessionId on which we need to abort scan. |
Srinivas, Dasari | 138af4f | 2014-02-07 11:13:45 +0530 | [diff] [blame] | 7713 | \param reason - Reason to abort the scan. |
c_hpothu | a3d45d5 | 2015-01-05 14:11:17 +0530 | [diff] [blame] | 7714 | \return tSirAbortScanStatus Abort scan status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7715 | ---------------------------------------------------------------------------*/ |
c_hpothu | a3d45d5 | 2015-01-05 14:11:17 +0530 | [diff] [blame] | 7716 | tSirAbortScanStatus sme_AbortMacScan(tHalHandle hHal, tANI_U8 sessionId, |
| 7717 | eCsrAbortReason reason) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7718 | { |
c_hpothu | a3d45d5 | 2015-01-05 14:11:17 +0530 | [diff] [blame] | 7719 | tSirAbortScanStatus scanAbortStatus = eSIR_ABORT_SCAN_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7720 | eHalStatus status; |
| 7721 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7722 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7723 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7724 | TRACE_CODE_SME_RX_HDD_ABORT_MACSCAN, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7725 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7726 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7727 | { |
c_hpothu | a3d45d5 | 2015-01-05 14:11:17 +0530 | [diff] [blame] | 7728 | scanAbortStatus = csrScanAbortMacScan(pMac, sessionId, reason); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7729 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7730 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7731 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7732 | |
c_hpothu | a3d45d5 | 2015-01-05 14:11:17 +0530 | [diff] [blame] | 7733 | return ( scanAbortStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7734 | } |
| 7735 | |
| 7736 | /* ---------------------------------------------------------------------------- |
| 7737 | \fn sme_GetOperationChannel |
| 7738 | \brief API to get current channel on which STA is parked |
| 7739 | this function gives channel information only of infra station or IBSS station |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 7740 | \param hHal, pointer to memory location and sessionId |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7741 | \returns eHAL_STATUS_SUCCESS |
| 7742 | eHAL_STATUS_FAILURE |
| 7743 | -------------------------------------------------------------------------------*/ |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 7744 | eHalStatus sme_GetOperationChannel(tHalHandle hHal, tANI_U32 *pChannel, tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7745 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7746 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7747 | tCsrRoamSession *pSession; |
| 7748 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 7749 | if (CSR_IS_SESSION_VALID( pMac, sessionId )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7750 | { |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 7751 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7752 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7753 | if(( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_INFRASTRUCTURE ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 7754 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_IBSS ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 7755 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_INFRA_AP ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 7756 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_START_IBSS )) |
| 7757 | { |
| 7758 | *pChannel =pSession->connectedProfile.operationChannel; |
| 7759 | return eHAL_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7760 | } |
| 7761 | } |
| 7762 | return eHAL_STATUS_FAILURE; |
| 7763 | }// sme_GetOperationChannel ends here |
| 7764 | |
Abhishek Singh | 7d624e1 | 2015-11-30 14:29:27 +0530 | [diff] [blame] | 7765 | /** |
| 7766 | * sme_register_mgmt_frame_ind_callback() - Register a callback for |
| 7767 | * management frame indication to PE. |
| 7768 | * @hHal: hal pointer |
| 7769 | * @callback: callback pointer to be registered |
| 7770 | * |
| 7771 | * This function is used to register a callback for management |
| 7772 | * frame indication to PE. |
| 7773 | * |
| 7774 | * Return: Success if msg is posted to PE else Failure. |
| 7775 | */ |
| 7776 | eHalStatus sme_register_mgmt_frame_ind_callback(tHalHandle hHal, |
| 7777 | sir_mgmt_frame_ind_callback callback) |
| 7778 | { |
| 7779 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7780 | struct sir_sme_mgmt_frame_cb_req *msg; |
| 7781 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7782 | |
| 7783 | smsLog(pMac, LOG1, FL(": ENTER")); |
| 7784 | |
| 7785 | if (eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock(&pMac->sme)) |
| 7786 | { |
| 7787 | msg = vos_mem_malloc(sizeof(*msg)); |
| 7788 | if (NULL == msg) |
| 7789 | { |
| 7790 | smsLog(pMac, LOGE, |
| 7791 | FL("Not able to allocate memory for eWNI_SME_REGISTER_MGMT_FRAME_CB")); |
| 7792 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7793 | return eHAL_STATUS_FAILURE; |
| 7794 | } |
| 7795 | vos_mem_set(msg, sizeof(*msg), 0); |
| 7796 | msg->message_type = eWNI_SME_REGISTER_MGMT_FRAME_CB; |
| 7797 | msg->length = sizeof(*msg); |
| 7798 | |
| 7799 | msg->callback = callback; |
| 7800 | status = palSendMBMessage(pMac->hHdd, msg); |
| 7801 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7802 | return status; |
| 7803 | } |
| 7804 | return eHAL_STATUS_FAILURE; |
| 7805 | } |
| 7806 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7807 | /* --------------------------------------------------------------------------- |
| 7808 | |
| 7809 | \fn sme_RegisterMgtFrame |
| 7810 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7811 | \brief To register managment frame of specified type and subtype. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7812 | \param frameType - type of the frame that needs to be passed to HDD. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7813 | \param matchData - data which needs to be matched before passing frame |
| 7814 | to HDD. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7815 | \param matchDataLen - Length of matched data. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7816 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7817 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7818 | eHalStatus sme_RegisterMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7819 | tANI_U16 frameType, tANI_U8* matchData, tANI_U16 matchLen) |
| 7820 | { |
| 7821 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7822 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7823 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7824 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7825 | TRACE_CODE_SME_RX_HDD_REGISTER_MGMTFR, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7826 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7827 | { |
| 7828 | tSirRegisterMgmtFrame *pMsg; |
| 7829 | tANI_U16 len; |
| 7830 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 7831 | |
| 7832 | if(!pSession) |
| 7833 | { |
| 7834 | smsLog(pMac, LOGE, FL(" session %d not found "), sessionId); |
Leela Venkata Kiran Kumar Reddy Chirala | 090cc1f | 2013-03-07 17:40:17 -0800 | [diff] [blame] | 7835 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 7836 | return eHAL_STATUS_FAILURE; |
| 7837 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7838 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7839 | if( !pSession->sessionActive ) |
| 7840 | { |
| 7841 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7842 | "%s Invalid Sessionid", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7843 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7844 | return eHAL_STATUS_FAILURE; |
| 7845 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7846 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7847 | len = sizeof(tSirRegisterMgmtFrame) + matchLen; |
| 7848 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7849 | pMsg = vos_mem_malloc(len); |
| 7850 | if ( NULL == pMsg ) |
| 7851 | status = eHAL_STATUS_FAILURE; |
| 7852 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7853 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7854 | vos_mem_set(pMsg, len, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7855 | pMsg->messageType = eWNI_SME_REGISTER_MGMT_FRAME_REQ; |
| 7856 | pMsg->length = len; |
| 7857 | pMsg->sessionId = sessionId; |
| 7858 | pMsg->registerFrame = VOS_TRUE; |
| 7859 | pMsg->frameType = frameType; |
| 7860 | pMsg->matchLen = matchLen; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7861 | vos_mem_copy(pMsg->matchData, matchData, matchLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7862 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 7863 | } |
| 7864 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7865 | } |
| 7866 | return status; |
| 7867 | } |
| 7868 | |
| 7869 | /* --------------------------------------------------------------------------- |
| 7870 | |
| 7871 | \fn sme_DeregisterMgtFrame |
| 7872 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7873 | \brief To De-register managment frame of specified type and subtype. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7874 | \param frameType - type of the frame that needs to be passed to HDD. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7875 | \param matchData - data which needs to be matched before passing frame |
| 7876 | to HDD. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7877 | \param matchDataLen - Length of matched data. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7878 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7879 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7880 | eHalStatus sme_DeregisterMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7881 | tANI_U16 frameType, tANI_U8* matchData, tANI_U16 matchLen) |
| 7882 | { |
| 7883 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7884 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7885 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7886 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7887 | TRACE_CODE_SME_RX_HDD_DEREGISTER_MGMTFR, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7888 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7889 | { |
| 7890 | tSirRegisterMgmtFrame *pMsg; |
| 7891 | tANI_U16 len; |
| 7892 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 7893 | |
| 7894 | if(!pSession) |
| 7895 | { |
| 7896 | smsLog(pMac, LOGE, FL(" session %d not found "), sessionId); |
Leela Venkata Kiran Kumar Reddy Chirala | 090cc1f | 2013-03-07 17:40:17 -0800 | [diff] [blame] | 7897 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 7898 | return eHAL_STATUS_FAILURE; |
| 7899 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7900 | |
| 7901 | if( !pSession->sessionActive ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7902 | { |
| 7903 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7904 | "%s Invalid Sessionid", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7905 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7906 | return eHAL_STATUS_FAILURE; |
| 7907 | } |
| 7908 | |
| 7909 | len = sizeof(tSirRegisterMgmtFrame) + matchLen; |
| 7910 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7911 | pMsg = vos_mem_malloc(len); |
| 7912 | if ( NULL == pMsg ) |
| 7913 | status = eHAL_STATUS_FAILURE; |
| 7914 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7915 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7916 | vos_mem_set(pMsg, len, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7917 | pMsg->messageType = eWNI_SME_REGISTER_MGMT_FRAME_REQ; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7918 | pMsg->length = len; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7919 | pMsg->registerFrame = VOS_FALSE; |
| 7920 | pMsg->frameType = frameType; |
| 7921 | pMsg->matchLen = matchLen; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7922 | vos_mem_copy(pMsg->matchData, matchData, matchLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7923 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 7924 | } |
| 7925 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7926 | } |
| 7927 | return status; |
| 7928 | } |
| 7929 | |
| 7930 | /* --------------------------------------------------------------------------- |
| 7931 | \fn sme_RemainOnChannel |
| 7932 | \brief API to request remain on channel for 'x' duration. used in p2p in listen state |
| 7933 | \param hHal - The handle returned by macOpen. |
| 7934 | \param pRequest - channel |
| 7935 | \param duration - duration in ms |
| 7936 | \param callback - HDD registered callback to process reaminOnChannelRsp |
| 7937 | \param context - HDD Callback param |
| 7938 | \return eHalStatus |
| 7939 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7940 | eHalStatus sme_RemainOnChannel(tHalHandle hHal, tANI_U8 sessionId, |
| 7941 | tANI_U8 channel, tANI_U32 duration, |
Gopichand Nakkala | 924e455 | 2013-05-08 19:18:14 +0530 | [diff] [blame] | 7942 | remainOnChanCallback callback, |
| 7943 | void *pContext, |
| 7944 | tANI_U8 isP2PProbeReqAllowed) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7945 | { |
| 7946 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7947 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7948 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7949 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7950 | TRACE_CODE_SME_RX_HDD_REMAIN_ONCHAN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7951 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7952 | { |
Gopichand Nakkala | 924e455 | 2013-05-08 19:18:14 +0530 | [diff] [blame] | 7953 | status = p2pRemainOnChannel (hHal, sessionId, channel, duration, callback, pContext, |
| 7954 | isP2PProbeReqAllowed |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7955 | #ifdef WLAN_FEATURE_P2P_INTERNAL |
| 7956 | , eP2PRemainOnChnReasonUnknown |
| 7957 | #endif |
| 7958 | ); |
| 7959 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7960 | } |
| 7961 | return(status); |
| 7962 | } |
| 7963 | |
| 7964 | /* --------------------------------------------------------------------------- |
| 7965 | \fn sme_ReportProbeReq |
| 7966 | \brief API to enable/disable forwarding of probeReq to apps in p2p. |
| 7967 | \param hHal - The handle returned by macOpen. |
| 7968 | \param falg: to set the Probe request forarding to wpa_supplicant in listen state in p2p |
| 7969 | \return eHalStatus |
| 7970 | ---------------------------------------------------------------------------*/ |
| 7971 | |
| 7972 | #ifndef WLAN_FEATURE_CONCURRENT_P2P |
| 7973 | eHalStatus sme_ReportProbeReq(tHalHandle hHal, tANI_U8 flag) |
| 7974 | { |
| 7975 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7976 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7977 | |
| 7978 | do |
| 7979 | { |
| 7980 | //acquire the lock for the sme object |
| 7981 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 7982 | if(HAL_STATUS_SUCCESS(status)) |
| 7983 | { |
| 7984 | /* call set in context */ |
| 7985 | pMac->p2pContext.probeReqForwarding = flag; |
| 7986 | //release the lock for the sme object |
| 7987 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7988 | } |
| 7989 | } while(0); |
| 7990 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7991 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7992 | |
| 7993 | return(status); |
| 7994 | } |
| 7995 | |
| 7996 | /* --------------------------------------------------------------------------- |
| 7997 | \fn sme_updateP2pIe |
| 7998 | \brief API to set the P2p Ie in p2p context |
| 7999 | \param hHal - The handle returned by macOpen. |
| 8000 | \param p2pIe - Ptr to p2pIe from HDD. |
| 8001 | \param p2pIeLength: length of p2pIe |
| 8002 | \return eHalStatus |
| 8003 | ---------------------------------------------------------------------------*/ |
| 8004 | |
| 8005 | eHalStatus sme_updateP2pIe(tHalHandle hHal, void *p2pIe, tANI_U32 p2pIeLength) |
| 8006 | { |
| 8007 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8008 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8009 | |
| 8010 | //acquire the lock for the sme object |
| 8011 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 8012 | if(HAL_STATUS_SUCCESS(status)) |
| 8013 | { |
| 8014 | if(NULL != pMac->p2pContext.probeRspIe){ |
| 8015 | vos_mem_free(pMac->p2pContext.probeRspIe); |
| 8016 | pMac->p2pContext.probeRspIeLength = 0; |
| 8017 | } |
| 8018 | |
| 8019 | pMac->p2pContext.probeRspIe = vos_mem_malloc(p2pIeLength); |
| 8020 | if (NULL == pMac->p2pContext.probeRspIe) |
| 8021 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8022 | smsLog(pMac, LOGE, "%s: Unable to allocate P2P IE", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8023 | pMac->p2pContext.probeRspIeLength = 0; |
| 8024 | status = eHAL_STATUS_FAILURE; |
| 8025 | } |
| 8026 | else |
| 8027 | { |
| 8028 | pMac->p2pContext.probeRspIeLength = p2pIeLength; |
| 8029 | |
| 8030 | sirDumpBuf( pMac, SIR_LIM_MODULE_ID, LOG2, |
| 8031 | pMac->p2pContext.probeRspIe, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8032 | pMac->p2pContext.probeRspIeLength ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8033 | vos_mem_copy((tANI_U8 *)pMac->p2pContext.probeRspIe, p2pIe, |
| 8034 | p2pIeLength); |
| 8035 | } |
| 8036 | |
| 8037 | //release the lock for the sme object |
| 8038 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8039 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8040 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8041 | smsLog(pMac, LOG2, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8042 | |
| 8043 | return(status); |
| 8044 | } |
| 8045 | #endif |
| 8046 | |
| 8047 | /* --------------------------------------------------------------------------- |
| 8048 | \fn sme_sendAction |
| 8049 | \brief API to send action frame from supplicant. |
| 8050 | \param hHal - The handle returned by macOpen. |
| 8051 | \return eHalStatus |
| 8052 | ---------------------------------------------------------------------------*/ |
| 8053 | |
| 8054 | eHalStatus sme_sendAction(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8055 | const tANI_U8 *pBuf, tANI_U32 len, |
| 8056 | tANI_U16 wait, tANI_BOOLEAN noack) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8057 | { |
| 8058 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8059 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8060 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8061 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8062 | TRACE_CODE_SME_RX_HDD_SEND_ACTION, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8063 | //acquire the lock for the sme object |
| 8064 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 8065 | if(HAL_STATUS_SUCCESS(status)) |
| 8066 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8067 | p2pSendAction(hHal, sessionId, pBuf, len, wait, noack); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8068 | //release the lock for the sme object |
| 8069 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8070 | } |
| 8071 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8072 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8073 | |
| 8074 | return(status); |
| 8075 | } |
| 8076 | |
| 8077 | eHalStatus sme_CancelRemainOnChannel(tHalHandle hHal, tANI_U8 sessionId ) |
| 8078 | { |
| 8079 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8080 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8081 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8082 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8083 | TRACE_CODE_SME_RX_HDD_CANCEL_REMAIN_ONCHAN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8084 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8085 | { |
| 8086 | status = p2pCancelRemainOnChannel (hHal, sessionId); |
| 8087 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8088 | } |
| 8089 | return(status); |
| 8090 | } |
| 8091 | |
| 8092 | //Power Save Related |
| 8093 | eHalStatus sme_p2pSetPs(tHalHandle hHal, tP2pPsConfig * data) |
| 8094 | { |
| 8095 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8096 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8097 | |
| 8098 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8099 | { |
| 8100 | status = p2pSetPs (hHal, data); |
| 8101 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8102 | } |
| 8103 | return(status); |
| 8104 | } |
| 8105 | |
Siddharth Bhal | b7c421c | 2015-02-27 00:26:09 +0530 | [diff] [blame] | 8106 | /* --------------------------------------------------------------------------- |
Siddharth Bhal | 6424617 | 2015-02-27 01:04:37 +0530 | [diff] [blame] | 8107 | \fn sme_GetFramesLog |
| 8108 | \brief a wrapper function that client calls to register a callback to get |
| 8109 | mgmt frames logged |
Siddharth Bhal | 6424617 | 2015-02-27 01:04:37 +0530 | [diff] [blame] | 8110 | \param flag - flag tells to clear OR send the frame log buffer |
Siddharth Bhal | 6424617 | 2015-02-27 01:04:37 +0530 | [diff] [blame] | 8111 | \return eHalStatus |
| 8112 | ---------------------------------------------------------------------------*/ |
Abhishek Singh | 611295e | 2015-07-09 11:11:54 +0530 | [diff] [blame] | 8113 | eHalStatus sme_GetFramesLog(tHalHandle hHal, tANI_U8 flag) |
Siddharth Bhal | 6424617 | 2015-02-27 01:04:37 +0530 | [diff] [blame] | 8114 | { |
| 8115 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8116 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8117 | tSmeCmd *pGetFrameLogCmd; |
| 8118 | |
mukul sharma | ca8e432 | 2015-07-20 18:33:43 +0530 | [diff] [blame] | 8119 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8120 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8121 | { |
| 8122 | pGetFrameLogCmd = csrGetCommandBuffer(pMac); |
| 8123 | if (pGetFrameLogCmd) |
Siddharth Bhal | 6424617 | 2015-02-27 01:04:37 +0530 | [diff] [blame] | 8124 | { |
mukul sharma | ca8e432 | 2015-07-20 18:33:43 +0530 | [diff] [blame] | 8125 | pGetFrameLogCmd->command = eSmeCommandGetFrameLogRequest; |
| 8126 | pGetFrameLogCmd->u.getFramelogCmd.getFrameLogCmdFlag= flag; |
Siddharth Bhal | 6424617 | 2015-02-27 01:04:37 +0530 | [diff] [blame] | 8127 | |
mukul sharma | ca8e432 | 2015-07-20 18:33:43 +0530 | [diff] [blame] | 8128 | status = csrQueueSmeCommand(pMac, pGetFrameLogCmd, eANI_BOOLEAN_TRUE); |
| 8129 | if ( !HAL_STATUS_SUCCESS( status ) ) |
| 8130 | { |
| 8131 | smsLog( pMac, LOGE, FL("fail to send msg status = %d\n"), status ); |
| 8132 | csrReleaseCommandScan(pMac, pGetFrameLogCmd); |
| 8133 | } |
| 8134 | } |
| 8135 | else |
| 8136 | { |
| 8137 | //log error |
| 8138 | smsLog(pMac, LOGE, FL("can not obtain a common buffer\n")); |
| 8139 | status = eHAL_STATUS_RESOURCES; |
| 8140 | } |
| 8141 | sme_ReleaseGlobalLock( &pMac->sme); |
| 8142 | } |
Siddharth Bhal | 6424617 | 2015-02-27 01:04:37 +0530 | [diff] [blame] | 8143 | return (status); |
| 8144 | } |
| 8145 | |
| 8146 | /* --------------------------------------------------------------------------- |
Siddharth Bhal | b7c421c | 2015-02-27 00:26:09 +0530 | [diff] [blame] | 8147 | |
| 8148 | \fn sme_InitMgmtFrameLogging |
| 8149 | |
| 8150 | \brief |
| 8151 | SME will pass this request to lower mac to initialize Frame Logging. |
| 8152 | |
| 8153 | \param |
| 8154 | |
| 8155 | hHal - The handle returned by macOpen. |
| 8156 | |
Siddharth Bhal | d1be97f | 2015-05-27 22:39:59 +0530 | [diff] [blame] | 8157 | wlanFWLoggingInitParam - Params to initialize frame logging |
Siddharth Bhal | b7c421c | 2015-02-27 00:26:09 +0530 | [diff] [blame] | 8158 | |
| 8159 | \return eHalStatus |
| 8160 | |
| 8161 | |
| 8162 | --------------------------------------------------------------------------- */ |
| 8163 | eHalStatus sme_InitMgmtFrameLogging( tHalHandle hHal, |
Siddharth Bhal | d1be97f | 2015-05-27 22:39:59 +0530 | [diff] [blame] | 8164 | tSirFWLoggingInitParam *wlanFWLoggingInitParam) |
Siddharth Bhal | b7c421c | 2015-02-27 00:26:09 +0530 | [diff] [blame] | 8165 | { |
| 8166 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8167 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 8168 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8169 | vos_msg_t vosMessage; |
Sreelakshmi Konamki | d8784d9 | 2016-04-14 14:59:13 +0530 | [diff] [blame] | 8170 | tpSirFWLoggingInitParam msg; |
| 8171 | |
| 8172 | msg = vos_mem_malloc(sizeof(tSirFWLoggingInitParam)); |
| 8173 | |
| 8174 | if (NULL == msg) |
| 8175 | { |
| 8176 | smsLog(pMac, LOGE, FL("Failed to alloc mem of size %zu for msg"), |
| 8177 | sizeof(*msg)); |
| 8178 | return eHAL_STATUS_FAILED_ALLOC; |
| 8179 | } |
| 8180 | *msg = *wlanFWLoggingInitParam; |
Siddharth Bhal | b7c421c | 2015-02-27 00:26:09 +0530 | [diff] [blame] | 8181 | |
| 8182 | if ( eHAL_STATUS_SUCCESS == ( status = |
| 8183 | sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8184 | { |
| 8185 | /* serialize the req through MC thread */ |
Sreelakshmi Konamki | d8784d9 | 2016-04-14 14:59:13 +0530 | [diff] [blame] | 8186 | vosMessage.bodyptr = msg; |
Siddharth Bhal | b7c421c | 2015-02-27 00:26:09 +0530 | [diff] [blame] | 8187 | vosMessage.type = WDA_MGMT_LOGGING_INIT_REQ; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 8188 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 8189 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
Siddharth Bhal | b7c421c | 2015-02-27 00:26:09 +0530 | [diff] [blame] | 8190 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 8191 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 8192 | { |
Sreelakshmi Konamki | d8784d9 | 2016-04-14 14:59:13 +0530 | [diff] [blame] | 8193 | vos_mem_free(msg); |
Siddharth Bhal | b7c421c | 2015-02-27 00:26:09 +0530 | [diff] [blame] | 8194 | status = eHAL_STATUS_FAILURE; |
| 8195 | } |
| 8196 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8197 | } |
Sreelakshmi Konamki | d8784d9 | 2016-04-14 14:59:13 +0530 | [diff] [blame] | 8198 | else |
| 8199 | { |
| 8200 | smsLog(pMac, LOGE, FL("sme_AcquireGlobalLock error")); |
| 8201 | vos_mem_free(msg); |
| 8202 | } |
Siddharth Bhal | b7c421c | 2015-02-27 00:26:09 +0530 | [diff] [blame] | 8203 | return(status); |
| 8204 | } |
Gupta, Kapil | 7c34b32 | 2015-09-30 13:12:35 +0530 | [diff] [blame] | 8205 | /* --------------------------------------------------------------------------- |
| 8206 | |
| 8207 | \fn sme_StartRssiMonitoring |
| 8208 | |
| 8209 | \brief |
| 8210 | SME will pass this request to lower mac to start monitoring rssi range on |
| 8211 | a bssid. |
| 8212 | |
| 8213 | \param |
| 8214 | |
| 8215 | hHal - The handle returned by macOpen. |
| 8216 | |
| 8217 | tSirRssiMonitorReq req- depict the monitor req params. |
| 8218 | |
| 8219 | \return eHalStatus |
| 8220 | |
| 8221 | --------------------------------------------------------------------------- */ |
| 8222 | eHalStatus sme_StartRssiMonitoring( tHalHandle hHal, |
| 8223 | tSirRssiMonitorReq *req) |
| 8224 | { |
| 8225 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8226 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 8227 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8228 | vos_msg_t vosMessage; |
| 8229 | |
| 8230 | if ( eHAL_STATUS_SUCCESS == ( status = |
| 8231 | sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8232 | { |
| 8233 | /* serialize the req through MC thread */ |
| 8234 | vosMessage.bodyptr = req; |
| 8235 | vosMessage.type = WDA_START_RSSI_MONITOR_REQ; |
| 8236 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 8237 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
| 8238 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 8239 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 8240 | { |
| 8241 | status = eHAL_STATUS_FAILURE; |
| 8242 | } |
| 8243 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8244 | } |
| 8245 | return(status); |
| 8246 | } |
| 8247 | |
| 8248 | /* --------------------------------------------------------------------------- |
| 8249 | |
| 8250 | \fn sme_StopRssiMonitoring |
| 8251 | |
| 8252 | \brief |
| 8253 | SME will pass this request to lower mac to stop monitoring rssi range on |
| 8254 | a bssid. |
| 8255 | |
| 8256 | \param |
| 8257 | |
| 8258 | hHal - The handle returned by macOpen. |
| 8259 | |
| 8260 | tSirRssiMonitorReq req- depict the monitor req params. |
| 8261 | |
| 8262 | \return eHalStatus |
| 8263 | |
| 8264 | --------------------------------------------------------------------------- */ |
| 8265 | eHalStatus sme_StopRssiMonitoring(tHalHandle hHal, |
| 8266 | tSirRssiMonitorReq *req) |
| 8267 | { |
| 8268 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8269 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 8270 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8271 | vos_msg_t vosMessage; |
| 8272 | |
| 8273 | if ( eHAL_STATUS_SUCCESS == ( status = |
| 8274 | sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8275 | { |
| 8276 | /* serialize the req through MC thread */ |
| 8277 | vosMessage.bodyptr = req; |
| 8278 | vosMessage.type = WDA_STOP_RSSI_MONITOR_REQ; |
| 8279 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 8280 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
| 8281 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 8282 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 8283 | { |
| 8284 | status = eHAL_STATUS_FAILURE; |
| 8285 | } |
| 8286 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8287 | } |
| 8288 | return(status); |
| 8289 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8290 | |
| 8291 | /* --------------------------------------------------------------------------- |
| 8292 | |
| 8293 | \fn sme_ConfigureRxpFilter |
| 8294 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8295 | \brief |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8296 | SME will pass this request to lower mac to set/reset the filter on RXP for |
| 8297 | multicast & broadcast traffic. |
| 8298 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8299 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8300 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8301 | hHal - The handle returned by macOpen. |
| 8302 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8303 | filterMask- Currently the API takes a 1 or 0 (set or reset) as filter. |
| 8304 | Basically to enable/disable the filter (to filter "all" mcbc traffic) based |
| 8305 | on this param. In future we can use this as a mask to set various types of |
| 8306 | filters as suggested below: |
| 8307 | FILTER_ALL_MULTICAST: |
| 8308 | FILTER_ALL_BROADCAST: |
| 8309 | FILTER_ALL_MULTICAST_BROADCAST: |
| 8310 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8311 | |
| 8312 | \return eHalStatus |
| 8313 | |
| 8314 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8315 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8316 | eHalStatus sme_ConfigureRxpFilter( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8317 | tpSirWlanSetRxpFilters wlanRxpFilterParam) |
| 8318 | { |
| 8319 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8320 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 8321 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8322 | vos_msg_t vosMessage; |
| 8323 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8324 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8325 | TRACE_CODE_SME_RX_HDD_CONFIG_RXPFIL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8326 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8327 | { |
| 8328 | /* serialize the req through MC thread */ |
| 8329 | vosMessage.bodyptr = wlanRxpFilterParam; |
| 8330 | vosMessage.type = WDA_CFG_RXP_FILTER_REQ; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 8331 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 8332 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8333 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 8334 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 8335 | { |
| 8336 | status = eHAL_STATUS_FAILURE; |
| 8337 | } |
| 8338 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8339 | } |
| 8340 | return(status); |
| 8341 | } |
| 8342 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8343 | /* --------------------------------------------------------------------------- |
| 8344 | |
mukul sharma | 6b53e20 | 2016-11-23 19:29:18 +0530 | [diff] [blame] | 8345 | \fn sme_update_hal_int_param |
| 8346 | |
| 8347 | \brief |
| 8348 | SME will pass this request to lower mac to indicate that the host needs to |
| 8349 | update the cfg item |
| 8350 | |
| 8351 | \param |
| 8352 | |
| 8353 | hHal - The handle returned by macOpen. |
| 8354 | |
| 8355 | cfg_id- cfg param id |
| 8356 | |
| 8357 | |
| 8358 | \return eHalStatus |
| 8359 | |
| 8360 | |
| 8361 | --------------------------------------------------------------------------- */ |
| 8362 | |
| 8363 | eHalStatus sme_update_cfg_int_param(tHalHandle hHal, |
| 8364 | tANI_U32 cfg_id) |
| 8365 | { |
| 8366 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8367 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 8368 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8369 | vos_msg_t vosMessage; |
| 8370 | tpSirUpdateCfgIntParam updateCfgIntParam = |
| 8371 | vos_mem_malloc(sizeof(tSirUpdateCfgIntParam)); |
| 8372 | |
| 8373 | if (updateCfgIntParam == NULL) |
| 8374 | { |
| 8375 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8376 | "%s: vos_mem_alloc for updateCfgIntParam", __func__); |
| 8377 | return eHAL_STATUS_FAILURE; |
| 8378 | } |
| 8379 | |
| 8380 | updateCfgIntParam->cfgId = cfg_id; |
| 8381 | /* |
| 8382 | * This API expect user must have updated cfg item using cfg API's. |
| 8383 | * Hence it just need the cfg param id not the cfg value. |
| 8384 | */ |
| 8385 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 8386 | if (eHAL_STATUS_SUCCESS == status) |
| 8387 | { |
| 8388 | /* serialize the req through MC thread */ |
| 8389 | vosMessage.bodyptr = updateCfgIntParam; |
| 8390 | vosMessage.type = WDA_UPDATE_CFG_INT_PARAM; |
| 8391 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 8392 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 8393 | { |
| 8394 | status = eHAL_STATUS_FAILURE; |
| 8395 | vos_mem_free(updateCfgIntParam); |
| 8396 | } |
| 8397 | sme_ReleaseGlobalLock(&pMac->sme); |
| 8398 | } |
| 8399 | else |
| 8400 | { |
| 8401 | status = eHAL_STATUS_FAILURE; |
| 8402 | vos_mem_free(updateCfgIntParam); |
| 8403 | } |
| 8404 | return(status); |
| 8405 | } |
| 8406 | |
| 8407 | /* --------------------------------------------------------------------------- |
| 8408 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8409 | \fn sme_ConfigureSuspendInd |
| 8410 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8411 | \brief |
| 8412 | SME will pass this request to lower mac to Indicate that the wlan needs to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8413 | be suspended |
| 8414 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8415 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8416 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8417 | hHal - The handle returned by macOpen. |
| 8418 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8419 | wlanSuspendParam- Depicts the wlan suspend params |
| 8420 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8421 | |
| 8422 | \return eHalStatus |
| 8423 | |
| 8424 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8425 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8426 | eHalStatus sme_ConfigureSuspendInd( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8427 | tpSirWlanSuspendParam wlanSuspendParam) |
| 8428 | { |
| 8429 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8430 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 8431 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8432 | vos_msg_t vosMessage; |
| 8433 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8434 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8435 | TRACE_CODE_SME_RX_HDD_CONFIG_SUSPENDIND, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8436 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8437 | { |
| 8438 | /* serialize the req through MC thread */ |
| 8439 | vosMessage.bodyptr = wlanSuspendParam; |
| 8440 | vosMessage.type = WDA_WLAN_SUSPEND_IND; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 8441 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 8442 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8443 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 8444 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 8445 | { |
| 8446 | status = eHAL_STATUS_FAILURE; |
| 8447 | } |
| 8448 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8449 | } |
| 8450 | return(status); |
| 8451 | } |
| 8452 | |
| 8453 | /* --------------------------------------------------------------------------- |
| 8454 | |
| 8455 | \fn sme_ConfigureResumeReq |
| 8456 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8457 | \brief |
| 8458 | SME will pass this request to lower mac to Indicate that the wlan needs to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8459 | be Resumed |
| 8460 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8461 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8462 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8463 | hHal - The handle returned by macOpen. |
| 8464 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8465 | wlanResumeParam- Depicts the wlan resume params |
| 8466 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8467 | |
| 8468 | \return eHalStatus |
| 8469 | |
| 8470 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8471 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8472 | eHalStatus sme_ConfigureResumeReq( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8473 | tpSirWlanResumeParam wlanResumeParam) |
| 8474 | { |
| 8475 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8476 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 8477 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8478 | vos_msg_t vosMessage; |
| 8479 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8480 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8481 | TRACE_CODE_SME_RX_HDD_CONFIG_RESUMEREQ, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8482 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8483 | { |
| 8484 | /* serialize the req through MC thread */ |
| 8485 | vosMessage.bodyptr = wlanResumeParam; |
| 8486 | vosMessage.type = WDA_WLAN_RESUME_REQ; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 8487 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 8488 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8489 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 8490 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 8491 | { |
| 8492 | status = eHAL_STATUS_FAILURE; |
| 8493 | } |
| 8494 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8495 | } |
| 8496 | return(status); |
| 8497 | } |
| 8498 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8499 | /* --------------------------------------------------------------------------- |
| 8500 | |
| 8501 | \fn sme_GetInfraSessionId |
| 8502 | |
| 8503 | \brief To get the session ID for infra session, if connected |
| 8504 | This is a synchronous API. |
| 8505 | |
| 8506 | \param hHal - The handle returned by macOpen. |
| 8507 | |
| 8508 | \return sessionid, -1 if infra session is not connected |
| 8509 | |
| 8510 | -------------------------------------------------------------------------------*/ |
| 8511 | tANI_S8 sme_GetInfraSessionId(tHalHandle hHal) |
| 8512 | { |
| 8513 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8514 | tANI_S8 sessionid = -1; |
| 8515 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8516 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8517 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8518 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8519 | { |
| 8520 | |
| 8521 | sessionid = csrGetInfraSessionId( pMac); |
| 8522 | |
| 8523 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8524 | } |
| 8525 | |
| 8526 | return (sessionid); |
| 8527 | } |
| 8528 | |
Padma, Santhosh Kumar | 9093b20 | 2015-07-21 15:37:38 +0530 | [diff] [blame] | 8529 | tANI_U32 sme_get_sessionid_from_activeList(tpAniSirGlobal mac) |
| 8530 | { |
| 8531 | tListElem *entry = NULL; |
| 8532 | tSmeCmd *command = NULL; |
| 8533 | tANI_U32 session_id = 0; |
| 8534 | |
| 8535 | entry = csrLLPeekHead( &mac->sme.smeCmdActiveList, LL_ACCESS_LOCK ); |
| 8536 | if ( entry ) { |
| 8537 | command = GET_BASE_ADDR( entry, tSmeCmd, Link ); |
| 8538 | session_id = command->sessionId; |
| 8539 | } |
| 8540 | |
| 8541 | return (session_id); |
| 8542 | } |
| 8543 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8544 | /* --------------------------------------------------------------------------- |
| 8545 | |
| 8546 | \fn sme_GetInfraOperationChannel |
| 8547 | |
| 8548 | \brief To get the operating channel for infra session, if connected |
| 8549 | This is a synchronous API. |
| 8550 | |
| 8551 | \param hHal - The handle returned by macOpen. |
| 8552 | \param sessionId - the sessionId returned by sme_OpenSession. |
| 8553 | |
| 8554 | \return operating channel, 0 if infra session is not connected |
| 8555 | |
| 8556 | -------------------------------------------------------------------------------*/ |
| 8557 | tANI_U8 sme_GetInfraOperationChannel( tHalHandle hHal, tANI_U8 sessionId) |
| 8558 | { |
| 8559 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8560 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8561 | tANI_U8 channel = 0; |
| 8562 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8563 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8564 | { |
| 8565 | |
| 8566 | channel = csrGetInfraOperationChannel( pMac, sessionId); |
| 8567 | |
| 8568 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8569 | } |
| 8570 | |
| 8571 | return (channel); |
| 8572 | } |
| 8573 | |
| 8574 | //This routine will return poerating channel on which other BSS is operating to be used for concurrency mode. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8575 | //If other BSS is not up or not connected it will return 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8576 | tANI_U8 sme_GetConcurrentOperationChannel( tHalHandle hHal ) |
| 8577 | { |
| 8578 | eHalStatus status = eHAL_STATUS_FAILURE; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8579 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8580 | tANI_U8 channel = 0; |
| 8581 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8582 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8583 | { |
| 8584 | |
| 8585 | channel = csrGetConcurrentOperationChannel( pMac ); |
| 8586 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, "%s: " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8587 | " Other Concurrent Channel = %d", __func__,channel); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8588 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8589 | } |
| 8590 | |
| 8591 | return (channel); |
| 8592 | } |
| 8593 | |
| 8594 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 8595 | /****************************************************************************** |
| 8596 | * |
| 8597 | * Name: sme_PreferredNetworkFoundInd |
| 8598 | * |
| 8599 | * Description: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8600 | * Invoke Preferred Network Found Indication |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8601 | * |
| 8602 | * Parameters: |
| 8603 | * hHal - HAL handle for device |
| 8604 | * pMsg - found network description |
| 8605 | * |
| 8606 | * Returns: eHalStatus |
| 8607 | * |
| 8608 | ******************************************************************************/ |
| 8609 | eHalStatus sme_PreferredNetworkFoundInd (tHalHandle hHal, void* pMsg) |
| 8610 | { |
| 8611 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8612 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8613 | tSirPrefNetworkFoundInd *pPrefNetworkFoundInd = (tSirPrefNetworkFoundInd *)pMsg; |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 8614 | v_U8_t dumpSsId[SIR_MAC_MAX_SSID_LENGTH + 1]; |
| 8615 | tANI_U8 ssIdLength = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8616 | |
| 8617 | if (NULL == pMsg) |
| 8618 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8619 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8620 | status = eHAL_STATUS_FAILURE; |
| 8621 | } |
| 8622 | else |
| 8623 | { |
| 8624 | if (pPrefNetworkFoundInd->ssId.length > 0) |
| 8625 | { |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 8626 | ssIdLength = CSR_MIN(SIR_MAC_MAX_SSID_LENGTH, |
| 8627 | pPrefNetworkFoundInd->ssId.length); |
| 8628 | vos_mem_copy(dumpSsId, pPrefNetworkFoundInd->ssId.ssId, ssIdLength); |
| 8629 | dumpSsId[ssIdLength] = 0; |
Abhishek Singh | 195c03e | 2014-05-14 17:21:30 +0530 | [diff] [blame] | 8630 | smsLog(pMac, LOG1, FL(" SSID=%s frame length %d"), |
| 8631 | dumpSsId, pPrefNetworkFoundInd->frameLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8632 | |
Vinay Krishna Eranna | b13043b | 2013-12-06 11:50:21 +0530 | [diff] [blame] | 8633 | /* Flush scan results, So as to avoid indication/updation of |
| 8634 | * stale entries, which may not have aged out during APPS collapse |
| 8635 | */ |
| 8636 | sme_ScanFlushResult(hHal,0); |
| 8637 | |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 8638 | //Save the frame to scan result |
| 8639 | if (pPrefNetworkFoundInd->mesgLen > sizeof(tSirPrefNetworkFoundInd)) |
| 8640 | { |
| 8641 | //we may have a frame |
| 8642 | status = csrScanSavePreferredNetworkFound(pMac, |
| 8643 | pPrefNetworkFoundInd); |
| 8644 | if (!HAL_STATUS_SUCCESS(status)) |
| 8645 | { |
| 8646 | smsLog(pMac, LOGE, FL(" fail to save preferred network")); |
| 8647 | } |
| 8648 | } |
| 8649 | else |
| 8650 | { |
Jeff Johnson | afeb958 | 2013-11-22 18:39:00 -0800 | [diff] [blame] | 8651 | smsLog(pMac, LOGE, FL(" not enough data length %u needed %zu"), |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 8652 | pPrefNetworkFoundInd->mesgLen, sizeof(tSirPrefNetworkFoundInd)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8653 | } |
| 8654 | |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 8655 | /* Call Preferred Netowrk Found Indication callback routine. */ |
| 8656 | if (HAL_STATUS_SUCCESS(status) && (pMac->pmc.prefNetwFoundCB != NULL)) |
| 8657 | { |
| 8658 | pMac->pmc.prefNetwFoundCB( |
| 8659 | pMac->pmc.preferredNetworkFoundIndCallbackContext, |
| 8660 | pPrefNetworkFoundInd); |
| 8661 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8662 | } |
| 8663 | else |
| 8664 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8665 | smsLog(pMac, LOGE, "%s: callback failed - SSID is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8666 | status = eHAL_STATUS_FAILURE; |
| 8667 | } |
| 8668 | } |
| 8669 | |
| 8670 | |
| 8671 | return(status); |
| 8672 | } |
| 8673 | |
| 8674 | #endif // FEATURE_WLAN_SCAN_PNO |
| 8675 | |
| 8676 | |
| 8677 | eHalStatus sme_GetCfgValidChannels(tHalHandle hHal, tANI_U8 *aValidChannels, tANI_U32 *len) |
| 8678 | { |
| 8679 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8680 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8681 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8682 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8683 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8684 | { |
| 8685 | status = csrGetCfgValidChannels(pMac, aValidChannels, len); |
| 8686 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8687 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8688 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8689 | return (status); |
| 8690 | } |
| 8691 | |
Padma, Santhosh Kumar | 778d838 | 2015-03-04 17:41:22 +0530 | [diff] [blame] | 8692 | eHalStatus sme_SetCfgScanControlList(tHalHandle hHal, tANI_U8 *countryCode, tCsrChannel *pChannelList) |
| 8693 | { |
| 8694 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8695 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8696 | |
| 8697 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8698 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8699 | { |
| 8700 | csrSetCfgScanControlList(pMac, countryCode, pChannelList); |
| 8701 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8702 | } |
| 8703 | |
| 8704 | return (status); |
| 8705 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8706 | |
| 8707 | /* --------------------------------------------------------------------------- |
| 8708 | |
| 8709 | \fn sme_SetTxPerTracking |
| 8710 | |
| 8711 | \brief Set Tx PER tracking configuration parameters |
| 8712 | |
| 8713 | \param hHal - The handle returned by macOpen. |
| 8714 | \param pTxPerTrackingConf - Tx PER configuration parameters |
| 8715 | |
| 8716 | \return eHalStatus |
| 8717 | |
| 8718 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8719 | eHalStatus sme_SetTxPerTracking(tHalHandle hHal, |
| 8720 | void (*pCallbackfn) (void *pCallbackContext), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8721 | void *pCallbackContext, |
| 8722 | tpSirTxPerTrackingParam pTxPerTrackingParam) |
| 8723 | { |
| 8724 | vos_msg_t msg; |
| 8725 | tpSirTxPerTrackingParam pTxPerTrackingParamReq = NULL; |
| 8726 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8727 | |
| 8728 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 8729 | { |
| 8730 | pMac->sme.pTxPerHitCallback = pCallbackfn; |
| 8731 | pMac->sme.pTxPerHitCbContext = pCallbackContext; |
| 8732 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8733 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8734 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8735 | // free this memory in failure case or WDA request callback function |
| 8736 | pTxPerTrackingParamReq = vos_mem_malloc(sizeof(tSirTxPerTrackingParam)); |
| 8737 | if (NULL == pTxPerTrackingParamReq) |
| 8738 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8739 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to allocate memory for tSirTxPerTrackingParam", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8740 | return eHAL_STATUS_FAILURE; |
| 8741 | } |
| 8742 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8743 | vos_mem_copy(pTxPerTrackingParamReq, (void*)pTxPerTrackingParam, |
| 8744 | sizeof(tSirTxPerTrackingParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8745 | msg.type = WDA_SET_TX_PER_TRACKING_REQ; |
| 8746 | msg.reserved = 0; |
| 8747 | msg.bodyptr = pTxPerTrackingParamReq; |
| 8748 | |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 8749 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 8750 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8751 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8752 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8753 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to post WDA_SET_TX_PER_TRACKING_REQ message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8754 | vos_mem_free(pTxPerTrackingParamReq); |
| 8755 | return eHAL_STATUS_FAILURE; |
| 8756 | } |
| 8757 | |
| 8758 | return eHAL_STATUS_SUCCESS; |
| 8759 | } |
| 8760 | |
| 8761 | /* --------------------------------------------------------------------------- |
| 8762 | |
| 8763 | \fn sme_HandleChangeCountryCode |
| 8764 | |
| 8765 | \brief Change Country code, Reg Domain and channel list |
| 8766 | |
| 8767 | \details Country Code Priority |
| 8768 | 0 = 11D > Configured Country > NV |
| 8769 | 1 = Configured Country > 11D > NV |
| 8770 | If Supplicant country code is priority than 11d is disabled. |
| 8771 | If 11D is enabled, we update the country code after every scan. |
| 8772 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 8773 | Country code from Supplicant is set as current courtry code. |
| 8774 | User can send reset command XX (instead of country code) to reset the |
| 8775 | country code to default values which is read from NV. |
| 8776 | In case of reset, 11D is enabled and default NV code is Set as current country code |
| 8777 | If 11D is priority, |
| 8778 | Than Supplicant country code code is set to default code. But 11D code is set as current country code |
| 8779 | |
| 8780 | \param pMac - The handle returned by macOpen. |
| 8781 | \param pMsgBuf - MSG Buffer |
| 8782 | |
| 8783 | \return eHalStatus |
| 8784 | |
| 8785 | -------------------------------------------------------------------------------*/ |
| 8786 | eHalStatus sme_HandleChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf) |
| 8787 | { |
| 8788 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8789 | tAniChangeCountryCodeReq *pMsg; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 8790 | v_REGDOMAIN_t domainIdIoctl; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8791 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 8792 | static uNvTables nvTables; |
| 8793 | pMsg = (tAniChangeCountryCodeReq *)pMsgBuf; |
| 8794 | |
Agarwal Ashish | 8bd53ae | 2015-06-12 18:03:45 +0530 | [diff] [blame] | 8795 | if (pMac->scan.fcc_constraint) |
| 8796 | { |
| 8797 | pMac->scan.fcc_constraint = false; |
| 8798 | if (VOS_TRUE== vos_mem_compare(pMac->scan.countryCodeCurrent, |
| 8799 | pMsg->countryCode, 2)) |
| 8800 | { |
| 8801 | csrInitGetChannels(pMac); |
| 8802 | csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); |
| 8803 | csrScanFilterResults(pMac); |
| 8804 | return status ; |
| 8805 | } |
| 8806 | } |
| 8807 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8808 | |
| 8809 | /* if the reset Supplicant country code command is triggered, enable 11D, reset the NV country code and return */ |
| 8810 | if( VOS_TRUE == vos_mem_compare(pMsg->countryCode, SME_INVALID_COUNTRY_CODE, 2) ) |
| 8811 | { |
| 8812 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 8813 | |
| 8814 | vosStatus = vos_nv_readDefaultCountryTable( &nvTables ); |
| 8815 | |
| 8816 | /* read the country code from NV and use it */ |
| 8817 | if ( VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 8818 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8819 | vos_mem_copy(pMsg->countryCode, |
| 8820 | nvTables.defaultCountryTable.countryCode, |
| 8821 | WNI_CFG_COUNTRY_CODE_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8822 | } |
| 8823 | else |
| 8824 | { |
| 8825 | status = eHAL_STATUS_FAILURE; |
| 8826 | return status; |
| 8827 | } |
Abhishek Singh | 4d6b54c | 2014-10-14 12:31:00 +0530 | [diff] [blame] | 8828 | /* Update the 11d country to default country from NV bin so that when |
| 8829 | * callback is received for this default country, driver will not |
| 8830 | * disable the 11d taking it as valid country by user. |
| 8831 | */ |
| 8832 | smsLog(pMac, LOG1, |
| 8833 | FL("Set default country code (%c%c) from NV as invalid country received"), |
| 8834 | pMsg->countryCode[0],pMsg->countryCode[1]); |
| 8835 | vos_mem_copy(pMac->scan.countryCode11d, pMsg->countryCode, |
| 8836 | WNI_CFG_COUNTRY_CODE_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8837 | } |
| 8838 | else |
| 8839 | { |
| 8840 | /* if Supplicant country code has priority, disable 11d */ |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 8841 | if(pMac->roam.configParam.fSupplicantCountryCodeHasPriority && |
| 8842 | pMsg->countryFromUserSpace) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8843 | { |
| 8844 | pMac->roam.configParam.Is11dSupportEnabled = eANI_BOOLEAN_FALSE; |
| 8845 | } |
| 8846 | } |
| 8847 | |
| 8848 | /* WEXT set country code means |
| 8849 | * 11D should be supported? |
| 8850 | * 11D Channel should be enforced? |
| 8851 | * 11D Country code should be matched? |
| 8852 | * 11D Reg Domian should be matched? |
| 8853 | * Country string changed */ |
| 8854 | if(pMac->roam.configParam.Is11dSupportEnabled && |
| 8855 | pMac->roam.configParam.fEnforce11dChannels && |
| 8856 | pMac->roam.configParam.fEnforceCountryCodeMatch && |
| 8857 | pMac->roam.configParam.fEnforceDefaultDomain && |
| 8858 | !csrSave11dCountryString(pMac, pMsg->countryCode, eANI_BOOLEAN_TRUE)) |
| 8859 | { |
| 8860 | /* All 11D related options are already enabled |
| 8861 | * Country string is not changed |
| 8862 | * Do not need do anything for country code change request */ |
| 8863 | return eHAL_STATUS_SUCCESS; |
| 8864 | } |
| 8865 | |
| 8866 | /* Set Current Country code and Current Regulatory domain */ |
| 8867 | status = csrSetCountryCode(pMac, pMsg->countryCode, NULL); |
| 8868 | if(eHAL_STATUS_SUCCESS != status) |
| 8869 | { |
| 8870 | /* Supplicant country code failed. So give 11D priority */ |
| 8871 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 8872 | smsLog(pMac, LOGE, "Set Country Code Fail %d", status); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8873 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8874 | } |
| 8875 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8876 | /* overwrite the defualt country code */ |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8877 | vos_mem_copy(pMac->scan.countryCodeDefault, |
| 8878 | pMac->scan.countryCodeCurrent, |
| 8879 | WNI_CFG_COUNTRY_CODE_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8880 | |
| 8881 | /* Get Domain ID from country code */ |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 8882 | status = csrGetRegulatoryDomainForCountry(pMac, |
| 8883 | pMac->scan.countryCodeCurrent, |
| 8884 | (v_REGDOMAIN_t *) &domainIdIoctl, |
| 8885 | COUNTRY_QUERY); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8886 | if ( status != eHAL_STATUS_SUCCESS ) |
| 8887 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8888 | smsLog( pMac, LOGE, FL(" fail to get regId %d"), domainIdIoctl ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8889 | return status; |
| 8890 | } |
Tushnim Bhattacharyya | 796ffe8 | 2013-11-05 16:31:36 -0800 | [diff] [blame] | 8891 | else if (REGDOMAIN_WORLD == domainIdIoctl) |
| 8892 | { |
| 8893 | /* Supplicant country code is invalid, so we are on world mode now. So |
| 8894 | give 11D chance to update */ |
| 8895 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 8896 | smsLog(pMac, LOG1, FL("Country Code unrecognized by driver")); |
| 8897 | } |
| 8898 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8899 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 8900 | status = WDA_SetRegDomain(pMac, domainIdIoctl, pMsg->sendRegHint); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8901 | |
| 8902 | if ( status != eHAL_STATUS_SUCCESS ) |
| 8903 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8904 | smsLog( pMac, LOGE, FL(" fail to set regId %d"), domainIdIoctl ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8905 | return status; |
| 8906 | } |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 8907 | else |
| 8908 | { |
| 8909 | //if 11d has priority, clear currentCountryBssid & countryCode11d to get |
| 8910 | //set again if we find AP with 11d info during scan |
Sachin Ahuja | cb64fc8 | 2015-01-12 17:01:05 +0530 | [diff] [blame] | 8911 | status = csrSetRegulatoryDomain(pMac, domainIdIoctl, NULL); |
| 8912 | if (status != eHAL_STATUS_SUCCESS) |
| 8913 | { |
| 8914 | smsLog( pMac, LOGE, FL("fail to set regId.status : %d"), status); |
| 8915 | } |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 8916 | if (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority) |
| 8917 | { |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8918 | smsLog( pMac, LOGW, FL("Clearing currentCountryBssid, countryCode11d")); |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 8919 | vos_mem_zero(&pMac->scan.currentCountryBssid, sizeof(tCsrBssid)); |
| 8920 | vos_mem_zero( pMac->scan.countryCode11d, sizeof( pMac->scan.countryCode11d ) ); |
| 8921 | } |
| 8922 | } |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 8923 | #ifndef CONFIG_ENABLE_LINUX_REG |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8924 | /* set to default domain ID */ |
| 8925 | pMac->scan.domainIdDefault = pMac->scan.domainIdCurrent; |
| 8926 | |
| 8927 | /* get the channels based on new cc */ |
| 8928 | status = csrInitGetChannels( pMac ); |
| 8929 | |
| 8930 | if ( status != eHAL_STATUS_SUCCESS ) |
| 8931 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8932 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8933 | return status; |
| 8934 | } |
| 8935 | |
| 8936 | /* reset info based on new cc, and we are done */ |
Gopichand Nakkala | b9185f2 | 2012-12-21 08:03:42 -0800 | [diff] [blame] | 8937 | csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 8938 | /* Country code Changed, Purge Only scan result |
| 8939 | * which does not have channel number belong to 11d |
| 8940 | * channel list |
| 8941 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 8942 | csrScanFilterResults(pMac); |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 8943 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 8944 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8945 | if( pMsg->changeCCCallback ) |
| 8946 | { |
| 8947 | ((tSmeChangeCountryCallback)(pMsg->changeCCCallback))((void *)pMsg->pDevContext); |
| 8948 | } |
| 8949 | |
| 8950 | return eHAL_STATUS_SUCCESS; |
| 8951 | } |
| 8952 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 8953 | /* --------------------------------------------------------------------------- |
| 8954 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8955 | \fn sme_HandleChangeCountryCodeByUser |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 8956 | |
| 8957 | \brief Change Country code, Reg Domain and channel list |
| 8958 | |
| 8959 | If Supplicant country code is priority than 11d is disabled. |
| 8960 | If 11D is enabled, we update the country code after every scan. |
| 8961 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 8962 | Country code from Supplicant is set as current country code. |
| 8963 | |
| 8964 | \param pMac - The handle returned by macOpen. |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8965 | \param pMsg - Carrying new CC & domain set in kernel by user |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 8966 | |
| 8967 | \return eHalStatus |
| 8968 | |
| 8969 | -------------------------------------------------------------------------------*/ |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8970 | eHalStatus sme_HandleChangeCountryCodeByUser(tpAniSirGlobal pMac, |
| 8971 | tAniGenericChangeCountryCodeReq *pMsg) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 8972 | { |
| 8973 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 8974 | v_REGDOMAIN_t reg_domain_id; |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 8975 | v_BOOL_t is11dCountry = VOS_FALSE; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 8976 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8977 | smsLog(pMac, LOG1, FL(" called")); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 8978 | reg_domain_id = (v_REGDOMAIN_t)pMsg->domain_index; |
| 8979 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 8980 | if (memcmp(pMsg->countryCode, pMac->scan.countryCode11d, |
| 8981 | VOS_COUNTRY_CODE_LEN) == 0) |
| 8982 | { |
| 8983 | is11dCountry = VOS_TRUE; |
| 8984 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 8985 | |
Sachin Ahuja | 120bf63 | 2015-02-24 18:06:34 +0530 | [diff] [blame] | 8986 | smsLog( pMac, LOG1, FL("pMsg->countryCode : %c%c," |
| 8987 | "pMac->scan.countryCode11d : %c%c\n"), |
| 8988 | pMsg->countryCode[0], pMsg->countryCode[1], |
| 8989 | pMac->scan.countryCode11d[0], pMac->scan.countryCode11d[1]); |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 8990 | /* Set the country code given by userspace when 11dOriginal is FALSE |
| 8991 | * when 11doriginal is True,is11dCountry =0 and |
| 8992 | * fSupplicantCountryCodeHasPriority = 0, then revert the country code, |
| 8993 | * and return failure |
| 8994 | */ |
| 8995 | if (pMac->roam.configParam.Is11dSupportEnabledOriginal == true) |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 8996 | { |
Abhishek Singh | 2ec36ab | 2014-08-07 16:14:25 +0530 | [diff] [blame] | 8997 | if ((!is11dCountry) && (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority)&& |
| 8998 | (!pMac->roam.configParam.fEnforceCountryCode) ) |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 8999 | { |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 9000 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 9001 | smsLog( pMac, LOGW, FL(" incorrect country being set, nullify this request")); |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 9002 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 9003 | status = csrGetRegulatoryDomainForCountry(pMac, |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 9004 | pMac->scan.countryCode11d, |
| 9005 | (v_REGDOMAIN_t *) ®_domain_id, |
| 9006 | COUNTRY_IE); |
| 9007 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 9008 | return eHAL_STATUS_FAILURE; |
| 9009 | } |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 9010 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 9011 | /* if Supplicant country code has priority, disable 11d */ |
Sachin Ahuja | 120bf63 | 2015-02-24 18:06:34 +0530 | [diff] [blame] | 9012 | if ((!is11dCountry) && |
| 9013 | (pMac->roam.configParam.fSupplicantCountryCodeHasPriority) && |
| 9014 | (!pMac->roam.configParam.fEnforceCountryCode)) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 9015 | { |
| 9016 | pMac->roam.configParam.Is11dSupportEnabled = eANI_BOOLEAN_FALSE; |
Agarwal Ashish | cd9b8e6 | 2014-07-21 19:48:24 +0530 | [diff] [blame] | 9017 | smsLog( pMac, LOG1, FL(" 11d is being disabled")); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 9018 | } |
| 9019 | |
Sachin Ahuja | 120bf63 | 2015-02-24 18:06:34 +0530 | [diff] [blame] | 9020 | pMac->roam.configParam.fEnforceCountryCode = eANI_BOOLEAN_FALSE; |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 9021 | vos_mem_copy(pMac->scan.countryCodeCurrent, pMsg->countryCode, |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 9022 | WNI_CFG_COUNTRY_CODE_LEN); |
Sachin Ahuja | 120bf63 | 2015-02-24 18:06:34 +0530 | [diff] [blame] | 9023 | vos_mem_copy(pMac->scan.countryCode11d, pMsg->countryCode, |
| 9024 | WNI_CFG_COUNTRY_CODE_LEN); |
| 9025 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 9026 | |
Sachin Ahuja | cb64fc8 | 2015-01-12 17:01:05 +0530 | [diff] [blame] | 9027 | status = csrSetRegulatoryDomain(pMac, reg_domain_id, NULL); |
| 9028 | if (status != eHAL_STATUS_SUCCESS) |
| 9029 | { |
| 9030 | smsLog( pMac, LOGE, FL("fail to set regId.status : %d"), status); |
| 9031 | } |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 9032 | status = WDA_SetRegDomain(pMac, reg_domain_id, eSIR_TRUE); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 9033 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 9034 | if (VOS_FALSE == is11dCountry ) |
| 9035 | { |
| 9036 | /* overwrite the defualt country code */ |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 9037 | vos_mem_copy(pMac->scan.countryCodeDefault, |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 9038 | pMac->scan.countryCodeCurrent, WNI_CFG_COUNTRY_CODE_LEN); |
| 9039 | /* set to default domain ID */ |
| 9040 | pMac->scan.domainIdDefault = pMac->scan.domainIdCurrent; |
| 9041 | } |
| 9042 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 9043 | if ( status != eHAL_STATUS_SUCCESS ) |
| 9044 | { |
| 9045 | smsLog( pMac, LOGE, FL(" fail to set regId %d"), reg_domain_id ); |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 9046 | return status; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 9047 | } |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 9048 | else |
| 9049 | { |
| 9050 | //if 11d has priority, clear currentCountryBssid & countryCode11d to get |
| 9051 | //set again if we find AP with 11d info during scan |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 9052 | if((!pMac->roam.configParam.fSupplicantCountryCodeHasPriority) && |
| 9053 | (VOS_FALSE == is11dCountry )) |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 9054 | { |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 9055 | smsLog( pMac, LOGW, FL("Clearing currentCountryBssid, countryCode11d")); |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 9056 | vos_mem_zero(&pMac->scan.currentCountryBssid, sizeof(tCsrBssid)); |
| 9057 | vos_mem_zero( pMac->scan.countryCode11d, sizeof( pMac->scan.countryCode11d ) ); |
| 9058 | } |
| 9059 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 9060 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 9061 | /* get the channels based on new cc */ |
| 9062 | status = csrInitGetChannels(pMac); |
| 9063 | |
| 9064 | if ( status != eHAL_STATUS_SUCCESS ) |
| 9065 | { |
| 9066 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
| 9067 | return status; |
| 9068 | } |
| 9069 | |
| 9070 | /* reset info based on new cc, and we are done */ |
| 9071 | csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 9072 | if (VOS_TRUE == is11dCountry) |
| 9073 | { |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 9074 | pMac->scan.f11dInfoApplied = eANI_BOOLEAN_TRUE; |
| 9075 | pMac->scan.f11dInfoReset = eANI_BOOLEAN_FALSE; |
| 9076 | } |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 9077 | /* Country code Changed, Purge Only scan result |
| 9078 | * which does not have channel number belong to 11d |
| 9079 | * channel list |
| 9080 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 9081 | csrScanFilterResults(pMac); |
Kiet Lam | bd5cd9b | 2013-11-11 19:01:45 +0530 | [diff] [blame] | 9082 | // Do active scans after the country is set by User hints or Country IE |
| 9083 | pMac->scan.curScanType = eSIR_ACTIVE_SCAN; |
Sushant Kaushik | 1d73256 | 2014-05-21 14:15:37 +0530 | [diff] [blame] | 9084 | sme_DisconnectConnectedSessions(pMac); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 9085 | smsLog(pMac, LOG1, FL(" returned")); |
| 9086 | return eHAL_STATUS_SUCCESS; |
| 9087 | } |
| 9088 | |
| 9089 | /* --------------------------------------------------------------------------- |
| 9090 | |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 9091 | \fn sme_HandleChangeCountryCodeByCore |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 9092 | |
| 9093 | \brief Update Country code in the driver if set by kernel as world |
| 9094 | |
| 9095 | If 11D is enabled, we update the country code after every scan & notify kernel. |
| 9096 | This is to make sure kernel & driver are in sync in case of CC found in |
| 9097 | driver but not in kernel database |
| 9098 | |
| 9099 | \param pMac - The handle returned by macOpen. |
| 9100 | \param pMsg - Carrying new CC set in kernel |
| 9101 | |
| 9102 | \return eHalStatus |
| 9103 | |
| 9104 | -------------------------------------------------------------------------------*/ |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 9105 | eHalStatus sme_HandleChangeCountryCodeByCore(tpAniSirGlobal pMac, tAniGenericChangeCountryCodeReq *pMsg) |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 9106 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 9107 | eHalStatus status; |
| 9108 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 9109 | smsLog(pMac, LOG1, FL(" called")); |
| 9110 | |
| 9111 | //this is to make sure kernel & driver are in sync in case of CC found in |
| 9112 | //driver but not in kernel database |
| 9113 | if (('0' == pMsg->countryCode[0]) && ('0' == pMsg->countryCode[1])) |
| 9114 | { |
Tushnim Bhattacharyya | 582ac1d | 2013-11-07 23:44:09 -0800 | [diff] [blame] | 9115 | smsLog( pMac, LOGW, FL("Setting countryCode11d & countryCodeCurrent to world CC")); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 9116 | vos_mem_copy(pMac->scan.countryCode11d, pMsg->countryCode, |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 9117 | WNI_CFG_COUNTRY_CODE_LEN); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 9118 | vos_mem_copy(pMac->scan.countryCodeCurrent, pMsg->countryCode, |
Tushnim Bhattacharyya | 582ac1d | 2013-11-07 23:44:09 -0800 | [diff] [blame] | 9119 | WNI_CFG_COUNTRY_CODE_LEN); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 9120 | } |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 9121 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 9122 | status = WDA_SetRegDomain(pMac, REGDOMAIN_WORLD, eSIR_TRUE); |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 9123 | |
| 9124 | if ( status != eHAL_STATUS_SUCCESS ) |
| 9125 | { |
| 9126 | smsLog( pMac, LOGE, FL(" fail to set regId") ); |
| 9127 | return status; |
| 9128 | } |
| 9129 | else |
| 9130 | { |
Sachin Ahuja | cb64fc8 | 2015-01-12 17:01:05 +0530 | [diff] [blame] | 9131 | status = csrSetRegulatoryDomain(pMac, REGDOMAIN_WORLD, NULL); |
| 9132 | if (status != eHAL_STATUS_SUCCESS) |
| 9133 | { |
| 9134 | smsLog( pMac, LOGE, FL("fail to set regId.status : %d"), status); |
| 9135 | } |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 9136 | status = csrInitGetChannels(pMac); |
| 9137 | if ( status != eHAL_STATUS_SUCCESS ) |
| 9138 | { |
| 9139 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
| 9140 | } |
| 9141 | else |
| 9142 | { |
| 9143 | csrInitChannelList(pMac); |
| 9144 | } |
| 9145 | } |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 9146 | /* Country code Changed, Purge Only scan result |
| 9147 | * which does not have channel number belong to 11d |
| 9148 | * channel list |
| 9149 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 9150 | csrScanFilterResults(pMac); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 9151 | smsLog(pMac, LOG1, FL(" returned")); |
| 9152 | return eHAL_STATUS_SUCCESS; |
| 9153 | } |
| 9154 | |
| 9155 | /* --------------------------------------------------------------------------- |
| 9156 | |
Sushant Kaushik | 1d73256 | 2014-05-21 14:15:37 +0530 | [diff] [blame] | 9157 | \fn sme_DisconnectConnectedSessions |
| 9158 | |
| 9159 | \brief Disconnect STA and P2P client session if channel is not supported |
| 9160 | |
| 9161 | If new country code does not support the channel on which STA/P2P client |
| 9162 | is connetced, it sends the disconnect to the AP/P2P GO |
| 9163 | |
| 9164 | \param pMac - The handle returned by macOpen |
| 9165 | |
| 9166 | \return eHalStatus |
| 9167 | |
| 9168 | -------------------------------------------------------------------------------*/ |
| 9169 | |
| 9170 | void sme_DisconnectConnectedSessions(tpAniSirGlobal pMac) |
| 9171 | { |
| 9172 | v_U8_t i, sessionId, isChanFound = false; |
| 9173 | tANI_U8 currChannel; |
| 9174 | |
| 9175 | for (sessionId=0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++) |
| 9176 | { |
| 9177 | if (csrIsSessionClientAndConnected(pMac, sessionId)) |
| 9178 | { |
| 9179 | isChanFound = false; |
| 9180 | //Session is connected.Check the channel |
| 9181 | currChannel = csrGetInfraOperationChannel(pMac, sessionId); |
| 9182 | smsLog(pMac, LOGW, "Current Operating channel : %d, session :%d", |
| 9183 | currChannel, sessionId); |
| 9184 | for (i=0; i < pMac->scan.base20MHzChannels.numChannels; i++) |
| 9185 | { |
| 9186 | if (pMac->scan.base20MHzChannels.channelList[i] == currChannel) |
| 9187 | { |
| 9188 | isChanFound = true; |
| 9189 | break; |
| 9190 | } |
| 9191 | } |
| 9192 | |
| 9193 | if (!isChanFound) |
| 9194 | { |
| 9195 | for (i=0; i < pMac->scan.base40MHzChannels.numChannels; i++) |
| 9196 | { |
| 9197 | if (pMac->scan.base40MHzChannels.channelList[i] == currChannel) |
| 9198 | { |
| 9199 | isChanFound = true; |
| 9200 | break; |
| 9201 | } |
| 9202 | } |
| 9203 | } |
| 9204 | if (!isChanFound) |
| 9205 | { |
| 9206 | smsLog(pMac, LOGW, "%s : Disconnect Session :%d", __func__, sessionId); |
| 9207 | csrRoamDisconnect(pMac, sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); |
| 9208 | } |
| 9209 | } |
| 9210 | } |
| 9211 | } |
| 9212 | /* --------------------------------------------------------------------------- |
| 9213 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 9214 | \fn sme_HandleGenericChangeCountryCode |
| 9215 | |
| 9216 | \brief Change Country code, Reg Domain and channel list |
| 9217 | |
| 9218 | If Supplicant country code is priority than 11d is disabled. |
| 9219 | If 11D is enabled, we update the country code after every scan. |
| 9220 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 9221 | Country code from kernel is set as current country code. |
| 9222 | |
| 9223 | \param pMac - The handle returned by macOpen. |
| 9224 | \param pMsgBuf - message buffer |
| 9225 | |
| 9226 | \return eHalStatus |
| 9227 | |
| 9228 | -------------------------------------------------------------------------------*/ |
| 9229 | eHalStatus sme_HandleGenericChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf) |
| 9230 | { |
| 9231 | tAniGenericChangeCountryCodeReq *pMsg; |
| 9232 | v_REGDOMAIN_t reg_domain_id; |
| 9233 | |
| 9234 | smsLog(pMac, LOG1, FL(" called")); |
| 9235 | pMsg = (tAniGenericChangeCountryCodeReq *)pMsgBuf; |
| 9236 | reg_domain_id = (v_REGDOMAIN_t)pMsg->domain_index; |
| 9237 | |
| 9238 | if (REGDOMAIN_COUNT == reg_domain_id) |
| 9239 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 9240 | sme_HandleChangeCountryCodeByCore(pMac, pMsg); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 9241 | } |
| 9242 | else |
| 9243 | { |
| 9244 | sme_HandleChangeCountryCodeByUser(pMac, pMsg); |
| 9245 | } |
| 9246 | smsLog(pMac, LOG1, FL(" returned")); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 9247 | return eHAL_STATUS_SUCCESS; |
| 9248 | } |
| 9249 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9250 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 9251 | eHalStatus sme_8023MulticastList (tHalHandle hHal, tANI_U8 sessionId, tpSirRcvFltMcAddrList pMulticastAddrs) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9252 | { |
| 9253 | tpSirRcvFltMcAddrList pRequestBuf; |
| 9254 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9255 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9256 | tCsrRoamSession *pSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9257 | |
| 9258 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: " |
Gopichand Nakkala | 66c0bd0 | 2013-04-10 11:36:29 +0530 | [diff] [blame] | 9259 | "ulMulticastAddrCnt=%d, multicastAddr[0]=%p", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9260 | pMulticastAddrs->ulMulticastAddrCnt, |
| 9261 | pMulticastAddrs->multicastAddr[0]); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9262 | |
| 9263 | /* |
| 9264 | *Find the connected Infra / P2P_client connected session |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 9265 | */ |
| 9266 | if (CSR_IS_SESSION_VALID(pMac, sessionId) && |
| 9267 | csrIsConnStateInfra(pMac, sessionId)) |
| 9268 | { |
| 9269 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 9270 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9271 | |
| 9272 | if(pSession == NULL ) |
| 9273 | { |
Anurag Chouhan | 65ea6dc | 2016-10-25 19:59:14 +0530 | [diff] [blame] | 9274 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, "%s: Unable to find " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9275 | "the right session", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9276 | return eHAL_STATUS_FAILURE; |
| 9277 | } |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 9278 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9279 | pRequestBuf = vos_mem_malloc(sizeof(tSirRcvFltMcAddrList)); |
| 9280 | if (NULL == pRequestBuf) |
| 9281 | { |
| 9282 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9283 | "allocate memory for 8023 Multicast List request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9284 | return eHAL_STATUS_FAILED_ALLOC; |
| 9285 | } |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 9286 | |
| 9287 | if( !csrIsConnStateConnectedInfra (pMac, sessionId )) |
| 9288 | { |
| 9289 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Ignoring the " |
| 9290 | "indication as we are not connected", __func__); |
| 9291 | vos_mem_free(pRequestBuf); |
| 9292 | return eHAL_STATUS_FAILURE; |
| 9293 | } |
| 9294 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9295 | vos_mem_copy(pRequestBuf, pMulticastAddrs, sizeof(tSirRcvFltMcAddrList)); |
| 9296 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 9297 | vos_mem_copy(pRequestBuf->selfMacAddr, pSession->selfMacAddr, |
| 9298 | sizeof(tSirMacAddr)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9299 | vos_mem_copy(pRequestBuf->bssId, pSession->connectedProfile.bssid, |
| 9300 | sizeof(tSirMacAddr)); |
| 9301 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9302 | msg.type = WDA_8023_MULTICAST_LIST_REQ; |
| 9303 | msg.reserved = 0; |
| 9304 | msg.bodyptr = pRequestBuf; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 9305 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 9306 | TRACE_CODE_SME_TX_WDA_MSG, sessionId, msg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9307 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 9308 | { |
| 9309 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9310 | "post WDA_8023_MULTICAST_LIST message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9311 | vos_mem_free(pRequestBuf); |
| 9312 | return eHAL_STATUS_FAILURE; |
| 9313 | } |
| 9314 | |
| 9315 | return eHAL_STATUS_SUCCESS; |
| 9316 | } |
| 9317 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9318 | eHalStatus sme_ReceiveFilterSetFilter(tHalHandle hHal, tpSirRcvPktFilterCfgType pRcvPktFilterCfg, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9319 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9320 | { |
| 9321 | tpSirRcvPktFilterCfgType pRequestBuf; |
| 9322 | v_SINT_t allocSize; |
| 9323 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9324 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9325 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9326 | v_U8_t idx=0; |
| 9327 | |
| 9328 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: filterType=%d, " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9329 | "filterId = %d", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9330 | pRcvPktFilterCfg->filterType, pRcvPktFilterCfg->filterId); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9331 | |
Madan Mohan Koyyalamudi | d402962 | 2012-10-18 20:30:17 -0700 | [diff] [blame] | 9332 | allocSize = sizeof(tSirRcvPktFilterCfgType); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9333 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9334 | pRequestBuf = vos_mem_malloc(allocSize); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 9335 | |
| 9336 | if (NULL == pRequestBuf) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9337 | { |
| 9338 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9339 | "allocate memory for Receive Filter Set Filter request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9340 | return eHAL_STATUS_FAILED_ALLOC; |
| 9341 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9342 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 9343 | if( NULL == pSession ) |
| 9344 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9345 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Session Not found ", __func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 9346 | vos_mem_free(pRequestBuf); |
| 9347 | return eHAL_STATUS_FAILURE; |
| 9348 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 9349 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 9350 | vos_mem_copy(pRcvPktFilterCfg->selfMacAddr, pSession->selfMacAddr, |
| 9351 | sizeof(tSirMacAddr)); |
| 9352 | vos_mem_copy(pRcvPktFilterCfg->bssId, pSession->connectedProfile.bssid, |
| 9353 | sizeof(tSirMacAddr)); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 9354 | vos_mem_copy(pRequestBuf, pRcvPktFilterCfg, allocSize); |
| 9355 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9356 | msg.type = WDA_RECEIVE_FILTER_SET_FILTER_REQ; |
| 9357 | msg.reserved = 0; |
| 9358 | msg.bodyptr = pRequestBuf; |
| 9359 | |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 9360 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 9361 | TRACE_CODE_SME_TX_WDA_MSG, sessionId, msg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9362 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "Pkt Flt Req : " |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9363 | "FT %d FID %d ", |
| 9364 | pRequestBuf->filterType, pRequestBuf->filterId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9365 | |
| 9366 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "Pkt Flt Req : " |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9367 | "params %d CT %d", |
| 9368 | pRequestBuf->numFieldParams, pRequestBuf->coalesceTime); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9369 | |
| 9370 | for (idx=0; idx<pRequestBuf->numFieldParams; idx++) |
| 9371 | { |
| 9372 | |
| 9373 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 9374 | "Proto %d Comp Flag %d ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9375 | pRequestBuf->paramsData[idx].protocolLayer, |
| 9376 | pRequestBuf->paramsData[idx].cmpFlag); |
| 9377 | |
| 9378 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 9379 | "Data Offset %d Data Len %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9380 | pRequestBuf->paramsData[idx].dataOffset, |
| 9381 | pRequestBuf->paramsData[idx].dataLength); |
| 9382 | |
| 9383 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 9384 | "CData: %d:%d:%d:%d:%d:%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9385 | pRequestBuf->paramsData[idx].compareData[0], |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9386 | pRequestBuf->paramsData[idx].compareData[1], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9387 | pRequestBuf->paramsData[idx].compareData[2], |
| 9388 | pRequestBuf->paramsData[idx].compareData[3], |
| 9389 | pRequestBuf->paramsData[idx].compareData[4], |
| 9390 | pRequestBuf->paramsData[idx].compareData[5]); |
| 9391 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9392 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 9393 | "MData: %d:%d:%d:%d:%d:%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9394 | pRequestBuf->paramsData[idx].dataMask[0], |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9395 | pRequestBuf->paramsData[idx].dataMask[1], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9396 | pRequestBuf->paramsData[idx].dataMask[2], |
| 9397 | pRequestBuf->paramsData[idx].dataMask[3], |
| 9398 | pRequestBuf->paramsData[idx].dataMask[4], |
| 9399 | pRequestBuf->paramsData[idx].dataMask[5]); |
| 9400 | |
| 9401 | } |
| 9402 | |
| 9403 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 9404 | { |
| 9405 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to post " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9406 | "WDA_RECEIVE_FILTER_SET_FILTER message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9407 | vos_mem_free(pRequestBuf); |
| 9408 | return eHAL_STATUS_FAILURE; |
| 9409 | } |
| 9410 | |
| 9411 | return eHAL_STATUS_SUCCESS; |
| 9412 | } |
| 9413 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9414 | eHalStatus sme_GetFilterMatchCount(tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9415 | FilterMatchCountCallback callbackRoutine, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9416 | void *callbackContext, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 9417 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9418 | { |
| 9419 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9420 | eHalStatus status; |
| 9421 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9422 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "+%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9423 | |
| 9424 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme))) |
| 9425 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 9426 | pmcGetFilterMatchCount(hHal, callbackRoutine, callbackContext, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9427 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9428 | } |
| 9429 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9430 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "-%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9431 | |
| 9432 | return (status); |
| 9433 | } |
| 9434 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9435 | eHalStatus sme_ReceiveFilterClearFilter(tHalHandle hHal, tpSirRcvFltPktClearParam pRcvFltPktClearParam, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9436 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9437 | { |
| 9438 | tpSirRcvFltPktClearParam pRequestBuf; |
| 9439 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9440 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9441 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9442 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9443 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: filterId = %d", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9444 | pRcvFltPktClearParam->filterId); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9445 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9446 | pRequestBuf = vos_mem_malloc(sizeof(tSirRcvFltPktClearParam)); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 9447 | if (NULL == pRequestBuf) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9448 | { |
| 9449 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 9450 | "%s: Not able to allocate memory for Receive Filter " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9451 | "Clear Filter request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9452 | return eHAL_STATUS_FAILED_ALLOC; |
| 9453 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 9454 | if( NULL == pSession ) |
| 9455 | { |
| 9456 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9457 | "%s: Session Not find ", __func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 9458 | vos_mem_free(pRequestBuf); |
| 9459 | return eHAL_STATUS_FAILURE; |
| 9460 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9461 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 9462 | vos_mem_copy(pRcvFltPktClearParam->selfMacAddr, pSession->selfMacAddr, |
| 9463 | sizeof(tSirMacAddr)); |
| 9464 | vos_mem_copy(pRcvFltPktClearParam->bssId, pSession->connectedProfile.bssid, |
| 9465 | sizeof(tSirMacAddr)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9466 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 9467 | vos_mem_copy(pRequestBuf, pRcvFltPktClearParam, sizeof(tSirRcvFltPktClearParam)); |
| 9468 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9469 | msg.type = WDA_RECEIVE_FILTER_CLEAR_FILTER_REQ; |
| 9470 | msg.reserved = 0; |
| 9471 | msg.bodyptr = pRequestBuf; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 9472 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 9473 | TRACE_CODE_SME_TX_WDA_MSG, sessionId, msg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9474 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 9475 | { |
| 9476 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to post " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9477 | "WDA_RECEIVE_FILTER_CLEAR_FILTER message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9478 | vos_mem_free(pRequestBuf); |
| 9479 | return eHAL_STATUS_FAILURE; |
| 9480 | } |
| 9481 | |
| 9482 | return eHAL_STATUS_SUCCESS; |
| 9483 | } |
| 9484 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 9485 | |
| 9486 | /* --------------------------------------------------------------------------- |
| 9487 | \fn sme_PreChannelSwitchIndFullPowerCB |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9488 | \brief call back function for the PMC full power request because of pre |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9489 | channel switch. |
| 9490 | \param callbackContext |
| 9491 | \param status |
| 9492 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9493 | void sme_PreChannelSwitchIndFullPowerCB(void *callbackContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9494 | eHalStatus status) |
| 9495 | { |
| 9496 | tpAniSirGlobal pMac = (tpAniSirGlobal)callbackContext; |
| 9497 | tSirMbMsg *pMsg; |
| 9498 | tANI_U16 msgLen; |
| 9499 | |
| 9500 | msgLen = (tANI_U16)(sizeof( tSirMbMsg )); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 9501 | pMsg = vos_mem_malloc(msgLen); |
| 9502 | if ( NULL != pMsg ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9503 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 9504 | vos_mem_set(pMsg, msgLen, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9505 | pMsg->type = pal_cpu_to_be16((tANI_U16)eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER); |
| 9506 | pMsg->msgLen = pal_cpu_to_be16(msgLen); |
| 9507 | status = palSendMBMessage(pMac->hHdd, pMsg); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9508 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9509 | |
| 9510 | return; |
| 9511 | } |
| 9512 | |
| 9513 | /* --------------------------------------------------------------------------- |
| 9514 | \fn sme_HandlePreChannelSwitchInd |
| 9515 | \brief Processes the indcation from PE for pre-channel switch. |
| 9516 | \param hHal |
| 9517 | \- The handle returned by macOpen. return eHalStatus |
| 9518 | ---------------------------------------------------------------------------*/ |
| 9519 | eHalStatus sme_HandlePreChannelSwitchInd(tHalHandle hHal) |
| 9520 | { |
| 9521 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 9522 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9523 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9524 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9525 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9526 | status = pmcRequestFullPower(hHal, sme_PreChannelSwitchIndFullPowerCB, |
| 9527 | pMac, eSME_FULL_PWR_NEEDED_BY_CHANNEL_SWITCH); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9528 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9529 | } |
| 9530 | |
| 9531 | return (status); |
| 9532 | } |
| 9533 | |
| 9534 | /* --------------------------------------------------------------------------- |
| 9535 | \fn sme_HandlePostChannelSwitchInd |
| 9536 | \brief Processes the indcation from PE for post-channel switch. |
| 9537 | \param hHal |
| 9538 | \- The handle returned by macOpen. return eHalStatus |
| 9539 | ---------------------------------------------------------------------------*/ |
| 9540 | eHalStatus sme_HandlePostChannelSwitchInd(tHalHandle hHal) |
| 9541 | { |
| 9542 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 9543 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9544 | |
| 9545 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9546 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9547 | { |
| 9548 | status = pmcRequestBmps(hHal, NULL, NULL); |
| 9549 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9550 | } |
| 9551 | |
| 9552 | return (status); |
| 9553 | } |
| 9554 | |
| 9555 | /* --------------------------------------------------------------------------- |
| 9556 | |
| 9557 | \fn sme_IsChannelValid |
| 9558 | |
| 9559 | \brief To check if the channel is valid for currently established domain |
| 9560 | This is a synchronous API. |
| 9561 | |
| 9562 | \param hHal - The handle returned by macOpen. |
| 9563 | \param channel - channel to verify |
| 9564 | |
| 9565 | \return TRUE/FALSE, TRUE if channel is valid |
| 9566 | |
| 9567 | -------------------------------------------------------------------------------*/ |
| 9568 | tANI_BOOLEAN sme_IsChannelValid(tHalHandle hHal, tANI_U8 channel) |
| 9569 | { |
| 9570 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 9571 | tANI_BOOLEAN valid = FALSE; |
| 9572 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9573 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9574 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9575 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9576 | { |
| 9577 | |
| 9578 | valid = csrRoamIsChannelValid( pMac, channel); |
| 9579 | |
| 9580 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9581 | } |
| 9582 | |
| 9583 | return (valid); |
| 9584 | } |
| 9585 | |
| 9586 | /* --------------------------------------------------------------------------- |
| 9587 | \fn sme_SetFreqBand |
| 9588 | \brief Used to set frequency band. |
| 9589 | \param hHal |
| 9590 | \eBand band value to be configured |
| 9591 | \- return eHalStatus |
| 9592 | -------------------------------------------------------------------------*/ |
| 9593 | eHalStatus sme_SetFreqBand(tHalHandle hHal, eCsrBand eBand) |
| 9594 | { |
| 9595 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 9596 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9597 | |
| 9598 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9599 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9600 | { |
| 9601 | status = csrSetBand(hHal, eBand); |
| 9602 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9603 | } |
| 9604 | return status; |
| 9605 | } |
| 9606 | |
| 9607 | /* --------------------------------------------------------------------------- |
| 9608 | \fn sme_GetFreqBand |
| 9609 | \brief Used to get the current band settings. |
| 9610 | \param hHal |
| 9611 | \pBand pointer to hold band value |
| 9612 | \- return eHalStatus |
| 9613 | -------------------------------------------------------------------------*/ |
| 9614 | eHalStatus sme_GetFreqBand(tHalHandle hHal, eCsrBand *pBand) |
| 9615 | { |
| 9616 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 9617 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9618 | |
| 9619 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9620 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9621 | { |
| 9622 | *pBand = csrGetCurrentBand( hHal ); |
| 9623 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9624 | } |
| 9625 | return status; |
| 9626 | } |
| 9627 | |
| 9628 | #ifdef WLAN_WAKEUP_EVENTS |
| 9629 | /****************************************************************************** |
| 9630 | \fn sme_WakeReasonIndCallback |
| 9631 | |
| 9632 | \brief |
| 9633 | a callback function called when SME received eWNI_SME_WAKE_REASON_IND event from WDA |
| 9634 | |
| 9635 | \param hHal - HAL handle for device |
| 9636 | \param pMsg - Message body passed from WDA; includes Wake Reason Indication parameter |
| 9637 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9638 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9639 | ******************************************************************************/ |
| 9640 | eHalStatus sme_WakeReasonIndCallback (tHalHandle hHal, void* pMsg) |
| 9641 | { |
| 9642 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9643 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9644 | tSirWakeReasonInd *pWakeReasonInd = (tSirWakeReasonInd *)pMsg; |
| 9645 | |
| 9646 | if (NULL == pMsg) |
| 9647 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 9648 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9649 | status = eHAL_STATUS_FAILURE; |
| 9650 | } |
| 9651 | else |
| 9652 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 9653 | smsLog(pMac, LOG2, "SME: entering sme_WakeReasonIndCallback"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9654 | |
| 9655 | /* Call Wake Reason Indication callback routine. */ |
| 9656 | if (pMac->pmc.wakeReasonIndCB != NULL) |
| 9657 | pMac->pmc.wakeReasonIndCB(pMac->pmc.wakeReasonIndCBContext, pWakeReasonInd); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9658 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9659 | smsLog(pMac, LOG1, "Wake Reason Indication in %s(), reason=%d", __func__, pWakeReasonInd->ulReason); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9660 | } |
| 9661 | |
| 9662 | return(status); |
| 9663 | } |
| 9664 | #endif // WLAN_WAKEUP_EVENTS |
| 9665 | |
| 9666 | |
Abhishek Singh | 99a31be | 2015-12-10 10:37:44 +0530 | [diff] [blame] | 9667 | /** |
| 9668 | * sme_SetMaxTxPower() - Set the Maximum Transmit Power |
| 9669 | * |
| 9670 | * @hHal: hal pointer. |
| 9671 | * @bssid: bssid to set the power cap for |
| 9672 | * @self_mac_addr:self mac address |
| 9673 | * @db: power to set in dB |
| 9674 | * |
| 9675 | * Set the maximum transmit power dynamically. |
| 9676 | * |
| 9677 | * Return: eHalStatus |
| 9678 | * |
| 9679 | */ |
| 9680 | eHalStatus sme_SetMaxTxPower(tHalHandle hHal, tSirMacAddr bssid, |
| 9681 | tSirMacAddr self_mac_addr, v_S7_t db) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9682 | { |
Abhishek Singh | 99a31be | 2015-12-10 10:37:44 +0530 | [diff] [blame] | 9683 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9684 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9685 | tSmeCmd *set_max_tx_pwr; |
| 9686 | |
| 9687 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 9688 | TRACE_CODE_SME_RX_HDD_SET_MAXTXPOW, NO_SESSION, 0)); |
| 9689 | smsLog(pMac, LOG1, |
| 9690 | FL("bssid :" MAC_ADDRESS_STR " self addr: "MAC_ADDRESS_STR" power %d Db"), |
| 9691 | MAC_ADDR_ARRAY(bssid), MAC_ADDR_ARRAY(self_mac_addr), db); |
| 9692 | |
| 9693 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9694 | if ( HAL_STATUS_SUCCESS( status ) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9695 | { |
Abhishek Singh | 99a31be | 2015-12-10 10:37:44 +0530 | [diff] [blame] | 9696 | set_max_tx_pwr = csrGetCommandBuffer(pMac); |
| 9697 | if (set_max_tx_pwr) |
| 9698 | { |
| 9699 | set_max_tx_pwr->command = eSmeCommandSetMaxTxPower; |
| 9700 | vos_mem_copy(set_max_tx_pwr->u.set_tx_max_pwr.bssid, |
| 9701 | bssid, SIR_MAC_ADDR_LENGTH); |
| 9702 | vos_mem_copy(set_max_tx_pwr->u.set_tx_max_pwr.self_sta_mac_addr, |
| 9703 | self_mac_addr, SIR_MAC_ADDR_LENGTH); |
| 9704 | set_max_tx_pwr->u.set_tx_max_pwr.power = db; |
| 9705 | status = csrQueueSmeCommand(pMac, set_max_tx_pwr, eANI_BOOLEAN_TRUE); |
| 9706 | if ( !HAL_STATUS_SUCCESS( status ) ) |
| 9707 | { |
| 9708 | smsLog( pMac, LOGE, FL("fail to send msg status = %d"), status ); |
| 9709 | csrReleaseCommandScan(pMac, set_max_tx_pwr); |
| 9710 | } |
| 9711 | } |
| 9712 | else |
| 9713 | { |
| 9714 | smsLog(pMac, LOGE, FL("can not obtain a common buffer")); |
| 9715 | status = eHAL_STATUS_RESOURCES; |
| 9716 | } |
| 9717 | sme_ReleaseGlobalLock( &pMac->sme); |
| 9718 | } |
| 9719 | return (status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9720 | } |
| 9721 | |
Padma, Santhosh Kumar | 98b5d25 | 2016-10-17 17:30:41 +0530 | [diff] [blame] | 9722 | /** |
| 9723 | * sme_SetMaxTxPowerPerBand() - Set the Maximum Transmit Power |
| 9724 | * specific to band dynamically |
| 9725 | * @band: Band for which power needs to be applied |
| 9726 | * @dB: power to set in dB |
| 9727 | * @hal: HAL handle |
| 9728 | * |
| 9729 | * Set the maximum transmit power dynamically per band |
| 9730 | * |
| 9731 | * Return: eHalStatus |
| 9732 | */ |
| 9733 | eHalStatus sme_SetMaxTxPowerPerBand(eCsrBand band, v_S7_t dB, |
| 9734 | tHalHandle hal) |
Arif Hussain | a5ebce0 | 2013-08-09 15:09:58 -0700 | [diff] [blame] | 9735 | { |
| 9736 | vos_msg_t msg; |
Padma, Santhosh Kumar | 98b5d25 | 2016-10-17 17:30:41 +0530 | [diff] [blame] | 9737 | eHalStatus status; |
| 9738 | tSmeCmd *set_max_tx_pwr_per_band; |
| 9739 | tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); |
Arif Hussain | a5ebce0 | 2013-08-09 15:09:58 -0700 | [diff] [blame] | 9740 | |
Padma, Santhosh Kumar | 98b5d25 | 2016-10-17 17:30:41 +0530 | [diff] [blame] | 9741 | smsLog(mac_ctx, LOG1, |
| 9742 | FL("band : %d power %d dB"), |
| 9743 | band, dB); |
| 9744 | |
| 9745 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 9746 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); |
| 9747 | |
| 9748 | status = sme_AcquireGlobalLock(&mac_ctx->sme); |
| 9749 | if (HAL_STATUS_SUCCESS(status)) { |
| 9750 | set_max_tx_pwr_per_band = csrGetCommandBuffer(mac_ctx); |
| 9751 | if (set_max_tx_pwr_per_band) { |
| 9752 | set_max_tx_pwr_per_band->command = eSmeCommandSetMaxTxPowerPerBand; |
| 9753 | set_max_tx_pwr_per_band->u.set_tx_max_pwr_per_band.band = band; |
| 9754 | set_max_tx_pwr_per_band->u.set_tx_max_pwr_per_band.power = dB; |
| 9755 | status = csrQueueSmeCommand(mac_ctx, set_max_tx_pwr_per_band, |
| 9756 | eANI_BOOLEAN_TRUE); |
| 9757 | if (!HAL_STATUS_SUCCESS(status)) { |
| 9758 | smsLog(mac_ctx, LOGE, FL("fail to send msg status = %d"), status); |
| 9759 | csrReleaseCommand(mac_ctx, set_max_tx_pwr_per_band); |
| 9760 | } |
| 9761 | } else { |
| 9762 | smsLog(mac_ctx, LOGE, FL("can not obtain a common buffer")); |
| 9763 | status = eHAL_STATUS_RESOURCES; |
| 9764 | } |
| 9765 | sme_ReleaseGlobalLock(&mac_ctx->sme); |
Arif Hussain | a5ebce0 | 2013-08-09 15:09:58 -0700 | [diff] [blame] | 9766 | } |
Padma, Santhosh Kumar | 98b5d25 | 2016-10-17 17:30:41 +0530 | [diff] [blame] | 9767 | return status; |
Arif Hussain | a5ebce0 | 2013-08-09 15:09:58 -0700 | [diff] [blame] | 9768 | } |
| 9769 | |
| 9770 | /* --------------------------------------------------------------------------- |
| 9771 | |
schang | 86c22c4 | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 9772 | \fn sme_SetTxPower |
| 9773 | |
| 9774 | \brief Set Transmit Power dynamically. Note: this setting will |
| 9775 | not persist over reboots. |
| 9776 | |
| 9777 | \param hHal |
| 9778 | \param sessionId Target Session ID |
| 9779 | \param mW power to set in mW |
| 9780 | \- return eHalStatus |
| 9781 | |
| 9782 | -------------------------------------------------------------------------------*/ |
| 9783 | eHalStatus sme_SetTxPower(tHalHandle hHal, v_U8_t sessionId, v_U8_t mW) |
| 9784 | { |
| 9785 | |
| 9786 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 9787 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9788 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 9789 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 9790 | TRACE_CODE_SME_RX_HDD_SET_TXPOW, NO_SESSION, 0)); |
schang | 86c22c4 | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 9791 | smsLog(pMac, LOG1, FL("set tx power %dmW"), mW); |
| 9792 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 9793 | if (HAL_STATUS_SUCCESS(status)) |
| 9794 | { |
| 9795 | status = csrSetTxPower(pMac, sessionId, mW); |
| 9796 | sme_ReleaseGlobalLock(&pMac->sme); |
| 9797 | } |
| 9798 | return status; |
| 9799 | } |
| 9800 | |
| 9801 | /* --------------------------------------------------------------------------- |
| 9802 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9803 | \fn sme_HideSSID |
| 9804 | |
| 9805 | \brief hide/show SSID dynamically. Note: this setting will |
| 9806 | not persist over reboots. |
| 9807 | |
| 9808 | \param hHal |
| 9809 | \param sessionId |
| 9810 | \param ssidHidden 0 - Broadcast SSID, 1 - Disable broadcast SSID |
| 9811 | \- return eHalStatus |
| 9812 | |
| 9813 | -------------------------------------------------------------------------------*/ |
| 9814 | eHalStatus sme_HideSSID(tHalHandle hHal, v_U8_t sessionId, v_U8_t ssidHidden) |
| 9815 | { |
| 9816 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9817 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9818 | tANI_U16 len; |
| 9819 | |
| 9820 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 9821 | { |
| 9822 | tpSirUpdateParams pMsg; |
| 9823 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 9824 | |
| 9825 | if(!pSession) |
| 9826 | { |
| 9827 | smsLog(pMac, LOGE, FL(" session %d not found "), sessionId); |
Leela Venkata Kiran Kumar Reddy Chirala | 090cc1f | 2013-03-07 17:40:17 -0800 | [diff] [blame] | 9828 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 9829 | return eHAL_STATUS_FAILURE; |
| 9830 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9831 | |
| 9832 | if( !pSession->sessionActive ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9833 | VOS_ASSERT(0); |
| 9834 | |
| 9835 | /* Create the message and send to lim */ |
| 9836 | len = sizeof(tSirUpdateParams); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 9837 | pMsg = vos_mem_malloc(len); |
| 9838 | if ( NULL == pMsg ) |
| 9839 | status = eHAL_STATUS_FAILURE; |
| 9840 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9841 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 9842 | vos_mem_set(pMsg, sizeof(tSirUpdateParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9843 | pMsg->messageType = eWNI_SME_HIDE_SSID_REQ; |
| 9844 | pMsg->length = len; |
| 9845 | /* Data starts from here */ |
| 9846 | pMsg->sessionId = sessionId; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9847 | pMsg->ssidHidden = ssidHidden; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9848 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 9849 | } |
| 9850 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9851 | } |
| 9852 | return status; |
| 9853 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9854 | |
| 9855 | /* --------------------------------------------------------------------------- |
| 9856 | |
| 9857 | \fn sme_SetTmLevel |
| 9858 | \brief Set Thermal Mitigation Level to RIVA |
| 9859 | \param hHal - The handle returned by macOpen. |
| 9860 | \param newTMLevel - new Thermal Mitigation Level |
| 9861 | \param tmMode - Thermal Mitigation handle mode, default 0 |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9862 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9863 | ---------------------------------------------------------------------------*/ |
| 9864 | eHalStatus sme_SetTmLevel(tHalHandle hHal, v_U16_t newTMLevel, v_U16_t tmMode) |
| 9865 | { |
| 9866 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9867 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 9868 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9869 | vos_msg_t vosMessage; |
| 9870 | tAniSetTmLevelReq *setTmLevelReq = NULL; |
| 9871 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 9872 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 9873 | TRACE_CODE_SME_RX_HDD_SET_TMLEVEL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9874 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 9875 | { |
| 9876 | setTmLevelReq = (tAniSetTmLevelReq *)vos_mem_malloc(sizeof(tAniSetTmLevelReq)); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 9877 | if (NULL == setTmLevelReq) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9878 | { |
| 9879 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9880 | "%s: Not able to allocate memory for sme_SetTmLevel", __func__); |
Leela Venkata Kiran Kumar Reddy Chirala | 090cc1f | 2013-03-07 17:40:17 -0800 | [diff] [blame] | 9881 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9882 | return eHAL_STATUS_FAILURE; |
| 9883 | } |
| 9884 | |
| 9885 | setTmLevelReq->tmMode = tmMode; |
| 9886 | setTmLevelReq->newTmLevel = newTMLevel; |
| 9887 | |
| 9888 | /* serialize the req through MC thread */ |
| 9889 | vosMessage.bodyptr = setTmLevelReq; |
| 9890 | vosMessage.type = WDA_SET_TM_LEVEL_REQ; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 9891 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 9892 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9893 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 9894 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 9895 | { |
| 9896 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9897 | "%s: Post Set TM Level MSG fail", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9898 | vos_mem_free(setTmLevelReq); |
| 9899 | status = eHAL_STATUS_FAILURE; |
| 9900 | } |
| 9901 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9902 | } |
| 9903 | return(status); |
| 9904 | } |
| 9905 | |
| 9906 | /*--------------------------------------------------------------------------- |
| 9907 | |
| 9908 | \brief sme_featureCapsExchange() - SME interface to exchange capabilities between |
| 9909 | Host and FW. |
| 9910 | |
| 9911 | \param hHal - HAL handle for device |
| 9912 | |
| 9913 | \return NONE |
| 9914 | |
| 9915 | ---------------------------------------------------------------------------*/ |
| 9916 | void sme_featureCapsExchange( tHalHandle hHal) |
| 9917 | { |
| 9918 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 9919 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 9920 | TRACE_CODE_SME_RX_HDD_CAPS_EXCH, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9921 | WDA_featureCapsExchange(vosContext); |
| 9922 | } |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 9923 | |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 9924 | /*--------------------------------------------------------------------------- |
| 9925 | |
| 9926 | \brief sme_disableFeatureCapablity() - SME interface to disable Active mode offload capablity |
| 9927 | in Host. |
| 9928 | |
| 9929 | \param hHal - HAL handle for device |
| 9930 | |
| 9931 | \return NONE |
| 9932 | |
| 9933 | ---------------------------------------------------------------------------*/ |
| 9934 | void sme_disableFeatureCapablity(tANI_U8 feature_index) |
| 9935 | { |
| 9936 | WDA_disableCapablityFeature(feature_index); |
| 9937 | } |
| 9938 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 9939 | /* --------------------------------------------------------------------------- |
| 9940 | |
| 9941 | \fn sme_GetDefaultCountryCode |
| 9942 | |
| 9943 | \brief Get the default country code from NV |
| 9944 | |
| 9945 | \param hHal |
| 9946 | \param pCountry |
| 9947 | \- return eHalStatus |
| 9948 | |
| 9949 | -------------------------------------------------------------------------------*/ |
| 9950 | eHalStatus sme_GetDefaultCountryCodeFrmNv(tHalHandle hHal, tANI_U8 *pCountry) |
| 9951 | { |
| 9952 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 9953 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 9954 | TRACE_CODE_SME_RX_HDD_GET_DEFCCNV, NO_SESSION, 0)); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 9955 | return csrGetDefaultCountryCodeFrmNv(pMac, pCountry); |
| 9956 | } |
| 9957 | |
| 9958 | /* --------------------------------------------------------------------------- |
| 9959 | |
| 9960 | \fn sme_GetCurrentCountryCode |
| 9961 | |
| 9962 | \brief Get the current country code |
| 9963 | |
| 9964 | \param hHal |
| 9965 | \param pCountry |
| 9966 | \- return eHalStatus |
| 9967 | |
| 9968 | -------------------------------------------------------------------------------*/ |
| 9969 | eHalStatus sme_GetCurrentCountryCode(tHalHandle hHal, tANI_U8 *pCountry) |
| 9970 | { |
| 9971 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 9972 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 9973 | TRACE_CODE_SME_RX_HDD_GET_CURCC, NO_SESSION, 0)); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 9974 | return csrGetCurrentCountryCode(pMac, pCountry); |
| 9975 | } |
| 9976 | |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 9977 | /* --------------------------------------------------------------------------- |
| 9978 | \fn sme_transportDebug |
| 9979 | \brief Dynamically monitoring Transport channels |
| 9980 | Private IOCTL will querry transport channel status if driver loaded |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 9981 | \param hHal Upper MAC context |
Jeff Johnson | b88db98 | 2012-12-10 13:34:59 -0800 | [diff] [blame] | 9982 | \param displaySnapshot Display transport channel snapshot option |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 9983 | \param toggleStallDetect Enable stall detect feature |
| 9984 | This feature will take effect to data performance |
| 9985 | Not integrate till fully verification |
| 9986 | \- return NONE |
| 9987 | -------------------------------------------------------------------------*/ |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 9988 | void sme_transportDebug(tHalHandle hHal, v_BOOL_t displaySnapshot, v_BOOL_t toggleStallDetect) |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 9989 | { |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 9990 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9991 | |
| 9992 | if (NULL == pMac) |
| 9993 | { |
| 9994 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 9995 | "%s: invalid context", __func__); |
| 9996 | return; |
| 9997 | } |
| 9998 | WDA_TransportChannelDebug(pMac, displaySnapshot, toggleStallDetect); |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 9999 | } |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 10000 | |
Kiran | 4a17ebe | 2013-01-31 10:43:43 -0800 | [diff] [blame] | 10001 | /* --------------------------------------------------------------------------- |
| 10002 | \fn sme_ResetPowerValuesFor5G |
| 10003 | \brief Reset the power values for 5G band with NV power values. |
| 10004 | \param hHal - HAL handle for device |
| 10005 | \- return NONE |
| 10006 | -------------------------------------------------------------------------*/ |
| 10007 | void sme_ResetPowerValuesFor5G (tHalHandle hHal) |
| 10008 | { |
| 10009 | tpAniSirGlobal pMac = PMAC_STRUCT (hHal); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 10010 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 10011 | TRACE_CODE_SME_RX_HDD_RESET_PW5G, NO_SESSION, 0)); |
Kiran | 4a17ebe | 2013-01-31 10:43:43 -0800 | [diff] [blame] | 10012 | csrSaveChannelPowerForBand(pMac, eANI_BOOLEAN_TRUE); |
| 10013 | csrApplyPower2Current(pMac); // Store the channel+power info in the global place: Cfg |
| 10014 | } |
| 10015 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10016 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 10017 | /* --------------------------------------------------------------------------- |
| 10018 | \fn sme_UpdateRoamPrefer5GHz |
| 10019 | \brief enable/disable Roam prefer 5G runtime option |
| 10020 | This function is called through dynamic setConfig callback function |
| 10021 | to configure the Roam prefer 5G runtime option |
| 10022 | \param hHal - HAL handle for device |
| 10023 | \param nRoamPrefer5GHz Enable/Disable Roam prefer 5G runtime option |
| 10024 | \- return Success or failure |
| 10025 | -------------------------------------------------------------------------*/ |
| 10026 | |
| 10027 | eHalStatus sme_UpdateRoamPrefer5GHz(tHalHandle hHal, v_BOOL_t nRoamPrefer5GHz) |
| 10028 | { |
| 10029 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10030 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10031 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 10032 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 10033 | TRACE_CODE_SME_RX_HDD_UPDATE_RP5G, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10034 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10035 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10036 | { |
| 10037 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10038 | "%s: gRoamPrefer5GHz is changed from %d to %d", __func__, |
| 10039 | pMac->roam.configParam.nRoamPrefer5GHz, |
| 10040 | nRoamPrefer5GHz); |
| 10041 | pMac->roam.configParam.nRoamPrefer5GHz = nRoamPrefer5GHz; |
| 10042 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10043 | } |
| 10044 | |
| 10045 | return status ; |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 10046 | } |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 10047 | |
| 10048 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10049 | \fn sme_setRoamIntraBand |
| 10050 | \brief enable/disable Intra band roaming |
| 10051 | This function is called through dynamic setConfig callback function |
| 10052 | to configure the intra band roaming |
| 10053 | \param hHal - HAL handle for device |
| 10054 | \param nRoamIntraBand Enable/Disable Intra band roaming |
| 10055 | \- return Success or failure |
| 10056 | -------------------------------------------------------------------------*/ |
| 10057 | eHalStatus sme_setRoamIntraBand(tHalHandle hHal, const v_BOOL_t nRoamIntraBand) |
| 10058 | { |
| 10059 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10060 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10061 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 10062 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 10063 | TRACE_CODE_SME_RX_HDD_SET_ROAMIBAND, NO_SESSION, 0)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10064 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10065 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10066 | { |
| 10067 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10068 | "%s: gRoamIntraBand is changed from %d to %d", __func__, |
| 10069 | pMac->roam.configParam.nRoamIntraBand, |
| 10070 | nRoamIntraBand); |
| 10071 | pMac->roam.configParam.nRoamIntraBand = nRoamIntraBand; |
| 10072 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10073 | } |
| 10074 | |
| 10075 | return status ; |
| 10076 | } |
| 10077 | |
| 10078 | /* --------------------------------------------------------------------------- |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 10079 | \fn sme_UpdateRoamScanNProbes |
| 10080 | \brief function to update roam scan N probes |
| 10081 | This function is called through dynamic setConfig callback function |
| 10082 | to update roam scan N probes |
| 10083 | \param hHal - HAL handle for device |
| 10084 | \param nProbes number of probe requests to be sent out |
| 10085 | \- return Success or failure |
| 10086 | -------------------------------------------------------------------------*/ |
| 10087 | eHalStatus sme_UpdateRoamScanNProbes(tHalHandle hHal, const v_U8_t nProbes) |
| 10088 | { |
| 10089 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10090 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10091 | |
| 10092 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10093 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10094 | { |
| 10095 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10096 | "%s: gRoamScanNProbes is changed from %d to %d", __func__, |
| 10097 | pMac->roam.configParam.nProbes, |
| 10098 | nProbes); |
| 10099 | pMac->roam.configParam.nProbes = nProbes; |
| 10100 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10101 | } |
| 10102 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 10103 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 10104 | { |
| 10105 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 10106 | REASON_NPROBES_CHANGED); |
| 10107 | } |
| 10108 | #endif |
| 10109 | return status ; |
| 10110 | } |
| 10111 | |
| 10112 | /* --------------------------------------------------------------------------- |
| 10113 | \fn sme_UpdateRoamScanHomeAwayTime |
| 10114 | \brief function to update roam scan Home away time |
| 10115 | This function is called through dynamic setConfig callback function |
| 10116 | to update roam scan home away time |
| 10117 | \param hHal - HAL handle for device |
| 10118 | \param nRoamScanAwayTime Scan home away time |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 10119 | \param bSendOffloadCmd If TRUE then send offload command to firmware |
| 10120 | If FALSE then command is not sent to firmware |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 10121 | \- return Success or failure |
| 10122 | -------------------------------------------------------------------------*/ |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 10123 | eHalStatus sme_UpdateRoamScanHomeAwayTime(tHalHandle hHal, const v_U16_t nRoamScanHomeAwayTime, |
| 10124 | const eAniBoolean bSendOffloadCmd) |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 10125 | { |
| 10126 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10127 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10128 | |
| 10129 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10130 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10131 | { |
| 10132 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10133 | "%s: gRoamScanHomeAwayTime is changed from %d to %d", __func__, |
| 10134 | pMac->roam.configParam.nRoamScanHomeAwayTime, |
| 10135 | nRoamScanHomeAwayTime); |
| 10136 | pMac->roam.configParam.nRoamScanHomeAwayTime = nRoamScanHomeAwayTime; |
| 10137 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10138 | } |
| 10139 | |
| 10140 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 10141 | if (pMac->roam.configParam.isRoamOffloadScanEnabled && bSendOffloadCmd) |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 10142 | { |
| 10143 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 10144 | REASON_HOME_AWAY_TIME_CHANGED); |
| 10145 | } |
| 10146 | #endif |
| 10147 | return status; |
| 10148 | } |
| 10149 | |
| 10150 | |
| 10151 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10152 | \fn sme_getRoamIntraBand |
| 10153 | \brief get Intra band roaming |
| 10154 | \param hHal - HAL handle for device |
| 10155 | \- return Success or failure |
| 10156 | -------------------------------------------------------------------------*/ |
| 10157 | v_BOOL_t sme_getRoamIntraBand(tHalHandle hHal) |
| 10158 | { |
| 10159 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 10160 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 10161 | TRACE_CODE_SME_RX_HDD_GET_ROAMIBAND, NO_SESSION, 0)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10162 | return pMac->roam.configParam.nRoamIntraBand; |
| 10163 | } |
| 10164 | |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 10165 | /* --------------------------------------------------------------------------- |
| 10166 | \fn sme_getRoamScanNProbes |
| 10167 | \brief get N Probes |
| 10168 | \param hHal - HAL handle for device |
| 10169 | \- return Success or failure |
| 10170 | -------------------------------------------------------------------------*/ |
| 10171 | v_U8_t sme_getRoamScanNProbes(tHalHandle hHal) |
| 10172 | { |
| 10173 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10174 | return pMac->roam.configParam.nProbes; |
| 10175 | } |
| 10176 | |
| 10177 | /* --------------------------------------------------------------------------- |
| 10178 | \fn sme_getRoamScanHomeAwayTime |
| 10179 | \brief get Roam scan home away time |
| 10180 | \param hHal - HAL handle for device |
| 10181 | \- return Success or failure |
| 10182 | -------------------------------------------------------------------------*/ |
| 10183 | v_U16_t sme_getRoamScanHomeAwayTime(tHalHandle hHal) |
| 10184 | { |
| 10185 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10186 | return pMac->roam.configParam.nRoamScanHomeAwayTime; |
| 10187 | } |
| 10188 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10189 | |
| 10190 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 10191 | \fn sme_UpdateImmediateRoamRssiDiff |
| 10192 | \brief Update nImmediateRoamRssiDiff |
| 10193 | This function is called through dynamic setConfig callback function |
| 10194 | to configure nImmediateRoamRssiDiff |
| 10195 | Usage: adb shell iwpriv wlan0 setConfig gImmediateRoamRssiDiff=[0 .. 125] |
| 10196 | \param hHal - HAL handle for device |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10197 | \param nImmediateRoamRssiDiff - minimum rssi difference between potential |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 10198 | candidate and current AP. |
| 10199 | \- return Success or failure |
| 10200 | -------------------------------------------------------------------------*/ |
| 10201 | |
| 10202 | eHalStatus sme_UpdateImmediateRoamRssiDiff(tHalHandle hHal, v_U8_t nImmediateRoamRssiDiff) |
| 10203 | { |
| 10204 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10205 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10206 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 10207 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 10208 | TRACE_CODE_SME_RX_HDD_UPDATE_IMMRSSIDIFF, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10209 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10210 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10211 | { |
| 10212 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10213 | "LFR runtime successfully set immediate roam rssi diff to" |
| 10214 | "%d - old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10215 | nImmediateRoamRssiDiff, |
| 10216 | pMac->roam.configParam.nImmediateRoamRssiDiff, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10217 | macTraceGetNeighbourRoamState( |
| 10218 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10219 | pMac->roam.configParam.nImmediateRoamRssiDiff = nImmediateRoamRssiDiff; |
| 10220 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10221 | } |
| 10222 | |
| 10223 | return status ; |
| 10224 | } |
| 10225 | |
| 10226 | /* --------------------------------------------------------------------------- |
| 10227 | \fn sme_UpdateRoamRssiDiff |
| 10228 | \brief Update RoamRssiDiff |
| 10229 | This function is called through dynamic setConfig callback function |
| 10230 | to configure RoamRssiDiff |
| 10231 | Usage: adb shell iwpriv wlan0 setConfig RoamRssiDiff=[0 .. 125] |
| 10232 | \param hHal - HAL handle for device |
| 10233 | \param RoamRssiDiff - minimum rssi difference between potential |
| 10234 | candidate and current AP. |
| 10235 | \- return Success or failure |
| 10236 | -------------------------------------------------------------------------*/ |
| 10237 | |
| 10238 | eHalStatus sme_UpdateRoamRssiDiff(tHalHandle hHal, v_U8_t RoamRssiDiff) |
| 10239 | { |
| 10240 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10241 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10242 | |
| 10243 | status = sme_AcquireGlobalLock( &pMac->sme ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 10244 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 10245 | TRACE_CODE_SME_RX_HDD_UPDATE_RSSIDIFF, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10246 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10247 | { |
| 10248 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10249 | "LFR runtime successfully set roam rssi diff to %d" |
| 10250 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10251 | RoamRssiDiff, |
| 10252 | pMac->roam.configParam.RoamRssiDiff, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10253 | macTraceGetNeighbourRoamState( |
| 10254 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10255 | pMac->roam.configParam.RoamRssiDiff = RoamRssiDiff; |
| 10256 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10257 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 10258 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 10259 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 10260 | { |
| 10261 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_RSSI_DIFF_CHANGED); |
| 10262 | } |
| 10263 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10264 | return status ; |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 10265 | } |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10266 | |
| 10267 | /*-------------------------------------------------------------------------- |
| 10268 | \brief sme_UpdateFastTransitionEnabled() - enable/disable Fast Transition support at runtime |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10269 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10270 | isFastTransitionEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10271 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10272 | \param hHal - The handle returned by macOpen. |
| 10273 | \return eHAL_STATUS_SUCCESS - SME update isFastTransitionEnabled config successfully. |
| 10274 | Other status means SME is failed to update isFastTransitionEnabled. |
| 10275 | \sa |
| 10276 | --------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10277 | eHalStatus sme_UpdateFastTransitionEnabled(tHalHandle hHal, |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10278 | v_BOOL_t isFastTransitionEnabled) |
| 10279 | { |
| 10280 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10281 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10282 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 10283 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 10284 | TRACE_CODE_SME_RX_HDD_UPDATE_FTENABLED, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10285 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10286 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10287 | { |
| 10288 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10289 | "%s: FastTransitionEnabled is changed from %d to %d", __func__, |
| 10290 | pMac->roam.configParam.isFastTransitionEnabled, |
| 10291 | isFastTransitionEnabled); |
| 10292 | pMac->roam.configParam.isFastTransitionEnabled = isFastTransitionEnabled; |
| 10293 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10294 | } |
| 10295 | |
| 10296 | return status ; |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10297 | } |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 10298 | |
| 10299 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 10300 | \fn sme_UpdateWESMode |
| 10301 | \brief Update WES Mode |
| 10302 | This function is called through dynamic setConfig callback function |
| 10303 | to configure isWESModeEnabled |
| 10304 | \param hHal - HAL handle for device |
| 10305 | \return eHAL_STATUS_SUCCESS - SME update isWESModeEnabled config successfully. |
| 10306 | Other status means SME is failed to update isWESModeEnabled. |
| 10307 | -------------------------------------------------------------------------*/ |
| 10308 | |
| 10309 | eHalStatus sme_UpdateWESMode(tHalHandle hHal, v_BOOL_t isWESModeEnabled) |
| 10310 | { |
| 10311 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10312 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10313 | |
| 10314 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10315 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10316 | { |
| 10317 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10318 | "LFR runtime successfully set WES Mode to %d" |
| 10319 | "- old value is %d - roam state is %s", |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 10320 | isWESModeEnabled, |
| 10321 | pMac->roam.configParam.isWESModeEnabled, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10322 | macTraceGetNeighbourRoamState( |
| 10323 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 10324 | pMac->roam.configParam.isWESModeEnabled = isWESModeEnabled; |
| 10325 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10326 | } |
| 10327 | |
| 10328 | return status ; |
| 10329 | } |
| 10330 | |
| 10331 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 10332 | \fn sme_SetRoamScanControl |
| 10333 | \brief Set roam scan control |
| 10334 | This function is called to set roam scan control |
| 10335 | if roam scan control is set to 0, roaming scan cache is cleared |
| 10336 | any value other than 0 is treated as invalid value |
| 10337 | \param hHal - HAL handle for device |
| 10338 | \return eHAL_STATUS_SUCCESS - SME update config successfully. |
| 10339 | Other status means SME failure to update |
| 10340 | -------------------------------------------------------------------------*/ |
| 10341 | eHalStatus sme_SetRoamScanControl(tHalHandle hHal, v_BOOL_t roamScanControl) |
| 10342 | { |
| 10343 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10344 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10345 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 10346 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 10347 | TRACE_CODE_SME_RX_HDD_SET_SCANCTRL, NO_SESSION, 0)); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 10348 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10349 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10350 | { |
| 10351 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10352 | "LFR runtime successfully set roam scan control to %d" |
| 10353 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 10354 | roamScanControl, |
| 10355 | pMac->roam.configParam.nRoamScanControl, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10356 | macTraceGetNeighbourRoamState( |
| 10357 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 10358 | pMac->roam.configParam.nRoamScanControl = roamScanControl; |
| 10359 | if ( 0 == roamScanControl) |
| 10360 | { |
| 10361 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 10362 | "LFR runtime successfully cleared roam scan cache"); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 10363 | csrFlushCfgBgScanRoamChannelList(pMac); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 10364 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 10365 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 10366 | { |
| 10367 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_FLUSH_CHANNEL_LIST); |
| 10368 | } |
| 10369 | #endif |
| 10370 | } |
| 10371 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10372 | } |
| 10373 | return status ; |
| 10374 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10375 | #endif /* (WLAN_FEATURE_VOWIFI_11R) || (FEATURE_WLAN_ESE) || (FEATURE_WLAN_LFR) */ |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10376 | |
| 10377 | #ifdef FEATURE_WLAN_LFR |
| 10378 | /*-------------------------------------------------------------------------- |
| 10379 | \brief sme_UpdateIsFastRoamIniFeatureEnabled() - enable/disable LFR support at runtime |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10380 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10381 | isFastRoamIniFeatureEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10382 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10383 | \param hHal - The handle returned by macOpen. |
| 10384 | \return eHAL_STATUS_SUCCESS - SME update isFastRoamIniFeatureEnabled config successfully. |
| 10385 | Other status means SME is failed to update isFastRoamIniFeatureEnabled. |
| 10386 | \sa |
| 10387 | --------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10388 | eHalStatus sme_UpdateIsFastRoamIniFeatureEnabled(tHalHandle hHal, |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10389 | const v_BOOL_t isFastRoamIniFeatureEnabled) |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10390 | { |
| 10391 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10392 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10393 | if (pMac->roam.configParam.isFastRoamIniFeatureEnabled == isFastRoamIniFeatureEnabled) |
| 10394 | { |
| 10395 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10396 | "%s: FastRoam is already enabled or disabled, nothing to do (returning) old(%d) new(%d)", __func__, |
| 10397 | pMac->roam.configParam.isFastRoamIniFeatureEnabled, |
| 10398 | isFastRoamIniFeatureEnabled); |
| 10399 | return eHAL_STATUS_SUCCESS; |
| 10400 | } |
| 10401 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10402 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10403 | "%s: FastRoamEnabled is changed from %d to %d", __func__, |
| 10404 | pMac->roam.configParam.isFastRoamIniFeatureEnabled, |
| 10405 | isFastRoamIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10406 | pMac->roam.configParam.isFastRoamIniFeatureEnabled = isFastRoamIniFeatureEnabled; |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10407 | csrNeighborRoamUpdateFastRoamingEnabled(pMac, isFastRoamIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10408 | |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10409 | return eHAL_STATUS_SUCCESS; |
| 10410 | } |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 10411 | |
Sameer Thalappil | 4ae66ec | 2013-11-05 14:17:35 -0800 | [diff] [blame] | 10412 | /*-------------------------------------------------------------------------- |
Mukul Sharma | 2a27163 | 2014-10-13 14:59:01 +0530 | [diff] [blame] | 10413 | \brief sme_ConfigFwrRoaming() - enable/disable LFR support at runtime |
| 10414 | When Supplicant issue enabled / disable fwr based roaming on the basis |
| 10415 | of the Bssid modification in network block ( e.g. AutoJoin mody N/W block) |
| 10416 | |
| 10417 | This is a synchronous call |
| 10418 | \param hHal - The handle returned by macOpen. |
| 10419 | \return eHAL_STATUS_SUCCESS - SME (enabled/disabled) offload scan successfully. |
| 10420 | Other status means SME is failed to (enabled/disabled) offload scan. |
| 10421 | \sa |
| 10422 | --------------------------------------------------------------------------*/ |
| 10423 | |
| 10424 | eHalStatus sme_ConfigFwrRoaming(tHalHandle hHal, |
| 10425 | const v_BOOL_t isFastRoamEnabled) |
| 10426 | { |
| 10427 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10428 | if (!pMac->roam.configParam.isFastRoamIniFeatureEnabled) |
| 10429 | { |
| 10430 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10431 | "%s: FastRoam is disabled through ini", __func__); |
| 10432 | return eHAL_STATUS_FAILURE; |
| 10433 | } |
| 10434 | csrNeighborRoamUpdateFastRoamingEnabled(pMac, isFastRoamEnabled); |
| 10435 | return eHAL_STATUS_SUCCESS; |
| 10436 | } |
| 10437 | |
| 10438 | /*-------------------------------------------------------------------------- |
Sameer Thalappil | 4ae66ec | 2013-11-05 14:17:35 -0800 | [diff] [blame] | 10439 | \brief sme_UpdateIsMAWCIniFeatureEnabled() - |
| 10440 | Enable/disable LFR MAWC support at runtime |
| 10441 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 10442 | isMAWCIniFeatureEnabled. |
| 10443 | This is a synchronous call |
| 10444 | \param hHal - The handle returned by macOpen. |
| 10445 | \return eHAL_STATUS_SUCCESS - SME update MAWCEnabled config successfully. |
| 10446 | Other status means SME is failed to update MAWCEnabled. |
| 10447 | \sa |
| 10448 | --------------------------------------------------------------------------*/ |
| 10449 | eHalStatus sme_UpdateIsMAWCIniFeatureEnabled(tHalHandle hHal, |
| 10450 | const v_BOOL_t MAWCEnabled) |
| 10451 | { |
| 10452 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10453 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10454 | |
| 10455 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10456 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10457 | { |
| 10458 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10459 | "%s: MAWCEnabled is changed from %d to %d", __func__, |
| 10460 | pMac->roam.configParam.MAWCEnabled, |
| 10461 | MAWCEnabled); |
| 10462 | pMac->roam.configParam.MAWCEnabled = MAWCEnabled; |
| 10463 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10464 | } |
| 10465 | |
| 10466 | return status ; |
| 10467 | |
| 10468 | } |
| 10469 | |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 10470 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 10471 | /*-------------------------------------------------------------------------- |
| 10472 | \brief sme_UpdateEnableFastRoamInConcurrency() - enable/disable LFR if Concurrent session exists |
| 10473 | This is a synchronuous call |
| 10474 | \param hHal - The handle returned by macOpen. |
| 10475 | \return eHAL_STATUS_SUCCESS |
| 10476 | Other status means SME is failed |
| 10477 | \sa |
| 10478 | --------------------------------------------------------------------------*/ |
| 10479 | |
| 10480 | eHalStatus sme_UpdateEnableFastRoamInConcurrency(tHalHandle hHal, |
| 10481 | v_BOOL_t bFastRoamInConIniFeatureEnabled) |
| 10482 | { |
| 10483 | |
| 10484 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10485 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10486 | |
| 10487 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10488 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10489 | { |
| 10490 | pMac->roam.configParam.bFastRoamInConIniFeatureEnabled = bFastRoamInConIniFeatureEnabled; |
| 10491 | if (0 == pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 10492 | { |
| 10493 | pMac->roam.configParam.bFastRoamInConIniFeatureEnabled = 0; |
| 10494 | } |
| 10495 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10496 | } |
| 10497 | |
| 10498 | return status; |
| 10499 | } |
| 10500 | #endif |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10501 | #endif /* FEATURE_WLAN_LFR */ |
| 10502 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10503 | #ifdef FEATURE_WLAN_ESE |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10504 | /*-------------------------------------------------------------------------- |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10505 | \brief sme_UpdateIsEseFeatureEnabled() - enable/disable Ese support at runtime |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10506 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10507 | isEseIniFeatureEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10508 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10509 | \param hHal - The handle returned by macOpen. |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10510 | \return eHAL_STATUS_SUCCESS - SME update isEseIniFeatureEnabled config successfully. |
| 10511 | Other status means SME is failed to update isEseIniFeatureEnabled. |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10512 | \sa |
| 10513 | --------------------------------------------------------------------------*/ |
| 10514 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10515 | eHalStatus sme_UpdateIsEseFeatureEnabled(tHalHandle hHal, |
| 10516 | const v_BOOL_t isEseIniFeatureEnabled) |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10517 | { |
| 10518 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10519 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10520 | if (pMac->roam.configParam.isEseIniFeatureEnabled == isEseIniFeatureEnabled) |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10521 | { |
| 10522 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10523 | "%s: Ese Mode is already enabled or disabled, nothing to do (returning) old(%d) new(%d)", __func__, |
| 10524 | pMac->roam.configParam.isEseIniFeatureEnabled, |
| 10525 | isEseIniFeatureEnabled); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10526 | return eHAL_STATUS_SUCCESS; |
| 10527 | } |
| 10528 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10529 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10530 | "%s: EseEnabled is changed from %d to %d", __func__, |
| 10531 | pMac->roam.configParam.isEseIniFeatureEnabled, |
| 10532 | isEseIniFeatureEnabled); |
| 10533 | pMac->roam.configParam.isEseIniFeatureEnabled = isEseIniFeatureEnabled; |
| 10534 | csrNeighborRoamUpdateEseModeEnabled(pMac, isEseIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10535 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10536 | if(TRUE == isEseIniFeatureEnabled) |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10537 | { |
| 10538 | sme_UpdateFastTransitionEnabled(hHal, TRUE); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10539 | } |
Srinivas Girigowda | ba17369 | 2013-08-07 11:55:38 -0700 | [diff] [blame] | 10540 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 10541 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 10542 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 10543 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10544 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_ESE_INI_CFG_CHANGED); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 10545 | } |
| 10546 | #endif |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10547 | return eHAL_STATUS_SUCCESS; |
| 10548 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10549 | #endif /* FEATURE_WLAN_ESE */ |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10550 | |
| 10551 | /*-------------------------------------------------------------------------- |
| 10552 | \brief sme_UpdateConfigFwRssiMonitoring() - enable/disable firmware RSSI Monitoring at runtime |
| 10553 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 10554 | fEnableFwRssiMonitoring. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10555 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10556 | \param hHal - The handle returned by macOpen. |
| 10557 | \return eHAL_STATUS_SUCCESS - SME update fEnableFwRssiMonitoring. config successfully. |
| 10558 | Other status means SME is failed to update fEnableFwRssiMonitoring. |
| 10559 | \sa |
| 10560 | --------------------------------------------------------------------------*/ |
| 10561 | |
| 10562 | eHalStatus sme_UpdateConfigFwRssiMonitoring(tHalHandle hHal, |
| 10563 | v_BOOL_t fEnableFwRssiMonitoring) |
| 10564 | { |
| 10565 | eHalStatus halStatus = eHAL_STATUS_SUCCESS; |
| 10566 | |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10567 | if (ccmCfgSetInt(hHal, WNI_CFG_PS_ENABLE_RSSI_MONITOR, fEnableFwRssiMonitoring, |
| 10568 | NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE) |
| 10569 | { |
| 10570 | halStatus = eHAL_STATUS_FAILURE; |
| 10571 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 10572 | "Failure: Could not pass on WNI_CFG_PS_RSSI_MONITOR configuration info to CCM"); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 10573 | } |
| 10574 | |
| 10575 | return (halStatus); |
| 10576 | } |
| 10577 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10578 | #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10579 | /*-------------------------------------------------------------------------- |
| 10580 | \brief sme_setNeighborLookupRssiThreshold() - update neighbor lookup rssi threshold |
| 10581 | This is a synchronous call |
| 10582 | \param hHal - The handle returned by macOpen. |
| 10583 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 10584 | Other status means SME is failed to update |
| 10585 | \sa |
| 10586 | --------------------------------------------------------------------------*/ |
| 10587 | eHalStatus sme_setNeighborLookupRssiThreshold(tHalHandle hHal, |
| 10588 | v_U8_t neighborLookupRssiThreshold) |
| 10589 | { |
| 10590 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10591 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10592 | |
| 10593 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10594 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10595 | { |
| 10596 | status = csrNeighborRoamSetLookupRssiThreshold(pMac, neighborLookupRssiThreshold); |
| 10597 | if (HAL_STATUS_SUCCESS(status)) |
| 10598 | { |
| 10599 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10600 | "LFR runtime successfully set Lookup threshold to %d" |
| 10601 | " - old value is %d - roam state is %s", |
| 10602 | neighborLookupRssiThreshold, |
| 10603 | pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold, |
| 10604 | macTraceGetNeighbourRoamState( |
| 10605 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10606 | pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold = |
| 10607 | neighborLookupRssiThreshold; |
| 10608 | } |
| 10609 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10610 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10611 | return status; |
| 10612 | } |
| 10613 | |
| 10614 | /*-------------------------------------------------------------------------- |
| 10615 | \brief sme_setNeighborReassocRssiThreshold() - update neighbor reassoc rssi threshold |
| 10616 | This is a synchronous call |
| 10617 | \param hHal - The handle returned by macOpen. |
| 10618 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 10619 | Other status means SME is failed to update |
| 10620 | \sa |
| 10621 | --------------------------------------------------------------------------*/ |
| 10622 | eHalStatus sme_setNeighborReassocRssiThreshold(tHalHandle hHal, |
| 10623 | v_U8_t neighborReassocRssiThreshold) |
| 10624 | { |
| 10625 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10626 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10627 | |
| 10628 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10629 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10630 | { |
| 10631 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10632 | "LFR runtime successfully set Reassoc threshold to %d" |
| 10633 | "- old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10634 | neighborReassocRssiThreshold, |
| 10635 | pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10636 | macTraceGetNeighbourRoamState( |
| 10637 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10638 | pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold = |
| 10639 | neighborReassocRssiThreshold; |
| 10640 | pMac->roam.neighborRoamInfo.cfgParams.neighborReassocThreshold = |
| 10641 | neighborReassocRssiThreshold; |
| 10642 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10643 | } |
| 10644 | |
| 10645 | return status ; |
| 10646 | } |
| 10647 | |
| 10648 | |
| 10649 | /*-------------------------------------------------------------------------- |
| 10650 | \brief sme_getNeighborLookupRssiThreshold() - get neighbor lookup rssi threshold |
| 10651 | This is a synchronous call |
| 10652 | \param hHal - The handle returned by macOpen. |
| 10653 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 10654 | Other status means SME is failed to update |
| 10655 | \sa |
| 10656 | --------------------------------------------------------------------------*/ |
| 10657 | v_U8_t sme_getNeighborLookupRssiThreshold(tHalHandle hHal) |
| 10658 | { |
| 10659 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10660 | return pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold; |
| 10661 | } |
| 10662 | |
| 10663 | /*-------------------------------------------------------------------------- |
| 10664 | \brief sme_setNeighborScanRefreshPeriod() - set neighbor scan results refresh period |
| 10665 | This is a synchronous call |
| 10666 | \param hHal - The handle returned by macOpen. |
| 10667 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 10668 | Other status means SME is failed to update |
| 10669 | \sa |
| 10670 | --------------------------------------------------------------------------*/ |
| 10671 | eHalStatus sme_setNeighborScanRefreshPeriod(tHalHandle hHal, |
| 10672 | v_U16_t neighborScanResultsRefreshPeriod) |
| 10673 | { |
| 10674 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10675 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10676 | |
| 10677 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10678 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10679 | { |
| 10680 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10681 | "LFR runtime successfully set roam scan refresh period to %d" |
| 10682 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10683 | neighborScanResultsRefreshPeriod, |
| 10684 | pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10685 | macTraceGetNeighbourRoamState( |
| 10686 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10687 | pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod = |
| 10688 | neighborScanResultsRefreshPeriod; |
| 10689 | pMac->roam.neighborRoamInfo.cfgParams.neighborResultsRefreshPeriod = |
| 10690 | neighborScanResultsRefreshPeriod; |
| 10691 | |
| 10692 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10693 | } |
| 10694 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 10695 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 10696 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 10697 | { |
| 10698 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 10699 | REASON_NEIGHBOR_SCAN_REFRESH_PERIOD_CHANGED); |
| 10700 | } |
| 10701 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10702 | return status ; |
| 10703 | } |
| 10704 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 10705 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 10706 | /*-------------------------------------------------------------------------- |
| 10707 | \brief sme_UpdateRoamScanOffloadEnabled() - enable/disable roam scan offload feaure |
| 10708 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 10709 | gRoamScanOffloadEnabled. |
| 10710 | This is a synchronous call |
| 10711 | \param hHal - The handle returned by macOpen. |
| 10712 | \return eHAL_STATUS_SUCCESS - SME update config successfully. |
| 10713 | Other status means SME is failed to update. |
| 10714 | \sa |
| 10715 | --------------------------------------------------------------------------*/ |
| 10716 | |
| 10717 | eHalStatus sme_UpdateRoamScanOffloadEnabled(tHalHandle hHal, |
| 10718 | v_BOOL_t nRoamScanOffloadEnabled) |
| 10719 | { |
| 10720 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10721 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10722 | |
| 10723 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10724 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10725 | { |
| 10726 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10727 | "%s: gRoamScanOffloadEnabled is changed from %d to %d", __func__, |
| 10728 | pMac->roam.configParam.isRoamOffloadScanEnabled, |
| 10729 | nRoamScanOffloadEnabled); |
| 10730 | pMac->roam.configParam.isRoamOffloadScanEnabled = nRoamScanOffloadEnabled; |
| 10731 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10732 | } |
| 10733 | |
| 10734 | return status ; |
| 10735 | } |
| 10736 | #endif |
| 10737 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10738 | /*-------------------------------------------------------------------------- |
| 10739 | \brief sme_getNeighborScanRefreshPeriod() - get neighbor scan results refresh period |
| 10740 | This is a synchronous call |
| 10741 | \param hHal - The handle returned by macOpen. |
| 10742 | \return v_U16_t - Neighbor scan results refresh period value |
| 10743 | \sa |
| 10744 | --------------------------------------------------------------------------*/ |
| 10745 | v_U16_t sme_getNeighborScanRefreshPeriod(tHalHandle hHal) |
| 10746 | { |
| 10747 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10748 | return pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod; |
| 10749 | } |
| 10750 | |
| 10751 | /*-------------------------------------------------------------------------- |
| 10752 | \brief sme_getEmptyScanRefreshPeriod() - get empty scan refresh period |
| 10753 | This is a synchronuous call |
| 10754 | \param hHal - The handle returned by macOpen. |
| 10755 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 10756 | Other status means SME is failed to update |
| 10757 | \sa |
| 10758 | --------------------------------------------------------------------------*/ |
| 10759 | v_U16_t sme_getEmptyScanRefreshPeriod(tHalHandle hHal) |
| 10760 | { |
| 10761 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10762 | return pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod; |
| 10763 | } |
| 10764 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10765 | /* --------------------------------------------------------------------------- |
| 10766 | \fn sme_UpdateEmptyScanRefreshPeriod |
| 10767 | \brief Update nEmptyScanRefreshPeriod |
| 10768 | This function is called through dynamic setConfig callback function |
| 10769 | to configure nEmptyScanRefreshPeriod |
| 10770 | Usage: adb shell iwpriv wlan0 setConfig nEmptyScanRefreshPeriod=[0 .. 60] |
| 10771 | \param hHal - HAL handle for device |
| 10772 | \param nEmptyScanRefreshPeriod - scan period following empty scan results. |
| 10773 | \- return Success or failure |
| 10774 | -------------------------------------------------------------------------*/ |
| 10775 | |
| 10776 | eHalStatus sme_UpdateEmptyScanRefreshPeriod(tHalHandle hHal, v_U16_t nEmptyScanRefreshPeriod) |
| 10777 | { |
| 10778 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10779 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10780 | |
| 10781 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10782 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10783 | { |
| 10784 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10785 | "LFR runtime successfully set roam scan period to %d -" |
| 10786 | "old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10787 | nEmptyScanRefreshPeriod, |
| 10788 | pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10789 | macTraceGetNeighbourRoamState( |
| 10790 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10791 | pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod = nEmptyScanRefreshPeriod; |
| 10792 | pMac->roam.neighborRoamInfo.cfgParams.emptyScanRefreshPeriod = nEmptyScanRefreshPeriod; |
| 10793 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10794 | } |
| 10795 | |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 10796 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 10797 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 10798 | { |
| 10799 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 10800 | REASON_EMPTY_SCAN_REF_PERIOD_CHANGED); |
| 10801 | } |
| 10802 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10803 | return status ; |
| 10804 | } |
| 10805 | |
| 10806 | /* --------------------------------------------------------------------------- |
| 10807 | \fn sme_setNeighborScanMinChanTime |
| 10808 | \brief Update nNeighborScanMinChanTime |
| 10809 | This function is called through dynamic setConfig callback function |
| 10810 | to configure gNeighborScanChannelMinTime |
| 10811 | Usage: adb shell iwpriv wlan0 setConfig gNeighborScanChannelMinTime=[0 .. 60] |
| 10812 | \param hHal - HAL handle for device |
| 10813 | \param nNeighborScanMinChanTime - Channel minimum dwell time |
| 10814 | \- return Success or failure |
| 10815 | -------------------------------------------------------------------------*/ |
| 10816 | eHalStatus sme_setNeighborScanMinChanTime(tHalHandle hHal, const v_U16_t nNeighborScanMinChanTime) |
| 10817 | { |
| 10818 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10819 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10820 | |
| 10821 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10822 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10823 | { |
| 10824 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10825 | "LFR runtime successfully set channel min dwell time to %d" |
| 10826 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10827 | nNeighborScanMinChanTime, |
| 10828 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10829 | macTraceGetNeighbourRoamState( |
| 10830 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10831 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime = nNeighborScanMinChanTime; |
| 10832 | pMac->roam.neighborRoamInfo.cfgParams.minChannelScanTime = nNeighborScanMinChanTime; |
| 10833 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10834 | } |
| 10835 | |
| 10836 | return status ; |
| 10837 | } |
| 10838 | |
| 10839 | /* --------------------------------------------------------------------------- |
| 10840 | \fn sme_setNeighborScanMaxChanTime |
| 10841 | \brief Update nNeighborScanMaxChanTime |
| 10842 | This function is called through dynamic setConfig callback function |
| 10843 | to configure gNeighborScanChannelMaxTime |
| 10844 | Usage: adb shell iwpriv wlan0 setConfig gNeighborScanChannelMaxTime=[0 .. 60] |
| 10845 | \param hHal - HAL handle for device |
| 10846 | \param nNeighborScanMinChanTime - Channel maximum dwell time |
| 10847 | \- return Success or failure |
| 10848 | -------------------------------------------------------------------------*/ |
| 10849 | eHalStatus sme_setNeighborScanMaxChanTime(tHalHandle hHal, const v_U16_t nNeighborScanMaxChanTime) |
| 10850 | { |
| 10851 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10852 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10853 | |
| 10854 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10855 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10856 | { |
| 10857 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10858 | "LFR runtime successfully set channel max dwell time to %d" |
| 10859 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10860 | nNeighborScanMaxChanTime, |
| 10861 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMaxChanTime, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10862 | macTraceGetNeighbourRoamState( |
| 10863 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10864 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMaxChanTime = nNeighborScanMaxChanTime; |
| 10865 | pMac->roam.neighborRoamInfo.cfgParams.maxChannelScanTime = nNeighborScanMaxChanTime; |
| 10866 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10867 | } |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 10868 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 10869 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 10870 | { |
| 10871 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 10872 | REASON_SCAN_CH_TIME_CHANGED); |
| 10873 | } |
| 10874 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10875 | |
| 10876 | return status ; |
| 10877 | } |
| 10878 | |
| 10879 | /* --------------------------------------------------------------------------- |
| 10880 | \fn sme_getNeighborScanMinChanTime |
| 10881 | \brief get neighbor scan min channel time |
| 10882 | \param hHal - The handle returned by macOpen. |
| 10883 | \return v_U16_t - channel min time value |
| 10884 | -------------------------------------------------------------------------*/ |
| 10885 | v_U16_t sme_getNeighborScanMinChanTime(tHalHandle hHal) |
| 10886 | { |
| 10887 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10888 | return pMac->roam.neighborRoamInfo.cfgParams.minChannelScanTime; |
| 10889 | } |
| 10890 | |
| 10891 | /* --------------------------------------------------------------------------- |
| 10892 | \fn sme_getNeighborScanMaxChanTime |
| 10893 | \brief get neighbor scan max channel time |
| 10894 | \param hHal - The handle returned by macOpen. |
| 10895 | \return v_U16_t - channel max time value |
| 10896 | -------------------------------------------------------------------------*/ |
| 10897 | v_U16_t sme_getNeighborScanMaxChanTime(tHalHandle hHal) |
| 10898 | { |
| 10899 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10900 | return pMac->roam.neighborRoamInfo.cfgParams.maxChannelScanTime; |
| 10901 | } |
| 10902 | |
| 10903 | /* --------------------------------------------------------------------------- |
| 10904 | \fn sme_setNeighborScanPeriod |
| 10905 | \brief Update nNeighborScanPeriod |
| 10906 | This function is called through dynamic setConfig callback function |
| 10907 | to configure nNeighborScanPeriod |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 10908 | Usage: adb shell iwpriv wlan0 setConfig nNeighborScanPeriod=[0 .. 1000] |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10909 | \param hHal - HAL handle for device |
| 10910 | \param nNeighborScanPeriod - neighbor scan period |
| 10911 | \- return Success or failure |
| 10912 | -------------------------------------------------------------------------*/ |
| 10913 | eHalStatus sme_setNeighborScanPeriod(tHalHandle hHal, const v_U16_t nNeighborScanPeriod) |
| 10914 | { |
| 10915 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10916 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10917 | |
| 10918 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10919 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10920 | { |
| 10921 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10922 | "LFR runtime successfully set neighbor scan period to %d" |
| 10923 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10924 | nNeighborScanPeriod, |
| 10925 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 10926 | macTraceGetNeighbourRoamState( |
| 10927 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10928 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod = nNeighborScanPeriod; |
| 10929 | pMac->roam.neighborRoamInfo.cfgParams.neighborScanPeriod = nNeighborScanPeriod; |
| 10930 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10931 | } |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 10932 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 10933 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 10934 | { |
| 10935 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 10936 | REASON_SCAN_HOME_TIME_CHANGED); |
| 10937 | } |
| 10938 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10939 | |
| 10940 | return status ; |
| 10941 | } |
| 10942 | |
| 10943 | /* --------------------------------------------------------------------------- |
| 10944 | \fn sme_getNeighborScanPeriod |
| 10945 | \brief get neighbor scan period |
| 10946 | \param hHal - The handle returned by macOpen. |
| 10947 | \return v_U16_t - neighbor scan period |
| 10948 | -------------------------------------------------------------------------*/ |
| 10949 | v_U16_t sme_getNeighborScanPeriod(tHalHandle hHal) |
| 10950 | { |
| 10951 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10952 | return pMac->roam.neighborRoamInfo.cfgParams.neighborScanPeriod; |
| 10953 | } |
| 10954 | |
| 10955 | #endif |
| 10956 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10957 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10958 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10959 | /*-------------------------------------------------------------------------- |
| 10960 | \brief sme_getRoamRssiDiff() - get Roam rssi diff |
| 10961 | This is a synchronous call |
| 10962 | \param hHal - The handle returned by macOpen. |
| 10963 | \return v_U16_t - Rssi diff value |
| 10964 | \sa |
| 10965 | --------------------------------------------------------------------------*/ |
| 10966 | v_U8_t sme_getRoamRssiDiff(tHalHandle hHal) |
| 10967 | { |
| 10968 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10969 | return pMac->roam.configParam.RoamRssiDiff; |
| 10970 | } |
| 10971 | |
| 10972 | /*-------------------------------------------------------------------------- |
| 10973 | \brief sme_ChangeRoamScanChannelList() - Change roam scan channel list |
| 10974 | This is a synchronous call |
| 10975 | \param hHal - The handle returned by macOpen. |
| 10976 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 10977 | Other status means SME is failed to update |
| 10978 | \sa |
| 10979 | --------------------------------------------------------------------------*/ |
| 10980 | eHalStatus sme_ChangeRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, |
| 10981 | tANI_U8 numChannels) |
| 10982 | { |
| 10983 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10984 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10985 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 10986 | tANI_U8 oldChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
Kiet Lam | 600d3ca | 2013-08-31 16:33:32 +0530 | [diff] [blame] | 10987 | tANI_U8 newChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10988 | tANI_U8 i = 0, j = 0; |
| 10989 | |
| 10990 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10991 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10992 | { |
| 10993 | if (NULL != pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
| 10994 | { |
| 10995 | for (i = 0; i < pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; i++) |
| 10996 | { |
Kaushik, Sushant | d39915b | 2014-04-23 15:12:28 +0530 | [diff] [blame] | 10997 | if (j < sizeof(oldChannelList)) |
| 10998 | { |
| 10999 | j += snprintf(oldChannelList + j, sizeof(oldChannelList) - j," %d", |
| 11000 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]); |
| 11001 | } |
| 11002 | else |
| 11003 | { |
| 11004 | break; |
| 11005 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 11006 | } |
| 11007 | } |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 11008 | csrFlushCfgBgScanRoamChannelList(pMac); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 11009 | csrCreateBgScanRoamChannelList(pMac, pChannelList, numChannels); |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 11010 | sme_SetRoamScanControl(hHal, 1); |
| 11011 | if (NULL != pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 11012 | { |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 11013 | j = 0; |
| 11014 | for (i = 0; i < pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; i++) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 11015 | { |
Kaushik, Sushant | d39915b | 2014-04-23 15:12:28 +0530 | [diff] [blame] | 11016 | if (j < sizeof(oldChannelList)) |
| 11017 | { |
| 11018 | j += snprintf(newChannelList + j, sizeof(newChannelList) - j," %d", |
| 11019 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]); |
| 11020 | } |
| 11021 | else |
| 11022 | { |
| 11023 | break; |
| 11024 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 11025 | } |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 11026 | } |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 11027 | |
| 11028 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 11029 | "LFR runtime successfully set roam scan channels to %s" |
| 11030 | "- old value is %s - roam state is %s", |
| 11031 | newChannelList, oldChannelList, |
| 11032 | macTraceGetNeighbourRoamState( |
| 11033 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 11034 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11035 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 11036 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 11037 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 11038 | { |
| 11039 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); |
| 11040 | } |
| 11041 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 11042 | |
| 11043 | return status ; |
| 11044 | } |
| 11045 | |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 11046 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 11047 | #ifdef FEATURE_WLAN_ESE_UPLOAD |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 11048 | /*-------------------------------------------------------------------------- |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 11049 | \brief sme_SetEseRoamScanChannelList() - set ese roam scan channel list |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 11050 | This is a synchronuous call |
| 11051 | \param hHal - The handle returned by macOpen. |
| 11052 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 11053 | Other status means SME is failed to update |
| 11054 | \sa |
| 11055 | --------------------------------------------------------------------------*/ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 11056 | eHalStatus sme_SetEseRoamScanChannelList(tHalHandle hHal, |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 11057 | tANI_U8 *pChannelList, |
| 11058 | tANI_U8 numChannels) |
| 11059 | { |
| 11060 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11061 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11062 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 11063 | tpCsrChannelInfo currChannelListInfo = &pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo; |
| 11064 | tANI_U8 oldChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
| 11065 | tANI_U8 newChannelList[128] = {0}; |
| 11066 | tANI_U8 i = 0, j = 0; |
| 11067 | |
| 11068 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 11069 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 11070 | { |
| 11071 | if (NULL != currChannelListInfo->ChannelList) |
| 11072 | { |
| 11073 | for (i = 0; i < currChannelListInfo->numOfChannels; i++) |
| 11074 | { |
| 11075 | j += snprintf(oldChannelList + j, sizeof(oldChannelList) - j," %d", |
| 11076 | currChannelListInfo->ChannelList[i]); |
| 11077 | } |
| 11078 | } |
| 11079 | status = csrCreateRoamScanChannelList(pMac, pChannelList, numChannels, csrGetCurrentBand(hHal)); |
| 11080 | |
| 11081 | if ( HAL_STATUS_SUCCESS( status )) |
| 11082 | { |
| 11083 | if (NULL != currChannelListInfo->ChannelList) |
| 11084 | { |
| 11085 | j = 0; |
| 11086 | for (i = 0; i < currChannelListInfo->numOfChannels; i++) |
| 11087 | { |
| 11088 | j += snprintf(newChannelList + j, sizeof(newChannelList) - j," %d", |
| 11089 | currChannelListInfo->ChannelList[i]); |
| 11090 | } |
| 11091 | } |
| 11092 | |
| 11093 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 11094 | "ESE roam scan channel list successfully set to %s - old value is %s - roam state is %s", |
| 11095 | newChannelList, oldChannelList, |
| 11096 | macTraceGetNeighbourRoamState(pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 11097 | } |
| 11098 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11099 | } |
| 11100 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 11101 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 11102 | { |
| 11103 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); |
| 11104 | } |
| 11105 | #endif |
| 11106 | |
| 11107 | return status ; |
| 11108 | } |
| 11109 | #endif |
| 11110 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 11111 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 11112 | \brief sme_getRoamScanChannelList() - get roam scan channel list |
| 11113 | This is a synchronous call |
| 11114 | \param hHal - The handle returned by macOpen. |
| 11115 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 11116 | Other status means SME is failed to update |
| 11117 | \sa |
| 11118 | --------------------------------------------------------------------------*/ |
| 11119 | eHalStatus sme_getRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, |
| 11120 | tANI_U8 *pNumChannels) |
| 11121 | { |
| 11122 | int i = 0; |
| 11123 | tANI_U8 *pOutPtr = pChannelList; |
| 11124 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11125 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 11126 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11127 | |
| 11128 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 11129 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 11130 | { |
| 11131 | if (NULL == pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
| 11132 | { |
| 11133 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, |
| 11134 | "Roam Scan channel list is NOT yet initialized"); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 11135 | *pNumChannels = 0; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 11136 | sme_ReleaseGlobalLock( &pMac->sme ); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 11137 | return status; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 11138 | } |
| 11139 | |
| 11140 | *pNumChannels = pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; |
| 11141 | for (i = 0; i < (*pNumChannels); i++) |
| 11142 | { |
| 11143 | pOutPtr[i] = pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]; |
| 11144 | } |
| 11145 | pOutPtr[i] = '\0'; |
| 11146 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11147 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 11148 | return status ; |
| 11149 | } |
| 11150 | |
| 11151 | /*-------------------------------------------------------------------------- |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 11152 | \brief sme_getIsEseFeatureEnabled() - get Ese feature enabled or not |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 11153 | This is a synchronuous call |
| 11154 | \param hHal - The handle returned by macOpen. |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 11155 | \return TRUE (1) - if the Ese feature is enabled |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 11156 | FALSE (0) - if feature is disabled (compile or runtime) |
| 11157 | \sa |
| 11158 | --------------------------------------------------------------------------*/ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 11159 | tANI_BOOLEAN sme_getIsEseFeatureEnabled(tHalHandle hHal) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 11160 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 11161 | #ifdef FEATURE_WLAN_ESE |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 11162 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 11163 | return csrRoamIsEseIniFeatureEnabled(pMac); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 11164 | #else |
| 11165 | return eANI_BOOLEAN_FALSE; |
| 11166 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 11167 | } |
| 11168 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 11169 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 11170 | \brief sme_GetWESMode() - get WES Mode |
| 11171 | This is a synchronous call |
| 11172 | \param hHal - The handle returned by macOpen |
| 11173 | \return v_U8_t - WES Mode Enabled(1)/Disabled(0) |
| 11174 | \sa |
| 11175 | --------------------------------------------------------------------------*/ |
| 11176 | v_BOOL_t sme_GetWESMode(tHalHandle hHal) |
| 11177 | { |
| 11178 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11179 | return pMac->roam.configParam.isWESModeEnabled; |
| 11180 | } |
| 11181 | |
| 11182 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 11183 | \brief sme_GetRoamScanControl() - get scan control |
| 11184 | This is a synchronous call |
| 11185 | \param hHal - The handle returned by macOpen. |
| 11186 | \return v_BOOL_t - Enabled(1)/Disabled(0) |
| 11187 | \sa |
| 11188 | --------------------------------------------------------------------------*/ |
| 11189 | v_BOOL_t sme_GetRoamScanControl(tHalHandle hHal) |
| 11190 | { |
| 11191 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11192 | return pMac->roam.configParam.nRoamScanControl; |
| 11193 | } |
| 11194 | #endif |
| 11195 | |
| 11196 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 11197 | \brief sme_getIsLfrFeatureEnabled() - get LFR feature enabled or not |
| 11198 | This is a synchronuous call |
| 11199 | \param hHal - The handle returned by macOpen. |
| 11200 | \return TRUE (1) - if the feature is enabled |
| 11201 | FALSE (0) - if feature is disabled (compile or runtime) |
| 11202 | \sa |
| 11203 | --------------------------------------------------------------------------*/ |
| 11204 | tANI_BOOLEAN sme_getIsLfrFeatureEnabled(tHalHandle hHal) |
| 11205 | { |
| 11206 | #ifdef FEATURE_WLAN_LFR |
| 11207 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11208 | return pMac->roam.configParam.isFastRoamIniFeatureEnabled; |
| 11209 | #else |
| 11210 | return eANI_BOOLEAN_FALSE; |
| 11211 | #endif |
| 11212 | } |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 11213 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 11214 | /*-------------------------------------------------------------------------- |
| 11215 | \brief sme_getIsFtFeatureEnabled() - get FT feature enabled or not |
| 11216 | This is a synchronuous call |
| 11217 | \param hHal - The handle returned by macOpen. |
| 11218 | \return TRUE (1) - if the feature is enabled |
| 11219 | FALSE (0) - if feature is disabled (compile or runtime) |
| 11220 | \sa |
| 11221 | --------------------------------------------------------------------------*/ |
| 11222 | tANI_BOOLEAN sme_getIsFtFeatureEnabled(tHalHandle hHal) |
| 11223 | { |
| 11224 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 11225 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11226 | return pMac->roam.configParam.isFastTransitionEnabled; |
| 11227 | #else |
| 11228 | return eANI_BOOLEAN_FALSE; |
| 11229 | #endif |
| 11230 | } |
| 11231 | |
Abhishek Singh | 00b7197 | 2016-01-07 10:51:04 +0530 | [diff] [blame] | 11232 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11233 | /* --------------------------------------------------------------------------- |
| 11234 | \fn sme_IsFeatureSupportedByFW |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 11235 | \brief Check if a feature is enabled by FW |
| 11236 | |
| 11237 | \param featEnumValue - Enumeration value from placeHolderInCapBitmap |
| 11238 | \- return 1/0 (TRUE/FALSE) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11239 | -------------------------------------------------------------------------*/ |
| 11240 | tANI_U8 sme_IsFeatureSupportedByFW(tANI_U8 featEnumValue) |
| 11241 | { |
| 11242 | return IS_FEATURE_SUPPORTED_BY_FW(featEnumValue); |
| 11243 | } |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 11244 | |
| 11245 | /* --------------------------------------------------------------------------- |
| 11246 | \fn sme_IsFeatureSupportedByDriver |
| 11247 | \brief Check if a feature is enabled by Driver |
| 11248 | |
| 11249 | \param featEnumValue - Enumeration value from placeHolderInCapBitmap |
| 11250 | \- return 1/0 (TRUE/FALSE) |
| 11251 | -------------------------------------------------------------------------*/ |
| 11252 | |
| 11253 | tANI_U8 sme_IsFeatureSupportedByDriver(tANI_U8 featEnumValue) |
| 11254 | { |
| 11255 | return IS_FEATURE_SUPPORTED_BY_DRIVER(featEnumValue); |
| 11256 | } |
| 11257 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11258 | #ifdef FEATURE_WLAN_TDLS |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 11259 | |
| 11260 | /* --------------------------------------------------------------------------- |
| 11261 | \fn sme_SendTdlsMgmtFrame |
| 11262 | \brief API to send TDLS management frames. |
| 11263 | |
| 11264 | \param peerMac - peer's Mac Adress. |
| 11265 | \param tdlsLinkEstablishParams - TDLS Peer Link Establishment Parameters |
| 11266 | \- return VOS_STATUS_SUCCES |
| 11267 | -------------------------------------------------------------------------*/ |
| 11268 | VOS_STATUS sme_SendTdlsLinkEstablishParams(tHalHandle hHal, |
Anand N Sunkad | c205d95 | 2015-07-30 15:36:03 +0530 | [diff] [blame] | 11269 | tANI_U8 sessionId, |
| 11270 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 11271 | const tSirMacAddr peerMac, |
| 11272 | #else |
| 11273 | tSirMacAddr peerMac, |
| 11274 | #endif |
| 11275 | tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams) |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 11276 | { |
| 11277 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11278 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11279 | |
Konamki, Sreelakshmi | 7b464be | 2015-07-14 12:17:01 +0530 | [diff] [blame] | 11280 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11281 | TRACE_CODE_SME_RX_HDD_TDLS_LINK_ESTABLISH_PARAM, |
| 11282 | sessionId, tdlsLinkEstablishParams->isOffChannelSupported)); |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 11283 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 11284 | |
| 11285 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 11286 | { |
| 11287 | status = csrTdlsSendLinkEstablishParams(hHal, sessionId, peerMac, tdlsLinkEstablishParams) ; |
| 11288 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11289 | } |
| 11290 | return status ; |
| 11291 | } |
| 11292 | |
Atul Mittal | c0f739f | 2014-07-31 13:47:47 +0530 | [diff] [blame] | 11293 | // tdlsoffchan |
| 11294 | |
| 11295 | /* --------------------------------------------------------------------------- |
| 11296 | \fn sme_SendTdlsChanSwitchReq |
| 11297 | \brief API to send TDLS management frames. |
| 11298 | |
| 11299 | \param peerMac - peer's Mac Adress. |
| 11300 | \param tdlsLinkEstablishParams - TDLS Peer Link Establishment Parameters |
| 11301 | \- return VOS_STATUS_SUCCES |
| 11302 | -------------------------------------------------------------------------*/ |
| 11303 | VOS_STATUS sme_SendTdlsChanSwitchReq(tHalHandle hHal, |
| 11304 | tANI_U8 sessionId, |
| 11305 | tSirMacAddr peerMac, |
| 11306 | tANI_S32 tdlsOffCh, |
| 11307 | tANI_S32 tdlsOffChBwOffset, |
| 11308 | tANI_U8 tdlsSwMode) |
| 11309 | { |
| 11310 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11311 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11312 | |
Konamki, Sreelakshmi | 7b464be | 2015-07-14 12:17:01 +0530 | [diff] [blame] | 11313 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11314 | TRACE_CODE_SME_RX_HDD_TDLS_CHAN_SWITCH_REQ, |
| 11315 | sessionId, tdlsOffCh)); |
Atul Mittal | c0f739f | 2014-07-31 13:47:47 +0530 | [diff] [blame] | 11316 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 11317 | |
| 11318 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 11319 | { |
| 11320 | status = csrTdlsSendChanSwitchReq(hHal, sessionId, peerMac, |
| 11321 | tdlsOffCh, tdlsOffChBwOffset, |
| 11322 | tdlsSwMode); |
| 11323 | } |
| 11324 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11325 | return status ; |
| 11326 | } |
| 11327 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11328 | /* --------------------------------------------------------------------------- |
| 11329 | \fn sme_SendTdlsMgmtFrame |
| 11330 | \brief API to send TDLS management frames. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 11331 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11332 | \param peerMac - peer's Mac Adress. |
| 11333 | \param frame_type - Type of TDLS mgmt frame to be sent. |
| 11334 | \param dialog - dialog token used in the frame. |
| 11335 | \param status - status to be incuded in the frame. |
Pradeep Reddy POTTETI | ca171f8 | 2014-03-21 14:17:35 +0530 | [diff] [blame] | 11336 | \param peerCapability - peer cpabilities |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11337 | \param buf - additional IEs to be included |
| 11338 | \param len - lenght of additional Ies |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 11339 | \param responder - Tdls request type |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11340 | \- return VOS_STATUS_SUCCES |
| 11341 | -------------------------------------------------------------------------*/ |
Anand N Sunkad | c205d95 | 2015-07-30 15:36:03 +0530 | [diff] [blame] | 11342 | VOS_STATUS sme_SendTdlsMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, |
| 11343 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 11344 | const tSirMacAddr peerMac, |
| 11345 | #else |
| 11346 | tSirMacAddr peerMac, |
| 11347 | #endif |
| 11348 | tANI_U8 frame_type, tANI_U8 dialog, |
| 11349 | tANI_U16 statusCode, tANI_U32 peerCapability, |
| 11350 | tANI_U8 *buf, tANI_U8 len, tANI_U8 responder) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11351 | { |
| 11352 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11353 | tCsrTdlsSendMgmt sendTdlsReq = {{0}} ; |
| 11354 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11355 | |
Konamki, Sreelakshmi | 7b464be | 2015-07-14 12:17:01 +0530 | [diff] [blame] | 11356 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11357 | TRACE_CODE_SME_RX_HDD_TDLS_SEND_MGMT_FRAME, |
| 11358 | sessionId, statusCode)); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11359 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 11360 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 11361 | { |
| 11362 | vos_mem_copy(sendTdlsReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 11363 | sendTdlsReq.frameType = frame_type; |
| 11364 | sendTdlsReq.buf = buf; |
| 11365 | sendTdlsReq.len = len; |
| 11366 | sendTdlsReq.dialog = dialog; |
| 11367 | sendTdlsReq.statusCode = statusCode; |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 11368 | sendTdlsReq.responder = responder; |
Pradeep Reddy POTTETI | ca171f8 | 2014-03-21 14:17:35 +0530 | [diff] [blame] | 11369 | sendTdlsReq.peerCapability = peerCapability; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11370 | |
| 11371 | status = csrTdlsSendMgmtReq(hHal, sessionId, &sendTdlsReq) ; |
| 11372 | |
| 11373 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11374 | } |
| 11375 | |
| 11376 | return status ; |
| 11377 | |
| 11378 | } |
| 11379 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 11380 | \fn sme_ChangeTdlsPeerSta |
| 11381 | \brief API to Update TDLS peer sta parameters. |
| 11382 | |
| 11383 | \param peerMac - peer's Mac Adress. |
| 11384 | \param staParams - Peer Station Parameters |
| 11385 | \- return VOS_STATUS_SUCCES |
| 11386 | -------------------------------------------------------------------------*/ |
Anand N Sunkad | b3ab97d | 2015-07-29 09:58:13 +0530 | [diff] [blame] | 11387 | VOS_STATUS sme_ChangeTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, |
| 11388 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 11389 | const tSirMacAddr peerMac, |
| 11390 | #else |
| 11391 | tSirMacAddr peerMac, |
| 11392 | #endif |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 11393 | tCsrStaParams *pstaParams) |
| 11394 | { |
| 11395 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11396 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11397 | |
Sushant Kaushik | d62d978 | 2014-02-19 15:39:40 +0530 | [diff] [blame] | 11398 | if (NULL == pstaParams) |
| 11399 | { |
| 11400 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11401 | "%s :pstaParams is NULL",__func__); |
| 11402 | return eHAL_STATUS_FAILURE; |
| 11403 | } |
Konamki, Sreelakshmi | 7b464be | 2015-07-14 12:17:01 +0530 | [diff] [blame] | 11404 | |
| 11405 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11406 | TRACE_CODE_SME_RX_HDD_TDLS_CHANGE_PEER_STA, sessionId, |
| 11407 | pstaParams->capability)); |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 11408 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 11409 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 11410 | { |
Anand N Sunkad | b3ab97d | 2015-07-29 09:58:13 +0530 | [diff] [blame] | 11411 | status = csrTdlsChangePeerSta(hHal, sessionId, peerMac, pstaParams); |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 11412 | |
| 11413 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11414 | } |
| 11415 | |
| 11416 | return status ; |
| 11417 | |
| 11418 | } |
| 11419 | |
| 11420 | /* --------------------------------------------------------------------------- |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11421 | \fn sme_AddTdlsPeerSta |
| 11422 | \brief API to Add TDLS peer sta entry. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 11423 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11424 | \param peerMac - peer's Mac Adress. |
| 11425 | \- return VOS_STATUS_SUCCES |
| 11426 | -------------------------------------------------------------------------*/ |
Anand N Sunkad | b3ab97d | 2015-07-29 09:58:13 +0530 | [diff] [blame] | 11427 | VOS_STATUS sme_AddTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, |
| 11428 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 11429 | const tSirMacAddr peerMac |
| 11430 | #else |
| 11431 | tSirMacAddr peerMac |
| 11432 | #endif |
| 11433 | ) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11434 | { |
| 11435 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11436 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11437 | |
Konamki, Sreelakshmi | 7b464be | 2015-07-14 12:17:01 +0530 | [diff] [blame] | 11438 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11439 | TRACE_CODE_SME_RX_HDD_TDLS_ADD_PEER_STA, |
| 11440 | sessionId, 0)); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11441 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 11442 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 11443 | { |
| 11444 | status = csrTdlsAddPeerSta(hHal, sessionId, peerMac); |
| 11445 | |
| 11446 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11447 | } |
| 11448 | |
| 11449 | return status ; |
| 11450 | |
| 11451 | } |
| 11452 | /* --------------------------------------------------------------------------- |
| 11453 | \fn sme_DeleteTdlsPeerSta |
| 11454 | \brief API to Delete TDLS peer sta entry. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 11455 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11456 | \param peerMac - peer's Mac Adress. |
| 11457 | \- return VOS_STATUS_SUCCES |
| 11458 | -------------------------------------------------------------------------*/ |
Anand N Sunkad | c205d95 | 2015-07-30 15:36:03 +0530 | [diff] [blame] | 11459 | VOS_STATUS sme_DeleteTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, |
| 11460 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 11461 | const tSirMacAddr peerMac |
| 11462 | #else |
| 11463 | tSirMacAddr peerMac |
| 11464 | #endif |
| 11465 | ) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11466 | { |
| 11467 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11468 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11469 | |
Konamki, Sreelakshmi | 7b464be | 2015-07-14 12:17:01 +0530 | [diff] [blame] | 11470 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11471 | TRACE_CODE_SME_RX_HDD_TDLS_DEL_PEER_STA, |
| 11472 | sessionId, 0)); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11473 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 11474 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 11475 | { |
| 11476 | status = csrTdlsDelPeerSta(hHal, sessionId, peerMac) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11477 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11478 | } |
| 11479 | |
| 11480 | return status ; |
| 11481 | |
| 11482 | } |
Gopichand Nakkala | 75e7b28 | 2013-03-15 18:37:13 -0700 | [diff] [blame] | 11483 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | ccd3a38 | 2013-03-19 13:56:10 -0700 | [diff] [blame] | 11484 | \fn sme_SetTdlsPowerSaveProhibited |
| 11485 | \API to set/reset the isTdlsPowerSaveProhibited. |
| 11486 | |
| 11487 | \- return void |
| 11488 | -------------------------------------------------------------------------*/ |
| 11489 | void sme_SetTdlsPowerSaveProhibited(tHalHandle hHal, v_BOOL_t val) |
| 11490 | { |
| 11491 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11492 | |
| 11493 | pMac->isTdlsPowerSaveProhibited = val; |
Agarwal Ashish | a7ef41d | 2015-06-25 18:00:26 +0530 | [diff] [blame] | 11494 | smsLog(pMac, LOG1, FL("isTdlsPowerSaveProhibited is %d"), |
| 11495 | pMac->isTdlsPowerSaveProhibited); |
Gopichand Nakkala | ccd3a38 | 2013-03-19 13:56:10 -0700 | [diff] [blame] | 11496 | return; |
| 11497 | } |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 11498 | #endif |
Gopichand Nakkala | fe7246d | 2013-06-10 17:43:37 +0530 | [diff] [blame] | 11499 | /* --------------------------------------------------------------------------- |
| 11500 | \fn sme_IsPmcBmps |
| 11501 | \API to Check if PMC state is BMPS. |
| 11502 | |
| 11503 | \- return v_BOOL_t |
| 11504 | -------------------------------------------------------------------------*/ |
| 11505 | v_BOOL_t sme_IsPmcBmps(tHalHandle hHal) |
| 11506 | { |
| 11507 | return (BMPS == pmcGetPmcState(hHal)); |
| 11508 | } |
| 11509 | |
Tushnim Bhattacharyya | 9cdf608 | 2013-04-21 16:33:30 -0700 | [diff] [blame] | 11510 | eHalStatus sme_UpdateDfsSetting(tHalHandle hHal, tANI_U8 fUpdateEnableDFSChnlScan) |
| 11511 | { |
| 11512 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 11513 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11514 | |
| 11515 | smsLog(pMac, LOG2, FL("enter")); |
Padma, Santhosh Kumar | 778d838 | 2015-03-04 17:41:22 +0530 | [diff] [blame] | 11516 | |
| 11517 | if (pMac->fActiveScanOnDFSChannels) |
| 11518 | { |
| 11519 | smsLog(pMac, LOG1, FL("Skip updating fEnableDFSChnlScan" |
| 11520 | " as DFS feature is triggered")); |
| 11521 | return (status); |
| 11522 | } |
| 11523 | |
Tushnim Bhattacharyya | 9cdf608 | 2013-04-21 16:33:30 -0700 | [diff] [blame] | 11524 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 11525 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 11526 | { |
| 11527 | pMac->scan.fEnableDFSChnlScan = fUpdateEnableDFSChnlScan; |
| 11528 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11529 | } |
| 11530 | smsLog(pMac, LOG2, FL("exit status %d"), status); |
| 11531 | |
| 11532 | return (status); |
| 11533 | } |
| 11534 | |
Padma, Santhosh Kumar | 778d838 | 2015-03-04 17:41:22 +0530 | [diff] [blame] | 11535 | /* --------------------------------------------------------------------------- |
| 11536 | \fn sme_UpdateDFSRoamMode |
| 11537 | \brief Update DFS roam scan mode |
| 11538 | This function is called to configure allowDFSChannelRoam |
| 11539 | dynamically |
| 11540 | \param hHal - HAL handle for device |
| 11541 | \param allowDFSChannelRoam - DFS roaming scan mode |
| 11542 | mode 0 disable roam scan on DFS channels |
| 11543 | mode 1 enables roam scan (passive/active) on DFS channels |
| 11544 | \return eHAL_STATUS_SUCCESS - SME update DFS roaming scan config |
| 11545 | successfully. |
| 11546 | Other status means SME failed to update DFS roaming scan config. |
| 11547 | \sa |
| 11548 | -------------------------------------------------------------------------*/ |
| 11549 | eHalStatus sme_UpdateDFSRoamMode(tHalHandle hHal, tANI_U8 allowDFSChannelRoam) |
| 11550 | { |
| 11551 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11552 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11553 | |
| 11554 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 11555 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 11556 | { |
| 11557 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 11558 | "LFR runtime successfully set AllowDFSChannelRoam Mode to " |
| 11559 | "%d - old value is %d", |
| 11560 | allowDFSChannelRoam, |
| 11561 | pMac->roam.configParam.allowDFSChannelRoam); |
| 11562 | pMac->roam.configParam.allowDFSChannelRoam = allowDFSChannelRoam; |
| 11563 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11564 | } |
| 11565 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 11566 | if (csrRoamIsRoamOffloadScanEnabled(pMac)) |
| 11567 | { |
| 11568 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 11569 | REASON_CHANNEL_LIST_CHANGED); |
| 11570 | } |
| 11571 | #endif |
| 11572 | |
| 11573 | return status ; |
| 11574 | } |
| 11575 | |
| 11576 | /* --------------------------------------------------------------------------- |
| 11577 | \fn sme_UpdateDFSScanMode |
| 11578 | \brief Update DFS scan mode |
| 11579 | This function is called to configure fEnableDFSChnlScan. |
| 11580 | \param hHal - HAL handle for device |
| 11581 | \param dfsScanMode - DFS scan mode |
| 11582 | mode 0 disable scan on DFS channels |
| 11583 | mode 1 enables passive scan on DFS channels |
| 11584 | mode 2 enables active scan on DFS channels for static list |
| 11585 | \return eHAL_STATUS_SUCCESS - SME update DFS roaming scan config |
| 11586 | successfully. |
| 11587 | Other status means SME failed to update DFS scan config. |
| 11588 | \sa |
| 11589 | -------------------------------------------------------------------------*/ |
| 11590 | eHalStatus sme_UpdateDFSScanMode(tHalHandle hHal, tANI_U8 dfsScanMode) |
| 11591 | { |
| 11592 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11593 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11594 | |
| 11595 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 11596 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 11597 | { |
| 11598 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 11599 | "DFS scan Mode changed to %d, old value is %d ", |
| 11600 | dfsScanMode, |
| 11601 | pMac->scan.fEnableDFSChnlScan); |
| 11602 | pMac->scan.fEnableDFSChnlScan = dfsScanMode; |
| 11603 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11604 | } |
| 11605 | |
| 11606 | sme_FilterScanDFSResults(hHal); |
| 11607 | sme_UpdateChannelList( hHal ); |
| 11608 | |
| 11609 | return status ; |
| 11610 | } |
| 11611 | |
| 11612 | /*-------------------------------------------------------------------------- |
| 11613 | \brief sme_GetDFSScanMode() - get DFS scan mode |
| 11614 | \param hHal - The handle returned by macOpen. |
| 11615 | \return DFS scan mode |
| 11616 | mode 0 disable scan on DFS channels |
| 11617 | mode 1 enables passive scan on DFS channels |
| 11618 | mode 2 enables active scan on DFS channels for static list |
| 11619 | \sa |
| 11620 | --------------------------------------------------------------------------*/ |
| 11621 | v_U8_t sme_GetDFSScanMode(tHalHandle hHal) |
| 11622 | { |
| 11623 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11624 | return pMac->scan.fEnableDFSChnlScan; |
| 11625 | } |
| 11626 | |
| 11627 | /* --------------------------------------------------------------------------- |
| 11628 | \fn sme_HandleDFSChanScan |
| 11629 | \brief Gets Valid channel list and updates scan control list according to |
| 11630 | dfsScanMode |
| 11631 | \param hHal - HAL handle for device |
| 11632 | \return eHAL_STATUS_FAILURE when failed to get valid channel list |
| 11633 | Otherwise eHAL_STATUS_SUCCESS - |
| 11634 | \sa |
| 11635 | -------------------------------------------------------------------------*/ |
| 11636 | eHalStatus sme_HandleDFSChanScan(tHalHandle hHal) |
| 11637 | { |
| 11638 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11639 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11640 | tCsrChannel ChannelList; |
| 11641 | |
Abhishek Singh | 5f391bd | 2016-05-04 12:52:45 +0530 | [diff] [blame] | 11642 | /* |
| 11643 | * Set Flag to block driver scan type conversion from active to passive |
| 11644 | * and vice versa in case if fEnableDFSChnlScan is |
| 11645 | * DFS_CHNL_SCAN_ENABLED_ACTIVE |
| 11646 | */ |
| 11647 | if (DFS_CHNL_SCAN_ENABLED_ACTIVE == |
| 11648 | pMac->scan.fEnableDFSChnlScan) |
| 11649 | pMac->fActiveScanOnDFSChannels = 1; |
| 11650 | else |
| 11651 | pMac->fActiveScanOnDFSChannels = 0; |
Padma, Santhosh Kumar | 778d838 | 2015-03-04 17:41:22 +0530 | [diff] [blame] | 11652 | |
| 11653 | ChannelList.numChannels = sizeof(ChannelList.channelList); |
| 11654 | status = sme_GetCfgValidChannels(hHal, (tANI_U8 *)ChannelList.channelList, |
| 11655 | (tANI_U32*)&ChannelList.numChannels); |
| 11656 | if (!HAL_STATUS_SUCCESS(status)) |
| 11657 | { |
| 11658 | smsLog(pMac, LOGE, |
| 11659 | FL("Failed to get valid channel list (err=%d)"), status); |
| 11660 | return status; |
| 11661 | } |
| 11662 | |
| 11663 | smsLog(pMac, LOG1, FL("Valid Channel list:")); |
| 11664 | VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 11665 | ChannelList.channelList, ChannelList.numChannels); |
| 11666 | |
| 11667 | sme_SetCfgScanControlList(hHal, pMac->scan.countryCodeCurrent, |
| 11668 | &ChannelList); |
| 11669 | return status ; |
| 11670 | } |
| 11671 | |
Gopichand Nakkala | e620d5a | 2013-04-26 05:45:57 -0700 | [diff] [blame] | 11672 | /* |
| 11673 | * SME API to enable/disable WLAN driver initiated SSR |
| 11674 | */ |
| 11675 | void sme_UpdateEnableSSR(tHalHandle hHal, tANI_BOOLEAN enableSSR) |
| 11676 | { |
| 11677 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11678 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11679 | |
| 11680 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 11681 | if (HAL_STATUS_SUCCESS(status)) |
| 11682 | { |
| 11683 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 11684 | "SSR level is changed %d", enableSSR); |
| 11685 | /* not serializing this messsage, as this is only going |
| 11686 | * to set a variable in WDA/WDI |
| 11687 | */ |
| 11688 | WDA_SetEnableSSR(enableSSR); |
| 11689 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11690 | } |
| 11691 | return; |
| 11692 | } |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 11693 | |
| 11694 | /* |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 11695 | * SME API to stringify bonding mode. (hostapd convention) |
| 11696 | */ |
| 11697 | |
| 11698 | static const char* sme_CBMode2String( tANI_U32 mode) |
| 11699 | { |
| 11700 | switch (mode) |
| 11701 | { |
| 11702 | case eCSR_INI_SINGLE_CHANNEL_CENTERED: |
| 11703 | return "HT20"; |
| 11704 | case eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY: |
| 11705 | return "HT40-"; /* lower secondary channel */ |
| 11706 | case eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY: |
| 11707 | return "HT40+"; /* upper secondary channel */ |
| 11708 | #ifdef WLAN_FEATURE_11AC |
| 11709 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 11710 | return "VHT80+40+"; /* upper secondary channels */ |
| 11711 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 11712 | return "VHT80+40-"; /* 1 lower and 2 upper secondary channels */ |
| 11713 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 11714 | return "VHT80-40+"; /* 2 lower and 1 upper secondary channels */ |
| 11715 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 11716 | return "VHT80-40-"; /* lower secondary channels */ |
| 11717 | #endif |
| 11718 | default: |
| 11719 | VOS_ASSERT(0); |
| 11720 | return "Unknown"; |
| 11721 | } |
| 11722 | } |
| 11723 | |
| 11724 | /* |
Abhishek Singh | 6b27f07 | 2015-09-10 14:46:33 +0530 | [diff] [blame] | 11725 | * SME API to adjust bonding mode to regulatory .. etc. |
| 11726 | * |
| 11727 | */ |
| 11728 | static VOS_STATUS sme_AdjustCBMode(tAniSirGlobal* pMac, |
| 11729 | tSmeConfigParams *smeConfig, |
| 11730 | tANI_U8 channel) |
| 11731 | { |
| 11732 | const tANI_U8 step = SME_START_CHAN_STEP; |
| 11733 | tANI_U8 i, startChan = channel, chanCnt = 0, chanBitmap = 0; |
| 11734 | tANI_BOOLEAN violation = VOS_FALSE; |
| 11735 | tANI_U32 newMode, mode; |
| 11736 | tANI_U8 centerChan = channel; |
| 11737 | /* to validate 40MHz channels against the regulatory domain */ |
| 11738 | tANI_BOOLEAN ht40PhyMode = VOS_FALSE; |
| 11739 | |
| 11740 | /* get the bonding mode */ |
| 11741 | mode = (channel <= 14) ? smeConfig->csrConfig.channelBondingMode24GHz : |
| 11742 | smeConfig->csrConfig.channelBondingMode5GHz; |
| 11743 | newMode = mode; |
| 11744 | |
| 11745 | /* get the channels */ |
| 11746 | switch (mode) |
| 11747 | { |
| 11748 | case eCSR_INI_SINGLE_CHANNEL_CENTERED: |
| 11749 | startChan = channel; |
| 11750 | chanCnt = 1; |
| 11751 | break; |
| 11752 | case eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY: |
| 11753 | startChan = channel - step; |
| 11754 | chanCnt = 2; |
| 11755 | centerChan = channel - CSR_CB_CENTER_CHANNEL_OFFSET; |
| 11756 | ht40PhyMode = VOS_TRUE; |
| 11757 | break; |
| 11758 | case eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY: |
| 11759 | startChan = channel; |
| 11760 | chanCnt=2; |
| 11761 | centerChan = channel + CSR_CB_CENTER_CHANNEL_OFFSET; |
| 11762 | ht40PhyMode = VOS_TRUE; |
| 11763 | break; |
| 11764 | #ifdef WLAN_FEATURE_11AC |
| 11765 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 11766 | startChan = channel; |
| 11767 | chanCnt = 4; |
| 11768 | break; |
| 11769 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 11770 | startChan = channel - step; |
| 11771 | chanCnt = 4; |
| 11772 | break; |
| 11773 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 11774 | startChan = channel - 2*step; |
| 11775 | chanCnt = 4; |
| 11776 | break; |
| 11777 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 11778 | startChan = channel - 3*step; |
| 11779 | chanCnt = 4; |
| 11780 | break; |
| 11781 | #endif |
| 11782 | default: |
| 11783 | VOS_ASSERT(0); |
| 11784 | return VOS_STATUS_E_FAILURE; |
| 11785 | } |
| 11786 | |
| 11787 | /* find violation; also map valid channels to a bitmap */ |
| 11788 | for (i = 0; i < chanCnt; i++) |
| 11789 | { |
| 11790 | if (csrIsValidChannel(pMac, (startChan + (i * step))) == |
| 11791 | eHAL_STATUS_SUCCESS) |
| 11792 | chanBitmap = chanBitmap | 1 << i; |
| 11793 | else |
| 11794 | violation = VOS_TRUE; |
| 11795 | } |
| 11796 | /* validate if 40MHz channel is allowed */ |
| 11797 | if (ht40PhyMode) |
| 11798 | { |
| 11799 | if (!csrRoamIsValid40MhzChannel(pMac, centerChan)) |
| 11800 | violation = VOS_TRUE; |
| 11801 | } |
| 11802 | |
| 11803 | /* no channels are valid */ |
| 11804 | if (chanBitmap == 0) |
| 11805 | { |
| 11806 | /* never be in this case */ |
| 11807 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11808 | FL("channel %d %s is not supported"), |
| 11809 | channel, |
| 11810 | sme_CBMode2String(mode)); |
| 11811 | return VOS_STATUS_E_INVAL; |
| 11812 | } |
| 11813 | |
| 11814 | /* fix violation */ |
| 11815 | if (violation) |
| 11816 | { |
| 11817 | const tANI_U8 lowerMask = 0x03, upperMask = 0x0c; |
| 11818 | /* fall back to single channel in all exception cases */ |
| 11819 | newMode = eCSR_INI_SINGLE_CHANNEL_CENTERED; |
| 11820 | |
| 11821 | switch (mode) |
| 11822 | { |
| 11823 | case eCSR_INI_SINGLE_CHANNEL_CENTERED: |
| 11824 | /* fall thru */ |
| 11825 | case eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY: |
| 11826 | /* fall thru */ |
| 11827 | case eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY: |
| 11828 | break; |
| 11829 | #ifdef WLAN_FEATURE_11AC |
| 11830 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 11831 | if ((chanBitmap & lowerMask) == lowerMask) |
| 11832 | newMode = eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 11833 | break; |
| 11834 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 11835 | if ((chanBitmap & lowerMask) == lowerMask) |
| 11836 | newMode = eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 11837 | break; |
| 11838 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 11839 | if ((chanBitmap & upperMask) == upperMask) |
| 11840 | newMode = eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 11841 | break; |
| 11842 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 11843 | if ((chanBitmap & upperMask) == upperMask) |
| 11844 | newMode = eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 11845 | break; |
| 11846 | #endif |
| 11847 | default: |
| 11848 | return VOS_STATUS_E_NOSUPPORT; |
| 11849 | break; |
| 11850 | } |
| 11851 | |
| 11852 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, |
| 11853 | FL("bonding mode adjust: %s to %s"), |
| 11854 | sme_CBMode2String(mode), |
| 11855 | sme_CBMode2String(newMode)); |
| 11856 | |
| 11857 | } |
| 11858 | |
| 11859 | /* check for mode change */ |
| 11860 | if (newMode != mode) |
| 11861 | { |
| 11862 | if (channel <= 14) |
| 11863 | smeConfig->csrConfig.channelBondingMode24GHz = newMode; |
| 11864 | else |
| 11865 | smeConfig->csrConfig.channelBondingMode5GHz = newMode; |
| 11866 | } |
| 11867 | |
| 11868 | return VOS_STATUS_SUCCESS; |
| 11869 | |
| 11870 | } |
| 11871 | |
| 11872 | /* |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 11873 | * SME API to determine the channel bonding mode |
| 11874 | */ |
| 11875 | VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 channel) |
| 11876 | { |
| 11877 | tSmeConfigParams smeConfig; |
| 11878 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Abhishek Singh | 4fe2b6b | 2015-09-15 17:13:27 +0530 | [diff] [blame] | 11879 | #ifdef WLAN_FEATURE_11AC |
| 11880 | tANI_U8 vht80Allowed; |
| 11881 | #endif |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 11882 | |
| 11883 | if ( |
| 11884 | #ifdef WLAN_FEATURE_11AC |
| 11885 | eCSR_DOT11_MODE_11ac != eCsrPhyMode && |
| 11886 | eCSR_DOT11_MODE_11ac_ONLY != eCsrPhyMode && |
| 11887 | #endif |
| 11888 | eCSR_DOT11_MODE_11n != eCsrPhyMode && |
krunal soni | 634aba3 | 2014-03-06 17:46:50 -0800 | [diff] [blame] | 11889 | eCSR_DOT11_MODE_11n_ONLY != eCsrPhyMode && |
| 11890 | |
| 11891 | eCSR_DOT11_MODE_11a != eCsrPhyMode && |
| 11892 | eCSR_DOT11_MODE_11a_ONLY != eCsrPhyMode && |
| 11893 | |
| 11894 | eCSR_DOT11_MODE_abg != eCsrPhyMode |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 11895 | ) |
| 11896 | { |
| 11897 | return VOS_STATUS_SUCCESS; |
| 11898 | } |
| 11899 | |
Kaushik, Sushant | 553a06c | 2014-11-26 15:29:40 +0530 | [diff] [blame] | 11900 | vos_mem_zero(&smeConfig, sizeof (tSmeConfigParams)); |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 11901 | sme_GetConfigParam(pMac, &smeConfig); |
| 11902 | |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 11903 | /* If channel bonding mode is not required */ |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 11904 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 11905 | if ( !pMac->roam.configParam.channelBondingMode5GHz |
| 11906 | && !smeConfig.csrConfig.apHT40_24GEnabled ) { |
| 11907 | #else |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 11908 | if ( !pMac->roam.configParam.channelBondingMode5GHz ) { |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 11909 | #endif |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 11910 | return VOS_STATUS_SUCCESS; |
| 11911 | } |
| 11912 | |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 11913 | |
| 11914 | #ifdef WLAN_FEATURE_11AC |
| 11915 | if ( eCSR_DOT11_MODE_11ac == eCsrPhyMode || |
| 11916 | eCSR_DOT11_MODE_11ac_ONLY == eCsrPhyMode ) |
| 11917 | { |
Abhishek Singh | 4fe2b6b | 2015-09-15 17:13:27 +0530 | [diff] [blame] | 11918 | /* Check if VHT80 is allowed for the channel*/ |
| 11919 | vht80Allowed = vos_is_channel_valid_for_vht80(channel); |
| 11920 | |
| 11921 | if (vht80Allowed) |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 11922 | { |
Abhishek Singh | 4fe2b6b | 2015-09-15 17:13:27 +0530 | [diff] [blame] | 11923 | if (channel== 36 || channel == 52 || channel == 100 || |
| 11924 | channel == 116 || channel == 149) |
| 11925 | { |
| 11926 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 11927 | eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
| 11928 | } |
| 11929 | else if (channel == 40 || channel == 56 || channel == 104 || |
| 11930 | channel == 120 || channel == 153) |
| 11931 | { |
| 11932 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 11933 | eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW; |
| 11934 | } |
| 11935 | else if (channel == 44 || channel == 60 || channel == 108 || |
| 11936 | channel == 124 || channel == 157) |
| 11937 | { |
| 11938 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 11939 | eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; |
| 11940 | } |
| 11941 | else if (channel == 48 || channel == 64 || channel == 112 || |
| 11942 | channel == 128 || channel == 144 || channel == 161) |
| 11943 | { |
| 11944 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 11945 | eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; |
| 11946 | } |
| 11947 | else if (channel == 165) |
| 11948 | { |
| 11949 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 11950 | eCSR_INI_SINGLE_CHANNEL_CENTERED; |
| 11951 | } |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 11952 | } |
Abhishek Singh | 4fe2b6b | 2015-09-15 17:13:27 +0530 | [diff] [blame] | 11953 | else /* Set VHT40 */ |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 11954 | { |
Abhishek Singh | 4fe2b6b | 2015-09-15 17:13:27 +0530 | [diff] [blame] | 11955 | if (channel== 40 || channel == 48 || channel == 56 || |
| 11956 | channel == 64 || channel == 104 || channel == 112 || |
| 11957 | channel == 120 || channel == 128 || channel == 136 || |
| 11958 | channel == 144 || channel == 153 || channel == 161) |
| 11959 | { |
| 11960 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 11961 | eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 11962 | } |
| 11963 | else if (channel== 36 || channel == 44 || channel == 52 || |
| 11964 | channel == 60 || channel == 100 || channel == 108 || |
| 11965 | channel == 116 || channel == 124 || channel == 132 || |
| 11966 | channel == 140 || channel == 149 || channel == 157) |
| 11967 | { |
| 11968 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 11969 | eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 11970 | } |
| 11971 | else if (channel == 165) |
| 11972 | { |
| 11973 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 11974 | eCSR_INI_SINGLE_CHANNEL_CENTERED; |
| 11975 | } |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 11976 | } |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 11977 | |
| 11978 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 11979 | if (smeConfig.csrConfig.apHT40_24GEnabled) |
| 11980 | { |
| 11981 | if (channel >= 1 && channel <= 7) |
| 11982 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 11983 | eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 11984 | else if (channel >= 8 && channel <= 13) |
| 11985 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 11986 | eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 11987 | else if (channel ==14) |
| 11988 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 11989 | eCSR_INI_SINGLE_CHANNEL_CENTERED; |
| 11990 | } |
| 11991 | #endif |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 11992 | } |
| 11993 | #endif |
| 11994 | |
| 11995 | if ( eCSR_DOT11_MODE_11n == eCsrPhyMode || |
| 11996 | eCSR_DOT11_MODE_11n_ONLY == eCsrPhyMode ) |
| 11997 | { |
| 11998 | if ( channel== 40 || channel == 48 || channel == 56 || |
| 11999 | channel == 64 || channel == 104 || channel == 112 || |
| 12000 | channel == 120 || channel == 128 || channel == 136 || |
| 12001 | channel == 144 || channel == 153 || channel == 161 ) |
| 12002 | { |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 12003 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 12004 | eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 12005 | } |
| 12006 | else if ( channel== 36 || channel == 44 || channel == 52 || |
| 12007 | channel == 60 || channel == 100 || channel == 108 || |
| 12008 | channel == 116 || channel == 124 || channel == 132 || |
| 12009 | channel == 140 || channel == 149 || channel == 157 ) |
| 12010 | { |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 12011 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 12012 | eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 12013 | } |
| 12014 | else if ( channel == 165 ) |
| 12015 | { |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 12016 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 12017 | eCSR_INI_SINGLE_CHANNEL_CENTERED; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 12018 | } |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 12019 | |
| 12020 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 12021 | if (smeConfig.csrConfig.apHT40_24GEnabled) |
| 12022 | { |
| 12023 | if (channel >= 1 && channel <= 7) |
| 12024 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 12025 | eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 12026 | else if (channel >= 8 && channel <= 13) |
| 12027 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 12028 | eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 12029 | else if (channel ==14) |
| 12030 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 12031 | eCSR_INI_SINGLE_CHANNEL_CENTERED; |
| 12032 | } |
| 12033 | #endif |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 12034 | } |
krunal soni | 634aba3 | 2014-03-06 17:46:50 -0800 | [diff] [blame] | 12035 | |
| 12036 | /* |
| 12037 | for 802.11a phy mode, channel bonding should be zero. |
| 12038 | From default config, it is set as PHY_DOUBLE_CHANNEL_HIGH_PRIMARY = 3 |
| 12039 | through csrChangeDefaultConfigParam function. We will override this |
| 12040 | value here. |
| 12041 | */ |
| 12042 | if ( eCSR_DOT11_MODE_11a == eCsrPhyMode || |
| 12043 | eCSR_DOT11_MODE_11a_ONLY == eCsrPhyMode || |
| 12044 | eCSR_DOT11_MODE_abg == eCsrPhyMode) |
| 12045 | { |
| 12046 | smeConfig.csrConfig.channelBondingMode5GHz = 0; |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 12047 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 12048 | } else if ( eCSR_DOT11_MODE_11g_ONLY == eCsrPhyMode) |
| 12049 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 12050 | eCSR_INI_SINGLE_CHANNEL_CENTERED; |
| 12051 | #else |
krunal soni | 634aba3 | 2014-03-06 17:46:50 -0800 | [diff] [blame] | 12052 | } |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 12053 | #endif |
krunal soni | 634aba3 | 2014-03-06 17:46:50 -0800 | [diff] [blame] | 12054 | |
Abhishek Singh | 6b27f07 | 2015-09-10 14:46:33 +0530 | [diff] [blame] | 12055 | sme_AdjustCBMode(pMac, &smeConfig, channel); |
| 12056 | |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 12057 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 12058 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 12059 | FL("%s cbmode selected=%d bonding mode:%s"), |
| 12060 | (channel <= 14) ? "2G" : "5G", |
| 12061 | (channel <= 14) ? smeConfig.csrConfig.channelBondingAPMode24GHz : |
| 12062 | smeConfig.csrConfig.channelBondingMode5GHz, |
| 12063 | (channel <= 14) ? |
| 12064 | sme_CBMode2String(smeConfig.csrConfig.channelBondingAPMode24GHz) : |
| 12065 | sme_CBMode2String(smeConfig.csrConfig.channelBondingMode5GHz)); |
| 12066 | #else |
Agarwal Ashish | bf98caf | 2014-03-25 13:29:11 +0530 | [diff] [blame] | 12067 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 12068 | "cbmode selected=%d", smeConfig.csrConfig.channelBondingMode5GHz); |
| 12069 | #endif |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 12070 | |
| 12071 | sme_UpdateConfig (pMac, &smeConfig); |
| 12072 | return VOS_STATUS_SUCCESS; |
| 12073 | } |
| 12074 | |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 12075 | /*-------------------------------------------------------------------------- |
| 12076 | |
| 12077 | \brief sme_SetCurrDeviceMode() - Sets the current operating device mode. |
| 12078 | \param hHal - The handle returned by macOpen. |
| 12079 | \param currDeviceMode - Current operating device mode. |
| 12080 | --------------------------------------------------------------------------*/ |
| 12081 | |
| 12082 | void sme_SetCurrDeviceMode (tHalHandle hHal, tVOS_CON_MODE currDeviceMode) |
| 12083 | { |
| 12084 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 12085 | pMac->sme.currDeviceMode = currDeviceMode; |
| 12086 | return; |
| 12087 | } |
| 12088 | |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 12089 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 12090 | /*-------------------------------------------------------------------------- |
| 12091 | \brief sme_HandoffRequest() - a wrapper function to Request a handoff |
| 12092 | from CSR. |
| 12093 | This is a synchronous call |
| 12094 | \param hHal - The handle returned by macOpen |
| 12095 | \param pHandoffInfo - info provided by HDD with the handoff request (namely: |
| 12096 | BSSID, channel etc.) |
| 12097 | \return eHAL_STATUS_SUCCESS - SME passed the request to CSR successfully. |
| 12098 | Other status means SME is failed to send the request. |
| 12099 | \sa |
| 12100 | --------------------------------------------------------------------------*/ |
| 12101 | |
| 12102 | eHalStatus sme_HandoffRequest(tHalHandle hHal, |
| 12103 | tCsrHandoffRequest *pHandoffInfo) |
| 12104 | { |
| 12105 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 12106 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 12107 | |
| 12108 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 12109 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 12110 | { |
| 12111 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 12112 | "%s: invoked", __func__); |
| 12113 | status = csrHandoffRequest(pMac, pHandoffInfo); |
| 12114 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 12115 | } |
| 12116 | |
| 12117 | return status ; |
| 12118 | } |
| 12119 | #endif |
| 12120 | |
Sudhir Sattayappa Kohalli | b1d8c3a | 2013-06-18 14:47:20 -0700 | [diff] [blame] | 12121 | /* |
| 12122 | * SME API to check if there is any infra station or |
| 12123 | * P2P client is connected |
| 12124 | */ |
| 12125 | VOS_STATUS sme_isSta_p2p_clientConnected(tHalHandle hHal) |
| 12126 | { |
| 12127 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 12128 | if(csrIsInfraConnected(pMac)) |
| 12129 | { |
| 12130 | return VOS_STATUS_SUCCESS; |
| 12131 | } |
| 12132 | return VOS_STATUS_E_FAILURE; |
| 12133 | } |
| 12134 | |
Agarwal Ashish | 57e8437 | 2014-12-05 18:26:53 +0530 | [diff] [blame] | 12135 | /* |
| 12136 | * SME API to check if any sessoion connected. |
| 12137 | */ |
| 12138 | VOS_STATUS sme_is_any_session_connected(tHalHandle hHal) |
| 12139 | { |
| 12140 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 12141 | if(csrIsAnySessionConnected(pMac)) |
| 12142 | { |
| 12143 | |
| 12144 | return VOS_STATUS_SUCCESS; |
| 12145 | } |
| 12146 | return VOS_STATUS_E_FAILURE; |
| 12147 | } |
| 12148 | |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 12149 | |
| 12150 | #ifdef FEATURE_WLAN_LPHB |
| 12151 | /* --------------------------------------------------------------------------- |
| 12152 | \fn sme_LPHBConfigReq |
| 12153 | \API to make configuration LPHB within FW. |
| 12154 | \param hHal - The handle returned by macOpen |
| 12155 | \param lphdReq - LPHB request argument by client |
| 12156 | \param pCallbackfn - LPHB timeout notification callback function pointer |
| 12157 | \- return Configuration message posting status, SUCCESS or Fail |
| 12158 | -------------------------------------------------------------------------*/ |
| 12159 | eHalStatus sme_LPHBConfigReq |
| 12160 | ( |
| 12161 | tHalHandle hHal, |
| 12162 | tSirLPHBReq *lphdReq, |
| 12163 | void (*pCallbackfn)(void *pAdapter, void *indParam) |
| 12164 | ) |
| 12165 | { |
| 12166 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 12167 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 12168 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 12169 | vos_msg_t vosMessage; |
| 12170 | |
Konamki, Sreelakshmi | 7b464be | 2015-07-14 12:17:01 +0530 | [diff] [blame] | 12171 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 12172 | TRACE_CODE_SME_RX_HDD_LPHB_CONFIG_REQ, |
| 12173 | NO_SESSION, lphdReq->cmd)); |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 12174 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 12175 | if (eHAL_STATUS_SUCCESS == status) |
| 12176 | { |
| 12177 | if ((LPHB_SET_EN_PARAMS_INDID == lphdReq->cmd) && |
| 12178 | (NULL == pCallbackfn) && |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 12179 | (NULL == pMac->sme.pLphbIndCb)) |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 12180 | { |
| 12181 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 12182 | "%s: Indication Call back did not registered", __func__); |
| 12183 | sme_ReleaseGlobalLock(&pMac->sme); |
| 12184 | return eHAL_STATUS_FAILURE; |
| 12185 | } |
| 12186 | else if (NULL != pCallbackfn) |
| 12187 | { |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 12188 | pMac->sme.pLphbIndCb = pCallbackfn; |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 12189 | } |
| 12190 | |
| 12191 | /* serialize the req through MC thread */ |
| 12192 | vosMessage.bodyptr = lphdReq; |
| 12193 | vosMessage.type = WDA_LPHB_CONF_REQ; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 12194 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 12195 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 12196 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 12197 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 12198 | { |
| 12199 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 12200 | "%s: Post Config LPHB MSG fail", __func__); |
| 12201 | status = eHAL_STATUS_FAILURE; |
| 12202 | } |
| 12203 | sme_ReleaseGlobalLock(&pMac->sme); |
| 12204 | } |
| 12205 | |
| 12206 | return(status); |
| 12207 | } |
| 12208 | #endif /* FEATURE_WLAN_LPHB */ |
Sudhir Sattayappa Kohalli | 3762069 | 2013-08-05 14:02:26 -0700 | [diff] [blame] | 12209 | /*-------------------------------------------------------------------------- |
| 12210 | \brief sme_enable_disable_split_scan() - a wrapper function to set the split |
| 12211 | scan parameter. |
| 12212 | This is a synchronous call |
| 12213 | \param hHal - The handle returned by macOpen |
| 12214 | \return NONE. |
| 12215 | \sa |
| 12216 | --------------------------------------------------------------------------*/ |
| 12217 | void sme_enable_disable_split_scan (tHalHandle hHal, tANI_U8 nNumStaChan, |
| 12218 | tANI_U8 nNumP2PChan) |
| 12219 | { |
| 12220 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 12221 | |
| 12222 | pMac->roam.configParam.nNumStaChanCombinedConc = nNumStaChan; |
| 12223 | pMac->roam.configParam.nNumP2PChanCombinedConc = nNumP2PChan; |
| 12224 | |
| 12225 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 12226 | "%s: SCAN nNumStaChanCombinedConc : %d," |
| 12227 | "nNumP2PChanCombinedConc : %d ", |
| 12228 | __func__, nNumStaChan, nNumP2PChan); |
| 12229 | |
| 12230 | return; |
| 12231 | |
| 12232 | } |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 12233 | |
Srinivas Girigowda | d882a85 | 2015-09-29 19:26:23 +0530 | [diff] [blame] | 12234 | /** |
| 12235 | * sme_AddPeriodicTxPtrn() - Add Periodic TX Pattern |
| 12236 | * @hal: global hal handle |
| 12237 | * @addPeriodicTxPtrnParams: request message |
| 12238 | * |
| 12239 | * Return: eHalStatus enumeration |
| 12240 | */ |
| 12241 | eHalStatus |
| 12242 | sme_AddPeriodicTxPtrn(tHalHandle hal, |
| 12243 | struct sSirAddPeriodicTxPtrn *addPeriodicTxPtrnParams) |
Yue Ma | b9c86f4 | 2013-08-14 15:59:08 -0700 | [diff] [blame] | 12244 | { |
Srinivas Girigowda | d882a85 | 2015-09-29 19:26:23 +0530 | [diff] [blame] | 12245 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 12246 | VOS_STATUS vos_status = VOS_STATUS_SUCCESS; |
| 12247 | tpAniSirGlobal mac = PMAC_STRUCT(hal); |
| 12248 | struct sSirAddPeriodicTxPtrn *req_msg; |
Yue Ma | b9c86f4 | 2013-08-14 15:59:08 -0700 | [diff] [blame] | 12249 | vos_msg_t msg; |
| 12250 | |
Srinivas Girigowda | d882a85 | 2015-09-29 19:26:23 +0530 | [diff] [blame] | 12251 | smsLog(mac, LOG1, FL("enter")); |
| 12252 | |
| 12253 | req_msg = vos_mem_malloc(sizeof(*req_msg)); |
| 12254 | if (!req_msg) |
Yue Ma | b9c86f4 | 2013-08-14 15:59:08 -0700 | [diff] [blame] | 12255 | { |
Srinivas Girigowda | d882a85 | 2015-09-29 19:26:23 +0530 | [diff] [blame] | 12256 | smsLog(mac, LOGE, FL("vos_mem_malloc failed")); |
| 12257 | return eHAL_STATUS_FAILED_ALLOC; |
Yue Ma | b9c86f4 | 2013-08-14 15:59:08 -0700 | [diff] [blame] | 12258 | } |
| 12259 | |
Srinivas Girigowda | d882a85 | 2015-09-29 19:26:23 +0530 | [diff] [blame] | 12260 | *req_msg = *addPeriodicTxPtrnParams; |
| 12261 | |
| 12262 | status = sme_AcquireGlobalLock(&mac->sme); |
| 12263 | if (status != eHAL_STATUS_SUCCESS) |
| 12264 | { |
| 12265 | smsLog(mac, LOGE, |
| 12266 | FL("sme_AcquireGlobalLock failed!(status=%d)"), |
| 12267 | status); |
| 12268 | vos_mem_free(req_msg); |
| 12269 | return status; |
| 12270 | } |
| 12271 | |
| 12272 | /* Serialize the req through MC thread */ |
| 12273 | msg.bodyptr = req_msg; |
| 12274 | msg.type = WDA_ADD_PERIODIC_TX_PTRN_IND; |
| 12275 | vos_status = vos_mq_post_message(VOS_MQ_ID_WDA, &msg); |
| 12276 | if (!VOS_IS_STATUS_SUCCESS(vos_status)) |
| 12277 | { |
| 12278 | smsLog(mac, LOGE, |
| 12279 | FL("vos_mq_post_message failed!(err=%d)"), |
| 12280 | vos_status); |
| 12281 | vos_mem_free(req_msg); |
| 12282 | status = eHAL_STATUS_FAILURE; |
| 12283 | } |
| 12284 | sme_ReleaseGlobalLock(&mac->sme); |
Yue Ma | b9c86f4 | 2013-08-14 15:59:08 -0700 | [diff] [blame] | 12285 | return status; |
| 12286 | } |
| 12287 | |
Srinivas Girigowda | d882a85 | 2015-09-29 19:26:23 +0530 | [diff] [blame] | 12288 | |
| 12289 | /** |
| 12290 | * sme_DelPeriodicTxPtrn() - Delete Periodic TX Pattern |
| 12291 | * @hal: global hal handle |
| 12292 | * @delPeriodicTxPtrnParams: request message |
| 12293 | * |
| 12294 | * Return: eHalStatus enumeration |
| 12295 | */ |
| 12296 | eHalStatus |
| 12297 | sme_DelPeriodicTxPtrn(tHalHandle hal, |
| 12298 | struct sSirDelPeriodicTxPtrn *delPeriodicTxPtrnParams) |
Yue Ma | b9c86f4 | 2013-08-14 15:59:08 -0700 | [diff] [blame] | 12299 | { |
Srinivas Girigowda | d882a85 | 2015-09-29 19:26:23 +0530 | [diff] [blame] | 12300 | |
| 12301 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 12302 | VOS_STATUS vos_status = VOS_STATUS_SUCCESS; |
| 12303 | tpAniSirGlobal mac = PMAC_STRUCT(hal); |
| 12304 | struct sSirDelPeriodicTxPtrn *req_msg; |
Yue Ma | b9c86f4 | 2013-08-14 15:59:08 -0700 | [diff] [blame] | 12305 | vos_msg_t msg; |
| 12306 | |
Srinivas Girigowda | d882a85 | 2015-09-29 19:26:23 +0530 | [diff] [blame] | 12307 | smsLog(mac, LOG1, FL("enter")); |
| 12308 | |
| 12309 | req_msg = vos_mem_malloc(sizeof(*req_msg)); |
| 12310 | |
| 12311 | if (!req_msg) |
Yue Ma | b9c86f4 | 2013-08-14 15:59:08 -0700 | [diff] [blame] | 12312 | { |
Srinivas Girigowda | d882a85 | 2015-09-29 19:26:23 +0530 | [diff] [blame] | 12313 | smsLog(mac, LOGE, FL("vos_mem_malloc failed")); |
| 12314 | return eHAL_STATUS_FAILED_ALLOC; |
Yue Ma | b9c86f4 | 2013-08-14 15:59:08 -0700 | [diff] [blame] | 12315 | } |
| 12316 | |
Srinivas Girigowda | d882a85 | 2015-09-29 19:26:23 +0530 | [diff] [blame] | 12317 | *req_msg = *delPeriodicTxPtrnParams; |
| 12318 | |
| 12319 | status = sme_AcquireGlobalLock(&mac->sme); |
| 12320 | if (status != eHAL_STATUS_SUCCESS) |
| 12321 | { |
| 12322 | smsLog(mac, LOGE, |
| 12323 | FL("sme_AcquireGlobalLock failed!(status=%d)"), |
| 12324 | status); |
| 12325 | vos_mem_free(req_msg); |
| 12326 | return status; |
| 12327 | } |
| 12328 | |
| 12329 | /* Serialize the req through MC thread */ |
| 12330 | msg.bodyptr = req_msg; |
| 12331 | msg.type = WDA_DEL_PERIODIC_TX_PTRN_IND; |
| 12332 | vos_status = vos_mq_post_message(VOS_MQ_ID_WDA, &msg); |
| 12333 | if (!VOS_IS_STATUS_SUCCESS(vos_status)) |
| 12334 | { |
| 12335 | smsLog(mac, LOGE, |
| 12336 | FL("vos_mq_post_message failed!(err=%d)"), |
| 12337 | vos_status); |
| 12338 | vos_mem_free(req_msg); |
| 12339 | status = eHAL_STATUS_FAILURE; |
| 12340 | } |
| 12341 | sme_ReleaseGlobalLock(&mac->sme); |
Yue Ma | b9c86f4 | 2013-08-14 15:59:08 -0700 | [diff] [blame] | 12342 | return status; |
| 12343 | } |
| 12344 | |
Abhishek Singh | 00b7197 | 2016-01-07 10:51:04 +0530 | [diff] [blame] | 12345 | #ifdef WLAN_FEATURE_RMC |
| 12346 | /* --------------------------------------------------------------------------- |
| 12347 | \fn sme_EnableRMC |
| 12348 | \brief Used to enable RMC |
| 12349 | setting will not persist over reboots |
| 12350 | \param hHal |
| 12351 | \param sessionId |
| 12352 | \- return eHalStatus |
| 12353 | -------------------------------------------------------------------------*/ |
| 12354 | eHalStatus sme_EnableRMC(tHalHandle hHal, tANI_U32 sessionId) |
| 12355 | { |
| 12356 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 12357 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 12358 | |
| 12359 | smsLog(pMac, LOG1, FL("enable RMC")); |
| 12360 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 12361 | if (HAL_STATUS_SUCCESS(status)) |
| 12362 | { |
| 12363 | status = csrEnableRMC(pMac, sessionId); |
| 12364 | sme_ReleaseGlobalLock(&pMac->sme); |
| 12365 | } |
| 12366 | return status; |
| 12367 | } |
| 12368 | |
| 12369 | /* --------------------------------------------------------------------------- |
| 12370 | \fn sme_DisableRMC |
| 12371 | \brief Used to disable RMC |
| 12372 | setting will not persist over reboots |
| 12373 | \param hHal |
| 12374 | \param sessionId |
| 12375 | \- return eHalStatus |
| 12376 | -------------------------------------------------------------------------*/ |
| 12377 | eHalStatus sme_DisableRMC(tHalHandle hHal, tANI_U32 sessionId) |
| 12378 | { |
| 12379 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 12380 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 12381 | |
| 12382 | smsLog(pMac, LOG1, FL("disable RMC")); |
| 12383 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 12384 | if (HAL_STATUS_SUCCESS(status)) |
| 12385 | { |
| 12386 | status = csrDisableRMC(pMac, sessionId); |
| 12387 | sme_ReleaseGlobalLock(&pMac->sme); |
| 12388 | } |
| 12389 | return status; |
| 12390 | } |
| 12391 | #endif /* WLAN_FEATURE_RMC */ |
| 12392 | |
| 12393 | /* --------------------------------------------------------------------------- |
| 12394 | \fn sme_SendRateUpdateInd |
| 12395 | \brief API to Update rate |
| 12396 | \param hHal - The handle returned by macOpen |
| 12397 | \param rateUpdateParams - Pointer to rate update params |
| 12398 | \return eHalStatus |
| 12399 | ---------------------------------------------------------------------------*/ |
| 12400 | eHalStatus sme_SendRateUpdateInd(tHalHandle hHal, tSirRateUpdateInd *rateUpdateParams) |
| 12401 | { |
| 12402 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 12403 | eHalStatus status; |
| 12404 | vos_msg_t msg; |
| 12405 | |
| 12406 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 12407 | { |
| 12408 | msg.type = WDA_RATE_UPDATE_IND; |
| 12409 | msg.bodyptr = rateUpdateParams; |
| 12410 | |
| 12411 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 12412 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); |
| 12413 | if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 12414 | { |
| 12415 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " |
| 12416 | "to post WDA_SET_RMC_RATE_IND to WDA!", |
| 12417 | __func__); |
| 12418 | |
| 12419 | sme_ReleaseGlobalLock(&pMac->sme); |
| 12420 | return eHAL_STATUS_FAILURE; |
| 12421 | } |
| 12422 | |
| 12423 | sme_ReleaseGlobalLock(&pMac->sme); |
| 12424 | return eHAL_STATUS_SUCCESS; |
| 12425 | } |
| 12426 | |
| 12427 | return status; |
| 12428 | } |
| 12429 | |
| 12430 | #ifdef WLAN_FEATURE_RMC |
| 12431 | /* --------------------------------------------------------------------------- |
| 12432 | \fn sme_GetIBSSPeerInfo |
| 12433 | \brief Used to disable RMC |
| 12434 | setting will not persist over reboots |
| 12435 | \param hHal |
| 12436 | \param ibssPeerInfoReq multicast Group IP address |
| 12437 | \- return eHalStatus |
| 12438 | -------------------------------------------------------------------------*/ |
| 12439 | eHalStatus sme_RequestIBSSPeerInfo(tHalHandle hHal, void *pUserData, |
| 12440 | pIbssPeerInfoCb peerInfoCbk, |
| 12441 | tANI_BOOLEAN allPeerInfoReqd, |
| 12442 | tANI_U8 staIdx) |
| 12443 | { |
| 12444 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 12445 | VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; |
| 12446 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 12447 | vos_msg_t vosMessage; |
| 12448 | tSirIbssGetPeerInfoReqParams *pIbssInfoReqParams; |
| 12449 | |
| 12450 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 12451 | if ( eHAL_STATUS_SUCCESS == status) |
| 12452 | { |
| 12453 | pMac->sme.peerInfoParams.peerInfoCbk = peerInfoCbk; |
| 12454 | pMac->sme.peerInfoParams.pUserData = pUserData; |
| 12455 | |
| 12456 | pIbssInfoReqParams = (tSirIbssGetPeerInfoReqParams *) |
| 12457 | vos_mem_malloc(sizeof(tSirIbssGetPeerInfoReqParams)); |
| 12458 | if (NULL == pIbssInfoReqParams) |
| 12459 | { |
| 12460 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 12461 | "%s: Not able to allocate memory for dhcp start", __func__); |
| 12462 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 12463 | return eHAL_STATUS_FAILURE; |
| 12464 | } |
| 12465 | pIbssInfoReqParams->allPeerInfoReqd = allPeerInfoReqd; |
| 12466 | pIbssInfoReqParams->staIdx = staIdx; |
| 12467 | |
| 12468 | vosMessage.type = WDA_GET_IBSS_PEER_INFO_REQ; |
| 12469 | vosMessage.bodyptr = pIbssInfoReqParams; |
| 12470 | vosMessage.reserved = 0; |
| 12471 | |
| 12472 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 12473 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
| 12474 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 12475 | if ( VOS_STATUS_SUCCESS != vosStatus ) |
| 12476 | { |
| 12477 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 12478 | "%s: Post WDA_GET_IBSS_PEER_INFO_REQ MSG failed", __func__); |
| 12479 | vos_mem_free(pIbssInfoReqParams); |
| 12480 | vosStatus = eHAL_STATUS_FAILURE; |
| 12481 | } |
| 12482 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 12483 | } |
| 12484 | |
| 12485 | return (vosStatus); |
| 12486 | } |
| 12487 | #endif |
| 12488 | |
Tushnim Bhattacharyya | ad37df1 | 2013-10-02 12:01:33 -0700 | [diff] [blame] | 12489 | void smeGetCommandQStatus( tHalHandle hHal ) |
| 12490 | { |
| 12491 | tSmeCmd *pTempCmd = NULL; |
| 12492 | tListElem *pEntry; |
| 12493 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 12494 | |
| 12495 | if (NULL == pMac) |
| 12496 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 12497 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 12498 | "%s: pMac is null", __func__); |
Tushnim Bhattacharyya | ad37df1 | 2013-10-02 12:01:33 -0700 | [diff] [blame] | 12499 | return; |
| 12500 | } |
| 12501 | |
| 12502 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK ); |
| 12503 | if( pEntry ) |
| 12504 | { |
| 12505 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 12506 | } |
| 12507 | smsLog( pMac, LOGE, "Currently smeCmdActiveList has command (0x%X)", |
| 12508 | (pTempCmd) ? pTempCmd->command : eSmeNoCommand ); |
| 12509 | if(pTempCmd) |
| 12510 | { |
| 12511 | if( eSmeCsrCommandMask & pTempCmd->command ) |
| 12512 | { |
| 12513 | //CSR command is stuck. See what the reason code is for that command |
| 12514 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 12515 | } |
| 12516 | } //if(pTempCmd) |
| 12517 | |
| 12518 | smsLog( pMac, LOGE, "Currently smeCmdPendingList has %d commands", |
| 12519 | csrLLCount(&pMac->sme.smeCmdPendingList)); |
| 12520 | |
| 12521 | smsLog( pMac, LOGE, "Currently roamCmdPendingList has %d commands", |
| 12522 | csrLLCount(&pMac->roam.roamCmdPendingList)); |
| 12523 | |
| 12524 | return; |
| 12525 | } |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 12526 | |
| 12527 | #ifdef FEATURE_WLAN_BATCH_SCAN |
| 12528 | /* --------------------------------------------------------------------------- |
| 12529 | \fn sme_SetBatchScanReq |
| 12530 | \brief API to set batch scan request in FW |
| 12531 | \param hHal - The handle returned by macOpen. |
| 12532 | \param pRequest - Pointer to the batch request. |
| 12533 | \param sessionId - session ID |
| 12534 | \param callbackRoutine - HDD callback which needs to be invoked after |
| 12535 | getting set batch scan response from FW |
| 12536 | \param callbackContext - pAdapter context |
| 12537 | \return eHalStatus |
| 12538 | ---------------------------------------------------------------------------*/ |
| 12539 | eHalStatus sme_SetBatchScanReq |
| 12540 | ( |
| 12541 | tHalHandle hHal, tSirSetBatchScanReq *pRequest, tANI_U8 sessionId, |
| 12542 | void (*callbackRoutine) (void *callbackCtx, tSirSetBatchScanRsp *pRsp), |
| 12543 | void *callbackContext |
| 12544 | ) |
| 12545 | { |
| 12546 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 12547 | eHalStatus status; |
| 12548 | |
Yue Ma | e36e355 | 2014-03-05 17:06:20 -0800 | [diff] [blame] | 12549 | if (!pMac) |
| 12550 | { |
| 12551 | return eHAL_STATUS_FAILURE; |
| 12552 | } |
| 12553 | |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 12554 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 12555 | { |
| 12556 | status = pmcSetBatchScanReq(hHal, pRequest, sessionId, callbackRoutine, |
| 12557 | callbackContext); |
| 12558 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 12559 | } |
| 12560 | |
| 12561 | return status; |
| 12562 | } |
| 12563 | |
| 12564 | /* --------------------------------------------------------------------------- |
| 12565 | \fn sme_TriggerBatchScanResultInd |
| 12566 | \brief API to trigger batch scan result indications from FW |
| 12567 | \param hHal - The handle returned by macOpen. |
| 12568 | \param pRequest - Pointer to get batch request. |
| 12569 | \param sessionId - session ID |
| 12570 | \param callbackRoutine - HDD callback which needs to be invoked after |
| 12571 | getting batch scan result indication from FW |
| 12572 | \param callbackContext - pAdapter context |
| 12573 | \return eHalStatus |
| 12574 | ---------------------------------------------------------------------------*/ |
| 12575 | eHalStatus sme_TriggerBatchScanResultInd |
| 12576 | ( |
| 12577 | tHalHandle hHal, tSirTriggerBatchScanResultInd *pRequest, tANI_U8 sessionId, |
| 12578 | void (*callbackRoutine) (void *callbackCtx, void *pRsp), |
| 12579 | void *callbackContext |
| 12580 | ) |
| 12581 | { |
| 12582 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 12583 | eHalStatus status; |
| 12584 | |
| 12585 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 12586 | { |
| 12587 | status = pmcTriggerBatchScanResultInd(hHal, pRequest, sessionId, |
| 12588 | callbackRoutine, callbackContext); |
| 12589 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 12590 | } |
| 12591 | |
| 12592 | return status; |
| 12593 | } |
| 12594 | |
| 12595 | |
| 12596 | /* --------------------------------------------------------------------------- |
| 12597 | \fn sme_StopBatchScanInd |
| 12598 | \brief API to stop batch scan request in FW |
| 12599 | \param hHal - The handle returned by macOpen. |
| 12600 | \param pRequest - Pointer to the batch request. |
| 12601 | \param sessionId - session ID |
| 12602 | \return eHalStatus |
| 12603 | ---------------------------------------------------------------------------*/ |
| 12604 | eHalStatus sme_StopBatchScanInd |
| 12605 | ( |
| 12606 | tHalHandle hHal, tSirStopBatchScanInd *pRequest, tANI_U8 sessionId |
| 12607 | ) |
| 12608 | { |
| 12609 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 12610 | eHalStatus status; |
| 12611 | |
| 12612 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 12613 | { |
| 12614 | status = pmcStopBatchScanInd(hHal, pRequest, sessionId); |
| 12615 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 12616 | } |
| 12617 | |
| 12618 | return status; |
| 12619 | } |
| 12620 | |
| 12621 | #endif |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 12622 | |
Abhishek Singh | 30fd58c | 2015-07-15 14:19:21 +0530 | [diff] [blame] | 12623 | void activeListCmdTimeoutHandle(void *userData) |
| 12624 | { |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 12625 | tHalHandle hHal= (tHalHandle) userData; |
| 12626 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Abhishek Singh | 55a2442 | 2016-02-04 18:18:04 +0530 | [diff] [blame] | 12627 | tListElem *pEntry; |
| 12628 | tSmeCmd *pTempCmd = NULL; |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 12629 | |
| 12630 | if (NULL == pMac) |
| 12631 | { |
| 12632 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 12633 | "%s: pMac is null", __func__); |
| 12634 | return; |
| 12635 | } |
Abhishek Singh | 30fd58c | 2015-07-15 14:19:21 +0530 | [diff] [blame] | 12636 | /* Return if no cmd pending in active list as |
| 12637 | * in this case we should not be here. |
| 12638 | */ |
| 12639 | if ((NULL == userData) || |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 12640 | (0 == csrLLCount(&pMac->sme.smeCmdActiveList))) |
Abhishek Singh | 30fd58c | 2015-07-15 14:19:21 +0530 | [diff] [blame] | 12641 | return; |
| 12642 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 12643 | "%s: Active List command timeout Cmd List Count %d", __func__, |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 12644 | csrLLCount(&pMac->sme.smeCmdActiveList) ); |
| 12645 | smeGetCommandQStatus(hHal); |
Abhishek Singh | 30fd58c | 2015-07-15 14:19:21 +0530 | [diff] [blame] | 12646 | |
Padma, Santhosh Kumar | 9093b20 | 2015-07-21 15:37:38 +0530 | [diff] [blame] | 12647 | vos_state_info_dump_all(); |
| 12648 | |
Abhishek Singh | 55a2442 | 2016-02-04 18:18:04 +0530 | [diff] [blame] | 12649 | |
| 12650 | pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK); |
| 12651 | if (pEntry) { |
| 12652 | pTempCmd = GET_BASE_ADDR(pEntry, tSmeCmd, Link); |
| 12653 | } |
| 12654 | /* If user initiated scan took more than active list timeout |
| 12655 | * abort it. |
| 12656 | */ |
| 12657 | if (pTempCmd && (eSmeCommandScan == pTempCmd->command) && |
| 12658 | (eCsrScanUserRequest == pTempCmd->u.scanCmd.reason)) { |
| 12659 | sme_AbortMacScan(hHal, pTempCmd->sessionId, |
| 12660 | eCSR_SCAN_ABORT_DEFAULT); |
| 12661 | return; |
Gupta, Kapil | 35756d6 | 2016-03-17 14:19:32 +0530 | [diff] [blame] | 12662 | } else if (pTempCmd && |
| 12663 | (eSmeCommandRemainOnChannel == pTempCmd->command)) { |
| 12664 | /* Ignore if ROC took more than 120 sec */ |
| 12665 | return; |
Abhishek Singh | 55a2442 | 2016-02-04 18:18:04 +0530 | [diff] [blame] | 12666 | } |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 12667 | if (pMac->roam.configParam.enableFatalEvent) |
| 12668 | { |
| 12669 | vos_fatal_event_logs_req(WLAN_LOG_TYPE_FATAL, |
| 12670 | WLAN_LOG_INDICATOR_HOST_DRIVER, |
| 12671 | WLAN_LOG_REASON_SME_COMMAND_STUCK, |
Abhishek Singh | 4eaf679 | 2016-02-04 12:36:39 +0530 | [diff] [blame] | 12672 | FALSE, FALSE); |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 12673 | } |
| 12674 | else |
| 12675 | { |
Abhishek Singh | 1fb64af | 2015-10-05 18:12:48 +0530 | [diff] [blame] | 12676 | /* Initiate SSR to recover */ |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 12677 | if (!(vos_isLoadUnloadInProgress() || |
| 12678 | vos_is_logp_in_progress(VOS_MODULE_ID_SME, NULL))) |
Abhishek Singh | c7d6fbc | 2015-10-19 12:14:41 +0530 | [diff] [blame] | 12679 | { |
Abhishek Singh | 1fb64af | 2015-10-05 18:12:48 +0530 | [diff] [blame] | 12680 | vos_wlanRestart(); |
Abhishek Singh | c7d6fbc | 2015-10-19 12:14:41 +0530 | [diff] [blame] | 12681 | } |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 12682 | } |
Abhishek Singh | 30fd58c | 2015-07-15 14:19:21 +0530 | [diff] [blame] | 12683 | } |
| 12684 | |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 12685 | #ifdef FEATURE_WLAN_CH_AVOID |
| 12686 | /* --------------------------------------------------------------------------- |
| 12687 | \fn sme_AddChAvoidCallback |
| 12688 | \brief Used to plug in callback function |
| 12689 | Which notify channel may not be used with SAP or P2PGO mode. |
| 12690 | Notification come from FW. |
| 12691 | \param hHal |
| 12692 | \param pCallbackfn : callback function pointer should be plugged in |
| 12693 | \- return eHalStatus |
| 12694 | -------------------------------------------------------------------------*/ |
| 12695 | eHalStatus sme_AddChAvoidCallback |
| 12696 | ( |
| 12697 | tHalHandle hHal, |
| 12698 | void (*pCallbackfn)(void *pAdapter, void *indParam) |
| 12699 | ) |
| 12700 | { |
| 12701 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 12702 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 12703 | |
| 12704 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 12705 | "%s: Plug in CH AVOID CB", __func__); |
| 12706 | |
| 12707 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 12708 | if (eHAL_STATUS_SUCCESS == status) |
| 12709 | { |
| 12710 | if (NULL != pCallbackfn) |
| 12711 | { |
| 12712 | pMac->sme.pChAvoidNotificationCb = pCallbackfn; |
| 12713 | } |
| 12714 | sme_ReleaseGlobalLock(&pMac->sme); |
| 12715 | } |
| 12716 | |
| 12717 | return(status); |
| 12718 | } |
| 12719 | #endif /* FEATURE_WLAN_CH_AVOID */ |
| 12720 | |
Gupta, Kapil | 7c34b32 | 2015-09-30 13:12:35 +0530 | [diff] [blame] | 12721 | |
| 12722 | /** |
| 12723 | * sme_set_rssi_threshold_breached_cb() - set rssi threshold breached callback |
| 12724 | * @hal: global hal handle |
| 12725 | * @cb: callback function pointer |
| 12726 | * |
| 12727 | * This function stores the rssi threshold breached callback function. |
| 12728 | * |
| 12729 | * Return: eHalStatus enumeration. |
| 12730 | */ |
| 12731 | eHalStatus sme_set_rssi_threshold_breached_cb(tHalHandle hal, |
| 12732 | void (*cb)(void *, struct rssi_breach_event *)) |
| 12733 | { |
| 12734 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 12735 | tpAniSirGlobal mac = PMAC_STRUCT(hal); |
| 12736 | |
| 12737 | status = sme_AcquireGlobalLock(&mac->sme); |
| 12738 | if (status != eHAL_STATUS_SUCCESS) { |
| 12739 | smsLog(mac, LOGE, |
| 12740 | FL("sme_AcquireGlobalLock failed!(status=%d)"), |
| 12741 | status); |
| 12742 | return status; |
| 12743 | } |
| 12744 | |
| 12745 | mac->sme.rssiThresholdBreachedCb = cb; |
| 12746 | sme_ReleaseGlobalLock(&mac->sme); |
| 12747 | return status; |
| 12748 | } |
| 12749 | |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12750 | #ifdef WLAN_FEATURE_LINK_LAYER_STATS |
| 12751 | |
| 12752 | /* --------------------------------------------------------------------------- |
| 12753 | \fn sme_LLStatsSetReq |
| 12754 | \brief API to set link layer stats request to FW |
| 12755 | \param hHal - The handle returned by macOpen. |
| 12756 | |
| 12757 | \Param pStatsReq - a pointer to a caller allocated object of |
| 12758 | typedef struct tSirLLStatsSetReq, signifying the parameters to link layer |
| 12759 | stats set. |
| 12760 | |
| 12761 | \return eHalStatus |
| 12762 | ---------------------------------------------------------------------------*/ |
| 12763 | eHalStatus sme_LLStatsSetReq(tHalHandle hHal, |
| 12764 | tSirLLStatsSetReq *pLinkLayerStatsSetReq) |
| 12765 | { |
| 12766 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 12767 | vos_msg_t msg; |
| 12768 | eHalStatus status = eHAL_STATUS_FAILURE; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 12769 | tSirLLStatsSetReq *plinkLayerSetReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12770 | |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 12771 | plinkLayerSetReq = vos_mem_malloc(sizeof(*plinkLayerSetReq)); |
| 12772 | if ( !plinkLayerSetReq) |
| 12773 | { |
| 12774 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 12775 | "%s: Not able to allocate memory for " |
| 12776 | "WDA_LINK_LAYER_STATS_SET_REQ", |
| 12777 | __func__); |
| 12778 | return eHAL_STATUS_FAILURE; |
| 12779 | } |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12780 | |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 12781 | *plinkLayerSetReq = *pLinkLayerStatsSetReq; |
| 12782 | |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12783 | |
| 12784 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 12785 | { |
| 12786 | msg.type = WDA_LINK_LAYER_STATS_SET_REQ; |
| 12787 | msg.reserved = 0; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 12788 | msg.bodyptr = plinkLayerSetReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12789 | |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 12790 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 12791 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12792 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 12793 | { |
| 12794 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 12795 | "Not able to post SIR_HAL_LL_STATS_SET message to HAL", __func__); |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 12796 | vos_mem_free(plinkLayerSetReq); |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12797 | status = eHAL_STATUS_FAILURE; |
| 12798 | } |
| 12799 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 12800 | } |
| 12801 | else |
| 12802 | { |
| 12803 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 12804 | "sme_AcquireGlobalLock error", __func__); |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 12805 | vos_mem_free(plinkLayerSetReq); |
| 12806 | status = eHAL_STATUS_FAILURE; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12807 | } |
| 12808 | return status; |
| 12809 | } |
| 12810 | |
| 12811 | /* --------------------------------------------------------------------------- |
| 12812 | \fn sme_LLStatsGetReq |
| 12813 | \brief API to get link layer stats request to FW |
| 12814 | \param hHal - The handle returned by macOpen. |
| 12815 | |
| 12816 | \Param pStatsReq - a pointer to a caller allocated object of |
| 12817 | typedef struct tSirLLStatsGetReq, signifying the parameters to link layer |
| 12818 | stats get. |
| 12819 | |
| 12820 | \return eHalStatus |
| 12821 | ---------------------------------------------------------------------------*/ |
| 12822 | eHalStatus sme_LLStatsGetReq(tHalHandle hHal, |
| 12823 | tSirLLStatsGetReq *pLinkLayerStatsGetReq) |
| 12824 | { |
| 12825 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 12826 | vos_msg_t msg; |
| 12827 | eHalStatus status = eHAL_STATUS_FAILURE; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 12828 | tSirLLStatsGetReq *pGetStatsReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12829 | |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 12830 | pGetStatsReq = vos_mem_malloc(sizeof(*pGetStatsReq)); |
| 12831 | if ( !pGetStatsReq) |
| 12832 | { |
| 12833 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 12834 | "%s: Not able to allocate memory for " |
| 12835 | "WDA_LINK_LAYER_STATS_GET_REQ", |
| 12836 | __func__); |
| 12837 | return eHAL_STATUS_FAILURE; |
| 12838 | } |
| 12839 | *pGetStatsReq = *pLinkLayerStatsGetReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12840 | |
| 12841 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 12842 | { |
| 12843 | msg.type = WDA_LINK_LAYER_STATS_GET_REQ; |
| 12844 | msg.reserved = 0; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 12845 | msg.bodyptr = pGetStatsReq; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 12846 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 12847 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12848 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 12849 | { |
| 12850 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 12851 | "Not able to post SIR_HAL_LL_STATS_GET message to HAL", __func__); |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 12852 | vos_mem_free(pGetStatsReq); |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12853 | status = eHAL_STATUS_FAILURE; |
| 12854 | } |
| 12855 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 12856 | } |
| 12857 | else |
| 12858 | { |
| 12859 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 12860 | "sme_AcquireGlobalLock error", __func__); |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 12861 | vos_mem_free(pGetStatsReq); |
| 12862 | status = eHAL_STATUS_FAILURE; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12863 | } |
| 12864 | return status; |
| 12865 | } |
| 12866 | |
| 12867 | /* --------------------------------------------------------------------------- |
| 12868 | \fn sme_LLStatsClearReq |
| 12869 | \brief API to clear link layer stats request to FW |
| 12870 | \param hHal - The handle returned by macOpen. |
| 12871 | |
| 12872 | \Param pStatsReq - a pointer to a caller allocated object of |
| 12873 | typedef struct tSirLLStatsClearReq, signifying the parameters to link layer |
| 12874 | stats clear. |
| 12875 | |
| 12876 | \return eHalStatus |
| 12877 | ---------------------------------------------------------------------------*/ |
| 12878 | eHalStatus sme_LLStatsClearReq(tHalHandle hHal, |
| 12879 | tSirLLStatsClearReq *pLinkLayerStatsClear) |
| 12880 | { |
| 12881 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 12882 | vos_msg_t msg; |
| 12883 | eHalStatus status = eHAL_STATUS_FAILURE; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 12884 | tSirLLStatsClearReq *pClearStatsReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12885 | |
| 12886 | |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12887 | |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 12888 | pClearStatsReq = vos_mem_malloc(sizeof(*pClearStatsReq)); |
| 12889 | if ( !pClearStatsReq) |
| 12890 | { |
| 12891 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 12892 | "%s: Not able to allocate memory for " |
| 12893 | "WDA_LINK_LAYER_STATS_CLEAR_REQ", |
| 12894 | __func__); |
| 12895 | return eHAL_STATUS_FAILURE; |
| 12896 | } |
| 12897 | |
| 12898 | *pClearStatsReq = *pLinkLayerStatsClear; |
| 12899 | |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12900 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 12901 | { |
| 12902 | msg.type = WDA_LINK_LAYER_STATS_CLEAR_REQ; |
| 12903 | msg.reserved = 0; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 12904 | msg.bodyptr = pClearStatsReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12905 | |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 12906 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 12907 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12908 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 12909 | { |
| 12910 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 12911 | "Not able to post SIR_HAL_LL_STATS_CLEAR message to HAL", __func__); |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 12912 | vos_mem_free(pClearStatsReq); |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12913 | status = eHAL_STATUS_FAILURE; |
| 12914 | } |
| 12915 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 12916 | } |
| 12917 | else |
| 12918 | { |
| 12919 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 12920 | "sme_AcquireGlobalLock error", __func__); |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 12921 | vos_mem_free(pClearStatsReq); |
| 12922 | status = eHAL_STATUS_FAILURE; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12923 | } |
| 12924 | |
| 12925 | return status; |
| 12926 | } |
| 12927 | |
| 12928 | /* --------------------------------------------------------------------------- |
| 12929 | \fn sme_SetLinkLayerStatsIndCB |
| 12930 | \brief API to trigger Link Layer Statistic indications from FW |
| 12931 | \param hHal - The handle returned by macOpen. |
| 12932 | \param sessionId - session ID |
| 12933 | \param callbackRoutine - HDD callback which needs to be invoked after |
| 12934 | getting Link Layer Statistics from FW |
| 12935 | \param callbackContext - pAdapter context |
| 12936 | \return eHalStatus |
| 12937 | ---------------------------------------------------------------------------*/ |
| 12938 | eHalStatus sme_SetLinkLayerStatsIndCB |
| 12939 | ( |
Dino Mycle | d3d5002 | 2014-07-07 12:58:25 +0530 | [diff] [blame] | 12940 | tHalHandle hHal, |
| 12941 | void (*callbackRoutine) (void *callbackCtx, int indType, void *pRsp, |
| 12942 | tANI_U8 *macAddr) |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12943 | ) |
| 12944 | { |
| 12945 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 12946 | eHalStatus status; |
| 12947 | |
| 12948 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 12949 | { |
| 12950 | if (NULL != callbackRoutine) |
| 12951 | { |
| 12952 | pMac->sme.pLinkLayerStatsIndCallback = callbackRoutine; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 12953 | } |
| 12954 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 12955 | } |
| 12956 | |
| 12957 | return status; |
| 12958 | } |
| 12959 | #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ |
| 12960 | |
Sachin Ahuja | 3d47fcd | 2015-08-28 16:02:06 +0530 | [diff] [blame] | 12961 | |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 12962 | eHalStatus sme_UpdateConnectDebug(tHalHandle hHal, tANI_U32 set_value) |
| 12963 | { |
| 12964 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 12965 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 12966 | pMac->fEnableDebugLog = set_value; |
| 12967 | return (status); |
| 12968 | } |
| 12969 | |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 12970 | VOS_STATUS sme_UpdateDSCPtoUPMapping( tHalHandle hHal, |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 12971 | sme_QosWmmUpType *dscpmapping, |
| 12972 | v_U8_t sessionId ) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 12973 | { |
| 12974 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 12975 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 12976 | v_U8_t i, j, peSessionId; |
| 12977 | tCsrRoamSession *pCsrSession = NULL; |
| 12978 | tpPESession pSession = NULL; |
| 12979 | |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 12980 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 12981 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 12982 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 12983 | pCsrSession = CSR_GET_SESSION( pMac, sessionId ); |
| 12984 | |
| 12985 | if (pCsrSession == NULL) |
| 12986 | { |
| 12987 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 12988 | "%s: CSR Session lookup fails %u", __func__, sessionId); |
| 12989 | sme_ReleaseGlobalLock( &pMac->sme); |
| 12990 | return eHAL_STATUS_FAILURE; |
| 12991 | } |
| 12992 | |
Ratheesh S P | e8f00c6 | 2015-08-20 13:03:01 +0530 | [diff] [blame] | 12993 | if (!CSR_IS_SESSION_VALID( pMac, sessionId )) |
| 12994 | { |
| 12995 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 12996 | "%s: Invalid session Id %u", __func__, sessionId); |
| 12997 | sme_ReleaseGlobalLock( &pMac->sme); |
| 12998 | return eHAL_STATUS_FAILURE; |
| 12999 | } |
| 13000 | |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 13001 | pSession = peFindSessionByBssid( pMac, |
| 13002 | pCsrSession->connectedProfile.bssid, &peSessionId ); |
| 13003 | |
| 13004 | if (pSession == NULL) |
| 13005 | { |
| 13006 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13007 | "%s: Session lookup fails for BSSID", __func__); |
| 13008 | sme_ReleaseGlobalLock( &pMac->sme); |
| 13009 | return eHAL_STATUS_FAILURE; |
| 13010 | } |
| 13011 | |
| 13012 | if ( !pSession->QosMapSet.present ) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 13013 | { |
Ratheesh S P | 36dbc93 | 2015-08-07 14:28:57 +0530 | [diff] [blame] | 13014 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 13015 | "%s: QOS Mapping IE not present", __func__); |
| 13016 | sme_ReleaseGlobalLock( &pMac->sme); |
| 13017 | return eHAL_STATUS_FAILURE; |
| 13018 | } |
| 13019 | else |
| 13020 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 13021 | for (i = 0; i < SME_QOS_WMM_UP_MAX; i++) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 13022 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 13023 | for (j = pSession->QosMapSet.dscp_range[i][0]; |
| 13024 | j <= pSession->QosMapSet.dscp_range[i][1]; j++) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 13025 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 13026 | if ((pSession->QosMapSet.dscp_range[i][0] == 255) && |
| 13027 | (pSession->QosMapSet.dscp_range[i][1] == 255)) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 13028 | { |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 13029 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Deepthi Gowri | 942d3e8 | 2016-06-10 18:32:37 +0530 | [diff] [blame] | 13030 | "%s: User Priority %d is not used in mapping", |
| 13031 | __func__, i); |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 13032 | break; |
| 13033 | } |
| 13034 | else |
| 13035 | { |
| 13036 | dscpmapping[j]= i; |
| 13037 | } |
| 13038 | } |
| 13039 | } |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 13040 | for (i = 0; i< pSession->QosMapSet.num_dscp_exceptions; i++) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 13041 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 13042 | if (pSession->QosMapSet.dscp_exceptions[i][0] != 255) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 13043 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 13044 | dscpmapping[pSession->QosMapSet.dscp_exceptions[i][0] ] = |
| 13045 | pSession->QosMapSet.dscp_exceptions[i][1]; |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 13046 | } |
| 13047 | } |
| 13048 | } |
| 13049 | } |
| 13050 | sme_ReleaseGlobalLock( &pMac->sme); |
| 13051 | return status; |
| 13052 | } |
Agarwal Ashish | 5e41479 | 2014-06-08 15:25:23 +0530 | [diff] [blame] | 13053 | |
Agarwal Ashish | 5e41479 | 2014-06-08 15:25:23 +0530 | [diff] [blame] | 13054 | tANI_BOOLEAN sme_Is11dCountrycode(tHalHandle hHal) |
| 13055 | { |
| 13056 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 13057 | |
| 13058 | if (VOS_TRUE == vos_mem_compare(pMac->scan.countryCodeCurrent, |
| 13059 | pMac->scan.countryCode11d, 2)) |
| 13060 | { |
| 13061 | return eANI_BOOLEAN_TRUE; |
| 13062 | } |
| 13063 | else |
| 13064 | { |
| 13065 | return eANI_BOOLEAN_FALSE; |
| 13066 | } |
| 13067 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13068 | |
Siddharth Bhal | d8a95e8 | 2015-02-12 20:14:52 +0530 | [diff] [blame] | 13069 | eHalStatus sme_SpoofMacAddrReq(tHalHandle hHal, v_MACADDR_t *macaddr) |
Siddharth Bhal | 6af5d4e | 2014-09-29 21:11:16 +0530 | [diff] [blame] | 13070 | { |
Siddharth Bhal | d8a95e8 | 2015-02-12 20:14:52 +0530 | [diff] [blame] | 13071 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 13072 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 13073 | tSmeCmd *pMacSpoofCmd; |
Siddharth Bhal | 6af5d4e | 2014-09-29 21:11:16 +0530 | [diff] [blame] | 13074 | |
mukul sharma | ca8e432 | 2015-07-20 18:33:43 +0530 | [diff] [blame] | 13075 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 13076 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 13077 | { |
| 13078 | pMacSpoofCmd = csrGetCommandBuffer(pMac); |
| 13079 | if (pMacSpoofCmd) |
Siddharth Bhal | d8a95e8 | 2015-02-12 20:14:52 +0530 | [diff] [blame] | 13080 | { |
mukul sharma | ca8e432 | 2015-07-20 18:33:43 +0530 | [diff] [blame] | 13081 | pMacSpoofCmd->command = eSmeCommandMacSpoofRequest; |
| 13082 | vos_mem_set(&pMacSpoofCmd->u.macAddrSpoofCmd, |
| 13083 | sizeof(tSirSpoofMacAddrReq), 0); |
| 13084 | vos_mem_copy(pMacSpoofCmd->u.macAddrSpoofCmd.macAddr, |
| 13085 | macaddr->bytes, VOS_MAC_ADDRESS_LEN); |
Siddharth Bhal | 6af5d4e | 2014-09-29 21:11:16 +0530 | [diff] [blame] | 13086 | |
Abhishek Singh | 06c4b8b | 2016-04-05 10:27:07 +0530 | [diff] [blame] | 13087 | status = csrQueueSmeCommand(pMac, pMacSpoofCmd, false); |
mukul sharma | ca8e432 | 2015-07-20 18:33:43 +0530 | [diff] [blame] | 13088 | if ( !HAL_STATUS_SUCCESS( status ) ) |
| 13089 | { |
| 13090 | smsLog( pMac, LOGE, FL("fail to send msg status = %d\n"), status ); |
Abhishek Singh | 06c4b8b | 2016-04-05 10:27:07 +0530 | [diff] [blame] | 13091 | csrReleaseCommand(pMac, pMacSpoofCmd); |
mukul sharma | ca8e432 | 2015-07-20 18:33:43 +0530 | [diff] [blame] | 13092 | } |
| 13093 | } |
| 13094 | else |
| 13095 | { |
| 13096 | //log error |
| 13097 | smsLog(pMac, LOGE, FL("can not obtain a common buffer\n")); |
| 13098 | status = eHAL_STATUS_RESOURCES; |
| 13099 | } |
| 13100 | sme_ReleaseGlobalLock( &pMac->sme); |
| 13101 | } |
Siddharth Bhal | d8a95e8 | 2015-02-12 20:14:52 +0530 | [diff] [blame] | 13102 | return (status); |
Siddharth Bhal | 6af5d4e | 2014-09-29 21:11:16 +0530 | [diff] [blame] | 13103 | } |
| 13104 | |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13105 | #ifdef WLAN_FEATURE_EXTSCAN |
| 13106 | /* --------------------------------------------------------------------------- |
| 13107 | \fn sme_GetValidChannelsByBand |
| 13108 | \brief SME API to fetch all valid channel filtered by band |
| 13109 | \param hHal |
| 13110 | \param wifiBand: RF band information |
| 13111 | \param aValidChannels: Array to store channel info |
| 13112 | \param len: number of channels |
| 13113 | \- return eHalStatus |
| 13114 | -------------------------------------------------------------------------*/ |
| 13115 | eHalStatus sme_GetValidChannelsByBand (tHalHandle hHal, tANI_U8 wifiBand, |
| 13116 | tANI_U32 *aValidChannels, tANI_U8 *pNumChannels) |
| 13117 | { |
| 13118 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 13119 | tANI_U8 chanList[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0}; |
| 13120 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 13121 | tANI_U8 numChannels = 0; |
| 13122 | tANI_U8 i = 0; |
| 13123 | tANI_U32 totValidChannels = WNI_CFG_VALID_CHANNEL_LIST_LEN; |
| 13124 | |
| 13125 | if (!aValidChannels || !pNumChannels) { |
| 13126 | smsLog(pMac, VOS_TRACE_LEVEL_ERROR, |
| 13127 | FL("Output channel list/NumChannels is NULL")); |
| 13128 | return eHAL_STATUS_INVALID_PARAMETER; |
| 13129 | } |
| 13130 | |
| 13131 | if ((wifiBand < WIFI_BAND_UNSPECIFIED) || (wifiBand >= WIFI_BAND_MAX)) { |
| 13132 | smsLog(pMac, VOS_TRACE_LEVEL_ERROR, |
| 13133 | FL("Invalid wifiBand (%d)"), wifiBand); |
| 13134 | return eHAL_STATUS_INVALID_PARAMETER; |
| 13135 | } |
| 13136 | |
| 13137 | status = sme_GetCfgValidChannels(hHal, &chanList[0], |
| 13138 | &totValidChannels); |
| 13139 | if (!HAL_STATUS_SUCCESS(status)) { |
| 13140 | smsLog(pMac, VOS_TRACE_LEVEL_ERROR, |
| 13141 | FL("Failed to get valid channel list (err=%d)"), status); |
| 13142 | return status; |
| 13143 | } |
| 13144 | |
| 13145 | switch (wifiBand) { |
| 13146 | case WIFI_BAND_UNSPECIFIED: |
| 13147 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, FL("Unspecified wifiBand, " |
| 13148 | "return all (%d) valid channels"), totValidChannels); |
| 13149 | numChannels = totValidChannels; |
| 13150 | for (i = 0; i < numChannels; i++) |
| 13151 | aValidChannels[i] = vos_chan_to_freq(chanList[i]); |
| 13152 | break; |
| 13153 | |
| 13154 | case WIFI_BAND_BG: |
| 13155 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, FL("WIFI_BAND_BG (2.4 GHz)")); |
| 13156 | for (i = 0; i < totValidChannels; i++) |
| 13157 | if (CSR_IS_CHANNEL_24GHZ(chanList[i])) |
| 13158 | aValidChannels[numChannels++] = |
| 13159 | vos_chan_to_freq(chanList[i]); |
| 13160 | break; |
| 13161 | |
| 13162 | case WIFI_BAND_A: |
| 13163 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, |
| 13164 | FL("WIFI_BAND_A (5 GHz without DFS)")); |
| 13165 | for (i = 0; i < totValidChannels; i++) |
| 13166 | if (CSR_IS_CHANNEL_5GHZ(chanList[i]) && |
| 13167 | !CSR_IS_CHANNEL_DFS(chanList[i])) |
| 13168 | aValidChannels[numChannels++] = |
| 13169 | vos_chan_to_freq(chanList[i]); |
| 13170 | break; |
| 13171 | |
| 13172 | case WIFI_BAND_ABG: |
| 13173 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, |
| 13174 | FL("WIFI_BAND_ABG (2.4 GHz + 5 GHz; no DFS)")); |
| 13175 | for (i = 0; i < totValidChannels; i++) |
| 13176 | if ((CSR_IS_CHANNEL_24GHZ(chanList[i]) || |
| 13177 | CSR_IS_CHANNEL_5GHZ(chanList[i])) && |
| 13178 | !CSR_IS_CHANNEL_DFS(chanList[i])) |
| 13179 | aValidChannels[numChannels++] = |
| 13180 | vos_chan_to_freq(chanList[i]); |
| 13181 | break; |
| 13182 | |
| 13183 | case WIFI_BAND_A_DFS_ONLY: |
| 13184 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, |
| 13185 | FL("WIFI_BAND_A_DFS (5 GHz DFS only)")); |
| 13186 | for (i = 0; i < totValidChannels; i++) |
| 13187 | if (CSR_IS_CHANNEL_5GHZ(chanList[i]) && |
| 13188 | CSR_IS_CHANNEL_DFS(chanList[i])) |
| 13189 | aValidChannels[numChannels++] = |
| 13190 | vos_chan_to_freq(chanList[i]); |
| 13191 | break; |
| 13192 | |
| 13193 | case WIFI_BAND_A_WITH_DFS: |
| 13194 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, |
| 13195 | FL("WIFI_BAND_A_WITH_DFS (5 GHz with DFS)")); |
| 13196 | for (i = 0; i < totValidChannels; i++) |
| 13197 | if (CSR_IS_CHANNEL_5GHZ(chanList[i])) |
| 13198 | aValidChannels[numChannels++] = |
| 13199 | vos_chan_to_freq(chanList[i]); |
| 13200 | break; |
| 13201 | |
| 13202 | case WIFI_BAND_ABG_WITH_DFS: |
| 13203 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, |
| 13204 | FL("WIFI_BAND_ABG_WITH_DFS (2.4 GHz + 5 GHz with DFS)")); |
| 13205 | for (i = 0; i < totValidChannels; i++) |
| 13206 | if (CSR_IS_CHANNEL_24GHZ(chanList[i]) || |
| 13207 | CSR_IS_CHANNEL_5GHZ(chanList[i])) |
| 13208 | aValidChannels[numChannels++] = |
| 13209 | vos_chan_to_freq(chanList[i]); |
| 13210 | break; |
| 13211 | |
| 13212 | default: |
| 13213 | smsLog(pMac, VOS_TRACE_LEVEL_ERROR, |
| 13214 | FL("Unknown wifiBand (%d))"), wifiBand); |
| 13215 | return eHAL_STATUS_INVALID_PARAMETER; |
| 13216 | break; |
| 13217 | } |
| 13218 | *pNumChannels = numChannels; |
| 13219 | |
| 13220 | return status; |
| 13221 | } |
| 13222 | /* --------------------------------------------------------------------------- |
| 13223 | \fn sme_EXTScanGetCapabilities |
| 13224 | \brief SME API to fetch Extended Scan capabilities |
| 13225 | \param hHal |
| 13226 | \param pReq: Extended Scan capabilities structure |
| 13227 | \- return eHalStatus |
| 13228 | -------------------------------------------------------------------------*/ |
| 13229 | eHalStatus sme_EXTScanGetCapabilities (tHalHandle hHal, |
| 13230 | tSirGetEXTScanCapabilitiesReqParams *pReq) |
| 13231 | { |
| 13232 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 13233 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 13234 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 13235 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 13236 | tSirGetEXTScanCapabilitiesReqParams *pGetEXTScanCapabilitiesReq; |
| 13237 | |
| 13238 | pGetEXTScanCapabilitiesReq = |
| 13239 | vos_mem_malloc(sizeof(*pGetEXTScanCapabilitiesReq)); |
| 13240 | if ( !pGetEXTScanCapabilitiesReq) |
| 13241 | { |
| 13242 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13243 | "%s: Not able to allocate memory for " |
| 13244 | "WDA_EXTSCAN_GET_CAPABILITIES_REQ", |
| 13245 | __func__); |
| 13246 | return eHAL_STATUS_FAILURE; |
| 13247 | } |
| 13248 | |
| 13249 | *pGetEXTScanCapabilitiesReq = *pReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13250 | |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13251 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 13252 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 13253 | vosMessage.bodyptr = pGetEXTScanCapabilitiesReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13254 | vosMessage.type = WDA_EXTSCAN_GET_CAPABILITIES_REQ; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 13255 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 13256 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13257 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13258 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { |
| 13259 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 13260 | "failed to post WDA_EXTSCAN_GET_CAPABILITIES_REQ ", |
| 13261 | __func__); |
| 13262 | vos_mem_free(pGetEXTScanCapabilitiesReq); |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13263 | status = eHAL_STATUS_FAILURE; |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13264 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13265 | |
| 13266 | sme_ReleaseGlobalLock(&pMac->sme); |
| 13267 | } |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13268 | else |
| 13269 | { |
| 13270 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 13271 | "sme_AcquireGlobalLock error", __func__); |
| 13272 | vos_mem_free(pGetEXTScanCapabilitiesReq); |
| 13273 | status = eHAL_STATUS_FAILURE; |
| 13274 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13275 | return(status); |
| 13276 | } |
| 13277 | |
| 13278 | /* --------------------------------------------------------------------------- |
| 13279 | \fn sme_EXTScanStart |
| 13280 | \brief SME API to issue Extended Scan start |
| 13281 | \param hHal |
| 13282 | \param pStartCmd: Extended Scan start structure |
| 13283 | \- return eHalStatus |
| 13284 | -------------------------------------------------------------------------*/ |
| 13285 | eHalStatus sme_EXTScanStart (tHalHandle hHal, |
| 13286 | tSirEXTScanStartReqParams *pStartCmd) |
| 13287 | { |
| 13288 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 13289 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 13290 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 13291 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 13292 | tSirEXTScanStartReqParams *pextScanStartReq; |
| 13293 | |
| 13294 | pextScanStartReq = vos_mem_malloc(sizeof(*pextScanStartReq)); |
| 13295 | if ( !pextScanStartReq) |
| 13296 | { |
| 13297 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13298 | "%s: Not able to allocate memory for " |
| 13299 | "WDA_EXTSCAN_START_REQ", |
| 13300 | __func__); |
| 13301 | return eHAL_STATUS_FAILURE; |
| 13302 | } |
| 13303 | |
| 13304 | *pextScanStartReq = *pStartCmd; |
| 13305 | |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13306 | |
| 13307 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 13308 | TRACE_CODE_SME_RX_HDD_EXTSCAN_START, NO_SESSION, 0)); |
| 13309 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 13310 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 13311 | vosMessage.bodyptr = pextScanStartReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13312 | vosMessage.type = WDA_EXTSCAN_START_REQ; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 13313 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 13314 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13315 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13316 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { |
| 13317 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13318 | "%s: failed to post WDA_EXTSCAN_START_REQ", __func__); |
| 13319 | vos_mem_free(pextScanStartReq); |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13320 | status = eHAL_STATUS_FAILURE; |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13321 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13322 | sme_ReleaseGlobalLock(&pMac->sme); |
| 13323 | } |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13324 | else |
| 13325 | { |
| 13326 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 13327 | "sme_AcquireGlobalLock error", __func__); |
| 13328 | vos_mem_free(pextScanStartReq); |
| 13329 | status = eHAL_STATUS_FAILURE; |
| 13330 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13331 | return(status); |
| 13332 | } |
| 13333 | |
| 13334 | /* --------------------------------------------------------------------------- |
| 13335 | \fn sme_EXTScanStop |
| 13336 | \brief SME API to issue Extended Scan stop |
| 13337 | \param hHal |
| 13338 | \param pStopReq: Extended Scan stop structure |
| 13339 | \- return eHalStatus |
| 13340 | -------------------------------------------------------------------------*/ |
| 13341 | eHalStatus sme_EXTScanStop(tHalHandle hHal, tSirEXTScanStopReqParams *pStopReq) |
| 13342 | { |
| 13343 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 13344 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 13345 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 13346 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 13347 | tSirEXTScanStopReqParams *pEXTScanStopReq; |
| 13348 | |
| 13349 | pEXTScanStopReq = vos_mem_malloc(sizeof(*pEXTScanStopReq)); |
| 13350 | if ( !pEXTScanStopReq) |
| 13351 | { |
| 13352 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13353 | "%s: Not able to allocate memory for " |
| 13354 | "WDA_EXTSCAN_STOP_REQ", |
| 13355 | __func__); |
| 13356 | return eHAL_STATUS_FAILURE; |
| 13357 | } |
| 13358 | |
| 13359 | *pEXTScanStopReq = *pStopReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13360 | |
| 13361 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 13362 | TRACE_CODE_SME_RX_HDD_EXTSCAN_STOP, NO_SESSION, 0)); |
| 13363 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 13364 | { |
| 13365 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 13366 | vosMessage.bodyptr = pEXTScanStopReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13367 | vosMessage.type = WDA_EXTSCAN_STOP_REQ; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 13368 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 13369 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13370 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 13371 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 13372 | { |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13373 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13374 | "%s: failed to post WDA_EXTSCAN_STOP_REQ", __func__); |
| 13375 | vos_mem_free(pEXTScanStopReq); |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13376 | status = eHAL_STATUS_FAILURE; |
| 13377 | } |
| 13378 | sme_ReleaseGlobalLock(&pMac->sme); |
| 13379 | } |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13380 | else |
| 13381 | { |
| 13382 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 13383 | "sme_AcquireGlobalLock error", __func__); |
| 13384 | vos_mem_free(pEXTScanStopReq); |
| 13385 | status = eHAL_STATUS_FAILURE; |
| 13386 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13387 | return(status); |
| 13388 | } |
| 13389 | |
| 13390 | /* --------------------------------------------------------------------------- |
| 13391 | \fn sme_SetBssHotlist |
| 13392 | \brief SME API to set BSSID hotlist |
| 13393 | \param hHal |
| 13394 | \param pSetHotListReq: Extended Scan set hotlist structure |
| 13395 | \- return eHalStatus |
| 13396 | -------------------------------------------------------------------------*/ |
| 13397 | eHalStatus sme_SetBssHotlist (tHalHandle hHal, |
| 13398 | tSirEXTScanSetBssidHotListReqParams *pSetHotListReq) |
| 13399 | { |
| 13400 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 13401 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 13402 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 13403 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 13404 | tSirEXTScanSetBssidHotListReqParams *pEXTScanSetBssidHotlistReq; |
| 13405 | |
| 13406 | pEXTScanSetBssidHotlistReq = |
| 13407 | vos_mem_malloc(sizeof(*pEXTScanSetBssidHotlistReq)); |
| 13408 | if ( !pEXTScanSetBssidHotlistReq) |
| 13409 | { |
| 13410 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13411 | "%s: Not able to allocate memory for " |
| 13412 | "WDA_EXTSCAN_SET_BSSID_HOTLIST_REQ", |
| 13413 | __func__); |
| 13414 | return eHAL_STATUS_FAILURE; |
| 13415 | } |
| 13416 | |
| 13417 | *pEXTScanSetBssidHotlistReq = *pSetHotListReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13418 | |
| 13419 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 13420 | TRACE_CODE_SME_RX_HDD_EXTSCAN_SET_BSS_HOTLIST, NO_SESSION, 0)); |
| 13421 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 13422 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 13423 | vosMessage.bodyptr = pEXTScanSetBssidHotlistReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13424 | vosMessage.type = WDA_EXTSCAN_SET_BSSID_HOTLIST_REQ; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 13425 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 13426 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13427 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13428 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { |
| 13429 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13430 | "%s: failed to post WDA_EXTSCAN_STOP_REQ", __func__); |
| 13431 | vos_mem_free(pEXTScanSetBssidHotlistReq); |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13432 | status = eHAL_STATUS_FAILURE; |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13433 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13434 | sme_ReleaseGlobalLock(&pMac->sme); |
| 13435 | } |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13436 | else |
| 13437 | { |
| 13438 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 13439 | "sme_AcquireGlobalLock error", __func__); |
| 13440 | vos_mem_free(pEXTScanSetBssidHotlistReq); |
| 13441 | status = eHAL_STATUS_FAILURE; |
| 13442 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13443 | |
| 13444 | return(status); |
| 13445 | } |
| 13446 | |
| 13447 | /* --------------------------------------------------------------------------- |
| 13448 | \fn sme_ResetBssHotlist |
| 13449 | \brief SME API to reset BSSID hotlist |
| 13450 | \param hHal |
| 13451 | \param pSetHotListReq: Extended Scan set hotlist structure |
| 13452 | \- return eHalStatus |
| 13453 | -------------------------------------------------------------------------*/ |
| 13454 | eHalStatus sme_ResetBssHotlist (tHalHandle hHal, |
| 13455 | tSirEXTScanResetBssidHotlistReqParams *pResetReq) |
| 13456 | { |
| 13457 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 13458 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 13459 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 13460 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 13461 | tSirEXTScanResetBssidHotlistReqParams *pEXTScanHotlistResetReq; |
| 13462 | |
| 13463 | pEXTScanHotlistResetReq = vos_mem_malloc(sizeof(*pEXTScanHotlistResetReq)); |
| 13464 | if ( !pEXTScanHotlistResetReq) |
| 13465 | { |
| 13466 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13467 | "%s: Not able to allocate memory for " |
| 13468 | "WDA_EXTSCAN_RESET_BSSID_HOTLIST_REQ", |
| 13469 | __func__); |
| 13470 | return eHAL_STATUS_FAILURE; |
| 13471 | } |
| 13472 | |
| 13473 | *pEXTScanHotlistResetReq = *pResetReq; |
| 13474 | |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13475 | |
| 13476 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 13477 | TRACE_CODE_SME_RX_HDD_EXTSCAN_RESET_BSS_HOTLIST, NO_SESSION, 0)); |
| 13478 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 13479 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 13480 | vosMessage.bodyptr = pEXTScanHotlistResetReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13481 | vosMessage.type = WDA_EXTSCAN_RESET_BSSID_HOTLIST_REQ; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 13482 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 13483 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13484 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13485 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { |
| 13486 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13487 | "%s: failed to post WDA_EXTSCAN_RESET_BSSID_HOTLIST_REQ", |
| 13488 | __func__); |
| 13489 | vos_mem_free(pEXTScanHotlistResetReq); |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13490 | status = eHAL_STATUS_FAILURE; |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13491 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13492 | sme_ReleaseGlobalLock(&pMac->sme); |
| 13493 | } |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13494 | else |
| 13495 | { |
| 13496 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 13497 | "sme_AcquireGlobalLock error", __func__); |
| 13498 | vos_mem_free(pEXTScanHotlistResetReq); |
| 13499 | status = eHAL_STATUS_FAILURE; |
| 13500 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13501 | return(status); |
| 13502 | } |
| 13503 | |
Padma, Santhosh Kumar | 9acee01 | 2015-08-21 19:58:01 +0530 | [diff] [blame] | 13504 | /** |
| 13505 | * sme_set_ssid_hotlist() - Set the SSID hotlist |
| 13506 | * @hal: SME handle |
| 13507 | * @request: set ssid hotlist request |
| 13508 | * |
| 13509 | * Return: eHalStatus |
| 13510 | */ |
| 13511 | eHalStatus |
| 13512 | sme_set_ssid_hotlist(tHalHandle hal, |
| 13513 | tSirEXTScanSetSsidHotListReqParams *request) |
| 13514 | { |
| 13515 | eHalStatus status; |
| 13516 | VOS_STATUS vstatus; |
| 13517 | tpAniSirGlobal mac = PMAC_STRUCT(hal); |
| 13518 | vos_msg_t vos_message; |
| 13519 | tSirEXTScanSetSsidHotListReqParams *set_req; |
| 13520 | int i; |
| 13521 | |
| 13522 | set_req = vos_mem_malloc(sizeof(*set_req)); |
| 13523 | if (!set_req) { |
| 13524 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13525 | "%s: Not able to allocate memory for WDA_EXTSCAN_SET_SSID_HOTLIST_REQ", |
| 13526 | __func__); |
| 13527 | return eHAL_STATUS_FAILURE; |
| 13528 | } |
| 13529 | |
| 13530 | *set_req = *request; |
| 13531 | |
| 13532 | |
| 13533 | |
| 13534 | for( i = 0; i < set_req->ssid_count; i++){ |
| 13535 | |
| 13536 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13537 | "%s: SSID %s \n length: %d", |
| 13538 | __func__, set_req->ssid[i].ssid.ssId, set_req->ssid[i].ssid.length); |
| 13539 | } |
| 13540 | |
| 13541 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 13542 | TRACE_CODE_SME_RX_HDD_EXTSCAN_SET_SSID_HOTLIST, NO_SESSION, 0)); |
| 13543 | |
| 13544 | status = sme_AcquireGlobalLock(&mac->sme); |
| 13545 | if (eHAL_STATUS_SUCCESS == status) { |
| 13546 | /* Serialize the req through MC thread */ |
| 13547 | vos_message.bodyptr = set_req; |
| 13548 | vos_message.type = WDA_EXTSCAN_SET_SSID_HOTLIST_REQ; |
| 13549 | vstatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vos_message); |
| 13550 | sme_ReleaseGlobalLock(&mac->sme); |
| 13551 | if (!VOS_IS_STATUS_SUCCESS(vstatus)) { |
| 13552 | vos_mem_free(set_req); |
| 13553 | status = eHAL_STATUS_FAILURE; |
| 13554 | } |
| 13555 | } else { |
| 13556 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13557 | "%s: sme_AcquireGlobalLock error", __func__); |
| 13558 | vos_mem_free(set_req); |
| 13559 | status = eHAL_STATUS_FAILURE; |
| 13560 | } |
| 13561 | return status; |
| 13562 | } |
| 13563 | |
| 13564 | /** |
| 13565 | * sme_reset_ssid_hotlist() - Set the SSID hotlist |
| 13566 | * @hal: SME handle |
| 13567 | * @request: reset ssid hotlist request |
| 13568 | * |
| 13569 | * Return: eHalStatus |
| 13570 | */ |
| 13571 | eHalStatus |
| 13572 | sme_reset_ssid_hotlist(tHalHandle hal, |
| 13573 | tSirEXTScanResetSsidHotlistReqParams *request) |
| 13574 | { |
| 13575 | eHalStatus status; |
| 13576 | VOS_STATUS vstatus; |
| 13577 | tpAniSirGlobal mac = PMAC_STRUCT(hal); |
| 13578 | vos_msg_t vos_message; |
| 13579 | tSirEXTScanResetSsidHotlistReqParams *set_req; |
| 13580 | |
| 13581 | set_req = vos_mem_malloc(sizeof(*set_req)); |
| 13582 | if (!set_req) { |
| 13583 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13584 | "%s: Not able to allocate memory for WDA_EXTSCAN_SET_SSID_HOTLIST_REQ", |
| 13585 | __func__); |
| 13586 | return eHAL_STATUS_FAILURE; |
| 13587 | } |
| 13588 | |
| 13589 | *set_req = *request; |
| 13590 | |
| 13591 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 13592 | TRACE_CODE_SME_RX_HDD_EXTSCAN_RESET_SSID_HOTLIST, NO_SESSION, 0)); |
| 13593 | |
| 13594 | status = sme_AcquireGlobalLock(&mac->sme); |
| 13595 | if (eHAL_STATUS_SUCCESS == status) { |
| 13596 | /* Serialize the req through MC thread */ |
| 13597 | vos_message.bodyptr = set_req; |
| 13598 | vos_message.type = WDA_EXTSCAN_RESET_SSID_HOTLIST_REQ; |
| 13599 | vstatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vos_message); |
| 13600 | sme_ReleaseGlobalLock(&mac->sme); |
| 13601 | if (!VOS_IS_STATUS_SUCCESS(vstatus)) { |
| 13602 | vos_mem_free(set_req); |
| 13603 | status = eHAL_STATUS_FAILURE; |
| 13604 | } |
| 13605 | } else { |
| 13606 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13607 | "%s: sme_AcquireGlobalLock error", __func__); |
| 13608 | vos_mem_free(set_req); |
| 13609 | status = eHAL_STATUS_FAILURE; |
| 13610 | } |
| 13611 | return status; |
| 13612 | } |
| 13613 | |
| 13614 | |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13615 | /* --------------------------------------------------------------------------- |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13616 | \fn sme_getCachedResults |
| 13617 | \brief SME API to get cached results |
| 13618 | \param hHal |
| 13619 | \param pCachedResultsReq: Extended Scan get cached results structure |
| 13620 | \- return eHalStatus |
| 13621 | -------------------------------------------------------------------------*/ |
| 13622 | eHalStatus sme_getCachedResults (tHalHandle hHal, |
| 13623 | tSirEXTScanGetCachedResultsReqParams *pCachedResultsReq) |
| 13624 | { |
| 13625 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 13626 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 13627 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 13628 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 13629 | tSirEXTScanGetCachedResultsReqParams *pEXTScanCachedResultsReq; |
| 13630 | |
| 13631 | pEXTScanCachedResultsReq = |
| 13632 | vos_mem_malloc(sizeof(*pEXTScanCachedResultsReq)); |
| 13633 | if ( !pEXTScanCachedResultsReq) |
| 13634 | { |
| 13635 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13636 | "%s: Not able to allocate memory for " |
| 13637 | "WDA_EXTSCAN_GET_CACHED_RESULTS_REQ", |
| 13638 | __func__); |
| 13639 | return eHAL_STATUS_FAILURE; |
| 13640 | } |
| 13641 | |
| 13642 | *pEXTScanCachedResultsReq = *pCachedResultsReq; |
| 13643 | |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13644 | |
| 13645 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 13646 | TRACE_CODE_SME_RX_HDD_EXTSCAN_GET_CACHED_RESULTS, NO_SESSION, 0)); |
| 13647 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 13648 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 13649 | vosMessage.bodyptr = pEXTScanCachedResultsReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13650 | vosMessage.type = WDA_EXTSCAN_GET_CACHED_RESULTS_REQ; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 13651 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 13652 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13653 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13654 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { |
| 13655 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13656 | "%s: failed tp post WDA_EXTSCAN_GET_CACHED_RESULTS_REQ", |
| 13657 | __func__); |
| 13658 | vos_mem_free(pEXTScanCachedResultsReq); |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13659 | status = eHAL_STATUS_FAILURE; |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13660 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13661 | sme_ReleaseGlobalLock(&pMac->sme); |
| 13662 | } |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13663 | else |
| 13664 | { |
| 13665 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13666 | FL("Failed to acquire SME Global Lock")); |
| 13667 | vos_mem_free(pEXTScanCachedResultsReq); |
| 13668 | status = eHAL_STATUS_FAILURE; |
| 13669 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13670 | return(status); |
| 13671 | } |
| 13672 | |
| 13673 | eHalStatus sme_EXTScanRegisterCallback (tHalHandle hHal, |
| 13674 | void (*pEXTScanIndCb)(void *, const tANI_U16, void *), |
| 13675 | void *callbackContext) |
| 13676 | { |
| 13677 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 13678 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 13679 | |
| 13680 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 13681 | pMac->sme.pEXTScanIndCb = pEXTScanIndCb; |
| 13682 | pMac->sme.pEXTScanCallbackContext = callbackContext; |
| 13683 | sme_ReleaseGlobalLock(&pMac->sme); |
| 13684 | } |
| 13685 | return(status); |
| 13686 | } |
| 13687 | |
Padma, Santhosh Kumar | 2ccac21 | 2015-10-20 17:27:27 +0530 | [diff] [blame] | 13688 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 13689 | eHalStatus sme_OemDataRegisterCallback (tHalHandle hHal, |
Padma, Santhosh Kumar | ee7c3d2 | 2016-01-25 10:36:08 +0530 | [diff] [blame] | 13690 | void (*pOemDataIndCb)(void *, const tANI_U16, void *, tANI_U32), |
Padma, Santhosh Kumar | 2ccac21 | 2015-10-20 17:27:27 +0530 | [diff] [blame] | 13691 | void *callbackContext) |
| 13692 | { |
| 13693 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 13694 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 13695 | |
| 13696 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 13697 | pMac->sme.pOemDataIndCb = pOemDataIndCb; |
| 13698 | pMac->sme.pOemDataCallbackContext = callbackContext; |
| 13699 | sme_ReleaseGlobalLock(&pMac->sme); |
| 13700 | } |
| 13701 | return(status); |
| 13702 | } |
| 13703 | #endif |
| 13704 | |
Ganesh Kondabattini | 8f6e3b3 | 2014-08-25 16:07:54 +0530 | [diff] [blame] | 13705 | void sme_SetMiracastMode (tHalHandle hHal,tANI_U8 mode) |
| 13706 | { |
| 13707 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Padma, Santhosh Kumar | c1f7f05 | 2015-08-26 12:29:01 +0530 | [diff] [blame] | 13708 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 13709 | vos_msg_t vosMessage = {0}; |
| 13710 | tSirHighPriorityDataInfoInd *phighPriorityDataInfo; |
Ganesh Kondabattini | 8f6e3b3 | 2014-08-25 16:07:54 +0530 | [diff] [blame] | 13711 | |
| 13712 | pMac->miracast_mode = mode; |
Padma, Santhosh Kumar | c1f7f05 | 2015-08-26 12:29:01 +0530 | [diff] [blame] | 13713 | |
| 13714 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 13715 | "%s: miracast_mode: %d", __func__, mode); |
| 13716 | |
| 13717 | phighPriorityDataInfo = |
| 13718 | vos_mem_malloc(sizeof(*phighPriorityDataInfo)); |
| 13719 | if ( !phighPriorityDataInfo) |
| 13720 | { |
| 13721 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s:" |
| 13722 | "Failed to allocate memory for WDA_HIGH_PRIORITY_DATA_INFO_IND", |
| 13723 | __func__); |
| 13724 | return; |
| 13725 | } |
| 13726 | |
| 13727 | if (mode) |
| 13728 | phighPriorityDataInfo->pause = TRUE; |
| 13729 | else |
| 13730 | phighPriorityDataInfo->pause = FALSE; |
| 13731 | |
| 13732 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 13733 | /* Serialize the req through MC thread */ |
| 13734 | vosMessage.bodyptr = phighPriorityDataInfo; |
| 13735 | vosMessage.type = WDA_HIGH_PRIORITY_DATA_INFO_IND; |
| 13736 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 13737 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
| 13738 | |
| 13739 | if(VOS_STATUS_SUCCESS != |
| 13740 | vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage)) { |
| 13741 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s:" |
| 13742 | "Failed to post WDA_HIGH_PRIORITY_DATA_INFO_IND msg to WDA", |
| 13743 | __func__); |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13744 | vos_mem_free(phighPriorityDataInfo); |
Padma, Santhosh Kumar | c1f7f05 | 2015-08-26 12:29:01 +0530 | [diff] [blame] | 13745 | } |
| 13746 | sme_ReleaseGlobalLock(&pMac->sme); |
| 13747 | } |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13748 | else |
| 13749 | { |
| 13750 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 13751 | "sme_AcquireGlobalLock error", __func__); |
| 13752 | vos_mem_free(phighPriorityDataInfo); |
| 13753 | } |
Ganesh Kondabattini | 8f6e3b3 | 2014-08-25 16:07:54 +0530 | [diff] [blame] | 13754 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 13755 | #endif /* WLAN_FEATURE_EXTSCAN */ |
c_hpothu | ef45bc3 | 2014-09-11 10:10:18 +0530 | [diff] [blame] | 13756 | |
| 13757 | void sme_resetCoexEevent(tHalHandle hHal) |
| 13758 | { |
| 13759 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 13760 | |
| 13761 | if (pMac == NULL) |
| 13762 | { |
| 13763 | printk("btc: %s pMac is NULL \n",__func__); |
| 13764 | return; |
| 13765 | } |
| 13766 | |
| 13767 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 13768 | FL("isCoexScoIndSet: %d"), pMac->isCoexScoIndSet); |
| 13769 | |
| 13770 | if (pMac->isCoexScoIndSet) |
| 13771 | { |
| 13772 | pMac->isCoexScoIndSet = 0; |
| 13773 | ccmCfgSetInt(pMac, WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC, 0, |
| 13774 | NULL, eANI_BOOLEAN_FALSE); |
| 13775 | } |
| 13776 | |
| 13777 | return; |
| 13778 | } |
Agarwal Ashish | 738843c | 2014-09-25 12:27:56 +0530 | [diff] [blame] | 13779 | |
| 13780 | void sme_disable_dfs_channel(tHalHandle hHal, bool disbale_dfs) |
| 13781 | { |
| 13782 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 13783 | pMac->scan.fEnableDFSChnlScan = !disbale_dfs; |
| 13784 | csrDisableDfsChannel(pMac); |
| 13785 | |
Padma, Santhosh Kumar | 778d838 | 2015-03-04 17:41:22 +0530 | [diff] [blame] | 13786 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 13787 | "%s: Modified fEnableDFSChnlScan: %d", __func__, |
| 13788 | pMac->scan.fEnableDFSChnlScan); |
Agarwal Ashish | 738843c | 2014-09-25 12:27:56 +0530 | [diff] [blame] | 13789 | } |
Srinivas Dasari | b8fdd42 | 2014-11-27 10:44:20 +0530 | [diff] [blame] | 13790 | |
| 13791 | /* --------------------------------------------------------------------------- |
| 13792 | \fn sme_Encryptmsgsend |
| 13793 | \brief SME API to issue encrypt message request |
| 13794 | \param hHal |
| 13795 | \param pCmd: Data to be encrypted |
| 13796 | \- return eHalStatus |
| 13797 | -------------------------------------------------------------------------*/ |
| 13798 | eHalStatus sme_Encryptmsgsend (tHalHandle hHal, |
| 13799 | u8 *pCmd, |
| 13800 | int length, |
| 13801 | pEncryptMsgRSPCb encMsgCbk) |
| 13802 | { |
| 13803 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 13804 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 13805 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 13806 | vos_msg_t vosMessage; |
| 13807 | u8 *pEncryptMsg; |
| 13808 | |
| 13809 | pEncryptMsg = vos_mem_malloc(length); |
| 13810 | if ( !pEncryptMsg) |
| 13811 | { |
| 13812 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13813 | "%s: Not able to allocate memory for " |
| 13814 | "SIR_HAL_ENCRYPT_MSG_REQ", |
| 13815 | __func__); |
| 13816 | return eHAL_STATUS_FAILURE; |
| 13817 | } |
| 13818 | |
| 13819 | vos_mem_copy(pEncryptMsg, pCmd, length); |
| 13820 | |
| 13821 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 13822 | |
| 13823 | pMac->sme.pEncMsgInfoParams.pEncMsgCbk = encMsgCbk; |
| 13824 | pMac->sme.pEncMsgInfoParams.pUserData = hHal; |
| 13825 | /* Serialize the req through MC thread */ |
| 13826 | vosMessage.bodyptr = pEncryptMsg; |
| 13827 | vosMessage.type = SIR_HAL_ENCRYPT_MSG_REQ; |
Konamki, Sreelakshmi | 5548ff9 | 2015-07-29 14:47:54 +0530 | [diff] [blame] | 13828 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 13829 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, vosMessage.type)); |
Srinivas Dasari | b8fdd42 | 2014-11-27 10:44:20 +0530 | [diff] [blame] | 13830 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13831 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { |
| 13832 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13833 | "%s: failed to post SIR_HAL_ENCRYPT_MSG_REQ", __func__); |
| 13834 | vos_mem_free(pEncryptMsg); |
Srinivas Dasari | b8fdd42 | 2014-11-27 10:44:20 +0530 | [diff] [blame] | 13835 | status = eHAL_STATUS_FAILURE; |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13836 | } |
Srinivas Dasari | b8fdd42 | 2014-11-27 10:44:20 +0530 | [diff] [blame] | 13837 | sme_ReleaseGlobalLock(&pMac->sme); |
| 13838 | } |
Hanumantha Reddy Pothula | 692171d | 2016-02-10 20:16:16 +0530 | [diff] [blame] | 13839 | else |
| 13840 | { |
| 13841 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 13842 | "sme_AcquireGlobalLock error", __func__); |
| 13843 | vos_mem_free(pEncryptMsg); |
| 13844 | status = eHAL_STATUS_FAILURE; |
| 13845 | } |
Srinivas Dasari | b8fdd42 | 2014-11-27 10:44:20 +0530 | [diff] [blame] | 13846 | return(status); |
| 13847 | } |
Pradeep Reddy POTTETI | f0569d7 | 2014-12-13 16:54:03 +0530 | [diff] [blame] | 13848 | |
| 13849 | /* --------------------------------------------------------------------------- |
| 13850 | \fn sme_RegisterBtCoexTDLSCallback |
| 13851 | \brief Used to plug in callback function |
| 13852 | Which notify btcoex on or off. |
| 13853 | Notification come from FW. |
| 13854 | \param hHal |
| 13855 | \param pCallbackfn : callback function pointer should be plugged in |
| 13856 | \- return eHalStatus |
| 13857 | -------------------------------------------------------------------------*/ |
| 13858 | eHalStatus sme_RegisterBtCoexTDLSCallback |
| 13859 | ( |
| 13860 | tHalHandle hHal, |
| 13861 | void (*pCallbackfn)(void *pAdapter, int ) |
| 13862 | ) |
| 13863 | { |
| 13864 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 13865 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 13866 | |
| 13867 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 13868 | "%s: Plug in BtCoex TDLS CB", __func__); |
| 13869 | |
| 13870 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 13871 | if (eHAL_STATUS_SUCCESS == status) |
| 13872 | { |
| 13873 | if (NULL != pCallbackfn) |
| 13874 | { |
| 13875 | pMac->sme.pBtCoexTDLSNotification = pCallbackfn; |
| 13876 | } |
| 13877 | sme_ReleaseGlobalLock(&pMac->sme); |
| 13878 | } |
| 13879 | return(status); |
| 13880 | } |
Padma, Santhosh Kumar | 98f271d | 2014-12-31 17:23:31 +0530 | [diff] [blame] | 13881 | |
| 13882 | /* --------------------------------------------------------------------------- |
Padma, Santhosh Kumar | 3b9657d | 2015-02-04 19:37:32 +0530 | [diff] [blame] | 13883 | \fn smeNeighborMiddleOfRoaming |
Padma, Santhosh Kumar | 98f271d | 2014-12-31 17:23:31 +0530 | [diff] [blame] | 13884 | |
Padma, Santhosh Kumar | 3b9657d | 2015-02-04 19:37:32 +0530 | [diff] [blame] | 13885 | \brief This function is a wrapper to call csrNeighborMiddleOfRoaming |
Padma, Santhosh Kumar | 98f271d | 2014-12-31 17:23:31 +0530 | [diff] [blame] | 13886 | |
| 13887 | \param hHal - The handle returned by macOpen. |
| 13888 | |
Padma, Santhosh Kumar | 3b9657d | 2015-02-04 19:37:32 +0530 | [diff] [blame] | 13889 | \return eANI_BOOLEAN_TRUE if reassoc in progress, |
| 13890 | eANI_BOOLEAN_FALSE otherwise |
Padma, Santhosh Kumar | 98f271d | 2014-12-31 17:23:31 +0530 | [diff] [blame] | 13891 | ---------------------------------------------------------------------------*/ |
Padma, Santhosh Kumar | 3b9657d | 2015-02-04 19:37:32 +0530 | [diff] [blame] | 13892 | |
| 13893 | tANI_BOOLEAN smeNeighborMiddleOfRoaming(tHalHandle hHal) |
Padma, Santhosh Kumar | 98f271d | 2014-12-31 17:23:31 +0530 | [diff] [blame] | 13894 | { |
Padma, Santhosh Kumar | 3b9657d | 2015-02-04 19:37:32 +0530 | [diff] [blame] | 13895 | return (csrNeighborMiddleOfRoaming(PMAC_STRUCT(hHal))); |
Padma, Santhosh Kumar | 98f271d | 2014-12-31 17:23:31 +0530 | [diff] [blame] | 13896 | } |
Pradeep Reddy POTTETI | e8bd41a | 2015-01-29 14:52:43 +0530 | [diff] [blame] | 13897 | |
| 13898 | /* --------------------------------------------------------------------------- |
| 13899 | |
| 13900 | \fn sme_IsTdlsOffChannelValid |
| 13901 | |
| 13902 | \brief To check if the channel is valid for currently established domain |
| 13903 | This is a synchronous API. |
| 13904 | |
| 13905 | \param hHal - The handle returned by macOpen. |
| 13906 | \param channel - channel to verify |
| 13907 | |
| 13908 | \return TRUE/FALSE, TRUE if channel is valid |
| 13909 | |
| 13910 | -------------------------------------------------------------------------------*/ |
| 13911 | tANI_BOOLEAN sme_IsTdlsOffChannelValid(tHalHandle hHal, tANI_U8 channel) |
| 13912 | { |
| 13913 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 13914 | tANI_BOOLEAN valid = FALSE; |
| 13915 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 13916 | |
| 13917 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 13918 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 13919 | { |
| 13920 | /* check whether off channel is valid and non DFS */ |
Pradeep Reddy POTTETI | b9c5f99 | 2015-02-18 14:15:55 +0530 | [diff] [blame] | 13921 | if (csrRoamIsChannelValid(pMac, channel)) |
Pradeep Reddy POTTETI | e8bd41a | 2015-01-29 14:52:43 +0530 | [diff] [blame] | 13922 | { |
Pradeep Reddy POTTETI | b9c5f99 | 2015-02-18 14:15:55 +0530 | [diff] [blame] | 13923 | if (!CSR_IS_CHANNEL_DFS(channel)) |
| 13924 | valid = TRUE; |
| 13925 | else { |
| 13926 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13927 | "%s: configured channel is DFS", __func__); |
| 13928 | } |
| 13929 | } |
| 13930 | else { |
| 13931 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13932 | "%s: configured channel is not valid", __func__); |
Pradeep Reddy POTTETI | e8bd41a | 2015-01-29 14:52:43 +0530 | [diff] [blame] | 13933 | } |
| 13934 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 13935 | } |
Pradeep Reddy POTTETI | b9c5f99 | 2015-02-18 14:15:55 +0530 | [diff] [blame] | 13936 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 13937 | "%s: current country code %c%c channel %d valid %d", |
| 13938 | __func__, pMac->scan.countryCodeCurrent[0], |
| 13939 | pMac->scan.countryCodeCurrent[1], channel, valid); |
Pradeep Reddy POTTETI | e8bd41a | 2015-01-29 14:52:43 +0530 | [diff] [blame] | 13940 | return (valid); |
| 13941 | } |
Mukul Sharma | 4be8842 | 2015-03-09 20:29:07 +0530 | [diff] [blame] | 13942 | |
| 13943 | tANI_BOOLEAN sme_IsCoexScoIndicationSet(tHalHandle hHal) |
| 13944 | { |
| 13945 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 13946 | tANI_BOOLEAN valid = FALSE; |
| 13947 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 13948 | |
| 13949 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 13950 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 13951 | { |
| 13952 | valid = pMac->isCoexScoIndSet; |
| 13953 | } |
| 13954 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 13955 | return (valid); |
| 13956 | } |
Abhishek Singh | 01c73d1 | 2015-03-12 15:13:44 +0530 | [diff] [blame] | 13957 | eHalStatus sme_SetMiracastVendorConfig(tHalHandle hHal, |
| 13958 | tANI_U32 iniNumBuffAdvert , tANI_U32 set_value) |
| 13959 | { |
| 13960 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 13961 | tANI_U8 mcsSet[SIZE_OF_SUPPORTED_MCS_SET]; |
| 13962 | tANI_U32 val = SIZE_OF_SUPPORTED_MCS_SET; |
| 13963 | |
| 13964 | if (ccmCfgGetStr(hHal, WNI_CFG_SUPPORTED_MCS_SET, mcsSet, &val) |
| 13965 | != eHAL_STATUS_SUCCESS) |
| 13966 | { |
| 13967 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13968 | FL("failed to get ini param, WNI_CFG_SUPPORTED_MCS_SET")); |
| 13969 | return eHAL_STATUS_FAILURE; |
| 13970 | } |
| 13971 | |
| 13972 | if (set_value) |
| 13973 | { |
| 13974 | if (pMac->miracastVendorConfig) |
| 13975 | { |
| 13976 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 13977 | FL(" Miracast tuning already enabled!!")); |
| 13978 | return eHAL_STATUS_SUCCESS; |
| 13979 | } |
| 13980 | |
| 13981 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 13982 | FL("Enable Miracast tuning by disabling 64QAM rates, setting 4 blocks for aggregation and disabling probe response for broadcast probe in P2P-GO mode")); |
| 13983 | |
| 13984 | if (ccmCfgSetInt(hHal, WNI_CFG_NUM_BUFF_ADVERT, 4, |
| 13985 | NULL, eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) |
| 13986 | { |
| 13987 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 13988 | FL("Failure: Could not set WNI_CFG_NUM_BUFF_ADVERT")); |
| 13989 | return eHAL_STATUS_FAILURE; |
| 13990 | } |
| 13991 | /* Disable 64QAM rates ie (MCS 5,6 and 7) |
| 13992 | */ |
| 13993 | mcsSet[0]=0x1F; |
| 13994 | } |
| 13995 | else |
| 13996 | { |
| 13997 | if (!pMac->miracastVendorConfig) |
| 13998 | { |
| 13999 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 14000 | FL(" Miracast tuning already disabled!!")); |
| 14001 | return eHAL_STATUS_SUCCESS; |
| 14002 | } |
| 14003 | |
| 14004 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 14005 | FL("Disable Miracast tuning by enabling all MCS rates, setting %d blocks for aggregation and enabling probe response for broadcast probe in P2P-GO mode"), |
| 14006 | iniNumBuffAdvert); |
| 14007 | |
| 14008 | if (ccmCfgSetInt(hHal, WNI_CFG_NUM_BUFF_ADVERT, iniNumBuffAdvert, |
| 14009 | NULL, eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) |
| 14010 | { |
| 14011 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 14012 | FL("Failure: Could not set WNI_CFG_NUM_BUFF_ADVERT")); |
| 14013 | return eHAL_STATUS_FAILURE; |
| 14014 | } |
| 14015 | /* Enable all MCS rates) |
| 14016 | */ |
| 14017 | mcsSet[0]=0xFF; |
| 14018 | } |
| 14019 | |
| 14020 | if (ccmCfgSetStr(hHal, WNI_CFG_SUPPORTED_MCS_SET, mcsSet, |
| 14021 | val, NULL, eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) |
| 14022 | { |
| 14023 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 14024 | FL("Failure: Could not set WNI_CFG_SUPPORTED_MCS_SET")); |
| 14025 | return eHAL_STATUS_FAILURE; |
| 14026 | } |
| 14027 | |
| 14028 | pMac->miracastVendorConfig = set_value; |
| 14029 | return eHAL_STATUS_SUCCESS; |
| 14030 | } |
Mukul Sharma | 4be8842 | 2015-03-09 20:29:07 +0530 | [diff] [blame] | 14031 | |
Mukul Sharma | 4506394 | 2015-04-01 20:07:59 +0530 | [diff] [blame] | 14032 | void sme_SetDefDot11Mode(tHalHandle hHal) |
| 14033 | { |
| 14034 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 14035 | csrSetDefaultDot11Mode(pMac); |
| 14036 | } |
| 14037 | |
Pradeep Reddy POTTETI | 3150589 | 2015-04-16 16:47:54 +0530 | [diff] [blame] | 14038 | /* --------------------------------------------------------------------------- |
| 14039 | \fn sme_SetTdls2040BSSCoexistence |
| 14040 | \brief API to enable or disable 20_40 BSS Coexistence IE in TDLS frames. |
| 14041 | |
| 14042 | \param isEnabled - Enable or Disable. |
| 14043 | \- return VOS_STATUS_SUCCES |
| 14044 | -------------------------------------------------------------------------*/ |
| 14045 | eHalStatus sme_SetTdls2040BSSCoexistence(tHalHandle hHal, |
| 14046 | tANI_S32 isTdls2040BSSCoexEnabled) |
| 14047 | { |
| 14048 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 14049 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 14050 | vos_msg_t msg; |
| 14051 | tAniSetTdls2040BSSCoex *pMsg; |
| 14052 | |
| 14053 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 14054 | if (HAL_STATUS_SUCCESS( status )) |
| 14055 | { |
| 14056 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 14057 | "%s: is2040BSSCoexEnabled %d ", |
| 14058 | __func__, isTdls2040BSSCoexEnabled); |
| 14059 | pMsg = vos_mem_malloc(sizeof(tAniSetTdls2040BSSCoex)); |
| 14060 | if (NULL == pMsg ) |
| 14061 | { |
| 14062 | smsLog(pMac, LOGE, "failed to allocate mem for SetTdls2040BSSCoex"); |
| 14063 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 14064 | return eHAL_STATUS_FAILURE; |
| 14065 | } |
| 14066 | |
| 14067 | pMsg->msgType = pal_cpu_to_be16( |
| 14068 | (tANI_U16)eWNI_SME_SET_TDLS_2040_BSSCOEX_REQ); |
| 14069 | pMsg->msgLen = (tANI_U16)sizeof(tAniSetTdls2040BSSCoex); |
| 14070 | pMsg->SetTdls2040BSSCoex = isTdls2040BSSCoexEnabled; |
| 14071 | |
| 14072 | msg.type = eWNI_SME_SET_TDLS_2040_BSSCOEX_REQ; |
| 14073 | msg.reserved = 0; |
| 14074 | msg.bodyptr = pMsg; |
| 14075 | msg.bodyval = 0; |
| 14076 | |
| 14077 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_PE, &msg)) |
| 14078 | { |
| 14079 | smsLog(pMac, LOGE, |
| 14080 | "sme_SetTdls2040BSSCoexistence failed to post msg to PE "); |
| 14081 | vos_mem_free((void *)pMsg); |
| 14082 | status = eHAL_STATUS_FAILURE; |
| 14083 | } |
| 14084 | smsLog(pMac, LOG1, FL(" returned")); |
| 14085 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 14086 | } |
| 14087 | return status; |
| 14088 | } |
Abhishek Singh | 41988ba | 2015-05-25 19:42:29 +0530 | [diff] [blame] | 14089 | |
| 14090 | /* --------------------------------------------------------------------------- |
| 14091 | \fn sme_SetRtsCtsHtVht |
| 14092 | \brief API to to enable/disable RTS/CTS for different modes. |
| 14093 | |
| 14094 | \param set_value - Bit mask value to enable RTS/CTS for different modes. |
| 14095 | \- return VOS_STATUS_SUCCES if INdication is posted to |
| 14096 | WDA else return eHAL_STATUS_FAILURE |
| 14097 | -------------------------------------------------------------------------*/ |
| 14098 | eHalStatus sme_SetRtsCtsHtVht(tHalHandle hHal, tANI_U32 set_value) |
| 14099 | { |
| 14100 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 14101 | vos_msg_t msg; |
| 14102 | |
| 14103 | smsLog(pMac, LOG1, FL(" set_value = %d"), set_value); |
| 14104 | |
| 14105 | if (ccmCfgSetInt(hHal, WNI_CFG_ENABLE_RTSCTS_HTVHT, set_value, |
| 14106 | NULL, eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) |
| 14107 | { |
| 14108 | smsLog(pMac, LOGE, |
| 14109 | FL("Failure: Could not set WNI_CFG_ENABLE_RTSCTS_HTVHT")); |
| 14110 | return eHAL_STATUS_FAILURE; |
| 14111 | } |
| 14112 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme )) |
| 14113 | { |
| 14114 | vos_mem_zero(&msg, sizeof(vos_msg_t)); |
| 14115 | msg.type = WDA_SET_RTS_CTS_HTVHT; |
| 14116 | msg.reserved = 0; |
| 14117 | msg.bodyval = set_value; |
| 14118 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_WDA, &msg)) |
| 14119 | { |
| 14120 | smsLog(pMac, LOGE, |
| 14121 | FL("Not able to post WDA_SET_RTS_CTS_HTVHT message to HAL")); |
| 14122 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 14123 | return eHAL_STATUS_FAILURE; |
| 14124 | } |
| 14125 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 14126 | return eHAL_STATUS_SUCCESS; |
| 14127 | } |
| 14128 | return eHAL_STATUS_FAILURE; |
| 14129 | |
| 14130 | } |
Agarwal Ashish | 8bd53ae | 2015-06-12 18:03:45 +0530 | [diff] [blame] | 14131 | |
Sachin Ahuja | 715aafc | 2015-07-21 23:35:10 +0530 | [diff] [blame] | 14132 | |
| 14133 | /* --------------------------------------------------------------------------- |
| 14134 | \fn sme_fatal_event_logs_req |
| 14135 | \brief API to to send flush log command to FW.. |
| 14136 | |
| 14137 | \param hHal - Mac Context Handle |
| 14138 | \- return VOS_STATUS_SUCCES if command is posted to |
| 14139 | WDA else return eHAL_STATUS_FAILURE |
| 14140 | -------------------------------------------------------------------------*/ |
| 14141 | eHalStatus sme_fatal_event_logs_req(tHalHandle hHal, tANI_U32 is_fatal, |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 14142 | tANI_U32 indicator, tANI_U32 reason_code, |
| 14143 | tANI_BOOLEAN dump_vos_trace) |
Sachin Ahuja | 715aafc | 2015-07-21 23:35:10 +0530 | [diff] [blame] | 14144 | { |
| 14145 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 14146 | vos_msg_t msg; |
| 14147 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 14148 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 14149 | tpSirFatalEventLogsReqParam pFatalEventLogsReqParams; |
| 14150 | |
Abhishek Singh | 4eaf679 | 2016-02-04 12:36:39 +0530 | [diff] [blame] | 14151 | /* Dump last 500 VosTrace */ |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 14152 | if (dump_vos_trace) |
Abhishek Singh | 4eaf679 | 2016-02-04 12:36:39 +0530 | [diff] [blame] | 14153 | vosTraceDumpAll(pMac, 0, 0, 500, 0); |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 14154 | |
| 14155 | if (WLAN_LOG_INDICATOR_HOST_ONLY == indicator) |
| 14156 | { |
| 14157 | vos_flush_host_logs_for_fatal(); |
| 14158 | return VOS_STATUS_SUCCESS; |
| 14159 | } |
| 14160 | |
Sachin Ahuja | 715aafc | 2015-07-21 23:35:10 +0530 | [diff] [blame] | 14161 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme )) |
| 14162 | { |
Hanumantha Reddy Pothula | 368eefb | 2016-01-22 15:36:40 +0530 | [diff] [blame] | 14163 | pFatalEventLogsReqParams = |
| 14164 | vos_mem_malloc(sizeof(*pFatalEventLogsReqParams)); |
Sachin Ahuja | 715aafc | 2015-07-21 23:35:10 +0530 | [diff] [blame] | 14165 | if(NULL == pFatalEventLogsReqParams) |
| 14166 | { |
| 14167 | smsLog(pMac, LOGE, |
| 14168 | FL("vos_mem_alloc failed ")); |
| 14169 | return eHAL_STATUS_FAILED_ALLOC; |
| 14170 | } |
Hanumantha Reddy Pothula | 368eefb | 2016-01-22 15:36:40 +0530 | [diff] [blame] | 14171 | vos_mem_set(pFatalEventLogsReqParams, |
| 14172 | sizeof(*pFatalEventLogsReqParams), 0); |
Sachin Ahuja | 715aafc | 2015-07-21 23:35:10 +0530 | [diff] [blame] | 14173 | pFatalEventLogsReqParams->reason_code = reason_code; |
| 14174 | |
| 14175 | vos_mem_zero(&msg, sizeof(vos_msg_t)); |
| 14176 | msg.type = WDA_FATAL_EVENT_LOGS_REQ; |
| 14177 | msg.reserved = 0; |
| 14178 | msg.bodyptr = pFatalEventLogsReqParams; |
| 14179 | msg.bodyval = 0; |
| 14180 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &msg); |
| 14181 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 14182 | { |
| 14183 | vos_mem_free(pFatalEventLogsReqParams); |
| 14184 | status = eHAL_STATUS_FAILURE; |
| 14185 | } |
| 14186 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 14187 | return status; |
| 14188 | |
| 14189 | } |
| 14190 | return eHAL_STATUS_FAILURE; |
| 14191 | } |
| 14192 | |
| 14193 | |
Agarwal Ashish | 8bd53ae | 2015-06-12 18:03:45 +0530 | [diff] [blame] | 14194 | /** |
| 14195 | * sme_handleSetFccChannel() - handle fcc constraint request |
| 14196 | * @hal: HAL pointer |
| 14197 | * @fcc_constraint: whether to apply or remove fcc constraint |
| 14198 | * |
| 14199 | * Return: tANI_BOOLEAN. |
| 14200 | */ |
Agrawal Ashish | 842eea8 | 2016-02-04 17:56:16 +0530 | [diff] [blame] | 14201 | tANI_BOOLEAN sme_handleSetFccChannel(tHalHandle hHal, tANI_U8 fcc_constraint, |
| 14202 | v_U32_t scan_pending) |
Agarwal Ashish | 8bd53ae | 2015-06-12 18:03:45 +0530 | [diff] [blame] | 14203 | { |
| 14204 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 14205 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 14206 | |
| 14207 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 14208 | |
| 14209 | if (eHAL_STATUS_SUCCESS == status && |
| 14210 | (!sme_Is11dSupported(hHal)) ) |
| 14211 | { |
Agrawal Ashish | 842eea8 | 2016-02-04 17:56:16 +0530 | [diff] [blame] | 14212 | pMac->scan.fcc_constraint = !fcc_constraint; |
Agarwal Ashish | 8bd53ae | 2015-06-12 18:03:45 +0530 | [diff] [blame] | 14213 | |
Agrawal Ashish | 842eea8 | 2016-02-04 17:56:16 +0530 | [diff] [blame] | 14214 | if (scan_pending == TRUE) { |
| 14215 | pMac->scan.defer_update_channel_list = true; |
| 14216 | } else { |
| 14217 | /* update the channel list to the firmware */ |
| 14218 | csrUpdateChannelList(pMac); |
| 14219 | } |
Agarwal Ashish | 8bd53ae | 2015-06-12 18:03:45 +0530 | [diff] [blame] | 14220 | } |
| 14221 | |
| 14222 | sme_ReleaseGlobalLock(&pMac->sme); |
| 14223 | |
| 14224 | return status; |
| 14225 | } |
Masti, Narayanraddi | 1fb32a9 | 2015-06-29 13:14:06 +0530 | [diff] [blame] | 14226 | |
Mahesh A Saptasagar | beca12c | 2015-09-07 16:21:06 +0530 | [diff] [blame] | 14227 | eHalStatus sme_enableDisableChanAvoidIndEvent(tHalHandle hHal, tANI_U8 set_value) |
| 14228 | { |
| 14229 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 14230 | VOS_STATUS vosStatus; |
| 14231 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 14232 | vos_msg_t msg; |
| 14233 | |
| 14234 | smsLog(pMac, LOG1, FL("set_value: %d"), set_value); |
| 14235 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme )) |
| 14236 | { |
| 14237 | vos_mem_zero(&msg, sizeof(vos_msg_t)); |
| 14238 | msg.type = WDA_SEND_FREQ_RANGE_CONTROL_IND; |
| 14239 | msg.reserved = 0; |
| 14240 | msg.bodyval = set_value; |
| 14241 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &msg); |
| 14242 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 14243 | { |
| 14244 | status = eHAL_STATUS_FAILURE; |
| 14245 | } |
| 14246 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 14247 | return status; |
| 14248 | } |
| 14249 | |
| 14250 | return eHAL_STATUS_FAILURE; |
| 14251 | } |
| 14252 | |
Masti, Narayanraddi | 1fb32a9 | 2015-06-29 13:14:06 +0530 | [diff] [blame] | 14253 | eHalStatus sme_DeleteAllTDLSPeers(tHalHandle hHal, uint8_t sessionId) |
| 14254 | { |
| 14255 | tSirDelAllTdlsPeers *pMsg; |
| 14256 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 14257 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 14258 | tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); |
| 14259 | |
| 14260 | pMsg = vos_mem_malloc(sizeof(tSirDelAllTdlsPeers)); |
| 14261 | if (NULL == pMsg) |
| 14262 | { |
| 14263 | smsLog(pMac, LOGE, FL("memory alloc failed")); |
| 14264 | return eHAL_STATUS_FAILURE; |
| 14265 | } |
| 14266 | vos_mem_set(pMsg, sizeof( tSirDelAllTdlsPeers ), 0); |
| 14267 | pMsg->mesgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_DEL_ALL_TDLS_PEERS); |
| 14268 | pMsg->mesgLen = pal_cpu_to_be16((tANI_U16)sizeof( tSirDelAllTdlsPeers )); |
| 14269 | vos_mem_copy(pMsg->bssid, pSession->connectedProfile.bssid, |
| 14270 | sizeof(tSirMacAddr)); |
| 14271 | status = palSendMBMessage( pMac->hHdd, pMsg ); |
| 14272 | return status; |
| 14273 | } |
c_manjee | cfd1efb | 2015-09-25 19:32:34 +0530 | [diff] [blame] | 14274 | |
| 14275 | |
| 14276 | /** |
| 14277 | * sme_FwMemDumpReq() - Send Fwr mem Dump Request |
| 14278 | * @hal: HAL pointer |
| 14279 | * |
| 14280 | * Return: eHalStatus |
| 14281 | */ |
| 14282 | |
| 14283 | eHalStatus sme_FwMemDumpReq(tHalHandle hHal, tAniFwrDumpReq *recv_req) |
| 14284 | { |
| 14285 | |
| 14286 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 14287 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 14288 | vos_msg_t msg; |
| 14289 | tAniFwrDumpReq * send_req; |
| 14290 | |
| 14291 | send_req = vos_mem_malloc(sizeof(*send_req)); |
| 14292 | if(!send_req) { |
| 14293 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 14294 | FL("Mem allo failed for FW_MEM_DUMP")); |
| 14295 | return eHAL_STATUS_FAILURE; |
| 14296 | } |
| 14297 | |
| 14298 | send_req->fwMemDumpReqCallback = recv_req->fwMemDumpReqCallback; |
| 14299 | send_req->fwMemDumpReqContext = recv_req->fwMemDumpReqContext; |
| 14300 | |
| 14301 | if (eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock(&pMac->sme)) |
| 14302 | { |
| 14303 | msg.bodyptr = send_req; |
| 14304 | msg.type = WDA_FW_MEM_DUMP_REQ; |
| 14305 | msg.reserved = 0; |
| 14306 | |
| 14307 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 14308 | { |
| 14309 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 14310 | FL("Not able to post WDA_FW_MEM_DUMP")); |
| 14311 | vos_mem_free(send_req); |
| 14312 | status = eHAL_STATUS_FAILURE; |
| 14313 | } |
| 14314 | sme_ReleaseGlobalLock(&pMac->sme); |
| 14315 | } |
| 14316 | else |
| 14317 | { |
| 14318 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 14319 | FL("Failed to acquire SME Global Lock")); |
| 14320 | vos_mem_free(send_req); |
| 14321 | status = eHAL_STATUS_FAILURE; |
| 14322 | } |
| 14323 | |
| 14324 | return status; |
| 14325 | } |
| 14326 | |
Arun Khandavalli | 7eeb159 | 2015-10-19 21:36:57 +0530 | [diff] [blame] | 14327 | eHalStatus sme_set_wificonfig_params(tHalHandle hHal, tSetWifiConfigParams *req) |
| 14328 | { |
| 14329 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 14330 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 14331 | vos_msg_t msg; |
| 14332 | |
| 14333 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 14334 | |
| 14335 | if (eHAL_STATUS_SUCCESS == status){ |
| 14336 | |
| 14337 | /* serialize the req through MC thread */ |
| 14338 | msg.type = WDA_WIFI_CONFIG_REQ; |
| 14339 | msg.reserved = 0; |
| 14340 | msg.bodyptr = req; |
| 14341 | |
| 14342 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 14343 | TRACE_CODE_SME_TX_WDA_MSG, NO_SESSION, msg.type)); |
| 14344 | |
| 14345 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 14346 | { |
| 14347 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 14348 | "Not able to post SIR_HAL_WIFI_CONFIG_PARAMS message to HAL", __func__); |
| 14349 | status = eHAL_STATUS_FAILURE; |
| 14350 | } |
| 14351 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 14352 | } |
| 14353 | else |
| 14354 | { |
| 14355 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 14356 | "sme_AcquireGlobalLock error", __func__); |
| 14357 | } |
| 14358 | return status; |
| 14359 | } |
Padma, Santhosh Kumar | 2762e9d | 2015-10-20 15:02:57 +0530 | [diff] [blame] | 14360 | |
| 14361 | eHalStatus sme_getRegInfo(tHalHandle hHal, tANI_U8 chanId, |
| 14362 | tANI_U32 *regInfo1, tANI_U32 *regInfo2) |
| 14363 | { |
| 14364 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 14365 | eHalStatus status; |
| 14366 | tANI_U8 i; |
| 14367 | eAniBoolean found = false; |
| 14368 | |
| 14369 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 14370 | *regInfo1 = 0; |
| 14371 | *regInfo2 = 0; |
| 14372 | if (HAL_STATUS_SUCCESS(status)) |
| 14373 | { |
| 14374 | for (i = 0 ; i < WNI_CFG_VALID_CHANNEL_LIST_LEN; i++) |
| 14375 | { |
| 14376 | if (pMac->scan.defaultPowerTable[i].chanId == chanId) |
| 14377 | { |
| 14378 | SME_SET_CHANNEL_REG_POWER(*regInfo1, |
| 14379 | pMac->scan.defaultPowerTable[i].pwr); |
| 14380 | |
| 14381 | SME_SET_CHANNEL_MAX_TX_POWER(*regInfo2, |
| 14382 | pMac->scan.defaultPowerTable[i].pwr); |
| 14383 | |
| 14384 | |
| 14385 | found = true; |
| 14386 | break; |
| 14387 | } |
| 14388 | } |
| 14389 | |
| 14390 | if (!found) |
| 14391 | status = eHAL_STATUS_FAILURE; |
| 14392 | |
| 14393 | sme_ReleaseGlobalLock(&pMac->sme); |
| 14394 | } |
| 14395 | return status; |
| 14396 | } |
Mahesh A Saptasagar | cfc65ae | 2015-12-22 15:06:10 +0530 | [diff] [blame] | 14397 | |
| 14398 | eHalStatus sme_GetCurrentAntennaIndex(tHalHandle hHal, |
| 14399 | tCsrAntennaIndexCallback callback, |
| 14400 | void *pContext, tANI_U8 sessionId) |
| 14401 | { |
| 14402 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 14403 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 14404 | tSirAntennaDiversitySelectionReq *pMsg; |
| 14405 | tCsrRoamSession *pSession; |
| 14406 | VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; |
| 14407 | vos_msg_t vosMessage; |
| 14408 | |
| 14409 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 14410 | if (HAL_STATUS_SUCCESS(status)) |
| 14411 | { |
| 14412 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 14413 | if (!pSession) |
| 14414 | { |
| 14415 | smsLog(pMac, LOGE, FL("session %d not found"), sessionId); |
| 14416 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 14417 | return eHAL_STATUS_FAILURE; |
| 14418 | } |
| 14419 | |
| 14420 | pMsg = (tSirAntennaDiversitySelectionReq*)vos_mem_malloc(sizeof(*pMsg)); |
| 14421 | if (NULL == pMsg) |
| 14422 | { |
| 14423 | smsLog(pMac, LOGE, FL("failed to allocated memory")); |
| 14424 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 14425 | return eHAL_STATUS_FAILURE; |
| 14426 | } |
| 14427 | pMsg->callback = callback; |
| 14428 | pMsg->data = pContext; |
| 14429 | |
| 14430 | vosMessage.type = WDA_ANTENNA_DIVERSITY_SELECTION_REQ; |
| 14431 | vosMessage.bodyptr = pMsg; |
| 14432 | vosMessage.reserved = 0; |
| 14433 | |
| 14434 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 14435 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 14436 | { |
| 14437 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 14438 | "%s: Failed to post message to WDA", __func__); |
| 14439 | vos_mem_free(pMsg); |
| 14440 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 14441 | return eHAL_STATUS_FAILURE; |
| 14442 | } |
| 14443 | sme_ReleaseGlobalLock( &pMac->sme); |
| 14444 | return eHAL_STATUS_SUCCESS; |
| 14445 | } |
| 14446 | return eHAL_STATUS_FAILURE; |
| 14447 | } |
Mahesh A Saptasagar | 7d43295 | 2016-02-09 14:01:03 +0530 | [diff] [blame] | 14448 | |
| 14449 | eHalStatus sme_setBcnMissPenaltyCount(tHalHandle hHal, |
| 14450 | tModifyRoamParamsReqParams *pModifyRoamReqParams) |
| 14451 | { |
| 14452 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 14453 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 14454 | VOS_STATUS vosStatus; |
| 14455 | tModifyRoamParamsReqParams *pMsg; |
| 14456 | vos_msg_t msg; |
| 14457 | |
| 14458 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 14459 | if (HAL_STATUS_SUCCESS(status)) |
| 14460 | { |
| 14461 | pMsg = (tModifyRoamParamsReqParams*)vos_mem_malloc(sizeof(*pMsg)); |
| 14462 | if (NULL == pMsg) |
| 14463 | { |
| 14464 | smsLog(pMac, LOGE, FL("failed to allocated memory")); |
| 14465 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 14466 | return eHAL_STATUS_FAILURE; |
| 14467 | } |
| 14468 | if (NULL == pModifyRoamReqParams) |
| 14469 | { |
| 14470 | smsLog(pMac, LOGE, FL("Invalid memory")); |
| 14471 | vos_mem_free(pMsg); |
| 14472 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 14473 | return eHAL_STATUS_FAILURE; |
| 14474 | } |
| 14475 | pMsg->param = pModifyRoamReqParams->param; |
| 14476 | pMsg->value = pModifyRoamReqParams->value; |
| 14477 | vos_mem_zero(&msg, sizeof(vos_msg_t)); |
| 14478 | msg.type = WDA_MODIFY_ROAM_PARAMS_IND; |
| 14479 | msg.reserved = 0; |
| 14480 | msg.bodyptr = pMsg; |
| 14481 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &msg); |
| 14482 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 14483 | { |
| 14484 | status = eHAL_STATUS_FAILURE; |
| 14485 | vos_mem_free(pMsg); |
| 14486 | } |
| 14487 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 14488 | return status; |
| 14489 | } |
| 14490 | |
| 14491 | return eHAL_STATUS_FAILURE; |
| 14492 | } |
Abhishek Singh | bfb3c9e | 2016-07-22 11:25:43 +0530 | [diff] [blame] | 14493 | |
| 14494 | /** |
| 14495 | * sme_remove_bssid_from_scan_list() - wrapper to remove the bssid from |
| 14496 | * scan list |
| 14497 | * @hal: hal context. |
| 14498 | * @bssid: bssid to be removed |
| 14499 | * |
| 14500 | * This function remove the given bssid from scan list. |
| 14501 | * |
| 14502 | * Return: hal status. |
| 14503 | */ |
| 14504 | eHalStatus sme_remove_bssid_from_scan_list(tHalHandle hal, |
| 14505 | tSirMacAddr bssid) |
| 14506 | { |
| 14507 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 14508 | tpAniSirGlobal pMac = PMAC_STRUCT(hal); |
| 14509 | |
| 14510 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 14511 | if (HAL_STATUS_SUCCESS(status)) { |
| 14512 | csr_remove_bssid_from_scan_list(pMac, bssid); |
| 14513 | sme_ReleaseGlobalLock(&pMac->sme); |
| 14514 | } |
| 14515 | |
| 14516 | return status; |
| 14517 | } |
| 14518 | |
Agrawal Ashish | 0552be0 | 2016-03-02 18:03:43 +0530 | [diff] [blame] | 14519 | /** |
| 14520 | * sme_set_mgmt_frm_via_wq5() - Set INI params sendMgmtPktViaWQ5 to WDA. |
| 14521 | * @hal: HAL pointer |
| 14522 | * @sendMgmtPktViaWQ5: INI params to enable/disable sending mgmt pkt via WQ5. |
| 14523 | * |
| 14524 | * Return: void |
| 14525 | */ |
| 14526 | void sme_set_mgmt_frm_via_wq5(tHalHandle hHal, tANI_BOOLEAN sendMgmtPktViaWQ5) |
| 14527 | { |
| 14528 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 14529 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 14530 | |
| 14531 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 14532 | if (HAL_STATUS_SUCCESS(status)) |
| 14533 | { |
| 14534 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 14535 | "sendMgmtPktViaWQ5 is %d", sendMgmtPktViaWQ5); |
| 14536 | /* not serializing this messsage, as this is only going |
| 14537 | * to set a variable in WDA/WDI |
| 14538 | */ |
| 14539 | WDA_SetMgmtPktViaWQ5(sendMgmtPktViaWQ5); |
| 14540 | sme_ReleaseGlobalLock(&pMac->sme); |
| 14541 | } |
| 14542 | return; |
| 14543 | } |
Agrawal Ashish | 17ef508 | 2016-10-17 18:33:21 +0530 | [diff] [blame] | 14544 | |
| 14545 | #ifdef SAP_AUTH_OFFLOAD |
| 14546 | /** |
| 14547 | * sme_set_sap_auth_offload() enable/disable Software AP Auth Offload |
| 14548 | * @hHal: hal layer handler |
| 14549 | * @sap_auth_offload_info: the information of Software AP Auth offload |
| 14550 | * |
| 14551 | * This function provide enable/disable Software AP authenticaiton offload |
| 14552 | * feature on target firmware |
| 14553 | * |
| 14554 | * Return: Return eHalStatus. |
| 14555 | */ |
| 14556 | eHalStatus sme_set_sap_auth_offload(tHalHandle hHal, |
| 14557 | struct tSirSapOffloadInfo *sap_auth_offload_info) |
| 14558 | { |
| 14559 | vos_msg_t vosMessage; |
| 14560 | struct tSirSapOffloadInfo *sme_sap_auth_offload_info; |
| 14561 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 14562 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 14563 | |
| 14564 | pMac->sap_auth_offload_sec_type = |
| 14565 | sap_auth_offload_info->sap_auth_offload_sec_type; |
| 14566 | pMac->sap_auth_offload = sap_auth_offload_info->sap_auth_offload_enable; |
| 14567 | |
| 14568 | sme_sap_auth_offload_info = |
| 14569 | vos_mem_malloc(sizeof(*sme_sap_auth_offload_info)); |
| 14570 | |
| 14571 | if (!sme_sap_auth_offload_info) |
| 14572 | { |
| 14573 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 14574 | "%s: Not able to allocate memory for WDA_SET_SAP_AUTH_OFL", |
| 14575 | __func__); |
| 14576 | return eHAL_STATUS_E_MALLOC_FAILED; |
| 14577 | } |
| 14578 | vos_mem_copy(sme_sap_auth_offload_info, sap_auth_offload_info, |
| 14579 | sizeof(*sap_auth_offload_info)); |
| 14580 | |
| 14581 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 14582 | { |
| 14583 | /* serialize the req through MC thread */ |
| 14584 | vosMessage.type = WDA_SET_SAP_AUTH_OFL; |
| 14585 | vosMessage.bodyptr = sme_sap_auth_offload_info; |
| 14586 | |
| 14587 | if (!VOS_IS_STATUS_SUCCESS( |
| 14588 | vos_mq_post_message(VOS_MODULE_ID_WDA, &vosMessage))) |
| 14589 | { |
| 14590 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 14591 | "%s: Not able to post WDA_SET_SAP_AUTH_OFL to WDA!", |
| 14592 | __func__); |
| 14593 | vos_mem_free(sme_sap_auth_offload_info); |
| 14594 | status = eHAL_STATUS_FAILURE; |
| 14595 | } |
| 14596 | sme_ReleaseGlobalLock(&pMac->sme); |
| 14597 | } |
| 14598 | else |
| 14599 | { |
| 14600 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 14601 | "%s: sme_AcquireGlobalLock error!", |
| 14602 | __func__); |
| 14603 | vos_mem_free(sme_sap_auth_offload_info); |
| 14604 | status = eHAL_STATUS_FAILURE; |
| 14605 | } |
| 14606 | |
| 14607 | return (status); |
| 14608 | } |
| 14609 | #endif |