Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | 0fb93dd | 2014-02-19 00:32:59 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame] | 23 | * Copyright (c) 2012-2014 Qualcomm Atheros, Inc. |
| 24 | * All Rights Reserved. |
| 25 | * Qualcomm Atheros Confidential and Proprietary. |
Kiet Lam | 0fb93dd | 2014-02-19 00:32:59 -0800 | [diff] [blame] | 26 | * |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 27 | */ |
Kiet Lam | 0fb93dd | 2014-02-19 00:32:59 -0800 | [diff] [blame] | 28 | |
| 29 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 30 | /**========================================================================= |
| 31 | |
| 32 | \file smeApi.c |
| 33 | |
| 34 | \brief Definitions for SME APIs |
| 35 | |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame] | 36 | Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. |
| 37 | |
| 38 | Qualcomm Confidential and Proprietary. |
| 39 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 40 | ========================================================================*/ |
| 41 | |
| 42 | /*=========================================================================== |
| 43 | |
| 44 | EDIT HISTORY FOR FILE |
| 45 | |
| 46 | |
| 47 | This section contains comments describing changes made to the module. |
| 48 | Notice that changes are listed in reverse chronological order. |
| 49 | |
| 50 | |
| 51 | |
| 52 | when who what, where, why |
| 53 | ---------- --- -------------------------------------------------------- |
| 54 | 06/03/10 js Added support to hostapd driven |
| 55 | * deauth/disassoc/mic failure |
| 56 | |
| 57 | ===========================================================================*/ |
| 58 | |
| 59 | /*-------------------------------------------------------------------------- |
| 60 | Include Files |
| 61 | ------------------------------------------------------------------------*/ |
| 62 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 63 | |
| 64 | #include "smsDebug.h" |
| 65 | #include "sme_Api.h" |
| 66 | #include "csrInsideApi.h" |
| 67 | #include "smeInside.h" |
| 68 | #include "csrInternal.h" |
| 69 | #include "wlan_qct_wda.h" |
| 70 | #include "halMsgApi.h" |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 71 | #include "vos_trace.h" |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 72 | #include "sme_Trace.h" |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 73 | #include "vos_types.h" |
| 74 | #include "vos_trace.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 75 | #include "sapApi.h" |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 76 | #include "macTrace.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 77 | |
| 78 | |
| 79 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 80 | extern tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); |
| 81 | |
| 82 | #include <wlan_qct_pal_api.h> |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 83 | #define LOG_SIZE 256 |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 84 | #define READ_MEMORY_DUMP_CMD 9 |
Madan Mohan Koyyalamudi | 8af9b40 | 2013-07-11 14:59:10 +0530 | [diff] [blame] | 85 | #define TL_INIT_STATE 0 |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 86 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 87 | |
| 88 | #define CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE 1000*30 //30s |
| 89 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 90 | // TxMB Functions |
| 91 | extern eHalStatus pmcPrepareCommand( tpAniSirGlobal pMac, eSmeCommandType cmdType, void *pvParam, |
| 92 | tANI_U32 size, tSmeCmd **ppCmd ); |
| 93 | extern void pmcReleaseCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 94 | extern void qosReleaseCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 95 | extern eHalStatus p2pProcessRemainOnChannelCmd(tpAniSirGlobal pMac, tSmeCmd *p2pRemainonChn); |
| 96 | extern eHalStatus sme_remainOnChnRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg); |
| 97 | extern eHalStatus sme_mgmtFrmInd( tHalHandle hHal, tpSirSmeMgmtFrameInd pSmeMgmtFrm); |
| 98 | extern eHalStatus sme_remainOnChnReady( tHalHandle hHal, tANI_U8* pMsg); |
| 99 | extern eHalStatus sme_sendActionCnf( tHalHandle hHal, tANI_U8* pMsg); |
| 100 | extern eHalStatus p2pProcessNoAReq(tpAniSirGlobal pMac, tSmeCmd *pNoACmd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 101 | |
| 102 | static eHalStatus initSmeCmdList(tpAniSirGlobal pMac); |
| 103 | static void smeAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping ); |
| 104 | |
| 105 | eCsrPhyMode sme_GetPhyMode(tHalHandle hHal); |
| 106 | |
| 107 | eHalStatus sme_HandleChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf); |
| 108 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 109 | eHalStatus sme_HandleGenericChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf); |
| 110 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 111 | eHalStatus sme_HandlePreChannelSwitchInd(tHalHandle hHal); |
| 112 | |
| 113 | eHalStatus sme_HandlePostChannelSwitchInd(tHalHandle hHal); |
| 114 | |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 115 | #ifdef FEATURE_WLAN_LFR |
| 116 | tANI_BOOLEAN csrIsScanAllowed(tpAniSirGlobal pMac); |
| 117 | #endif |
| 118 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 119 | #ifdef WLAN_FEATURE_11W |
| 120 | eHalStatus sme_UnprotectedMgmtFrmInd( tHalHandle hHal, |
| 121 | tpSirSmeUnprotMgmtFrameInd pSmeMgmtFrm ); |
| 122 | #endif |
| 123 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 124 | //Internal SME APIs |
| 125 | eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme) |
| 126 | { |
| 127 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 128 | |
| 129 | if(psSme) |
| 130 | { |
| 131 | if( VOS_IS_STATUS_SUCCESS( vos_lock_acquire( &psSme->lkSmeGlobalLock) ) ) |
| 132 | { |
| 133 | status = eHAL_STATUS_SUCCESS; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | return (status); |
| 138 | } |
| 139 | |
| 140 | |
| 141 | eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme) |
| 142 | { |
| 143 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 144 | |
| 145 | if(psSme) |
| 146 | { |
| 147 | if( VOS_IS_STATUS_SUCCESS( vos_lock_release( &psSme->lkSmeGlobalLock) ) ) |
| 148 | { |
| 149 | status = eHAL_STATUS_SUCCESS; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | return (status); |
| 154 | } |
| 155 | |
| 156 | |
| 157 | |
| 158 | static eHalStatus initSmeCmdList(tpAniSirGlobal pMac) |
| 159 | { |
| 160 | eHalStatus status; |
| 161 | tSmeCmd *pCmd; |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 162 | tANI_U32 cmd_idx; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 163 | VOS_STATUS vosStatus; |
| 164 | vos_timer_t* cmdTimeoutTimer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 165 | |
| 166 | pMac->sme.totalSmeCmd = SME_TOTAL_COMMAND; |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 167 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 168 | &pMac->sme.smeCmdActiveList))) |
| 169 | goto end; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 170 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 171 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 172 | &pMac->sme.smeCmdPendingList))) |
| 173 | goto end; |
| 174 | |
| 175 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 176 | &pMac->sme.smeScanCmdActiveList))) |
| 177 | goto end; |
| 178 | |
| 179 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 180 | &pMac->sme.smeScanCmdPendingList))) |
| 181 | goto end; |
| 182 | |
| 183 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 184 | &pMac->sme.smeCmdFreeList))) |
| 185 | goto end; |
| 186 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 187 | pCmd = vos_mem_malloc(sizeof(tSmeCmd) * pMac->sme.totalSmeCmd); |
| 188 | if ( NULL == pCmd ) |
| 189 | status = eHAL_STATUS_FAILURE; |
| 190 | else |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 191 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 192 | status = eHAL_STATUS_SUCCESS; |
| 193 | |
| 194 | vos_mem_set(pCmd, sizeof(tSmeCmd) * pMac->sme.totalSmeCmd, 0); |
| 195 | pMac->sme.pSmeCmdBufAddr = pCmd; |
| 196 | |
| 197 | for (cmd_idx = 0; cmd_idx < pMac->sme.totalSmeCmd; cmd_idx++) |
| 198 | { |
| 199 | csrLLInsertTail(&pMac->sme.smeCmdFreeList, |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 200 | &pCmd[cmd_idx].Link, LL_ACCESS_LOCK); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 201 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 202 | } |
| 203 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 204 | /* This timer is only to debug the active list command timeout */ |
| 205 | |
| 206 | cmdTimeoutTimer = (vos_timer_t*)vos_mem_malloc(sizeof(vos_timer_t)); |
| 207 | if (cmdTimeoutTimer) |
| 208 | { |
| 209 | pMac->sme.smeCmdActiveList.cmdTimeoutTimer = cmdTimeoutTimer; |
| 210 | vosStatus = |
| 211 | vos_timer_init( pMac->sme.smeCmdActiveList.cmdTimeoutTimer, |
| 212 | VOS_TIMER_TYPE_SW, |
| 213 | activeListCmdTimeoutHandle, |
| 214 | (void*) pMac); |
| 215 | |
| 216 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 217 | { |
| 218 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 219 | "Init Timer fail for active list command process time out"); |
| 220 | vos_mem_free(pMac->sme.smeCmdActiveList.cmdTimeoutTimer); |
| 221 | } |
| 222 | else |
| 223 | { |
| 224 | pMac->sme.smeCmdActiveList.cmdTimeoutDuration = |
| 225 | CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE; |
| 226 | } |
| 227 | } |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 228 | end: |
| 229 | if (!HAL_STATUS_SUCCESS(status)) |
| 230 | smsLog(pMac, LOGE, "failed to initialize sme command list:%d\n", |
| 231 | status); |
| 232 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 233 | return (status); |
| 234 | } |
| 235 | |
| 236 | |
| 237 | void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd) |
| 238 | { |
| 239 | pCmd->command = eSmeNoCommand; |
| 240 | csrLLInsertTail(&pMac->sme.smeCmdFreeList, &pCmd->Link, LL_ACCESS_LOCK); |
| 241 | } |
| 242 | |
| 243 | |
| 244 | |
| 245 | static void smeReleaseCmdList(tpAniSirGlobal pMac, tDblLinkList *pList) |
| 246 | { |
| 247 | tListElem *pEntry; |
| 248 | tSmeCmd *pCommand; |
| 249 | |
| 250 | while((pEntry = csrLLRemoveHead(pList, LL_ACCESS_LOCK)) != NULL) |
| 251 | { |
| 252 | //TODO: base on command type to call release functions |
| 253 | //reinitialize different command types so they can be reused |
| 254 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 255 | smeAbortCommand(pMac, pCommand, eANI_BOOLEAN_TRUE); |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | static void purgeSmeCmdList(tpAniSirGlobal pMac) |
| 260 | { |
| 261 | //release any out standing commands back to free command list |
| 262 | smeReleaseCmdList(pMac, &pMac->sme.smeCmdPendingList); |
| 263 | smeReleaseCmdList(pMac, &pMac->sme.smeCmdActiveList); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 264 | smeReleaseCmdList(pMac, &pMac->sme.smeScanCmdPendingList); |
| 265 | smeReleaseCmdList(pMac, &pMac->sme.smeScanCmdActiveList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 266 | } |
| 267 | |
Madan Mohan Koyyalamudi | 2125599 | 2013-08-01 18:00:25 +0530 | [diff] [blame] | 268 | void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId, |
| 269 | tDblLinkList *pList) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 270 | { |
| 271 | //release any out standing commands back to free command list |
| 272 | tListElem *pEntry, *pNext; |
| 273 | tSmeCmd *pCommand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 274 | tDblLinkList localList; |
| 275 | |
| 276 | vos_mem_zero(&localList, sizeof(tDblLinkList)); |
| 277 | if(!HAL_STATUS_SUCCESS(csrLLOpen(pMac->hHdd, &localList))) |
| 278 | { |
| 279 | smsLog(pMac, LOGE, FL(" failed to open list")); |
| 280 | return; |
| 281 | } |
| 282 | |
| 283 | csrLLLock(pList); |
| 284 | pEntry = csrLLPeekHead(pList, LL_ACCESS_NOLOCK); |
| 285 | while(pEntry != NULL) |
| 286 | { |
| 287 | pNext = csrLLNext(pList, pEntry, LL_ACCESS_NOLOCK); |
| 288 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 289 | if(pCommand->sessionId == sessionId) |
| 290 | { |
| 291 | if(csrLLRemoveEntry(pList, pEntry, LL_ACCESS_NOLOCK)) |
| 292 | { |
| 293 | csrLLInsertTail(&localList, pEntry, LL_ACCESS_NOLOCK); |
| 294 | } |
| 295 | } |
| 296 | pEntry = pNext; |
| 297 | } |
| 298 | csrLLUnlock(pList); |
| 299 | |
| 300 | while( (pEntry = csrLLRemoveHead(&localList, LL_ACCESS_NOLOCK)) ) |
| 301 | { |
| 302 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 303 | smeAbortCommand(pMac, pCommand, eANI_BOOLEAN_TRUE); |
| 304 | } |
| 305 | csrLLClose(&localList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 306 | } |
| 307 | |
| 308 | |
| 309 | static eHalStatus freeSmeCmdList(tpAniSirGlobal pMac) |
| 310 | { |
| 311 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 312 | |
| 313 | purgeSmeCmdList(pMac); |
| 314 | csrLLClose(&pMac->sme.smeCmdPendingList); |
| 315 | csrLLClose(&pMac->sme.smeCmdActiveList); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 316 | csrLLClose(&pMac->sme.smeScanCmdPendingList); |
| 317 | csrLLClose(&pMac->sme.smeScanCmdActiveList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 318 | csrLLClose(&pMac->sme.smeCmdFreeList); |
| 319 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 320 | /*destroy active list command time out timer */ |
| 321 | vos_timer_destroy(pMac->sme.smeCmdActiveList.cmdTimeoutTimer); |
| 322 | vos_mem_free(pMac->sme.smeCmdActiveList.cmdTimeoutTimer); |
| 323 | pMac->sme.smeCmdActiveList.cmdTimeoutTimer = NULL; |
| 324 | |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 325 | status = vos_lock_acquire(&pMac->sme.lkSmeGlobalLock); |
| 326 | if(status != eHAL_STATUS_SUCCESS) |
| 327 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 328 | smsLog(pMac, LOGE, |
| 329 | FL("Failed to acquire the lock status = %d"), status); |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 330 | goto done; |
| 331 | } |
| 332 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 333 | if(NULL != pMac->sme.pSmeCmdBufAddr) |
| 334 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 335 | vos_mem_free(pMac->sme.pSmeCmdBufAddr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 336 | pMac->sme.pSmeCmdBufAddr = NULL; |
| 337 | } |
| 338 | |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 339 | status = vos_lock_release(&pMac->sme.lkSmeGlobalLock); |
| 340 | if(status != eHAL_STATUS_SUCCESS) |
| 341 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 342 | smsLog(pMac, LOGE, |
| 343 | FL("Failed to release the lock status = %d"), status); |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 344 | } |
| 345 | done: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 346 | return (status); |
| 347 | } |
| 348 | |
| 349 | |
| 350 | void dumpCsrCommandInfo(tpAniSirGlobal pMac, tSmeCmd *pCmd) |
| 351 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 352 | switch( pCmd->command ) |
| 353 | { |
| 354 | case eSmeCommandScan: |
| 355 | smsLog( pMac, LOGE, " scan command reason is %d", pCmd->u.scanCmd.reason ); |
| 356 | break; |
| 357 | |
| 358 | case eSmeCommandRoam: |
| 359 | smsLog( pMac, LOGE, " roam command reason is %d", pCmd->u.roamCmd.roamReason ); |
| 360 | break; |
| 361 | |
| 362 | case eSmeCommandWmStatusChange: |
| 363 | smsLog( pMac, LOGE, " WMStatusChange command type is %d", pCmd->u.wmStatusChangeCmd.Type ); |
| 364 | break; |
| 365 | |
| 366 | case eSmeCommandSetKey: |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 367 | smsLog( pMac, LOGE, " setKey command auth(%d) enc(%d)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 368 | pCmd->u.setKeyCmd.authType, pCmd->u.setKeyCmd.encType ); |
| 369 | break; |
| 370 | |
| 371 | case eSmeCommandRemoveKey: |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 372 | smsLog( pMac, LOGE, " removeKey command auth(%d) enc(%d)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 373 | pCmd->u.removeKeyCmd.authType, pCmd->u.removeKeyCmd.encType ); |
| 374 | break; |
| 375 | |
| 376 | default: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 377 | smsLog( pMac, LOGE, " default: Unhandled command %d", |
| 378 | pCmd->command); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 379 | break; |
| 380 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 381 | } |
| 382 | |
| 383 | tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac ) |
| 384 | { |
| 385 | tSmeCmd *pRetCmd = NULL, *pTempCmd = NULL; |
| 386 | tListElem *pEntry; |
| 387 | |
| 388 | pEntry = csrLLRemoveHead( &pMac->sme.smeCmdFreeList, LL_ACCESS_LOCK ); |
| 389 | |
| 390 | // If we can get another MS Msg buffer, then we are ok. Just link |
| 391 | // the entry onto the linked list. (We are using the linked list |
| 392 | // to keep track of tfhe message buffers). |
| 393 | if ( pEntry ) |
| 394 | { |
| 395 | pRetCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 396 | } |
| 397 | else { |
| 398 | int idx = 1; |
| 399 | |
| 400 | //Cannot change pRetCmd here since it needs to return later. |
| 401 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK ); |
| 402 | if( pEntry ) |
| 403 | { |
| 404 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 405 | } |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 406 | smsLog( pMac, LOGE, "Out of command buffer.... command (0x%X) stuck", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 407 | (pTempCmd) ? pTempCmd->command : eSmeNoCommand ); |
| 408 | if(pTempCmd) |
| 409 | { |
| 410 | if( eSmeCsrCommandMask & pTempCmd->command ) |
| 411 | { |
| 412 | //CSR command is stuck. See what the reason code is for that command |
| 413 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 414 | } |
| 415 | } //if(pTempCmd) |
| 416 | |
| 417 | //dump what is in the pending queue |
| 418 | csrLLLock(&pMac->sme.smeCmdPendingList); |
| 419 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK ); |
| 420 | while(pEntry) |
| 421 | { |
| 422 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 423 | smsLog( pMac, LOGE, "Out of command buffer.... SME pending command #%d (0x%X)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 424 | idx++, pTempCmd->command ); |
| 425 | if( eSmeCsrCommandMask & pTempCmd->command ) |
| 426 | { |
| 427 | //CSR command is stuck. See what the reason code is for that command |
| 428 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 429 | } |
| 430 | pEntry = csrLLNext( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_NOLOCK ); |
| 431 | } |
| 432 | csrLLUnlock(&pMac->sme.smeCmdPendingList); |
| 433 | |
| 434 | //There may be some more command in CSR's own pending queue |
| 435 | csrLLLock(&pMac->roam.roamCmdPendingList); |
| 436 | pEntry = csrLLPeekHead( &pMac->roam.roamCmdPendingList, LL_ACCESS_NOLOCK ); |
| 437 | while(pEntry) |
| 438 | { |
| 439 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 440 | smsLog( pMac, LOGE, "Out of command buffer.... CSR pending command #%d (0x%X)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 441 | idx++, pTempCmd->command ); |
| 442 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 443 | pEntry = csrLLNext( &pMac->roam.roamCmdPendingList, pEntry, LL_ACCESS_NOLOCK ); |
| 444 | } |
| 445 | csrLLUnlock(&pMac->roam.roamCmdPendingList); |
| 446 | } |
| 447 | |
| 448 | return( pRetCmd ); |
| 449 | } |
| 450 | |
| 451 | |
| 452 | void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority ) |
| 453 | { |
| 454 | if ( fHighPriority ) |
| 455 | { |
| 456 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pCmd->Link, LL_ACCESS_LOCK ); |
| 457 | } |
| 458 | else |
| 459 | { |
| 460 | csrLLInsertTail( &pMac->sme.smeCmdPendingList, &pCmd->Link, LL_ACCESS_LOCK ); |
| 461 | } |
| 462 | |
| 463 | // process the command queue... |
| 464 | smeProcessPendingQueue( pMac ); |
| 465 | |
| 466 | return; |
| 467 | } |
| 468 | |
| 469 | |
| 470 | static eSmeCommandType smeIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand ) |
| 471 | { |
| 472 | eSmeCommandType pmcCommand = eSmeNoCommand; |
| 473 | tANI_BOOLEAN fFullPowerNeeded = eANI_BOOLEAN_FALSE; |
| 474 | tPmcState pmcState; |
| 475 | eHalStatus status; |
| 476 | |
| 477 | do |
| 478 | { |
| 479 | pmcState = pmcGetPmcState(pMac); |
| 480 | |
| 481 | status = csrIsFullPowerNeeded( pMac, pCommand, NULL, &fFullPowerNeeded ); |
| 482 | if( !HAL_STATUS_SUCCESS(status) ) |
| 483 | { |
| 484 | //PMC state is not right for the command, drop it |
| 485 | return ( eSmeDropCommand ); |
| 486 | } |
| 487 | if( fFullPowerNeeded ) break; |
| 488 | fFullPowerNeeded = ( ( eSmeCommandAddTs == pCommand->command ) || |
| 489 | ( eSmeCommandDelTs == pCommand->command ) ); |
| 490 | if( fFullPowerNeeded ) break; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 491 | #ifdef FEATURE_OEM_DATA_SUPPORT |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 492 | fFullPowerNeeded = (pmcState == IMPS && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 493 | eSmeCommandOemDataReq == pCommand->command); |
| 494 | if(fFullPowerNeeded) break; |
| 495 | #endif |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 496 | fFullPowerNeeded = (pmcState == IMPS && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 497 | eSmeCommandRemainOnChannel == pCommand->command); |
| 498 | if(fFullPowerNeeded) break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 499 | } while(0); |
| 500 | |
| 501 | if( fFullPowerNeeded ) |
| 502 | { |
| 503 | switch( pmcState ) |
| 504 | { |
| 505 | case IMPS: |
| 506 | case STANDBY: |
| 507 | pmcCommand = eSmeCommandExitImps; |
| 508 | break; |
| 509 | |
| 510 | case BMPS: |
| 511 | pmcCommand = eSmeCommandExitBmps; |
| 512 | break; |
| 513 | |
| 514 | case UAPSD: |
| 515 | pmcCommand = eSmeCommandExitUapsd; |
| 516 | break; |
| 517 | |
| 518 | case WOWL: |
| 519 | pmcCommand = eSmeCommandExitWowl; |
| 520 | break; |
| 521 | |
| 522 | default: |
| 523 | break; |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | return ( pmcCommand ); |
| 528 | } |
| 529 | |
| 530 | |
| 531 | //For commands that need to do extra cleanup. |
| 532 | static void smeAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping ) |
| 533 | { |
| 534 | if( eSmePmcCommandMask & pCommand->command ) |
| 535 | { |
| 536 | pmcAbortCommand( pMac, pCommand, fStopping ); |
| 537 | } |
| 538 | else if ( eSmeCsrCommandMask & pCommand->command ) |
| 539 | { |
| 540 | csrAbortCommand( pMac, pCommand, fStopping ); |
| 541 | } |
| 542 | else |
| 543 | { |
| 544 | switch( pCommand->command ) |
| 545 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 546 | case eSmeCommandRemainOnChannel: |
| 547 | if (NULL != pCommand->u.remainChlCmd.callback) |
| 548 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 549 | remainOnChanCallback callback = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 550 | pCommand->u.remainChlCmd.callback; |
| 551 | /* process the msg */ |
| 552 | if( callback ) |
| 553 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 554 | callback(pMac, pCommand->u.remainChlCmd.callbackCtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 555 | eCSR_SCAN_ABORT ); |
| 556 | } |
| 557 | } |
| 558 | smeReleaseCommand( pMac, pCommand ); |
| 559 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 560 | default: |
| 561 | smeReleaseCommand( pMac, pCommand ); |
| 562 | break; |
| 563 | } |
| 564 | } |
| 565 | } |
| 566 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 567 | tListElem *csrGetCmdToProcess(tpAniSirGlobal pMac, tDblLinkList *pList, |
| 568 | tANI_U8 sessionId, tANI_BOOLEAN fInterlocked) |
| 569 | { |
| 570 | tListElem *pCurEntry = NULL; |
| 571 | tSmeCmd *pCommand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 572 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 573 | /* Go through the list and return the command whose session id is not |
| 574 | * matching with the current ongoing scan cmd sessionId */ |
| 575 | pCurEntry = csrLLPeekHead( pList, LL_ACCESS_LOCK ); |
| 576 | while (pCurEntry) |
| 577 | { |
| 578 | pCommand = GET_BASE_ADDR(pCurEntry, tSmeCmd, Link); |
| 579 | if (pCommand->sessionId != sessionId) |
| 580 | { |
| 581 | smsLog(pMac, LOG1, "selected the command with different sessionId"); |
| 582 | return pCurEntry; |
| 583 | } |
| 584 | |
| 585 | pCurEntry = csrLLNext(pList, pCurEntry, fInterlocked); |
| 586 | } |
| 587 | |
| 588 | smsLog(pMac, LOG1, "No command pending with different sessionId"); |
| 589 | return NULL; |
| 590 | } |
| 591 | |
| 592 | tANI_BOOLEAN smeProcessScanQueue(tpAniSirGlobal pMac) |
| 593 | { |
| 594 | tListElem *pEntry; |
| 595 | tSmeCmd *pCommand; |
| 596 | tListElem *pSmeEntry; |
| 597 | tSmeCmd *pSmeCommand; |
| 598 | tANI_BOOLEAN status = eANI_BOOLEAN_TRUE; |
| 599 | |
| 600 | csrLLLock( &pMac->sme.smeScanCmdActiveList ); |
| 601 | if (csrLLIsListEmpty( &pMac->sme.smeScanCmdActiveList, |
| 602 | LL_ACCESS_NOLOCK )) |
| 603 | { |
| 604 | if (!csrLLIsListEmpty(&pMac->sme.smeScanCmdPendingList, |
| 605 | LL_ACCESS_LOCK)) |
| 606 | { |
| 607 | pEntry = csrLLPeekHead( &pMac->sme.smeScanCmdPendingList, |
| 608 | LL_ACCESS_LOCK ); |
| 609 | if (pEntry) |
| 610 | { |
| 611 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 612 | //We cannot execute any command in wait-for-key state until setKey is through. |
| 613 | if (CSR_IS_WAIT_FOR_KEY( pMac, pCommand->sessionId)) |
| 614 | { |
| 615 | if (!CSR_IS_SET_KEY_COMMAND(pCommand)) |
| 616 | { |
| 617 | smsLog(pMac, LOGE, |
| 618 | " Cannot process command(%d) while waiting for key", |
| 619 | pCommand->command); |
| 620 | status = eANI_BOOLEAN_FALSE; |
| 621 | goto end; |
| 622 | } |
| 623 | } |
| 624 | |
| 625 | if ((!csrLLIsListEmpty(&pMac->sme.smeCmdActiveList, |
| 626 | LL_ACCESS_LOCK ))) |
| 627 | { |
| 628 | pSmeEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, |
| 629 | LL_ACCESS_LOCK); |
| 630 | if (pEntry) |
| 631 | { |
| 632 | pSmeCommand = GET_BASE_ADDR(pEntry, tSmeCmd, |
| 633 | Link) ; |
| 634 | |
| 635 | /* if scan is running on one interface and SME recei |
| 636 | ves the next command on the same interface then |
| 637 | dont the allow the command to be queued to |
| 638 | smeCmdPendingList. If next scan is allowed on |
| 639 | the same interface the CSR state machine will |
| 640 | get screwed up. */ |
| 641 | if (pSmeCommand->sessionId == pCommand->sessionId) |
| 642 | { |
| 643 | status = eANI_BOOLEAN_FALSE; |
| 644 | goto end; |
| 645 | } |
| 646 | } |
| 647 | } |
| 648 | if ( csrLLRemoveEntry( &pMac->sme.smeScanCmdPendingList, |
| 649 | pEntry, LL_ACCESS_LOCK ) ) |
| 650 | { |
| 651 | csrLLInsertHead( &pMac->sme.smeScanCmdActiveList, |
| 652 | &pCommand->Link, LL_ACCESS_NOLOCK ); |
| 653 | |
| 654 | switch (pCommand->command) |
| 655 | { |
| 656 | case eSmeCommandScan: |
| 657 | smsLog(pMac, LOG1, |
| 658 | " Processing scan offload command "); |
| 659 | csrProcessScanCommand( pMac, pCommand ); |
| 660 | break; |
| 661 | default: |
| 662 | smsLog(pMac, LOGE, |
| 663 | " Something wrong, wrong command enqueued" |
| 664 | " to smeScanCmdPendingList"); |
| 665 | pEntry = csrLLRemoveHead( |
| 666 | &pMac->sme.smeScanCmdActiveList, |
| 667 | LL_ACCESS_NOLOCK ); |
| 668 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 669 | smeReleaseCommand( pMac, pCommand ); |
| 670 | break; |
| 671 | } |
| 672 | } |
| 673 | } |
| 674 | } |
| 675 | } |
| 676 | end: |
| 677 | csrLLUnlock(&pMac->sme.smeScanCmdActiveList); |
| 678 | return status; |
| 679 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 680 | |
| 681 | tANI_BOOLEAN smeProcessCommand( tpAniSirGlobal pMac ) |
| 682 | { |
| 683 | tANI_BOOLEAN fContinue = eANI_BOOLEAN_FALSE; |
| 684 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 685 | tListElem *pEntry; |
| 686 | tSmeCmd *pCommand; |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 687 | tListElem *pSmeEntry; |
| 688 | tSmeCmd *pSmeCommand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 689 | eSmeCommandType pmcCommand = eSmeNoCommand; |
| 690 | |
| 691 | // if the ActiveList is empty, then nothing is active so we can process a |
| 692 | // pending command... |
| 693 | //alwasy lock active list before locking pending list |
| 694 | csrLLLock( &pMac->sme.smeCmdActiveList ); |
| 695 | if ( csrLLIsListEmpty( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ) ) |
| 696 | { |
| 697 | if(!csrLLIsListEmpty(&pMac->sme.smeCmdPendingList, LL_ACCESS_LOCK)) |
| 698 | { |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 699 | /* If scan command is pending in the smeScanCmdActive list |
| 700 | * then pick the command from smeCmdPendingList which is |
| 701 | * not matching with the scan command session id. |
| 702 | * At any point of time only one command will be allowed |
| 703 | * on a single session. */ |
| 704 | if ((pMac->fScanOffload) && |
| 705 | (!csrLLIsListEmpty(&pMac->sme.smeScanCmdActiveList, |
| 706 | LL_ACCESS_LOCK))) |
| 707 | { |
| 708 | pSmeEntry = csrLLPeekHead(&pMac->sme.smeScanCmdActiveList, |
| 709 | LL_ACCESS_LOCK); |
| 710 | if (pSmeEntry) |
| 711 | { |
| 712 | pSmeCommand = GET_BASE_ADDR(pSmeEntry, tSmeCmd, Link); |
| 713 | |
| 714 | pEntry = csrGetCmdToProcess(pMac, |
| 715 | &pMac->sme.smeCmdPendingList, |
| 716 | pSmeCommand->sessionId, |
| 717 | LL_ACCESS_LOCK); |
| 718 | goto sme_process_cmd; |
| 719 | } |
| 720 | } |
| 721 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 722 | //Peek the command |
| 723 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdPendingList, LL_ACCESS_LOCK ); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 724 | sme_process_cmd: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 725 | if( pEntry ) |
| 726 | { |
| 727 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 728 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 729 | //We cannot execute any command in wait-for-key state until setKey is through. |
| 730 | if( CSR_IS_WAIT_FOR_KEY( pMac, pCommand->sessionId ) ) |
| 731 | { |
| 732 | if( !CSR_IS_SET_KEY_COMMAND( pCommand ) ) |
| 733 | { |
| 734 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 735 | smsLog(pMac, LOGE, " Cannot process command(%d) while waiting for key", pCommand->command); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 736 | fContinue = eANI_BOOLEAN_FALSE; |
| 737 | goto sme_process_scan_queue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 738 | } |
| 739 | } |
| 740 | pmcCommand = smeIsFullPowerNeeded( pMac, pCommand ); |
| 741 | if( eSmeDropCommand == pmcCommand ) |
| 742 | { |
| 743 | //This command is not ok for current PMC state |
| 744 | if( csrLLRemoveEntry( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_LOCK ) ) |
| 745 | { |
| 746 | smeAbortCommand( pMac, pCommand, eANI_BOOLEAN_FALSE ); |
| 747 | } |
| 748 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 749 | //tell caller to continue |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 750 | fContinue = eANI_BOOLEAN_TRUE; |
| 751 | goto sme_process_scan_queue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 752 | } |
| 753 | else if( eSmeNoCommand != pmcCommand ) |
| 754 | { |
| 755 | tExitBmpsInfo exitBmpsInfo; |
| 756 | void *pv = NULL; |
| 757 | tANI_U32 size = 0; |
| 758 | tSmeCmd *pPmcCmd = NULL; |
| 759 | |
| 760 | if( eSmeCommandExitBmps == pmcCommand ) |
| 761 | { |
| 762 | exitBmpsInfo.exitBmpsReason = eSME_REASON_OTHER; |
| 763 | pv = (void *)&exitBmpsInfo; |
| 764 | size = sizeof(tExitBmpsInfo); |
| 765 | } |
| 766 | //pmcCommand has to be one of the exit power save command |
| 767 | status = pmcPrepareCommand( pMac, pmcCommand, pv, size, &pPmcCmd ); |
| 768 | if( HAL_STATUS_SUCCESS( status ) && pPmcCmd ) |
| 769 | { |
| 770 | //Force this command to wake up the chip |
| 771 | csrLLInsertHead( &pMac->sme.smeCmdActiveList, &pPmcCmd->Link, LL_ACCESS_NOLOCK ); |
| 772 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 773 | fContinue = pmcProcessCommand( pMac, pPmcCmd ); |
| 774 | if( fContinue ) |
| 775 | { |
| 776 | //The command failed, remove it |
| 777 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, &pPmcCmd->Link, LL_ACCESS_NOLOCK ) ) |
| 778 | { |
| 779 | pmcReleaseCommand( pMac, pPmcCmd ); |
| 780 | } |
| 781 | } |
| 782 | } |
| 783 | else |
| 784 | { |
| 785 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 786 | 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] | 787 | //Let it retry |
| 788 | fContinue = eANI_BOOLEAN_TRUE; |
| 789 | } |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 790 | goto sme_process_scan_queue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 791 | } |
| 792 | if ( csrLLRemoveEntry( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_LOCK ) ) |
| 793 | { |
| 794 | // we can reuse the pCommand |
| 795 | |
| 796 | // Insert the command onto the ActiveList... |
| 797 | csrLLInsertHead( &pMac->sme.smeCmdActiveList, &pCommand->Link, LL_ACCESS_NOLOCK ); |
| 798 | |
Rashmi Ramanna | 68b309c | 2014-05-20 11:52:22 +0530 | [diff] [blame^] | 799 | if( pMac->deferImps ) |
| 800 | { |
| 801 | /* IMPS timer is already running so stop it and |
| 802 | * it will get restarted when no command is pending |
| 803 | */ |
| 804 | csrScanStopIdleScanTimer( pMac ); |
| 805 | pMac->scan.fRestartIdleScan = eANI_BOOLEAN_TRUE; |
| 806 | pMac->deferImps = eANI_BOOLEAN_FALSE; |
| 807 | } |
| 808 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 809 | // .... and process the command. |
| 810 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 811 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 812 | TRACE_CODE_SME_COMMAND, pCommand->sessionId, pCommand->command)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 813 | switch ( pCommand->command ) |
| 814 | { |
| 815 | |
| 816 | case eSmeCommandScan: |
| 817 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 818 | status = csrProcessScanCommand( pMac, pCommand ); |
| 819 | break; |
| 820 | |
| 821 | case eSmeCommandRoam: |
| 822 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 823 | status = csrRoamProcessCommand( pMac, pCommand ); |
Madan Mohan Koyyalamudi | 59efbe0 | 2013-01-10 15:38:42 -0800 | [diff] [blame] | 824 | if(!HAL_STATUS_SUCCESS(status)) |
| 825 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 826 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Madan Mohan Koyyalamudi | 59efbe0 | 2013-01-10 15:38:42 -0800 | [diff] [blame] | 827 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 828 | { |
| 829 | csrReleaseCommandRoam( pMac, pCommand ); |
| 830 | } |
| 831 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 832 | break; |
| 833 | |
| 834 | case eSmeCommandWmStatusChange: |
| 835 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 836 | csrRoamProcessWmStatusChangeCommand(pMac, pCommand); |
| 837 | break; |
| 838 | |
| 839 | case eSmeCommandSetKey: |
| 840 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 841 | status = csrRoamProcessSetKeyCommand( pMac, pCommand ); |
| 842 | if(!HAL_STATUS_SUCCESS(status)) |
| 843 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 844 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 845 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 846 | { |
| 847 | csrReleaseCommandSetKey( pMac, pCommand ); |
| 848 | } |
| 849 | } |
| 850 | break; |
| 851 | |
| 852 | case eSmeCommandRemoveKey: |
| 853 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 854 | status = csrRoamProcessRemoveKeyCommand( pMac, pCommand ); |
| 855 | if(!HAL_STATUS_SUCCESS(status)) |
| 856 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 857 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 858 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 859 | { |
| 860 | csrReleaseCommandRemoveKey( pMac, pCommand ); |
| 861 | } |
| 862 | } |
| 863 | break; |
| 864 | |
| 865 | case eSmeCommandAddStaSession: |
| 866 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 867 | csrProcessAddStaSessionCommand( pMac, pCommand ); |
| 868 | break; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 869 | case eSmeCommandDelStaSession: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 870 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 871 | csrProcessDelStaSessionCommand( pMac, pCommand ); |
| 872 | break; |
| 873 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 874 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 875 | case eSmeCommandOemDataReq: |
| 876 | csrLLUnlock(&pMac->sme.smeCmdActiveList); |
| 877 | oemData_ProcessOemDataReqCommand(pMac, pCommand); |
| 878 | break; |
| 879 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 880 | case eSmeCommandRemainOnChannel: |
| 881 | csrLLUnlock(&pMac->sme.smeCmdActiveList); |
| 882 | p2pProcessRemainOnChannelCmd(pMac, pCommand); |
| 883 | break; |
| 884 | case eSmeCommandNoAUpdate: |
| 885 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 886 | p2pProcessNoAReq(pMac,pCommand); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 887 | case eSmeCommandEnterImps: |
| 888 | case eSmeCommandExitImps: |
| 889 | case eSmeCommandEnterBmps: |
| 890 | case eSmeCommandExitBmps: |
| 891 | case eSmeCommandEnterUapsd: |
| 892 | case eSmeCommandExitUapsd: |
| 893 | case eSmeCommandEnterWowl: |
| 894 | case eSmeCommandExitWowl: |
| 895 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 896 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 897 | if( fContinue ) |
| 898 | { |
| 899 | //The command failed, remove it |
| 900 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 901 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 902 | { |
| 903 | pmcReleaseCommand( pMac, pCommand ); |
| 904 | } |
| 905 | } |
| 906 | break; |
| 907 | |
| 908 | //Treat standby differently here because caller may not be able to handle |
| 909 | //the failure so we do our best here |
| 910 | case eSmeCommandEnterStandby: |
| 911 | if( csrIsConnStateDisconnected( pMac, pCommand->sessionId ) ) |
| 912 | { |
| 913 | //It can continue |
| 914 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 915 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 916 | if( fContinue ) |
| 917 | { |
| 918 | //The command failed, remove it |
| 919 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 920 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 921 | { |
| 922 | pmcReleaseCommand( pMac, pCommand ); |
| 923 | } |
| 924 | } |
| 925 | } |
| 926 | else |
| 927 | { |
| 928 | //Need to issue a disconnect first before processing this command |
| 929 | tSmeCmd *pNewCmd; |
| 930 | |
| 931 | //We need to re-run the command |
| 932 | fContinue = eANI_BOOLEAN_TRUE; |
| 933 | //Pull off the standby command first |
| 934 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 935 | &pCommand->Link, LL_ACCESS_NOLOCK ) ) |
| 936 | { |
| 937 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 938 | //Need to call CSR function here because the disconnect command |
| 939 | //is handled by CSR |
| 940 | pNewCmd = csrGetCommandBuffer( pMac ); |
| 941 | if( NULL != pNewCmd ) |
| 942 | { |
| 943 | //Put the standby command to the head of the pending list first |
| 944 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pCommand->Link, |
| 945 | LL_ACCESS_LOCK ); |
| 946 | pNewCmd->command = eSmeCommandRoam; |
| 947 | pNewCmd->u.roamCmd.roamReason = eCsrForcedDisassoc; |
| 948 | //Put the disassoc command before the standby command |
| 949 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pNewCmd->Link, |
| 950 | LL_ACCESS_LOCK ); |
| 951 | } |
| 952 | else |
| 953 | { |
| 954 | //Continue the command here |
| 955 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 956 | if( fContinue ) |
| 957 | { |
| 958 | //The command failed, remove it |
| 959 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 960 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 961 | { |
| 962 | pmcReleaseCommand( pMac, pCommand ); |
| 963 | } |
| 964 | } |
| 965 | } |
| 966 | } |
| 967 | else |
| 968 | { |
| 969 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 970 | smsLog( pMac, LOGE, FL(" failed to remove standby command") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 971 | VOS_ASSERT(0); |
| 972 | } |
| 973 | } |
| 974 | break; |
| 975 | |
| 976 | case eSmeCommandAddTs: |
| 977 | case eSmeCommandDelTs: |
| 978 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 979 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 980 | fContinue = qosProcessCommand( pMac, pCommand ); |
| 981 | if( fContinue ) |
| 982 | { |
| 983 | //The command failed, remove it |
| 984 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 985 | &pCommand->Link, LL_ACCESS_NOLOCK ) ) |
| 986 | { |
| 987 | //#ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 988 | qosReleaseCommand( pMac, pCommand ); |
| 989 | //#endif /* WLAN_MDM_CODE_REDUCTION_OPT*/ |
| 990 | } |
| 991 | } |
| 992 | #endif |
| 993 | break; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 994 | #ifdef FEATURE_WLAN_TDLS |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 995 | case eSmeCommandTdlsSendMgmt: |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 996 | case eSmeCommandTdlsAddPeer: |
| 997 | case eSmeCommandTdlsDelPeer: |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 998 | case eSmeCommandTdlsLinkEstablish: |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 999 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 1000 | case eSmeCommandTdlsDiscovery: |
| 1001 | case eSmeCommandTdlsLinkSetup: |
| 1002 | case eSmeCommandTdlsLinkTear: |
| 1003 | case eSmeCommandTdlsEnterUapsd: |
| 1004 | case eSmeCommandTdlsExitUapsd: |
| 1005 | #endif |
| 1006 | { |
Hoonki Lee | 1090c6a | 2013-01-16 17:40:54 -0800 | [diff] [blame] | 1007 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1008 | "sending TDLS Command 0x%x to PE", pCommand->command); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1009 | |
| 1010 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1011 | status = csrTdlsProcessCmd( pMac, pCommand ); |
| 1012 | } |
| 1013 | break ; |
| 1014 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1015 | |
| 1016 | default: |
| 1017 | //something is wrong |
| 1018 | //remove it from the active list |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1019 | smsLog(pMac, LOGE, " csrProcessCommand processes an unknown command %d", pCommand->command); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1020 | pEntry = csrLLRemoveHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ); |
| 1021 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1022 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 1023 | smeReleaseCommand( pMac, pCommand ); |
| 1024 | status = eHAL_STATUS_FAILURE; |
| 1025 | break; |
| 1026 | } |
| 1027 | if(!HAL_STATUS_SUCCESS(status)) |
| 1028 | { |
| 1029 | fContinue = eANI_BOOLEAN_TRUE; |
| 1030 | } |
| 1031 | }//if(pEntry) |
| 1032 | else |
| 1033 | { |
| 1034 | //This is odd. Some one else pull off the command. |
| 1035 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1036 | } |
| 1037 | } |
| 1038 | else |
| 1039 | { |
| 1040 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1041 | } |
| 1042 | } |
| 1043 | else |
| 1044 | { |
| 1045 | //No command waiting |
| 1046 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1047 | //This is only used to restart an idle mode scan, it means at least one other idle scan has finished. |
| 1048 | if(pMac->scan.fRestartIdleScan && eANI_BOOLEAN_FALSE == pMac->scan.fCancelIdleScan) |
| 1049 | { |
| 1050 | tANI_U32 nTime = 0; |
| 1051 | |
| 1052 | pMac->scan.fRestartIdleScan = eANI_BOOLEAN_FALSE; |
| 1053 | if(!HAL_STATUS_SUCCESS(csrScanTriggerIdleScan(pMac, &nTime))) |
| 1054 | { |
| 1055 | csrScanStartIdleScanTimer(pMac, nTime); |
| 1056 | } |
| 1057 | } |
| 1058 | } |
| 1059 | } |
| 1060 | else { |
| 1061 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1062 | } |
| 1063 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 1064 | sme_process_scan_queue: |
| 1065 | if (pMac->fScanOffload && !(smeProcessScanQueue(pMac))) |
| 1066 | fContinue = eANI_BOOLEAN_FALSE; |
| 1067 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1068 | return ( fContinue ); |
| 1069 | } |
| 1070 | |
| 1071 | void smeProcessPendingQueue( tpAniSirGlobal pMac ) |
| 1072 | { |
| 1073 | while( smeProcessCommand( pMac ) ); |
| 1074 | } |
| 1075 | |
| 1076 | |
| 1077 | tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac) |
| 1078 | { |
| 1079 | return ( !csrLLIsListEmpty( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ) || |
| 1080 | !csrLLIsListEmpty(&pMac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK) ); |
| 1081 | } |
| 1082 | |
| 1083 | |
| 1084 | |
| 1085 | //Global APIs |
| 1086 | |
| 1087 | /*-------------------------------------------------------------------------- |
| 1088 | |
| 1089 | \brief sme_Open() - Initialze all SME modules and put them at idle state |
| 1090 | |
| 1091 | The function initializes each module inside SME, PMC, CCM, CSR, etc. . Upon |
| 1092 | successfully return, all modules are at idle state ready to start. |
| 1093 | |
| 1094 | smeOpen must be called before any other SME APIs can be involved. |
| 1095 | smeOpen must be called after macOpen. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1096 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1097 | \param hHal - The handle returned by macOpen. |
| 1098 | |
| 1099 | \return eHAL_STATUS_SUCCESS - SME is successfully initialized. |
| 1100 | |
| 1101 | Other status means SME is failed to be initialized |
| 1102 | \sa |
| 1103 | |
| 1104 | --------------------------------------------------------------------------*/ |
| 1105 | eHalStatus sme_Open(tHalHandle hHal) |
| 1106 | { |
| 1107 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1108 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1109 | |
| 1110 | do { |
| 1111 | pMac->sme.state = SME_STATE_STOP; |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 1112 | pMac->sme.currDeviceMode = VOS_STA_MODE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1113 | if( !VOS_IS_STATUS_SUCCESS( vos_lock_init( &pMac->sme.lkSmeGlobalLock ) ) ) |
| 1114 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1115 | smsLog( pMac, LOGE, "sme_Open failed init lock" ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1116 | status = eHAL_STATUS_FAILURE; |
| 1117 | break; |
| 1118 | } |
| 1119 | |
| 1120 | status = ccmOpen(hHal); |
| 1121 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1122 | smsLog( pMac, LOGE, |
| 1123 | "ccmOpen failed during initialization with status=%d", status ); |
| 1124 | break; |
| 1125 | } |
| 1126 | |
| 1127 | status = csrOpen(pMac); |
| 1128 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1129 | smsLog( pMac, LOGE, |
| 1130 | "csrOpen failed during initialization with status=%d", status ); |
| 1131 | break; |
| 1132 | } |
| 1133 | |
| 1134 | status = pmcOpen(hHal); |
| 1135 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1136 | smsLog( pMac, LOGE, |
| 1137 | "pmcOpen failed during initialization with status=%d", status ); |
| 1138 | break; |
| 1139 | } |
| 1140 | |
Gopichand Nakkala | 34d1b06 | 2013-03-19 15:28:33 -0700 | [diff] [blame] | 1141 | #ifdef FEATURE_WLAN_TDLS |
| 1142 | pMac->isTdlsPowerSaveProhibited = 0; |
| 1143 | #endif |
| 1144 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1145 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1146 | status = sme_QosOpen(pMac); |
| 1147 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1148 | smsLog( pMac, LOGE, |
| 1149 | "Qos open failed during initialization with status=%d", status ); |
| 1150 | break; |
| 1151 | } |
| 1152 | |
| 1153 | status = btcOpen(pMac); |
| 1154 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1155 | smsLog( pMac, LOGE, |
| 1156 | "btcOpen open failed during initialization with status=%d", status ); |
| 1157 | break; |
| 1158 | } |
| 1159 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1160 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1161 | status = oemData_OemDataReqOpen(pMac); |
| 1162 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1163 | smsLog(pMac, LOGE, |
| 1164 | "oemData_OemDataReqOpen failed during initialization with status=%d", status ); |
| 1165 | break; |
| 1166 | } |
| 1167 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1168 | |
| 1169 | if(!HAL_STATUS_SUCCESS((status = initSmeCmdList(pMac)))) |
| 1170 | break; |
| 1171 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1172 | { |
| 1173 | v_PVOID_t pvosGCtx = vos_get_global_context(VOS_MODULE_ID_SAP, NULL); |
| 1174 | if ( NULL == pvosGCtx ){ |
| 1175 | smsLog( pMac, LOGE, "WLANSAP_Open open failed during initialization"); |
| 1176 | status = eHAL_STATUS_FAILURE; |
| 1177 | break; |
| 1178 | } |
| 1179 | |
| 1180 | status = WLANSAP_Open( pvosGCtx ); |
| 1181 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1182 | smsLog( pMac, LOGE, |
| 1183 | "WLANSAP_Open open failed during initialization with status=%d", status ); |
| 1184 | break; |
| 1185 | } |
| 1186 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1187 | #if defined WLAN_FEATURE_VOWIFI |
| 1188 | status = rrmOpen(pMac); |
| 1189 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1190 | smsLog( pMac, LOGE, |
| 1191 | "rrmOpen open failed during initialization with status=%d", status ); |
| 1192 | break; |
| 1193 | } |
| 1194 | #endif |
| 1195 | |
| 1196 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 1197 | sme_FTOpen(pMac); |
| 1198 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1199 | sme_p2pOpen(pMac); |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1200 | smeTraceInit(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1201 | |
| 1202 | }while (0); |
| 1203 | |
| 1204 | return status; |
| 1205 | } |
| 1206 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1207 | /*-------------------------------------------------------------------------- |
| 1208 | |
| 1209 | \brief sme_set11dinfo() - Set the 11d information about valid channels |
| 1210 | and there power using information from nvRAM |
| 1211 | This function is called only for AP. |
| 1212 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1213 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1214 | |
| 1215 | \param hHal - The handle returned by macOpen. |
| 1216 | \Param pSmeConfigParams - a pointer to a caller allocated object of |
| 1217 | typedef struct _smeConfigParams. |
| 1218 | |
| 1219 | \return eHAL_STATUS_SUCCESS - SME update the config parameters successfully. |
| 1220 | |
| 1221 | Other status means SME is failed to update the config parameters. |
| 1222 | \sa |
| 1223 | --------------------------------------------------------------------------*/ |
| 1224 | |
| 1225 | eHalStatus sme_set11dinfo(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) |
| 1226 | { |
| 1227 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1228 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1229 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1230 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1231 | TRACE_CODE_SME_RX_HDD_MSG_SET_11DINFO, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1232 | if (NULL == pSmeConfigParams ) { |
| 1233 | smsLog( pMac, LOGE, |
| 1234 | "Empty config param structure for SME, nothing to update"); |
| 1235 | return status; |
| 1236 | } |
| 1237 | |
| 1238 | status = csrSetChannels(hHal, &pSmeConfigParams->csrConfig ); |
| 1239 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1240 | smsLog( pMac, LOGE, "csrChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1241 | status ); |
| 1242 | } |
| 1243 | return status; |
| 1244 | } |
| 1245 | |
| 1246 | /*-------------------------------------------------------------------------- |
| 1247 | |
| 1248 | \brief sme_getSoftApDomain() - Get the current regulatory domain of softAp. |
| 1249 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1250 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1251 | |
| 1252 | \param hHal - The handle returned by HostapdAdapter. |
| 1253 | \Param v_REGDOMAIN_t - The current Regulatory Domain requested for SoftAp. |
| 1254 | |
| 1255 | \return eHAL_STATUS_SUCCESS - SME successfully completed the request. |
| 1256 | |
| 1257 | Other status means, failed to get the current regulatory domain. |
| 1258 | \sa |
| 1259 | --------------------------------------------------------------------------*/ |
| 1260 | |
| 1261 | eHalStatus sme_getSoftApDomain(tHalHandle hHal, v_REGDOMAIN_t *domainIdSoftAp) |
| 1262 | { |
| 1263 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1264 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1265 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1266 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1267 | TRACE_CODE_SME_RX_HDD_MSG_GET_SOFTAP_DOMAIN, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1268 | if (NULL == domainIdSoftAp ) { |
| 1269 | smsLog( pMac, LOGE, "Uninitialized domain Id"); |
| 1270 | return status; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1271 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1272 | |
| 1273 | *domainIdSoftAp = pMac->scan.domainIdCurrent; |
| 1274 | status = eHAL_STATUS_SUCCESS; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1275 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1276 | return status; |
| 1277 | } |
| 1278 | |
| 1279 | |
| 1280 | eHalStatus sme_setRegInfo(tHalHandle hHal, tANI_U8 *apCntryCode) |
| 1281 | { |
| 1282 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1283 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1284 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1285 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1286 | TRACE_CODE_SME_RX_HDD_MSG_SET_REGINFO, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1287 | if (NULL == apCntryCode ) { |
| 1288 | smsLog( pMac, LOGE, "Empty Country Code, nothing to update"); |
| 1289 | return status; |
| 1290 | } |
| 1291 | |
| 1292 | status = csrSetRegInfo(hHal, apCntryCode ); |
| 1293 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1294 | smsLog( pMac, LOGE, "csrSetRegInfo failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1295 | status ); |
| 1296 | } |
| 1297 | return status; |
| 1298 | } |
| 1299 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1300 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 1301 | /*-------------------------------------------------------------------------- |
| 1302 | |
| 1303 | \brief sme_UpdateChannelConfig() - Update channel configuration in RIVA. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1304 | |
| 1305 | It is used at driver start up to inform RIVA of the default channel |
| 1306 | configuration. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1307 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1308 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1309 | |
| 1310 | \param hHal - The handle returned by macOpen. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1311 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1312 | \return eHAL_STATUS_SUCCESS - SME update the channel config successfully. |
| 1313 | |
| 1314 | Other status means SME is failed to update the channel config. |
| 1315 | \sa |
| 1316 | |
| 1317 | --------------------------------------------------------------------------*/ |
| 1318 | eHalStatus sme_UpdateChannelConfig(tHalHandle hHal) |
| 1319 | { |
| 1320 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1321 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1322 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1323 | TRACE_CODE_SME_RX_HDD_MSG_UPDATE_CHANNEL_CONFIG, NO_SESSION, 0)); |
| 1324 | pmcUpdateScanParams( pMac, &(pMac->roam.configParam), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1325 | &pMac->scan.base20MHzChannels, FALSE); |
| 1326 | return eHAL_STATUS_SUCCESS; |
| 1327 | } |
| 1328 | #endif // FEATURE_WLAN_SCAN_PNLO |
| 1329 | |
| 1330 | /*-------------------------------------------------------------------------- |
| 1331 | |
| 1332 | \brief sme_UpdateConfig() - Change configurations for all SME moduels |
| 1333 | |
| 1334 | The function updates some configuration for modules in SME, CCM, CSR, etc |
| 1335 | during SMEs close open sequence. |
| 1336 | |
| 1337 | Modules inside SME apply the new configuration at the next transaction. |
| 1338 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1339 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1340 | |
| 1341 | \param hHal - The handle returned by macOpen. |
| 1342 | \Param pSmeConfigParams - a pointer to a caller allocated object of |
| 1343 | typedef struct _smeConfigParams. |
| 1344 | |
| 1345 | \return eHAL_STATUS_SUCCESS - SME update the config parameters successfully. |
| 1346 | |
| 1347 | Other status means SME is failed to update the config parameters. |
| 1348 | \sa |
| 1349 | |
| 1350 | --------------------------------------------------------------------------*/ |
| 1351 | eHalStatus sme_UpdateConfig(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) |
| 1352 | { |
| 1353 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1354 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1355 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1356 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1357 | TRACE_CODE_SME_RX_HDD_MSG_UPDATE_CONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1358 | if (NULL == pSmeConfigParams ) { |
| 1359 | smsLog( pMac, LOGE, |
| 1360 | "Empty config param structure for SME, nothing to update"); |
| 1361 | return status; |
| 1362 | } |
| 1363 | |
| 1364 | status = csrChangeDefaultConfigParam(pMac, &pSmeConfigParams->csrConfig); |
| 1365 | |
| 1366 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1367 | smsLog( pMac, LOGE, "csrChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1368 | status ); |
| 1369 | } |
| 1370 | #if defined WLAN_FEATURE_P2P_INTERNAL |
| 1371 | status = p2pChangeDefaultConfigParam(pMac, &pSmeConfigParams->p2pConfig); |
| 1372 | |
| 1373 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1374 | smsLog( pMac, LOGE, "p2pChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1375 | status ); |
| 1376 | } |
| 1377 | #endif |
| 1378 | #if defined WLAN_FEATURE_VOWIFI |
| 1379 | status = rrmChangeDefaultConfigParam(hHal, &pSmeConfigParams->rrmConfig); |
| 1380 | |
| 1381 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1382 | smsLog( pMac, LOGE, "rrmChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1383 | status ); |
| 1384 | } |
| 1385 | #endif |
| 1386 | //For SOC, CFG is set before start |
| 1387 | //We don't want to apply global CFG in connect state because that may cause some side affect |
| 1388 | if( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1389 | csrIsAllSessionDisconnected( pMac) ) |
| 1390 | { |
| 1391 | csrSetGlobalCfgs(pMac); |
| 1392 | } |
| 1393 | |
Gopichand Nakkala | 86e4266 | 2013-06-11 17:44:11 +0530 | [diff] [blame] | 1394 | /* update the directed scan offload setting */ |
| 1395 | pMac->fScanOffload = pSmeConfigParams->fScanOffload; |
| 1396 | |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 1397 | /* Enable channel bonding mode in 2.4GHz */ |
| 1398 | if ((pSmeConfigParams->csrConfig.channelBondingMode24GHz == TRUE) && |
| 1399 | (IS_HT40_OBSS_SCAN_FEATURE_ENABLE)) |
| 1400 | { |
| 1401 | ccmCfgSetInt(hHal,WNI_CFG_CHANNEL_BONDING_24G, |
| 1402 | eANI_BOOLEAN_TRUE, NULL,eANI_BOOLEAN_FALSE); |
| 1403 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, |
| 1404 | "Setting channelBondingMode24GHz:%d " , |
| 1405 | pSmeConfigParams->csrConfig.channelBondingMode24GHz); |
| 1406 | } |
Madan Mohan Koyyalamudi | d89feb7 | 2013-07-31 15:47:12 +0530 | [diff] [blame] | 1407 | if (pMac->fScanOffload) |
| 1408 | { |
| 1409 | /* If scan offload is enabled then lim has allow the sending of |
| 1410 | scan request to firmware even in powersave mode. The firmware has |
| 1411 | to take care of exiting from power save mode */ |
| 1412 | status = ccmCfgSetInt(hHal, WNI_CFG_SCAN_IN_POWERSAVE, |
| 1413 | eANI_BOOLEAN_TRUE, NULL, eANI_BOOLEAN_FALSE); |
| 1414 | |
| 1415 | if (eHAL_STATUS_SUCCESS != status) |
| 1416 | { |
| 1417 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1418 | "Could not pass on WNI_CFG_SCAN_IN_POWERSAVE to CCM"); |
| 1419 | } |
| 1420 | } |
krunal soni | e9002db | 2013-11-25 14:24:17 -0800 | [diff] [blame] | 1421 | pMac->isCoalesingInIBSSAllowed = |
| 1422 | pSmeConfigParams->csrConfig.isCoalesingInIBSSAllowed; |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 1423 | pMac->fEnableDebugLog = pSmeConfigParams->fEnableDebugLog; |
Rashmi Ramanna | 68b309c | 2014-05-20 11:52:22 +0530 | [diff] [blame^] | 1424 | pMac->fDeferIMPSTime = pSmeConfigParams->fDeferIMPSTime; |
| 1425 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1426 | return status; |
| 1427 | } |
| 1428 | |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 1429 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 1430 | void sme_ProcessGetGtkInfoRsp( tHalHandle hHal, |
| 1431 | tpSirGtkOffloadGetInfoRspParams pGtkOffloadGetInfoRsp) |
| 1432 | { |
| 1433 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1434 | |
| 1435 | if (NULL == pMac) |
| 1436 | { |
| 1437 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 1438 | "%s: pMac is null", __func__); |
| 1439 | return ; |
| 1440 | } |
| 1441 | if (pMac->pmc.GtkOffloadGetInfoCB == NULL) |
| 1442 | { |
| 1443 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1444 | "%s: HDD callback is null", __func__); |
| 1445 | return ; |
| 1446 | } |
| 1447 | pMac->pmc.GtkOffloadGetInfoCB(pMac->pmc.GtkOffloadGetInfoCBContext, |
| 1448 | pGtkOffloadGetInfoRsp); |
| 1449 | } |
| 1450 | #endif |
| 1451 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1452 | /* --------------------------------------------------------------------------- |
| 1453 | \fn sme_ChangeConfigParams |
| 1454 | \brief The SME API exposed for HDD to provide config params to SME during |
| 1455 | SMEs stop -> start sequence. |
| 1456 | |
| 1457 | If HDD changed the domain that will cause a reset. This function will |
| 1458 | provide the new set of 11d information for the new domain. Currrently this |
| 1459 | API provides info regarding 11d only at reset but we can extend this for |
| 1460 | other params (PMC, QoS) which needs to be initialized again at reset. |
| 1461 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1462 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1463 | |
| 1464 | \param hHal - The handle returned by macOpen. |
| 1465 | |
| 1466 | \Param |
| 1467 | pUpdateConfigParam - a pointer to a structure (tCsrUpdateConfigParam) that |
| 1468 | currently provides 11d related information like Country code, |
| 1469 | Regulatory domain, valid channel list, Tx power per channel, a |
| 1470 | list with active/passive scan allowed per valid channel. |
| 1471 | |
| 1472 | \return eHalStatus |
| 1473 | ---------------------------------------------------------------------------*/ |
| 1474 | eHalStatus sme_ChangeConfigParams(tHalHandle hHal, |
| 1475 | tCsrUpdateConfigParam *pUpdateConfigParam) |
| 1476 | { |
| 1477 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1478 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1479 | |
| 1480 | if (NULL == pUpdateConfigParam ) { |
| 1481 | smsLog( pMac, LOGE, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1482 | "Empty config param structure for SME, nothing to reset"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1483 | return status; |
| 1484 | } |
| 1485 | |
| 1486 | status = csrChangeConfigParams(pMac, pUpdateConfigParam); |
| 1487 | |
| 1488 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1489 | smsLog( pMac, LOGE, "csrUpdateConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1490 | status ); |
| 1491 | } |
| 1492 | |
| 1493 | return status; |
| 1494 | |
| 1495 | } |
| 1496 | |
| 1497 | /*-------------------------------------------------------------------------- |
| 1498 | |
| 1499 | \brief sme_HDDReadyInd() - SME sends eWNI_SME_SYS_READY_IND to PE to inform |
| 1500 | that the NIC is ready tio run. |
| 1501 | |
| 1502 | The function is called by HDD at the end of initialization stage so PE/HAL can |
| 1503 | enable the NIC to running state. |
| 1504 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1505 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1506 | \param hHal - The handle returned by macOpen. |
| 1507 | |
| 1508 | \return eHAL_STATUS_SUCCESS - eWNI_SME_SYS_READY_IND is sent to PE |
| 1509 | successfully. |
| 1510 | |
| 1511 | Other status means SME failed to send the message to PE. |
| 1512 | \sa |
| 1513 | |
| 1514 | --------------------------------------------------------------------------*/ |
| 1515 | eHalStatus sme_HDDReadyInd(tHalHandle hHal) |
| 1516 | { |
| 1517 | tSirSmeReadyReq Msg; |
| 1518 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1519 | tPmcPowerState powerState; |
| 1520 | tPmcSwitchState hwWlanSwitchState; |
| 1521 | tPmcSwitchState swWlanSwitchState; |
| 1522 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1523 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1524 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1525 | TRACE_CODE_SME_RX_HDD_MSG_HDDREADYIND, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1526 | do |
| 1527 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1528 | |
| 1529 | Msg.messageType = eWNI_SME_SYS_READY_IND; |
| 1530 | Msg.length = sizeof( tSirSmeReadyReq ); |
| 1531 | |
| 1532 | if (eSIR_FAILURE != uMacPostCtrlMsg( hHal, (tSirMbMsg*)&Msg )) |
| 1533 | { |
| 1534 | status = eHAL_STATUS_SUCCESS; |
| 1535 | } |
| 1536 | else |
| 1537 | { |
| 1538 | smsLog( pMac, LOGE, |
| 1539 | "uMacPostCtrlMsg failed to send eWNI_SME_SYS_READY_IND"); |
| 1540 | break; |
| 1541 | } |
| 1542 | |
| 1543 | status = pmcQueryPowerState( hHal, &powerState, |
| 1544 | &hwWlanSwitchState, &swWlanSwitchState ); |
| 1545 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1546 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1547 | smsLog( pMac, LOGE, "pmcQueryPowerState failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1548 | status ); |
| 1549 | break; |
| 1550 | } |
| 1551 | |
| 1552 | if ( (ePMC_SWITCH_OFF != hwWlanSwitchState) && |
| 1553 | (ePMC_SWITCH_OFF != swWlanSwitchState) ) |
| 1554 | { |
| 1555 | status = csrReady(pMac); |
| 1556 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1557 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1558 | smsLog( pMac, LOGE, "csrReady failed with status=%d", status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1559 | break; |
| 1560 | } |
| 1561 | status = pmcReady(hHal); |
| 1562 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1563 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1564 | smsLog( pMac, LOGE, "pmcReady failed with status=%d", status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1565 | break; |
| 1566 | } |
| 1567 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1568 | if(VOS_STATUS_SUCCESS != btcReady(hHal)) |
| 1569 | { |
| 1570 | status = eHAL_STATUS_FAILURE; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1571 | smsLog( pMac, LOGE, "btcReady failed"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1572 | break; |
| 1573 | } |
| 1574 | #endif |
| 1575 | |
| 1576 | #if defined WLAN_FEATURE_VOWIFI |
| 1577 | if(VOS_STATUS_SUCCESS != rrmReady(hHal)) |
| 1578 | { |
| 1579 | status = eHAL_STATUS_FAILURE; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1580 | smsLog( pMac, LOGE, "rrmReady failed"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1581 | break; |
| 1582 | } |
| 1583 | #endif |
| 1584 | } |
| 1585 | pMac->sme.state = SME_STATE_READY; |
| 1586 | } while( 0 ); |
| 1587 | |
| 1588 | return status; |
| 1589 | } |
| 1590 | |
| 1591 | /*-------------------------------------------------------------------------- |
| 1592 | |
| 1593 | \brief sme_Start() - Put all SME modules at ready state. |
| 1594 | |
| 1595 | The function starts each module in SME, PMC, CCM, CSR, etc. . Upon |
| 1596 | successfully return, all modules are ready to run. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1597 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1598 | \param hHal - The handle returned by macOpen. |
| 1599 | |
| 1600 | \return eHAL_STATUS_SUCCESS - SME is ready. |
| 1601 | |
| 1602 | Other status means SME is failed to start |
| 1603 | \sa |
| 1604 | |
| 1605 | --------------------------------------------------------------------------*/ |
| 1606 | eHalStatus sme_Start(tHalHandle hHal) |
| 1607 | { |
| 1608 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1609 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1610 | |
| 1611 | do |
| 1612 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1613 | status = csrStart(pMac); |
| 1614 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1615 | smsLog( pMac, LOGE, "csrStart failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1616 | status ); |
| 1617 | break; |
| 1618 | } |
| 1619 | |
| 1620 | status = pmcStart(hHal); |
| 1621 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1622 | smsLog( pMac, LOGE, "pmcStart failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1623 | status ); |
| 1624 | break; |
| 1625 | } |
| 1626 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1627 | status = WLANSAP_Start(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 1628 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1629 | smsLog( pMac, LOGE, "WLANSAP_Start failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1630 | status ); |
| 1631 | break; |
| 1632 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1633 | pMac->sme.state = SME_STATE_START; |
| 1634 | }while (0); |
| 1635 | |
| 1636 | return status; |
| 1637 | } |
| 1638 | |
| 1639 | |
| 1640 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 1641 | /****************************************************************************** |
| 1642 | * |
| 1643 | * Name: sme_PCFilterMatchCountResponseHandler |
| 1644 | * |
| 1645 | * Description: |
| 1646 | * Invoke Packet Coalescing Filter Match Count callback routine |
| 1647 | * |
| 1648 | * Parameters: |
| 1649 | * hHal - HAL handle for device |
| 1650 | * pMsg - Pointer to tRcvFltPktMatchRsp structure |
| 1651 | * |
| 1652 | * Returns: eHalStatus |
| 1653 | * |
| 1654 | ******************************************************************************/ |
| 1655 | eHalStatus sme_PCFilterMatchCountResponseHandler(tHalHandle hHal, void* pMsg) |
| 1656 | { |
| 1657 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 1658 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1659 | tpSirRcvFltPktMatchRsp pRcvFltPktMatchRsp = (tpSirRcvFltPktMatchRsp)pMsg; |
| 1660 | |
| 1661 | if (NULL == pMsg) |
| 1662 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1663 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1664 | status = eHAL_STATUS_FAILURE; |
| 1665 | } |
| 1666 | else |
| 1667 | { |
| 1668 | smsLog(pMac, LOG2, "SME: entering " |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1669 | "sme_FilterMatchCountResponseHandler"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1670 | |
| 1671 | /* Call Packet Coalescing Filter Match Count callback routine. */ |
| 1672 | if (pMac->pmc.FilterMatchCountCB != NULL) |
| 1673 | pMac->pmc.FilterMatchCountCB(pMac->pmc.FilterMatchCountCBContext, |
| 1674 | pRcvFltPktMatchRsp); |
| 1675 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1676 | smsLog(pMac, LOG1, "%s: status=0x%x", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1677 | pRcvFltPktMatchRsp->status); |
| 1678 | |
| 1679 | pMac->pmc.FilterMatchCountCB = NULL; |
| 1680 | pMac->pmc.FilterMatchCountCBContext = NULL; |
| 1681 | } |
| 1682 | |
| 1683 | return(status); |
| 1684 | } |
| 1685 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 1686 | |
| 1687 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1688 | #ifdef WLAN_FEATURE_11W |
| 1689 | /*------------------------------------------------------------------ |
| 1690 | * |
| 1691 | * Handle the unprotected management frame indication from LIM and |
| 1692 | * forward it to HDD. |
| 1693 | * |
| 1694 | *------------------------------------------------------------------*/ |
| 1695 | |
| 1696 | eHalStatus sme_UnprotectedMgmtFrmInd( tHalHandle hHal, |
| 1697 | tpSirSmeUnprotMgmtFrameInd pSmeMgmtFrm) |
| 1698 | { |
| 1699 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1700 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1701 | tCsrRoamInfo pRoamInfo = {0}; |
| 1702 | tANI_U32 SessionId = pSmeMgmtFrm->sessionId; |
| 1703 | |
| 1704 | pRoamInfo.nFrameLength = pSmeMgmtFrm->frameLen; |
| 1705 | pRoamInfo.pbFrames = pSmeMgmtFrm->frameBuf; |
| 1706 | pRoamInfo.frameType = pSmeMgmtFrm->frameType; |
| 1707 | |
| 1708 | /* forward the mgmt frame to HDD */ |
| 1709 | csrRoamCallCallback(pMac, SessionId, &pRoamInfo, 0, eCSR_ROAM_UNPROT_MGMT_FRAME_IND, 0); |
| 1710 | |
| 1711 | return status; |
| 1712 | } |
| 1713 | #endif |
| 1714 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1715 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1716 | /*------------------------------------------------------------------ |
| 1717 | * |
| 1718 | * Handle the tsm ie indication from LIM and forward it to HDD. |
| 1719 | * |
| 1720 | *------------------------------------------------------------------*/ |
| 1721 | |
| 1722 | eHalStatus sme_TsmIeInd(tHalHandle hHal, tSirSmeTsmIEInd *pSmeTsmIeInd) |
| 1723 | { |
| 1724 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1725 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1726 | tCsrRoamInfo pRoamInfo = {0}; |
| 1727 | tANI_U32 SessionId = pSmeTsmIeInd->sessionId; |
| 1728 | |
| 1729 | pRoamInfo.tsmIe.tsid= pSmeTsmIeInd->tsmIe.tsid; |
| 1730 | pRoamInfo.tsmIe.state= pSmeTsmIeInd->tsmIe.state; |
| 1731 | pRoamInfo.tsmIe.msmt_interval= pSmeTsmIeInd->tsmIe.msmt_interval; |
| 1732 | |
| 1733 | /* forward the tsm ie information to HDD */ |
| 1734 | csrRoamCallCallback(pMac, SessionId, &pRoamInfo, 0, eCSR_ROAM_TSM_IE_IND, 0); |
| 1735 | |
| 1736 | return status; |
| 1737 | } |
| 1738 | |
| 1739 | /* --------------------------------------------------------------------------- |
| 1740 | \fn sme_SetCCKMIe |
| 1741 | \brief function to store the CCKM IE passed from supplicant and use it while packing |
| 1742 | reassociation request |
| 1743 | \param hHal - HAL handle for device |
| 1744 | \param pCckmIe - pointer to CCKM IE data |
| 1745 | \param pCckmIeLen - length of the CCKM IE |
| 1746 | \- return Success or failure |
| 1747 | -------------------------------------------------------------------------*/ |
| 1748 | eHalStatus sme_SetCCKMIe(tHalHandle hHal, tANI_U8 sessionId, |
| 1749 | tANI_U8 *pCckmIe, tANI_U8 cckmIeLen) |
| 1750 | { |
| 1751 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1752 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1753 | |
| 1754 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 1755 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 1756 | { |
| 1757 | csrSetCCKMIe(pMac, sessionId, pCckmIe, cckmIeLen); |
| 1758 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 1759 | } |
| 1760 | return status; |
| 1761 | } |
| 1762 | |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1763 | /* --------------------------------------------------------------------------- |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1764 | \fn sme_SetEseBeaconRequest |
| 1765 | \brief function to set Ese beacon request parameters |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1766 | \param hHal - HAL handle for device |
| 1767 | \param sessionId - Session id |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1768 | \param pEseBcnReq - pointer to Ese beacon request |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1769 | \- return Success or failure |
| 1770 | -------------------------------------------------------------------------*/ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1771 | eHalStatus sme_SetEseBeaconRequest(tHalHandle hHal, const tANI_U8 sessionId, |
| 1772 | const tCsrEseBeaconReq* pEseBcnReq) |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1773 | { |
| 1774 | eHalStatus status = eSIR_SUCCESS; |
| 1775 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1776 | tpSirBeaconReportReqInd pSmeBcnReportReq = NULL; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1777 | tCsrEseBeaconReqParams *pBeaconReq = NULL; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1778 | tANI_U8 counter = 0; |
| 1779 | tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); |
| 1780 | tpRrmSMEContext pSmeRrmContext = &pMac->rrm.rrmSmeContext; |
| 1781 | |
| 1782 | /* Store the info in RRM context */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1783 | vos_mem_copy(&pSmeRrmContext->eseBcnReqInfo, pEseBcnReq, sizeof(tCsrEseBeaconReq)); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1784 | |
| 1785 | //Prepare the request to send to SME. |
| 1786 | pSmeBcnReportReq = vos_mem_malloc(sizeof( tSirBeaconReportReqInd )); |
| 1787 | if(NULL == pSmeBcnReportReq) |
| 1788 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1789 | smsLog(pMac, LOGP, "Memory Allocation Failure!!! Ese BcnReq Ind to SME"); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1790 | return eSIR_FAILURE; |
| 1791 | } |
| 1792 | |
| 1793 | smsLog(pMac, LOGE, "Sending Beacon Report Req to SME"); |
| 1794 | vos_mem_zero( pSmeBcnReportReq, sizeof( tSirBeaconReportReqInd )); |
| 1795 | |
| 1796 | pSmeBcnReportReq->messageType = eWNI_SME_BEACON_REPORT_REQ_IND; |
| 1797 | pSmeBcnReportReq->length = sizeof( tSirBeaconReportReqInd ); |
| 1798 | vos_mem_copy( pSmeBcnReportReq->bssId, pSession->connectedProfile.bssid, sizeof(tSirMacAddr) ); |
| 1799 | pSmeBcnReportReq->channelInfo.channelNum = 255; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1800 | pSmeBcnReportReq->channelList.numChannels = pEseBcnReq->numBcnReqIe; |
| 1801 | pSmeBcnReportReq->msgSource = eRRM_MSG_SOURCE_ESE_UPLOAD; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1802 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1803 | for (counter = 0; counter < pEseBcnReq->numBcnReqIe; counter++) |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1804 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1805 | pBeaconReq = (tCsrEseBeaconReqParams *)&pEseBcnReq->bcnReq[counter]; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1806 | pSmeBcnReportReq->fMeasurementtype[counter] = pBeaconReq->scanMode; |
| 1807 | pSmeBcnReportReq->measurementDuration[counter] = SYS_TU_TO_MS(pBeaconReq->measurementDuration); |
| 1808 | pSmeBcnReportReq->channelList.channelNumber[counter] = pBeaconReq->channel; |
| 1809 | } |
| 1810 | |
| 1811 | sme_RrmProcessBeaconReportReqInd(pMac, pSmeBcnReportReq); |
| 1812 | return status; |
| 1813 | } |
| 1814 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1815 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1816 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1817 | |
c_hpothu | 9236791 | 2014-05-01 15:18:17 +0530 | [diff] [blame] | 1818 | /* --------------------------------------------------------------------------- |
| 1819 | \fn sme_getBcnMissRate |
| 1820 | \brief function sends 'WDA_GET_BCN_MISS_RATE_REQ' to WDA layer, |
| 1821 | \param hHal - HAL handle for device. |
| 1822 | \param sessionId - session ID. |
| 1823 | \- return Success or Failure. |
| 1824 | -------------------------------------------------------------------------*/ |
| 1825 | |
| 1826 | eHalStatus sme_getBcnMissRate(tHalHandle hHal, tANI_U8 sessionId, void *callback, void *data) |
| 1827 | { |
| 1828 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1829 | VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; |
| 1830 | vos_msg_t vosMessage; |
| 1831 | tSirBcnMissRateReq *pMsg; |
| 1832 | tCsrRoamSession *pSession; |
| 1833 | |
| 1834 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 1835 | { |
| 1836 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 1837 | |
| 1838 | if (!pSession) |
| 1839 | { |
| 1840 | smsLog(pMac, LOGE, FL("session %d not found"), sessionId); |
| 1841 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 1842 | return eHAL_STATUS_FAILURE; |
| 1843 | } |
| 1844 | |
| 1845 | pMsg = (tSirBcnMissRateReq *) vos_mem_malloc(sizeof(tSirTxPerTrackingParam)); |
| 1846 | if (NULL == pMsg) |
| 1847 | { |
| 1848 | smsLog(pMac, LOGE, FL("failed to allocated memory")); |
| 1849 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 1850 | return eHAL_STATUS_FAILURE; |
| 1851 | } |
| 1852 | |
| 1853 | vos_mem_copy(pMsg->bssid, pSession->connectedProfile.bssid, |
| 1854 | sizeof(tSirMacAddr)); |
| 1855 | |
| 1856 | pMsg->msgLen = sizeof(tSirBcnMissRateReq); |
| 1857 | pMsg->callback = callback; |
| 1858 | pMsg->data = data; |
| 1859 | |
| 1860 | vosMessage.type = WDA_GET_BCN_MISS_RATE_REQ; |
| 1861 | vosMessage.bodyptr = pMsg; |
| 1862 | vosMessage.reserved = 0; |
| 1863 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 1864 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 1865 | { |
| 1866 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1867 | "%s: Post Set TM Level MSG fail", __func__); |
| 1868 | vos_mem_free(pMsg); |
| 1869 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 1870 | return eHAL_STATUS_FAILURE; |
| 1871 | } |
| 1872 | sme_ReleaseGlobalLock( &pMac->sme); |
| 1873 | return eHAL_STATUS_SUCCESS; |
| 1874 | } |
| 1875 | return eHAL_STATUS_FAILURE; |
| 1876 | } |
| 1877 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1878 | /*-------------------------------------------------------------------------- |
| 1879 | |
| 1880 | \brief sme_ProcessMsg() - The main message processor for SME. |
| 1881 | |
| 1882 | The function is called by a message dispatcher when to process a message |
| 1883 | targeted for SME. |
| 1884 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1885 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1886 | \param hHal - The handle returned by macOpen. |
| 1887 | \param pMsg - A pointer to a caller allocated object of tSirMsgQ. |
| 1888 | |
| 1889 | \return eHAL_STATUS_SUCCESS - SME successfully process the message. |
| 1890 | |
| 1891 | Other status means SME failed to process the message to HAL. |
| 1892 | \sa |
| 1893 | |
| 1894 | --------------------------------------------------------------------------*/ |
| 1895 | eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) |
| 1896 | { |
| 1897 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1898 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1899 | |
| 1900 | if (pMsg == NULL) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1901 | smsLog( pMac, LOGE, "Empty message for SME, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1902 | return status; |
| 1903 | } |
| 1904 | |
| 1905 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 1906 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 1907 | { |
| 1908 | if( SME_IS_START(pMac) ) |
| 1909 | { |
| 1910 | switch (pMsg->type) { // TODO: Will be modified to do a range check for msgs instead of having cases for each msgs |
| 1911 | case eWNI_PMC_ENTER_BMPS_RSP: |
| 1912 | case eWNI_PMC_EXIT_BMPS_RSP: |
| 1913 | case eWNI_PMC_EXIT_BMPS_IND: |
| 1914 | case eWNI_PMC_ENTER_IMPS_RSP: |
| 1915 | case eWNI_PMC_EXIT_IMPS_RSP: |
| 1916 | case eWNI_PMC_SMPS_STATE_IND: |
| 1917 | case eWNI_PMC_ENTER_UAPSD_RSP: |
| 1918 | case eWNI_PMC_EXIT_UAPSD_RSP: |
| 1919 | case eWNI_PMC_ENTER_WOWL_RSP: |
| 1920 | case eWNI_PMC_EXIT_WOWL_RSP: |
| 1921 | //PMC |
| 1922 | if (pMsg->bodyptr) |
| 1923 | { |
| 1924 | pmcMessageProcessor(hHal, pMsg->bodyptr); |
| 1925 | status = eHAL_STATUS_SUCCESS; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 1926 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1927 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1928 | smsLog( pMac, LOGE, "Empty rsp message for PMC, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1929 | } |
| 1930 | break; |
| 1931 | |
| 1932 | case WNI_CFG_SET_CNF: |
| 1933 | case WNI_CFG_DNLD_CNF: |
| 1934 | case WNI_CFG_GET_RSP: |
| 1935 | case WNI_CFG_ADD_GRP_ADDR_CNF: |
| 1936 | case WNI_CFG_DEL_GRP_ADDR_CNF: |
| 1937 | //CCM |
| 1938 | if (pMsg->bodyptr) |
| 1939 | { |
| 1940 | ccmCfgCnfMsgHandler(hHal, pMsg->bodyptr); |
| 1941 | status = eHAL_STATUS_SUCCESS; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 1942 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1943 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1944 | smsLog( pMac, LOGE, "Empty rsp message for CCM, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1945 | } |
| 1946 | break; |
| 1947 | |
| 1948 | case eWNI_SME_ADDTS_RSP: |
| 1949 | case eWNI_SME_DELTS_RSP: |
| 1950 | case eWNI_SME_DELTS_IND: |
| 1951 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1952 | case eWNI_SME_FT_AGGR_QOS_RSP: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1953 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1954 | //QoS |
| 1955 | if (pMsg->bodyptr) |
| 1956 | { |
| 1957 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1958 | status = sme_QosMsgProcessor(pMac, pMsg->type, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 1959 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1960 | #endif |
| 1961 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1962 | smsLog( pMac, LOGE, "Empty rsp message for QoS, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1963 | } |
| 1964 | break; |
| 1965 | #if defined WLAN_FEATURE_VOWIFI |
| 1966 | case eWNI_SME_NEIGHBOR_REPORT_IND: |
| 1967 | case eWNI_SME_BEACON_REPORT_REQ_IND: |
| 1968 | #if defined WLAN_VOWIFI_DEBUG |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1969 | smsLog( pMac, LOGE, "Received RRM message. Message Id = %d", pMsg->type ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1970 | #endif |
| 1971 | if ( pMsg->bodyptr ) |
| 1972 | { |
| 1973 | status = sme_RrmMsgProcessor( pMac, pMsg->type, pMsg->bodyptr ); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 1974 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1975 | } |
| 1976 | else |
| 1977 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1978 | smsLog( pMac, LOGE, "Empty message for RRM, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1979 | } |
| 1980 | break; |
| 1981 | #endif |
| 1982 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1983 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1984 | //Handle the eWNI_SME_OEM_DATA_RSP: |
| 1985 | case eWNI_SME_OEM_DATA_RSP: |
| 1986 | if(pMsg->bodyptr) |
| 1987 | { |
| 1988 | status = sme_HandleOemDataRsp(pMac, pMsg->bodyptr); |
| 1989 | vos_mem_free(pMsg->bodyptr); |
| 1990 | } |
| 1991 | else |
| 1992 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1993 | 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] | 1994 | } |
| 1995 | smeProcessPendingQueue( pMac ); |
| 1996 | break; |
| 1997 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1998 | |
| 1999 | case eWNI_SME_ADD_STA_SELF_RSP: |
| 2000 | if(pMsg->bodyptr) |
| 2001 | { |
| 2002 | status = csrProcessAddStaSessionRsp(pMac, pMsg->bodyptr); |
| 2003 | vos_mem_free(pMsg->bodyptr); |
| 2004 | } |
| 2005 | else |
| 2006 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2007 | 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] | 2008 | } |
| 2009 | break; |
| 2010 | case eWNI_SME_DEL_STA_SELF_RSP: |
| 2011 | if(pMsg->bodyptr) |
| 2012 | { |
| 2013 | status = csrProcessDelStaSessionRsp(pMac, pMsg->bodyptr); |
| 2014 | vos_mem_free(pMsg->bodyptr); |
| 2015 | } |
| 2016 | else |
| 2017 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2018 | 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] | 2019 | } |
| 2020 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2021 | case eWNI_SME_REMAIN_ON_CHN_RSP: |
| 2022 | if(pMsg->bodyptr) |
| 2023 | { |
| 2024 | status = sme_remainOnChnRsp(pMac, pMsg->bodyptr); |
| 2025 | vos_mem_free(pMsg->bodyptr); |
| 2026 | } |
| 2027 | else |
| 2028 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2029 | 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] | 2030 | } |
| 2031 | break; |
| 2032 | case eWNI_SME_REMAIN_ON_CHN_RDY_IND: |
| 2033 | if(pMsg->bodyptr) |
| 2034 | { |
| 2035 | status = sme_remainOnChnReady(pMac, pMsg->bodyptr); |
| 2036 | vos_mem_free(pMsg->bodyptr); |
| 2037 | } |
| 2038 | else |
| 2039 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2040 | 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] | 2041 | } |
| 2042 | break; |
| 2043 | case eWNI_SME_MGMT_FRM_IND: |
| 2044 | if(pMsg->bodyptr) |
| 2045 | { |
| 2046 | sme_mgmtFrmInd(pMac, pMsg->bodyptr); |
| 2047 | vos_mem_free(pMsg->bodyptr); |
| 2048 | } |
| 2049 | else |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2050 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2051 | smsLog( pMac, LOGE, "Empty rsp message for meas (eWNI_SME_MGMT_FRM_IND), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2052 | } |
| 2053 | break; |
| 2054 | case eWNI_SME_ACTION_FRAME_SEND_CNF: |
| 2055 | if(pMsg->bodyptr) |
| 2056 | { |
| 2057 | status = sme_sendActionCnf(pMac, pMsg->bodyptr); |
| 2058 | vos_mem_free(pMsg->bodyptr); |
| 2059 | } |
| 2060 | else |
| 2061 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2062 | 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] | 2063 | } |
| 2064 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2065 | case eWNI_SME_COEX_IND: |
| 2066 | if(pMsg->bodyptr) |
| 2067 | { |
| 2068 | status = btcHandleCoexInd((void *)pMac, pMsg->bodyptr); |
| 2069 | vos_mem_free(pMsg->bodyptr); |
| 2070 | } |
| 2071 | else |
| 2072 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2073 | 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] | 2074 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2075 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2076 | |
| 2077 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 2078 | case eWNI_SME_PREF_NETWORK_FOUND_IND: |
| 2079 | if(pMsg->bodyptr) |
| 2080 | { |
| 2081 | status = sme_PreferredNetworkFoundInd((void *)pMac, pMsg->bodyptr); |
| 2082 | vos_mem_free(pMsg->bodyptr); |
| 2083 | } |
| 2084 | else |
| 2085 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2086 | 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] | 2087 | } |
| 2088 | break; |
| 2089 | #endif // FEATURE_WLAN_SCAN_PNO |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2090 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2091 | case eWNI_SME_TX_PER_HIT_IND: |
| 2092 | if (pMac->sme.pTxPerHitCallback) |
| 2093 | { |
| 2094 | pMac->sme.pTxPerHitCallback(pMac->sme.pTxPerHitCbContext); |
| 2095 | } |
| 2096 | break; |
| 2097 | |
| 2098 | case eWNI_SME_CHANGE_COUNTRY_CODE: |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 2099 | if(pMsg->bodyptr) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2100 | { |
| 2101 | status = sme_HandleChangeCountryCode((void *)pMac, pMsg->bodyptr); |
| 2102 | vos_mem_free(pMsg->bodyptr); |
| 2103 | } |
| 2104 | else |
| 2105 | { |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 2106 | smsLog(pMac, LOGE, "Empty rsp message for message (eWNI_SME_CHANGE_COUNTRY_CODE), nothing to process"); |
| 2107 | } |
| 2108 | break; |
| 2109 | |
| 2110 | case eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE: |
| 2111 | if (pMsg->bodyptr) |
| 2112 | { |
| 2113 | status = sme_HandleGenericChangeCountryCode((void *)pMac, pMsg->bodyptr); |
| 2114 | vos_mem_free(pMsg->bodyptr); |
| 2115 | } |
| 2116 | else |
| 2117 | { |
| 2118 | 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] | 2119 | } |
| 2120 | break; |
| 2121 | |
| 2122 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 2123 | case eWNI_PMC_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP: |
| 2124 | if(pMsg->bodyptr) |
| 2125 | { |
| 2126 | status = sme_PCFilterMatchCountResponseHandler((void *)pMac, pMsg->bodyptr); |
| 2127 | vos_mem_free(pMsg->bodyptr); |
| 2128 | } |
| 2129 | else |
| 2130 | { |
| 2131 | smsLog(pMac, LOGE, "Empty rsp message for meas " |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2132 | "(PACKET_COALESCING_FILTER_MATCH_COUNT_RSP), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2133 | } |
| 2134 | break; |
| 2135 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 2136 | case eWNI_SME_PRE_SWITCH_CHL_IND: |
| 2137 | { |
| 2138 | status = sme_HandlePreChannelSwitchInd(pMac); |
| 2139 | break; |
| 2140 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2141 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2142 | case eWNI_SME_POST_SWITCH_CHL_IND: |
| 2143 | { |
| 2144 | status = sme_HandlePostChannelSwitchInd(pMac); |
| 2145 | break; |
| 2146 | } |
| 2147 | |
| 2148 | #ifdef WLAN_WAKEUP_EVENTS |
| 2149 | case eWNI_SME_WAKE_REASON_IND: |
| 2150 | if(pMsg->bodyptr) |
| 2151 | { |
| 2152 | status = sme_WakeReasonIndCallback((void *)pMac, pMsg->bodyptr); |
| 2153 | vos_mem_free(pMsg->bodyptr); |
| 2154 | } |
| 2155 | else |
| 2156 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2157 | 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] | 2158 | } |
| 2159 | break; |
| 2160 | #endif // WLAN_WAKEUP_EVENTS |
| 2161 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2162 | #ifdef FEATURE_WLAN_TDLS |
| 2163 | /* |
| 2164 | * command rescived from PE, SME tdls msg processor shall be called |
| 2165 | * to process commands recieved from PE |
| 2166 | */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2167 | case eWNI_SME_TDLS_SEND_MGMT_RSP: |
| 2168 | case eWNI_SME_TDLS_ADD_STA_RSP: |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 2169 | case eWNI_SME_TDLS_DEL_STA_RSP: |
| 2170 | case eWNI_SME_TDLS_DEL_STA_IND: |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2171 | case eWNI_SME_TDLS_DEL_ALL_PEER_IND: |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 2172 | case eWNI_SME_MGMT_FRM_TX_COMPLETION_IND: |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 2173 | case eWNI_SME_TDLS_LINK_ESTABLISH_RSP: |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2174 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 2175 | case eWNI_SME_TDLS_DISCOVERY_START_RSP: |
| 2176 | case eWNI_SME_TDLS_DISCOVERY_START_IND: |
| 2177 | case eWNI_SME_TDLS_LINK_START_RSP: |
| 2178 | case eWNI_SME_TDLS_LINK_START_IND: |
| 2179 | case eWNI_SME_TDLS_TEARDOWN_RSP: |
| 2180 | case eWNI_SME_TDLS_TEARDOWN_IND: |
| 2181 | case eWNI_SME_ADD_TDLS_PEER_IND: |
| 2182 | case eWNI_SME_DELETE_TDLS_PEER_IND: |
| 2183 | #endif |
| 2184 | { |
| 2185 | if (pMsg->bodyptr) |
| 2186 | { |
| 2187 | status = tdlsMsgProcessor(pMac, pMsg->type, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2188 | vos_mem_free(pMsg->bodyptr); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2189 | } |
| 2190 | else |
| 2191 | { |
| 2192 | smsLog( pMac, LOGE, "Empty rsp message for TDLS, \ |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2193 | nothing to process"); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2194 | } |
| 2195 | break; |
| 2196 | } |
| 2197 | #endif |
| 2198 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2199 | #ifdef WLAN_FEATURE_11W |
| 2200 | case eWNI_SME_UNPROT_MGMT_FRM_IND: |
| 2201 | if (pMsg->bodyptr) |
| 2202 | { |
| 2203 | sme_UnprotectedMgmtFrmInd(pMac, pMsg->bodyptr); |
| 2204 | vos_mem_free(pMsg->bodyptr); |
| 2205 | } |
| 2206 | else |
| 2207 | { |
| 2208 | smsLog(pMac, LOGE, "Empty rsp message for meas (eWNI_SME_UNPROT_MGMT_FRM_IND), nothing to process"); |
| 2209 | } |
| 2210 | break; |
| 2211 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2212 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2213 | case eWNI_SME_TSM_IE_IND: |
| 2214 | { |
| 2215 | if (pMsg->bodyptr) |
| 2216 | { |
| 2217 | sme_TsmIeInd(pMac, pMsg->bodyptr); |
| 2218 | vos_mem_free(pMsg->bodyptr); |
| 2219 | } |
| 2220 | else |
| 2221 | { |
| 2222 | smsLog(pMac, LOGE, "Empty rsp message for (eWNI_SME_TSM_IE_IND), nothing to process"); |
| 2223 | } |
| 2224 | break; |
| 2225 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2226 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 2227 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 2228 | case eWNI_SME_ROAM_SCAN_OFFLOAD_RSP: |
| 2229 | status = csrRoamOffloadScanRspHdlr((void *)pMac, pMsg->bodyval); |
| 2230 | break; |
| 2231 | #endif // WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2232 | |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 2233 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 2234 | case eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP: |
| 2235 | if (pMsg->bodyptr) |
| 2236 | { |
| 2237 | sme_ProcessGetGtkInfoRsp(pMac, pMsg->bodyptr); |
| 2238 | vos_mem_free(pMsg->bodyptr); |
| 2239 | } |
| 2240 | else |
| 2241 | { |
| 2242 | smsLog(pMac, LOGE, "Empty rsp message for (eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP), nothing to process"); |
| 2243 | } |
| 2244 | break ; |
| 2245 | #endif |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2246 | |
| 2247 | #ifdef FEATURE_WLAN_LPHB |
| 2248 | /* LPHB timeout indication arrived, send IND to client */ |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 2249 | case eWNI_SME_LPHB_IND: |
| 2250 | if (pMac->sme.pLphbIndCb) |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2251 | { |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 2252 | pMac->sme.pLphbIndCb(pMac->pAdapter, pMsg->bodyptr); |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2253 | } |
| 2254 | vos_mem_free(pMsg->bodyptr); |
| 2255 | |
| 2256 | break; |
| 2257 | #endif /* FEATURE_WLAN_LPHB */ |
| 2258 | |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 2259 | #ifdef FEATURE_WLAN_CH_AVOID |
| 2260 | /* LPHB timeout indication arrived, send IND to client */ |
| 2261 | case eWNI_SME_CH_AVOID_IND: |
| 2262 | if (pMac->sme.pChAvoidNotificationCb) |
| 2263 | { |
| 2264 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 2265 | "%s: CH avoid notification", __func__); |
| 2266 | pMac->sme.pChAvoidNotificationCb(pMac->pAdapter, pMsg->bodyptr); |
| 2267 | } |
| 2268 | vos_mem_free(pMsg->bodyptr); |
| 2269 | |
| 2270 | break; |
| 2271 | #endif /* FEATURE_WLAN_CH_AVOID */ |
| 2272 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2273 | default: |
| 2274 | |
| 2275 | if ( ( pMsg->type >= eWNI_SME_MSG_TYPES_BEGIN ) |
| 2276 | && ( pMsg->type <= eWNI_SME_MSG_TYPES_END ) ) |
| 2277 | { |
| 2278 | //CSR |
| 2279 | if (pMsg->bodyptr) |
| 2280 | { |
| 2281 | status = csrMsgProcessor(hHal, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2282 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2283 | } |
| 2284 | else |
| 2285 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2286 | smsLog( pMac, LOGE, "Empty rsp message for CSR, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2287 | } |
| 2288 | } |
| 2289 | else |
| 2290 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2291 | smsLog( pMac, LOGW, "Unknown message type %d, nothing to process", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2292 | pMsg->type); |
| 2293 | if (pMsg->bodyptr) |
| 2294 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2295 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2296 | } |
| 2297 | } |
| 2298 | }//switch |
| 2299 | } //SME_IS_START |
| 2300 | else |
| 2301 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2302 | smsLog( pMac, LOGW, "message type %d in stop state ignored", pMsg->type); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2303 | if (pMsg->bodyptr) |
| 2304 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2305 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2306 | } |
| 2307 | } |
| 2308 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2309 | } |
| 2310 | else |
| 2311 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2312 | smsLog( pMac, LOGW, "Locking failed, bailing out"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2313 | if (pMsg->bodyptr) |
| 2314 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2315 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2316 | } |
| 2317 | } |
| 2318 | |
| 2319 | return status; |
| 2320 | } |
| 2321 | |
| 2322 | |
| 2323 | //No need to hold the global lock here because this function can only be called |
| 2324 | //after sme_Stop. |
| 2325 | v_VOID_t sme_FreeMsg( tHalHandle hHal, vos_msg_t* pMsg ) |
| 2326 | { |
| 2327 | if( pMsg ) |
| 2328 | { |
| 2329 | if (pMsg->bodyptr) |
| 2330 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2331 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2332 | } |
| 2333 | } |
| 2334 | |
| 2335 | } |
| 2336 | |
| 2337 | |
| 2338 | /*-------------------------------------------------------------------------- |
| 2339 | |
| 2340 | \brief sme_Stop() - Stop all SME modules and put them at idle state |
| 2341 | |
| 2342 | The function stops each module in SME, PMC, CCM, CSR, etc. . Upon |
| 2343 | return, all modules are at idle state ready to start. |
| 2344 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2345 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2346 | \param hHal - The handle returned by macOpen |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2347 | \param tHalStopType - reason for stopping |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2348 | |
| 2349 | \return eHAL_STATUS_SUCCESS - SME is stopped. |
| 2350 | |
| 2351 | Other status means SME is failed to stop but caller should still |
| 2352 | consider SME is stopped. |
| 2353 | \sa |
| 2354 | |
| 2355 | --------------------------------------------------------------------------*/ |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2356 | eHalStatus sme_Stop(tHalHandle hHal, tHalStopType stopType) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2357 | { |
| 2358 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2359 | eHalStatus fail_status = eHAL_STATUS_SUCCESS; |
| 2360 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2361 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2362 | status = WLANSAP_Stop(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 2363 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2364 | smsLog( pMac, LOGE, "WLANSAP_Stop failed during smeStop with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2365 | status ); |
| 2366 | fail_status = status; |
| 2367 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2368 | |
| 2369 | p2pStop(hHal); |
| 2370 | |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2371 | status = pmcStop(hHal); |
| 2372 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 2373 | smsLog( pMac, LOGE, "pmcStop failed during smeStop with status=%d", |
| 2374 | status ); |
| 2375 | fail_status = status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2376 | } |
| 2377 | |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2378 | status = csrStop(pMac, stopType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2379 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2380 | smsLog( pMac, LOGE, "csrStop failed during smeStop with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2381 | status ); |
| 2382 | fail_status = status; |
| 2383 | } |
| 2384 | |
| 2385 | ccmStop(hHal); |
| 2386 | |
| 2387 | purgeSmeCmdList(pMac); |
| 2388 | |
| 2389 | if (!HAL_STATUS_SUCCESS( fail_status )) { |
| 2390 | status = fail_status; |
| 2391 | } |
| 2392 | |
| 2393 | pMac->sme.state = SME_STATE_STOP; |
| 2394 | |
| 2395 | return status; |
| 2396 | } |
| 2397 | |
| 2398 | /*-------------------------------------------------------------------------- |
| 2399 | |
| 2400 | \brief sme_Close() - Release all SME modules and their resources. |
| 2401 | |
| 2402 | The function release each module in SME, PMC, CCM, CSR, etc. . Upon |
| 2403 | return, all modules are at closed state. |
| 2404 | |
| 2405 | No SME APIs can be involved after smeClose except smeOpen. |
| 2406 | smeClose must be called before macClose. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2407 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2408 | \param hHal - The handle returned by macOpen |
| 2409 | |
| 2410 | \return eHAL_STATUS_SUCCESS - SME is successfully close. |
| 2411 | |
| 2412 | Other status means SME is failed to be closed but caller still cannot |
| 2413 | call any other SME functions except smeOpen. |
| 2414 | \sa |
| 2415 | |
| 2416 | --------------------------------------------------------------------------*/ |
| 2417 | eHalStatus sme_Close(tHalHandle hHal) |
| 2418 | { |
| 2419 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2420 | eHalStatus fail_status = eHAL_STATUS_SUCCESS; |
| 2421 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2422 | |
| 2423 | status = csrClose(pMac); |
| 2424 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2425 | smsLog( pMac, LOGE, "csrClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2426 | status ); |
| 2427 | fail_status = status; |
| 2428 | } |
| 2429 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2430 | status = WLANSAP_Close(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 2431 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2432 | smsLog( pMac, LOGE, "WLANSAP_close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2433 | status ); |
| 2434 | fail_status = status; |
| 2435 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2436 | |
| 2437 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 2438 | status = btcClose(hHal); |
| 2439 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2440 | smsLog( pMac, LOGE, "BTC close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2441 | status ); |
| 2442 | fail_status = status; |
| 2443 | } |
| 2444 | |
| 2445 | status = sme_QosClose(pMac); |
| 2446 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2447 | smsLog( pMac, LOGE, "Qos close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2448 | status ); |
| 2449 | fail_status = status; |
| 2450 | } |
| 2451 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2452 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 2453 | status = oemData_OemDataReqClose(hHal); |
| 2454 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2455 | 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] | 2456 | status ); |
| 2457 | fail_status = status; |
| 2458 | } |
| 2459 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2460 | |
| 2461 | status = ccmClose(hHal); |
| 2462 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2463 | smsLog( pMac, LOGE, "ccmClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2464 | status ); |
| 2465 | fail_status = status; |
| 2466 | } |
| 2467 | |
| 2468 | status = pmcClose(hHal); |
| 2469 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2470 | smsLog( pMac, LOGE, "pmcClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2471 | status ); |
| 2472 | fail_status = status; |
| 2473 | } |
| 2474 | #if defined WLAN_FEATURE_VOWIFI |
| 2475 | status = rrmClose(hHal); |
| 2476 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2477 | smsLog( pMac, LOGE, "RRM close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2478 | status ); |
| 2479 | fail_status = status; |
| 2480 | } |
| 2481 | #endif |
| 2482 | |
| 2483 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 2484 | sme_FTClose(hHal); |
| 2485 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2486 | sme_p2pClose(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2487 | |
| 2488 | freeSmeCmdList(pMac); |
| 2489 | |
| 2490 | if( !VOS_IS_STATUS_SUCCESS( vos_lock_destroy( &pMac->sme.lkSmeGlobalLock ) ) ) |
| 2491 | { |
| 2492 | fail_status = eHAL_STATUS_FAILURE; |
| 2493 | } |
| 2494 | |
| 2495 | if (!HAL_STATUS_SUCCESS( fail_status )) { |
| 2496 | status = fail_status; |
| 2497 | } |
| 2498 | |
| 2499 | pMac->sme.state = SME_STATE_STOP; |
| 2500 | |
| 2501 | return status; |
| 2502 | } |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2503 | #ifdef FEATURE_WLAN_LFR |
| 2504 | tANI_BOOLEAN csrIsScanAllowed(tpAniSirGlobal pMac) |
| 2505 | { |
Madan Mohan Koyyalamudi | fb534bb | 2012-10-24 14:35:45 -0700 | [diff] [blame] | 2506 | #if 0 |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2507 | switch(pMac->roam.neighborRoamInfo.neighborRoamState) { |
| 2508 | case eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN: |
| 2509 | case eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING: |
| 2510 | case eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE: |
| 2511 | case eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING: |
| 2512 | return eANI_BOOLEAN_FALSE; |
| 2513 | default: |
| 2514 | return eANI_BOOLEAN_TRUE; |
| 2515 | } |
Madan Mohan Koyyalamudi | fb534bb | 2012-10-24 14:35:45 -0700 | [diff] [blame] | 2516 | #else |
| 2517 | /* |
| 2518 | * TODO: always return TRUE for now until |
| 2519 | * we figure out why we could be stuck in |
| 2520 | * one of the roaming states forever. |
| 2521 | */ |
| 2522 | return eANI_BOOLEAN_TRUE; |
| 2523 | #endif |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2524 | } |
| 2525 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2526 | /* --------------------------------------------------------------------------- |
| 2527 | \fn sme_ScanRequest |
| 2528 | \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] | 2529 | This is an asynchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2530 | \param pScanRequestID - pointer to an object to get back the request ID |
| 2531 | \param callback - a callback function that scan calls upon finish, will not |
| 2532 | be called if csrScanRequest returns error |
| 2533 | \param pContext - a pointer passed in for the callback |
| 2534 | \return eHalStatus |
| 2535 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2536 | eHalStatus sme_ScanRequest(tHalHandle hHal, tANI_U8 sessionId, tCsrScanRequest *pscanReq, |
| 2537 | tANI_U32 *pScanRequestID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2538 | csrScanCompleteCallback callback, void *pContext) |
| 2539 | { |
| 2540 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2541 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2542 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2543 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_REQ, sessionId, pscanReq->scanType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2544 | smsLog(pMac, LOG2, FL("enter")); |
| 2545 | do |
| 2546 | { |
| 2547 | if(pMac->scan.fScanEnable) |
| 2548 | { |
| 2549 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2550 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2551 | { |
| 2552 | { |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2553 | #ifdef FEATURE_WLAN_LFR |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2554 | if(csrIsScanAllowed(pMac)) |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2555 | { |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2556 | #endif |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2557 | status = csrScanRequest( hHal, sessionId, pscanReq, |
| 2558 | pScanRequestID, callback, pContext ); |
Vinay Krishna Eranna | 636b7bc | 2013-12-18 20:49:08 +0530 | [diff] [blame] | 2559 | if ( !HAL_STATUS_SUCCESS( status ) ) |
| 2560 | { |
| 2561 | smsLog(pMac, LOGE, FL("csrScanRequest failed" |
| 2562 | " SId=%d"), sessionId); |
| 2563 | } |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2564 | #ifdef FEATURE_WLAN_LFR |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2565 | } |
| 2566 | else |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2567 | { |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 2568 | smsLog(pMac, LOGE, FL("Scan denied in state %s" |
Mahesh A Saptasagar | 14addb6 | 2014-02-17 17:17:51 +0530 | [diff] [blame] | 2569 | "(sub-state %s)"), |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 2570 | macTraceGetNeighbourRoamState( |
| 2571 | pMac->roam.neighborRoamInfo.neighborRoamState), |
Mahesh A Saptasagar | 14addb6 | 2014-02-17 17:17:51 +0530 | [diff] [blame] | 2572 | macTraceGetcsrRoamSubState( |
| 2573 | pMac->roam.curSubState[sessionId])); |
Madan Mohan Koyyalamudi | ab4ab0d | 2012-10-24 14:26:50 -0700 | [diff] [blame] | 2574 | /*HandOff is in progress. So schedule this scan later*/ |
| 2575 | status = eHAL_STATUS_RESOURCES; |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2576 | } |
| 2577 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2578 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2579 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2580 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2581 | } //sme_AcquireGlobalLock success |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2582 | else |
| 2583 | { |
| 2584 | smsLog(pMac, LOGE, FL("sme_AcquireGlobalLock failed")); |
| 2585 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2586 | } //if(pMac->scan.fScanEnable) |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2587 | else |
| 2588 | { |
| 2589 | smsLog(pMac, LOGE, FL("fScanEnable FALSE")); |
| 2590 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2591 | } while( 0 ); |
| 2592 | |
| 2593 | return (status); |
| 2594 | |
| 2595 | |
| 2596 | } |
| 2597 | |
| 2598 | /* --------------------------------------------------------------------------- |
| 2599 | \fn sme_ScanGetResult |
| 2600 | \brief a wrapper function to request scan results from CSR. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2601 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2602 | \param pFilter - If pFilter is NULL, all cached results are returned |
| 2603 | \param phResult - an object for the result. |
| 2604 | \return eHalStatus |
| 2605 | ---------------------------------------------------------------------------*/ |
| 2606 | eHalStatus sme_ScanGetResult(tHalHandle hHal, tANI_U8 sessionId, tCsrScanResultFilter *pFilter, |
| 2607 | tScanResultHandle *phResult) |
| 2608 | { |
| 2609 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2610 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2611 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2612 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2613 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_GET_RESULTS, sessionId,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2614 | smsLog(pMac, LOG2, FL("enter")); |
| 2615 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2616 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2617 | { |
Madan Mohan Koyyalamudi | ca43cdf | 2012-09-24 13:15:49 -0700 | [diff] [blame] | 2618 | status = csrScanGetResult( hHal, pFilter, phResult ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2619 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2620 | } |
| 2621 | smsLog(pMac, LOG2, FL("exit status %d"), status); |
| 2622 | |
| 2623 | return (status); |
| 2624 | } |
| 2625 | |
| 2626 | |
| 2627 | /* --------------------------------------------------------------------------- |
| 2628 | \fn sme_ScanFlushResult |
| 2629 | \brief a wrapper function to request CSR to clear scan results. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2630 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2631 | \return eHalStatus |
| 2632 | ---------------------------------------------------------------------------*/ |
| 2633 | eHalStatus sme_ScanFlushResult(tHalHandle hHal, tANI_U8 sessionId) |
| 2634 | { |
| 2635 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2636 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2637 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2638 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2639 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_RESULTS, sessionId,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2640 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2641 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2642 | { |
Madan Mohan Koyyalamudi | ca43cdf | 2012-09-24 13:15:49 -0700 | [diff] [blame] | 2643 | status = csrScanFlushResult( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2644 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2645 | } |
| 2646 | |
| 2647 | return (status); |
| 2648 | } |
| 2649 | |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 2650 | /* --------------------------------------------------------------------------- |
| 2651 | \fn sme_FilterScanResults |
| 2652 | \brief a wrapper function to request CSR to clear scan results. |
| 2653 | This is a synchronous call |
| 2654 | \return eHalStatus |
| 2655 | ---------------------------------------------------------------------------*/ |
| 2656 | eHalStatus sme_FilterScanResults(tHalHandle hHal, tANI_U8 sessionId) |
| 2657 | { |
| 2658 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 2659 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2660 | |
| 2661 | MTRACE(macTraceNew(pMac, VOS_MODULE_ID_SME, |
| 2662 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_RESULTS, sessionId,0 )); |
| 2663 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2664 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2665 | { |
| 2666 | csrScanFilterResults(pMac); |
| 2667 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2668 | } |
| 2669 | |
| 2670 | return (status); |
| 2671 | } |
| 2672 | |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 2673 | eHalStatus sme_ScanFlushP2PResult(tHalHandle hHal, tANI_U8 sessionId) |
| 2674 | { |
| 2675 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2676 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2677 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2678 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2679 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_P2PRESULTS, sessionId,0 )); |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 2680 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2681 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2682 | { |
Madan Mohan Koyyalamudi | 5850f31 | 2012-11-27 19:00:25 +0530 | [diff] [blame] | 2683 | status = csrScanFlushSelectiveResult( hHal, VOS_TRUE ); |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 2684 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2685 | } |
| 2686 | |
| 2687 | return (status); |
| 2688 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2689 | |
| 2690 | /* --------------------------------------------------------------------------- |
| 2691 | \fn sme_ScanResultGetFirst |
| 2692 | \brief a wrapper function to request CSR to returns the first element of |
| 2693 | scan result. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2694 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2695 | \param hScanResult - returned from csrScanGetResult |
| 2696 | \return tCsrScanResultInfo * - NULL if no result |
| 2697 | ---------------------------------------------------------------------------*/ |
| 2698 | tCsrScanResultInfo *sme_ScanResultGetFirst(tHalHandle hHal, |
| 2699 | tScanResultHandle hScanResult) |
| 2700 | { |
| 2701 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2702 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2703 | tCsrScanResultInfo *pRet = NULL; |
| 2704 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2705 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2706 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_GETFIRST, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2707 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2708 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2709 | { |
| 2710 | pRet = csrScanResultGetFirst( pMac, hScanResult ); |
| 2711 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2712 | } |
| 2713 | |
| 2714 | return (pRet); |
| 2715 | } |
| 2716 | |
| 2717 | |
| 2718 | /* --------------------------------------------------------------------------- |
| 2719 | \fn sme_ScanResultGetNext |
| 2720 | \brief a wrapper function to request CSR to returns the next element of |
| 2721 | scan result. It can be called without calling csrScanResultGetFirst |
| 2722 | first |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2723 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2724 | \param hScanResult - returned from csrScanGetResult |
| 2725 | \return Null if no result or reach the end |
| 2726 | ---------------------------------------------------------------------------*/ |
| 2727 | tCsrScanResultInfo *sme_ScanResultGetNext(tHalHandle hHal, |
| 2728 | tScanResultHandle hScanResult) |
| 2729 | { |
| 2730 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2731 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2732 | tCsrScanResultInfo *pRet = NULL; |
| 2733 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2734 | MTRACE(vos_trace(VOS_MODULE_ID_SME , |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2735 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_GETNEXT, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2736 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2737 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2738 | { |
| 2739 | pRet = csrScanResultGetNext( pMac, hScanResult ); |
| 2740 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2741 | } |
| 2742 | |
| 2743 | return (pRet); |
| 2744 | } |
| 2745 | |
| 2746 | |
| 2747 | /* --------------------------------------------------------------------------- |
| 2748 | \fn sme_ScanSetBGScanparams |
| 2749 | \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] | 2750 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2751 | \param pScanReq - BG scan request structure |
| 2752 | \return eHalStatus |
| 2753 | ---------------------------------------------------------------------------*/ |
| 2754 | eHalStatus sme_ScanSetBGScanparams(tHalHandle hHal, tANI_U8 sessionId, tCsrBGScanRequest *pScanReq) |
| 2755 | { |
| 2756 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2757 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2758 | |
| 2759 | if( NULL != pScanReq ) |
| 2760 | { |
| 2761 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2762 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2763 | { |
| 2764 | status = csrScanSetBGScanparams( hHal, pScanReq ); |
| 2765 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2766 | } |
| 2767 | } |
| 2768 | |
| 2769 | return (status); |
| 2770 | } |
| 2771 | |
| 2772 | |
| 2773 | /* --------------------------------------------------------------------------- |
| 2774 | \fn sme_ScanResultPurge |
| 2775 | \brief a wrapper function to request CSR to remove all items(tCsrScanResult) |
| 2776 | in the list and free memory for each item |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2777 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2778 | \param hScanResult - returned from csrScanGetResult. hScanResult is |
| 2779 | considered gone by |
| 2780 | calling this function and even before this function reutrns. |
| 2781 | \return eHalStatus |
| 2782 | ---------------------------------------------------------------------------*/ |
| 2783 | eHalStatus sme_ScanResultPurge(tHalHandle hHal, tScanResultHandle hScanResult) |
| 2784 | { |
| 2785 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2786 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2787 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2788 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2789 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_PURGE, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2790 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2791 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2792 | { |
| 2793 | status = csrScanResultPurge( hHal, hScanResult ); |
| 2794 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2795 | } |
| 2796 | |
| 2797 | return (status); |
| 2798 | } |
| 2799 | |
| 2800 | /* --------------------------------------------------------------------------- |
| 2801 | \fn sme_ScanGetPMKIDCandidateList |
| 2802 | \brief a wrapper function to return the PMKID candidate list |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2803 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2804 | \param pPmkidList - caller allocated buffer point to an array of |
| 2805 | tPmkidCandidateInfo |
| 2806 | \param pNumItems - pointer to a variable that has the number of |
| 2807 | tPmkidCandidateInfo allocated when retruning, this is |
| 2808 | either the number needed or number of items put into |
| 2809 | pPmkidList |
| 2810 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 2811 | big enough and pNumItems |
| 2812 | has the number of tPmkidCandidateInfo. |
| 2813 | \Note: pNumItems is a number of tPmkidCandidateInfo, |
| 2814 | not sizeof(tPmkidCandidateInfo) * something |
| 2815 | ---------------------------------------------------------------------------*/ |
| 2816 | eHalStatus sme_ScanGetPMKIDCandidateList(tHalHandle hHal, tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2817 | tPmkidCandidateInfo *pPmkidList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2818 | tANI_U32 *pNumItems ) |
| 2819 | { |
| 2820 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2821 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2822 | |
| 2823 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2824 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2825 | { |
| 2826 | status = csrScanGetPMKIDCandidateList( pMac, sessionId, pPmkidList, pNumItems ); |
| 2827 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2828 | } |
| 2829 | |
| 2830 | return (status); |
| 2831 | } |
| 2832 | |
| 2833 | /*---------------------------------------------------------------------------- |
| 2834 | \fn sme_RoamRegisterLinkQualityIndCallback |
| 2835 | |
| 2836 | \brief |
| 2837 | a wrapper function to allow HDD to register a callback handler with CSR for |
| 2838 | link quality indications. |
| 2839 | |
| 2840 | Only one callback may be registered at any time. |
| 2841 | In order to deregister the callback, a NULL cback may be provided. |
| 2842 | |
| 2843 | Registration happens in the task context of the caller. |
| 2844 | |
| 2845 | \param callback - Call back being registered |
| 2846 | \param pContext - user data |
| 2847 | |
| 2848 | DEPENDENCIES: After CSR open |
| 2849 | |
| 2850 | \return eHalStatus |
| 2851 | -----------------------------------------------------------------------------*/ |
| 2852 | eHalStatus sme_RoamRegisterLinkQualityIndCallback(tHalHandle hHal, tANI_U8 sessionId, |
| 2853 | csrRoamLinkQualityIndCallback callback, |
| 2854 | void *pContext) |
| 2855 | { |
| 2856 | return(csrRoamRegisterLinkQualityIndCallback((tpAniSirGlobal)hHal, callback, pContext)); |
| 2857 | } |
| 2858 | |
| 2859 | /* --------------------------------------------------------------------------- |
| 2860 | \fn sme_RoamRegisterCallback |
| 2861 | \brief a wrapper function to allow HDD to register a callback with CSR. |
| 2862 | Unlike scan, roam has one callback for all the roam requests |
| 2863 | \param callback - a callback function that roam calls upon when state changes |
| 2864 | \param pContext - a pointer passed in for the callback |
| 2865 | \return eHalStatus |
| 2866 | ---------------------------------------------------------------------------*/ |
| 2867 | eHalStatus sme_RoamRegisterCallback(tHalHandle hHal, |
| 2868 | csrRoamCompleteCallback callback, |
| 2869 | void *pContext) |
| 2870 | { |
| 2871 | return(csrRoamRegisterCallback((tpAniSirGlobal)hHal, callback, pContext)); |
| 2872 | } |
| 2873 | |
| 2874 | eCsrPhyMode sme_GetPhyMode(tHalHandle hHal) |
| 2875 | { |
| 2876 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 2877 | return pMac->roam.configParam.phyMode; |
| 2878 | } |
| 2879 | |
| 2880 | /* --------------------------------------------------------------------------- |
| 2881 | \fn sme_RoamConnect |
| 2882 | \brief a wrapper function to request CSR to inititiate an association |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2883 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2884 | \param sessionId - the sessionId returned by sme_OpenSession. |
| 2885 | \param pProfile - description of the network to which to connect |
| 2886 | \param hBssListIn - a list of BSS descriptor to roam to. It is returned |
| 2887 | from csrScanGetResult |
| 2888 | \param pRoamId - to get back the request ID |
| 2889 | \return eHalStatus |
| 2890 | ---------------------------------------------------------------------------*/ |
| 2891 | eHalStatus sme_RoamConnect(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamProfile *pProfile, |
| 2892 | tANI_U32 *pRoamId) |
| 2893 | { |
| 2894 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2895 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2896 | |
Yue Ma | e36e355 | 2014-03-05 17:06:20 -0800 | [diff] [blame] | 2897 | if (!pMac) |
| 2898 | { |
| 2899 | return eHAL_STATUS_FAILURE; |
| 2900 | } |
| 2901 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2902 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2903 | TRACE_CODE_SME_RX_HDD_MSG_CONNECT, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2904 | smsLog(pMac, LOG2, FL("enter")); |
| 2905 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2906 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2907 | { |
| 2908 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 2909 | { |
| 2910 | status = csrRoamConnect( pMac, sessionId, pProfile, NULL, pRoamId ); |
| 2911 | } |
| 2912 | else |
| 2913 | { |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2914 | smsLog(pMac, LOGE, FL("invalid sessionID %d"), sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2915 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 2916 | } |
| 2917 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2918 | } |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2919 | else |
| 2920 | { |
| 2921 | smsLog(pMac, LOGE, FL("sme_AcquireGlobalLock failed")); |
| 2922 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2923 | |
| 2924 | return (status); |
| 2925 | } |
| 2926 | |
| 2927 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | dacbcb5 | 2013-04-18 16:41:54 +0530 | [diff] [blame] | 2928 | |
| 2929 | \fn sme_SetPhyMode |
| 2930 | |
| 2931 | \brief Changes the PhyMode. |
| 2932 | |
| 2933 | \param hHal - The handle returned by macOpen. |
| 2934 | |
| 2935 | \param phyMode new phyMode which is to set |
| 2936 | |
| 2937 | \return eHalStatus SUCCESS. |
| 2938 | |
| 2939 | -------------------------------------------------------------------------------*/ |
| 2940 | eHalStatus sme_SetPhyMode(tHalHandle hHal, eCsrPhyMode phyMode) |
| 2941 | { |
| 2942 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2943 | |
| 2944 | if (NULL == pMac) |
| 2945 | { |
| 2946 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 2947 | "%s: invalid context", __func__); |
| 2948 | return eHAL_STATUS_FAILURE; |
| 2949 | } |
| 2950 | |
| 2951 | pMac->roam.configParam.phyMode = phyMode; |
| 2952 | pMac->roam.configParam.uCfgDot11Mode = csrGetCfgDot11ModeFromCsrPhyMode(NULL, |
| 2953 | pMac->roam.configParam.phyMode, |
| 2954 | pMac->roam.configParam.ProprietaryRatesEnabled); |
| 2955 | |
| 2956 | return eHAL_STATUS_SUCCESS; |
| 2957 | } |
| 2958 | |
| 2959 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2960 | \fn sme_RoamReassoc |
| 2961 | \brief a wrapper function to request CSR to inititiate a re-association |
| 2962 | \param pProfile - can be NULL to join the currently connected AP. In that |
| 2963 | case modProfileFields should carry the modified field(s) which could trigger |
| 2964 | reassoc |
| 2965 | \param modProfileFields - fields which are part of tCsrRoamConnectedProfile |
| 2966 | that might need modification dynamically once STA is up & running and this |
| 2967 | could trigger a reassoc |
| 2968 | \param pRoamId - to get back the request ID |
| 2969 | \return eHalStatus |
| 2970 | -------------------------------------------------------------------------------*/ |
| 2971 | eHalStatus sme_RoamReassoc(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamProfile *pProfile, |
| 2972 | tCsrRoamModifyProfileFields modProfileFields, |
Madan Mohan Koyyalamudi | ea22cdc | 2012-10-18 21:02:23 -0700 | [diff] [blame] | 2973 | tANI_U32 *pRoamId, v_BOOL_t fForce) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2974 | { |
| 2975 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2976 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2977 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2978 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2979 | TRACE_CODE_SME_RX_HDD_ROAM_REASSOC, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2980 | smsLog(pMac, LOG2, FL("enter")); |
| 2981 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2982 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2983 | { |
| 2984 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 2985 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2986 | if((NULL == pProfile) && (fForce == 1)) |
| 2987 | { |
Madan Mohan Koyyalamudi | 0d0e171 | 2012-10-21 12:02:45 -0700 | [diff] [blame] | 2988 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 2989 | /* to force the AP initiate fresh 802.1x authentication need to clear |
| 2990 | * the PMKID cache for that set the following boolean. this is needed |
| 2991 | * by the HS 2.0 passpoint certification 5.2.a and b testcases */ |
| 2992 | pSession->fIgnorePMKIDCache = TRUE; |
Madan Mohan Koyyalamudi | ea22cdc | 2012-10-18 21:02:23 -0700 | [diff] [blame] | 2993 | status = csrReassoc( pMac, sessionId, &modProfileFields, pRoamId , fForce); |
| 2994 | } |
| 2995 | else |
| 2996 | { |
| 2997 | status = csrRoamReassoc( pMac, sessionId, pProfile, modProfileFields, pRoamId ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2998 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2999 | } |
| 3000 | else |
| 3001 | { |
| 3002 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3003 | } |
| 3004 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3005 | } |
| 3006 | |
| 3007 | return (status); |
| 3008 | } |
| 3009 | |
| 3010 | /* --------------------------------------------------------------------------- |
| 3011 | \fn sme_RoamConnectToLastProfile |
| 3012 | \brief a wrapper function to request CSR to disconnect and reconnect with |
| 3013 | the same profile |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3014 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3015 | \return eHalStatus. It returns fail if currently connected |
| 3016 | ---------------------------------------------------------------------------*/ |
| 3017 | eHalStatus sme_RoamConnectToLastProfile(tHalHandle hHal, tANI_U8 sessionId) |
| 3018 | { |
| 3019 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3020 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3021 | |
| 3022 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3023 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3024 | { |
| 3025 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3026 | { |
| 3027 | status = csrRoamConnectToLastProfile( pMac, sessionId ); |
| 3028 | } |
| 3029 | else |
| 3030 | { |
| 3031 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3032 | } |
| 3033 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3034 | } |
| 3035 | |
| 3036 | return (status); |
| 3037 | } |
| 3038 | |
| 3039 | /* --------------------------------------------------------------------------- |
| 3040 | \fn sme_RoamDisconnect |
| 3041 | \brief a wrapper function to request CSR to disconnect from a network |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3042 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3043 | \param reason -- To indicate the reason for disconnecting. Currently, only |
| 3044 | eCSR_DISCONNECT_REASON_MIC_ERROR is meanful. |
| 3045 | \return eHalStatus |
| 3046 | ---------------------------------------------------------------------------*/ |
| 3047 | eHalStatus sme_RoamDisconnect(tHalHandle hHal, tANI_U8 sessionId, eCsrRoamDisconnectReason reason) |
| 3048 | { |
| 3049 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3050 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3051 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3052 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3053 | TRACE_CODE_SME_RX_HDD_ROAM_DISCONNECT, sessionId, reason)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3054 | smsLog(pMac, LOG2, FL("enter")); |
| 3055 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3056 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3057 | { |
| 3058 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3059 | { |
| 3060 | status = csrRoamDisconnect( pMac, sessionId, reason ); |
| 3061 | } |
| 3062 | else |
| 3063 | { |
| 3064 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3065 | } |
| 3066 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3067 | } |
| 3068 | |
| 3069 | return (status); |
| 3070 | } |
| 3071 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3072 | /* --------------------------------------------------------------------------- |
| 3073 | \fn sme_RoamStopBss |
| 3074 | \brief To stop BSS for Soft AP. This is an asynchronous API. |
| 3075 | \param hHal - Global structure |
| 3076 | \param sessionId - sessionId of SoftAP |
| 3077 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3078 | -------------------------------------------------------------------------------*/ |
| 3079 | eHalStatus sme_RoamStopBss(tHalHandle hHal, tANI_U8 sessionId) |
| 3080 | { |
| 3081 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3082 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3083 | |
| 3084 | smsLog(pMac, LOG2, FL("enter")); |
| 3085 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3086 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3087 | { |
| 3088 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3089 | { |
Gopichand Nakkala | f44bdc5 | 2013-02-16 00:54:45 +0530 | [diff] [blame] | 3090 | status = csrRoamIssueStopBssCmd( pMac, sessionId, eANI_BOOLEAN_FALSE ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3091 | } |
| 3092 | else |
| 3093 | { |
| 3094 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3095 | } |
| 3096 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3097 | } |
| 3098 | |
| 3099 | return (status); |
| 3100 | } |
| 3101 | |
| 3102 | /* --------------------------------------------------------------------------- |
| 3103 | \fn sme_RoamDisconnectSta |
| 3104 | \brief To disassociate a station. This is an asynchronous API. |
| 3105 | \param hHal - Global structure |
| 3106 | \param sessionId - sessionId of SoftAP |
| 3107 | \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) |
| 3108 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3109 | -------------------------------------------------------------------------------*/ |
| 3110 | eHalStatus sme_RoamDisconnectSta(tHalHandle hHal, tANI_U8 sessionId, |
| 3111 | tANI_U8 *pPeerMacAddr) |
| 3112 | { |
| 3113 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3114 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3115 | |
| 3116 | if ( NULL == pMac ) |
| 3117 | { |
| 3118 | VOS_ASSERT(0); |
| 3119 | return status; |
| 3120 | } |
| 3121 | |
| 3122 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3123 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3124 | { |
| 3125 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3126 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3127 | status = csrRoamIssueDisassociateStaCmd( pMac, sessionId, pPeerMacAddr, |
Madan Mohan Koyyalamudi | 299b486 | 2013-01-30 19:59:23 +0530 | [diff] [blame] | 3128 | eSIR_MAC_DEAUTH_LEAVING_BSS_REASON); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3129 | } |
| 3130 | else |
| 3131 | { |
| 3132 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3133 | } |
| 3134 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3135 | } |
| 3136 | |
| 3137 | return (status); |
| 3138 | } |
| 3139 | |
| 3140 | /* --------------------------------------------------------------------------- |
| 3141 | \fn sme_RoamDeauthSta |
| 3142 | \brief To disassociate a station. This is an asynchronous API. |
| 3143 | \param hHal - Global structure |
| 3144 | \param sessionId - sessionId of SoftAP |
| 3145 | \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) |
| 3146 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3147 | -------------------------------------------------------------------------------*/ |
| 3148 | eHalStatus sme_RoamDeauthSta(tHalHandle hHal, tANI_U8 sessionId, |
| 3149 | tANI_U8 *pPeerMacAddr) |
| 3150 | { |
| 3151 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3152 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3153 | |
| 3154 | if ( NULL == pMac ) |
| 3155 | { |
| 3156 | VOS_ASSERT(0); |
| 3157 | return status; |
| 3158 | } |
| 3159 | |
| 3160 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3161 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3162 | { |
| 3163 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3164 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3165 | status = csrRoamIssueDeauthStaCmd( pMac, sessionId, pPeerMacAddr, |
Madan Mohan Koyyalamudi | 299b486 | 2013-01-30 19:59:23 +0530 | [diff] [blame] | 3166 | eSIR_MAC_DEAUTH_LEAVING_BSS_REASON); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3167 | } |
| 3168 | else |
| 3169 | { |
| 3170 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3171 | } |
| 3172 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3173 | } |
| 3174 | |
| 3175 | return (status); |
| 3176 | } |
| 3177 | |
| 3178 | /* --------------------------------------------------------------------------- |
| 3179 | \fn sme_RoamTKIPCounterMeasures |
| 3180 | \brief To start or stop TKIP counter measures. This is an asynchronous API. |
| 3181 | \param sessionId - sessionId of SoftAP |
| 3182 | \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) |
| 3183 | \return eHalStatus |
| 3184 | -------------------------------------------------------------------------------*/ |
| 3185 | eHalStatus sme_RoamTKIPCounterMeasures(tHalHandle hHal, tANI_U8 sessionId, |
| 3186 | tANI_BOOLEAN bEnable) |
| 3187 | { |
| 3188 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3189 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3190 | |
| 3191 | if ( NULL == pMac ) |
| 3192 | { |
| 3193 | VOS_ASSERT(0); |
| 3194 | return status; |
| 3195 | } |
| 3196 | |
| 3197 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3198 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3199 | { |
| 3200 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3201 | { |
| 3202 | status = csrRoamIssueTkipCounterMeasures( pMac, sessionId, bEnable); |
| 3203 | } |
| 3204 | else |
| 3205 | { |
| 3206 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3207 | } |
| 3208 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3209 | } |
| 3210 | |
| 3211 | return (status); |
| 3212 | } |
| 3213 | |
| 3214 | /* --------------------------------------------------------------------------- |
| 3215 | \fn sme_RoamGetAssociatedStas |
| 3216 | \brief To probe the list of associated stations from various modules of CORE stack. |
| 3217 | \This is an asynchronous API. |
| 3218 | \param sessionId - sessionId of SoftAP |
| 3219 | \param modId - Module from whom list of associtated stations is to be probed. |
| 3220 | If an invalid module is passed then by default VOS_MODULE_ID_PE will be probed |
| 3221 | \param pUsrContext - Opaque HDD context |
| 3222 | \param pfnSapEventCallback - Sap event callback in HDD |
| 3223 | \param pAssocBuf - Caller allocated memory to be filled with associatd stations info |
| 3224 | \return eHalStatus |
| 3225 | -------------------------------------------------------------------------------*/ |
| 3226 | eHalStatus sme_RoamGetAssociatedStas(tHalHandle hHal, tANI_U8 sessionId, |
| 3227 | VOS_MODULE_ID modId, void *pUsrContext, |
| 3228 | void *pfnSapEventCallback, tANI_U8 *pAssocStasBuf) |
| 3229 | { |
| 3230 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3231 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3232 | |
| 3233 | if ( NULL == pMac ) |
| 3234 | { |
| 3235 | VOS_ASSERT(0); |
| 3236 | return status; |
| 3237 | } |
| 3238 | |
| 3239 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3240 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3241 | { |
| 3242 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3243 | { |
| 3244 | status = csrRoamGetAssociatedStas( pMac, sessionId, modId, pUsrContext, pfnSapEventCallback, pAssocStasBuf ); |
| 3245 | } |
| 3246 | else |
| 3247 | { |
| 3248 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3249 | } |
| 3250 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3251 | } |
| 3252 | |
| 3253 | return (status); |
| 3254 | } |
| 3255 | |
| 3256 | /* --------------------------------------------------------------------------- |
| 3257 | \fn sme_RoamGetWpsSessionOverlap |
| 3258 | \brief To get the WPS PBC session overlap information. |
| 3259 | \This is an asynchronous API. |
| 3260 | \param sessionId - sessionId of SoftAP |
| 3261 | \param pUsrContext - Opaque HDD context |
| 3262 | \param pfnSapEventCallback - Sap event callback in HDD |
| 3263 | \pRemoveMac - pointer to Mac address which needs to be removed from session |
| 3264 | \return eHalStatus |
| 3265 | -------------------------------------------------------------------------------*/ |
| 3266 | eHalStatus sme_RoamGetWpsSessionOverlap(tHalHandle hHal, tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3267 | void *pUsrContext, void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3268 | *pfnSapEventCallback, v_MACADDR_t pRemoveMac) |
| 3269 | { |
| 3270 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3271 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3272 | |
| 3273 | if ( NULL == pMac ) |
| 3274 | { |
| 3275 | VOS_ASSERT(0); |
| 3276 | return status; |
| 3277 | } |
| 3278 | |
| 3279 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3280 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3281 | { |
| 3282 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3283 | { |
| 3284 | status = csrRoamGetWpsSessionOverlap( pMac, sessionId, pUsrContext, pfnSapEventCallback, pRemoveMac); |
| 3285 | } |
| 3286 | else |
| 3287 | { |
| 3288 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3289 | } |
| 3290 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3291 | } |
| 3292 | |
| 3293 | return (status); |
| 3294 | } |
| 3295 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3296 | |
| 3297 | /* --------------------------------------------------------------------------- |
| 3298 | \fn sme_RoamGetConnectState |
| 3299 | \brief a wrapper function to request CSR to return the current connect state |
| 3300 | of Roaming |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3301 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3302 | \return eHalStatus |
| 3303 | ---------------------------------------------------------------------------*/ |
| 3304 | eHalStatus sme_RoamGetConnectState(tHalHandle hHal, tANI_U8 sessionId, eCsrConnectState *pState) |
| 3305 | { |
| 3306 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3307 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3308 | |
| 3309 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3310 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3311 | { |
| 3312 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3313 | { |
| 3314 | status = csrRoamGetConnectState( pMac, sessionId, pState ); |
| 3315 | } |
| 3316 | else |
| 3317 | { |
| 3318 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3319 | } |
| 3320 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3321 | } |
| 3322 | |
| 3323 | return (status); |
| 3324 | } |
| 3325 | |
| 3326 | /* --------------------------------------------------------------------------- |
| 3327 | \fn sme_RoamGetConnectProfile |
| 3328 | \brief a wrapper function to request CSR to return the current connect |
| 3329 | profile. Caller must call csrRoamFreeConnectProfile after it is done |
| 3330 | and before reuse for another csrRoamGetConnectProfile call. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3331 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3332 | \param pProfile - pointer to a caller allocated structure |
| 3333 | tCsrRoamConnectedProfile |
| 3334 | \return eHalStatus. Failure if not connected |
| 3335 | ---------------------------------------------------------------------------*/ |
| 3336 | eHalStatus sme_RoamGetConnectProfile(tHalHandle hHal, tANI_U8 sessionId, |
| 3337 | tCsrRoamConnectedProfile *pProfile) |
| 3338 | { |
| 3339 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3340 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3341 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3342 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3343 | TRACE_CODE_SME_RX_HDD_ROAM_GET_CONNECTPROFILE, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3344 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3345 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3346 | { |
| 3347 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3348 | { |
| 3349 | status = csrRoamGetConnectProfile( pMac, sessionId, pProfile ); |
| 3350 | } |
| 3351 | else |
| 3352 | { |
| 3353 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3354 | } |
| 3355 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3356 | } |
| 3357 | |
| 3358 | return (status); |
| 3359 | } |
| 3360 | |
| 3361 | /* --------------------------------------------------------------------------- |
| 3362 | \fn sme_RoamFreeConnectProfile |
| 3363 | \brief a wrapper function to request CSR to free and reinitialize the |
| 3364 | profile returned previously by csrRoamGetConnectProfile. |
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 pProfile - pointer to a caller allocated structure |
| 3367 | tCsrRoamConnectedProfile |
| 3368 | \return eHalStatus. |
| 3369 | ---------------------------------------------------------------------------*/ |
| 3370 | eHalStatus sme_RoamFreeConnectProfile(tHalHandle hHal, |
| 3371 | tCsrRoamConnectedProfile *pProfile) |
| 3372 | { |
| 3373 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3374 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 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_ROAM_FREE_CONNECTPROFILE, 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 | status = csrRoamFreeConnectProfile( pMac, pProfile ); |
| 3382 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3383 | } |
| 3384 | |
| 3385 | return (status); |
| 3386 | } |
| 3387 | |
| 3388 | /* --------------------------------------------------------------------------- |
| 3389 | \fn sme_RoamSetPMKIDCache |
| 3390 | \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] | 3391 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3392 | \param pPMKIDCache - caller allocated buffer point to an array of |
| 3393 | tPmkidCacheInfo |
| 3394 | \param numItems - a variable that has the number of tPmkidCacheInfo |
| 3395 | allocated when retruning, this is either the number needed |
| 3396 | or number of items put into pPMKIDCache |
| 3397 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3398 | big enough and pNumItems has the number of |
| 3399 | tPmkidCacheInfo. |
| 3400 | \Note: pNumItems is a number of tPmkidCacheInfo, |
| 3401 | not sizeof(tPmkidCacheInfo) * something |
| 3402 | ---------------------------------------------------------------------------*/ |
| 3403 | eHalStatus sme_RoamSetPMKIDCache( tHalHandle hHal, tANI_U8 sessionId, tPmkidCacheInfo *pPMKIDCache, |
| 3404 | tANI_U32 numItems ) |
| 3405 | { |
| 3406 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3407 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3408 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3409 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3410 | TRACE_CODE_SME_RX_HDD_ROAM_SET_PMKIDCACHE, sessionId, numItems)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3411 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3412 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3413 | { |
| 3414 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3415 | { |
| 3416 | status = csrRoamSetPMKIDCache( pMac, sessionId, pPMKIDCache, numItems ); |
| 3417 | } |
| 3418 | else |
| 3419 | { |
| 3420 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3421 | } |
| 3422 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3423 | } |
| 3424 | |
| 3425 | return (status); |
| 3426 | } |
| 3427 | |
Leela Venkata Kiran Kumar Reddy Chirala | ede1065 | 2013-09-11 18:48:46 -0700 | [diff] [blame] | 3428 | eHalStatus sme_RoamDelPMKIDfromCache( tHalHandle hHal, tANI_U8 sessionId, tANI_U8 *pBSSId ) |
| 3429 | { |
| 3430 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3431 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3432 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3433 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3434 | { |
| 3435 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3436 | { |
| 3437 | status = csrRoamDelPMKIDfromCache( pMac, sessionId, pBSSId ); |
| 3438 | } |
| 3439 | else |
| 3440 | { |
| 3441 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3442 | } |
| 3443 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3444 | } |
| 3445 | return (status); |
| 3446 | } |
Wilson Yang | 47b5819 | 2013-12-11 11:40:19 -0800 | [diff] [blame] | 3447 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3448 | /* --------------------------------------------------------------------------- |
| 3449 | \fn sme_RoamGetSecurityReqIE |
| 3450 | \brief a wrapper function to request CSR to return the WPA or RSN or WAPI IE CSR |
| 3451 | passes to PE to JOIN request or START_BSS request |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3452 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3453 | \param pLen - caller allocated memory that has the length of pBuf as input. |
| 3454 | Upon returned, *pLen has the needed or IE length in pBuf. |
| 3455 | \param pBuf - Caller allocated memory that contain the IE field, if any, |
| 3456 | upon return |
| 3457 | \param secType - Specifies whether looking for WPA/WPA2/WAPI IE |
| 3458 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3459 | big enough |
| 3460 | ---------------------------------------------------------------------------*/ |
| 3461 | eHalStatus sme_RoamGetSecurityReqIE(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pLen, |
| 3462 | tANI_U8 *pBuf, eCsrSecurityType secType) |
| 3463 | { |
| 3464 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3465 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3466 | |
| 3467 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3468 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3469 | { |
| 3470 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3471 | { |
| 3472 | status = csrRoamGetWpaRsnReqIE( hHal, sessionId, pLen, pBuf ); |
| 3473 | } |
| 3474 | else |
| 3475 | { |
| 3476 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3477 | } |
| 3478 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3479 | } |
| 3480 | |
| 3481 | return (status); |
| 3482 | } |
| 3483 | |
| 3484 | /* --------------------------------------------------------------------------- |
| 3485 | \fn sme_RoamGetSecurityRspIE |
| 3486 | \brief a wrapper function to request CSR to return the WPA or RSN or WAPI IE from |
| 3487 | the beacon or probe rsp if connected |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3488 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3489 | \param pLen - caller allocated memory that has the length of pBuf as input. |
| 3490 | Upon returned, *pLen has the needed or IE length in pBuf. |
| 3491 | \param pBuf - Caller allocated memory that contain the IE field, if any, |
| 3492 | upon return |
| 3493 | \param secType - Specifies whether looking for WPA/WPA2/WAPI IE |
| 3494 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3495 | big enough |
| 3496 | ---------------------------------------------------------------------------*/ |
| 3497 | eHalStatus sme_RoamGetSecurityRspIE(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pLen, |
| 3498 | tANI_U8 *pBuf, eCsrSecurityType secType) |
| 3499 | { |
| 3500 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3501 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3502 | |
| 3503 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3504 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3505 | { |
| 3506 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3507 | { |
| 3508 | status = csrRoamGetWpaRsnRspIE( pMac, sessionId, pLen, pBuf ); |
| 3509 | } |
| 3510 | else |
| 3511 | { |
| 3512 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3513 | } |
| 3514 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3515 | } |
| 3516 | |
| 3517 | return (status); |
| 3518 | |
| 3519 | } |
| 3520 | |
| 3521 | |
| 3522 | /* --------------------------------------------------------------------------- |
| 3523 | \fn sme_RoamGetNumPMKIDCache |
| 3524 | \brief a wrapper function to request CSR to return number of PMKID cache |
| 3525 | entries |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3526 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3527 | \return tANI_U32 - the number of PMKID cache entries |
| 3528 | ---------------------------------------------------------------------------*/ |
| 3529 | tANI_U32 sme_RoamGetNumPMKIDCache(tHalHandle hHal, tANI_U8 sessionId) |
| 3530 | { |
| 3531 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3532 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3533 | tANI_U32 numPmkidCache = 0; |
| 3534 | |
| 3535 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3536 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3537 | { |
| 3538 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3539 | { |
| 3540 | numPmkidCache = csrRoamGetNumPMKIDCache( pMac, sessionId ); |
| 3541 | status = eHAL_STATUS_SUCCESS; |
| 3542 | } |
| 3543 | else |
| 3544 | { |
| 3545 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3546 | } |
| 3547 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3548 | } |
| 3549 | |
| 3550 | return (numPmkidCache); |
| 3551 | } |
| 3552 | |
| 3553 | /* --------------------------------------------------------------------------- |
| 3554 | \fn sme_RoamGetPMKIDCache |
| 3555 | \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] | 3556 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3557 | \param pNum - caller allocated memory that has the space of the number of |
| 3558 | pBuf tPmkidCacheInfo as input. Upon returned, *pNum has the |
| 3559 | needed or actually number in tPmkidCacheInfo. |
| 3560 | \param pPmkidCache - Caller allocated memory that contains PMKID cache, if |
| 3561 | any, upon return |
| 3562 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3563 | big enough |
| 3564 | ---------------------------------------------------------------------------*/ |
| 3565 | eHalStatus sme_RoamGetPMKIDCache(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pNum, |
| 3566 | tPmkidCacheInfo *pPmkidCache) |
| 3567 | { |
| 3568 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3569 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3570 | |
| 3571 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3572 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3573 | { |
| 3574 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3575 | { |
| 3576 | status = csrRoamGetPMKIDCache( pMac, sessionId, pNum, pPmkidCache ); |
| 3577 | } |
| 3578 | else |
| 3579 | { |
| 3580 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3581 | } |
| 3582 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3583 | } |
| 3584 | |
| 3585 | return (status); |
| 3586 | } |
| 3587 | |
| 3588 | |
| 3589 | /* --------------------------------------------------------------------------- |
| 3590 | \fn sme_GetConfigParam |
| 3591 | \brief a wrapper function that HDD calls to get the global settings |
| 3592 | currently maintained by CSR. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3593 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3594 | \param pParam - caller allocated memory |
| 3595 | \return eHalStatus |
| 3596 | ---------------------------------------------------------------------------*/ |
| 3597 | eHalStatus sme_GetConfigParam(tHalHandle hHal, tSmeConfigParams *pParam) |
| 3598 | { |
| 3599 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3600 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3601 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3602 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3603 | TRACE_CODE_SME_RX_HDD_GET_CONFIGPARAM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3604 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3605 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3606 | { |
| 3607 | status = csrGetConfigParam(pMac, &pParam->csrConfig); |
| 3608 | if (status != eHAL_STATUS_SUCCESS) |
| 3609 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3610 | smsLog( pMac, LOGE, "%s csrGetConfigParam failed", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3611 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3612 | return status; |
| 3613 | } |
| 3614 | #if defined WLAN_FEATURE_P2P_INTERNAL |
| 3615 | status = p2pGetConfigParam(pMac, &pParam->p2pConfig); |
| 3616 | if (status != eHAL_STATUS_SUCCESS) |
| 3617 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3618 | smsLog( pMac, LOGE, "%s p2pGetConfigParam failed", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3619 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3620 | return status; |
| 3621 | } |
| 3622 | #endif |
| 3623 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3624 | } |
| 3625 | |
| 3626 | return (status); |
| 3627 | } |
| 3628 | |
| 3629 | /* --------------------------------------------------------------------------- |
| 3630 | \fn sme_CfgSetInt |
| 3631 | \brief a wrapper function that HDD calls to set parameters in CFG. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3632 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3633 | \param cfgId - Configuration Parameter ID (type) for STA. |
| 3634 | \param ccmValue - The information related to Configuration Parameter ID |
| 3635 | which needs to be saved in CFG |
| 3636 | \param callback - To be registered by CSR with CCM. Once the CFG done with |
| 3637 | saving the information in the database, it notifies CCM & |
| 3638 | then the callback will be invoked to notify. |
| 3639 | \param toBeSaved - To save the request for future reference |
| 3640 | \return eHalStatus |
| 3641 | ---------------------------------------------------------------------------*/ |
| 3642 | eHalStatus sme_CfgSetInt(tHalHandle hHal, tANI_U32 cfgId, tANI_U32 ccmValue, |
| 3643 | tCcmCfgSetCallback callback, eAniBoolean toBeSaved) |
| 3644 | { |
| 3645 | return(ccmCfgSetInt(hHal, cfgId, ccmValue, callback, toBeSaved)); |
| 3646 | } |
| 3647 | |
| 3648 | /* --------------------------------------------------------------------------- |
| 3649 | \fn sme_CfgSetStr |
| 3650 | \brief a wrapper function that HDD calls to set parameters in CFG. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3651 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3652 | \param cfgId - Configuration Parameter ID (type) for STA. |
| 3653 | \param pStr - Pointer to the byte array which carries the information needs |
| 3654 | to be saved in CFG |
| 3655 | \param length - Length of the data to be saved |
| 3656 | \param callback - To be registered by CSR with CCM. Once the CFG done with |
| 3657 | saving the information in the database, it notifies CCM & |
| 3658 | then the callback will be invoked to notify. |
| 3659 | \param toBeSaved - To save the request for future reference |
| 3660 | \return eHalStatus |
| 3661 | ---------------------------------------------------------------------------*/ |
| 3662 | eHalStatus sme_CfgSetStr(tHalHandle hHal, tANI_U32 cfgId, tANI_U8 *pStr, |
| 3663 | tANI_U32 length, tCcmCfgSetCallback callback, |
| 3664 | eAniBoolean toBeSaved) |
| 3665 | { |
| 3666 | return(ccmCfgSetStr(hHal, cfgId, pStr, length, callback, toBeSaved)); |
| 3667 | } |
| 3668 | |
| 3669 | /* --------------------------------------------------------------------------- |
Sandeep Puligilla | 332ea91 | 2014-02-04 00:16:24 +0530 | [diff] [blame] | 3670 | \fn sme_HT40StopOBSSScan |
| 3671 | \brief HDD or SME - Command to stop the OBSS scan |
| 3672 | THis is implemented only for debugging purpose. |
| 3673 | As per spec while operating in 2.4GHz OBSS scan shouldnt be stopped. |
| 3674 | \param sessionId - sessionId |
| 3675 | changing which can cause reassoc |
| 3676 | |
| 3677 | \return eHalStatus |
| 3678 | -------------------------------------------------------------------------------*/ |
| 3679 | eHalStatus sme_HT40StopOBSSScan(tHalHandle hHal, tANI_U8 sessionId) |
| 3680 | { |
| 3681 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3682 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3683 | |
| 3684 | smsLog(pMac, LOG2, FL("enter")); |
| 3685 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3686 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3687 | { |
| 3688 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3689 | { |
| 3690 | csrHT40StopOBSSScan( pMac, sessionId ); |
| 3691 | } |
| 3692 | else |
| 3693 | { |
| 3694 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 3695 | "%s: Invalid session sessionId %d", __func__,sessionId); |
| 3696 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3697 | } |
| 3698 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3699 | } |
| 3700 | return (status); |
| 3701 | } |
| 3702 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3703 | /*-------------------------------------------------------------------------- |
| 3704 | \fn sme_SetConfigPowerSave |
| 3705 | \brief Wrapper fn to change power save configuration in SME (PMC) module. |
| 3706 | For BMPS related configuration, this function also updates the CFG |
| 3707 | and sends a message to FW to pick up the new values. Note: Calling |
| 3708 | this function only updates the configuration and does not enable |
| 3709 | the specified power save mode. |
| 3710 | \param hHal - The handle returned by macOpen. |
| 3711 | \param psMode - Power Saving mode being modified |
| 3712 | \param pConfigParams - a pointer to a caller allocated object of type |
| 3713 | tPmcSmpsConfigParams or tPmcBmpsConfigParams or tPmcImpsConfigParams |
| 3714 | \return eHalStatus |
| 3715 | --------------------------------------------------------------------------*/ |
| 3716 | eHalStatus sme_SetConfigPowerSave(tHalHandle hHal, tPmcPowerSavingMode psMode, |
| 3717 | void *pConfigParams) |
| 3718 | { |
| 3719 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3720 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3721 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3722 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3723 | TRACE_CODE_SME_RX_HDD_SET_CONFIG_PWRSAVE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3724 | if (NULL == pConfigParams ) { |
| 3725 | smsLog( pMac, LOGE, "Empty config param structure for PMC, " |
| 3726 | "nothing to update"); |
| 3727 | return eHAL_STATUS_FAILURE; |
| 3728 | } |
| 3729 | |
| 3730 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3731 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3732 | { |
| 3733 | status = pmcSetConfigPowerSave(hHal, psMode, pConfigParams); |
| 3734 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3735 | } |
| 3736 | |
| 3737 | return (status); |
| 3738 | } |
| 3739 | |
| 3740 | /*-------------------------------------------------------------------------- |
| 3741 | \fn sme_GetConfigPowerSave |
| 3742 | \brief Wrapper fn to retrieve power save configuration in SME (PMC) module |
| 3743 | \param hHal - The handle returned by macOpen. |
| 3744 | \param psMode - Power Saving mode |
| 3745 | \param pConfigParams - a pointer to a caller allocated object of type |
| 3746 | tPmcSmpsConfigParams or tPmcBmpsConfigParams or tPmcImpsConfigParams |
| 3747 | \return eHalStatus |
| 3748 | --------------------------------------------------------------------------*/ |
| 3749 | eHalStatus sme_GetConfigPowerSave(tHalHandle hHal, tPmcPowerSavingMode psMode, |
| 3750 | void *pConfigParams) |
| 3751 | { |
| 3752 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3753 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3754 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3755 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3756 | TRACE_CODE_SME_RX_HDD_GET_CONFIG_PWRSAVE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3757 | if (NULL == pConfigParams ) { |
| 3758 | smsLog( pMac, LOGE, "Empty config param structure for PMC, " |
| 3759 | "nothing to update"); |
| 3760 | return eHAL_STATUS_FAILURE; |
| 3761 | } |
| 3762 | |
| 3763 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3764 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3765 | { |
| 3766 | status = pmcGetConfigPowerSave(hHal, psMode, pConfigParams); |
| 3767 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3768 | } |
| 3769 | |
| 3770 | return (status); |
| 3771 | } |
| 3772 | |
| 3773 | /* --------------------------------------------------------------------------- |
| 3774 | \fn sme_SignalPowerEvent |
| 3775 | \brief Signals to PMC that a power event has occurred. Used for putting |
| 3776 | the chip into deep sleep mode. |
| 3777 | \param hHal - The handle returned by macOpen. |
| 3778 | \param event - the event that has occurred |
| 3779 | \return eHalStatus |
| 3780 | ---------------------------------------------------------------------------*/ |
| 3781 | eHalStatus sme_SignalPowerEvent (tHalHandle hHal, tPmcPowerEvent event) |
| 3782 | { |
| 3783 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3784 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3785 | |
| 3786 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3787 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3788 | { |
| 3789 | status = pmcSignalPowerEvent(hHal, event); |
| 3790 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3791 | } |
| 3792 | |
| 3793 | return (status); |
| 3794 | } |
| 3795 | |
| 3796 | /* --------------------------------------------------------------------------- |
| 3797 | \fn sme_EnablePowerSave |
| 3798 | \brief Enables one of the power saving modes. |
| 3799 | \param hHal - The handle returned by macOpen. |
| 3800 | \param psMode - The power saving mode to enable. If BMPS mode is enabled |
| 3801 | while the chip is operating in Full Power, PMC will start |
| 3802 | a timer that will try to put the chip in BMPS mode after |
| 3803 | expiry. |
| 3804 | \return eHalStatus |
| 3805 | ---------------------------------------------------------------------------*/ |
| 3806 | eHalStatus sme_EnablePowerSave (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 3807 | { |
| 3808 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3809 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3810 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3811 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3812 | TRACE_CODE_SME_RX_HDD_ENABLE_PWRSAVE, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3813 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3814 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3815 | { |
| 3816 | status = pmcEnablePowerSave(hHal, psMode); |
| 3817 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3818 | } |
| 3819 | |
| 3820 | return (status); |
| 3821 | } |
| 3822 | |
| 3823 | /* --------------------------------------------------------------------------- |
| 3824 | \fn sme_DisablePowerSave |
| 3825 | \brief Disables one of the power saving modes. |
| 3826 | \param hHal - The handle returned by macOpen. |
| 3827 | \param psMode - The power saving mode to disable. Disabling does not imply |
| 3828 | that device will be brought out of the current PS mode. This |
| 3829 | is purely a configuration API. |
| 3830 | \return eHalStatus |
| 3831 | ---------------------------------------------------------------------------*/ |
| 3832 | eHalStatus sme_DisablePowerSave (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 3833 | { |
| 3834 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3835 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3836 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3837 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3838 | TRACE_CODE_SME_RX_HDD_DISABLE_PWRSAVE, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3839 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3840 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3841 | { |
| 3842 | status = pmcDisablePowerSave(hHal, psMode); |
| 3843 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3844 | } |
| 3845 | |
| 3846 | return (status); |
| 3847 | } |
| 3848 | |
| 3849 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 69b3418 | 2013-01-16 08:51:40 +0530 | [diff] [blame] | 3850 | + \fn sme_SetHostPowerSave |
| 3851 | + \brief Enables BMPS logic to be controlled by User level apps |
| 3852 | + \param hHal - The handle returned by macOpen. |
| 3853 | + \param psMode - The power saving mode to disable. Disabling does not imply |
| 3854 | + that device will be brought out of the current PS mode. This |
| 3855 | + is purely a configuration API. |
| 3856 | + \return eHalStatus |
| 3857 | + ---------------------------------------------------------------------------*/ |
| 3858 | eHalStatus sme_SetHostPowerSave (tHalHandle hHal, v_BOOL_t psMode) |
| 3859 | { |
| 3860 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3861 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3862 | |
| 3863 | pMac->pmc.isHostPsEn = psMode; |
| 3864 | |
| 3865 | return (status); |
| 3866 | } |
| 3867 | |
| 3868 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3869 | \fn sme_StartAutoBmpsTimer |
| 3870 | \brief Starts a timer that periodically polls all the registered |
| 3871 | module for entry into Bmps mode. This timer is started only if BMPS is |
| 3872 | enabled and whenever the device is in full power. |
| 3873 | \param hHal - The handle returned by macOpen. |
| 3874 | \return eHalStatus |
| 3875 | ---------------------------------------------------------------------------*/ |
| 3876 | eHalStatus sme_StartAutoBmpsTimer ( tHalHandle hHal) |
| 3877 | { |
| 3878 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3879 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3880 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3881 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3882 | TRACE_CODE_SME_RX_HDD_START_AUTO_BMPSTIMER, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3883 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3884 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3885 | { |
| 3886 | status = pmcStartAutoBmpsTimer(hHal); |
| 3887 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3888 | } |
| 3889 | |
| 3890 | return (status); |
| 3891 | } |
| 3892 | /* --------------------------------------------------------------------------- |
| 3893 | \fn sme_StopAutoBmpsTimer |
| 3894 | \brief Stops the Auto BMPS Timer that was started using sme_startAutoBmpsTimer |
| 3895 | Stopping the timer does not cause a device state change. Only the timer |
| 3896 | is stopped. If "Full Power" is desired, use the sme_RequestFullPower API |
| 3897 | \param hHal - The handle returned by macOpen. |
| 3898 | \return eHalStatus |
| 3899 | ---------------------------------------------------------------------------*/ |
| 3900 | eHalStatus sme_StopAutoBmpsTimer ( tHalHandle hHal) |
| 3901 | { |
| 3902 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3903 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3904 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3905 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3906 | TRACE_CODE_SME_RX_HDD_STOP_AUTO_BMPSTIMER, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3907 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3908 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3909 | { |
| 3910 | status = pmcStopAutoBmpsTimer(hHal); |
| 3911 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3912 | } |
| 3913 | |
| 3914 | return (status); |
| 3915 | } |
| 3916 | /* --------------------------------------------------------------------------- |
| 3917 | \fn sme_QueryPowerState |
| 3918 | \brief Returns the current power state of the device. |
| 3919 | \param hHal - The handle returned by macOpen. |
| 3920 | \param pPowerState - pointer to location to return power state (LOW or HIGH) |
| 3921 | \param pSwWlanSwitchState - ptr to location to return SW WLAN Switch state |
| 3922 | \return eHalStatus |
| 3923 | ---------------------------------------------------------------------------*/ |
| 3924 | eHalStatus sme_QueryPowerState ( |
| 3925 | tHalHandle hHal, |
| 3926 | tPmcPowerState *pPowerState, |
| 3927 | tPmcSwitchState *pSwWlanSwitchState) |
| 3928 | { |
| 3929 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3930 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3931 | |
| 3932 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3933 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3934 | { |
| 3935 | status = pmcQueryPowerState (hHal, pPowerState, NULL, pSwWlanSwitchState); |
| 3936 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3937 | } |
| 3938 | |
| 3939 | return (status); |
| 3940 | } |
| 3941 | |
| 3942 | /* --------------------------------------------------------------------------- |
| 3943 | \fn sme_IsPowerSaveEnabled |
| 3944 | \brief Checks if the device is able to enter a particular power save mode |
| 3945 | This does not imply that the device is in a particular PS mode |
| 3946 | \param hHal - The handle returned by macOpen. |
| 3947 | \param psMode - the power saving mode |
| 3948 | \return eHalStatus |
| 3949 | ---------------------------------------------------------------------------*/ |
| 3950 | tANI_BOOLEAN sme_IsPowerSaveEnabled (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 3951 | { |
| 3952 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3953 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3954 | tANI_BOOLEAN result = false; |
| 3955 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3956 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3957 | TRACE_CODE_SME_RX_HDD_IS_PWRSAVE_ENABLED, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3958 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3959 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3960 | { |
| 3961 | result = pmcIsPowerSaveEnabled(hHal, psMode); |
| 3962 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3963 | return result; |
| 3964 | } |
| 3965 | |
| 3966 | return false; |
| 3967 | } |
| 3968 | |
| 3969 | /* --------------------------------------------------------------------------- |
| 3970 | \fn sme_RequestFullPower |
| 3971 | \brief Request that the device be brought to full power state. When the |
| 3972 | device enters Full Power PMC will start a BMPS timer if BMPS PS mode |
| 3973 | is enabled. On timer expiry PMC will attempt to put the device in |
| 3974 | BMPS mode if following holds true: |
| 3975 | - BMPS mode is enabled |
| 3976 | - Polling of all modules through the Power Save Check routine passes |
| 3977 | - STA is associated to an access point |
| 3978 | \param hHal - The handle returned by macOpen. |
| 3979 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 3980 | \return eHalStatus - status |
| 3981 | eHAL_STATUS_SUCCESS - device brought to full power state |
| 3982 | eHAL_STATUS_FAILURE - device cannot be brought to full power state |
| 3983 | eHAL_STATUS_PMC_PENDING - device is being brought to full power state, |
| 3984 | ---------------------------------------------------------------------------*/ |
| 3985 | eHalStatus sme_RequestFullPower ( |
| 3986 | tHalHandle hHal, |
| 3987 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 3988 | void *callbackContext, |
| 3989 | tRequestFullPowerReason fullPowerReason) |
| 3990 | { |
| 3991 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3992 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3993 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3994 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3995 | TRACE_CODE_SME_RX_HDD_REQUEST_FULLPOWER, NO_SESSION, fullPowerReason)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3996 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3997 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3998 | { |
| 3999 | status = pmcRequestFullPower(hHal, callbackRoutine, callbackContext, fullPowerReason); |
| 4000 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4001 | } |
| 4002 | |
| 4003 | return (status); |
| 4004 | } |
| 4005 | |
| 4006 | /* --------------------------------------------------------------------------- |
| 4007 | \fn sme_RequestBmps |
| 4008 | \brief Request that the device be put in BMPS state. Request will be |
| 4009 | accepted only if BMPS mode is enabled and power save check routine |
| 4010 | passes. |
| 4011 | \param hHal - The handle returned by macOpen. |
| 4012 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4013 | \return eHalStatus |
| 4014 | eHAL_STATUS_SUCCESS - device is in BMPS state |
| 4015 | eHAL_STATUS_FAILURE - device cannot be brought to BMPS state |
| 4016 | eHAL_STATUS_PMC_PENDING - device is being brought to BMPS state |
| 4017 | ---------------------------------------------------------------------------*/ |
| 4018 | eHalStatus sme_RequestBmps ( |
| 4019 | tHalHandle hHal, |
| 4020 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4021 | void *callbackContext) |
| 4022 | { |
| 4023 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4024 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4025 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4026 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4027 | TRACE_CODE_SME_RX_HDD_REQUEST_BMPS, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4028 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4029 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4030 | { |
| 4031 | status = pmcRequestBmps(hHal, callbackRoutine, callbackContext); |
| 4032 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4033 | } |
| 4034 | |
| 4035 | return (status); |
| 4036 | } |
| 4037 | |
| 4038 | |
| 4039 | /* --------------------------------------------------------------------------- |
| 4040 | \fn sme_SetDHCPTillPowerActiveFlag |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4041 | \brief Sets/Clears DHCP related flag in PMC to disable/enable auto BMPS |
| 4042 | entry by PMC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4043 | \param hHal - The handle returned by macOpen. |
| 4044 | ---------------------------------------------------------------------------*/ |
| 4045 | void sme_SetDHCPTillPowerActiveFlag(tHalHandle hHal, tANI_U8 flag) |
| 4046 | { |
| 4047 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4048 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4049 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4050 | TRACE_CODE_SME_RX_HDD_SET_DHCP_FLAG, NO_SESSION, flag)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4051 | // Set/Clear the DHCP flag which will disable/enable auto BMPS entery by PMC |
| 4052 | pMac->pmc.remainInPowerActiveTillDHCP = flag; |
| 4053 | } |
| 4054 | |
| 4055 | |
| 4056 | /* --------------------------------------------------------------------------- |
| 4057 | \fn sme_StartUapsd |
| 4058 | \brief Request that the device be put in UAPSD state. If the device is in |
| 4059 | Full Power it will be put in BMPS mode first and then into UAPSD |
| 4060 | mode. |
| 4061 | \param hHal - The handle returned by macOpen. |
| 4062 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4063 | eHAL_STATUS_SUCCESS - device is in UAPSD state |
| 4064 | eHAL_STATUS_FAILURE - device cannot be brought to UAPSD state |
| 4065 | eHAL_STATUS_PMC_PENDING - device is being brought to UAPSD state |
| 4066 | eHAL_STATUS_PMC_DISABLED - UAPSD is disabled or BMPS mode is disabled |
| 4067 | \return eHalStatus |
| 4068 | ---------------------------------------------------------------------------*/ |
| 4069 | eHalStatus sme_StartUapsd ( |
| 4070 | tHalHandle hHal, |
| 4071 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4072 | void *callbackContext) |
| 4073 | { |
| 4074 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4075 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4076 | |
| 4077 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4078 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4079 | { |
| 4080 | status = pmcStartUapsd(hHal, callbackRoutine, callbackContext); |
| 4081 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4082 | } |
| 4083 | |
| 4084 | return (status); |
| 4085 | } |
| 4086 | |
| 4087 | /* --------------------------------------------------------------------------- |
| 4088 | \fn sme_StopUapsd |
| 4089 | \brief Request that the device be put out of UAPSD state. Device will be |
| 4090 | put in in BMPS state after stop UAPSD completes. |
| 4091 | \param hHal - The handle returned by macOpen. |
| 4092 | \return eHalStatus |
| 4093 | eHAL_STATUS_SUCCESS - device is put out of UAPSD and back in BMPS state |
| 4094 | eHAL_STATUS_FAILURE - device cannot be brought out of UAPSD state |
| 4095 | ---------------------------------------------------------------------------*/ |
| 4096 | eHalStatus sme_StopUapsd (tHalHandle hHal) |
| 4097 | { |
| 4098 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4099 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4100 | |
| 4101 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4102 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4103 | { |
| 4104 | status = pmcStopUapsd(hHal); |
| 4105 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4106 | } |
| 4107 | |
| 4108 | return (status); |
| 4109 | } |
| 4110 | |
| 4111 | /* --------------------------------------------------------------------------- |
| 4112 | \fn sme_RequestStandby |
| 4113 | \brief Request that the device be put in standby. It is HDD's responsibility |
| 4114 | to bring the chip to full power and do a disassoc before calling |
| 4115 | this API. |
| 4116 | \param hHal - The handle returned by macOpen. |
| 4117 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4118 | \return eHalStatus |
| 4119 | eHAL_STATUS_SUCCESS - device is in Standby mode |
| 4120 | eHAL_STATUS_FAILURE - device cannot be put in standby mode |
| 4121 | eHAL_STATUS_PMC_PENDING - device is being put in standby mode |
| 4122 | ---------------------------------------------------------------------------*/ |
| 4123 | eHalStatus sme_RequestStandby ( |
| 4124 | tHalHandle hHal, |
| 4125 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4126 | void *callbackContext) |
| 4127 | { |
| 4128 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4129 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4130 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4131 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4132 | TRACE_CODE_SME_RX_HDD_REQUEST_STANDBY, NO_SESSION, 0)); |
Agarwal Ashish | e3cca2a | 2013-07-21 03:01:48 +0530 | [diff] [blame] | 4133 | smsLog( pMac, LOG1, FL(" called") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4134 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4135 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4136 | { |
| 4137 | status = pmcRequestStandby(hHal, callbackRoutine, callbackContext); |
| 4138 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4139 | } |
| 4140 | |
| 4141 | return (status); |
| 4142 | } |
| 4143 | |
| 4144 | /* --------------------------------------------------------------------------- |
| 4145 | \fn sme_RegisterPowerSaveCheck |
| 4146 | \brief Register a power save check routine that is called whenever |
| 4147 | the device is about to enter one of the power save modes. |
| 4148 | \param hHal - The handle returned by macOpen. |
| 4149 | \param checkRoutine - Power save check routine to be registered |
| 4150 | \return eHalStatus |
| 4151 | eHAL_STATUS_SUCCESS - successfully registered |
| 4152 | eHAL_STATUS_FAILURE - not successfully registered |
| 4153 | ---------------------------------------------------------------------------*/ |
| 4154 | eHalStatus sme_RegisterPowerSaveCheck ( |
| 4155 | tHalHandle hHal, |
| 4156 | tANI_BOOLEAN (*checkRoutine) (void *checkContext), void *checkContext) |
| 4157 | { |
| 4158 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4159 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4160 | |
| 4161 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4162 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4163 | { |
| 4164 | status = pmcRegisterPowerSaveCheck (hHal, checkRoutine, checkContext); |
| 4165 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4166 | } |
| 4167 | |
| 4168 | return (status); |
| 4169 | } |
| 4170 | |
| 4171 | /* --------------------------------------------------------------------------- |
Mihir Shete | fc7ff5b | 2014-01-27 11:30:05 +0530 | [diff] [blame] | 4172 | \fn sme_Register11dScanDoneCallback |
| 4173 | \brief Register a routine of type csrScanCompleteCallback which is |
| 4174 | called whenever an 11d scan is done |
| 4175 | \param hHal - The handle returned by macOpen. |
| 4176 | \param callback - 11d scan complete routine to be registered |
| 4177 | \return eHalStatus |
| 4178 | ---------------------------------------------------------------------------*/ |
| 4179 | eHalStatus sme_Register11dScanDoneCallback ( |
| 4180 | tHalHandle hHal, |
| 4181 | csrScanCompleteCallback callback) |
| 4182 | { |
| 4183 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 4184 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4185 | |
| 4186 | pMac->scan.callback11dScanDone = callback; |
| 4187 | |
| 4188 | return (status); |
| 4189 | } |
| 4190 | |
| 4191 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4192 | \fn sme_DeregisterPowerSaveCheck |
| 4193 | \brief Deregister a power save check routine |
| 4194 | \param hHal - The handle returned by macOpen. |
| 4195 | \param checkRoutine - Power save check routine to be deregistered |
| 4196 | \return eHalStatus |
| 4197 | eHAL_STATUS_SUCCESS - successfully deregistered |
| 4198 | eHAL_STATUS_FAILURE - not successfully deregistered |
| 4199 | ---------------------------------------------------------------------------*/ |
| 4200 | eHalStatus sme_DeregisterPowerSaveCheck ( |
| 4201 | tHalHandle hHal, |
| 4202 | tANI_BOOLEAN (*checkRoutine) (void *checkContext)) |
| 4203 | { |
| 4204 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4205 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4206 | |
| 4207 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4208 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4209 | { |
| 4210 | status = pmcDeregisterPowerSaveCheck (hHal, checkRoutine); |
| 4211 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4212 | } |
| 4213 | |
| 4214 | return (status); |
| 4215 | } |
| 4216 | |
| 4217 | /* --------------------------------------------------------------------------- |
| 4218 | \fn sme_RegisterDeviceStateUpdateInd |
| 4219 | \brief Register a callback routine that is called whenever |
| 4220 | the device enters a new device state (Full Power, BMPS, UAPSD) |
| 4221 | \param hHal - The handle returned by macOpen. |
| 4222 | \param callbackRoutine - Callback routine to be registered |
| 4223 | \param callbackContext - Cookie to be passed back during callback |
| 4224 | \return eHalStatus |
| 4225 | eHAL_STATUS_SUCCESS - successfully registered |
| 4226 | eHAL_STATUS_FAILURE - not successfully registered |
| 4227 | ---------------------------------------------------------------------------*/ |
| 4228 | eHalStatus sme_RegisterDeviceStateUpdateInd ( |
| 4229 | tHalHandle hHal, |
| 4230 | void (*callbackRoutine) (void *callbackContext, tPmcState pmcState), |
| 4231 | void *callbackContext) |
| 4232 | { |
| 4233 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4234 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4235 | |
| 4236 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4237 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4238 | { |
| 4239 | status = pmcRegisterDeviceStateUpdateInd (hHal, callbackRoutine, callbackContext); |
| 4240 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4241 | } |
| 4242 | |
| 4243 | return (status); |
| 4244 | } |
| 4245 | |
| 4246 | /* --------------------------------------------------------------------------- |
| 4247 | \fn sme_DeregisterDeviceStateUpdateInd |
| 4248 | \brief Deregister a routine that was registered for device state changes |
| 4249 | \param hHal - The handle returned by macOpen. |
| 4250 | \param callbackRoutine - Callback routine to be deregistered |
| 4251 | \return eHalStatus |
| 4252 | eHAL_STATUS_SUCCESS - successfully deregistered |
| 4253 | eHAL_STATUS_FAILURE - not successfully deregistered |
| 4254 | ---------------------------------------------------------------------------*/ |
| 4255 | eHalStatus sme_DeregisterDeviceStateUpdateInd ( |
| 4256 | tHalHandle hHal, |
| 4257 | void (*callbackRoutine) (void *callbackContext, tPmcState pmcState)) |
| 4258 | { |
| 4259 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4260 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4261 | |
| 4262 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4263 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4264 | { |
| 4265 | status = pmcDeregisterDeviceStateUpdateInd (hHal, callbackRoutine); |
| 4266 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4267 | } |
| 4268 | |
| 4269 | return (status); |
| 4270 | } |
| 4271 | |
| 4272 | /* --------------------------------------------------------------------------- |
| 4273 | \fn sme_WowlAddBcastPattern |
| 4274 | \brief Add a pattern for Pattern Byte Matching in Wowl mode. Firmware will |
| 4275 | do a pattern match on these patterns when Wowl is enabled during BMPS |
| 4276 | mode. Note that Firmware performs the pattern matching only on |
| 4277 | broadcast frames and while Libra is in BMPS mode. |
| 4278 | \param hHal - The handle returned by macOpen. |
| 4279 | \param pattern - Pattern to be added |
| 4280 | \return eHalStatus |
| 4281 | eHAL_STATUS_FAILURE Cannot add pattern |
| 4282 | eHAL_STATUS_SUCCESS Request accepted. |
| 4283 | ---------------------------------------------------------------------------*/ |
| 4284 | eHalStatus sme_WowlAddBcastPattern ( |
| 4285 | tHalHandle hHal, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4286 | tpSirWowlAddBcastPtrn pattern, |
| 4287 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4288 | { |
| 4289 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4290 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4291 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4292 | TRACE_CODE_SME_RX_HDD_WOWL_ADDBCAST_PATTERN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4293 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4294 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4295 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4296 | status = pmcWowlAddBcastPattern (hHal, pattern, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4297 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4298 | } |
| 4299 | |
| 4300 | return (status); |
| 4301 | } |
| 4302 | |
| 4303 | /* --------------------------------------------------------------------------- |
| 4304 | \fn sme_WowlDelBcastPattern |
| 4305 | \brief Delete a pattern that was added for Pattern Byte Matching. |
| 4306 | \param hHal - The handle returned by macOpen. |
| 4307 | \param pattern - Pattern to be deleted |
| 4308 | \return eHalStatus |
| 4309 | eHAL_STATUS_FAILURE Cannot delete pattern |
| 4310 | eHAL_STATUS_SUCCESS Request accepted. |
| 4311 | ---------------------------------------------------------------------------*/ |
| 4312 | eHalStatus sme_WowlDelBcastPattern ( |
| 4313 | tHalHandle hHal, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4314 | tpSirWowlDelBcastPtrn pattern, |
| 4315 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4316 | { |
| 4317 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4318 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4319 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4320 | TRACE_CODE_SME_RX_HDD_WOWL_DELBCAST_PATTERN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4321 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4322 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4323 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4324 | status = pmcWowlDelBcastPattern (hHal, pattern, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4325 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4326 | } |
| 4327 | |
| 4328 | return (status); |
| 4329 | } |
| 4330 | |
| 4331 | /* --------------------------------------------------------------------------- |
| 4332 | \fn sme_EnterWowl |
| 4333 | \brief This is the SME API exposed to HDD to request enabling of WOWL mode. |
| 4334 | WoWLAN works on top of BMPS mode. If the device is not in BMPS mode, |
| 4335 | SME will will cache the information that WOWL has been enabled and |
| 4336 | attempt to put the device in BMPS. On entry into BMPS, SME will |
| 4337 | enable the WOWL mode. |
| 4338 | Note 1: If we exit BMPS mode (someone requests full power), we |
| 4339 | will NOT resume WOWL when we go back to BMPS again. Request for full |
| 4340 | power (while in WOWL mode) means disable WOWL and go to full power. |
| 4341 | Note 2: Both UAPSD and WOWL work on top of BMPS. On entry into BMPS, SME |
| 4342 | will give priority to UAPSD and enable only UAPSD if both UAPSD and WOWL |
| 4343 | are required. Currently there is no requirement or use case to support |
| 4344 | UAPSD and WOWL at the same time. |
| 4345 | |
| 4346 | \param hHal - The handle returned by macOpen. |
| 4347 | \param enterWowlCallbackRoutine - Callback routine provided by HDD. |
| 4348 | Used for success/failure notification by SME |
| 4349 | \param enterWowlCallbackContext - A cookie passed by HDD, that is passed back to HDD |
| 4350 | at the time of callback. |
| 4351 | \param wakeReasonIndCB - Callback routine provided by HDD. |
| 4352 | Used for Wake Reason Indication by SME |
| 4353 | \param wakeReasonIndCBContext - A cookie passed by HDD, that is passed back to HDD |
| 4354 | at the time of callback. |
| 4355 | \return eHalStatus |
| 4356 | eHAL_STATUS_SUCCESS Device is already in WoWLAN mode |
| 4357 | eHAL_STATUS_FAILURE Device cannot enter WoWLAN mode. |
| 4358 | eHAL_STATUS_PMC_PENDING Request accepted. SME will enable WOWL after |
| 4359 | BMPS mode is entered. |
| 4360 | ---------------------------------------------------------------------------*/ |
| 4361 | eHalStatus sme_EnterWowl ( |
| 4362 | tHalHandle hHal, |
| 4363 | void (*enterWowlCallbackRoutine) (void *callbackContext, eHalStatus status), |
| 4364 | void *enterWowlCallbackContext, |
| 4365 | #ifdef WLAN_WAKEUP_EVENTS |
| 4366 | void (*wakeIndicationCB) (void *callbackContext, tpSirWakeReasonInd pWakeReasonInd), |
| 4367 | void *wakeIndicationCBContext, |
| 4368 | #endif // WLAN_WAKEUP_EVENTS |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4369 | tpSirSmeWowlEnterParams wowlEnterParams, tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4370 | { |
| 4371 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4372 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4373 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4374 | TRACE_CODE_SME_RX_HDD_ENTER_WOWL, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4375 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4376 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4377 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4378 | status = pmcEnterWowl (hHal, enterWowlCallbackRoutine, enterWowlCallbackContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4379 | #ifdef WLAN_WAKEUP_EVENTS |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4380 | wakeIndicationCB, wakeIndicationCBContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4381 | #endif // WLAN_WAKEUP_EVENTS |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4382 | wowlEnterParams, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4383 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4384 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4385 | return (status); |
| 4386 | } |
| 4387 | /* --------------------------------------------------------------------------- |
| 4388 | \fn sme_ExitWowl |
| 4389 | \brief This is the SME API exposed to HDD to request exit from WoWLAN mode. |
| 4390 | SME will initiate exit from WoWLAN mode and device will be put in BMPS |
| 4391 | mode. |
| 4392 | \param hHal - The handle returned by macOpen. |
| 4393 | \return eHalStatus |
| 4394 | eHAL_STATUS_FAILURE Device cannot exit WoWLAN mode. |
| 4395 | eHAL_STATUS_SUCCESS Request accepted to exit WoWLAN mode. |
| 4396 | ---------------------------------------------------------------------------*/ |
| 4397 | eHalStatus sme_ExitWowl (tHalHandle hHal) |
| 4398 | { |
| 4399 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4400 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4401 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4402 | TRACE_CODE_SME_RX_HDD_EXIT_WOWL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4403 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4404 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4405 | { |
| 4406 | status = pmcExitWowl (hHal); |
| 4407 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4408 | } |
| 4409 | |
| 4410 | return (status); |
| 4411 | } |
| 4412 | |
| 4413 | /* --------------------------------------------------------------------------- |
| 4414 | |
| 4415 | \fn sme_RoamSetKey |
| 4416 | |
| 4417 | \brief To set encryption key. This function should be called only when connected |
| 4418 | This is an asynchronous API. |
| 4419 | |
| 4420 | \param pSetKeyInfo - pointer to a caller allocated object of tCsrSetContextInfo |
| 4421 | |
| 4422 | \param pRoamId Upon success return, this is the id caller can use to identify the request in roamcallback |
| 4423 | |
| 4424 | \return eHalStatus SUCCESS Roam callback will be called indicate actually results |
| 4425 | |
| 4426 | FAILURE or RESOURCES The API finished and failed. |
| 4427 | |
| 4428 | -------------------------------------------------------------------------------*/ |
| 4429 | eHalStatus sme_RoamSetKey(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 *pRoamId) |
| 4430 | { |
| 4431 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4432 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4433 | tANI_U32 roamId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4434 | tANI_U32 i; |
| 4435 | tCsrRoamSession *pSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4436 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4437 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4438 | TRACE_CODE_SME_RX_HDD_SET_KEY, sessionId, 0)); |
Jeff Johnson | f89f4b5 | 2013-03-27 10:32:44 -0700 | [diff] [blame] | 4439 | if (pSetKey->keyLength > CSR_MAX_KEY_LEN) |
| 4440 | { |
| 4441 | smsLog(pMac, LOGE, FL("Invalid key length %d"), pSetKey->keyLength); |
| 4442 | return eHAL_STATUS_FAILURE; |
| 4443 | } |
Abhishek Singh | 36abbcb | 2014-03-20 13:04:09 +0530 | [diff] [blame] | 4444 | /*Once Setkey is done, we can go in BMPS*/ |
| 4445 | if(pSetKey->keyLength) |
Abhishek Singh | 65d939e | 2014-04-25 13:33:07 +0530 | [diff] [blame] | 4446 | { |
Abhishek Singh | 36abbcb | 2014-03-20 13:04:09 +0530 | [diff] [blame] | 4447 | pMac->pmc.remainInPowerActiveTillDHCP = FALSE; |
Abhishek Singh | 65d939e | 2014-04-25 13:33:07 +0530 | [diff] [blame] | 4448 | smsLog(pMac, LOG1, FL("Reset remainInPowerActiveTillDHCP" |
| 4449 | " to allow BMPS")); |
| 4450 | } |
Jeff Johnson | f89f4b5 | 2013-03-27 10:32:44 -0700 | [diff] [blame] | 4451 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4452 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4453 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4454 | { |
| 4455 | roamId = GET_NEXT_ROAM_ID(&pMac->roam); |
| 4456 | if(pRoamId) |
| 4457 | { |
| 4458 | *pRoamId = roamId; |
| 4459 | } |
| 4460 | |
Jeff Johnson | f89f4b5 | 2013-03-27 10:32:44 -0700 | [diff] [blame] | 4461 | smsLog(pMac, LOG2, FL("keyLength %d"), pSetKey->keyLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4462 | |
| 4463 | for(i=0; i<pSetKey->keyLength; i++) |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4464 | smsLog(pMac, LOG2, FL("%02x"), pSetKey->Key[i]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4465 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4466 | smsLog(pMac, LOG2, "\n sessionId=%d roamId=%d", sessionId, roamId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4467 | |
| 4468 | pSession = CSR_GET_SESSION(pMac, sessionId); |
| 4469 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4470 | if(!pSession) |
| 4471 | { |
| 4472 | 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] | 4473 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4474 | return eHAL_STATUS_FAILURE; |
| 4475 | } |
| 4476 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4477 | if(CSR_IS_INFRA_AP(&pSession->connectedProfile)) |
| 4478 | { |
| 4479 | if(pSetKey->keyDirection == eSIR_TX_DEFAULT) |
| 4480 | { |
| 4481 | if ( ( eCSR_ENCRYPT_TYPE_WEP40 == pSetKey->encType ) || |
| 4482 | ( eCSR_ENCRYPT_TYPE_WEP40_STATICKEY == pSetKey->encType )) |
| 4483 | { |
| 4484 | pSession->pCurRoamProfile->negotiatedUCEncryptionType = eCSR_ENCRYPT_TYPE_WEP40_STATICKEY; |
| 4485 | } |
| 4486 | if ( ( eCSR_ENCRYPT_TYPE_WEP104 == pSetKey->encType ) || |
| 4487 | ( eCSR_ENCRYPT_TYPE_WEP104_STATICKEY == pSetKey->encType )) |
| 4488 | { |
| 4489 | pSession->pCurRoamProfile->negotiatedUCEncryptionType = eCSR_ENCRYPT_TYPE_WEP104_STATICKEY; |
| 4490 | } |
| 4491 | } |
| 4492 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4493 | |
| 4494 | status = csrRoamSetKey ( pMac, sessionId, pSetKey, roamId ); |
| 4495 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4496 | } |
| 4497 | |
| 4498 | return (status); |
| 4499 | } |
| 4500 | |
| 4501 | |
| 4502 | /* --------------------------------------------------------------------------- |
| 4503 | |
| 4504 | \fn sme_RoamRemoveKey |
| 4505 | |
| 4506 | \brief To set encryption key. This is an asynchronous API. |
| 4507 | |
| 4508 | \param pRemoveKey - pointer to a caller allocated object of tCsrRoamRemoveKey |
| 4509 | |
| 4510 | \param pRoamId Upon success return, this is the id caller can use to identify the request in roamcallback |
| 4511 | |
| 4512 | \return eHalStatus SUCCESS Roam callback will be called indicate actually results |
| 4513 | |
| 4514 | FAILURE or RESOURCES The API finished and failed. |
| 4515 | |
| 4516 | -------------------------------------------------------------------------------*/ |
| 4517 | eHalStatus sme_RoamRemoveKey(tHalHandle hHal, tANI_U8 sessionId, |
| 4518 | tCsrRoamRemoveKey *pRemoveKey, tANI_U32 *pRoamId) |
| 4519 | { |
| 4520 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4521 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4522 | tANI_U32 roamId; |
| 4523 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4524 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4525 | TRACE_CODE_SME_RX_HDD_REMOVE_KEY, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4526 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4527 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4528 | { |
| 4529 | roamId = GET_NEXT_ROAM_ID(&pMac->roam); |
| 4530 | if(pRoamId) |
| 4531 | { |
| 4532 | *pRoamId = roamId; |
| 4533 | } |
| 4534 | status = csrRoamIssueRemoveKeyCommand( pMac, sessionId, pRemoveKey, roamId ); |
| 4535 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4536 | } |
| 4537 | |
| 4538 | return (status); |
| 4539 | } |
| 4540 | |
| 4541 | /* --------------------------------------------------------------------------- |
| 4542 | \fn sme_GetRssi |
| 4543 | \brief a wrapper function that client calls to register a callback to get RSSI |
| 4544 | |
| 4545 | \param callback - SME sends back the requested stats using the callback |
| 4546 | \param staId - The station ID for which the stats is requested for |
| 4547 | \param pContext - user context to be passed back along with the callback |
| 4548 | \param pVosContext - vos context |
| 4549 | \return eHalStatus |
| 4550 | ---------------------------------------------------------------------------*/ |
| 4551 | eHalStatus sme_GetRssi(tHalHandle hHal, |
| 4552 | tCsrRssiCallback callback, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4553 | tANI_U8 staId, tCsrBssid bssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4554 | void *pContext, void* pVosContext) |
| 4555 | { |
| 4556 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4557 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4558 | |
| 4559 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4560 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4561 | { |
| 4562 | status = csrGetRssi( pMac, callback, |
| 4563 | staId, bssId, pContext, pVosContext); |
| 4564 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4565 | } |
| 4566 | return (status); |
| 4567 | } |
Madan Mohan Koyyalamudi | d9383fd | 2013-08-13 09:27:30 +0530 | [diff] [blame] | 4568 | |
| 4569 | /* --------------------------------------------------------------------------- |
| 4570 | \fn sme_GetSnr |
| 4571 | \brief a wrapper function that client calls to register a callback to |
| 4572 | get SNR |
| 4573 | |
| 4574 | \param callback - SME sends back the requested stats using the callback |
| 4575 | \param staId - The station ID for which the stats is requested for |
| 4576 | \param pContext - user context to be passed back along with the callback |
| 4577 | \param pVosContext - vos context |
| 4578 | \return eHalStatus |
| 4579 | ---------------------------------------------------------------------------*/ |
| 4580 | eHalStatus sme_GetSnr(tHalHandle hHal, |
| 4581 | tCsrSnrCallback callback, |
| 4582 | tANI_U8 staId, tCsrBssid bssId, |
| 4583 | void *pContext) |
| 4584 | { |
| 4585 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4586 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4587 | |
| 4588 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4589 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4590 | { |
| 4591 | status = csrGetSnr(pMac, callback, |
| 4592 | staId, bssId, pContext); |
| 4593 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4594 | } |
| 4595 | return status; |
| 4596 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4597 | #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] | 4598 | /* --------------------------------------------------------------------------- |
| 4599 | \fn sme_GetRoamRssi |
| 4600 | \brief a wrapper function that client calls to register a callback to get Roam RSSI |
| 4601 | |
| 4602 | \param callback - SME sends back the requested stats using the callback |
| 4603 | \param staId - The station ID for which the stats is requested for |
| 4604 | \param pContext - user context to be passed back along with the callback |
| 4605 | \param pVosContext - vos context |
| 4606 | \return eHalStatus |
| 4607 | ---------------------------------------------------------------------------*/ |
| 4608 | eHalStatus sme_GetRoamRssi(tHalHandle hHal, |
| 4609 | tCsrRssiCallback callback, |
| 4610 | tANI_U8 staId, tCsrBssid bssId, |
| 4611 | void *pContext, void* pVosContext) |
| 4612 | { |
| 4613 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4614 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4615 | |
| 4616 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4617 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4618 | { |
| 4619 | status = csrGetRoamRssi( pMac, callback, |
| 4620 | staId, bssId, pContext, pVosContext); |
| 4621 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4622 | } |
| 4623 | return (status); |
| 4624 | } |
| 4625 | #endif |
| 4626 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4627 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4628 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4629 | /* --------------------------------------------------------------------------- |
| 4630 | \fn sme_GetTsmStats |
| 4631 | \brief a wrapper function that client calls to register a callback to get TSM Stats |
| 4632 | |
| 4633 | \param callback - SME sends back the requested stats using the callback |
| 4634 | \param staId - The station ID for which the stats is requested for |
| 4635 | \param pContext - user context to be passed back along with the callback |
| 4636 | \param pVosContext - vos context |
| 4637 | \return eHalStatus |
| 4638 | ---------------------------------------------------------------------------*/ |
| 4639 | eHalStatus sme_GetTsmStats(tHalHandle hHal, |
| 4640 | tCsrTsmStatsCallback callback, |
| 4641 | tANI_U8 staId, tCsrBssid bssId, |
| 4642 | void *pContext, void* pVosContext, tANI_U8 tid) |
| 4643 | { |
| 4644 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4645 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4646 | |
| 4647 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4648 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4649 | { |
| 4650 | status = csrGetTsmStats( pMac, callback, |
| 4651 | staId, bssId, pContext, pVosContext, tid); |
| 4652 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4653 | } |
| 4654 | return (status); |
| 4655 | } |
| 4656 | #endif |
| 4657 | |
| 4658 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4659 | /* --------------------------------------------------------------------------- |
| 4660 | \fn sme_GetStatistics |
| 4661 | \brief a wrapper function that client calls to register a callback to get |
| 4662 | different PHY level statistics from CSR. |
| 4663 | |
| 4664 | \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc |
| 4665 | \param statsMask - The different category/categories of stats requester is looking for |
| 4666 | \param callback - SME sends back the requested stats using the callback |
| 4667 | \param periodicity - If requester needs periodic update in millisec, 0 means |
| 4668 | it's an one time request |
| 4669 | \param cache - If requester is happy with cached stats |
| 4670 | \param staId - The station ID for which the stats is requested for |
| 4671 | \param pContext - user context to be passed back along with the callback |
| 4672 | \return eHalStatus |
| 4673 | ---------------------------------------------------------------------------*/ |
| 4674 | eHalStatus sme_GetStatistics(tHalHandle hHal, eCsrStatsRequesterType requesterId, |
| 4675 | tANI_U32 statsMask, |
| 4676 | tCsrStatsCallback callback, |
| 4677 | tANI_U32 periodicity, tANI_BOOLEAN cache, |
| 4678 | tANI_U8 staId, void *pContext) |
| 4679 | { |
| 4680 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4681 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4682 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4683 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4684 | TRACE_CODE_SME_RX_HDD_GET_STATS, NO_SESSION, periodicity)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4685 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4686 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4687 | { |
| 4688 | status = csrGetStatistics( pMac, requesterId , statsMask, callback, |
| 4689 | periodicity, cache, staId, pContext); |
| 4690 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4691 | } |
| 4692 | |
| 4693 | return (status); |
| 4694 | |
| 4695 | } |
| 4696 | |
| 4697 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 8af9b40 | 2013-07-11 14:59:10 +0530 | [diff] [blame] | 4698 | \fn smeGetTLSTAState |
| 4699 | \helper function to get the TL STA State whenever the function is called. |
| 4700 | |
| 4701 | \param staId - The staID to be passed to the TL |
| 4702 | to get the relevant TL STA State |
| 4703 | \return the state as tANI_U16 |
| 4704 | ---------------------------------------------------------------------------*/ |
| 4705 | tANI_U16 smeGetTLSTAState(tHalHandle hHal, tANI_U8 staId) |
| 4706 | { |
| 4707 | tANI_U16 tlSTAState = TL_INIT_STATE; |
| 4708 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4709 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4710 | |
| 4711 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4712 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4713 | { |
| 4714 | tlSTAState = csrGetTLSTAState( pMac, staId); |
| 4715 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4716 | } |
| 4717 | |
| 4718 | return tlSTAState; |
| 4719 | } |
| 4720 | |
| 4721 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4722 | |
| 4723 | \fn sme_GetCountryCode |
| 4724 | |
| 4725 | \brief To return the current country code. If no country code is applied, default country code is |
| 4726 | used to fill the buffer. |
| 4727 | If 11d supported is turned off, an error is return and the last applied/default country code is used. |
| 4728 | This is a synchronous API. |
| 4729 | |
| 4730 | \param pBuf - pointer to a caller allocated buffer for returned country code. |
| 4731 | |
| 4732 | \param pbLen For input, this parameter indicates how big is the buffer. |
| 4733 | Upon return, this parameter has the number of bytes for country. If pBuf |
| 4734 | doesn't have enough space, this function returns |
| 4735 | fail status and this parameter contains the number that is needed. |
| 4736 | |
| 4737 | \return eHalStatus SUCCESS. |
| 4738 | |
| 4739 | FAILURE or RESOURCES The API finished and failed. |
| 4740 | |
| 4741 | -------------------------------------------------------------------------------*/ |
| 4742 | eHalStatus sme_GetCountryCode(tHalHandle hHal, tANI_U8 *pBuf, tANI_U8 *pbLen) |
| 4743 | { |
| 4744 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4745 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4746 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4747 | TRACE_CODE_SME_RX_HDD_GET_CNTRYCODE, NO_SESSION, 0)); |
| 4748 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4749 | return ( csrGetCountryCode( pMac, pBuf, pbLen ) ); |
| 4750 | } |
| 4751 | |
| 4752 | |
| 4753 | /* --------------------------------------------------------------------------- |
| 4754 | |
| 4755 | \fn sme_SetCountryCode |
| 4756 | |
| 4757 | \brief To change the current/default country code. |
| 4758 | If 11d supported is turned off, an error is return. |
| 4759 | This is a synchronous API. |
| 4760 | |
| 4761 | \param pCountry - pointer to a caller allocated buffer for the country code. |
| 4762 | |
| 4763 | \param pfRestartNeeded A pointer to caller allocated memory, upon successful return, it indicates |
| 4764 | whether a reset is required. |
| 4765 | |
| 4766 | \return eHalStatus SUCCESS. |
| 4767 | |
| 4768 | FAILURE or RESOURCES The API finished and failed. |
| 4769 | |
| 4770 | -------------------------------------------------------------------------------*/ |
| 4771 | eHalStatus sme_SetCountryCode(tHalHandle hHal, tANI_U8 *pCountry, tANI_BOOLEAN *pfRestartNeeded) |
| 4772 | { |
| 4773 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4774 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4775 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4776 | TRACE_CODE_SME_RX_HDD_SET_CNTRYCODE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4777 | return ( csrSetCountryCode( pMac, pCountry, pfRestartNeeded ) ); |
| 4778 | } |
| 4779 | |
| 4780 | |
| 4781 | /* --------------------------------------------------------------------------- |
| 4782 | \fn sme_ResetCountryCodeInformation |
| 4783 | \brief this function is to reset the country code current being used back to EEPROM default |
| 4784 | this includes channel list and power setting. This is a synchronous API. |
| 4785 | \param pfRestartNeeded - pointer to a caller allocated space. Upon successful return, it indicates whether |
| 4786 | a restart is needed to apply the change |
| 4787 | \return eHalStatus |
| 4788 | -------------------------------------------------------------------------------*/ |
| 4789 | eHalStatus sme_ResetCountryCodeInformation(tHalHandle hHal, tANI_BOOLEAN *pfRestartNeeded) |
| 4790 | { |
| 4791 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4792 | |
| 4793 | return ( csrResetCountryCodeInformation( pMac, pfRestartNeeded ) ); |
| 4794 | } |
| 4795 | |
| 4796 | |
| 4797 | /* --------------------------------------------------------------------------- |
| 4798 | \fn sme_GetSupportedCountryCode |
| 4799 | \brief this function is to get a list of the country code current being supported |
| 4800 | \param pBuf - Caller allocated buffer with at least 3 bytes, upon success return, |
| 4801 | this has the country code list. 3 bytes for each country code. This may be NULL if |
| 4802 | caller wants to know the needed byte count. |
| 4803 | \param pbLen - Caller allocated, as input, it indicates the length of pBuf. Upon success return, |
| 4804 | this contains the length of the data in pBuf. If pbuf is NULL, as input, *pbLen should be 0. |
| 4805 | \return eHalStatus |
| 4806 | -------------------------------------------------------------------------------*/ |
| 4807 | eHalStatus sme_GetSupportedCountryCode(tHalHandle hHal, tANI_U8 *pBuf, tANI_U32 *pbLen) |
| 4808 | { |
| 4809 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4810 | |
| 4811 | return ( csrGetSupportedCountryCode( pMac, pBuf, pbLen ) ); |
| 4812 | } |
| 4813 | |
| 4814 | |
| 4815 | /* --------------------------------------------------------------------------- |
| 4816 | \fn sme_GetCurrentRegulatoryDomain |
| 4817 | \brief this function is to get the current regulatory domain. This is a synchronous API. |
| 4818 | This function must be called after CFG is downloaded and all the band/mode setting already passed into |
| 4819 | SME. The function fails if 11d support is turned off. |
| 4820 | \param pDomain - Caller allocated buffer to return the current domain. |
| 4821 | \return eHalStatus SUCCESS. |
| 4822 | |
| 4823 | FAILURE or RESOURCES The API finished and failed. |
| 4824 | -------------------------------------------------------------------------------*/ |
| 4825 | eHalStatus sme_GetCurrentRegulatoryDomain(tHalHandle hHal, v_REGDOMAIN_t *pDomain) |
| 4826 | { |
| 4827 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4828 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 4829 | |
| 4830 | if( pDomain ) |
| 4831 | { |
| 4832 | if( csrIs11dSupported( pMac ) ) |
| 4833 | { |
| 4834 | *pDomain = csrGetCurrentRegulatoryDomain( pMac ); |
| 4835 | status = eHAL_STATUS_SUCCESS; |
| 4836 | } |
| 4837 | else |
| 4838 | { |
| 4839 | status = eHAL_STATUS_FAILURE; |
| 4840 | } |
| 4841 | } |
| 4842 | |
| 4843 | return ( status ); |
| 4844 | } |
| 4845 | |
| 4846 | |
| 4847 | /* --------------------------------------------------------------------------- |
| 4848 | \fn sme_SetRegulatoryDomain |
| 4849 | \brief this function is to set the current regulatory domain. |
| 4850 | This function must be called after CFG is downloaded and all the band/mode setting already passed into |
| 4851 | SME. This is a synchronous API. |
| 4852 | \param domainId - indicate the domain (defined in the driver) needs to set to. |
| 4853 | See v_REGDOMAIN_t for definition |
| 4854 | \param pfRestartNeeded - pointer to a caller allocated space. Upon successful return, it indicates whether |
| 4855 | a restart is needed to apply the change |
| 4856 | \return eHalStatus |
| 4857 | -------------------------------------------------------------------------------*/ |
| 4858 | eHalStatus sme_SetRegulatoryDomain(tHalHandle hHal, v_REGDOMAIN_t domainId, tANI_BOOLEAN *pfRestartNeeded) |
| 4859 | { |
| 4860 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4861 | |
| 4862 | return ( csrSetRegulatoryDomain( pMac, domainId, pfRestartNeeded ) ); |
| 4863 | } |
| 4864 | |
| 4865 | |
| 4866 | /* --------------------------------------------------------------------------- |
| 4867 | |
| 4868 | \fn sme_GetRegulatoryDomainForCountry |
| 4869 | |
| 4870 | \brief To return a regulatory domain base on a country code. This is a synchronous API. |
| 4871 | |
| 4872 | \param pCountry - pointer to a caller allocated buffer for input country code. |
| 4873 | |
| 4874 | \param pDomainId Upon successful return, it is the domain that country belongs to. |
| 4875 | If it is NULL, returning success means that the country code is known. |
| 4876 | |
| 4877 | \return eHalStatus SUCCESS. |
| 4878 | |
| 4879 | FAILURE or RESOURCES The API finished and failed. |
| 4880 | |
| 4881 | -------------------------------------------------------------------------------*/ |
| 4882 | eHalStatus sme_GetRegulatoryDomainForCountry(tHalHandle hHal, tANI_U8 *pCountry, v_REGDOMAIN_t *pDomainId) |
| 4883 | { |
| 4884 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4885 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 4886 | return csrGetRegulatoryDomainForCountry(pMac, pCountry, pDomainId, |
| 4887 | COUNTRY_QUERY); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4888 | } |
| 4889 | |
| 4890 | |
| 4891 | |
| 4892 | |
| 4893 | /* --------------------------------------------------------------------------- |
| 4894 | |
| 4895 | \fn sme_GetSupportedRegulatoryDomains |
| 4896 | |
| 4897 | \brief To return a list of supported regulatory domains. This is a synchronous API. |
| 4898 | |
| 4899 | \param pDomains - pointer to a caller allocated buffer for returned regulatory domains. |
| 4900 | |
| 4901 | \param pNumDomains For input, this parameter indicates howm many domains pDomains can hold. |
| 4902 | Upon return, this parameter has the number for supported domains. If pDomains |
| 4903 | doesn't have enough space for all the supported domains, this function returns |
| 4904 | fail status and this parameter contains the number that is needed. |
| 4905 | |
| 4906 | \return eHalStatus SUCCESS. |
| 4907 | |
| 4908 | FAILURE or RESOURCES The API finished and failed. |
| 4909 | |
| 4910 | -------------------------------------------------------------------------------*/ |
| 4911 | eHalStatus sme_GetSupportedRegulatoryDomains(tHalHandle hHal, v_REGDOMAIN_t *pDomains, tANI_U32 *pNumDomains) |
| 4912 | { |
| 4913 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 4914 | |
| 4915 | //We support all domains for now |
| 4916 | if( pNumDomains ) |
| 4917 | { |
| 4918 | if( NUM_REG_DOMAINS <= *pNumDomains ) |
| 4919 | { |
| 4920 | status = eHAL_STATUS_SUCCESS; |
| 4921 | } |
| 4922 | *pNumDomains = NUM_REG_DOMAINS; |
| 4923 | } |
| 4924 | if( HAL_STATUS_SUCCESS( status ) ) |
| 4925 | { |
| 4926 | if( pDomains ) |
| 4927 | { |
| 4928 | pDomains[0] = REGDOMAIN_FCC; |
| 4929 | pDomains[1] = REGDOMAIN_ETSI; |
| 4930 | pDomains[2] = REGDOMAIN_JAPAN; |
| 4931 | pDomains[3] = REGDOMAIN_WORLD; |
| 4932 | pDomains[4] = REGDOMAIN_N_AMER_EXC_FCC; |
| 4933 | pDomains[5] = REGDOMAIN_APAC; |
| 4934 | pDomains[6] = REGDOMAIN_KOREA; |
| 4935 | pDomains[7] = REGDOMAIN_HI_5GHZ; |
| 4936 | pDomains[8] = REGDOMAIN_NO_5GHZ; |
| 4937 | } |
| 4938 | else |
| 4939 | { |
| 4940 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4941 | } |
| 4942 | } |
| 4943 | |
| 4944 | return ( status ); |
| 4945 | } |
| 4946 | |
| 4947 | |
| 4948 | //some support functions |
| 4949 | tANI_BOOLEAN sme_Is11dSupported(tHalHandle hHal) |
| 4950 | { |
| 4951 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4952 | |
| 4953 | return ( csrIs11dSupported( pMac ) ); |
| 4954 | } |
| 4955 | |
| 4956 | |
| 4957 | tANI_BOOLEAN sme_Is11hSupported(tHalHandle hHal) |
| 4958 | { |
| 4959 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4960 | |
| 4961 | return ( csrIs11hSupported( pMac ) ); |
| 4962 | } |
| 4963 | |
| 4964 | |
| 4965 | tANI_BOOLEAN sme_IsWmmSupported(tHalHandle hHal) |
| 4966 | { |
| 4967 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4968 | |
| 4969 | return ( csrIsWmmSupported( pMac ) ); |
| 4970 | } |
| 4971 | |
| 4972 | //Upper layer to get the list of the base channels to scan for passively 11d info from csr |
| 4973 | eHalStatus sme_ScanGetBaseChannels( tHalHandle hHal, tCsrChannelInfo * pChannelInfo ) |
| 4974 | { |
| 4975 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4976 | |
| 4977 | return(csrScanGetBaseChannels(pMac,pChannelInfo) ); |
| 4978 | } |
| 4979 | |
| 4980 | /* --------------------------------------------------------------------------- |
| 4981 | |
| 4982 | \fn sme_ChangeCountryCode |
| 4983 | |
| 4984 | \brief Change Country code from upperlayer during WLAN driver operation. |
| 4985 | This is a synchronous API. |
| 4986 | |
| 4987 | \param hHal - The handle returned by macOpen. |
| 4988 | |
| 4989 | \param pCountry New Country Code String |
| 4990 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 4991 | \param sendRegHint If we want to send reg hint to nl80211 |
| 4992 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4993 | \return eHalStatus SUCCESS. |
| 4994 | |
| 4995 | FAILURE or RESOURCES The API finished and failed. |
| 4996 | |
| 4997 | -------------------------------------------------------------------------------*/ |
| 4998 | eHalStatus sme_ChangeCountryCode( tHalHandle hHal, |
| 4999 | tSmeChangeCountryCallback callback, |
| 5000 | tANI_U8 *pCountry, |
| 5001 | void *pContext, |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 5002 | void* pVosContext, |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 5003 | tAniBool countryFromUserSpace, |
| 5004 | tAniBool sendRegHint ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5005 | { |
| 5006 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5007 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5008 | vos_msg_t msg; |
| 5009 | tAniChangeCountryCodeReq *pMsg; |
| 5010 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5011 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5012 | TRACE_CODE_SME_RX_HDD_CHANGE_CNTRYCODE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5013 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5014 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5015 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5016 | smsLog(pMac, LOG1, FL(" called")); |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 5017 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 5018 | if ((pMac->roam.configParam.Is11dSupportEnabledOriginal == true) && |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 5019 | (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority)) |
| 5020 | { |
| 5021 | |
| 5022 | smsLog(pMac, LOGW, "Set Country Code Fail since the STA is associated and userspace does not have priority "); |
| 5023 | |
| 5024 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5025 | status = eHAL_STATUS_FAILURE; |
| 5026 | return status; |
| 5027 | } |
| 5028 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5029 | pMsg = vos_mem_malloc(sizeof(tAniChangeCountryCodeReq)); |
| 5030 | if ( NULL == pMsg ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5031 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5032 | 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] | 5033 | sme_ReleaseGlobalLock( &pMac->sme ); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5034 | return eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5035 | } |
| 5036 | |
| 5037 | pMsg->msgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_CHANGE_COUNTRY_CODE); |
| 5038 | pMsg->msgLen = (tANI_U16)sizeof(tAniChangeCountryCodeReq); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5039 | vos_mem_copy(pMsg->countryCode, pCountry, 3); |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 5040 | pMsg->countryFromUserSpace = countryFromUserSpace; |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 5041 | pMsg->sendRegHint = sendRegHint; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5042 | pMsg->changeCCCallback = callback; |
| 5043 | pMsg->pDevContext = pContext; |
| 5044 | pMsg->pVosContext = pVosContext; |
| 5045 | |
| 5046 | msg.type = eWNI_SME_CHANGE_COUNTRY_CODE; |
| 5047 | msg.bodyptr = pMsg; |
| 5048 | msg.reserved = 0; |
| 5049 | |
| 5050 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg)) |
| 5051 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5052 | smsLog(pMac, LOGE, " sme_ChangeCountryCode failed to post msg to self "); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5053 | vos_mem_free((void *)pMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5054 | status = eHAL_STATUS_FAILURE; |
| 5055 | } |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5056 | smsLog(pMac, LOG1, FL(" returned")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5057 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5058 | } |
| 5059 | |
| 5060 | return (status); |
| 5061 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5062 | |
| 5063 | /*-------------------------------------------------------------------------- |
| 5064 | |
| 5065 | \fn sme_GenericChangeCountryCode |
| 5066 | |
| 5067 | \brief Change Country code from upperlayer during WLAN driver operation. |
| 5068 | This is a synchronous API. |
| 5069 | |
| 5070 | \param hHal - The handle returned by macOpen. |
| 5071 | |
| 5072 | \param pCountry New Country Code String |
| 5073 | |
| 5074 | \param reg_domain regulatory domain |
| 5075 | |
| 5076 | \return eHalStatus SUCCESS. |
| 5077 | |
| 5078 | FAILURE or RESOURCES The API finished and failed. |
| 5079 | |
| 5080 | -----------------------------------------------------------------------------*/ |
| 5081 | eHalStatus sme_GenericChangeCountryCode( tHalHandle hHal, |
| 5082 | tANI_U8 *pCountry, |
| 5083 | v_REGDOMAIN_t reg_domain) |
| 5084 | { |
| 5085 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5086 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5087 | vos_msg_t msg; |
| 5088 | tAniGenericChangeCountryCodeReq *pMsg; |
| 5089 | |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 5090 | if (NULL == pMac) |
| 5091 | { |
| 5092 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 5093 | "%s: pMac is null", __func__); |
| 5094 | return status; |
| 5095 | } |
| 5096 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5097 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5098 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5099 | { |
| 5100 | smsLog(pMac, LOG1, FL(" called")); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 5101 | pMsg = vos_mem_malloc(sizeof(tAniGenericChangeCountryCodeReq)); |
| 5102 | if (NULL == pMsg) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5103 | { |
| 5104 | smsLog(pMac, LOGE, " sme_GenericChangeCountryCode: failed to allocate mem for req"); |
| 5105 | sme_ReleaseGlobalLock( &pMac->sme ); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 5106 | return eHAL_STATUS_FAILURE; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5107 | } |
| 5108 | |
| 5109 | pMsg->msgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE); |
| 5110 | pMsg->msgLen = (tANI_U16)sizeof(tAniGenericChangeCountryCodeReq); |
Sameer Thalappil | 7324e8b | 2014-01-15 10:32:54 -0800 | [diff] [blame] | 5111 | vos_mem_copy(pMsg->countryCode, pCountry, 2); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5112 | pMsg->domain_index = reg_domain; |
| 5113 | |
| 5114 | msg.type = eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE; |
| 5115 | msg.bodyptr = pMsg; |
| 5116 | msg.reserved = 0; |
| 5117 | |
| 5118 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg)) |
| 5119 | { |
| 5120 | smsLog(pMac, LOGE, "sme_GenericChangeCountryCode failed to post msg to self"); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 5121 | vos_mem_free(pMsg); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5122 | status = eHAL_STATUS_FAILURE; |
| 5123 | } |
| 5124 | smsLog(pMac, LOG1, FL(" returned")); |
| 5125 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5126 | } |
| 5127 | |
| 5128 | return (status); |
| 5129 | } |
Mihir Shete | e1093ba | 2014-01-21 20:13:32 +0530 | [diff] [blame] | 5130 | |
| 5131 | /* --------------------------------------------------------------------------- |
| 5132 | |
| 5133 | \fn sme_InitChannels |
| 5134 | |
| 5135 | \brief Used to initialize CSR channel lists while driver loading |
| 5136 | |
| 5137 | \param hHal - global pMac structure |
| 5138 | |
| 5139 | \return eHalStatus SUCCESS. |
| 5140 | |
| 5141 | FAILURE or RESOURCES The API finished and failed. |
| 5142 | |
| 5143 | -------------------------------------------------------------------------------*/ |
| 5144 | eHalStatus sme_InitChannels(tHalHandle hHal) |
| 5145 | { |
| 5146 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5147 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 5148 | |
| 5149 | if (NULL == pMac) |
| 5150 | { |
| 5151 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 5152 | "%s: pMac is null", __func__); |
| 5153 | return status; |
| 5154 | } |
| 5155 | |
Vinay Krishna Eranna | b9295ae | 2014-05-09 13:43:23 +0530 | [diff] [blame] | 5156 | status = csrInitChannels(pMac); |
| 5157 | |
Mihir Shete | e1093ba | 2014-01-21 20:13:32 +0530 | [diff] [blame] | 5158 | return status; |
| 5159 | } |
| 5160 | |
Mahesh A Saptasagar | 74289d2 | 2014-05-14 12:43:37 +0530 | [diff] [blame] | 5161 | /*------------------------------------------------------------------------- |
| 5162 | \fn sme_InitChannelsForCC |
| 5163 | |
| 5164 | \brief Used to issue regulatory hint to user |
| 5165 | |
| 5166 | \param hHal - global pMac structure |
| 5167 | |
| 5168 | \return eHalStatus SUCCESS. |
| 5169 | |
| 5170 | FAILURE or RESOURCES The API finished and failed. |
| 5171 | --------------------------------------------------------------------------*/ |
| 5172 | |
| 5173 | eHalStatus sme_InitChannelsForCC(tHalHandle hHal) |
| 5174 | { |
| 5175 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5176 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 5177 | |
| 5178 | if (NULL == pMac) |
| 5179 | { |
| 5180 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 5181 | "%s: pMac is null", __func__); |
| 5182 | return status; |
| 5183 | } |
| 5184 | status = csrInitChannelsForCC(pMac); |
| 5185 | |
| 5186 | return status; |
| 5187 | } |
| 5188 | |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5189 | /* --------------------------------------------------------------------------- |
| 5190 | |
| 5191 | \fn sme_DHCPStartInd |
| 5192 | |
| 5193 | \brief API to signal the FW about the DHCP Start event. |
| 5194 | |
| 5195 | \param hHal - HAL handle for device. |
| 5196 | |
| 5197 | \param device_mode - mode(AP,SAP etc) of the device. |
| 5198 | |
| 5199 | \param macAddr - MAC address of the device. |
| 5200 | |
| 5201 | \return eHalStatus SUCCESS. |
| 5202 | |
| 5203 | FAILURE or RESOURCES The API finished and failed. |
| 5204 | --------------------------------------------------------------------------*/ |
| 5205 | eHalStatus sme_DHCPStartInd( tHalHandle hHal, |
| 5206 | tANI_U8 device_mode, |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5207 | tANI_U8 sessionId ) |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5208 | { |
| 5209 | eHalStatus status; |
| 5210 | VOS_STATUS vosStatus; |
| 5211 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5212 | vos_msg_t vosMessage; |
| 5213 | tAniDHCPInd *pMsg; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5214 | tCsrRoamSession *pSession; |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5215 | |
| 5216 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 5217 | if ( eHAL_STATUS_SUCCESS == status) |
| 5218 | { |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5219 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 5220 | |
| 5221 | if (!pSession) |
| 5222 | { |
| 5223 | smsLog(pMac, LOGE, FL("session %d not found "), sessionId); |
| 5224 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5225 | return eHAL_STATUS_FAILURE; |
| 5226 | } |
| 5227 | |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5228 | pMsg = (tAniDHCPInd*)vos_mem_malloc(sizeof(tAniDHCPInd)); |
| 5229 | if (NULL == pMsg) |
| 5230 | { |
| 5231 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5232 | "%s: Not able to allocate memory for dhcp start", __func__); |
| 5233 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5234 | return eHAL_STATUS_FAILURE; |
| 5235 | } |
| 5236 | pMsg->msgType = WDA_DHCP_START_IND; |
| 5237 | pMsg->msgLen = (tANI_U16)sizeof(tAniDHCPInd); |
| 5238 | pMsg->device_mode = device_mode; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5239 | vos_mem_copy(pMsg->macAddr, pSession->connectedProfile.bssid, |
| 5240 | sizeof(tSirMacAddr)); |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5241 | vosMessage.type = WDA_DHCP_START_IND; |
| 5242 | vosMessage.bodyptr = pMsg; |
| 5243 | vosMessage.reserved = 0; |
| 5244 | |
| 5245 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 5246 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 5247 | { |
| 5248 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5249 | "%s: Post DHCP Start MSG fail", __func__); |
| 5250 | vos_mem_free(pMsg); |
| 5251 | status = eHAL_STATUS_FAILURE; |
| 5252 | } |
| 5253 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5254 | } |
| 5255 | return (status); |
| 5256 | } |
| 5257 | /* --------------------------------------------------------------------------- |
| 5258 | \fn sme_DHCPStopInd |
| 5259 | |
| 5260 | \brief API to signal the FW about the DHCP complete event. |
| 5261 | |
| 5262 | \param hHal - HAL handle for device. |
| 5263 | |
| 5264 | \param device_mode - mode(AP, SAP etc) of the device. |
| 5265 | |
| 5266 | \param macAddr - MAC address of the device. |
| 5267 | |
| 5268 | \return eHalStatus SUCCESS. |
| 5269 | FAILURE or RESOURCES The API finished and failed. |
| 5270 | --------------------------------------------------------------------------*/ |
| 5271 | eHalStatus sme_DHCPStopInd( tHalHandle hHal, |
| 5272 | tANI_U8 device_mode, |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5273 | tANI_U8 sessionId ) |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5274 | { |
| 5275 | eHalStatus status; |
| 5276 | VOS_STATUS vosStatus; |
| 5277 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5278 | vos_msg_t vosMessage; |
| 5279 | tAniDHCPInd *pMsg; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5280 | tCsrRoamSession *pSession; |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5281 | |
| 5282 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 5283 | if ( eHAL_STATUS_SUCCESS == status) |
| 5284 | { |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5285 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 5286 | |
| 5287 | if (!pSession) |
| 5288 | { |
| 5289 | smsLog(pMac, LOGE, FL("session %d not found "), sessionId); |
| 5290 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5291 | return eHAL_STATUS_FAILURE; |
| 5292 | } |
| 5293 | |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5294 | pMsg = (tAniDHCPInd*)vos_mem_malloc(sizeof(tAniDHCPInd)); |
| 5295 | if (NULL == pMsg) |
| 5296 | { |
| 5297 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5298 | "%s: Not able to allocate memory for dhcp stop", __func__); |
| 5299 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5300 | return eHAL_STATUS_FAILURE; |
| 5301 | } |
| 5302 | |
| 5303 | pMsg->msgType = WDA_DHCP_STOP_IND; |
| 5304 | pMsg->msgLen = (tANI_U16)sizeof(tAniDHCPInd); |
| 5305 | pMsg->device_mode = device_mode; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5306 | vos_mem_copy(pMsg->macAddr, pSession->connectedProfile.bssid, |
| 5307 | sizeof(tSirMacAddr)); |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5308 | |
| 5309 | vosMessage.type = WDA_DHCP_STOP_IND; |
| 5310 | vosMessage.bodyptr = pMsg; |
| 5311 | vosMessage.reserved = 0; |
| 5312 | |
| 5313 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 5314 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 5315 | { |
| 5316 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5317 | "%s: Post DHCP Stop MSG fail", __func__); |
| 5318 | vos_mem_free(pMsg); |
| 5319 | status = eHAL_STATUS_FAILURE; |
| 5320 | } |
| 5321 | |
| 5322 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5323 | } |
| 5324 | return (status); |
| 5325 | } |
| 5326 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5327 | |
| 5328 | /* --------------------------------------------------------------------------- |
| 5329 | \fn sme_BtcSignalBtEvent |
| 5330 | \brief API to signal Bluetooth (BT) event to the WLAN driver. Based on the |
| 5331 | BT event type and the current operating mode of Libra (full power, |
| 5332 | BMPS, UAPSD etc), appropriate Bluetooth Coexistence (BTC) strategy |
| 5333 | would be employed. |
| 5334 | \param hHal - The handle returned by macOpen. |
| 5335 | \param pBtEvent - Pointer to a caller allocated object of type tSmeBtEvent |
| 5336 | Caller owns the memory and is responsible for freeing it. |
| 5337 | \return VOS_STATUS |
| 5338 | VOS_STATUS_E_FAILURE BT Event not passed to HAL. This can happen |
| 5339 | if BTC execution mode is set to BTC_WLAN_ONLY |
| 5340 | or BTC_PTA_ONLY. |
| 5341 | VOS_STATUS_SUCCESS BT Event passed to HAL |
| 5342 | ---------------------------------------------------------------------------*/ |
| 5343 | VOS_STATUS sme_BtcSignalBtEvent (tHalHandle hHal, tpSmeBtEvent pBtEvent) |
| 5344 | { |
| 5345 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5346 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5347 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 5348 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5349 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5350 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5351 | TRACE_CODE_SME_RX_HDD_BTC_SIGNALEVENT, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5352 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5353 | { |
| 5354 | status = btcSignalBTEvent (hHal, pBtEvent); |
| 5355 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5356 | } |
| 5357 | #endif |
| 5358 | return (status); |
| 5359 | } |
| 5360 | |
| 5361 | /* --------------------------------------------------------------------------- |
| 5362 | \fn sme_BtcSetConfig |
| 5363 | \brief API to change the current Bluetooth Coexistence (BTC) configuration |
| 5364 | This function should be invoked only after CFG download has completed. |
| 5365 | Calling it after sme_HDDReadyInd is recommended. |
| 5366 | \param hHal - The handle returned by macOpen. |
| 5367 | \param pSmeBtcConfig - Pointer to a caller allocated object of type tSmeBtcConfig. |
| 5368 | Caller owns the memory and is responsible for freeing it. |
| 5369 | \return VOS_STATUS |
| 5370 | VOS_STATUS_E_FAILURE Config not passed to HAL. |
| 5371 | VOS_STATUS_SUCCESS Config passed to HAL |
| 5372 | ---------------------------------------------------------------------------*/ |
| 5373 | VOS_STATUS sme_BtcSetConfig (tHalHandle hHal, tpSmeBtcConfig pSmeBtcConfig) |
| 5374 | { |
| 5375 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5376 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 5377 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5378 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5379 | TRACE_CODE_SME_RX_HDD_BTC_SETCONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5380 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5381 | { |
| 5382 | status = btcSetConfig (hHal, pSmeBtcConfig); |
| 5383 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5384 | } |
| 5385 | #endif |
| 5386 | return (status); |
| 5387 | } |
| 5388 | |
| 5389 | /* --------------------------------------------------------------------------- |
| 5390 | \fn sme_BtcGetConfig |
| 5391 | \brief API to retrieve the current Bluetooth Coexistence (BTC) configuration |
| 5392 | \param hHal - The handle returned by macOpen. |
| 5393 | \param pSmeBtcConfig - Pointer to a caller allocated object of type |
| 5394 | tSmeBtcConfig. Caller owns the memory and is responsible |
| 5395 | for freeing it. |
| 5396 | \return VOS_STATUS |
| 5397 | VOS_STATUS_E_FAILURE - failure |
| 5398 | VOS_STATUS_SUCCESS success |
| 5399 | ---------------------------------------------------------------------------*/ |
| 5400 | VOS_STATUS sme_BtcGetConfig (tHalHandle hHal, tpSmeBtcConfig pSmeBtcConfig) |
| 5401 | { |
| 5402 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5403 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 5404 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5405 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5406 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5407 | TRACE_CODE_SME_RX_HDD_BTC_GETCONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5408 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5409 | { |
| 5410 | status = btcGetConfig (hHal, pSmeBtcConfig); |
| 5411 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5412 | } |
| 5413 | #endif |
| 5414 | return (status); |
| 5415 | } |
| 5416 | /* --------------------------------------------------------------------------- |
| 5417 | \fn sme_SetCfgPrivacy |
| 5418 | \brief API to set configure privacy parameters |
| 5419 | \param hHal - The handle returned by macOpen. |
| 5420 | \param pProfile - Pointer CSR Roam profile. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5421 | \param fPrivacy - This parameter indicates status of privacy |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5422 | |
| 5423 | \return void |
| 5424 | ---------------------------------------------------------------------------*/ |
| 5425 | void sme_SetCfgPrivacy( tHalHandle hHal, |
| 5426 | tCsrRoamProfile *pProfile, |
| 5427 | tANI_BOOLEAN fPrivacy |
| 5428 | ) |
| 5429 | { |
| 5430 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5431 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5432 | TRACE_CODE_SME_RX_HDD_SET_CFGPRIVACY, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5433 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5434 | { |
| 5435 | csrSetCfgPrivacy(pMac, pProfile, fPrivacy); |
| 5436 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5437 | } |
| 5438 | } |
| 5439 | |
| 5440 | #if defined WLAN_FEATURE_VOWIFI |
| 5441 | /* --------------------------------------------------------------------------- |
| 5442 | \fn sme_NeighborReportRequest |
| 5443 | \brief API to request neighbor report. |
| 5444 | \param hHal - The handle returned by macOpen. |
| 5445 | \param pRrmNeighborReq - Pointer to a caller allocated object of type |
| 5446 | tRrmNeighborReq. Caller owns the memory and is responsible |
| 5447 | for freeing it. |
| 5448 | \return VOS_STATUS |
| 5449 | VOS_STATUS_E_FAILURE - failure |
| 5450 | VOS_STATUS_SUCCESS success |
| 5451 | ---------------------------------------------------------------------------*/ |
| 5452 | VOS_STATUS sme_NeighborReportRequest (tHalHandle hHal, tANI_U8 sessionId, |
| 5453 | tpRrmNeighborReq pRrmNeighborReq, tpRrmNeighborRspCallbackInfo callbackInfo) |
| 5454 | { |
| 5455 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5456 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5457 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5458 | TRACE_CODE_SME_RX_HDD_NEIGHBOR_REPORTREQ, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5459 | |
| 5460 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5461 | { |
| 5462 | status = sme_RrmNeighborReportRequest (hHal, sessionId, pRrmNeighborReq, callbackInfo); |
| 5463 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5464 | } |
| 5465 | |
| 5466 | return (status); |
| 5467 | } |
| 5468 | #endif |
| 5469 | |
| 5470 | //The following are debug APIs to support direct read/write register/memory |
| 5471 | //They are placed in SME because HW cannot be access when in LOW_POWER state |
| 5472 | //AND not connected. The knowledge and synchronization is done in SME |
| 5473 | |
| 5474 | //sme_DbgReadRegister |
| 5475 | //Caller needs to validate the input values |
| 5476 | VOS_STATUS sme_DbgReadRegister(tHalHandle hHal, v_U32_t regAddr, v_U32_t *pRegValue) |
| 5477 | { |
| 5478 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5479 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5480 | tPmcPowerState PowerState; |
| 5481 | tANI_U32 sessionId = 0; |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5482 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5483 | TRACE_CODE_SME_RX_HDD_DBG_READREG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5484 | |
| 5485 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5486 | |
| 5487 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5488 | { |
Hoonki Lee | 0af6aaf | 2013-02-08 12:26:44 -0800 | [diff] [blame] | 5489 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgReadRegister(regAddr, pRegValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5490 | { |
| 5491 | return VOS_STATUS_SUCCESS; |
| 5492 | } |
| 5493 | return VOS_STATUS_E_FAILURE; |
| 5494 | } |
| 5495 | |
| 5496 | /* 2) NON FTM mode driver *************************************************/ |
| 5497 | |
| 5498 | /* Acquire SME global lock */ |
| 5499 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5500 | { |
| 5501 | return VOS_STATUS_E_FAILURE; |
| 5502 | } |
| 5503 | |
| 5504 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5505 | { |
| 5506 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5507 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5508 | { |
Hoonki Lee | 0af6aaf | 2013-02-08 12:26:44 -0800 | [diff] [blame] | 5509 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgReadRegister(regAddr, pRegValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5510 | { |
| 5511 | status = VOS_STATUS_SUCCESS; |
| 5512 | } |
| 5513 | else |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5514 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5515 | status = VOS_STATUS_E_FAILURE; |
| 5516 | } |
| 5517 | } |
| 5518 | else |
| 5519 | { |
| 5520 | status = VOS_STATUS_E_FAILURE; |
| 5521 | } |
| 5522 | } |
| 5523 | |
| 5524 | /* This is a hack for Qualky/pttWniSocket |
| 5525 | Current implementation doesn't allow pttWniSocket to inform Qualky an error */ |
| 5526 | if ( VOS_STATUS_SUCCESS != status ) |
| 5527 | { |
| 5528 | *pRegValue = 0xDEADBEEF; |
| 5529 | status = VOS_STATUS_SUCCESS; |
| 5530 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5531 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5532 | /* Release SME global lock */ |
| 5533 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5534 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5535 | return (status); |
| 5536 | } |
| 5537 | |
| 5538 | |
| 5539 | //sme_DbgWriteRegister |
| 5540 | //Caller needs to validate the input values |
| 5541 | VOS_STATUS sme_DbgWriteRegister(tHalHandle hHal, v_U32_t regAddr, v_U32_t regValue) |
| 5542 | { |
| 5543 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5544 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5545 | tPmcPowerState PowerState; |
| 5546 | tANI_U32 sessionId = 0; |
| 5547 | |
| 5548 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5549 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5550 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5551 | TRACE_CODE_SME_RX_HDD_DBG_WRITEREG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5552 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5553 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5554 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteRegister(regAddr, regValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5555 | { |
| 5556 | return VOS_STATUS_SUCCESS; |
| 5557 | } |
| 5558 | return VOS_STATUS_E_FAILURE; |
| 5559 | } |
| 5560 | |
| 5561 | /* 2) NON FTM mode driver *************************************************/ |
| 5562 | |
| 5563 | /* Acquire SME global lock */ |
| 5564 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5565 | { |
| 5566 | return VOS_STATUS_E_FAILURE; |
| 5567 | } |
| 5568 | |
| 5569 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5570 | { |
| 5571 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5572 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5573 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5574 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteRegister(regAddr, regValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5575 | { |
| 5576 | status = VOS_STATUS_SUCCESS; |
| 5577 | } |
| 5578 | else |
| 5579 | { |
| 5580 | status = VOS_STATUS_E_FAILURE; |
| 5581 | } |
| 5582 | } |
| 5583 | else |
| 5584 | { |
| 5585 | status = VOS_STATUS_E_FAILURE; |
| 5586 | } |
| 5587 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5588 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5589 | /* Release SME global lock */ |
| 5590 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5591 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5592 | return (status); |
| 5593 | } |
| 5594 | |
| 5595 | |
| 5596 | |
| 5597 | //sme_DbgReadMemory |
| 5598 | //Caller needs to validate the input values |
| 5599 | //pBuf caller allocated buffer has the length of nLen |
| 5600 | VOS_STATUS sme_DbgReadMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U32_t nLen) |
| 5601 | { |
| 5602 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5603 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5604 | tPmcPowerState PowerState; |
| 5605 | tANI_U32 sessionId = 0; |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 5606 | tANI_U32 cmd = READ_MEMORY_DUMP_CMD; |
| 5607 | tANI_U32 arg1 = memAddr; |
| 5608 | tANI_U32 arg2 = nLen/4; |
| 5609 | tANI_U32 arg3 = 4; |
| 5610 | tANI_U32 arg4 = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5611 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5612 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5613 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5614 | TRACE_CODE_SME_RX_HDD_DBG_READMEM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5615 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5616 | { |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 5617 | if (VOS_STATUS_SUCCESS == WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, (tANI_U8*)pBuf)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5618 | { |
| 5619 | return VOS_STATUS_SUCCESS; |
| 5620 | } |
| 5621 | return VOS_STATUS_E_FAILURE; |
| 5622 | } |
| 5623 | |
| 5624 | /* 2) NON FTM mode driver *************************************************/ |
| 5625 | |
| 5626 | /* Acquire SME global lock */ |
| 5627 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5628 | { |
| 5629 | return VOS_STATUS_E_FAILURE; |
| 5630 | } |
| 5631 | |
| 5632 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5633 | { |
| 5634 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5635 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5636 | { |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 5637 | if (VOS_STATUS_SUCCESS == WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, (tANI_U8 *)pBuf)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5638 | { |
| 5639 | status = VOS_STATUS_SUCCESS; |
| 5640 | } |
| 5641 | else |
| 5642 | { |
| 5643 | status = VOS_STATUS_E_FAILURE; |
| 5644 | } |
| 5645 | } |
| 5646 | else |
| 5647 | { |
| 5648 | status = VOS_STATUS_E_FAILURE; |
| 5649 | } |
| 5650 | } |
| 5651 | |
| 5652 | /* This is a hack for Qualky/pttWniSocket |
| 5653 | Current implementation doesn't allow pttWniSocket to inform Qualky an error */ |
| 5654 | if (VOS_STATUS_SUCCESS != status) |
| 5655 | { |
| 5656 | vos_mem_set(pBuf, nLen, 0xCD); |
| 5657 | status = VOS_STATUS_SUCCESS; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5658 | 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] | 5659 | } |
| 5660 | |
| 5661 | /* Release SME lock */ |
| 5662 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5663 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5664 | return (status); |
| 5665 | } |
| 5666 | |
| 5667 | |
| 5668 | //sme_DbgWriteMemory |
| 5669 | //Caller needs to validate the input values |
| 5670 | VOS_STATUS sme_DbgWriteMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U32_t nLen) |
| 5671 | { |
| 5672 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5673 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5674 | tPmcPowerState PowerState; |
| 5675 | tANI_U32 sessionId = 0; |
| 5676 | |
| 5677 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5678 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5679 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5680 | TRACE_CODE_SME_RX_HDD_DBG_WRITEMEM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5681 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5682 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5683 | { |
| 5684 | return VOS_STATUS_SUCCESS; |
| 5685 | } |
| 5686 | return VOS_STATUS_E_FAILURE; |
| 5687 | } |
| 5688 | |
| 5689 | /* 2) NON FTM mode driver *************************************************/ |
| 5690 | |
| 5691 | /* Acquire SME global lock */ |
| 5692 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5693 | { |
| 5694 | return VOS_STATUS_E_FAILURE; |
| 5695 | } |
| 5696 | |
| 5697 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5698 | { |
| 5699 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5700 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5701 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5702 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteMemory(memAddr, (void *)pBuf, nLen)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5703 | { |
| 5704 | status = VOS_STATUS_SUCCESS; |
| 5705 | } |
| 5706 | else |
| 5707 | { |
| 5708 | status = VOS_STATUS_E_FAILURE; |
| 5709 | } |
| 5710 | } |
| 5711 | else |
| 5712 | { |
| 5713 | status = VOS_STATUS_E_FAILURE; |
| 5714 | } |
| 5715 | } |
| 5716 | |
| 5717 | /* Release Global lock */ |
| 5718 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5719 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5720 | return (status); |
| 5721 | } |
| 5722 | |
| 5723 | |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 5724 | void pmcLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString, ...) |
| 5725 | { |
| 5726 | VOS_TRACE_LEVEL vosDebugLevel; |
| 5727 | char logBuffer[LOG_SIZE]; |
| 5728 | va_list marker; |
| 5729 | |
| 5730 | /* getting proper Debug level */ |
| 5731 | vosDebugLevel = getVosDebugLevel(loglevel); |
| 5732 | |
| 5733 | /* extracting arguments from pstring */ |
| 5734 | va_start( marker, pString ); |
| 5735 | vsnprintf(logBuffer, LOG_SIZE, pString, marker); |
| 5736 | |
| 5737 | VOS_TRACE(VOS_MODULE_ID_PMC, vosDebugLevel, "%s", logBuffer); |
| 5738 | va_end( marker ); |
| 5739 | } |
| 5740 | |
| 5741 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5742 | void smsLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString,...) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5743 | { |
| 5744 | #ifdef WLAN_DEBUG |
| 5745 | // Verify against current log level |
| 5746 | if ( loglevel > pMac->utils.gLogDbgLevel[LOG_INDEX_FOR_MODULE( SIR_SMS_MODULE_ID )] ) |
| 5747 | return; |
| 5748 | else |
| 5749 | { |
| 5750 | va_list marker; |
| 5751 | |
| 5752 | va_start( marker, pString ); /* Initialize variable arguments. */ |
| 5753 | |
| 5754 | logDebug(pMac, SIR_SMS_MODULE_ID, loglevel, pString, marker); |
| 5755 | |
| 5756 | va_end( marker ); /* Reset variable arguments. */ |
| 5757 | } |
| 5758 | #endif |
| 5759 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5760 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5761 | /* --------------------------------------------------------------------------- |
| 5762 | \fn sme_GetWcnssWlanCompiledVersion |
| 5763 | \brief This API returns the version of the WCNSS WLAN API with |
| 5764 | which the HOST driver was built |
| 5765 | \param hHal - The handle returned by macOpen. |
| 5766 | \param pVersion - Points to the Version structure to be filled |
| 5767 | \return VOS_STATUS |
| 5768 | VOS_STATUS_E_INVAL - failure |
| 5769 | VOS_STATUS_SUCCESS success |
| 5770 | ---------------------------------------------------------------------------*/ |
| 5771 | VOS_STATUS sme_GetWcnssWlanCompiledVersion(tHalHandle hHal, |
| 5772 | tSirVersionType *pVersion) |
| 5773 | { |
| 5774 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 5775 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5776 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 5777 | |
| 5778 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5779 | { |
| 5780 | if( pVersion != NULL ) |
| 5781 | { |
| 5782 | status = WDA_GetWcnssWlanCompiledVersion(vosContext, pVersion); |
| 5783 | } |
| 5784 | else |
| 5785 | { |
| 5786 | status = VOS_STATUS_E_INVAL; |
| 5787 | } |
| 5788 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5789 | } |
| 5790 | |
| 5791 | return (status); |
| 5792 | } |
| 5793 | |
| 5794 | |
| 5795 | /* --------------------------------------------------------------------------- |
| 5796 | \fn sme_GetWcnssWlanReportedVersion |
| 5797 | \brief This API returns the version of the WCNSS WLAN API with |
| 5798 | which the WCNSS driver reports it was built |
| 5799 | \param hHal - The handle returned by macOpen. |
| 5800 | \param pVersion - Points to the Version structure to be filled |
| 5801 | \return VOS_STATUS |
| 5802 | VOS_STATUS_E_INVAL - failure |
| 5803 | VOS_STATUS_SUCCESS success |
| 5804 | ---------------------------------------------------------------------------*/ |
| 5805 | VOS_STATUS sme_GetWcnssWlanReportedVersion(tHalHandle hHal, |
| 5806 | tSirVersionType *pVersion) |
| 5807 | { |
| 5808 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 5809 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5810 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 5811 | |
| 5812 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5813 | { |
| 5814 | if( pVersion != NULL ) |
| 5815 | { |
| 5816 | status = WDA_GetWcnssWlanReportedVersion(vosContext, pVersion); |
| 5817 | } |
| 5818 | else |
| 5819 | { |
| 5820 | status = VOS_STATUS_E_INVAL; |
| 5821 | } |
| 5822 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5823 | } |
| 5824 | |
| 5825 | return (status); |
| 5826 | } |
| 5827 | |
| 5828 | |
| 5829 | /* --------------------------------------------------------------------------- |
| 5830 | \fn sme_GetWcnssSoftwareVersion |
| 5831 | \brief This API returns the version string of the WCNSS driver |
| 5832 | \param hHal - The handle returned by macOpen. |
| 5833 | \param pVersion - Points to the Version string buffer to be filled |
| 5834 | \param versionBufferSize - THe size of the Version string buffer |
| 5835 | \return VOS_STATUS |
| 5836 | VOS_STATUS_E_INVAL - failure |
| 5837 | VOS_STATUS_SUCCESS success |
| 5838 | ---------------------------------------------------------------------------*/ |
| 5839 | VOS_STATUS sme_GetWcnssSoftwareVersion(tHalHandle hHal, |
| 5840 | tANI_U8 *pVersion, |
| 5841 | tANI_U32 versionBufferSize) |
| 5842 | { |
| 5843 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 5844 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5845 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 5846 | |
| 5847 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5848 | { |
| 5849 | if( pVersion != NULL ) |
| 5850 | { |
| 5851 | status = WDA_GetWcnssSoftwareVersion(vosContext, pVersion, |
| 5852 | versionBufferSize); |
| 5853 | } |
| 5854 | else |
| 5855 | { |
| 5856 | status = VOS_STATUS_E_INVAL; |
| 5857 | } |
| 5858 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5859 | } |
| 5860 | |
| 5861 | return (status); |
| 5862 | } |
| 5863 | |
| 5864 | |
| 5865 | /* --------------------------------------------------------------------------- |
| 5866 | \fn sme_GetWcnssHardwareVersion |
| 5867 | \brief This API returns the version string of the WCNSS hardware |
| 5868 | \param hHal - The handle returned by macOpen. |
| 5869 | \param pVersion - Points to the Version string buffer to be filled |
| 5870 | \param versionBufferSize - THe size of the Version string buffer |
| 5871 | \return VOS_STATUS |
| 5872 | VOS_STATUS_E_INVAL - failure |
| 5873 | VOS_STATUS_SUCCESS success |
| 5874 | ---------------------------------------------------------------------------*/ |
| 5875 | VOS_STATUS sme_GetWcnssHardwareVersion(tHalHandle hHal, |
| 5876 | tANI_U8 *pVersion, |
| 5877 | tANI_U32 versionBufferSize) |
| 5878 | { |
| 5879 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 5880 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5881 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 5882 | |
| 5883 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5884 | { |
| 5885 | if( pVersion != NULL ) |
| 5886 | { |
| 5887 | status = WDA_GetWcnssHardwareVersion(vosContext, pVersion, |
| 5888 | versionBufferSize); |
| 5889 | } |
| 5890 | else |
| 5891 | { |
| 5892 | status = VOS_STATUS_E_INVAL; |
| 5893 | } |
| 5894 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5895 | } |
| 5896 | |
| 5897 | return (status); |
| 5898 | } |
Jeff Johnson | 4824d4c | 2013-02-12 14:23:57 -0800 | [diff] [blame] | 5899 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5900 | |
| 5901 | #ifdef FEATURE_WLAN_WAPI |
| 5902 | /* --------------------------------------------------------------------------- |
| 5903 | \fn sme_RoamSetBKIDCache |
| 5904 | \brief The SME API exposed to HDD to allow HDD to provde SME the BKID |
| 5905 | candidate list. |
| 5906 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 5907 | it is opened (by calling halOpen). |
| 5908 | \param pBKIDCache - caller allocated buffer point to an array of tBkidCacheInfo |
| 5909 | \param numItems - a variable that has the number of tBkidCacheInfo allocated |
| 5910 | when retruning, this is the number of items put into pBKIDCache |
| 5911 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 5912 | big enough and pNumItems has the number of tBkidCacheInfo. |
| 5913 | ---------------------------------------------------------------------------*/ |
| 5914 | eHalStatus sme_RoamSetBKIDCache( tHalHandle hHal, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache, |
| 5915 | tANI_U32 numItems ) |
| 5916 | { |
| 5917 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5918 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5919 | |
| 5920 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5921 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5922 | { |
| 5923 | status = csrRoamSetBKIDCache( pMac, sessionId, pBKIDCache, numItems ); |
| 5924 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5925 | } |
| 5926 | |
| 5927 | return (status); |
| 5928 | } |
| 5929 | |
| 5930 | /* --------------------------------------------------------------------------- |
| 5931 | \fn sme_RoamGetBKIDCache |
| 5932 | \brief The SME API exposed to HDD to allow HDD to request SME to return its |
| 5933 | BKID cache. |
| 5934 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 5935 | it is opened (by calling halOpen). |
| 5936 | \param pNum - caller allocated memory that has the space of the number of |
| 5937 | tBkidCacheInfo as input. Upon returned, *pNum has the needed number of entries |
| 5938 | in SME cache. |
| 5939 | \param pBkidCache - Caller allocated memory that contains BKID cache, if any, |
| 5940 | upon return |
| 5941 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 5942 | big enough. |
| 5943 | ---------------------------------------------------------------------------*/ |
| 5944 | eHalStatus sme_RoamGetBKIDCache(tHalHandle hHal, tANI_U32 *pNum, |
| 5945 | tBkidCacheInfo *pBkidCache) |
| 5946 | { |
| 5947 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5948 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5949 | |
| 5950 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5951 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5952 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5953 | smsLog(pMac, LOGE, FL(" !!!!!!!!!!!!!!!!!!SessionId is hardcoded")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5954 | status = csrRoamGetBKIDCache( pMac, 0, pNum, pBkidCache ); |
| 5955 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5956 | } |
| 5957 | |
| 5958 | return (status); |
| 5959 | } |
| 5960 | |
| 5961 | /* --------------------------------------------------------------------------- |
| 5962 | \fn sme_RoamGetNumBKIDCache |
| 5963 | \brief The SME API exposed to HDD to allow HDD to request SME to return the |
| 5964 | number of BKID cache entries. |
| 5965 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 5966 | it is opened (by calling halOpen). |
| 5967 | \return tANI_U32 - the number of BKID cache entries. |
| 5968 | ---------------------------------------------------------------------------*/ |
| 5969 | tANI_U32 sme_RoamGetNumBKIDCache(tHalHandle hHal, tANI_U32 sessionId) |
| 5970 | { |
| 5971 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5972 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5973 | tANI_U32 numBkidCache = 0; |
| 5974 | |
| 5975 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5976 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5977 | { |
| 5978 | numBkidCache = csrRoamGetNumBKIDCache( pMac, sessionId ); |
| 5979 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5980 | } |
| 5981 | |
| 5982 | return (numBkidCache); |
| 5983 | } |
| 5984 | |
| 5985 | /* --------------------------------------------------------------------------- |
| 5986 | \fn sme_ScanGetBKIDCandidateList |
| 5987 | \brief a wrapper function to return the BKID candidate list |
| 5988 | \param pBkidList - caller allocated buffer point to an array of |
| 5989 | tBkidCandidateInfo |
| 5990 | \param pNumItems - pointer to a variable that has the number of |
| 5991 | tBkidCandidateInfo allocated when retruning, this is |
| 5992 | either the number needed or number of items put into |
| 5993 | pPmkidList |
| 5994 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 5995 | big enough and pNumItems |
| 5996 | has the number of tBkidCandidateInfo. |
| 5997 | \Note: pNumItems is a number of tBkidCandidateInfo, |
| 5998 | not sizeof(tBkidCandidateInfo) * something |
| 5999 | ---------------------------------------------------------------------------*/ |
| 6000 | eHalStatus sme_ScanGetBKIDCandidateList(tHalHandle hHal, tANI_U32 sessionId, |
| 6001 | tBkidCandidateInfo *pBkidList, |
| 6002 | tANI_U32 *pNumItems ) |
| 6003 | { |
| 6004 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6005 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6006 | |
| 6007 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6008 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6009 | { |
| 6010 | status = csrScanGetBKIDCandidateList( pMac, sessionId, pBkidList, pNumItems ); |
| 6011 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6012 | } |
| 6013 | |
| 6014 | return (status); |
| 6015 | } |
| 6016 | #endif /* FEATURE_WLAN_WAPI */ |
| 6017 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6018 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 6019 | |
| 6020 | /***************************************************************************** |
| 6021 | OEM DATA related modifications and function additions |
| 6022 | *****************************************************************************/ |
| 6023 | |
| 6024 | /* --------------------------------------------------------------------------- |
| 6025 | \fn sme_getOemDataRsp |
| 6026 | \brief a wrapper function to obtain the OEM DATA RSP |
| 6027 | \param pOemDataRsp - A pointer to the response object |
| 6028 | \param pContext - a pointer passed in for the callback |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6029 | \return eHalStatus |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6030 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6031 | eHalStatus sme_getOemDataRsp(tHalHandle hHal, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6032 | tOemDataRsp **pOemDataRsp) |
| 6033 | { |
| 6034 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6035 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6036 | |
| 6037 | do |
| 6038 | { |
| 6039 | //acquire the lock for the sme object |
| 6040 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6041 | |
| 6042 | if(!HAL_STATUS_SUCCESS(status)) |
| 6043 | { |
| 6044 | break; |
| 6045 | } |
| 6046 | |
| 6047 | if(pMac->oemData.pOemDataRsp != NULL) |
| 6048 | { |
| 6049 | *pOemDataRsp = pMac->oemData.pOemDataRsp; |
| 6050 | } |
| 6051 | else |
| 6052 | { |
| 6053 | status = eHAL_STATUS_FAILURE; |
| 6054 | } |
| 6055 | |
| 6056 | //release the lock for the sme object |
| 6057 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6058 | |
| 6059 | } while(0); |
| 6060 | |
| 6061 | return status; |
| 6062 | } |
| 6063 | |
| 6064 | /* --------------------------------------------------------------------------- |
| 6065 | \fn sme_OemDataReq |
| 6066 | \brief a wrapper function for OEM DATA REQ |
| 6067 | \param sessionId - session id to be used. |
| 6068 | \param pOemDataReqId - pointer to an object to get back the request ID |
| 6069 | \param callback - a callback function that is called upon finish |
| 6070 | \param pContext - a pointer passed in for the callback |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6071 | \return eHalStatus |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6072 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6073 | eHalStatus sme_OemDataReq(tHalHandle hHal, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6074 | tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6075 | tOemDataReqConfig *pOemDataReqConfig, |
| 6076 | tANI_U32 *pOemDataReqID, |
| 6077 | oemData_OemDataReqCompleteCallback callback, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6078 | void *pContext) |
| 6079 | { |
| 6080 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6081 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6082 | |
| 6083 | do |
| 6084 | { |
| 6085 | //acquire the lock for the sme object |
| 6086 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6087 | if(HAL_STATUS_SUCCESS(status)) |
| 6088 | { |
| 6089 | tANI_U32 lOemDataReqId = pMac->oemData.oemDataReqID++; //let it wrap around |
| 6090 | |
| 6091 | if(pOemDataReqID) |
| 6092 | { |
| 6093 | *pOemDataReqID = lOemDataReqId; |
| 6094 | } |
| 6095 | else |
Leela Venkata Kiran Kumar Reddy Chirala | 090cc1f | 2013-03-07 17:40:17 -0800 | [diff] [blame] | 6096 | { |
| 6097 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6098 | return eHAL_STATUS_FAILURE; |
| 6099 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6100 | |
| 6101 | status = oemData_OemDataReq(hHal, sessionId, pOemDataReqConfig, pOemDataReqID, callback, pContext); |
| 6102 | |
| 6103 | //release the lock for the sme object |
| 6104 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6105 | } |
| 6106 | } while(0); |
| 6107 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6108 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6109 | |
| 6110 | return(status); |
| 6111 | } |
| 6112 | |
| 6113 | #endif /*FEATURE_OEM_DATA_SUPPORT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6114 | |
| 6115 | /*-------------------------------------------------------------------------- |
| 6116 | |
| 6117 | \brief sme_OpenSession() - Open a session for scan/roam operation. |
| 6118 | |
| 6119 | This is a synchronous API. |
| 6120 | |
| 6121 | |
| 6122 | \param hHal - The handle returned by macOpen. |
| 6123 | \param callback - A pointer to the function caller specifies for roam/connect status indication |
| 6124 | \param pContext - The context passed with callback |
| 6125 | \param pSelfMacAddr - Caller allocated memory filled with self MAC address (6 bytes) |
| 6126 | \param pbSessionId - pointer to a caller allocated buffer for returned session ID |
| 6127 | |
| 6128 | \return eHAL_STATUS_SUCCESS - session is opened. sessionId returned. |
| 6129 | |
| 6130 | Other status means SME is failed to open the session. |
| 6131 | eHAL_STATUS_RESOURCES - no more session available. |
| 6132 | \sa |
| 6133 | |
| 6134 | --------------------------------------------------------------------------*/ |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 6135 | eHalStatus sme_OpenSession(tHalHandle hHal, csrRoamCompleteCallback callback, |
| 6136 | void *pContext, tANI_U8 *pSelfMacAddr, |
| 6137 | tANI_U8 *pbSessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6138 | { |
| 6139 | eHalStatus status; |
| 6140 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6141 | |
| 6142 | if( NULL == pbSessionId ) |
| 6143 | { |
| 6144 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 6145 | } |
| 6146 | else |
| 6147 | { |
| 6148 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6149 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6150 | { |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 6151 | status = csrRoamOpenSession(pMac, callback, pContext, |
| 6152 | pSelfMacAddr, pbSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6153 | |
| 6154 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6155 | } |
| 6156 | } |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6157 | if( NULL != pbSessionId ) |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6158 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6159 | TRACE_CODE_SME_RX_HDD_OPEN_SESSION,*pbSessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6160 | |
| 6161 | return ( status ); |
| 6162 | } |
| 6163 | |
| 6164 | |
| 6165 | /*-------------------------------------------------------------------------- |
| 6166 | |
| 6167 | \brief sme_CloseSession() - Open a session for scan/roam operation. |
| 6168 | |
| 6169 | This is a synchronous API. |
| 6170 | |
| 6171 | |
| 6172 | \param hHal - The handle returned by macOpen. |
| 6173 | |
| 6174 | \param sessionId - A previous opened session's ID. |
| 6175 | |
| 6176 | \return eHAL_STATUS_SUCCESS - session is closed. |
| 6177 | |
| 6178 | Other status means SME is failed to open the session. |
| 6179 | eHAL_STATUS_INVALID_PARAMETER - session is not opened. |
| 6180 | \sa |
| 6181 | |
| 6182 | --------------------------------------------------------------------------*/ |
| 6183 | eHalStatus sme_CloseSession(tHalHandle hHal, tANI_U8 sessionId, |
| 6184 | csrRoamSessionCloseCallback callback, void *pContext) |
| 6185 | { |
| 6186 | eHalStatus status; |
| 6187 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6188 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6189 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6190 | TRACE_CODE_SME_RX_HDD_CLOSE_SESSION, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6191 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6192 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6193 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6194 | status = csrRoamCloseSession( pMac, sessionId, FALSE, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6195 | callback, pContext ); |
| 6196 | |
| 6197 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6198 | } |
| 6199 | |
| 6200 | return ( status ); |
| 6201 | } |
| 6202 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6203 | /* --------------------------------------------------------------------------- |
| 6204 | |
| 6205 | \fn sme_RoamUpdateAPWPSIE |
| 6206 | |
| 6207 | \brief To update AP's WPS IE. This function should be called after SME AP session is created |
| 6208 | This is an asynchronous API. |
| 6209 | |
| 6210 | \param pAPWPSIES - pointer to a caller allocated object of tSirAPWPSIEs |
| 6211 | |
| 6212 | \return eHalStatus – SUCCESS – |
| 6213 | |
| 6214 | FAILURE or RESOURCES – The API finished and failed. |
| 6215 | |
| 6216 | -------------------------------------------------------------------------------*/ |
| 6217 | eHalStatus sme_RoamUpdateAPWPSIE(tHalHandle hHal, tANI_U8 sessionId, tSirAPWPSIEs *pAPWPSIES) |
| 6218 | { |
| 6219 | |
| 6220 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6221 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6222 | |
| 6223 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6224 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6225 | { |
| 6226 | |
| 6227 | status = csrRoamUpdateAPWPSIE( pMac, sessionId, pAPWPSIES ); |
| 6228 | |
| 6229 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6230 | } |
| 6231 | |
| 6232 | return (status); |
| 6233 | } |
| 6234 | /* --------------------------------------------------------------------------- |
| 6235 | |
| 6236 | \fn sme_RoamUpdateAPWPARSNIEs |
| 6237 | |
| 6238 | \brief To update AP's WPA/RSN IEs. This function should be called after SME AP session is created |
| 6239 | This is an asynchronous API. |
| 6240 | |
| 6241 | \param pAPSirRSNie - pointer to a caller allocated object of tSirRSNie with WPS/RSN IEs |
| 6242 | |
| 6243 | \return eHalStatus – SUCCESS – |
| 6244 | |
| 6245 | FAILURE or RESOURCES – The API finished and failed. |
| 6246 | |
| 6247 | -------------------------------------------------------------------------------*/ |
| 6248 | eHalStatus sme_RoamUpdateAPWPARSNIEs(tHalHandle hHal, tANI_U8 sessionId, tSirRSNie * pAPSirRSNie) |
| 6249 | { |
| 6250 | |
| 6251 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6252 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6253 | |
| 6254 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6255 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6256 | { |
| 6257 | |
| 6258 | status = csrRoamUpdateWPARSNIEs( pMac, sessionId, pAPSirRSNie); |
| 6259 | |
| 6260 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6261 | } |
| 6262 | |
| 6263 | return (status); |
| 6264 | } |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6265 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6266 | |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6267 | \fn sme_ChangeMCCBeaconInterval |
| 6268 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6269 | \brief To update P2P-GO beaconInterval. This function should be called after |
| 6270 | disassociating all the station is done |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6271 | This is an asynchronous API. |
| 6272 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6273 | \param |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6274 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6275 | \return eHalStatus SUCCESS |
| 6276 | FAILURE or RESOURCES |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 6277 | The API finished and failed. |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6278 | |
| 6279 | -------------------------------------------------------------------------------*/ |
| 6280 | eHalStatus sme_ChangeMCCBeaconInterval(tHalHandle hHal, tANI_U8 sessionId) |
| 6281 | { |
| 6282 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6283 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6284 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6285 | smsLog(pMac, LOG1, FL("Update Beacon PARAMS ")); |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6286 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6287 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6288 | { |
| 6289 | status = csrSendChngMCCBeaconInterval( pMac, sessionId); |
| 6290 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6291 | } |
| 6292 | return (status); |
| 6293 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6294 | |
| 6295 | /*-------------------------------------------------------------------------------* |
| 6296 | |
| 6297 | \fn sme_sendBTAmpEvent |
| 6298 | |
| 6299 | \brief to receive the coex priorty request from BT-AMP PAL |
| 6300 | and send the BT_AMP link state to HAL |
| 6301 | |
| 6302 | \param btAmpEvent - btAmpEvent |
| 6303 | |
Jeff Johnson | feddb2d | 2012-12-10 14:41:22 -0800 | [diff] [blame] | 6304 | \return eHalStatus: SUCCESS : BTAmp event successfully sent to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6305 | |
| 6306 | FAILURE: API failed |
| 6307 | |
| 6308 | -------------------------------------------------------------------------------*/ |
| 6309 | |
| 6310 | eHalStatus sme_sendBTAmpEvent(tHalHandle hHal, tSmeBtAmpEvent btAmpEvent) |
| 6311 | { |
| 6312 | vos_msg_t msg; |
| 6313 | tpSmeBtAmpEvent ptrSmeBtAmpEvent = NULL; |
| 6314 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6315 | |
Leela Venkata Kiran Kumar Reddy Chirala | f7ea543 | 2013-11-15 11:03:04 -0800 | [diff] [blame] | 6316 | ptrSmeBtAmpEvent = vos_mem_malloc(sizeof(tSmeBtAmpEvent)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6317 | if (NULL == ptrSmeBtAmpEvent) |
| 6318 | { |
| 6319 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6320 | "Not able to allocate memory for BTAmp event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6321 | return status; |
| 6322 | } |
| 6323 | |
| 6324 | vos_mem_copy(ptrSmeBtAmpEvent, (void*)&btAmpEvent, sizeof(tSmeBtAmpEvent)); |
| 6325 | msg.type = WDA_SIGNAL_BTAMP_EVENT; |
| 6326 | msg.reserved = 0; |
| 6327 | msg.bodyptr = ptrSmeBtAmpEvent; |
| 6328 | |
| 6329 | //status = halFW_SendBTAmpEventMesg(pMac, event); |
| 6330 | |
| 6331 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 6332 | { |
| 6333 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6334 | "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] | 6335 | vos_mem_free(ptrSmeBtAmpEvent); |
| 6336 | return status; |
| 6337 | } |
| 6338 | |
| 6339 | return eHAL_STATUS_SUCCESS; |
| 6340 | |
| 6341 | } |
| 6342 | |
| 6343 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6344 | \fn smeIssueFastRoamNeighborAPEvent |
| 6345 | \brief API to trigger fast BSS roam independent of RSSI triggers |
| 6346 | \param hHal - The handle returned by macOpen. |
| 6347 | \param bssid - Pointer to the BSSID to roam to. |
| 6348 | \param fastRoamTrig - Trigger to Scan or roam |
| 6349 | \return eHalStatus |
| 6350 | ---------------------------------------------------------------------------*/ |
| 6351 | eHalStatus smeIssueFastRoamNeighborAPEvent (tHalHandle hHal, |
| 6352 | tANI_U8 *bssid, |
| 6353 | tSmeFastRoamTrigger fastRoamTrig) |
| 6354 | { |
| 6355 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6356 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 6357 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 6358 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6359 | |
| 6360 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6361 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6362 | { |
| 6363 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 6364 | "%s: invoked", __func__); |
| 6365 | |
| 6366 | if (eSME_ROAM_TRIGGER_SCAN == fastRoamTrig) |
| 6367 | { |
| 6368 | smsLog(pMac, LOG1, FL("CFG Channel list scan... ")); |
| 6369 | pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_SCAN; |
| 6370 | vos_mem_copy((void *)(&pNeighborRoamInfo->cfgRoambssId), |
| 6371 | (void *)bssid, sizeof(tSirMacAddr)); |
Arif Hussain | a7c8e41 | 2013-11-20 11:06:42 -0800 | [diff] [blame] | 6372 | smsLog(pMac, LOG1, "Calling Roam Look Up down Event BSSID " |
| 6373 | MAC_ADDRESS_STR, MAC_ADDR_ARRAY(pNeighborRoamInfo->cfgRoambssId)); |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6374 | |
| 6375 | vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac); |
| 6376 | if (VOS_STATUS_SUCCESS != vosStatus) |
| 6377 | { |
| 6378 | smsLog(pMac, LOGE, |
| 6379 | FL("CFG Channel list scan state failed with status %d "), |
| 6380 | vosStatus); |
| 6381 | } |
| 6382 | } |
| 6383 | else if (eSME_ROAM_TRIGGER_FAST_ROAM == fastRoamTrig) |
| 6384 | { |
| 6385 | vos_mem_copy((void *)(&pNeighborRoamInfo->cfgRoambssId), |
| 6386 | (void *)bssid, sizeof(tSirMacAddr)); |
| 6387 | pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_FAST_ROAM; |
Arif Hussain | a7c8e41 | 2013-11-20 11:06:42 -0800 | [diff] [blame] | 6388 | smsLog(pMac, LOG1, "Roam to BSSID "MAC_ADDRESS_STR, |
| 6389 | MAC_ADDR_ARRAY(pNeighborRoamInfo->cfgRoambssId)); |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6390 | |
| 6391 | vosStatus = csrNeighborRoamReassocIndCallback(pMac->roam.gVosContext, |
| 6392 | 0, |
| 6393 | pMac, |
| 6394 | 0); |
| 6395 | |
| 6396 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 6397 | { |
| 6398 | smsLog(pMac, |
| 6399 | LOGE, |
| 6400 | FL(" Call to csrNeighborRoamReassocIndCallback failed, status = %d"), |
| 6401 | vosStatus); |
| 6402 | } |
| 6403 | } |
| 6404 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6405 | } |
| 6406 | return vosStatus; |
| 6407 | } |
| 6408 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6409 | \fn sme_SetHostOffload |
| 6410 | \brief API to set the host offload feature. |
| 6411 | \param hHal - The handle returned by macOpen. |
| 6412 | \param pRequest - Pointer to the offload request. |
| 6413 | \return eHalStatus |
| 6414 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6415 | eHalStatus sme_SetHostOffload (tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6416 | tpSirHostOffloadReq pRequest) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6417 | { |
| 6418 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6419 | eHalStatus status = eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6420 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6421 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6422 | TRACE_CODE_SME_RX_HDD_SET_HOSTOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6423 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6424 | { |
| 6425 | #ifdef WLAN_NS_OFFLOAD |
| 6426 | if(SIR_IPV6_NS_OFFLOAD == pRequest->offloadType) |
| 6427 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6428 | status = pmcSetNSOffload( hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6429 | } |
| 6430 | else |
| 6431 | #endif //WLAN_NS_OFFLOAD |
| 6432 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6433 | status = pmcSetHostOffload (hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6434 | } |
| 6435 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6436 | } |
| 6437 | |
| 6438 | return (status); |
| 6439 | } |
| 6440 | |
| 6441 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 6442 | /* --------------------------------------------------------------------------- |
| 6443 | \fn sme_SetGTKOffload |
| 6444 | \brief API to set GTK offload information. |
| 6445 | \param hHal - The handle returned by macOpen. |
| 6446 | \param pRequest - Pointer to the GTK offload request. |
| 6447 | \return eHalStatus |
| 6448 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6449 | eHalStatus sme_SetGTKOffload (tHalHandle hHal, tpSirGtkOffloadParams pRequest, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6450 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6451 | { |
| 6452 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6453 | eHalStatus status; |
| 6454 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6455 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6456 | TRACE_CODE_SME_RX_HDD_SET_GTKOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6457 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6458 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6459 | status = pmcSetGTKOffload( hHal, pRequest, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6460 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6461 | } |
| 6462 | |
| 6463 | return (status); |
| 6464 | } |
| 6465 | |
| 6466 | /* --------------------------------------------------------------------------- |
| 6467 | \fn sme_GetGTKOffload |
| 6468 | \brief API to get GTK offload information. |
| 6469 | \param hHal - The handle returned by macOpen. |
| 6470 | \param pRequest - Pointer to the GTK offload response. |
| 6471 | \return eHalStatus |
| 6472 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6473 | eHalStatus sme_GetGTKOffload (tHalHandle hHal, GTKOffloadGetInfoCallback callbackRoutine, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6474 | void *callbackContext, tANI_U8 sessionId ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6475 | { |
| 6476 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6477 | eHalStatus status; |
| 6478 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6479 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6480 | TRACE_CODE_SME_RX_HDD_GET_GTKOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6481 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6482 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6483 | pmcGetGTKOffload(hHal, callbackRoutine, callbackContext, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6484 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6485 | } |
| 6486 | |
| 6487 | return (status); |
| 6488 | } |
| 6489 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 6490 | |
| 6491 | /* --------------------------------------------------------------------------- |
| 6492 | \fn sme_SetKeepAlive |
| 6493 | \brief API to set the Keep Alive feature. |
| 6494 | \param hHal - The handle returned by macOpen. |
| 6495 | \param pRequest - Pointer to the Keep Alive request. |
| 6496 | \return eHalStatus |
| 6497 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6498 | eHalStatus sme_SetKeepAlive (tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6499 | tpSirKeepAliveReq pRequest) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6500 | { |
| 6501 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6502 | eHalStatus status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6503 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6504 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6505 | status = pmcSetKeepAlive (hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6506 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6507 | } |
| 6508 | |
| 6509 | return (status); |
| 6510 | } |
| 6511 | |
| 6512 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 6513 | /* --------------------------------------------------------------------------- |
| 6514 | \fn sme_SetPreferredNetworkList |
| 6515 | \brief API to set the Preferred Network List Offload feature. |
| 6516 | \param hHal - The handle returned by macOpen. |
| 6517 | \param pRequest - Pointer to the offload request. |
| 6518 | \return eHalStatus |
| 6519 | ---------------------------------------------------------------------------*/ |
| 6520 | eHalStatus sme_SetPreferredNetworkList (tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, void (*callbackRoutine) (void *callbackContext, tSirPrefNetworkFoundInd *pPrefNetworkFoundInd), void *callbackContext ) |
| 6521 | { |
| 6522 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6523 | eHalStatus status; |
| 6524 | |
| 6525 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6526 | { |
| 6527 | pmcSetPreferredNetworkList(hHal, pRequest, sessionId, callbackRoutine, callbackContext); |
| 6528 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6529 | } |
| 6530 | |
| 6531 | return (status); |
| 6532 | } |
| 6533 | |
| 6534 | eHalStatus sme_SetRSSIFilter(tHalHandle hHal, v_U8_t rssiThreshold) |
| 6535 | { |
| 6536 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6537 | eHalStatus status; |
| 6538 | |
| 6539 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6540 | { |
| 6541 | pmcSetRssiFilter(hHal, rssiThreshold); |
| 6542 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6543 | } |
| 6544 | |
| 6545 | return (status); |
| 6546 | } |
| 6547 | |
| 6548 | #endif // FEATURE_WLAN_SCAN_PNO |
| 6549 | |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 6550 | eHalStatus sme_SetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams, tANI_BOOLEAN forced) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6551 | { |
| 6552 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6553 | eHalStatus status; |
| 6554 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6555 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6556 | TRACE_CODE_SME_RX_HDD_SET_POWERPARAMS, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6557 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6558 | { |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 6559 | pmcSetPowerParams(hHal, pwParams, forced); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6560 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6561 | } |
| 6562 | |
| 6563 | return (status); |
| 6564 | } |
| 6565 | |
| 6566 | /* --------------------------------------------------------------------------- |
| 6567 | \fn sme_AbortMacScan |
| 6568 | \brief API to cancel MAC scan. |
| 6569 | \param hHal - The handle returned by macOpen. |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 6570 | \param sessionId - sessionId on which we need to abort scan. |
Srinivas, Dasari | 138af4f | 2014-02-07 11:13:45 +0530 | [diff] [blame] | 6571 | \param reason - Reason to abort the scan. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6572 | \return VOS_STATUS |
| 6573 | VOS_STATUS_E_FAILURE - failure |
| 6574 | VOS_STATUS_SUCCESS success |
| 6575 | ---------------------------------------------------------------------------*/ |
Srinivas, Dasari | 138af4f | 2014-02-07 11:13:45 +0530 | [diff] [blame] | 6576 | eHalStatus sme_AbortMacScan(tHalHandle hHal, tANI_U8 sessionId, |
| 6577 | eCsrAbortReason reason) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6578 | { |
| 6579 | eHalStatus status; |
| 6580 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6581 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6582 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6583 | TRACE_CODE_SME_RX_HDD_ABORT_MACSCAN, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6584 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6585 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6586 | { |
Srinivas, Dasari | 138af4f | 2014-02-07 11:13:45 +0530 | [diff] [blame] | 6587 | status = csrScanAbortMacScan(pMac, sessionId, reason); |
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 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6590 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6591 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6592 | return ( status ); |
| 6593 | } |
| 6594 | |
| 6595 | /* ---------------------------------------------------------------------------- |
| 6596 | \fn sme_GetOperationChannel |
| 6597 | \brief API to get current channel on which STA is parked |
| 6598 | this function gives channel information only of infra station or IBSS station |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6599 | \param hHal, pointer to memory location and sessionId |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6600 | \returns eHAL_STATUS_SUCCESS |
| 6601 | eHAL_STATUS_FAILURE |
| 6602 | -------------------------------------------------------------------------------*/ |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6603 | eHalStatus sme_GetOperationChannel(tHalHandle hHal, tANI_U32 *pChannel, tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6604 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6605 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6606 | tCsrRoamSession *pSession; |
| 6607 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6608 | if (CSR_IS_SESSION_VALID( pMac, sessionId )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6609 | { |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6610 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6611 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6612 | if(( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_INFRASTRUCTURE ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6613 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_IBSS ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6614 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_INFRA_AP ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6615 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_START_IBSS )) |
| 6616 | { |
| 6617 | *pChannel =pSession->connectedProfile.operationChannel; |
| 6618 | return eHAL_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6619 | } |
| 6620 | } |
| 6621 | return eHAL_STATUS_FAILURE; |
| 6622 | }// sme_GetOperationChannel ends here |
| 6623 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6624 | /* --------------------------------------------------------------------------- |
| 6625 | |
| 6626 | \fn sme_RegisterMgtFrame |
| 6627 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6628 | \brief To register managment frame of specified type and subtype. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6629 | \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] | 6630 | \param matchData - data which needs to be matched before passing frame |
| 6631 | to HDD. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6632 | \param matchDataLen - Length of matched data. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6633 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6634 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6635 | eHalStatus sme_RegisterMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6636 | tANI_U16 frameType, tANI_U8* matchData, tANI_U16 matchLen) |
| 6637 | { |
| 6638 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6639 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6640 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6641 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6642 | TRACE_CODE_SME_RX_HDD_REGISTER_MGMTFR, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6643 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6644 | { |
| 6645 | tSirRegisterMgmtFrame *pMsg; |
| 6646 | tANI_U16 len; |
| 6647 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 6648 | |
| 6649 | if(!pSession) |
| 6650 | { |
| 6651 | 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] | 6652 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 6653 | return eHAL_STATUS_FAILURE; |
| 6654 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6655 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6656 | if( !pSession->sessionActive ) |
| 6657 | { |
| 6658 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6659 | "%s Invalid Sessionid", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6660 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6661 | return eHAL_STATUS_FAILURE; |
| 6662 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6663 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6664 | len = sizeof(tSirRegisterMgmtFrame) + matchLen; |
| 6665 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6666 | pMsg = vos_mem_malloc(len); |
| 6667 | if ( NULL == pMsg ) |
| 6668 | status = eHAL_STATUS_FAILURE; |
| 6669 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6670 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6671 | vos_mem_set(pMsg, len, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6672 | pMsg->messageType = eWNI_SME_REGISTER_MGMT_FRAME_REQ; |
| 6673 | pMsg->length = len; |
| 6674 | pMsg->sessionId = sessionId; |
| 6675 | pMsg->registerFrame = VOS_TRUE; |
| 6676 | pMsg->frameType = frameType; |
| 6677 | pMsg->matchLen = matchLen; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6678 | vos_mem_copy(pMsg->matchData, matchData, matchLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6679 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 6680 | } |
| 6681 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6682 | } |
| 6683 | return status; |
| 6684 | } |
| 6685 | |
| 6686 | /* --------------------------------------------------------------------------- |
| 6687 | |
| 6688 | \fn sme_DeregisterMgtFrame |
| 6689 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6690 | \brief To De-register managment frame of specified type and subtype. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6691 | \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] | 6692 | \param matchData - data which needs to be matched before passing frame |
| 6693 | to HDD. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6694 | \param matchDataLen - Length of matched data. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6695 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6696 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6697 | eHalStatus sme_DeregisterMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6698 | tANI_U16 frameType, tANI_U8* matchData, tANI_U16 matchLen) |
| 6699 | { |
| 6700 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6701 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6702 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6703 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6704 | TRACE_CODE_SME_RX_HDD_DEREGISTER_MGMTFR, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6705 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6706 | { |
| 6707 | tSirRegisterMgmtFrame *pMsg; |
| 6708 | tANI_U16 len; |
| 6709 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 6710 | |
| 6711 | if(!pSession) |
| 6712 | { |
| 6713 | 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] | 6714 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 6715 | return eHAL_STATUS_FAILURE; |
| 6716 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6717 | |
| 6718 | if( !pSession->sessionActive ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6719 | { |
| 6720 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6721 | "%s Invalid Sessionid", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6722 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6723 | return eHAL_STATUS_FAILURE; |
| 6724 | } |
| 6725 | |
| 6726 | len = sizeof(tSirRegisterMgmtFrame) + matchLen; |
| 6727 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6728 | pMsg = vos_mem_malloc(len); |
| 6729 | if ( NULL == pMsg ) |
| 6730 | status = eHAL_STATUS_FAILURE; |
| 6731 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6732 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6733 | vos_mem_set(pMsg, len, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6734 | pMsg->messageType = eWNI_SME_REGISTER_MGMT_FRAME_REQ; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6735 | pMsg->length = len; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6736 | pMsg->registerFrame = VOS_FALSE; |
| 6737 | pMsg->frameType = frameType; |
| 6738 | pMsg->matchLen = matchLen; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6739 | vos_mem_copy(pMsg->matchData, matchData, matchLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6740 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 6741 | } |
| 6742 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6743 | } |
| 6744 | return status; |
| 6745 | } |
| 6746 | |
| 6747 | /* --------------------------------------------------------------------------- |
| 6748 | \fn sme_RemainOnChannel |
| 6749 | \brief API to request remain on channel for 'x' duration. used in p2p in listen state |
| 6750 | \param hHal - The handle returned by macOpen. |
| 6751 | \param pRequest - channel |
| 6752 | \param duration - duration in ms |
| 6753 | \param callback - HDD registered callback to process reaminOnChannelRsp |
| 6754 | \param context - HDD Callback param |
| 6755 | \return eHalStatus |
| 6756 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6757 | eHalStatus sme_RemainOnChannel(tHalHandle hHal, tANI_U8 sessionId, |
| 6758 | tANI_U8 channel, tANI_U32 duration, |
Gopichand Nakkala | 924e455 | 2013-05-08 19:18:14 +0530 | [diff] [blame] | 6759 | remainOnChanCallback callback, |
| 6760 | void *pContext, |
| 6761 | tANI_U8 isP2PProbeReqAllowed) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6762 | { |
| 6763 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6764 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6765 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6766 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6767 | TRACE_CODE_SME_RX_HDD_REMAIN_ONCHAN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6768 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6769 | { |
Gopichand Nakkala | 924e455 | 2013-05-08 19:18:14 +0530 | [diff] [blame] | 6770 | status = p2pRemainOnChannel (hHal, sessionId, channel, duration, callback, pContext, |
| 6771 | isP2PProbeReqAllowed |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6772 | #ifdef WLAN_FEATURE_P2P_INTERNAL |
| 6773 | , eP2PRemainOnChnReasonUnknown |
| 6774 | #endif |
| 6775 | ); |
| 6776 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6777 | } |
| 6778 | return(status); |
| 6779 | } |
| 6780 | |
| 6781 | /* --------------------------------------------------------------------------- |
| 6782 | \fn sme_ReportProbeReq |
| 6783 | \brief API to enable/disable forwarding of probeReq to apps in p2p. |
| 6784 | \param hHal - The handle returned by macOpen. |
| 6785 | \param falg: to set the Probe request forarding to wpa_supplicant in listen state in p2p |
| 6786 | \return eHalStatus |
| 6787 | ---------------------------------------------------------------------------*/ |
| 6788 | |
| 6789 | #ifndef WLAN_FEATURE_CONCURRENT_P2P |
| 6790 | eHalStatus sme_ReportProbeReq(tHalHandle hHal, tANI_U8 flag) |
| 6791 | { |
| 6792 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6793 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6794 | |
| 6795 | do |
| 6796 | { |
| 6797 | //acquire the lock for the sme object |
| 6798 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6799 | if(HAL_STATUS_SUCCESS(status)) |
| 6800 | { |
| 6801 | /* call set in context */ |
| 6802 | pMac->p2pContext.probeReqForwarding = flag; |
| 6803 | //release the lock for the sme object |
| 6804 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6805 | } |
| 6806 | } while(0); |
| 6807 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6808 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6809 | |
| 6810 | return(status); |
| 6811 | } |
| 6812 | |
| 6813 | /* --------------------------------------------------------------------------- |
| 6814 | \fn sme_updateP2pIe |
| 6815 | \brief API to set the P2p Ie in p2p context |
| 6816 | \param hHal - The handle returned by macOpen. |
| 6817 | \param p2pIe - Ptr to p2pIe from HDD. |
| 6818 | \param p2pIeLength: length of p2pIe |
| 6819 | \return eHalStatus |
| 6820 | ---------------------------------------------------------------------------*/ |
| 6821 | |
| 6822 | eHalStatus sme_updateP2pIe(tHalHandle hHal, void *p2pIe, tANI_U32 p2pIeLength) |
| 6823 | { |
| 6824 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6825 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6826 | |
| 6827 | //acquire the lock for the sme object |
| 6828 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6829 | if(HAL_STATUS_SUCCESS(status)) |
| 6830 | { |
| 6831 | if(NULL != pMac->p2pContext.probeRspIe){ |
| 6832 | vos_mem_free(pMac->p2pContext.probeRspIe); |
| 6833 | pMac->p2pContext.probeRspIeLength = 0; |
| 6834 | } |
| 6835 | |
| 6836 | pMac->p2pContext.probeRspIe = vos_mem_malloc(p2pIeLength); |
| 6837 | if (NULL == pMac->p2pContext.probeRspIe) |
| 6838 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6839 | smsLog(pMac, LOGE, "%s: Unable to allocate P2P IE", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6840 | pMac->p2pContext.probeRspIeLength = 0; |
| 6841 | status = eHAL_STATUS_FAILURE; |
| 6842 | } |
| 6843 | else |
| 6844 | { |
| 6845 | pMac->p2pContext.probeRspIeLength = p2pIeLength; |
| 6846 | |
| 6847 | sirDumpBuf( pMac, SIR_LIM_MODULE_ID, LOG2, |
| 6848 | pMac->p2pContext.probeRspIe, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6849 | pMac->p2pContext.probeRspIeLength ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6850 | vos_mem_copy((tANI_U8 *)pMac->p2pContext.probeRspIe, p2pIe, |
| 6851 | p2pIeLength); |
| 6852 | } |
| 6853 | |
| 6854 | //release the lock for the sme object |
| 6855 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6856 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6857 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6858 | smsLog(pMac, LOG2, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6859 | |
| 6860 | return(status); |
| 6861 | } |
| 6862 | #endif |
| 6863 | |
| 6864 | /* --------------------------------------------------------------------------- |
| 6865 | \fn sme_sendAction |
| 6866 | \brief API to send action frame from supplicant. |
| 6867 | \param hHal - The handle returned by macOpen. |
| 6868 | \return eHalStatus |
| 6869 | ---------------------------------------------------------------------------*/ |
| 6870 | |
| 6871 | eHalStatus sme_sendAction(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6872 | const tANI_U8 *pBuf, tANI_U32 len, |
| 6873 | tANI_U16 wait, tANI_BOOLEAN noack) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6874 | { |
| 6875 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6876 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6877 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6878 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6879 | TRACE_CODE_SME_RX_HDD_SEND_ACTION, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6880 | //acquire the lock for the sme object |
| 6881 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6882 | if(HAL_STATUS_SUCCESS(status)) |
| 6883 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6884 | p2pSendAction(hHal, sessionId, pBuf, len, wait, noack); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6885 | //release the lock for the sme object |
| 6886 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6887 | } |
| 6888 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6889 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6890 | |
| 6891 | return(status); |
| 6892 | } |
| 6893 | |
| 6894 | eHalStatus sme_CancelRemainOnChannel(tHalHandle hHal, tANI_U8 sessionId ) |
| 6895 | { |
| 6896 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6897 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6898 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6899 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6900 | TRACE_CODE_SME_RX_HDD_CANCEL_REMAIN_ONCHAN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6901 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6902 | { |
| 6903 | status = p2pCancelRemainOnChannel (hHal, sessionId); |
| 6904 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6905 | } |
| 6906 | return(status); |
| 6907 | } |
| 6908 | |
| 6909 | //Power Save Related |
| 6910 | eHalStatus sme_p2pSetPs(tHalHandle hHal, tP2pPsConfig * data) |
| 6911 | { |
| 6912 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6913 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6914 | |
| 6915 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6916 | { |
| 6917 | status = p2pSetPs (hHal, data); |
| 6918 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6919 | } |
| 6920 | return(status); |
| 6921 | } |
| 6922 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6923 | |
| 6924 | /* --------------------------------------------------------------------------- |
| 6925 | |
| 6926 | \fn sme_ConfigureRxpFilter |
| 6927 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6928 | \brief |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6929 | SME will pass this request to lower mac to set/reset the filter on RXP for |
| 6930 | multicast & broadcast traffic. |
| 6931 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6932 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6933 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6934 | hHal - The handle returned by macOpen. |
| 6935 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6936 | filterMask- Currently the API takes a 1 or 0 (set or reset) as filter. |
| 6937 | Basically to enable/disable the filter (to filter "all" mcbc traffic) based |
| 6938 | on this param. In future we can use this as a mask to set various types of |
| 6939 | filters as suggested below: |
| 6940 | FILTER_ALL_MULTICAST: |
| 6941 | FILTER_ALL_BROADCAST: |
| 6942 | FILTER_ALL_MULTICAST_BROADCAST: |
| 6943 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6944 | |
| 6945 | \return eHalStatus |
| 6946 | |
| 6947 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6948 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6949 | eHalStatus sme_ConfigureRxpFilter( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6950 | tpSirWlanSetRxpFilters wlanRxpFilterParam) |
| 6951 | { |
| 6952 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6953 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 6954 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6955 | vos_msg_t vosMessage; |
| 6956 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6957 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6958 | TRACE_CODE_SME_RX_HDD_CONFIG_RXPFIL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6959 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6960 | { |
| 6961 | /* serialize the req through MC thread */ |
| 6962 | vosMessage.bodyptr = wlanRxpFilterParam; |
| 6963 | vosMessage.type = WDA_CFG_RXP_FILTER_REQ; |
| 6964 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 6965 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 6966 | { |
| 6967 | status = eHAL_STATUS_FAILURE; |
| 6968 | } |
| 6969 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6970 | } |
| 6971 | return(status); |
| 6972 | } |
| 6973 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6974 | /* --------------------------------------------------------------------------- |
| 6975 | |
| 6976 | \fn sme_ConfigureSuspendInd |
| 6977 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6978 | \brief |
| 6979 | 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] | 6980 | be suspended |
| 6981 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6982 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6983 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6984 | hHal - The handle returned by macOpen. |
| 6985 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6986 | wlanSuspendParam- Depicts the wlan suspend params |
| 6987 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6988 | |
| 6989 | \return eHalStatus |
| 6990 | |
| 6991 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6992 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6993 | eHalStatus sme_ConfigureSuspendInd( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6994 | tpSirWlanSuspendParam wlanSuspendParam) |
| 6995 | { |
| 6996 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6997 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 6998 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6999 | vos_msg_t vosMessage; |
| 7000 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7001 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7002 | TRACE_CODE_SME_RX_HDD_CONFIG_SUSPENDIND, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7003 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7004 | { |
| 7005 | /* serialize the req through MC thread */ |
| 7006 | vosMessage.bodyptr = wlanSuspendParam; |
| 7007 | vosMessage.type = WDA_WLAN_SUSPEND_IND; |
| 7008 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 7009 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 7010 | { |
| 7011 | status = eHAL_STATUS_FAILURE; |
| 7012 | } |
| 7013 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7014 | } |
| 7015 | return(status); |
| 7016 | } |
| 7017 | |
| 7018 | /* --------------------------------------------------------------------------- |
| 7019 | |
| 7020 | \fn sme_ConfigureResumeReq |
| 7021 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7022 | \brief |
| 7023 | 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] | 7024 | be Resumed |
| 7025 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7026 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7027 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7028 | hHal - The handle returned by macOpen. |
| 7029 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7030 | wlanResumeParam- Depicts the wlan resume params |
| 7031 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7032 | |
| 7033 | \return eHalStatus |
| 7034 | |
| 7035 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7036 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7037 | eHalStatus sme_ConfigureResumeReq( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7038 | tpSirWlanResumeParam wlanResumeParam) |
| 7039 | { |
| 7040 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7041 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 7042 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7043 | vos_msg_t vosMessage; |
| 7044 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7045 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7046 | TRACE_CODE_SME_RX_HDD_CONFIG_RESUMEREQ, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7047 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7048 | { |
| 7049 | /* serialize the req through MC thread */ |
| 7050 | vosMessage.bodyptr = wlanResumeParam; |
| 7051 | vosMessage.type = WDA_WLAN_RESUME_REQ; |
| 7052 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 7053 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 7054 | { |
| 7055 | status = eHAL_STATUS_FAILURE; |
| 7056 | } |
| 7057 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7058 | } |
| 7059 | return(status); |
| 7060 | } |
| 7061 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7062 | /* --------------------------------------------------------------------------- |
| 7063 | |
| 7064 | \fn sme_GetInfraSessionId |
| 7065 | |
| 7066 | \brief To get the session ID for infra session, if connected |
| 7067 | This is a synchronous API. |
| 7068 | |
| 7069 | \param hHal - The handle returned by macOpen. |
| 7070 | |
| 7071 | \return sessionid, -1 if infra session is not connected |
| 7072 | |
| 7073 | -------------------------------------------------------------------------------*/ |
| 7074 | tANI_S8 sme_GetInfraSessionId(tHalHandle hHal) |
| 7075 | { |
| 7076 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7077 | tANI_S8 sessionid = -1; |
| 7078 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7079 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7080 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7081 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7082 | { |
| 7083 | |
| 7084 | sessionid = csrGetInfraSessionId( pMac); |
| 7085 | |
| 7086 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7087 | } |
| 7088 | |
| 7089 | return (sessionid); |
| 7090 | } |
| 7091 | |
| 7092 | /* --------------------------------------------------------------------------- |
| 7093 | |
| 7094 | \fn sme_GetInfraOperationChannel |
| 7095 | |
| 7096 | \brief To get the operating channel for infra session, if connected |
| 7097 | This is a synchronous API. |
| 7098 | |
| 7099 | \param hHal - The handle returned by macOpen. |
| 7100 | \param sessionId - the sessionId returned by sme_OpenSession. |
| 7101 | |
| 7102 | \return operating channel, 0 if infra session is not connected |
| 7103 | |
| 7104 | -------------------------------------------------------------------------------*/ |
| 7105 | tANI_U8 sme_GetInfraOperationChannel( tHalHandle hHal, tANI_U8 sessionId) |
| 7106 | { |
| 7107 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7108 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7109 | tANI_U8 channel = 0; |
| 7110 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7111 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7112 | { |
| 7113 | |
| 7114 | channel = csrGetInfraOperationChannel( pMac, sessionId); |
| 7115 | |
| 7116 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7117 | } |
| 7118 | |
| 7119 | return (channel); |
| 7120 | } |
| 7121 | |
| 7122 | //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] | 7123 | //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] | 7124 | tANI_U8 sme_GetConcurrentOperationChannel( tHalHandle hHal ) |
| 7125 | { |
| 7126 | eHalStatus status = eHAL_STATUS_FAILURE; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7127 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7128 | tANI_U8 channel = 0; |
| 7129 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7130 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7131 | { |
| 7132 | |
| 7133 | channel = csrGetConcurrentOperationChannel( pMac ); |
| 7134 | 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] | 7135 | " Other Concurrent Channel = %d", __func__,channel); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7136 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7137 | } |
| 7138 | |
| 7139 | return (channel); |
| 7140 | } |
| 7141 | |
| 7142 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 7143 | /****************************************************************************** |
| 7144 | * |
| 7145 | * Name: sme_PreferredNetworkFoundInd |
| 7146 | * |
| 7147 | * Description: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7148 | * Invoke Preferred Network Found Indication |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7149 | * |
| 7150 | * Parameters: |
| 7151 | * hHal - HAL handle for device |
| 7152 | * pMsg - found network description |
| 7153 | * |
| 7154 | * Returns: eHalStatus |
| 7155 | * |
| 7156 | ******************************************************************************/ |
| 7157 | eHalStatus sme_PreferredNetworkFoundInd (tHalHandle hHal, void* pMsg) |
| 7158 | { |
| 7159 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7160 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7161 | tSirPrefNetworkFoundInd *pPrefNetworkFoundInd = (tSirPrefNetworkFoundInd *)pMsg; |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7162 | v_U8_t dumpSsId[SIR_MAC_MAX_SSID_LENGTH + 1]; |
| 7163 | tANI_U8 ssIdLength = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7164 | |
| 7165 | if (NULL == pMsg) |
| 7166 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7167 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7168 | status = eHAL_STATUS_FAILURE; |
| 7169 | } |
| 7170 | else |
| 7171 | { |
| 7172 | if (pPrefNetworkFoundInd->ssId.length > 0) |
| 7173 | { |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7174 | ssIdLength = CSR_MIN(SIR_MAC_MAX_SSID_LENGTH, |
| 7175 | pPrefNetworkFoundInd->ssId.length); |
| 7176 | vos_mem_copy(dumpSsId, pPrefNetworkFoundInd->ssId.ssId, ssIdLength); |
| 7177 | dumpSsId[ssIdLength] = 0; |
Abhishek Singh | 195c03e | 2014-05-14 17:21:30 +0530 | [diff] [blame] | 7178 | smsLog(pMac, LOG1, FL(" SSID=%s frame length %d"), |
| 7179 | dumpSsId, pPrefNetworkFoundInd->frameLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7180 | |
Vinay Krishna Eranna | b13043b | 2013-12-06 11:50:21 +0530 | [diff] [blame] | 7181 | /* Flush scan results, So as to avoid indication/updation of |
| 7182 | * stale entries, which may not have aged out during APPS collapse |
| 7183 | */ |
| 7184 | sme_ScanFlushResult(hHal,0); |
| 7185 | |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7186 | //Save the frame to scan result |
| 7187 | if (pPrefNetworkFoundInd->mesgLen > sizeof(tSirPrefNetworkFoundInd)) |
| 7188 | { |
| 7189 | //we may have a frame |
| 7190 | status = csrScanSavePreferredNetworkFound(pMac, |
| 7191 | pPrefNetworkFoundInd); |
| 7192 | if (!HAL_STATUS_SUCCESS(status)) |
| 7193 | { |
| 7194 | smsLog(pMac, LOGE, FL(" fail to save preferred network")); |
| 7195 | } |
| 7196 | } |
| 7197 | else |
| 7198 | { |
Jeff Johnson | afeb958 | 2013-11-22 18:39:00 -0800 | [diff] [blame] | 7199 | smsLog(pMac, LOGE, FL(" not enough data length %u needed %zu"), |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7200 | pPrefNetworkFoundInd->mesgLen, sizeof(tSirPrefNetworkFoundInd)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7201 | } |
| 7202 | |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7203 | /* Call Preferred Netowrk Found Indication callback routine. */ |
| 7204 | if (HAL_STATUS_SUCCESS(status) && (pMac->pmc.prefNetwFoundCB != NULL)) |
| 7205 | { |
| 7206 | pMac->pmc.prefNetwFoundCB( |
| 7207 | pMac->pmc.preferredNetworkFoundIndCallbackContext, |
| 7208 | pPrefNetworkFoundInd); |
| 7209 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7210 | } |
| 7211 | else |
| 7212 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7213 | smsLog(pMac, LOGE, "%s: callback failed - SSID is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7214 | status = eHAL_STATUS_FAILURE; |
| 7215 | } |
| 7216 | } |
| 7217 | |
| 7218 | |
| 7219 | return(status); |
| 7220 | } |
| 7221 | |
| 7222 | #endif // FEATURE_WLAN_SCAN_PNO |
| 7223 | |
| 7224 | |
| 7225 | eHalStatus sme_GetCfgValidChannels(tHalHandle hHal, tANI_U8 *aValidChannels, tANI_U32 *len) |
| 7226 | { |
| 7227 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7228 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7229 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7230 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7231 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7232 | { |
| 7233 | status = csrGetCfgValidChannels(pMac, aValidChannels, len); |
| 7234 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7235 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7236 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7237 | return (status); |
| 7238 | } |
| 7239 | |
| 7240 | |
| 7241 | /* --------------------------------------------------------------------------- |
| 7242 | |
| 7243 | \fn sme_SetTxPerTracking |
| 7244 | |
| 7245 | \brief Set Tx PER tracking configuration parameters |
| 7246 | |
| 7247 | \param hHal - The handle returned by macOpen. |
| 7248 | \param pTxPerTrackingConf - Tx PER configuration parameters |
| 7249 | |
| 7250 | \return eHalStatus |
| 7251 | |
| 7252 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7253 | eHalStatus sme_SetTxPerTracking(tHalHandle hHal, |
| 7254 | void (*pCallbackfn) (void *pCallbackContext), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7255 | void *pCallbackContext, |
| 7256 | tpSirTxPerTrackingParam pTxPerTrackingParam) |
| 7257 | { |
| 7258 | vos_msg_t msg; |
| 7259 | tpSirTxPerTrackingParam pTxPerTrackingParamReq = NULL; |
| 7260 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7261 | |
| 7262 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 7263 | { |
| 7264 | pMac->sme.pTxPerHitCallback = pCallbackfn; |
| 7265 | pMac->sme.pTxPerHitCbContext = pCallbackContext; |
| 7266 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7267 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7268 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7269 | // free this memory in failure case or WDA request callback function |
| 7270 | pTxPerTrackingParamReq = vos_mem_malloc(sizeof(tSirTxPerTrackingParam)); |
| 7271 | if (NULL == pTxPerTrackingParamReq) |
| 7272 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7273 | 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] | 7274 | return eHAL_STATUS_FAILURE; |
| 7275 | } |
| 7276 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7277 | vos_mem_copy(pTxPerTrackingParamReq, (void*)pTxPerTrackingParam, |
| 7278 | sizeof(tSirTxPerTrackingParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7279 | msg.type = WDA_SET_TX_PER_TRACKING_REQ; |
| 7280 | msg.reserved = 0; |
| 7281 | msg.bodyptr = pTxPerTrackingParamReq; |
| 7282 | |
| 7283 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 7284 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7285 | 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] | 7286 | vos_mem_free(pTxPerTrackingParamReq); |
| 7287 | return eHAL_STATUS_FAILURE; |
| 7288 | } |
| 7289 | |
| 7290 | return eHAL_STATUS_SUCCESS; |
| 7291 | } |
| 7292 | |
| 7293 | /* --------------------------------------------------------------------------- |
| 7294 | |
| 7295 | \fn sme_HandleChangeCountryCode |
| 7296 | |
| 7297 | \brief Change Country code, Reg Domain and channel list |
| 7298 | |
| 7299 | \details Country Code Priority |
| 7300 | 0 = 11D > Configured Country > NV |
| 7301 | 1 = Configured Country > 11D > NV |
| 7302 | If Supplicant country code is priority than 11d is disabled. |
| 7303 | If 11D is enabled, we update the country code after every scan. |
| 7304 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 7305 | Country code from Supplicant is set as current courtry code. |
| 7306 | User can send reset command XX (instead of country code) to reset the |
| 7307 | country code to default values which is read from NV. |
| 7308 | In case of reset, 11D is enabled and default NV code is Set as current country code |
| 7309 | If 11D is priority, |
| 7310 | Than Supplicant country code code is set to default code. But 11D code is set as current country code |
| 7311 | |
| 7312 | \param pMac - The handle returned by macOpen. |
| 7313 | \param pMsgBuf - MSG Buffer |
| 7314 | |
| 7315 | \return eHalStatus |
| 7316 | |
| 7317 | -------------------------------------------------------------------------------*/ |
| 7318 | eHalStatus sme_HandleChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf) |
| 7319 | { |
| 7320 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7321 | tAniChangeCountryCodeReq *pMsg; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7322 | v_REGDOMAIN_t domainIdIoctl; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7323 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 7324 | static uNvTables nvTables; |
| 7325 | pMsg = (tAniChangeCountryCodeReq *)pMsgBuf; |
| 7326 | |
| 7327 | |
| 7328 | /* if the reset Supplicant country code command is triggered, enable 11D, reset the NV country code and return */ |
| 7329 | if( VOS_TRUE == vos_mem_compare(pMsg->countryCode, SME_INVALID_COUNTRY_CODE, 2) ) |
| 7330 | { |
| 7331 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 7332 | |
| 7333 | vosStatus = vos_nv_readDefaultCountryTable( &nvTables ); |
| 7334 | |
| 7335 | /* read the country code from NV and use it */ |
| 7336 | if ( VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 7337 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7338 | vos_mem_copy(pMsg->countryCode, |
| 7339 | nvTables.defaultCountryTable.countryCode, |
| 7340 | WNI_CFG_COUNTRY_CODE_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7341 | } |
| 7342 | else |
| 7343 | { |
| 7344 | status = eHAL_STATUS_FAILURE; |
| 7345 | return status; |
| 7346 | } |
| 7347 | } |
| 7348 | else |
| 7349 | { |
| 7350 | /* if Supplicant country code has priority, disable 11d */ |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 7351 | if(pMac->roam.configParam.fSupplicantCountryCodeHasPriority && |
| 7352 | pMsg->countryFromUserSpace) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7353 | { |
| 7354 | pMac->roam.configParam.Is11dSupportEnabled = eANI_BOOLEAN_FALSE; |
| 7355 | } |
| 7356 | } |
| 7357 | |
| 7358 | /* WEXT set country code means |
| 7359 | * 11D should be supported? |
| 7360 | * 11D Channel should be enforced? |
| 7361 | * 11D Country code should be matched? |
| 7362 | * 11D Reg Domian should be matched? |
| 7363 | * Country string changed */ |
| 7364 | if(pMac->roam.configParam.Is11dSupportEnabled && |
| 7365 | pMac->roam.configParam.fEnforce11dChannels && |
| 7366 | pMac->roam.configParam.fEnforceCountryCodeMatch && |
| 7367 | pMac->roam.configParam.fEnforceDefaultDomain && |
| 7368 | !csrSave11dCountryString(pMac, pMsg->countryCode, eANI_BOOLEAN_TRUE)) |
| 7369 | { |
| 7370 | /* All 11D related options are already enabled |
| 7371 | * Country string is not changed |
| 7372 | * Do not need do anything for country code change request */ |
| 7373 | return eHAL_STATUS_SUCCESS; |
| 7374 | } |
| 7375 | |
| 7376 | /* Set Current Country code and Current Regulatory domain */ |
| 7377 | status = csrSetCountryCode(pMac, pMsg->countryCode, NULL); |
| 7378 | if(eHAL_STATUS_SUCCESS != status) |
| 7379 | { |
| 7380 | /* Supplicant country code failed. So give 11D priority */ |
| 7381 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 7382 | smsLog(pMac, LOGE, "Set Country Code Fail %d", status); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7383 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7384 | } |
| 7385 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7386 | /* overwrite the defualt country code */ |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7387 | vos_mem_copy(pMac->scan.countryCodeDefault, |
| 7388 | pMac->scan.countryCodeCurrent, |
| 7389 | WNI_CFG_COUNTRY_CODE_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7390 | |
| 7391 | /* Get Domain ID from country code */ |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7392 | status = csrGetRegulatoryDomainForCountry(pMac, |
| 7393 | pMac->scan.countryCodeCurrent, |
| 7394 | (v_REGDOMAIN_t *) &domainIdIoctl, |
| 7395 | COUNTRY_QUERY); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7396 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7397 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7398 | smsLog( pMac, LOGE, FL(" fail to get regId %d"), domainIdIoctl ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7399 | return status; |
| 7400 | } |
Tushnim Bhattacharyya | 796ffe8 | 2013-11-05 16:31:36 -0800 | [diff] [blame] | 7401 | else if (REGDOMAIN_WORLD == domainIdIoctl) |
| 7402 | { |
| 7403 | /* Supplicant country code is invalid, so we are on world mode now. So |
| 7404 | give 11D chance to update */ |
| 7405 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 7406 | smsLog(pMac, LOG1, FL("Country Code unrecognized by driver")); |
| 7407 | } |
| 7408 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7409 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 7410 | status = WDA_SetRegDomain(pMac, domainIdIoctl, pMsg->sendRegHint); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7411 | |
| 7412 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7413 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7414 | smsLog( pMac, LOGE, FL(" fail to set regId %d"), domainIdIoctl ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7415 | return status; |
| 7416 | } |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7417 | else |
| 7418 | { |
| 7419 | //if 11d has priority, clear currentCountryBssid & countryCode11d to get |
| 7420 | //set again if we find AP with 11d info during scan |
| 7421 | if (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority) |
| 7422 | { |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7423 | smsLog( pMac, LOGW, FL("Clearing currentCountryBssid, countryCode11d")); |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7424 | vos_mem_zero(&pMac->scan.currentCountryBssid, sizeof(tCsrBssid)); |
| 7425 | vos_mem_zero( pMac->scan.countryCode11d, sizeof( pMac->scan.countryCode11d ) ); |
| 7426 | } |
| 7427 | } |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7428 | #ifndef CONFIG_ENABLE_LINUX_REG |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7429 | /* set to default domain ID */ |
| 7430 | pMac->scan.domainIdDefault = pMac->scan.domainIdCurrent; |
| 7431 | |
| 7432 | /* get the channels based on new cc */ |
| 7433 | status = csrInitGetChannels( pMac ); |
| 7434 | |
| 7435 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7436 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7437 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7438 | return status; |
| 7439 | } |
| 7440 | |
| 7441 | /* reset info based on new cc, and we are done */ |
Gopichand Nakkala | b9185f2 | 2012-12-21 08:03:42 -0800 | [diff] [blame] | 7442 | csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7443 | /* Country code Changed, Purge Only scan result |
| 7444 | * which does not have channel number belong to 11d |
| 7445 | * channel list |
| 7446 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 7447 | csrScanFilterResults(pMac); |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7448 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7449 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7450 | if( pMsg->changeCCCallback ) |
| 7451 | { |
| 7452 | ((tSmeChangeCountryCallback)(pMsg->changeCCCallback))((void *)pMsg->pDevContext); |
| 7453 | } |
| 7454 | |
| 7455 | return eHAL_STATUS_SUCCESS; |
| 7456 | } |
| 7457 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7458 | /* --------------------------------------------------------------------------- |
| 7459 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7460 | \fn sme_HandleChangeCountryCodeByUser |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7461 | |
| 7462 | \brief Change Country code, Reg Domain and channel list |
| 7463 | |
| 7464 | If Supplicant country code is priority than 11d is disabled. |
| 7465 | If 11D is enabled, we update the country code after every scan. |
| 7466 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 7467 | Country code from Supplicant is set as current country code. |
| 7468 | |
| 7469 | \param pMac - The handle returned by macOpen. |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7470 | \param pMsg - Carrying new CC & domain set in kernel by user |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7471 | |
| 7472 | \return eHalStatus |
| 7473 | |
| 7474 | -------------------------------------------------------------------------------*/ |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7475 | eHalStatus sme_HandleChangeCountryCodeByUser(tpAniSirGlobal pMac, |
| 7476 | tAniGenericChangeCountryCodeReq *pMsg) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7477 | { |
| 7478 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7479 | v_REGDOMAIN_t reg_domain_id; |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7480 | v_BOOL_t is11dCountry = VOS_FALSE; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7481 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7482 | smsLog(pMac, LOG1, FL(" called")); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7483 | reg_domain_id = (v_REGDOMAIN_t)pMsg->domain_index; |
| 7484 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7485 | if (memcmp(pMsg->countryCode, pMac->scan.countryCode11d, |
| 7486 | VOS_COUNTRY_CODE_LEN) == 0) |
| 7487 | { |
| 7488 | is11dCountry = VOS_TRUE; |
| 7489 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7490 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 7491 | /* Set the country code given by userspace when 11dOriginal is FALSE |
| 7492 | * when 11doriginal is True,is11dCountry =0 and |
| 7493 | * fSupplicantCountryCodeHasPriority = 0, then revert the country code, |
| 7494 | * and return failure |
| 7495 | */ |
| 7496 | if (pMac->roam.configParam.Is11dSupportEnabledOriginal == true) |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7497 | { |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 7498 | if ((!is11dCountry) && (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority)) |
| 7499 | { |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7500 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 7501 | smsLog( pMac, LOGW, FL(" incorrect country being set, nullify this request")); |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7502 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 7503 | status = csrGetRegulatoryDomainForCountry(pMac, |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7504 | pMac->scan.countryCode11d, |
| 7505 | (v_REGDOMAIN_t *) ®_domain_id, |
| 7506 | COUNTRY_IE); |
| 7507 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 7508 | return eHAL_STATUS_FAILURE; |
| 7509 | } |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7510 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7511 | /* if Supplicant country code has priority, disable 11d */ |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7512 | if (!is11dCountry && pMac->roam.configParam.fSupplicantCountryCodeHasPriority) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7513 | { |
| 7514 | pMac->roam.configParam.Is11dSupportEnabled = eANI_BOOLEAN_FALSE; |
| 7515 | } |
| 7516 | |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7517 | vos_mem_copy(pMac->scan.countryCodeCurrent, pMsg->countryCode, |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7518 | WNI_CFG_COUNTRY_CODE_LEN); |
| 7519 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 7520 | status = WDA_SetRegDomain(pMac, reg_domain_id, eSIR_TRUE); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7521 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7522 | if (VOS_FALSE == is11dCountry ) |
| 7523 | { |
| 7524 | /* overwrite the defualt country code */ |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7525 | vos_mem_copy(pMac->scan.countryCodeDefault, |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7526 | pMac->scan.countryCodeCurrent, WNI_CFG_COUNTRY_CODE_LEN); |
| 7527 | /* set to default domain ID */ |
| 7528 | pMac->scan.domainIdDefault = pMac->scan.domainIdCurrent; |
| 7529 | } |
| 7530 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7531 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7532 | { |
| 7533 | smsLog( pMac, LOGE, FL(" fail to set regId %d"), reg_domain_id ); |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7534 | return status; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7535 | } |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7536 | else |
| 7537 | { |
| 7538 | //if 11d has priority, clear currentCountryBssid & countryCode11d to get |
| 7539 | //set again if we find AP with 11d info during scan |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7540 | if((!pMac->roam.configParam.fSupplicantCountryCodeHasPriority) && |
| 7541 | (VOS_FALSE == is11dCountry )) |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7542 | { |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7543 | smsLog( pMac, LOGW, FL("Clearing currentCountryBssid, countryCode11d")); |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7544 | vos_mem_zero(&pMac->scan.currentCountryBssid, sizeof(tCsrBssid)); |
| 7545 | vos_mem_zero( pMac->scan.countryCode11d, sizeof( pMac->scan.countryCode11d ) ); |
| 7546 | } |
| 7547 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7548 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7549 | /* get the channels based on new cc */ |
| 7550 | status = csrInitGetChannels(pMac); |
| 7551 | |
| 7552 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7553 | { |
| 7554 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
| 7555 | return status; |
| 7556 | } |
| 7557 | |
| 7558 | /* reset info based on new cc, and we are done */ |
| 7559 | csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7560 | if (VOS_TRUE == is11dCountry) |
| 7561 | { |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7562 | pMac->scan.f11dInfoApplied = eANI_BOOLEAN_TRUE; |
| 7563 | pMac->scan.f11dInfoReset = eANI_BOOLEAN_FALSE; |
| 7564 | } |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7565 | /* Country code Changed, Purge Only scan result |
| 7566 | * which does not have channel number belong to 11d |
| 7567 | * channel list |
| 7568 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 7569 | csrScanFilterResults(pMac); |
Kiet Lam | bd5cd9b | 2013-11-11 19:01:45 +0530 | [diff] [blame] | 7570 | // Do active scans after the country is set by User hints or Country IE |
| 7571 | pMac->scan.curScanType = eSIR_ACTIVE_SCAN; |
| 7572 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7573 | smsLog(pMac, LOG1, FL(" returned")); |
| 7574 | return eHAL_STATUS_SUCCESS; |
| 7575 | } |
| 7576 | |
| 7577 | /* --------------------------------------------------------------------------- |
| 7578 | |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7579 | \fn sme_HandleChangeCountryCodeByCore |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7580 | |
| 7581 | \brief Update Country code in the driver if set by kernel as world |
| 7582 | |
| 7583 | If 11D is enabled, we update the country code after every scan & notify kernel. |
| 7584 | This is to make sure kernel & driver are in sync in case of CC found in |
| 7585 | driver but not in kernel database |
| 7586 | |
| 7587 | \param pMac - The handle returned by macOpen. |
| 7588 | \param pMsg - Carrying new CC set in kernel |
| 7589 | |
| 7590 | \return eHalStatus |
| 7591 | |
| 7592 | -------------------------------------------------------------------------------*/ |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7593 | eHalStatus sme_HandleChangeCountryCodeByCore(tpAniSirGlobal pMac, tAniGenericChangeCountryCodeReq *pMsg) |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7594 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7595 | eHalStatus status; |
| 7596 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7597 | smsLog(pMac, LOG1, FL(" called")); |
| 7598 | |
| 7599 | //this is to make sure kernel & driver are in sync in case of CC found in |
| 7600 | //driver but not in kernel database |
| 7601 | if (('0' == pMsg->countryCode[0]) && ('0' == pMsg->countryCode[1])) |
| 7602 | { |
Tushnim Bhattacharyya | 582ac1d | 2013-11-07 23:44:09 -0800 | [diff] [blame] | 7603 | smsLog( pMac, LOGW, FL("Setting countryCode11d & countryCodeCurrent to world CC")); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7604 | vos_mem_copy(pMac->scan.countryCode11d, pMsg->countryCode, |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7605 | WNI_CFG_COUNTRY_CODE_LEN); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7606 | vos_mem_copy(pMac->scan.countryCodeCurrent, pMsg->countryCode, |
Tushnim Bhattacharyya | 582ac1d | 2013-11-07 23:44:09 -0800 | [diff] [blame] | 7607 | WNI_CFG_COUNTRY_CODE_LEN); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7608 | } |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7609 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 7610 | status = WDA_SetRegDomain(pMac, REGDOMAIN_WORLD, eSIR_TRUE); |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7611 | |
| 7612 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7613 | { |
| 7614 | smsLog( pMac, LOGE, FL(" fail to set regId") ); |
| 7615 | return status; |
| 7616 | } |
| 7617 | else |
| 7618 | { |
| 7619 | status = csrInitGetChannels(pMac); |
| 7620 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7621 | { |
| 7622 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
| 7623 | } |
| 7624 | else |
| 7625 | { |
| 7626 | csrInitChannelList(pMac); |
| 7627 | } |
| 7628 | } |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7629 | /* Country code Changed, Purge Only scan result |
| 7630 | * which does not have channel number belong to 11d |
| 7631 | * channel list |
| 7632 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 7633 | csrScanFilterResults(pMac); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7634 | smsLog(pMac, LOG1, FL(" returned")); |
| 7635 | return eHAL_STATUS_SUCCESS; |
| 7636 | } |
| 7637 | |
| 7638 | /* --------------------------------------------------------------------------- |
| 7639 | |
| 7640 | \fn sme_HandleGenericChangeCountryCode |
| 7641 | |
| 7642 | \brief Change Country code, Reg Domain and channel list |
| 7643 | |
| 7644 | If Supplicant country code is priority than 11d is disabled. |
| 7645 | If 11D is enabled, we update the country code after every scan. |
| 7646 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 7647 | Country code from kernel is set as current country code. |
| 7648 | |
| 7649 | \param pMac - The handle returned by macOpen. |
| 7650 | \param pMsgBuf - message buffer |
| 7651 | |
| 7652 | \return eHalStatus |
| 7653 | |
| 7654 | -------------------------------------------------------------------------------*/ |
| 7655 | eHalStatus sme_HandleGenericChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf) |
| 7656 | { |
| 7657 | tAniGenericChangeCountryCodeReq *pMsg; |
| 7658 | v_REGDOMAIN_t reg_domain_id; |
| 7659 | |
| 7660 | smsLog(pMac, LOG1, FL(" called")); |
| 7661 | pMsg = (tAniGenericChangeCountryCodeReq *)pMsgBuf; |
| 7662 | reg_domain_id = (v_REGDOMAIN_t)pMsg->domain_index; |
| 7663 | |
| 7664 | if (REGDOMAIN_COUNT == reg_domain_id) |
| 7665 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7666 | sme_HandleChangeCountryCodeByCore(pMac, pMsg); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7667 | } |
| 7668 | else |
| 7669 | { |
| 7670 | sme_HandleChangeCountryCodeByUser(pMac, pMsg); |
| 7671 | } |
| 7672 | smsLog(pMac, LOG1, FL(" returned")); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7673 | return eHAL_STATUS_SUCCESS; |
| 7674 | } |
| 7675 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7676 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 7677 | eHalStatus sme_8023MulticastList (tHalHandle hHal, tANI_U8 sessionId, tpSirRcvFltMcAddrList pMulticastAddrs) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7678 | { |
| 7679 | tpSirRcvFltMcAddrList pRequestBuf; |
| 7680 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7681 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7682 | tCsrRoamSession *pSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7683 | |
| 7684 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: " |
Gopichand Nakkala | 66c0bd0 | 2013-04-10 11:36:29 +0530 | [diff] [blame] | 7685 | "ulMulticastAddrCnt=%d, multicastAddr[0]=%p", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7686 | pMulticastAddrs->ulMulticastAddrCnt, |
| 7687 | pMulticastAddrs->multicastAddr[0]); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7688 | |
| 7689 | /* |
| 7690 | *Find the connected Infra / P2P_client connected session |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 7691 | */ |
| 7692 | if (CSR_IS_SESSION_VALID(pMac, sessionId) && |
| 7693 | csrIsConnStateInfra(pMac, sessionId)) |
| 7694 | { |
| 7695 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 7696 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7697 | |
| 7698 | if(pSession == NULL ) |
| 7699 | { |
| 7700 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Unable to find " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7701 | "the right session", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7702 | return eHAL_STATUS_FAILURE; |
| 7703 | } |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 7704 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7705 | pRequestBuf = vos_mem_malloc(sizeof(tSirRcvFltMcAddrList)); |
| 7706 | if (NULL == pRequestBuf) |
| 7707 | { |
| 7708 | 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] | 7709 | "allocate memory for 8023 Multicast List request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7710 | return eHAL_STATUS_FAILED_ALLOC; |
| 7711 | } |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 7712 | |
| 7713 | if( !csrIsConnStateConnectedInfra (pMac, sessionId )) |
| 7714 | { |
| 7715 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Ignoring the " |
| 7716 | "indication as we are not connected", __func__); |
| 7717 | vos_mem_free(pRequestBuf); |
| 7718 | return eHAL_STATUS_FAILURE; |
| 7719 | } |
| 7720 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7721 | vos_mem_copy(pRequestBuf, pMulticastAddrs, sizeof(tSirRcvFltMcAddrList)); |
| 7722 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7723 | vos_mem_copy(pRequestBuf->selfMacAddr, pSession->selfMacAddr, |
| 7724 | sizeof(tSirMacAddr)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7725 | vos_mem_copy(pRequestBuf->bssId, pSession->connectedProfile.bssid, |
| 7726 | sizeof(tSirMacAddr)); |
| 7727 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7728 | msg.type = WDA_8023_MULTICAST_LIST_REQ; |
| 7729 | msg.reserved = 0; |
| 7730 | msg.bodyptr = pRequestBuf; |
| 7731 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 7732 | { |
| 7733 | 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] | 7734 | "post WDA_8023_MULTICAST_LIST message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7735 | vos_mem_free(pRequestBuf); |
| 7736 | return eHAL_STATUS_FAILURE; |
| 7737 | } |
| 7738 | |
| 7739 | return eHAL_STATUS_SUCCESS; |
| 7740 | } |
| 7741 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7742 | eHalStatus sme_ReceiveFilterSetFilter(tHalHandle hHal, tpSirRcvPktFilterCfgType pRcvPktFilterCfg, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7743 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7744 | { |
| 7745 | tpSirRcvPktFilterCfgType pRequestBuf; |
| 7746 | v_SINT_t allocSize; |
| 7747 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7748 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7749 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7750 | v_U8_t idx=0; |
| 7751 | |
| 7752 | 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] | 7753 | "filterId = %d", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7754 | pRcvPktFilterCfg->filterType, pRcvPktFilterCfg->filterId); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7755 | |
Madan Mohan Koyyalamudi | d402962 | 2012-10-18 20:30:17 -0700 | [diff] [blame] | 7756 | allocSize = sizeof(tSirRcvPktFilterCfgType); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7757 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7758 | pRequestBuf = vos_mem_malloc(allocSize); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7759 | |
| 7760 | if (NULL == pRequestBuf) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7761 | { |
| 7762 | 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] | 7763 | "allocate memory for Receive Filter Set Filter request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7764 | return eHAL_STATUS_FAILED_ALLOC; |
| 7765 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7766 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7767 | if( NULL == pSession ) |
| 7768 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7769 | 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] | 7770 | vos_mem_free(pRequestBuf); |
| 7771 | return eHAL_STATUS_FAILURE; |
| 7772 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7773 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7774 | vos_mem_copy(pRcvPktFilterCfg->selfMacAddr, pSession->selfMacAddr, |
| 7775 | sizeof(tSirMacAddr)); |
| 7776 | vos_mem_copy(pRcvPktFilterCfg->bssId, pSession->connectedProfile.bssid, |
| 7777 | sizeof(tSirMacAddr)); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7778 | vos_mem_copy(pRequestBuf, pRcvPktFilterCfg, allocSize); |
| 7779 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7780 | msg.type = WDA_RECEIVE_FILTER_SET_FILTER_REQ; |
| 7781 | msg.reserved = 0; |
| 7782 | msg.bodyptr = pRequestBuf; |
| 7783 | |
| 7784 | 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] | 7785 | "FT %d FID %d ", |
| 7786 | pRequestBuf->filterType, pRequestBuf->filterId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7787 | |
| 7788 | 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] | 7789 | "params %d CT %d", |
| 7790 | pRequestBuf->numFieldParams, pRequestBuf->coalesceTime); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7791 | |
| 7792 | for (idx=0; idx<pRequestBuf->numFieldParams; idx++) |
| 7793 | { |
| 7794 | |
| 7795 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7796 | "Proto %d Comp Flag %d ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7797 | pRequestBuf->paramsData[idx].protocolLayer, |
| 7798 | pRequestBuf->paramsData[idx].cmpFlag); |
| 7799 | |
| 7800 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7801 | "Data Offset %d Data Len %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7802 | pRequestBuf->paramsData[idx].dataOffset, |
| 7803 | pRequestBuf->paramsData[idx].dataLength); |
| 7804 | |
| 7805 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7806 | "CData: %d:%d:%d:%d:%d:%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7807 | pRequestBuf->paramsData[idx].compareData[0], |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7808 | pRequestBuf->paramsData[idx].compareData[1], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7809 | pRequestBuf->paramsData[idx].compareData[2], |
| 7810 | pRequestBuf->paramsData[idx].compareData[3], |
| 7811 | pRequestBuf->paramsData[idx].compareData[4], |
| 7812 | pRequestBuf->paramsData[idx].compareData[5]); |
| 7813 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7814 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7815 | "MData: %d:%d:%d:%d:%d:%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7816 | pRequestBuf->paramsData[idx].dataMask[0], |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7817 | pRequestBuf->paramsData[idx].dataMask[1], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7818 | pRequestBuf->paramsData[idx].dataMask[2], |
| 7819 | pRequestBuf->paramsData[idx].dataMask[3], |
| 7820 | pRequestBuf->paramsData[idx].dataMask[4], |
| 7821 | pRequestBuf->paramsData[idx].dataMask[5]); |
| 7822 | |
| 7823 | } |
| 7824 | |
| 7825 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 7826 | { |
| 7827 | 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] | 7828 | "WDA_RECEIVE_FILTER_SET_FILTER message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7829 | vos_mem_free(pRequestBuf); |
| 7830 | return eHAL_STATUS_FAILURE; |
| 7831 | } |
| 7832 | |
| 7833 | return eHAL_STATUS_SUCCESS; |
| 7834 | } |
| 7835 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7836 | eHalStatus sme_GetFilterMatchCount(tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7837 | FilterMatchCountCallback callbackRoutine, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7838 | void *callbackContext, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7839 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7840 | { |
| 7841 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7842 | eHalStatus status; |
| 7843 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7844 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "+%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7845 | |
| 7846 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme))) |
| 7847 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7848 | pmcGetFilterMatchCount(hHal, callbackRoutine, callbackContext, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7849 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7850 | } |
| 7851 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7852 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "-%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7853 | |
| 7854 | return (status); |
| 7855 | } |
| 7856 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7857 | eHalStatus sme_ReceiveFilterClearFilter(tHalHandle hHal, tpSirRcvFltPktClearParam pRcvFltPktClearParam, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7858 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7859 | { |
| 7860 | tpSirRcvFltPktClearParam pRequestBuf; |
| 7861 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7862 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7863 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7864 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7865 | 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] | 7866 | pRcvFltPktClearParam->filterId); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7867 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7868 | pRequestBuf = vos_mem_malloc(sizeof(tSirRcvFltPktClearParam)); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7869 | if (NULL == pRequestBuf) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7870 | { |
| 7871 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 7872 | "%s: Not able to allocate memory for Receive Filter " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7873 | "Clear Filter request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7874 | return eHAL_STATUS_FAILED_ALLOC; |
| 7875 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7876 | if( NULL == pSession ) |
| 7877 | { |
| 7878 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7879 | "%s: Session Not find ", __func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7880 | vos_mem_free(pRequestBuf); |
| 7881 | return eHAL_STATUS_FAILURE; |
| 7882 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7883 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7884 | vos_mem_copy(pRcvFltPktClearParam->selfMacAddr, pSession->selfMacAddr, |
| 7885 | sizeof(tSirMacAddr)); |
| 7886 | vos_mem_copy(pRcvFltPktClearParam->bssId, pSession->connectedProfile.bssid, |
| 7887 | sizeof(tSirMacAddr)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7888 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7889 | vos_mem_copy(pRequestBuf, pRcvFltPktClearParam, sizeof(tSirRcvFltPktClearParam)); |
| 7890 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7891 | msg.type = WDA_RECEIVE_FILTER_CLEAR_FILTER_REQ; |
| 7892 | msg.reserved = 0; |
| 7893 | msg.bodyptr = pRequestBuf; |
| 7894 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 7895 | { |
| 7896 | 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] | 7897 | "WDA_RECEIVE_FILTER_CLEAR_FILTER message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7898 | vos_mem_free(pRequestBuf); |
| 7899 | return eHAL_STATUS_FAILURE; |
| 7900 | } |
| 7901 | |
| 7902 | return eHAL_STATUS_SUCCESS; |
| 7903 | } |
| 7904 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 7905 | |
| 7906 | /* --------------------------------------------------------------------------- |
| 7907 | \fn sme_PreChannelSwitchIndFullPowerCB |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7908 | \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] | 7909 | channel switch. |
| 7910 | \param callbackContext |
| 7911 | \param status |
| 7912 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7913 | void sme_PreChannelSwitchIndFullPowerCB(void *callbackContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7914 | eHalStatus status) |
| 7915 | { |
| 7916 | tpAniSirGlobal pMac = (tpAniSirGlobal)callbackContext; |
| 7917 | tSirMbMsg *pMsg; |
| 7918 | tANI_U16 msgLen; |
| 7919 | |
| 7920 | msgLen = (tANI_U16)(sizeof( tSirMbMsg )); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7921 | pMsg = vos_mem_malloc(msgLen); |
| 7922 | if ( NULL != pMsg ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7923 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7924 | vos_mem_set(pMsg, msgLen, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7925 | pMsg->type = pal_cpu_to_be16((tANI_U16)eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER); |
| 7926 | pMsg->msgLen = pal_cpu_to_be16(msgLen); |
| 7927 | status = palSendMBMessage(pMac->hHdd, pMsg); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7928 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7929 | |
| 7930 | return; |
| 7931 | } |
| 7932 | |
| 7933 | /* --------------------------------------------------------------------------- |
| 7934 | \fn sme_HandlePreChannelSwitchInd |
| 7935 | \brief Processes the indcation from PE for pre-channel switch. |
| 7936 | \param hHal |
| 7937 | \- The handle returned by macOpen. return eHalStatus |
| 7938 | ---------------------------------------------------------------------------*/ |
| 7939 | eHalStatus sme_HandlePreChannelSwitchInd(tHalHandle hHal) |
| 7940 | { |
| 7941 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7942 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7943 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7944 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7945 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7946 | status = pmcRequestFullPower(hHal, sme_PreChannelSwitchIndFullPowerCB, |
| 7947 | pMac, eSME_FULL_PWR_NEEDED_BY_CHANNEL_SWITCH); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7948 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7949 | } |
| 7950 | |
| 7951 | return (status); |
| 7952 | } |
| 7953 | |
| 7954 | /* --------------------------------------------------------------------------- |
| 7955 | \fn sme_HandlePostChannelSwitchInd |
| 7956 | \brief Processes the indcation from PE for post-channel switch. |
| 7957 | \param hHal |
| 7958 | \- The handle returned by macOpen. return eHalStatus |
| 7959 | ---------------------------------------------------------------------------*/ |
| 7960 | eHalStatus sme_HandlePostChannelSwitchInd(tHalHandle hHal) |
| 7961 | { |
| 7962 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7963 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7964 | |
| 7965 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7966 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7967 | { |
| 7968 | status = pmcRequestBmps(hHal, NULL, NULL); |
| 7969 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7970 | } |
| 7971 | |
| 7972 | return (status); |
| 7973 | } |
| 7974 | |
| 7975 | /* --------------------------------------------------------------------------- |
| 7976 | |
| 7977 | \fn sme_IsChannelValid |
| 7978 | |
| 7979 | \brief To check if the channel is valid for currently established domain |
| 7980 | This is a synchronous API. |
| 7981 | |
| 7982 | \param hHal - The handle returned by macOpen. |
| 7983 | \param channel - channel to verify |
| 7984 | |
| 7985 | \return TRUE/FALSE, TRUE if channel is valid |
| 7986 | |
| 7987 | -------------------------------------------------------------------------------*/ |
| 7988 | tANI_BOOLEAN sme_IsChannelValid(tHalHandle hHal, tANI_U8 channel) |
| 7989 | { |
| 7990 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7991 | tANI_BOOLEAN valid = FALSE; |
| 7992 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7993 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7994 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7995 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7996 | { |
| 7997 | |
| 7998 | valid = csrRoamIsChannelValid( pMac, channel); |
| 7999 | |
| 8000 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8001 | } |
| 8002 | |
| 8003 | return (valid); |
| 8004 | } |
| 8005 | |
| 8006 | /* --------------------------------------------------------------------------- |
| 8007 | \fn sme_SetFreqBand |
| 8008 | \brief Used to set frequency band. |
| 8009 | \param hHal |
| 8010 | \eBand band value to be configured |
| 8011 | \- return eHalStatus |
| 8012 | -------------------------------------------------------------------------*/ |
| 8013 | eHalStatus sme_SetFreqBand(tHalHandle hHal, eCsrBand eBand) |
| 8014 | { |
| 8015 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8016 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8017 | |
| 8018 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8019 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8020 | { |
| 8021 | status = csrSetBand(hHal, eBand); |
| 8022 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8023 | } |
| 8024 | return status; |
| 8025 | } |
| 8026 | |
| 8027 | /* --------------------------------------------------------------------------- |
| 8028 | \fn sme_GetFreqBand |
| 8029 | \brief Used to get the current band settings. |
| 8030 | \param hHal |
| 8031 | \pBand pointer to hold band value |
| 8032 | \- return eHalStatus |
| 8033 | -------------------------------------------------------------------------*/ |
| 8034 | eHalStatus sme_GetFreqBand(tHalHandle hHal, eCsrBand *pBand) |
| 8035 | { |
| 8036 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8037 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8038 | |
| 8039 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8040 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8041 | { |
| 8042 | *pBand = csrGetCurrentBand( hHal ); |
| 8043 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8044 | } |
| 8045 | return status; |
| 8046 | } |
| 8047 | |
| 8048 | #ifdef WLAN_WAKEUP_EVENTS |
| 8049 | /****************************************************************************** |
| 8050 | \fn sme_WakeReasonIndCallback |
| 8051 | |
| 8052 | \brief |
| 8053 | a callback function called when SME received eWNI_SME_WAKE_REASON_IND event from WDA |
| 8054 | |
| 8055 | \param hHal - HAL handle for device |
| 8056 | \param pMsg - Message body passed from WDA; includes Wake Reason Indication parameter |
| 8057 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8058 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8059 | ******************************************************************************/ |
| 8060 | eHalStatus sme_WakeReasonIndCallback (tHalHandle hHal, void* pMsg) |
| 8061 | { |
| 8062 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8063 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8064 | tSirWakeReasonInd *pWakeReasonInd = (tSirWakeReasonInd *)pMsg; |
| 8065 | |
| 8066 | if (NULL == pMsg) |
| 8067 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8068 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8069 | status = eHAL_STATUS_FAILURE; |
| 8070 | } |
| 8071 | else |
| 8072 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8073 | smsLog(pMac, LOG2, "SME: entering sme_WakeReasonIndCallback"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8074 | |
| 8075 | /* Call Wake Reason Indication callback routine. */ |
| 8076 | if (pMac->pmc.wakeReasonIndCB != NULL) |
| 8077 | pMac->pmc.wakeReasonIndCB(pMac->pmc.wakeReasonIndCBContext, pWakeReasonInd); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8078 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8079 | pMac->pmc.wakeReasonIndCB = NULL; |
| 8080 | pMac->pmc.wakeReasonIndCBContext = NULL; |
| 8081 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8082 | 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] | 8083 | } |
| 8084 | |
| 8085 | return(status); |
| 8086 | } |
| 8087 | #endif // WLAN_WAKEUP_EVENTS |
| 8088 | |
| 8089 | |
| 8090 | /* --------------------------------------------------------------------------- |
| 8091 | |
| 8092 | \fn sme_SetMaxTxPower |
| 8093 | |
| 8094 | \brief Set the Maximum Transmit Power dynamically. Note: this setting will |
| 8095 | not persist over reboots. |
| 8096 | |
| 8097 | \param hHal |
| 8098 | \param pBssid BSSID to set the power cap for |
| 8099 | \param pBssid pSelfMacAddress self MAC Address |
| 8100 | \param pBssid power to set in dB |
| 8101 | \- return eHalStatus |
| 8102 | |
| 8103 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8104 | eHalStatus sme_SetMaxTxPower(tHalHandle hHal, tSirMacAddr pBssid, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8105 | tSirMacAddr pSelfMacAddress, v_S7_t dB) |
| 8106 | { |
| 8107 | vos_msg_t msg; |
| 8108 | tpMaxTxPowerParams pMaxTxParams = NULL; |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8109 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8110 | TRACE_CODE_SME_RX_HDD_SET_MAXTXPOW, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8111 | pMaxTxParams = vos_mem_malloc(sizeof(tMaxTxPowerParams)); |
| 8112 | if (NULL == pMaxTxParams) |
| 8113 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8114 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to allocate memory for pMaxTxParams", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8115 | return eHAL_STATUS_FAILURE; |
| 8116 | } |
| 8117 | |
| 8118 | vos_mem_copy(pMaxTxParams->bssId, pBssid, SIR_MAC_ADDR_LENGTH); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8119 | vos_mem_copy(pMaxTxParams->selfStaMacAddr, pSelfMacAddress, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8120 | SIR_MAC_ADDR_LENGTH); |
| 8121 | pMaxTxParams->power = dB; |
| 8122 | |
| 8123 | msg.type = WDA_SET_MAX_TX_POWER_REQ; |
| 8124 | msg.reserved = 0; |
| 8125 | msg.bodyptr = pMaxTxParams; |
| 8126 | |
| 8127 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8128 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8129 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to post WDA_SET_MAX_TX_POWER_REQ message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8130 | vos_mem_free(pMaxTxParams); |
| 8131 | return eHAL_STATUS_FAILURE; |
| 8132 | } |
| 8133 | |
| 8134 | return eHAL_STATUS_SUCCESS; |
| 8135 | } |
| 8136 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8137 | /* --------------------------------------------------------------------------- |
| 8138 | |
Arif Hussain | a5ebce0 | 2013-08-09 15:09:58 -0700 | [diff] [blame] | 8139 | \fn sme_SetMaxTxPowerPerBand |
| 8140 | |
| 8141 | \brief Set the Maximum Transmit Power specific to band dynamically. |
| 8142 | Note: this setting will not persist over reboots. |
| 8143 | |
| 8144 | \param band |
| 8145 | \param power to set in dB |
| 8146 | \- return eHalStatus |
| 8147 | |
| 8148 | ----------------------------------------------------------------------------*/ |
| 8149 | eHalStatus sme_SetMaxTxPowerPerBand(eCsrBand band, v_S7_t dB) |
| 8150 | { |
| 8151 | vos_msg_t msg; |
| 8152 | tpMaxTxPowerPerBandParams pMaxTxPowerPerBandParams = NULL; |
| 8153 | |
| 8154 | pMaxTxPowerPerBandParams = vos_mem_malloc(sizeof(tMaxTxPowerPerBandParams)); |
| 8155 | if (NULL == pMaxTxPowerPerBandParams) |
| 8156 | { |
| 8157 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8158 | "%s:Not able to allocate memory for pMaxTxPowerPerBandParams", |
| 8159 | __func__); |
| 8160 | return eHAL_STATUS_FAILURE; |
| 8161 | } |
| 8162 | |
| 8163 | pMaxTxPowerPerBandParams->power = dB; |
| 8164 | pMaxTxPowerPerBandParams->bandInfo = band; |
| 8165 | |
| 8166 | msg.type = WDA_SET_MAX_TX_POWER_PER_BAND_REQ; |
| 8167 | msg.reserved = 0; |
| 8168 | msg.bodyptr = pMaxTxPowerPerBandParams; |
| 8169 | |
| 8170 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8171 | { |
| 8172 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8173 | "%s:Not able to post WDA_SET_MAX_TX_POWER_PER_BAND_REQ", |
| 8174 | __func__); |
| 8175 | vos_mem_free(pMaxTxPowerPerBandParams); |
| 8176 | return eHAL_STATUS_FAILURE; |
| 8177 | } |
| 8178 | |
| 8179 | return eHAL_STATUS_SUCCESS; |
| 8180 | } |
| 8181 | |
| 8182 | /* --------------------------------------------------------------------------- |
| 8183 | |
schang | 86c22c4 | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 8184 | \fn sme_SetTxPower |
| 8185 | |
| 8186 | \brief Set Transmit Power dynamically. Note: this setting will |
| 8187 | not persist over reboots. |
| 8188 | |
| 8189 | \param hHal |
| 8190 | \param sessionId Target Session ID |
| 8191 | \param mW power to set in mW |
| 8192 | \- return eHalStatus |
| 8193 | |
| 8194 | -------------------------------------------------------------------------------*/ |
| 8195 | eHalStatus sme_SetTxPower(tHalHandle hHal, v_U8_t sessionId, v_U8_t mW) |
| 8196 | { |
| 8197 | |
| 8198 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8199 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8200 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8201 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8202 | TRACE_CODE_SME_RX_HDD_SET_TXPOW, NO_SESSION, 0)); |
schang | 86c22c4 | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 8203 | smsLog(pMac, LOG1, FL("set tx power %dmW"), mW); |
| 8204 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 8205 | if (HAL_STATUS_SUCCESS(status)) |
| 8206 | { |
| 8207 | status = csrSetTxPower(pMac, sessionId, mW); |
| 8208 | sme_ReleaseGlobalLock(&pMac->sme); |
| 8209 | } |
| 8210 | return status; |
| 8211 | } |
| 8212 | |
| 8213 | /* --------------------------------------------------------------------------- |
| 8214 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8215 | \fn sme_HideSSID |
| 8216 | |
| 8217 | \brief hide/show SSID dynamically. Note: this setting will |
| 8218 | not persist over reboots. |
| 8219 | |
| 8220 | \param hHal |
| 8221 | \param sessionId |
| 8222 | \param ssidHidden 0 - Broadcast SSID, 1 - Disable broadcast SSID |
| 8223 | \- return eHalStatus |
| 8224 | |
| 8225 | -------------------------------------------------------------------------------*/ |
| 8226 | eHalStatus sme_HideSSID(tHalHandle hHal, v_U8_t sessionId, v_U8_t ssidHidden) |
| 8227 | { |
| 8228 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8229 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8230 | tANI_U16 len; |
| 8231 | |
| 8232 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8233 | { |
| 8234 | tpSirUpdateParams pMsg; |
| 8235 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 8236 | |
| 8237 | if(!pSession) |
| 8238 | { |
| 8239 | 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] | 8240 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 8241 | return eHAL_STATUS_FAILURE; |
| 8242 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8243 | |
| 8244 | if( !pSession->sessionActive ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8245 | VOS_ASSERT(0); |
| 8246 | |
| 8247 | /* Create the message and send to lim */ |
| 8248 | len = sizeof(tSirUpdateParams); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8249 | pMsg = vos_mem_malloc(len); |
| 8250 | if ( NULL == pMsg ) |
| 8251 | status = eHAL_STATUS_FAILURE; |
| 8252 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8253 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8254 | vos_mem_set(pMsg, sizeof(tSirUpdateParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8255 | pMsg->messageType = eWNI_SME_HIDE_SSID_REQ; |
| 8256 | pMsg->length = len; |
| 8257 | /* Data starts from here */ |
| 8258 | pMsg->sessionId = sessionId; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8259 | pMsg->ssidHidden = ssidHidden; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8260 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 8261 | } |
| 8262 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8263 | } |
| 8264 | return status; |
| 8265 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8266 | |
| 8267 | /* --------------------------------------------------------------------------- |
| 8268 | |
| 8269 | \fn sme_SetTmLevel |
| 8270 | \brief Set Thermal Mitigation Level to RIVA |
| 8271 | \param hHal - The handle returned by macOpen. |
| 8272 | \param newTMLevel - new Thermal Mitigation Level |
| 8273 | \param tmMode - Thermal Mitigation handle mode, default 0 |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8274 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8275 | ---------------------------------------------------------------------------*/ |
| 8276 | eHalStatus sme_SetTmLevel(tHalHandle hHal, v_U16_t newTMLevel, v_U16_t tmMode) |
| 8277 | { |
| 8278 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8279 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 8280 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8281 | vos_msg_t vosMessage; |
| 8282 | tAniSetTmLevelReq *setTmLevelReq = NULL; |
| 8283 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8284 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8285 | TRACE_CODE_SME_RX_HDD_SET_TMLEVEL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8286 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8287 | { |
| 8288 | setTmLevelReq = (tAniSetTmLevelReq *)vos_mem_malloc(sizeof(tAniSetTmLevelReq)); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8289 | if (NULL == setTmLevelReq) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8290 | { |
| 8291 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8292 | "%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] | 8293 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8294 | return eHAL_STATUS_FAILURE; |
| 8295 | } |
| 8296 | |
| 8297 | setTmLevelReq->tmMode = tmMode; |
| 8298 | setTmLevelReq->newTmLevel = newTMLevel; |
| 8299 | |
| 8300 | /* serialize the req through MC thread */ |
| 8301 | vosMessage.bodyptr = setTmLevelReq; |
| 8302 | vosMessage.type = WDA_SET_TM_LEVEL_REQ; |
| 8303 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 8304 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 8305 | { |
| 8306 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8307 | "%s: Post Set TM Level MSG fail", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8308 | vos_mem_free(setTmLevelReq); |
| 8309 | status = eHAL_STATUS_FAILURE; |
| 8310 | } |
| 8311 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8312 | } |
| 8313 | return(status); |
| 8314 | } |
| 8315 | |
| 8316 | /*--------------------------------------------------------------------------- |
| 8317 | |
| 8318 | \brief sme_featureCapsExchange() - SME interface to exchange capabilities between |
| 8319 | Host and FW. |
| 8320 | |
| 8321 | \param hHal - HAL handle for device |
| 8322 | |
| 8323 | \return NONE |
| 8324 | |
| 8325 | ---------------------------------------------------------------------------*/ |
| 8326 | void sme_featureCapsExchange( tHalHandle hHal) |
| 8327 | { |
| 8328 | 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] | 8329 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8330 | TRACE_CODE_SME_RX_HDD_CAPS_EXCH, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8331 | WDA_featureCapsExchange(vosContext); |
| 8332 | } |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8333 | |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 8334 | /*--------------------------------------------------------------------------- |
| 8335 | |
| 8336 | \brief sme_disableFeatureCapablity() - SME interface to disable Active mode offload capablity |
| 8337 | in Host. |
| 8338 | |
| 8339 | \param hHal - HAL handle for device |
| 8340 | |
| 8341 | \return NONE |
| 8342 | |
| 8343 | ---------------------------------------------------------------------------*/ |
| 8344 | void sme_disableFeatureCapablity(tANI_U8 feature_index) |
| 8345 | { |
| 8346 | WDA_disableCapablityFeature(feature_index); |
| 8347 | } |
| 8348 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8349 | /* --------------------------------------------------------------------------- |
| 8350 | |
| 8351 | \fn sme_GetDefaultCountryCode |
| 8352 | |
| 8353 | \brief Get the default country code from NV |
| 8354 | |
| 8355 | \param hHal |
| 8356 | \param pCountry |
| 8357 | \- return eHalStatus |
| 8358 | |
| 8359 | -------------------------------------------------------------------------------*/ |
| 8360 | eHalStatus sme_GetDefaultCountryCodeFrmNv(tHalHandle hHal, tANI_U8 *pCountry) |
| 8361 | { |
| 8362 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8363 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8364 | TRACE_CODE_SME_RX_HDD_GET_DEFCCNV, NO_SESSION, 0)); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8365 | return csrGetDefaultCountryCodeFrmNv(pMac, pCountry); |
| 8366 | } |
| 8367 | |
| 8368 | /* --------------------------------------------------------------------------- |
| 8369 | |
| 8370 | \fn sme_GetCurrentCountryCode |
| 8371 | |
| 8372 | \brief Get the current country code |
| 8373 | |
| 8374 | \param hHal |
| 8375 | \param pCountry |
| 8376 | \- return eHalStatus |
| 8377 | |
| 8378 | -------------------------------------------------------------------------------*/ |
| 8379 | eHalStatus sme_GetCurrentCountryCode(tHalHandle hHal, tANI_U8 *pCountry) |
| 8380 | { |
| 8381 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8382 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8383 | TRACE_CODE_SME_RX_HDD_GET_CURCC, NO_SESSION, 0)); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8384 | return csrGetCurrentCountryCode(pMac, pCountry); |
| 8385 | } |
| 8386 | |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 8387 | /* --------------------------------------------------------------------------- |
| 8388 | \fn sme_transportDebug |
| 8389 | \brief Dynamically monitoring Transport channels |
| 8390 | Private IOCTL will querry transport channel status if driver loaded |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 8391 | \param hHal Upper MAC context |
Jeff Johnson | b88db98 | 2012-12-10 13:34:59 -0800 | [diff] [blame] | 8392 | \param displaySnapshot Display transport channel snapshot option |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 8393 | \param toggleStallDetect Enable stall detect feature |
| 8394 | This feature will take effect to data performance |
| 8395 | Not integrate till fully verification |
| 8396 | \- return NONE |
| 8397 | -------------------------------------------------------------------------*/ |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 8398 | 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] | 8399 | { |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 8400 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8401 | |
| 8402 | if (NULL == pMac) |
| 8403 | { |
| 8404 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8405 | "%s: invalid context", __func__); |
| 8406 | return; |
| 8407 | } |
| 8408 | WDA_TransportChannelDebug(pMac, displaySnapshot, toggleStallDetect); |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 8409 | } |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 8410 | |
Kiran | 4a17ebe | 2013-01-31 10:43:43 -0800 | [diff] [blame] | 8411 | /* --------------------------------------------------------------------------- |
| 8412 | \fn sme_ResetPowerValuesFor5G |
| 8413 | \brief Reset the power values for 5G band with NV power values. |
| 8414 | \param hHal - HAL handle for device |
| 8415 | \- return NONE |
| 8416 | -------------------------------------------------------------------------*/ |
| 8417 | void sme_ResetPowerValuesFor5G (tHalHandle hHal) |
| 8418 | { |
| 8419 | tpAniSirGlobal pMac = PMAC_STRUCT (hHal); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8420 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8421 | TRACE_CODE_SME_RX_HDD_RESET_PW5G, NO_SESSION, 0)); |
Kiran | 4a17ebe | 2013-01-31 10:43:43 -0800 | [diff] [blame] | 8422 | csrSaveChannelPowerForBand(pMac, eANI_BOOLEAN_TRUE); |
| 8423 | csrApplyPower2Current(pMac); // Store the channel+power info in the global place: Cfg |
| 8424 | } |
| 8425 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 8426 | #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] | 8427 | /* --------------------------------------------------------------------------- |
| 8428 | \fn sme_UpdateRoamPrefer5GHz |
| 8429 | \brief enable/disable Roam prefer 5G runtime option |
| 8430 | This function is called through dynamic setConfig callback function |
| 8431 | to configure the Roam prefer 5G runtime option |
| 8432 | \param hHal - HAL handle for device |
| 8433 | \param nRoamPrefer5GHz Enable/Disable Roam prefer 5G runtime option |
| 8434 | \- return Success or failure |
| 8435 | -------------------------------------------------------------------------*/ |
| 8436 | |
| 8437 | eHalStatus sme_UpdateRoamPrefer5GHz(tHalHandle hHal, v_BOOL_t nRoamPrefer5GHz) |
| 8438 | { |
| 8439 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8440 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8441 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8442 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8443 | TRACE_CODE_SME_RX_HDD_UPDATE_RP5G, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8444 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8445 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8446 | { |
| 8447 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8448 | "%s: gRoamPrefer5GHz is changed from %d to %d", __func__, |
| 8449 | pMac->roam.configParam.nRoamPrefer5GHz, |
| 8450 | nRoamPrefer5GHz); |
| 8451 | pMac->roam.configParam.nRoamPrefer5GHz = nRoamPrefer5GHz; |
| 8452 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8453 | } |
| 8454 | |
| 8455 | return status ; |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 8456 | } |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 8457 | |
| 8458 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8459 | \fn sme_setRoamIntraBand |
| 8460 | \brief enable/disable Intra band roaming |
| 8461 | This function is called through dynamic setConfig callback function |
| 8462 | to configure the intra band roaming |
| 8463 | \param hHal - HAL handle for device |
| 8464 | \param nRoamIntraBand Enable/Disable Intra band roaming |
| 8465 | \- return Success or failure |
| 8466 | -------------------------------------------------------------------------*/ |
| 8467 | eHalStatus sme_setRoamIntraBand(tHalHandle hHal, const v_BOOL_t nRoamIntraBand) |
| 8468 | { |
| 8469 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8470 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8471 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8472 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8473 | TRACE_CODE_SME_RX_HDD_SET_ROAMIBAND, NO_SESSION, 0)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8474 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8475 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8476 | { |
| 8477 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8478 | "%s: gRoamIntraBand is changed from %d to %d", __func__, |
| 8479 | pMac->roam.configParam.nRoamIntraBand, |
| 8480 | nRoamIntraBand); |
| 8481 | pMac->roam.configParam.nRoamIntraBand = nRoamIntraBand; |
| 8482 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8483 | } |
| 8484 | |
| 8485 | return status ; |
| 8486 | } |
| 8487 | |
| 8488 | /* --------------------------------------------------------------------------- |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8489 | \fn sme_UpdateRoamScanNProbes |
| 8490 | \brief function to update roam scan N probes |
| 8491 | This function is called through dynamic setConfig callback function |
| 8492 | to update roam scan N probes |
| 8493 | \param hHal - HAL handle for device |
| 8494 | \param nProbes number of probe requests to be sent out |
| 8495 | \- return Success or failure |
| 8496 | -------------------------------------------------------------------------*/ |
| 8497 | eHalStatus sme_UpdateRoamScanNProbes(tHalHandle hHal, const v_U8_t nProbes) |
| 8498 | { |
| 8499 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8500 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8501 | |
| 8502 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8503 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8504 | { |
| 8505 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8506 | "%s: gRoamScanNProbes is changed from %d to %d", __func__, |
| 8507 | pMac->roam.configParam.nProbes, |
| 8508 | nProbes); |
| 8509 | pMac->roam.configParam.nProbes = nProbes; |
| 8510 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8511 | } |
| 8512 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8513 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8514 | { |
| 8515 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 8516 | REASON_NPROBES_CHANGED); |
| 8517 | } |
| 8518 | #endif |
| 8519 | return status ; |
| 8520 | } |
| 8521 | |
| 8522 | /* --------------------------------------------------------------------------- |
| 8523 | \fn sme_UpdateRoamScanHomeAwayTime |
| 8524 | \brief function to update roam scan Home away time |
| 8525 | This function is called through dynamic setConfig callback function |
| 8526 | to update roam scan home away time |
| 8527 | \param hHal - HAL handle for device |
| 8528 | \param nRoamScanAwayTime Scan home away time |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 8529 | \param bSendOffloadCmd If TRUE then send offload command to firmware |
| 8530 | If FALSE then command is not sent to firmware |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8531 | \- return Success or failure |
| 8532 | -------------------------------------------------------------------------*/ |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 8533 | eHalStatus sme_UpdateRoamScanHomeAwayTime(tHalHandle hHal, const v_U16_t nRoamScanHomeAwayTime, |
| 8534 | const eAniBoolean bSendOffloadCmd) |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8535 | { |
| 8536 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8537 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8538 | |
| 8539 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8540 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8541 | { |
| 8542 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8543 | "%s: gRoamScanHomeAwayTime is changed from %d to %d", __func__, |
| 8544 | pMac->roam.configParam.nRoamScanHomeAwayTime, |
| 8545 | nRoamScanHomeAwayTime); |
| 8546 | pMac->roam.configParam.nRoamScanHomeAwayTime = nRoamScanHomeAwayTime; |
| 8547 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8548 | } |
| 8549 | |
| 8550 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 8551 | if (pMac->roam.configParam.isRoamOffloadScanEnabled && bSendOffloadCmd) |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8552 | { |
| 8553 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 8554 | REASON_HOME_AWAY_TIME_CHANGED); |
| 8555 | } |
| 8556 | #endif |
| 8557 | return status; |
| 8558 | } |
| 8559 | |
| 8560 | |
| 8561 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8562 | \fn sme_getRoamIntraBand |
| 8563 | \brief get Intra band roaming |
| 8564 | \param hHal - HAL handle for device |
| 8565 | \- return Success or failure |
| 8566 | -------------------------------------------------------------------------*/ |
| 8567 | v_BOOL_t sme_getRoamIntraBand(tHalHandle hHal) |
| 8568 | { |
| 8569 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8570 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8571 | TRACE_CODE_SME_RX_HDD_GET_ROAMIBAND, NO_SESSION, 0)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8572 | return pMac->roam.configParam.nRoamIntraBand; |
| 8573 | } |
| 8574 | |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8575 | /* --------------------------------------------------------------------------- |
| 8576 | \fn sme_getRoamScanNProbes |
| 8577 | \brief get N Probes |
| 8578 | \param hHal - HAL handle for device |
| 8579 | \- return Success or failure |
| 8580 | -------------------------------------------------------------------------*/ |
| 8581 | v_U8_t sme_getRoamScanNProbes(tHalHandle hHal) |
| 8582 | { |
| 8583 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8584 | return pMac->roam.configParam.nProbes; |
| 8585 | } |
| 8586 | |
| 8587 | /* --------------------------------------------------------------------------- |
| 8588 | \fn sme_getRoamScanHomeAwayTime |
| 8589 | \brief get Roam scan home away time |
| 8590 | \param hHal - HAL handle for device |
| 8591 | \- return Success or failure |
| 8592 | -------------------------------------------------------------------------*/ |
| 8593 | v_U16_t sme_getRoamScanHomeAwayTime(tHalHandle hHal) |
| 8594 | { |
| 8595 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8596 | return pMac->roam.configParam.nRoamScanHomeAwayTime; |
| 8597 | } |
| 8598 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8599 | |
| 8600 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 8601 | \fn sme_UpdateImmediateRoamRssiDiff |
| 8602 | \brief Update nImmediateRoamRssiDiff |
| 8603 | This function is called through dynamic setConfig callback function |
| 8604 | to configure nImmediateRoamRssiDiff |
| 8605 | Usage: adb shell iwpriv wlan0 setConfig gImmediateRoamRssiDiff=[0 .. 125] |
| 8606 | \param hHal - HAL handle for device |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8607 | \param nImmediateRoamRssiDiff - minimum rssi difference between potential |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 8608 | candidate and current AP. |
| 8609 | \- return Success or failure |
| 8610 | -------------------------------------------------------------------------*/ |
| 8611 | |
| 8612 | eHalStatus sme_UpdateImmediateRoamRssiDiff(tHalHandle hHal, v_U8_t nImmediateRoamRssiDiff) |
| 8613 | { |
| 8614 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8615 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8616 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8617 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8618 | TRACE_CODE_SME_RX_HDD_UPDATE_IMMRSSIDIFF, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8619 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8620 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8621 | { |
| 8622 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8623 | "LFR runtime successfully set immediate roam rssi diff to" |
| 8624 | "%d - old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8625 | nImmediateRoamRssiDiff, |
| 8626 | pMac->roam.configParam.nImmediateRoamRssiDiff, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8627 | macTraceGetNeighbourRoamState( |
| 8628 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8629 | pMac->roam.configParam.nImmediateRoamRssiDiff = nImmediateRoamRssiDiff; |
| 8630 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8631 | } |
| 8632 | |
| 8633 | return status ; |
| 8634 | } |
| 8635 | |
| 8636 | /* --------------------------------------------------------------------------- |
| 8637 | \fn sme_UpdateRoamRssiDiff |
| 8638 | \brief Update RoamRssiDiff |
| 8639 | This function is called through dynamic setConfig callback function |
| 8640 | to configure RoamRssiDiff |
| 8641 | Usage: adb shell iwpriv wlan0 setConfig RoamRssiDiff=[0 .. 125] |
| 8642 | \param hHal - HAL handle for device |
| 8643 | \param RoamRssiDiff - minimum rssi difference between potential |
| 8644 | candidate and current AP. |
| 8645 | \- return Success or failure |
| 8646 | -------------------------------------------------------------------------*/ |
| 8647 | |
| 8648 | eHalStatus sme_UpdateRoamRssiDiff(tHalHandle hHal, v_U8_t RoamRssiDiff) |
| 8649 | { |
| 8650 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8651 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8652 | |
| 8653 | status = sme_AcquireGlobalLock( &pMac->sme ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8654 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8655 | TRACE_CODE_SME_RX_HDD_UPDATE_RSSIDIFF, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8656 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8657 | { |
| 8658 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8659 | "LFR runtime successfully set roam rssi diff to %d" |
| 8660 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8661 | RoamRssiDiff, |
| 8662 | pMac->roam.configParam.RoamRssiDiff, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8663 | macTraceGetNeighbourRoamState( |
| 8664 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8665 | pMac->roam.configParam.RoamRssiDiff = RoamRssiDiff; |
| 8666 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8667 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 8668 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8669 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8670 | { |
| 8671 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_RSSI_DIFF_CHANGED); |
| 8672 | } |
| 8673 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8674 | return status ; |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 8675 | } |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8676 | |
| 8677 | /*-------------------------------------------------------------------------- |
| 8678 | \brief sme_UpdateFastTransitionEnabled() - enable/disable Fast Transition support at runtime |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8679 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8680 | isFastTransitionEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8681 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8682 | \param hHal - The handle returned by macOpen. |
| 8683 | \return eHAL_STATUS_SUCCESS - SME update isFastTransitionEnabled config successfully. |
| 8684 | Other status means SME is failed to update isFastTransitionEnabled. |
| 8685 | \sa |
| 8686 | --------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8687 | eHalStatus sme_UpdateFastTransitionEnabled(tHalHandle hHal, |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8688 | v_BOOL_t isFastTransitionEnabled) |
| 8689 | { |
| 8690 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8691 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8692 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8693 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8694 | TRACE_CODE_SME_RX_HDD_UPDATE_FTENABLED, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8695 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8696 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8697 | { |
| 8698 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8699 | "%s: FastTransitionEnabled is changed from %d to %d", __func__, |
| 8700 | pMac->roam.configParam.isFastTransitionEnabled, |
| 8701 | isFastTransitionEnabled); |
| 8702 | pMac->roam.configParam.isFastTransitionEnabled = isFastTransitionEnabled; |
| 8703 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8704 | } |
| 8705 | |
| 8706 | return status ; |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8707 | } |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 8708 | |
| 8709 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 8710 | \fn sme_UpdateWESMode |
| 8711 | \brief Update WES Mode |
| 8712 | This function is called through dynamic setConfig callback function |
| 8713 | to configure isWESModeEnabled |
| 8714 | \param hHal - HAL handle for device |
| 8715 | \return eHAL_STATUS_SUCCESS - SME update isWESModeEnabled config successfully. |
| 8716 | Other status means SME is failed to update isWESModeEnabled. |
| 8717 | -------------------------------------------------------------------------*/ |
| 8718 | |
| 8719 | eHalStatus sme_UpdateWESMode(tHalHandle hHal, v_BOOL_t isWESModeEnabled) |
| 8720 | { |
| 8721 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8722 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8723 | |
| 8724 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8725 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8726 | { |
| 8727 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8728 | "LFR runtime successfully set WES Mode to %d" |
| 8729 | "- old value is %d - roam state is %s", |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 8730 | isWESModeEnabled, |
| 8731 | pMac->roam.configParam.isWESModeEnabled, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8732 | macTraceGetNeighbourRoamState( |
| 8733 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 8734 | pMac->roam.configParam.isWESModeEnabled = isWESModeEnabled; |
| 8735 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8736 | } |
| 8737 | |
| 8738 | return status ; |
| 8739 | } |
| 8740 | |
| 8741 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 8742 | \fn sme_SetRoamScanControl |
| 8743 | \brief Set roam scan control |
| 8744 | This function is called to set roam scan control |
| 8745 | if roam scan control is set to 0, roaming scan cache is cleared |
| 8746 | any value other than 0 is treated as invalid value |
| 8747 | \param hHal - HAL handle for device |
| 8748 | \return eHAL_STATUS_SUCCESS - SME update config successfully. |
| 8749 | Other status means SME failure to update |
| 8750 | -------------------------------------------------------------------------*/ |
| 8751 | eHalStatus sme_SetRoamScanControl(tHalHandle hHal, v_BOOL_t roamScanControl) |
| 8752 | { |
| 8753 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8754 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8755 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8756 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8757 | TRACE_CODE_SME_RX_HDD_SET_SCANCTRL, NO_SESSION, 0)); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 8758 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8759 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8760 | { |
| 8761 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8762 | "LFR runtime successfully set roam scan control to %d" |
| 8763 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 8764 | roamScanControl, |
| 8765 | pMac->roam.configParam.nRoamScanControl, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8766 | macTraceGetNeighbourRoamState( |
| 8767 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 8768 | pMac->roam.configParam.nRoamScanControl = roamScanControl; |
| 8769 | if ( 0 == roamScanControl) |
| 8770 | { |
| 8771 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 8772 | "LFR runtime successfully cleared roam scan cache"); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 8773 | csrFlushCfgBgScanRoamChannelList(pMac); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 8774 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8775 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8776 | { |
| 8777 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_FLUSH_CHANNEL_LIST); |
| 8778 | } |
| 8779 | #endif |
| 8780 | } |
| 8781 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8782 | } |
| 8783 | return status ; |
| 8784 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 8785 | #endif /* (WLAN_FEATURE_VOWIFI_11R) || (FEATURE_WLAN_ESE) || (FEATURE_WLAN_LFR) */ |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8786 | |
| 8787 | #ifdef FEATURE_WLAN_LFR |
| 8788 | /*-------------------------------------------------------------------------- |
| 8789 | \brief sme_UpdateIsFastRoamIniFeatureEnabled() - enable/disable LFR support at runtime |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8790 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8791 | isFastRoamIniFeatureEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8792 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8793 | \param hHal - The handle returned by macOpen. |
| 8794 | \return eHAL_STATUS_SUCCESS - SME update isFastRoamIniFeatureEnabled config successfully. |
| 8795 | Other status means SME is failed to update isFastRoamIniFeatureEnabled. |
| 8796 | \sa |
| 8797 | --------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8798 | eHalStatus sme_UpdateIsFastRoamIniFeatureEnabled(tHalHandle hHal, |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8799 | const v_BOOL_t isFastRoamIniFeatureEnabled) |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8800 | { |
| 8801 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8802 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8803 | if (pMac->roam.configParam.isFastRoamIniFeatureEnabled == isFastRoamIniFeatureEnabled) |
| 8804 | { |
| 8805 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8806 | "%s: FastRoam is already enabled or disabled, nothing to do (returning) old(%d) new(%d)", __func__, |
| 8807 | pMac->roam.configParam.isFastRoamIniFeatureEnabled, |
| 8808 | isFastRoamIniFeatureEnabled); |
| 8809 | return eHAL_STATUS_SUCCESS; |
| 8810 | } |
| 8811 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8812 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8813 | "%s: FastRoamEnabled is changed from %d to %d", __func__, |
| 8814 | pMac->roam.configParam.isFastRoamIniFeatureEnabled, |
| 8815 | isFastRoamIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8816 | pMac->roam.configParam.isFastRoamIniFeatureEnabled = isFastRoamIniFeatureEnabled; |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8817 | csrNeighborRoamUpdateFastRoamingEnabled(pMac, isFastRoamIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8818 | |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8819 | return eHAL_STATUS_SUCCESS; |
| 8820 | } |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 8821 | |
Sameer Thalappil | 4ae66ec | 2013-11-05 14:17:35 -0800 | [diff] [blame] | 8822 | /*-------------------------------------------------------------------------- |
| 8823 | \brief sme_UpdateIsMAWCIniFeatureEnabled() - |
| 8824 | Enable/disable LFR MAWC support at runtime |
| 8825 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 8826 | isMAWCIniFeatureEnabled. |
| 8827 | This is a synchronous call |
| 8828 | \param hHal - The handle returned by macOpen. |
| 8829 | \return eHAL_STATUS_SUCCESS - SME update MAWCEnabled config successfully. |
| 8830 | Other status means SME is failed to update MAWCEnabled. |
| 8831 | \sa |
| 8832 | --------------------------------------------------------------------------*/ |
| 8833 | eHalStatus sme_UpdateIsMAWCIniFeatureEnabled(tHalHandle hHal, |
| 8834 | const v_BOOL_t MAWCEnabled) |
| 8835 | { |
| 8836 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8837 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8838 | |
| 8839 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8840 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8841 | { |
| 8842 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8843 | "%s: MAWCEnabled is changed from %d to %d", __func__, |
| 8844 | pMac->roam.configParam.MAWCEnabled, |
| 8845 | MAWCEnabled); |
| 8846 | pMac->roam.configParam.MAWCEnabled = MAWCEnabled; |
| 8847 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8848 | } |
| 8849 | |
| 8850 | return status ; |
| 8851 | |
| 8852 | } |
| 8853 | |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 8854 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8855 | /*-------------------------------------------------------------------------- |
| 8856 | \brief sme_UpdateEnableFastRoamInConcurrency() - enable/disable LFR if Concurrent session exists |
| 8857 | This is a synchronuous call |
| 8858 | \param hHal - The handle returned by macOpen. |
| 8859 | \return eHAL_STATUS_SUCCESS |
| 8860 | Other status means SME is failed |
| 8861 | \sa |
| 8862 | --------------------------------------------------------------------------*/ |
| 8863 | |
| 8864 | eHalStatus sme_UpdateEnableFastRoamInConcurrency(tHalHandle hHal, |
| 8865 | v_BOOL_t bFastRoamInConIniFeatureEnabled) |
| 8866 | { |
| 8867 | |
| 8868 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8869 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8870 | |
| 8871 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8872 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8873 | { |
| 8874 | pMac->roam.configParam.bFastRoamInConIniFeatureEnabled = bFastRoamInConIniFeatureEnabled; |
| 8875 | if (0 == pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8876 | { |
| 8877 | pMac->roam.configParam.bFastRoamInConIniFeatureEnabled = 0; |
| 8878 | } |
| 8879 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8880 | } |
| 8881 | |
| 8882 | return status; |
| 8883 | } |
| 8884 | #endif |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8885 | #endif /* FEATURE_WLAN_LFR */ |
| 8886 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 8887 | #ifdef FEATURE_WLAN_ESE |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8888 | /*-------------------------------------------------------------------------- |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 8889 | \brief sme_UpdateIsEseFeatureEnabled() - enable/disable Ese support at runtime |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8890 | 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] | 8891 | isEseIniFeatureEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8892 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8893 | \param hHal - The handle returned by macOpen. |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 8894 | \return eHAL_STATUS_SUCCESS - SME update isEseIniFeatureEnabled config successfully. |
| 8895 | Other status means SME is failed to update isEseIniFeatureEnabled. |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8896 | \sa |
| 8897 | --------------------------------------------------------------------------*/ |
| 8898 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 8899 | eHalStatus sme_UpdateIsEseFeatureEnabled(tHalHandle hHal, |
| 8900 | const v_BOOL_t isEseIniFeatureEnabled) |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8901 | { |
| 8902 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8903 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 8904 | if (pMac->roam.configParam.isEseIniFeatureEnabled == isEseIniFeatureEnabled) |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8905 | { |
| 8906 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 8907 | "%s: Ese Mode is already enabled or disabled, nothing to do (returning) old(%d) new(%d)", __func__, |
| 8908 | pMac->roam.configParam.isEseIniFeatureEnabled, |
| 8909 | isEseIniFeatureEnabled); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8910 | return eHAL_STATUS_SUCCESS; |
| 8911 | } |
| 8912 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8913 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 8914 | "%s: EseEnabled is changed from %d to %d", __func__, |
| 8915 | pMac->roam.configParam.isEseIniFeatureEnabled, |
| 8916 | isEseIniFeatureEnabled); |
| 8917 | pMac->roam.configParam.isEseIniFeatureEnabled = isEseIniFeatureEnabled; |
| 8918 | csrNeighborRoamUpdateEseModeEnabled(pMac, isEseIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8919 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 8920 | if(TRUE == isEseIniFeatureEnabled) |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8921 | { |
| 8922 | sme_UpdateFastTransitionEnabled(hHal, TRUE); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8923 | } |
Srinivas Girigowda | ba17369 | 2013-08-07 11:55:38 -0700 | [diff] [blame] | 8924 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 8925 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8926 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8927 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 8928 | 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] | 8929 | } |
| 8930 | #endif |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8931 | return eHAL_STATUS_SUCCESS; |
| 8932 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 8933 | #endif /* FEATURE_WLAN_ESE */ |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8934 | |
| 8935 | /*-------------------------------------------------------------------------- |
| 8936 | \brief sme_UpdateConfigFwRssiMonitoring() - enable/disable firmware RSSI Monitoring at runtime |
| 8937 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 8938 | fEnableFwRssiMonitoring. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8939 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8940 | \param hHal - The handle returned by macOpen. |
| 8941 | \return eHAL_STATUS_SUCCESS - SME update fEnableFwRssiMonitoring. config successfully. |
| 8942 | Other status means SME is failed to update fEnableFwRssiMonitoring. |
| 8943 | \sa |
| 8944 | --------------------------------------------------------------------------*/ |
| 8945 | |
| 8946 | eHalStatus sme_UpdateConfigFwRssiMonitoring(tHalHandle hHal, |
| 8947 | v_BOOL_t fEnableFwRssiMonitoring) |
| 8948 | { |
| 8949 | eHalStatus halStatus = eHAL_STATUS_SUCCESS; |
| 8950 | |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8951 | if (ccmCfgSetInt(hHal, WNI_CFG_PS_ENABLE_RSSI_MONITOR, fEnableFwRssiMonitoring, |
| 8952 | NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE) |
| 8953 | { |
| 8954 | halStatus = eHAL_STATUS_FAILURE; |
| 8955 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8956 | "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] | 8957 | } |
| 8958 | |
| 8959 | return (halStatus); |
| 8960 | } |
| 8961 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8962 | #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8963 | /*-------------------------------------------------------------------------- |
| 8964 | \brief sme_setNeighborLookupRssiThreshold() - update neighbor lookup rssi threshold |
| 8965 | This is a synchronous call |
| 8966 | \param hHal - The handle returned by macOpen. |
| 8967 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 8968 | Other status means SME is failed to update |
| 8969 | \sa |
| 8970 | --------------------------------------------------------------------------*/ |
| 8971 | eHalStatus sme_setNeighborLookupRssiThreshold(tHalHandle hHal, |
| 8972 | v_U8_t neighborLookupRssiThreshold) |
| 8973 | { |
| 8974 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8975 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8976 | |
| 8977 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8978 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8979 | { |
| 8980 | status = csrNeighborRoamSetLookupRssiThreshold(pMac, neighborLookupRssiThreshold); |
| 8981 | if (HAL_STATUS_SUCCESS(status)) |
| 8982 | { |
| 8983 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8984 | "LFR runtime successfully set Lookup threshold to %d" |
| 8985 | " - old value is %d - roam state is %s", |
| 8986 | neighborLookupRssiThreshold, |
| 8987 | pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold, |
| 8988 | macTraceGetNeighbourRoamState( |
| 8989 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8990 | pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold = |
| 8991 | neighborLookupRssiThreshold; |
| 8992 | } |
| 8993 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8994 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8995 | return status; |
| 8996 | } |
| 8997 | |
| 8998 | /*-------------------------------------------------------------------------- |
| 8999 | \brief sme_setNeighborReassocRssiThreshold() - update neighbor reassoc rssi threshold |
| 9000 | This is a synchronous call |
| 9001 | \param hHal - The handle returned by macOpen. |
| 9002 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9003 | Other status means SME is failed to update |
| 9004 | \sa |
| 9005 | --------------------------------------------------------------------------*/ |
| 9006 | eHalStatus sme_setNeighborReassocRssiThreshold(tHalHandle hHal, |
| 9007 | v_U8_t neighborReassocRssiThreshold) |
| 9008 | { |
| 9009 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9010 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9011 | |
| 9012 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9013 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9014 | { |
| 9015 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9016 | "LFR runtime successfully set Reassoc threshold to %d" |
| 9017 | "- old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9018 | neighborReassocRssiThreshold, |
| 9019 | pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9020 | macTraceGetNeighbourRoamState( |
| 9021 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9022 | pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold = |
| 9023 | neighborReassocRssiThreshold; |
| 9024 | pMac->roam.neighborRoamInfo.cfgParams.neighborReassocThreshold = |
| 9025 | neighborReassocRssiThreshold; |
| 9026 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9027 | } |
| 9028 | |
| 9029 | return status ; |
| 9030 | } |
| 9031 | |
| 9032 | |
| 9033 | /*-------------------------------------------------------------------------- |
| 9034 | \brief sme_getNeighborLookupRssiThreshold() - get neighbor lookup rssi threshold |
| 9035 | This is a synchronous call |
| 9036 | \param hHal - The handle returned by macOpen. |
| 9037 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9038 | Other status means SME is failed to update |
| 9039 | \sa |
| 9040 | --------------------------------------------------------------------------*/ |
| 9041 | v_U8_t sme_getNeighborLookupRssiThreshold(tHalHandle hHal) |
| 9042 | { |
| 9043 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9044 | return pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold; |
| 9045 | } |
| 9046 | |
| 9047 | /*-------------------------------------------------------------------------- |
| 9048 | \brief sme_setNeighborScanRefreshPeriod() - set neighbor scan results refresh period |
| 9049 | This is a synchronous call |
| 9050 | \param hHal - The handle returned by macOpen. |
| 9051 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9052 | Other status means SME is failed to update |
| 9053 | \sa |
| 9054 | --------------------------------------------------------------------------*/ |
| 9055 | eHalStatus sme_setNeighborScanRefreshPeriod(tHalHandle hHal, |
| 9056 | v_U16_t neighborScanResultsRefreshPeriod) |
| 9057 | { |
| 9058 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9059 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9060 | |
| 9061 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9062 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9063 | { |
| 9064 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9065 | "LFR runtime successfully set roam scan refresh period to %d" |
| 9066 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9067 | neighborScanResultsRefreshPeriod, |
| 9068 | pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9069 | macTraceGetNeighbourRoamState( |
| 9070 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9071 | pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod = |
| 9072 | neighborScanResultsRefreshPeriod; |
| 9073 | pMac->roam.neighborRoamInfo.cfgParams.neighborResultsRefreshPeriod = |
| 9074 | neighborScanResultsRefreshPeriod; |
| 9075 | |
| 9076 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9077 | } |
| 9078 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9079 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9080 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9081 | { |
| 9082 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9083 | REASON_NEIGHBOR_SCAN_REFRESH_PERIOD_CHANGED); |
| 9084 | } |
| 9085 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9086 | return status ; |
| 9087 | } |
| 9088 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9089 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9090 | /*-------------------------------------------------------------------------- |
| 9091 | \brief sme_UpdateRoamScanOffloadEnabled() - enable/disable roam scan offload feaure |
| 9092 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 9093 | gRoamScanOffloadEnabled. |
| 9094 | This is a synchronous call |
| 9095 | \param hHal - The handle returned by macOpen. |
| 9096 | \return eHAL_STATUS_SUCCESS - SME update config successfully. |
| 9097 | Other status means SME is failed to update. |
| 9098 | \sa |
| 9099 | --------------------------------------------------------------------------*/ |
| 9100 | |
| 9101 | eHalStatus sme_UpdateRoamScanOffloadEnabled(tHalHandle hHal, |
| 9102 | v_BOOL_t nRoamScanOffloadEnabled) |
| 9103 | { |
| 9104 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9105 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9106 | |
| 9107 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9108 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9109 | { |
| 9110 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9111 | "%s: gRoamScanOffloadEnabled is changed from %d to %d", __func__, |
| 9112 | pMac->roam.configParam.isRoamOffloadScanEnabled, |
| 9113 | nRoamScanOffloadEnabled); |
| 9114 | pMac->roam.configParam.isRoamOffloadScanEnabled = nRoamScanOffloadEnabled; |
| 9115 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9116 | } |
| 9117 | |
| 9118 | return status ; |
| 9119 | } |
| 9120 | #endif |
| 9121 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9122 | /*-------------------------------------------------------------------------- |
| 9123 | \brief sme_getNeighborScanRefreshPeriod() - get neighbor scan results refresh period |
| 9124 | This is a synchronous call |
| 9125 | \param hHal - The handle returned by macOpen. |
| 9126 | \return v_U16_t - Neighbor scan results refresh period value |
| 9127 | \sa |
| 9128 | --------------------------------------------------------------------------*/ |
| 9129 | v_U16_t sme_getNeighborScanRefreshPeriod(tHalHandle hHal) |
| 9130 | { |
| 9131 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9132 | return pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod; |
| 9133 | } |
| 9134 | |
| 9135 | /*-------------------------------------------------------------------------- |
| 9136 | \brief sme_getEmptyScanRefreshPeriod() - get empty scan refresh period |
| 9137 | This is a synchronuous call |
| 9138 | \param hHal - The handle returned by macOpen. |
| 9139 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9140 | Other status means SME is failed to update |
| 9141 | \sa |
| 9142 | --------------------------------------------------------------------------*/ |
| 9143 | v_U16_t sme_getEmptyScanRefreshPeriod(tHalHandle hHal) |
| 9144 | { |
| 9145 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9146 | return pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod; |
| 9147 | } |
| 9148 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9149 | /* --------------------------------------------------------------------------- |
| 9150 | \fn sme_UpdateEmptyScanRefreshPeriod |
| 9151 | \brief Update nEmptyScanRefreshPeriod |
| 9152 | This function is called through dynamic setConfig callback function |
| 9153 | to configure nEmptyScanRefreshPeriod |
| 9154 | Usage: adb shell iwpriv wlan0 setConfig nEmptyScanRefreshPeriod=[0 .. 60] |
| 9155 | \param hHal - HAL handle for device |
| 9156 | \param nEmptyScanRefreshPeriod - scan period following empty scan results. |
| 9157 | \- return Success or failure |
| 9158 | -------------------------------------------------------------------------*/ |
| 9159 | |
| 9160 | eHalStatus sme_UpdateEmptyScanRefreshPeriod(tHalHandle hHal, v_U16_t nEmptyScanRefreshPeriod) |
| 9161 | { |
| 9162 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9163 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9164 | |
| 9165 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9166 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9167 | { |
| 9168 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9169 | "LFR runtime successfully set roam scan period to %d -" |
| 9170 | "old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9171 | nEmptyScanRefreshPeriod, |
| 9172 | pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9173 | macTraceGetNeighbourRoamState( |
| 9174 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9175 | pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod = nEmptyScanRefreshPeriod; |
| 9176 | pMac->roam.neighborRoamInfo.cfgParams.emptyScanRefreshPeriod = nEmptyScanRefreshPeriod; |
| 9177 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9178 | } |
| 9179 | |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9180 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9181 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9182 | { |
| 9183 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9184 | REASON_EMPTY_SCAN_REF_PERIOD_CHANGED); |
| 9185 | } |
| 9186 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9187 | return status ; |
| 9188 | } |
| 9189 | |
| 9190 | /* --------------------------------------------------------------------------- |
| 9191 | \fn sme_setNeighborScanMinChanTime |
| 9192 | \brief Update nNeighborScanMinChanTime |
| 9193 | This function is called through dynamic setConfig callback function |
| 9194 | to configure gNeighborScanChannelMinTime |
| 9195 | Usage: adb shell iwpriv wlan0 setConfig gNeighborScanChannelMinTime=[0 .. 60] |
| 9196 | \param hHal - HAL handle for device |
| 9197 | \param nNeighborScanMinChanTime - Channel minimum dwell time |
| 9198 | \- return Success or failure |
| 9199 | -------------------------------------------------------------------------*/ |
| 9200 | eHalStatus sme_setNeighborScanMinChanTime(tHalHandle hHal, const v_U16_t nNeighborScanMinChanTime) |
| 9201 | { |
| 9202 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9203 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9204 | |
| 9205 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9206 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9207 | { |
| 9208 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9209 | "LFR runtime successfully set channel min dwell time to %d" |
| 9210 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9211 | nNeighborScanMinChanTime, |
| 9212 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9213 | macTraceGetNeighbourRoamState( |
| 9214 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9215 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime = nNeighborScanMinChanTime; |
| 9216 | pMac->roam.neighborRoamInfo.cfgParams.minChannelScanTime = nNeighborScanMinChanTime; |
| 9217 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9218 | } |
| 9219 | |
| 9220 | return status ; |
| 9221 | } |
| 9222 | |
| 9223 | /* --------------------------------------------------------------------------- |
| 9224 | \fn sme_setNeighborScanMaxChanTime |
| 9225 | \brief Update nNeighborScanMaxChanTime |
| 9226 | This function is called through dynamic setConfig callback function |
| 9227 | to configure gNeighborScanChannelMaxTime |
| 9228 | Usage: adb shell iwpriv wlan0 setConfig gNeighborScanChannelMaxTime=[0 .. 60] |
| 9229 | \param hHal - HAL handle for device |
| 9230 | \param nNeighborScanMinChanTime - Channel maximum dwell time |
| 9231 | \- return Success or failure |
| 9232 | -------------------------------------------------------------------------*/ |
| 9233 | eHalStatus sme_setNeighborScanMaxChanTime(tHalHandle hHal, const v_U16_t nNeighborScanMaxChanTime) |
| 9234 | { |
| 9235 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9236 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9237 | |
| 9238 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9239 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9240 | { |
| 9241 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9242 | "LFR runtime successfully set channel max dwell time to %d" |
| 9243 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9244 | nNeighborScanMaxChanTime, |
| 9245 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMaxChanTime, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9246 | macTraceGetNeighbourRoamState( |
| 9247 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9248 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMaxChanTime = nNeighborScanMaxChanTime; |
| 9249 | pMac->roam.neighborRoamInfo.cfgParams.maxChannelScanTime = nNeighborScanMaxChanTime; |
| 9250 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9251 | } |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9252 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9253 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9254 | { |
| 9255 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9256 | REASON_SCAN_CH_TIME_CHANGED); |
| 9257 | } |
| 9258 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9259 | |
| 9260 | return status ; |
| 9261 | } |
| 9262 | |
| 9263 | /* --------------------------------------------------------------------------- |
| 9264 | \fn sme_getNeighborScanMinChanTime |
| 9265 | \brief get neighbor scan min channel time |
| 9266 | \param hHal - The handle returned by macOpen. |
| 9267 | \return v_U16_t - channel min time value |
| 9268 | -------------------------------------------------------------------------*/ |
| 9269 | v_U16_t sme_getNeighborScanMinChanTime(tHalHandle hHal) |
| 9270 | { |
| 9271 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9272 | return pMac->roam.neighborRoamInfo.cfgParams.minChannelScanTime; |
| 9273 | } |
| 9274 | |
| 9275 | /* --------------------------------------------------------------------------- |
| 9276 | \fn sme_getNeighborScanMaxChanTime |
| 9277 | \brief get neighbor scan max channel time |
| 9278 | \param hHal - The handle returned by macOpen. |
| 9279 | \return v_U16_t - channel max time value |
| 9280 | -------------------------------------------------------------------------*/ |
| 9281 | v_U16_t sme_getNeighborScanMaxChanTime(tHalHandle hHal) |
| 9282 | { |
| 9283 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9284 | return pMac->roam.neighborRoamInfo.cfgParams.maxChannelScanTime; |
| 9285 | } |
| 9286 | |
| 9287 | /* --------------------------------------------------------------------------- |
| 9288 | \fn sme_setNeighborScanPeriod |
| 9289 | \brief Update nNeighborScanPeriod |
| 9290 | This function is called through dynamic setConfig callback function |
| 9291 | to configure nNeighborScanPeriod |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9292 | Usage: adb shell iwpriv wlan0 setConfig nNeighborScanPeriod=[0 .. 1000] |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9293 | \param hHal - HAL handle for device |
| 9294 | \param nNeighborScanPeriod - neighbor scan period |
| 9295 | \- return Success or failure |
| 9296 | -------------------------------------------------------------------------*/ |
| 9297 | eHalStatus sme_setNeighborScanPeriod(tHalHandle hHal, const v_U16_t nNeighborScanPeriod) |
| 9298 | { |
| 9299 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9300 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9301 | |
| 9302 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9303 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9304 | { |
| 9305 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9306 | "LFR runtime successfully set neighbor scan period to %d" |
| 9307 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9308 | nNeighborScanPeriod, |
| 9309 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9310 | macTraceGetNeighbourRoamState( |
| 9311 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9312 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod = nNeighborScanPeriod; |
| 9313 | pMac->roam.neighborRoamInfo.cfgParams.neighborScanPeriod = nNeighborScanPeriod; |
| 9314 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9315 | } |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9316 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9317 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9318 | { |
| 9319 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9320 | REASON_SCAN_HOME_TIME_CHANGED); |
| 9321 | } |
| 9322 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9323 | |
| 9324 | return status ; |
| 9325 | } |
| 9326 | |
| 9327 | /* --------------------------------------------------------------------------- |
| 9328 | \fn sme_getNeighborScanPeriod |
| 9329 | \brief get neighbor scan period |
| 9330 | \param hHal - The handle returned by macOpen. |
| 9331 | \return v_U16_t - neighbor scan period |
| 9332 | -------------------------------------------------------------------------*/ |
| 9333 | v_U16_t sme_getNeighborScanPeriod(tHalHandle hHal) |
| 9334 | { |
| 9335 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9336 | return pMac->roam.neighborRoamInfo.cfgParams.neighborScanPeriod; |
| 9337 | } |
| 9338 | |
| 9339 | #endif |
| 9340 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9341 | #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] | 9342 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9343 | /*-------------------------------------------------------------------------- |
| 9344 | \brief sme_getRoamRssiDiff() - get Roam rssi diff |
| 9345 | This is a synchronous call |
| 9346 | \param hHal - The handle returned by macOpen. |
| 9347 | \return v_U16_t - Rssi diff value |
| 9348 | \sa |
| 9349 | --------------------------------------------------------------------------*/ |
| 9350 | v_U8_t sme_getRoamRssiDiff(tHalHandle hHal) |
| 9351 | { |
| 9352 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9353 | return pMac->roam.configParam.RoamRssiDiff; |
| 9354 | } |
| 9355 | |
| 9356 | /*-------------------------------------------------------------------------- |
| 9357 | \brief sme_ChangeRoamScanChannelList() - Change roam scan channel list |
| 9358 | This is a synchronous call |
| 9359 | \param hHal - The handle returned by macOpen. |
| 9360 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9361 | Other status means SME is failed to update |
| 9362 | \sa |
| 9363 | --------------------------------------------------------------------------*/ |
| 9364 | eHalStatus sme_ChangeRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, |
| 9365 | tANI_U8 numChannels) |
| 9366 | { |
| 9367 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9368 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9369 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9370 | tANI_U8 oldChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
Kiet Lam | 600d3ca | 2013-08-31 16:33:32 +0530 | [diff] [blame] | 9371 | tANI_U8 newChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9372 | tANI_U8 i = 0, j = 0; |
| 9373 | |
| 9374 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9375 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9376 | { |
| 9377 | if (NULL != pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
| 9378 | { |
| 9379 | for (i = 0; i < pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; i++) |
| 9380 | { |
Kaushik, Sushant | d39915b | 2014-04-23 15:12:28 +0530 | [diff] [blame] | 9381 | if (j < sizeof(oldChannelList)) |
| 9382 | { |
| 9383 | j += snprintf(oldChannelList + j, sizeof(oldChannelList) - j," %d", |
| 9384 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]); |
| 9385 | } |
| 9386 | else |
| 9387 | { |
| 9388 | break; |
| 9389 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9390 | } |
| 9391 | } |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9392 | csrFlushCfgBgScanRoamChannelList(pMac); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9393 | csrCreateBgScanRoamChannelList(pMac, pChannelList, numChannels); |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9394 | sme_SetRoamScanControl(hHal, 1); |
| 9395 | if (NULL != pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9396 | { |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9397 | j = 0; |
| 9398 | for (i = 0; i < pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; i++) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9399 | { |
Kaushik, Sushant | d39915b | 2014-04-23 15:12:28 +0530 | [diff] [blame] | 9400 | if (j < sizeof(oldChannelList)) |
| 9401 | { |
| 9402 | j += snprintf(newChannelList + j, sizeof(newChannelList) - j," %d", |
| 9403 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]); |
| 9404 | } |
| 9405 | else |
| 9406 | { |
| 9407 | break; |
| 9408 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9409 | } |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9410 | } |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9411 | |
| 9412 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9413 | "LFR runtime successfully set roam scan channels to %s" |
| 9414 | "- old value is %s - roam state is %s", |
| 9415 | newChannelList, oldChannelList, |
| 9416 | macTraceGetNeighbourRoamState( |
| 9417 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9418 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9419 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9420 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9421 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9422 | { |
| 9423 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); |
| 9424 | } |
| 9425 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9426 | |
| 9427 | return status ; |
| 9428 | } |
| 9429 | |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9430 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9431 | #ifdef FEATURE_WLAN_ESE_UPLOAD |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9432 | /*-------------------------------------------------------------------------- |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9433 | \brief sme_SetEseRoamScanChannelList() - set ese roam scan channel list |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9434 | This is a synchronuous call |
| 9435 | \param hHal - The handle returned by macOpen. |
| 9436 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9437 | Other status means SME is failed to update |
| 9438 | \sa |
| 9439 | --------------------------------------------------------------------------*/ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9440 | eHalStatus sme_SetEseRoamScanChannelList(tHalHandle hHal, |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9441 | tANI_U8 *pChannelList, |
| 9442 | tANI_U8 numChannels) |
| 9443 | { |
| 9444 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9445 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9446 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 9447 | tpCsrChannelInfo currChannelListInfo = &pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo; |
| 9448 | tANI_U8 oldChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
| 9449 | tANI_U8 newChannelList[128] = {0}; |
| 9450 | tANI_U8 i = 0, j = 0; |
| 9451 | |
| 9452 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9453 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9454 | { |
| 9455 | if (NULL != currChannelListInfo->ChannelList) |
| 9456 | { |
| 9457 | for (i = 0; i < currChannelListInfo->numOfChannels; i++) |
| 9458 | { |
| 9459 | j += snprintf(oldChannelList + j, sizeof(oldChannelList) - j," %d", |
| 9460 | currChannelListInfo->ChannelList[i]); |
| 9461 | } |
| 9462 | } |
| 9463 | status = csrCreateRoamScanChannelList(pMac, pChannelList, numChannels, csrGetCurrentBand(hHal)); |
| 9464 | |
| 9465 | if ( HAL_STATUS_SUCCESS( status )) |
| 9466 | { |
| 9467 | if (NULL != currChannelListInfo->ChannelList) |
| 9468 | { |
| 9469 | j = 0; |
| 9470 | for (i = 0; i < currChannelListInfo->numOfChannels; i++) |
| 9471 | { |
| 9472 | j += snprintf(newChannelList + j, sizeof(newChannelList) - j," %d", |
| 9473 | currChannelListInfo->ChannelList[i]); |
| 9474 | } |
| 9475 | } |
| 9476 | |
| 9477 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9478 | "ESE roam scan channel list successfully set to %s - old value is %s - roam state is %s", |
| 9479 | newChannelList, oldChannelList, |
| 9480 | macTraceGetNeighbourRoamState(pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9481 | } |
| 9482 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9483 | } |
| 9484 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9485 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9486 | { |
| 9487 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); |
| 9488 | } |
| 9489 | #endif |
| 9490 | |
| 9491 | return status ; |
| 9492 | } |
| 9493 | #endif |
| 9494 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9495 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9496 | \brief sme_getRoamScanChannelList() - get roam scan channel list |
| 9497 | This is a synchronous call |
| 9498 | \param hHal - The handle returned by macOpen. |
| 9499 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9500 | Other status means SME is failed to update |
| 9501 | \sa |
| 9502 | --------------------------------------------------------------------------*/ |
| 9503 | eHalStatus sme_getRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, |
| 9504 | tANI_U8 *pNumChannels) |
| 9505 | { |
| 9506 | int i = 0; |
| 9507 | tANI_U8 *pOutPtr = pChannelList; |
| 9508 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9509 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 9510 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9511 | |
| 9512 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9513 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9514 | { |
| 9515 | if (NULL == pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
| 9516 | { |
| 9517 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, |
| 9518 | "Roam Scan channel list is NOT yet initialized"); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9519 | *pNumChannels = 0; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9520 | sme_ReleaseGlobalLock( &pMac->sme ); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9521 | return status; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9522 | } |
| 9523 | |
| 9524 | *pNumChannels = pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; |
| 9525 | for (i = 0; i < (*pNumChannels); i++) |
| 9526 | { |
| 9527 | pOutPtr[i] = pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]; |
| 9528 | } |
| 9529 | pOutPtr[i] = '\0'; |
| 9530 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9531 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9532 | return status ; |
| 9533 | } |
| 9534 | |
| 9535 | /*-------------------------------------------------------------------------- |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9536 | \brief sme_getIsEseFeatureEnabled() - get Ese feature enabled or not |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9537 | This is a synchronuous call |
| 9538 | \param hHal - The handle returned by macOpen. |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9539 | \return TRUE (1) - if the Ese feature is enabled |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9540 | FALSE (0) - if feature is disabled (compile or runtime) |
| 9541 | \sa |
| 9542 | --------------------------------------------------------------------------*/ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9543 | tANI_BOOLEAN sme_getIsEseFeatureEnabled(tHalHandle hHal) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9544 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9545 | #ifdef FEATURE_WLAN_ESE |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9546 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9547 | return csrRoamIsEseIniFeatureEnabled(pMac); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9548 | #else |
| 9549 | return eANI_BOOLEAN_FALSE; |
| 9550 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9551 | } |
| 9552 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9553 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 9554 | \brief sme_GetWESMode() - get WES Mode |
| 9555 | This is a synchronous call |
| 9556 | \param hHal - The handle returned by macOpen |
| 9557 | \return v_U8_t - WES Mode Enabled(1)/Disabled(0) |
| 9558 | \sa |
| 9559 | --------------------------------------------------------------------------*/ |
| 9560 | v_BOOL_t sme_GetWESMode(tHalHandle hHal) |
| 9561 | { |
| 9562 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9563 | return pMac->roam.configParam.isWESModeEnabled; |
| 9564 | } |
| 9565 | |
| 9566 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9567 | \brief sme_GetRoamScanControl() - get scan control |
| 9568 | This is a synchronous call |
| 9569 | \param hHal - The handle returned by macOpen. |
| 9570 | \return v_BOOL_t - Enabled(1)/Disabled(0) |
| 9571 | \sa |
| 9572 | --------------------------------------------------------------------------*/ |
| 9573 | v_BOOL_t sme_GetRoamScanControl(tHalHandle hHal) |
| 9574 | { |
| 9575 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9576 | return pMac->roam.configParam.nRoamScanControl; |
| 9577 | } |
| 9578 | #endif |
| 9579 | |
| 9580 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9581 | \brief sme_getIsLfrFeatureEnabled() - get LFR feature enabled or not |
| 9582 | This is a synchronuous call |
| 9583 | \param hHal - The handle returned by macOpen. |
| 9584 | \return TRUE (1) - if the feature is enabled |
| 9585 | FALSE (0) - if feature is disabled (compile or runtime) |
| 9586 | \sa |
| 9587 | --------------------------------------------------------------------------*/ |
| 9588 | tANI_BOOLEAN sme_getIsLfrFeatureEnabled(tHalHandle hHal) |
| 9589 | { |
| 9590 | #ifdef FEATURE_WLAN_LFR |
| 9591 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9592 | return pMac->roam.configParam.isFastRoamIniFeatureEnabled; |
| 9593 | #else |
| 9594 | return eANI_BOOLEAN_FALSE; |
| 9595 | #endif |
| 9596 | } |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 9597 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9598 | /*-------------------------------------------------------------------------- |
| 9599 | \brief sme_getIsFtFeatureEnabled() - get FT feature enabled or not |
| 9600 | This is a synchronuous call |
| 9601 | \param hHal - The handle returned by macOpen. |
| 9602 | \return TRUE (1) - if the feature is enabled |
| 9603 | FALSE (0) - if feature is disabled (compile or runtime) |
| 9604 | \sa |
| 9605 | --------------------------------------------------------------------------*/ |
| 9606 | tANI_BOOLEAN sme_getIsFtFeatureEnabled(tHalHandle hHal) |
| 9607 | { |
| 9608 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 9609 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9610 | return pMac->roam.configParam.isFastTransitionEnabled; |
| 9611 | #else |
| 9612 | return eANI_BOOLEAN_FALSE; |
| 9613 | #endif |
| 9614 | } |
| 9615 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9616 | /* --------------------------------------------------------------------------- |
| 9617 | \fn sme_IsFeatureSupportedByFW |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9618 | |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 9619 | \brief Check if a feature is enabled by FW |
| 9620 | |
| 9621 | \param featEnumValue - Enumeration value from placeHolderInCapBitmap |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9622 | |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 9623 | \- return 1/0 (TRUE/FALSE) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9624 | -------------------------------------------------------------------------*/ |
| 9625 | tANI_U8 sme_IsFeatureSupportedByFW(tANI_U8 featEnumValue) |
| 9626 | { |
| 9627 | return IS_FEATURE_SUPPORTED_BY_FW(featEnumValue); |
| 9628 | } |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 9629 | |
| 9630 | /* --------------------------------------------------------------------------- |
| 9631 | \fn sme_IsFeatureSupportedByDriver |
| 9632 | \brief Check if a feature is enabled by Driver |
| 9633 | |
| 9634 | \param featEnumValue - Enumeration value from placeHolderInCapBitmap |
| 9635 | \- return 1/0 (TRUE/FALSE) |
| 9636 | -------------------------------------------------------------------------*/ |
| 9637 | |
| 9638 | tANI_U8 sme_IsFeatureSupportedByDriver(tANI_U8 featEnumValue) |
| 9639 | { |
| 9640 | return IS_FEATURE_SUPPORTED_BY_DRIVER(featEnumValue); |
| 9641 | } |
| 9642 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9643 | #ifdef FEATURE_WLAN_TDLS |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 9644 | |
| 9645 | /* --------------------------------------------------------------------------- |
| 9646 | \fn sme_SendTdlsMgmtFrame |
| 9647 | \brief API to send TDLS management frames. |
| 9648 | |
| 9649 | \param peerMac - peer's Mac Adress. |
| 9650 | \param tdlsLinkEstablishParams - TDLS Peer Link Establishment Parameters |
| 9651 | \- return VOS_STATUS_SUCCES |
| 9652 | -------------------------------------------------------------------------*/ |
| 9653 | VOS_STATUS sme_SendTdlsLinkEstablishParams(tHalHandle hHal, |
| 9654 | tANI_U8 sessionId, |
| 9655 | tSirMacAddr peerMac, |
| 9656 | tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams) |
| 9657 | { |
| 9658 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9659 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9660 | |
| 9661 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9662 | |
| 9663 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9664 | { |
| 9665 | status = csrTdlsSendLinkEstablishParams(hHal, sessionId, peerMac, tdlsLinkEstablishParams) ; |
| 9666 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9667 | } |
| 9668 | return status ; |
| 9669 | } |
| 9670 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9671 | /* --------------------------------------------------------------------------- |
| 9672 | \fn sme_SendTdlsMgmtFrame |
| 9673 | \brief API to send TDLS management frames. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9674 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9675 | \param peerMac - peer's Mac Adress. |
| 9676 | \param frame_type - Type of TDLS mgmt frame to be sent. |
| 9677 | \param dialog - dialog token used in the frame. |
| 9678 | \param status - status to be incuded in the frame. |
Pradeep Reddy POTTETI | ca171f8 | 2014-03-21 14:17:35 +0530 | [diff] [blame] | 9679 | \param peerCapability - peer cpabilities |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9680 | \param buf - additional IEs to be included |
| 9681 | \param len - lenght of additional Ies |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 9682 | \param responder - Tdls request type |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9683 | \- return VOS_STATUS_SUCCES |
| 9684 | -------------------------------------------------------------------------*/ |
| 9685 | VOS_STATUS sme_SendTdlsMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, |
Pradeep Reddy POTTETI | ca171f8 | 2014-03-21 14:17:35 +0530 | [diff] [blame] | 9686 | tANI_U8 frame_type, tANI_U8 dialog, tANI_U16 statusCode, tANI_U32 peerCapability, tANI_U8 *buf, tANI_U8 len, tANI_U8 responder) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9687 | { |
| 9688 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9689 | tCsrTdlsSendMgmt sendTdlsReq = {{0}} ; |
| 9690 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9691 | |
| 9692 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9693 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9694 | { |
| 9695 | vos_mem_copy(sendTdlsReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 9696 | sendTdlsReq.frameType = frame_type; |
| 9697 | sendTdlsReq.buf = buf; |
| 9698 | sendTdlsReq.len = len; |
| 9699 | sendTdlsReq.dialog = dialog; |
| 9700 | sendTdlsReq.statusCode = statusCode; |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 9701 | sendTdlsReq.responder = responder; |
Pradeep Reddy POTTETI | ca171f8 | 2014-03-21 14:17:35 +0530 | [diff] [blame] | 9702 | sendTdlsReq.peerCapability = peerCapability; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9703 | |
| 9704 | status = csrTdlsSendMgmtReq(hHal, sessionId, &sendTdlsReq) ; |
| 9705 | |
| 9706 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9707 | } |
| 9708 | |
| 9709 | return status ; |
| 9710 | |
| 9711 | } |
| 9712 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 9713 | \fn sme_ChangeTdlsPeerSta |
| 9714 | \brief API to Update TDLS peer sta parameters. |
| 9715 | |
| 9716 | \param peerMac - peer's Mac Adress. |
| 9717 | \param staParams - Peer Station Parameters |
| 9718 | \- return VOS_STATUS_SUCCES |
| 9719 | -------------------------------------------------------------------------*/ |
| 9720 | VOS_STATUS sme_ChangeTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, |
| 9721 | tCsrStaParams *pstaParams) |
| 9722 | { |
| 9723 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9724 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9725 | |
Sushant Kaushik | d62d978 | 2014-02-19 15:39:40 +0530 | [diff] [blame] | 9726 | if (NULL == pstaParams) |
| 9727 | { |
| 9728 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 9729 | "%s :pstaParams is NULL",__func__); |
| 9730 | return eHAL_STATUS_FAILURE; |
| 9731 | } |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 9732 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9733 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9734 | { |
| 9735 | status = csrTdlsChangePeerSta(hHal, sessionId, peerMac,pstaParams); |
| 9736 | |
| 9737 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9738 | } |
| 9739 | |
| 9740 | return status ; |
| 9741 | |
| 9742 | } |
| 9743 | |
| 9744 | /* --------------------------------------------------------------------------- |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9745 | \fn sme_AddTdlsPeerSta |
| 9746 | \brief API to Add TDLS peer sta entry. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9747 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9748 | \param peerMac - peer's Mac Adress. |
| 9749 | \- return VOS_STATUS_SUCCES |
| 9750 | -------------------------------------------------------------------------*/ |
| 9751 | VOS_STATUS sme_AddTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 9752 | { |
| 9753 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9754 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9755 | |
| 9756 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9757 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9758 | { |
| 9759 | status = csrTdlsAddPeerSta(hHal, sessionId, peerMac); |
| 9760 | |
| 9761 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9762 | } |
| 9763 | |
| 9764 | return status ; |
| 9765 | |
| 9766 | } |
| 9767 | /* --------------------------------------------------------------------------- |
| 9768 | \fn sme_DeleteTdlsPeerSta |
| 9769 | \brief API to Delete TDLS peer sta entry. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9770 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9771 | \param peerMac - peer's Mac Adress. |
| 9772 | \- return VOS_STATUS_SUCCES |
| 9773 | -------------------------------------------------------------------------*/ |
| 9774 | VOS_STATUS sme_DeleteTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 9775 | { |
| 9776 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9777 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9778 | |
| 9779 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9780 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9781 | { |
| 9782 | status = csrTdlsDelPeerSta(hHal, sessionId, peerMac) ; |
| 9783 | |
| 9784 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9785 | } |
| 9786 | |
| 9787 | return status ; |
| 9788 | |
| 9789 | } |
Gopichand Nakkala | 75e7b28 | 2013-03-15 18:37:13 -0700 | [diff] [blame] | 9790 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | ccd3a38 | 2013-03-19 13:56:10 -0700 | [diff] [blame] | 9791 | \fn sme_SetTdlsPowerSaveProhibited |
| 9792 | \API to set/reset the isTdlsPowerSaveProhibited. |
| 9793 | |
| 9794 | \- return void |
| 9795 | -------------------------------------------------------------------------*/ |
| 9796 | void sme_SetTdlsPowerSaveProhibited(tHalHandle hHal, v_BOOL_t val) |
| 9797 | { |
| 9798 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9799 | |
| 9800 | pMac->isTdlsPowerSaveProhibited = val; |
| 9801 | return; |
| 9802 | } |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9803 | #endif |
Gopichand Nakkala | fe7246d | 2013-06-10 17:43:37 +0530 | [diff] [blame] | 9804 | /* --------------------------------------------------------------------------- |
| 9805 | \fn sme_IsPmcBmps |
| 9806 | \API to Check if PMC state is BMPS. |
| 9807 | |
| 9808 | \- return v_BOOL_t |
| 9809 | -------------------------------------------------------------------------*/ |
| 9810 | v_BOOL_t sme_IsPmcBmps(tHalHandle hHal) |
| 9811 | { |
| 9812 | return (BMPS == pmcGetPmcState(hHal)); |
| 9813 | } |
| 9814 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9815 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 9816 | /* |
| 9817 | * SME API to start TDLS discovery Procedure |
| 9818 | */ |
| 9819 | VOS_STATUS sme_StartTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 9820 | { |
| 9821 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 9822 | tCsrTdlsDisRequest disReq = {{0}} ; |
| 9823 | vos_mem_copy(disReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 9824 | status = csrTdlsDiscoveryReq(hHal, sessionId, &disReq) ; |
| 9825 | |
| 9826 | return status ; |
| 9827 | |
| 9828 | } |
| 9829 | |
| 9830 | /* |
| 9831 | * Process TDLS discovery results |
| 9832 | */ |
| 9833 | v_U8_t sme_GetTdlsDiscoveryResult(tHalHandle hHal, |
| 9834 | tSmeTdlsDisResult *disResult, v_U8_t listType) |
| 9835 | { |
| 9836 | tCsrTdlsPeerLinkinfo *peerLinkInfo = NULL ; |
| 9837 | tSirTdlsPeerInfo *peerInfo = NULL ; |
| 9838 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9839 | tCsrTdlsCtxStruct *disInfo = &pMac->tdlsCtx ; |
| 9840 | tDblLinkList *peerList = &disInfo->tdlsPotentialPeerList ; |
| 9841 | tListElem *pEntry = NULL ; |
| 9842 | v_U8_t peerCnt = 0 ; |
| 9843 | |
| 9844 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 9845 | ("TDLS peer count = %d"),disInfo->tdlsPeerCount ) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9846 | pEntry = csrLLPeekHead( peerList, LL_ACCESS_LOCK ); |
| 9847 | while(pEntry) |
| 9848 | { |
| 9849 | peerLinkInfo = GET_BASE_ADDR( pEntry, tCsrTdlsPeerLinkinfo, |
| 9850 | tdlsPeerStaLink) ; |
| 9851 | peerInfo = &peerLinkInfo->tdlsDisPeerInfo ; |
| 9852 | |
| 9853 | switch(listType) |
| 9854 | { |
| 9855 | case TDLS_SETUP_LIST: |
| 9856 | { |
| 9857 | if(TDLS_LINK_SETUP_STATE == peerInfo->tdlsPeerState) |
| 9858 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 9859 | vos_mem_copy(disResult[peerCnt].tdlsPeerMac, |
| 9860 | peerInfo->peerMac, sizeof(tSirMacAddr)); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9861 | disResult[peerCnt].tdlsPeerRssi = peerInfo->tdlsPeerRssi ; |
| 9862 | peerCnt++ ; |
| 9863 | } |
| 9864 | break ; |
| 9865 | } |
| 9866 | case TDLS_DIS_LIST: |
| 9867 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 9868 | vos_mem_copy(disResult[peerCnt].tdlsPeerMac, |
| 9869 | peerInfo->peerMac, sizeof(tSirMacAddr)); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9870 | disResult[peerCnt].tdlsPeerRssi = peerInfo->tdlsPeerRssi ; |
| 9871 | peerCnt++ ; |
| 9872 | break ; |
| 9873 | } |
| 9874 | default: |
| 9875 | { |
| 9876 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 9877 | ("unknown list type ")) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9878 | break ; |
| 9879 | } |
| 9880 | } |
| 9881 | |
| 9882 | pEntry = csrLLNext( peerList, pEntry, LL_ACCESS_LOCK) ; |
| 9883 | } |
| 9884 | |
| 9885 | return peerCnt ; |
| 9886 | |
| 9887 | } |
| 9888 | |
| 9889 | /* |
| 9890 | * SME API to start TDLS link setup Procedure. |
| 9891 | */ |
| 9892 | VOS_STATUS sme_StartTdlsLinkSetupReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 9893 | { |
| 9894 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 9895 | tCsrTdlsSetupRequest setupReq = {{0}} ; |
| 9896 | vos_mem_copy(setupReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 9897 | status = csrTdlsSetupReq(hHal, sessionId, &setupReq) ; |
| 9898 | return status ; |
| 9899 | |
| 9900 | } |
| 9901 | |
| 9902 | /* |
| 9903 | * SME API to start TDLS link Teardown Procedure. |
| 9904 | */ |
| 9905 | VOS_STATUS sme_StartTdlsLinkTeardownReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 9906 | { |
| 9907 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 9908 | tCsrTdlsTeardownRequest teardownReq = {{0}} ; |
| 9909 | vos_mem_copy(teardownReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 9910 | status = csrTdlsTeardownReq(hHal, sessionId, &teardownReq) ; |
| 9911 | return status ; |
| 9912 | |
| 9913 | } |
| 9914 | |
| 9915 | #endif /* FEATURE_WLAN_TDLS */ |
| 9916 | |
Tushnim Bhattacharyya | 9cdf608 | 2013-04-21 16:33:30 -0700 | [diff] [blame] | 9917 | eHalStatus sme_UpdateDfsSetting(tHalHandle hHal, tANI_U8 fUpdateEnableDFSChnlScan) |
| 9918 | { |
| 9919 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 9920 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9921 | |
| 9922 | smsLog(pMac, LOG2, FL("enter")); |
| 9923 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9924 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9925 | { |
| 9926 | pMac->scan.fEnableDFSChnlScan = fUpdateEnableDFSChnlScan; |
| 9927 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9928 | } |
| 9929 | smsLog(pMac, LOG2, FL("exit status %d"), status); |
| 9930 | |
| 9931 | return (status); |
| 9932 | } |
| 9933 | |
Gopichand Nakkala | e620d5a | 2013-04-26 05:45:57 -0700 | [diff] [blame] | 9934 | /* |
| 9935 | * SME API to enable/disable WLAN driver initiated SSR |
| 9936 | */ |
| 9937 | void sme_UpdateEnableSSR(tHalHandle hHal, tANI_BOOLEAN enableSSR) |
| 9938 | { |
| 9939 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9940 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9941 | |
| 9942 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 9943 | if (HAL_STATUS_SUCCESS(status)) |
| 9944 | { |
| 9945 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 9946 | "SSR level is changed %d", enableSSR); |
| 9947 | /* not serializing this messsage, as this is only going |
| 9948 | * to set a variable in WDA/WDI |
| 9949 | */ |
| 9950 | WDA_SetEnableSSR(enableSSR); |
| 9951 | sme_ReleaseGlobalLock(&pMac->sme); |
| 9952 | } |
| 9953 | return; |
| 9954 | } |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 9955 | |
| 9956 | /* |
| 9957 | * SME API to determine the channel bonding mode |
| 9958 | */ |
| 9959 | VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 channel) |
| 9960 | { |
| 9961 | tSmeConfigParams smeConfig; |
| 9962 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9963 | |
| 9964 | if ( |
| 9965 | #ifdef WLAN_FEATURE_11AC |
| 9966 | eCSR_DOT11_MODE_11ac != eCsrPhyMode && |
| 9967 | eCSR_DOT11_MODE_11ac_ONLY != eCsrPhyMode && |
| 9968 | #endif |
| 9969 | eCSR_DOT11_MODE_11n != eCsrPhyMode && |
krunal soni | 634aba3 | 2014-03-06 17:46:50 -0800 | [diff] [blame] | 9970 | eCSR_DOT11_MODE_11n_ONLY != eCsrPhyMode && |
| 9971 | |
| 9972 | eCSR_DOT11_MODE_11a != eCsrPhyMode && |
| 9973 | eCSR_DOT11_MODE_11a_ONLY != eCsrPhyMode && |
| 9974 | |
| 9975 | eCSR_DOT11_MODE_abg != eCsrPhyMode |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 9976 | ) |
| 9977 | { |
| 9978 | return VOS_STATUS_SUCCESS; |
| 9979 | } |
| 9980 | |
| 9981 | /* If channel bonding mode is not required */ |
| 9982 | if ( !pMac->roam.configParam.channelBondingMode5GHz ) { |
| 9983 | return VOS_STATUS_SUCCESS; |
| 9984 | } |
| 9985 | |
| 9986 | vos_mem_zero(&smeConfig, sizeof (tSmeConfigParams)); |
| 9987 | sme_GetConfigParam(pMac, &smeConfig); |
| 9988 | |
| 9989 | #ifdef WLAN_FEATURE_11AC |
| 9990 | if ( eCSR_DOT11_MODE_11ac == eCsrPhyMode || |
| 9991 | eCSR_DOT11_MODE_11ac_ONLY == eCsrPhyMode ) |
| 9992 | { |
| 9993 | if ( channel== 36 || channel == 52 || channel == 100 || |
| 9994 | channel == 116 || channel == 149 ) |
| 9995 | { |
| 9996 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 9997 | PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW - 1; |
| 9998 | } |
| 9999 | else if ( channel == 40 || channel == 56 || channel == 104 || |
| 10000 | channel == 120 || channel == 153 ) |
| 10001 | { |
| 10002 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 10003 | PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW - 1; |
| 10004 | } |
| 10005 | else if ( channel == 44 || channel == 60 || channel == 108 || |
| 10006 | channel == 124 || channel == 157 ) |
| 10007 | { |
| 10008 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 10009 | PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH -1; |
| 10010 | } |
| 10011 | else if ( channel == 48 || channel == 64 || channel == 112 || |
Leo Chang | d0a4984 | 2013-12-30 11:41:04 -0800 | [diff] [blame] | 10012 | channel == 128 || channel == 144 || channel == 161 ) |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10013 | { |
| 10014 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 10015 | PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH - 1; |
| 10016 | } |
| 10017 | else if ( channel == 165 ) |
| 10018 | { |
| 10019 | smeConfig.csrConfig.channelBondingMode5GHz = 0; |
| 10020 | } |
| 10021 | } |
| 10022 | #endif |
| 10023 | |
| 10024 | if ( eCSR_DOT11_MODE_11n == eCsrPhyMode || |
| 10025 | eCSR_DOT11_MODE_11n_ONLY == eCsrPhyMode ) |
| 10026 | { |
| 10027 | if ( channel== 40 || channel == 48 || channel == 56 || |
| 10028 | channel == 64 || channel == 104 || channel == 112 || |
| 10029 | channel == 120 || channel == 128 || channel == 136 || |
| 10030 | channel == 144 || channel == 153 || channel == 161 ) |
| 10031 | { |
| 10032 | smeConfig.csrConfig.channelBondingMode5GHz = 1; |
| 10033 | } |
| 10034 | else if ( channel== 36 || channel == 44 || channel == 52 || |
| 10035 | channel == 60 || channel == 100 || channel == 108 || |
| 10036 | channel == 116 || channel == 124 || channel == 132 || |
| 10037 | channel == 140 || channel == 149 || channel == 157 ) |
| 10038 | { |
| 10039 | smeConfig.csrConfig.channelBondingMode5GHz = 2; |
| 10040 | } |
| 10041 | else if ( channel == 165 ) |
| 10042 | { |
| 10043 | smeConfig.csrConfig.channelBondingMode5GHz = 0; |
| 10044 | } |
| 10045 | } |
krunal soni | 634aba3 | 2014-03-06 17:46:50 -0800 | [diff] [blame] | 10046 | |
| 10047 | /* |
| 10048 | for 802.11a phy mode, channel bonding should be zero. |
| 10049 | From default config, it is set as PHY_DOUBLE_CHANNEL_HIGH_PRIMARY = 3 |
| 10050 | through csrChangeDefaultConfigParam function. We will override this |
| 10051 | value here. |
| 10052 | */ |
| 10053 | if ( eCSR_DOT11_MODE_11a == eCsrPhyMode || |
| 10054 | eCSR_DOT11_MODE_11a_ONLY == eCsrPhyMode || |
| 10055 | eCSR_DOT11_MODE_abg == eCsrPhyMode) |
| 10056 | { |
| 10057 | smeConfig.csrConfig.channelBondingMode5GHz = 0; |
| 10058 | } |
| 10059 | |
Agarwal Ashish | bf98caf | 2014-03-25 13:29:11 +0530 | [diff] [blame] | 10060 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, |
Jeff Johnson | ce8ad51 | 2013-10-30 12:34:42 -0700 | [diff] [blame] | 10061 | "cbmode selected=%d", smeConfig.csrConfig.channelBondingMode5GHz); |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10062 | |
| 10063 | sme_UpdateConfig (pMac, &smeConfig); |
| 10064 | return VOS_STATUS_SUCCESS; |
| 10065 | } |
| 10066 | |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 10067 | /*-------------------------------------------------------------------------- |
| 10068 | |
| 10069 | \brief sme_SetCurrDeviceMode() - Sets the current operating device mode. |
| 10070 | \param hHal - The handle returned by macOpen. |
| 10071 | \param currDeviceMode - Current operating device mode. |
| 10072 | --------------------------------------------------------------------------*/ |
| 10073 | |
| 10074 | void sme_SetCurrDeviceMode (tHalHandle hHal, tVOS_CON_MODE currDeviceMode) |
| 10075 | { |
| 10076 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10077 | pMac->sme.currDeviceMode = currDeviceMode; |
| 10078 | return; |
| 10079 | } |
| 10080 | |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 10081 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 10082 | /*-------------------------------------------------------------------------- |
| 10083 | \brief sme_HandoffRequest() - a wrapper function to Request a handoff |
| 10084 | from CSR. |
| 10085 | This is a synchronous call |
| 10086 | \param hHal - The handle returned by macOpen |
| 10087 | \param pHandoffInfo - info provided by HDD with the handoff request (namely: |
| 10088 | BSSID, channel etc.) |
| 10089 | \return eHAL_STATUS_SUCCESS - SME passed the request to CSR successfully. |
| 10090 | Other status means SME is failed to send the request. |
| 10091 | \sa |
| 10092 | --------------------------------------------------------------------------*/ |
| 10093 | |
| 10094 | eHalStatus sme_HandoffRequest(tHalHandle hHal, |
| 10095 | tCsrHandoffRequest *pHandoffInfo) |
| 10096 | { |
| 10097 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10098 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10099 | |
| 10100 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10101 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10102 | { |
| 10103 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10104 | "%s: invoked", __func__); |
| 10105 | status = csrHandoffRequest(pMac, pHandoffInfo); |
| 10106 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10107 | } |
| 10108 | |
| 10109 | return status ; |
| 10110 | } |
| 10111 | #endif |
| 10112 | |
Sudhir Sattayappa Kohalli | b1d8c3a | 2013-06-18 14:47:20 -0700 | [diff] [blame] | 10113 | /* |
| 10114 | * SME API to check if there is any infra station or |
| 10115 | * P2P client is connected |
| 10116 | */ |
| 10117 | VOS_STATUS sme_isSta_p2p_clientConnected(tHalHandle hHal) |
| 10118 | { |
| 10119 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10120 | if(csrIsInfraConnected(pMac)) |
| 10121 | { |
| 10122 | return VOS_STATUS_SUCCESS; |
| 10123 | } |
| 10124 | return VOS_STATUS_E_FAILURE; |
| 10125 | } |
| 10126 | |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10127 | |
| 10128 | #ifdef FEATURE_WLAN_LPHB |
| 10129 | /* --------------------------------------------------------------------------- |
| 10130 | \fn sme_LPHBConfigReq |
| 10131 | \API to make configuration LPHB within FW. |
| 10132 | \param hHal - The handle returned by macOpen |
| 10133 | \param lphdReq - LPHB request argument by client |
| 10134 | \param pCallbackfn - LPHB timeout notification callback function pointer |
| 10135 | \- return Configuration message posting status, SUCCESS or Fail |
| 10136 | -------------------------------------------------------------------------*/ |
| 10137 | eHalStatus sme_LPHBConfigReq |
| 10138 | ( |
| 10139 | tHalHandle hHal, |
| 10140 | tSirLPHBReq *lphdReq, |
| 10141 | void (*pCallbackfn)(void *pAdapter, void *indParam) |
| 10142 | ) |
| 10143 | { |
| 10144 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10145 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 10146 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10147 | vos_msg_t vosMessage; |
| 10148 | |
| 10149 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 10150 | if (eHAL_STATUS_SUCCESS == status) |
| 10151 | { |
| 10152 | if ((LPHB_SET_EN_PARAMS_INDID == lphdReq->cmd) && |
| 10153 | (NULL == pCallbackfn) && |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 10154 | (NULL == pMac->sme.pLphbIndCb)) |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10155 | { |
| 10156 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10157 | "%s: Indication Call back did not registered", __func__); |
| 10158 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10159 | return eHAL_STATUS_FAILURE; |
| 10160 | } |
| 10161 | else if (NULL != pCallbackfn) |
| 10162 | { |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 10163 | pMac->sme.pLphbIndCb = pCallbackfn; |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10164 | } |
| 10165 | |
| 10166 | /* serialize the req through MC thread */ |
| 10167 | vosMessage.bodyptr = lphdReq; |
| 10168 | vosMessage.type = WDA_LPHB_CONF_REQ; |
| 10169 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 10170 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 10171 | { |
| 10172 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10173 | "%s: Post Config LPHB MSG fail", __func__); |
| 10174 | status = eHAL_STATUS_FAILURE; |
| 10175 | } |
| 10176 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10177 | } |
| 10178 | |
| 10179 | return(status); |
| 10180 | } |
| 10181 | #endif /* FEATURE_WLAN_LPHB */ |
Sudhir Sattayappa Kohalli | 3762069 | 2013-08-05 14:02:26 -0700 | [diff] [blame] | 10182 | /*-------------------------------------------------------------------------- |
| 10183 | \brief sme_enable_disable_split_scan() - a wrapper function to set the split |
| 10184 | scan parameter. |
| 10185 | This is a synchronous call |
| 10186 | \param hHal - The handle returned by macOpen |
| 10187 | \return NONE. |
| 10188 | \sa |
| 10189 | --------------------------------------------------------------------------*/ |
| 10190 | void sme_enable_disable_split_scan (tHalHandle hHal, tANI_U8 nNumStaChan, |
| 10191 | tANI_U8 nNumP2PChan) |
| 10192 | { |
| 10193 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10194 | |
| 10195 | pMac->roam.configParam.nNumStaChanCombinedConc = nNumStaChan; |
| 10196 | pMac->roam.configParam.nNumP2PChanCombinedConc = nNumP2PChan; |
| 10197 | |
| 10198 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10199 | "%s: SCAN nNumStaChanCombinedConc : %d," |
| 10200 | "nNumP2PChanCombinedConc : %d ", |
| 10201 | __func__, nNumStaChan, nNumP2PChan); |
| 10202 | |
| 10203 | return; |
| 10204 | |
| 10205 | } |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10206 | |
Yue Ma | b9c86f4 | 2013-08-14 15:59:08 -0700 | [diff] [blame] | 10207 | /* --------------------------------------------------------------------------- |
| 10208 | \fn sme_AddPeriodicTxPtrn |
| 10209 | \brief API to Periodic TX Pattern Offload feature |
| 10210 | \param hHal - The handle returned by macOpen |
| 10211 | \param addPeriodicTxPtrnParams - Pointer to the add pattern structure |
| 10212 | \return eHalStatus |
| 10213 | ---------------------------------------------------------------------------*/ |
| 10214 | eHalStatus sme_AddPeriodicTxPtrn(tHalHandle hHal, tSirAddPeriodicTxPtrn |
| 10215 | *addPeriodicTxPtrnParams) |
| 10216 | { |
| 10217 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10218 | eHalStatus status; |
| 10219 | vos_msg_t msg; |
| 10220 | |
| 10221 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 10222 | { |
| 10223 | msg.type = WDA_ADD_PERIODIC_TX_PTRN_IND; |
| 10224 | msg.bodyptr = addPeriodicTxPtrnParams; |
| 10225 | |
| 10226 | if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 10227 | { |
| 10228 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " |
| 10229 | "to post WDA_ADD_PERIODIC_TX_PTRN_IND to WDA!", |
| 10230 | __func__); |
| 10231 | |
| 10232 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10233 | return eHAL_STATUS_FAILURE; |
| 10234 | } |
| 10235 | |
| 10236 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10237 | return eHAL_STATUS_SUCCESS; |
| 10238 | } |
| 10239 | |
| 10240 | return status; |
| 10241 | } |
| 10242 | |
| 10243 | /* --------------------------------------------------------------------------- |
| 10244 | \fn sme_DelPeriodicTxPtrn |
| 10245 | \brief API to Periodic TX Pattern Offload feature |
| 10246 | \param hHal - The handle returned by macOpen |
| 10247 | \param delPeriodicTxPtrnParams - Pointer to the delete pattern structure |
| 10248 | \return eHalStatus |
| 10249 | ---------------------------------------------------------------------------*/ |
| 10250 | eHalStatus sme_DelPeriodicTxPtrn(tHalHandle hHal, tSirDelPeriodicTxPtrn |
| 10251 | *delPeriodicTxPtrnParams) |
| 10252 | { |
| 10253 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10254 | eHalStatus status; |
| 10255 | vos_msg_t msg; |
| 10256 | |
| 10257 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 10258 | { |
| 10259 | msg.type = WDA_DEL_PERIODIC_TX_PTRN_IND; |
| 10260 | msg.bodyptr = delPeriodicTxPtrnParams; |
| 10261 | |
| 10262 | if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 10263 | { |
| 10264 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " |
| 10265 | "to post WDA_DEL_PERIODIC_TX_PTRN_IND to WDA!", |
| 10266 | __func__); |
| 10267 | |
| 10268 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10269 | return eHAL_STATUS_FAILURE; |
| 10270 | } |
| 10271 | |
| 10272 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10273 | return eHAL_STATUS_SUCCESS; |
| 10274 | } |
| 10275 | |
| 10276 | return status; |
| 10277 | } |
| 10278 | |
Tushnim Bhattacharyya | ad37df1 | 2013-10-02 12:01:33 -0700 | [diff] [blame] | 10279 | void smeGetCommandQStatus( tHalHandle hHal ) |
| 10280 | { |
| 10281 | tSmeCmd *pTempCmd = NULL; |
| 10282 | tListElem *pEntry; |
| 10283 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10284 | |
| 10285 | if (NULL == pMac) |
| 10286 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 10287 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 10288 | "%s: pMac is null", __func__); |
Tushnim Bhattacharyya | ad37df1 | 2013-10-02 12:01:33 -0700 | [diff] [blame] | 10289 | return; |
| 10290 | } |
| 10291 | |
| 10292 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK ); |
| 10293 | if( pEntry ) |
| 10294 | { |
| 10295 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 10296 | } |
| 10297 | smsLog( pMac, LOGE, "Currently smeCmdActiveList has command (0x%X)", |
| 10298 | (pTempCmd) ? pTempCmd->command : eSmeNoCommand ); |
| 10299 | if(pTempCmd) |
| 10300 | { |
| 10301 | if( eSmeCsrCommandMask & pTempCmd->command ) |
| 10302 | { |
| 10303 | //CSR command is stuck. See what the reason code is for that command |
| 10304 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 10305 | } |
| 10306 | } //if(pTempCmd) |
| 10307 | |
| 10308 | smsLog( pMac, LOGE, "Currently smeCmdPendingList has %d commands", |
| 10309 | csrLLCount(&pMac->sme.smeCmdPendingList)); |
| 10310 | |
| 10311 | smsLog( pMac, LOGE, "Currently roamCmdPendingList has %d commands", |
| 10312 | csrLLCount(&pMac->roam.roamCmdPendingList)); |
| 10313 | |
| 10314 | return; |
| 10315 | } |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 10316 | |
| 10317 | #ifdef FEATURE_WLAN_BATCH_SCAN |
| 10318 | /* --------------------------------------------------------------------------- |
| 10319 | \fn sme_SetBatchScanReq |
| 10320 | \brief API to set batch scan request in FW |
| 10321 | \param hHal - The handle returned by macOpen. |
| 10322 | \param pRequest - Pointer to the batch request. |
| 10323 | \param sessionId - session ID |
| 10324 | \param callbackRoutine - HDD callback which needs to be invoked after |
| 10325 | getting set batch scan response from FW |
| 10326 | \param callbackContext - pAdapter context |
| 10327 | \return eHalStatus |
| 10328 | ---------------------------------------------------------------------------*/ |
| 10329 | eHalStatus sme_SetBatchScanReq |
| 10330 | ( |
| 10331 | tHalHandle hHal, tSirSetBatchScanReq *pRequest, tANI_U8 sessionId, |
| 10332 | void (*callbackRoutine) (void *callbackCtx, tSirSetBatchScanRsp *pRsp), |
| 10333 | void *callbackContext |
| 10334 | ) |
| 10335 | { |
| 10336 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10337 | eHalStatus status; |
| 10338 | |
Yue Ma | e36e355 | 2014-03-05 17:06:20 -0800 | [diff] [blame] | 10339 | if (!pMac) |
| 10340 | { |
| 10341 | return eHAL_STATUS_FAILURE; |
| 10342 | } |
| 10343 | |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 10344 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 10345 | { |
| 10346 | status = pmcSetBatchScanReq(hHal, pRequest, sessionId, callbackRoutine, |
| 10347 | callbackContext); |
| 10348 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10349 | } |
| 10350 | |
| 10351 | return status; |
| 10352 | } |
| 10353 | |
| 10354 | /* --------------------------------------------------------------------------- |
Chittajit Mitra | f5413a4 | 2013-10-18 14:20:08 -0700 | [diff] [blame] | 10355 | \fn sme_SendRateUpdateInd |
| 10356 | \brief API to Update rate |
| 10357 | \param hHal - The handle returned by macOpen |
| 10358 | \param rateUpdateParams - Pointer to rate update params |
| 10359 | \return eHalStatus |
| 10360 | ---------------------------------------------------------------------------*/ |
| 10361 | eHalStatus sme_SendRateUpdateInd(tHalHandle hHal, tSirRateUpdateInd *rateUpdateParams) |
| 10362 | { |
| 10363 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10364 | eHalStatus status; |
| 10365 | vos_msg_t msg; |
| 10366 | |
| 10367 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 10368 | { |
| 10369 | msg.type = WDA_RATE_UPDATE_IND; |
| 10370 | msg.bodyptr = rateUpdateParams; |
| 10371 | |
| 10372 | if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 10373 | { |
| 10374 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " |
| 10375 | "to post WDA_SET_RMC_RATE_IND to WDA!", |
| 10376 | __func__); |
| 10377 | |
| 10378 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10379 | return eHAL_STATUS_FAILURE; |
| 10380 | } |
| 10381 | |
| 10382 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10383 | return eHAL_STATUS_SUCCESS; |
| 10384 | } |
| 10385 | |
| 10386 | return status; |
| 10387 | } |
| 10388 | |
| 10389 | /* --------------------------------------------------------------------------- |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 10390 | \fn sme_TriggerBatchScanResultInd |
| 10391 | \brief API to trigger batch scan result indications from FW |
| 10392 | \param hHal - The handle returned by macOpen. |
| 10393 | \param pRequest - Pointer to get batch request. |
| 10394 | \param sessionId - session ID |
| 10395 | \param callbackRoutine - HDD callback which needs to be invoked after |
| 10396 | getting batch scan result indication from FW |
| 10397 | \param callbackContext - pAdapter context |
| 10398 | \return eHalStatus |
| 10399 | ---------------------------------------------------------------------------*/ |
| 10400 | eHalStatus sme_TriggerBatchScanResultInd |
| 10401 | ( |
| 10402 | tHalHandle hHal, tSirTriggerBatchScanResultInd *pRequest, tANI_U8 sessionId, |
| 10403 | void (*callbackRoutine) (void *callbackCtx, void *pRsp), |
| 10404 | void *callbackContext |
| 10405 | ) |
| 10406 | { |
| 10407 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10408 | eHalStatus status; |
| 10409 | |
| 10410 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 10411 | { |
| 10412 | status = pmcTriggerBatchScanResultInd(hHal, pRequest, sessionId, |
| 10413 | callbackRoutine, callbackContext); |
| 10414 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10415 | } |
| 10416 | |
| 10417 | return status; |
| 10418 | } |
| 10419 | |
| 10420 | |
| 10421 | /* --------------------------------------------------------------------------- |
| 10422 | \fn sme_StopBatchScanInd |
| 10423 | \brief API to stop batch scan request in FW |
| 10424 | \param hHal - The handle returned by macOpen. |
| 10425 | \param pRequest - Pointer to the batch request. |
| 10426 | \param sessionId - session ID |
| 10427 | \return eHalStatus |
| 10428 | ---------------------------------------------------------------------------*/ |
| 10429 | eHalStatus sme_StopBatchScanInd |
| 10430 | ( |
| 10431 | tHalHandle hHal, tSirStopBatchScanInd *pRequest, tANI_U8 sessionId |
| 10432 | ) |
| 10433 | { |
| 10434 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10435 | eHalStatus status; |
| 10436 | |
| 10437 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 10438 | { |
| 10439 | status = pmcStopBatchScanInd(hHal, pRequest, sessionId); |
| 10440 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10441 | } |
| 10442 | |
| 10443 | return status; |
| 10444 | } |
| 10445 | |
| 10446 | #endif |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 10447 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10448 | |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 10449 | #ifdef FEATURE_WLAN_CH_AVOID |
| 10450 | /* --------------------------------------------------------------------------- |
| 10451 | \fn sme_AddChAvoidCallback |
| 10452 | \brief Used to plug in callback function |
| 10453 | Which notify channel may not be used with SAP or P2PGO mode. |
| 10454 | Notification come from FW. |
| 10455 | \param hHal |
| 10456 | \param pCallbackfn : callback function pointer should be plugged in |
| 10457 | \- return eHalStatus |
| 10458 | -------------------------------------------------------------------------*/ |
| 10459 | eHalStatus sme_AddChAvoidCallback |
| 10460 | ( |
| 10461 | tHalHandle hHal, |
| 10462 | void (*pCallbackfn)(void *pAdapter, void *indParam) |
| 10463 | ) |
| 10464 | { |
| 10465 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10466 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10467 | |
| 10468 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10469 | "%s: Plug in CH AVOID CB", __func__); |
| 10470 | |
| 10471 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 10472 | if (eHAL_STATUS_SUCCESS == status) |
| 10473 | { |
| 10474 | if (NULL != pCallbackfn) |
| 10475 | { |
| 10476 | pMac->sme.pChAvoidNotificationCb = pCallbackfn; |
| 10477 | } |
| 10478 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10479 | } |
| 10480 | |
| 10481 | return(status); |
| 10482 | } |
| 10483 | #endif /* FEATURE_WLAN_CH_AVOID */ |
| 10484 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10485 | |
| 10486 | void activeListCmdTimeoutHandle(void *userData) |
| 10487 | { |
| 10488 | if (NULL == userData) |
| 10489 | return; |
| 10490 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10491 | "%s: Active List command timeout Cmd List Count %d", __func__, |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 10492 | csrLLCount(&((tpAniSirGlobal) userData)->sme.smeCmdActiveList) ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10493 | smeGetCommandQStatus((tHalHandle) userData); |
| 10494 | } |
| 10495 | |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 10496 | eHalStatus sme_UpdateConnectDebug(tHalHandle hHal, tANI_U32 set_value) |
| 10497 | { |
| 10498 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10499 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10500 | pMac->fEnableDebugLog = set_value; |
| 10501 | return (status); |
| 10502 | } |
| 10503 | |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 10504 | VOS_STATUS sme_UpdateDSCPtoUPMapping( tHalHandle hHal, |
| 10505 | sme_QosWmmUpType *dscpmapping) |
| 10506 | { |
| 10507 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10508 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10509 | v_U8_t i, j; |
| 10510 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10511 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10512 | { |
| 10513 | if ( !pMac->QosMapSet.present ) |
| 10514 | { |
| 10515 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10516 | "%s: QOS Mapping IE not present", __func__); |
| 10517 | sme_ReleaseGlobalLock( &pMac->sme); |
| 10518 | return eHAL_STATUS_FAILURE; |
| 10519 | } |
| 10520 | else |
| 10521 | { |
| 10522 | for (i=0; i < 8; i++) |
| 10523 | { |
| 10524 | for (j = pMac->QosMapSet.dscp_range[i][0]; |
| 10525 | j <= pMac->QosMapSet.dscp_range[i][1]; j++) |
| 10526 | { |
| 10527 | if ((pMac->QosMapSet.dscp_range[i][0] == 255) && |
| 10528 | (pMac->QosMapSet.dscp_range[i][1] == 255)) |
| 10529 | { |
| 10530 | dscpmapping[j]= 0; |
| 10531 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10532 | "%s: User Priority %d is not used in mapping", |
| 10533 | __func__, i); |
| 10534 | break; |
| 10535 | } |
| 10536 | else |
| 10537 | { |
| 10538 | dscpmapping[j]= i; |
| 10539 | } |
| 10540 | } |
| 10541 | } |
| 10542 | for (i=0; i< pMac->QosMapSet.num_dscp_exceptions; i++) |
| 10543 | { |
| 10544 | if (pMac->QosMapSet.dscp_exceptions[i][0] != 255) |
| 10545 | { |
| 10546 | dscpmapping[pMac->QosMapSet.dscp_exceptions[i][0] ] = |
| 10547 | pMac->QosMapSet.dscp_exceptions[i][1]; |
| 10548 | } |
| 10549 | } |
| 10550 | } |
| 10551 | } |
| 10552 | sme_ReleaseGlobalLock( &pMac->sme); |
| 10553 | return status; |
| 10554 | } |