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 | |
| 799 | // .... and process the command. |
| 800 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 801 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 802 | TRACE_CODE_SME_COMMAND, pCommand->sessionId, pCommand->command)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 803 | switch ( pCommand->command ) |
| 804 | { |
| 805 | |
| 806 | case eSmeCommandScan: |
| 807 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 808 | status = csrProcessScanCommand( pMac, pCommand ); |
| 809 | break; |
| 810 | |
| 811 | case eSmeCommandRoam: |
| 812 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 813 | status = csrRoamProcessCommand( pMac, pCommand ); |
Madan Mohan Koyyalamudi | 59efbe0 | 2013-01-10 15:38:42 -0800 | [diff] [blame] | 814 | if(!HAL_STATUS_SUCCESS(status)) |
| 815 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 816 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Madan Mohan Koyyalamudi | 59efbe0 | 2013-01-10 15:38:42 -0800 | [diff] [blame] | 817 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 818 | { |
| 819 | csrReleaseCommandRoam( pMac, pCommand ); |
| 820 | } |
| 821 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 822 | break; |
| 823 | |
| 824 | case eSmeCommandWmStatusChange: |
| 825 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 826 | csrRoamProcessWmStatusChangeCommand(pMac, pCommand); |
| 827 | break; |
| 828 | |
| 829 | case eSmeCommandSetKey: |
| 830 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 831 | status = csrRoamProcessSetKeyCommand( pMac, pCommand ); |
| 832 | if(!HAL_STATUS_SUCCESS(status)) |
| 833 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 834 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 835 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 836 | { |
| 837 | csrReleaseCommandSetKey( pMac, pCommand ); |
| 838 | } |
| 839 | } |
| 840 | break; |
| 841 | |
| 842 | case eSmeCommandRemoveKey: |
| 843 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 844 | status = csrRoamProcessRemoveKeyCommand( pMac, pCommand ); |
| 845 | if(!HAL_STATUS_SUCCESS(status)) |
| 846 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 847 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 848 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 849 | { |
| 850 | csrReleaseCommandRemoveKey( pMac, pCommand ); |
| 851 | } |
| 852 | } |
| 853 | break; |
| 854 | |
| 855 | case eSmeCommandAddStaSession: |
| 856 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 857 | csrProcessAddStaSessionCommand( pMac, pCommand ); |
| 858 | break; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 859 | case eSmeCommandDelStaSession: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 860 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 861 | csrProcessDelStaSessionCommand( pMac, pCommand ); |
| 862 | break; |
| 863 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 864 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 865 | case eSmeCommandOemDataReq: |
| 866 | csrLLUnlock(&pMac->sme.smeCmdActiveList); |
| 867 | oemData_ProcessOemDataReqCommand(pMac, pCommand); |
| 868 | break; |
| 869 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 870 | case eSmeCommandRemainOnChannel: |
| 871 | csrLLUnlock(&pMac->sme.smeCmdActiveList); |
| 872 | p2pProcessRemainOnChannelCmd(pMac, pCommand); |
| 873 | break; |
| 874 | case eSmeCommandNoAUpdate: |
| 875 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 876 | p2pProcessNoAReq(pMac,pCommand); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 877 | case eSmeCommandEnterImps: |
| 878 | case eSmeCommandExitImps: |
| 879 | case eSmeCommandEnterBmps: |
| 880 | case eSmeCommandExitBmps: |
| 881 | case eSmeCommandEnterUapsd: |
| 882 | case eSmeCommandExitUapsd: |
| 883 | case eSmeCommandEnterWowl: |
| 884 | case eSmeCommandExitWowl: |
| 885 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 886 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 887 | if( fContinue ) |
| 888 | { |
| 889 | //The command failed, remove it |
| 890 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 891 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 892 | { |
| 893 | pmcReleaseCommand( pMac, pCommand ); |
| 894 | } |
| 895 | } |
| 896 | break; |
| 897 | |
| 898 | //Treat standby differently here because caller may not be able to handle |
| 899 | //the failure so we do our best here |
| 900 | case eSmeCommandEnterStandby: |
| 901 | if( csrIsConnStateDisconnected( pMac, pCommand->sessionId ) ) |
| 902 | { |
| 903 | //It can continue |
| 904 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 905 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 906 | if( fContinue ) |
| 907 | { |
| 908 | //The command failed, remove it |
| 909 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 910 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 911 | { |
| 912 | pmcReleaseCommand( pMac, pCommand ); |
| 913 | } |
| 914 | } |
| 915 | } |
| 916 | else |
| 917 | { |
| 918 | //Need to issue a disconnect first before processing this command |
| 919 | tSmeCmd *pNewCmd; |
| 920 | |
| 921 | //We need to re-run the command |
| 922 | fContinue = eANI_BOOLEAN_TRUE; |
| 923 | //Pull off the standby command first |
| 924 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 925 | &pCommand->Link, LL_ACCESS_NOLOCK ) ) |
| 926 | { |
| 927 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 928 | //Need to call CSR function here because the disconnect command |
| 929 | //is handled by CSR |
| 930 | pNewCmd = csrGetCommandBuffer( pMac ); |
| 931 | if( NULL != pNewCmd ) |
| 932 | { |
| 933 | //Put the standby command to the head of the pending list first |
| 934 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pCommand->Link, |
| 935 | LL_ACCESS_LOCK ); |
| 936 | pNewCmd->command = eSmeCommandRoam; |
| 937 | pNewCmd->u.roamCmd.roamReason = eCsrForcedDisassoc; |
| 938 | //Put the disassoc command before the standby command |
| 939 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pNewCmd->Link, |
| 940 | LL_ACCESS_LOCK ); |
| 941 | } |
| 942 | else |
| 943 | { |
| 944 | //Continue the command here |
| 945 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 946 | if( fContinue ) |
| 947 | { |
| 948 | //The command failed, remove it |
| 949 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 950 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 951 | { |
| 952 | pmcReleaseCommand( pMac, pCommand ); |
| 953 | } |
| 954 | } |
| 955 | } |
| 956 | } |
| 957 | else |
| 958 | { |
| 959 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 960 | smsLog( pMac, LOGE, FL(" failed to remove standby command") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 961 | VOS_ASSERT(0); |
| 962 | } |
| 963 | } |
| 964 | break; |
| 965 | |
| 966 | case eSmeCommandAddTs: |
| 967 | case eSmeCommandDelTs: |
| 968 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 969 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 970 | fContinue = qosProcessCommand( pMac, pCommand ); |
| 971 | if( fContinue ) |
| 972 | { |
| 973 | //The command failed, remove it |
| 974 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 975 | &pCommand->Link, LL_ACCESS_NOLOCK ) ) |
| 976 | { |
| 977 | //#ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 978 | qosReleaseCommand( pMac, pCommand ); |
| 979 | //#endif /* WLAN_MDM_CODE_REDUCTION_OPT*/ |
| 980 | } |
| 981 | } |
| 982 | #endif |
| 983 | break; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 984 | #ifdef FEATURE_WLAN_TDLS |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 985 | case eSmeCommandTdlsSendMgmt: |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 986 | case eSmeCommandTdlsAddPeer: |
| 987 | case eSmeCommandTdlsDelPeer: |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 988 | case eSmeCommandTdlsLinkEstablish: |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 989 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 990 | case eSmeCommandTdlsDiscovery: |
| 991 | case eSmeCommandTdlsLinkSetup: |
| 992 | case eSmeCommandTdlsLinkTear: |
| 993 | case eSmeCommandTdlsEnterUapsd: |
| 994 | case eSmeCommandTdlsExitUapsd: |
| 995 | #endif |
| 996 | { |
Hoonki Lee | 1090c6a | 2013-01-16 17:40:54 -0800 | [diff] [blame] | 997 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 998 | "sending TDLS Command 0x%x to PE", pCommand->command); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 999 | |
| 1000 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1001 | status = csrTdlsProcessCmd( pMac, pCommand ); |
| 1002 | } |
| 1003 | break ; |
| 1004 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1005 | |
| 1006 | default: |
| 1007 | //something is wrong |
| 1008 | //remove it from the active list |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1009 | smsLog(pMac, LOGE, " csrProcessCommand processes an unknown command %d", pCommand->command); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1010 | pEntry = csrLLRemoveHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ); |
| 1011 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1012 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 1013 | smeReleaseCommand( pMac, pCommand ); |
| 1014 | status = eHAL_STATUS_FAILURE; |
| 1015 | break; |
| 1016 | } |
| 1017 | if(!HAL_STATUS_SUCCESS(status)) |
| 1018 | { |
| 1019 | fContinue = eANI_BOOLEAN_TRUE; |
| 1020 | } |
| 1021 | }//if(pEntry) |
| 1022 | else |
| 1023 | { |
| 1024 | //This is odd. Some one else pull off the command. |
| 1025 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1026 | } |
| 1027 | } |
| 1028 | else |
| 1029 | { |
| 1030 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1031 | } |
| 1032 | } |
| 1033 | else |
| 1034 | { |
| 1035 | //No command waiting |
| 1036 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1037 | //This is only used to restart an idle mode scan, it means at least one other idle scan has finished. |
| 1038 | if(pMac->scan.fRestartIdleScan && eANI_BOOLEAN_FALSE == pMac->scan.fCancelIdleScan) |
| 1039 | { |
| 1040 | tANI_U32 nTime = 0; |
| 1041 | |
| 1042 | pMac->scan.fRestartIdleScan = eANI_BOOLEAN_FALSE; |
| 1043 | if(!HAL_STATUS_SUCCESS(csrScanTriggerIdleScan(pMac, &nTime))) |
| 1044 | { |
| 1045 | csrScanStartIdleScanTimer(pMac, nTime); |
| 1046 | } |
| 1047 | } |
| 1048 | } |
| 1049 | } |
| 1050 | else { |
| 1051 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1052 | } |
| 1053 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 1054 | sme_process_scan_queue: |
| 1055 | if (pMac->fScanOffload && !(smeProcessScanQueue(pMac))) |
| 1056 | fContinue = eANI_BOOLEAN_FALSE; |
| 1057 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1058 | return ( fContinue ); |
| 1059 | } |
| 1060 | |
| 1061 | void smeProcessPendingQueue( tpAniSirGlobal pMac ) |
| 1062 | { |
| 1063 | while( smeProcessCommand( pMac ) ); |
| 1064 | } |
| 1065 | |
| 1066 | |
| 1067 | tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac) |
| 1068 | { |
| 1069 | return ( !csrLLIsListEmpty( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ) || |
| 1070 | !csrLLIsListEmpty(&pMac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK) ); |
| 1071 | } |
| 1072 | |
| 1073 | |
| 1074 | |
| 1075 | //Global APIs |
| 1076 | |
| 1077 | /*-------------------------------------------------------------------------- |
| 1078 | |
| 1079 | \brief sme_Open() - Initialze all SME modules and put them at idle state |
| 1080 | |
| 1081 | The function initializes each module inside SME, PMC, CCM, CSR, etc. . Upon |
| 1082 | successfully return, all modules are at idle state ready to start. |
| 1083 | |
| 1084 | smeOpen must be called before any other SME APIs can be involved. |
| 1085 | smeOpen must be called after macOpen. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1086 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1087 | \param hHal - The handle returned by macOpen. |
| 1088 | |
| 1089 | \return eHAL_STATUS_SUCCESS - SME is successfully initialized. |
| 1090 | |
| 1091 | Other status means SME is failed to be initialized |
| 1092 | \sa |
| 1093 | |
| 1094 | --------------------------------------------------------------------------*/ |
| 1095 | eHalStatus sme_Open(tHalHandle hHal) |
| 1096 | { |
| 1097 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1098 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1099 | |
| 1100 | do { |
| 1101 | pMac->sme.state = SME_STATE_STOP; |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 1102 | pMac->sme.currDeviceMode = VOS_STA_MODE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1103 | if( !VOS_IS_STATUS_SUCCESS( vos_lock_init( &pMac->sme.lkSmeGlobalLock ) ) ) |
| 1104 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1105 | smsLog( pMac, LOGE, "sme_Open failed init lock" ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1106 | status = eHAL_STATUS_FAILURE; |
| 1107 | break; |
| 1108 | } |
| 1109 | |
| 1110 | status = ccmOpen(hHal); |
| 1111 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1112 | smsLog( pMac, LOGE, |
| 1113 | "ccmOpen failed during initialization with status=%d", status ); |
| 1114 | break; |
| 1115 | } |
| 1116 | |
| 1117 | status = csrOpen(pMac); |
| 1118 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1119 | smsLog( pMac, LOGE, |
| 1120 | "csrOpen failed during initialization with status=%d", status ); |
| 1121 | break; |
| 1122 | } |
| 1123 | |
| 1124 | status = pmcOpen(hHal); |
| 1125 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1126 | smsLog( pMac, LOGE, |
| 1127 | "pmcOpen failed during initialization with status=%d", status ); |
| 1128 | break; |
| 1129 | } |
| 1130 | |
Gopichand Nakkala | 34d1b06 | 2013-03-19 15:28:33 -0700 | [diff] [blame] | 1131 | #ifdef FEATURE_WLAN_TDLS |
| 1132 | pMac->isTdlsPowerSaveProhibited = 0; |
| 1133 | #endif |
| 1134 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1135 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1136 | status = sme_QosOpen(pMac); |
| 1137 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1138 | smsLog( pMac, LOGE, |
| 1139 | "Qos open failed during initialization with status=%d", status ); |
| 1140 | break; |
| 1141 | } |
| 1142 | |
| 1143 | status = btcOpen(pMac); |
| 1144 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1145 | smsLog( pMac, LOGE, |
| 1146 | "btcOpen open failed during initialization with status=%d", status ); |
| 1147 | break; |
| 1148 | } |
| 1149 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1150 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1151 | status = oemData_OemDataReqOpen(pMac); |
| 1152 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1153 | smsLog(pMac, LOGE, |
| 1154 | "oemData_OemDataReqOpen failed during initialization with status=%d", status ); |
| 1155 | break; |
| 1156 | } |
| 1157 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1158 | |
| 1159 | if(!HAL_STATUS_SUCCESS((status = initSmeCmdList(pMac)))) |
| 1160 | break; |
| 1161 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1162 | { |
| 1163 | v_PVOID_t pvosGCtx = vos_get_global_context(VOS_MODULE_ID_SAP, NULL); |
| 1164 | if ( NULL == pvosGCtx ){ |
| 1165 | smsLog( pMac, LOGE, "WLANSAP_Open open failed during initialization"); |
| 1166 | status = eHAL_STATUS_FAILURE; |
| 1167 | break; |
| 1168 | } |
| 1169 | |
| 1170 | status = WLANSAP_Open( pvosGCtx ); |
| 1171 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1172 | smsLog( pMac, LOGE, |
| 1173 | "WLANSAP_Open open failed during initialization with status=%d", status ); |
| 1174 | break; |
| 1175 | } |
| 1176 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1177 | #if defined WLAN_FEATURE_VOWIFI |
| 1178 | status = rrmOpen(pMac); |
| 1179 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1180 | smsLog( pMac, LOGE, |
| 1181 | "rrmOpen open failed during initialization with status=%d", status ); |
| 1182 | break; |
| 1183 | } |
| 1184 | #endif |
| 1185 | |
| 1186 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 1187 | sme_FTOpen(pMac); |
| 1188 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1189 | sme_p2pOpen(pMac); |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1190 | smeTraceInit(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1191 | |
| 1192 | }while (0); |
| 1193 | |
| 1194 | return status; |
| 1195 | } |
| 1196 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1197 | /*-------------------------------------------------------------------------- |
| 1198 | |
| 1199 | \brief sme_set11dinfo() - Set the 11d information about valid channels |
| 1200 | and there power using information from nvRAM |
| 1201 | This function is called only for AP. |
| 1202 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1203 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1204 | |
| 1205 | \param hHal - The handle returned by macOpen. |
| 1206 | \Param pSmeConfigParams - a pointer to a caller allocated object of |
| 1207 | typedef struct _smeConfigParams. |
| 1208 | |
| 1209 | \return eHAL_STATUS_SUCCESS - SME update the config parameters successfully. |
| 1210 | |
| 1211 | Other status means SME is failed to update the config parameters. |
| 1212 | \sa |
| 1213 | --------------------------------------------------------------------------*/ |
| 1214 | |
| 1215 | eHalStatus sme_set11dinfo(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) |
| 1216 | { |
| 1217 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1218 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1219 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1220 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1221 | TRACE_CODE_SME_RX_HDD_MSG_SET_11DINFO, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1222 | if (NULL == pSmeConfigParams ) { |
| 1223 | smsLog( pMac, LOGE, |
| 1224 | "Empty config param structure for SME, nothing to update"); |
| 1225 | return status; |
| 1226 | } |
| 1227 | |
| 1228 | status = csrSetChannels(hHal, &pSmeConfigParams->csrConfig ); |
| 1229 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1230 | smsLog( pMac, LOGE, "csrChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1231 | status ); |
| 1232 | } |
| 1233 | return status; |
| 1234 | } |
| 1235 | |
| 1236 | /*-------------------------------------------------------------------------- |
| 1237 | |
| 1238 | \brief sme_getSoftApDomain() - Get the current regulatory domain of softAp. |
| 1239 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1240 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1241 | |
| 1242 | \param hHal - The handle returned by HostapdAdapter. |
| 1243 | \Param v_REGDOMAIN_t - The current Regulatory Domain requested for SoftAp. |
| 1244 | |
| 1245 | \return eHAL_STATUS_SUCCESS - SME successfully completed the request. |
| 1246 | |
| 1247 | Other status means, failed to get the current regulatory domain. |
| 1248 | \sa |
| 1249 | --------------------------------------------------------------------------*/ |
| 1250 | |
| 1251 | eHalStatus sme_getSoftApDomain(tHalHandle hHal, v_REGDOMAIN_t *domainIdSoftAp) |
| 1252 | { |
| 1253 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1254 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1255 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1256 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1257 | TRACE_CODE_SME_RX_HDD_MSG_GET_SOFTAP_DOMAIN, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1258 | if (NULL == domainIdSoftAp ) { |
| 1259 | smsLog( pMac, LOGE, "Uninitialized domain Id"); |
| 1260 | return status; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1261 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1262 | |
| 1263 | *domainIdSoftAp = pMac->scan.domainIdCurrent; |
| 1264 | status = eHAL_STATUS_SUCCESS; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1265 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1266 | return status; |
| 1267 | } |
| 1268 | |
| 1269 | |
| 1270 | eHalStatus sme_setRegInfo(tHalHandle hHal, tANI_U8 *apCntryCode) |
| 1271 | { |
| 1272 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1273 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1274 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1275 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1276 | TRACE_CODE_SME_RX_HDD_MSG_SET_REGINFO, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1277 | if (NULL == apCntryCode ) { |
| 1278 | smsLog( pMac, LOGE, "Empty Country Code, nothing to update"); |
| 1279 | return status; |
| 1280 | } |
| 1281 | |
| 1282 | status = csrSetRegInfo(hHal, apCntryCode ); |
| 1283 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1284 | smsLog( pMac, LOGE, "csrSetRegInfo failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1285 | status ); |
| 1286 | } |
| 1287 | return status; |
| 1288 | } |
| 1289 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1290 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 1291 | /*-------------------------------------------------------------------------- |
| 1292 | |
| 1293 | \brief sme_UpdateChannelConfig() - Update channel configuration in RIVA. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1294 | |
| 1295 | It is used at driver start up to inform RIVA of the default channel |
| 1296 | configuration. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1297 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1298 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1299 | |
| 1300 | \param hHal - The handle returned by macOpen. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1301 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1302 | \return eHAL_STATUS_SUCCESS - SME update the channel config successfully. |
| 1303 | |
| 1304 | Other status means SME is failed to update the channel config. |
| 1305 | \sa |
| 1306 | |
| 1307 | --------------------------------------------------------------------------*/ |
| 1308 | eHalStatus sme_UpdateChannelConfig(tHalHandle hHal) |
| 1309 | { |
| 1310 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1311 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1312 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1313 | TRACE_CODE_SME_RX_HDD_MSG_UPDATE_CHANNEL_CONFIG, NO_SESSION, 0)); |
| 1314 | pmcUpdateScanParams( pMac, &(pMac->roam.configParam), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1315 | &pMac->scan.base20MHzChannels, FALSE); |
| 1316 | return eHAL_STATUS_SUCCESS; |
| 1317 | } |
| 1318 | #endif // FEATURE_WLAN_SCAN_PNLO |
| 1319 | |
| 1320 | /*-------------------------------------------------------------------------- |
| 1321 | |
| 1322 | \brief sme_UpdateConfig() - Change configurations for all SME moduels |
| 1323 | |
| 1324 | The function updates some configuration for modules in SME, CCM, CSR, etc |
| 1325 | during SMEs close open sequence. |
| 1326 | |
| 1327 | Modules inside SME apply the new configuration at the next transaction. |
| 1328 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1329 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1330 | |
| 1331 | \param hHal - The handle returned by macOpen. |
| 1332 | \Param pSmeConfigParams - a pointer to a caller allocated object of |
| 1333 | typedef struct _smeConfigParams. |
| 1334 | |
| 1335 | \return eHAL_STATUS_SUCCESS - SME update the config parameters successfully. |
| 1336 | |
| 1337 | Other status means SME is failed to update the config parameters. |
| 1338 | \sa |
| 1339 | |
| 1340 | --------------------------------------------------------------------------*/ |
| 1341 | eHalStatus sme_UpdateConfig(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) |
| 1342 | { |
| 1343 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1344 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1345 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1346 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1347 | TRACE_CODE_SME_RX_HDD_MSG_UPDATE_CONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1348 | if (NULL == pSmeConfigParams ) { |
| 1349 | smsLog( pMac, LOGE, |
| 1350 | "Empty config param structure for SME, nothing to update"); |
| 1351 | return status; |
| 1352 | } |
| 1353 | |
| 1354 | status = csrChangeDefaultConfigParam(pMac, &pSmeConfigParams->csrConfig); |
| 1355 | |
| 1356 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1357 | smsLog( pMac, LOGE, "csrChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1358 | status ); |
| 1359 | } |
| 1360 | #if defined WLAN_FEATURE_P2P_INTERNAL |
| 1361 | status = p2pChangeDefaultConfigParam(pMac, &pSmeConfigParams->p2pConfig); |
| 1362 | |
| 1363 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1364 | smsLog( pMac, LOGE, "p2pChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1365 | status ); |
| 1366 | } |
| 1367 | #endif |
| 1368 | #if defined WLAN_FEATURE_VOWIFI |
| 1369 | status = rrmChangeDefaultConfigParam(hHal, &pSmeConfigParams->rrmConfig); |
| 1370 | |
| 1371 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1372 | smsLog( pMac, LOGE, "rrmChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1373 | status ); |
| 1374 | } |
| 1375 | #endif |
| 1376 | //For SOC, CFG is set before start |
| 1377 | //We don't want to apply global CFG in connect state because that may cause some side affect |
| 1378 | if( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1379 | csrIsAllSessionDisconnected( pMac) ) |
| 1380 | { |
| 1381 | csrSetGlobalCfgs(pMac); |
| 1382 | } |
| 1383 | |
Gopichand Nakkala | 86e4266 | 2013-06-11 17:44:11 +0530 | [diff] [blame] | 1384 | /* update the directed scan offload setting */ |
| 1385 | pMac->fScanOffload = pSmeConfigParams->fScanOffload; |
| 1386 | |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 1387 | /* Enable channel bonding mode in 2.4GHz */ |
| 1388 | if ((pSmeConfigParams->csrConfig.channelBondingMode24GHz == TRUE) && |
| 1389 | (IS_HT40_OBSS_SCAN_FEATURE_ENABLE)) |
| 1390 | { |
| 1391 | ccmCfgSetInt(hHal,WNI_CFG_CHANNEL_BONDING_24G, |
| 1392 | eANI_BOOLEAN_TRUE, NULL,eANI_BOOLEAN_FALSE); |
| 1393 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, |
| 1394 | "Setting channelBondingMode24GHz:%d " , |
| 1395 | pSmeConfigParams->csrConfig.channelBondingMode24GHz); |
| 1396 | } |
Madan Mohan Koyyalamudi | d89feb7 | 2013-07-31 15:47:12 +0530 | [diff] [blame] | 1397 | if (pMac->fScanOffload) |
| 1398 | { |
| 1399 | /* If scan offload is enabled then lim has allow the sending of |
| 1400 | scan request to firmware even in powersave mode. The firmware has |
| 1401 | to take care of exiting from power save mode */ |
| 1402 | status = ccmCfgSetInt(hHal, WNI_CFG_SCAN_IN_POWERSAVE, |
| 1403 | eANI_BOOLEAN_TRUE, NULL, eANI_BOOLEAN_FALSE); |
| 1404 | |
| 1405 | if (eHAL_STATUS_SUCCESS != status) |
| 1406 | { |
| 1407 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1408 | "Could not pass on WNI_CFG_SCAN_IN_POWERSAVE to CCM"); |
| 1409 | } |
| 1410 | } |
krunal soni | e9002db | 2013-11-25 14:24:17 -0800 | [diff] [blame] | 1411 | pMac->isCoalesingInIBSSAllowed = |
| 1412 | pSmeConfigParams->csrConfig.isCoalesingInIBSSAllowed; |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 1413 | pMac->fEnableDebugLog = pSmeConfigParams->fEnableDebugLog; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1414 | return status; |
| 1415 | } |
| 1416 | |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 1417 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 1418 | void sme_ProcessGetGtkInfoRsp( tHalHandle hHal, |
| 1419 | tpSirGtkOffloadGetInfoRspParams pGtkOffloadGetInfoRsp) |
| 1420 | { |
| 1421 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1422 | |
| 1423 | if (NULL == pMac) |
| 1424 | { |
| 1425 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 1426 | "%s: pMac is null", __func__); |
| 1427 | return ; |
| 1428 | } |
| 1429 | if (pMac->pmc.GtkOffloadGetInfoCB == NULL) |
| 1430 | { |
| 1431 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1432 | "%s: HDD callback is null", __func__); |
| 1433 | return ; |
| 1434 | } |
| 1435 | pMac->pmc.GtkOffloadGetInfoCB(pMac->pmc.GtkOffloadGetInfoCBContext, |
| 1436 | pGtkOffloadGetInfoRsp); |
| 1437 | } |
| 1438 | #endif |
| 1439 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1440 | /* --------------------------------------------------------------------------- |
| 1441 | \fn sme_ChangeConfigParams |
| 1442 | \brief The SME API exposed for HDD to provide config params to SME during |
| 1443 | SMEs stop -> start sequence. |
| 1444 | |
| 1445 | If HDD changed the domain that will cause a reset. This function will |
| 1446 | provide the new set of 11d information for the new domain. Currrently this |
| 1447 | API provides info regarding 11d only at reset but we can extend this for |
| 1448 | other params (PMC, QoS) which needs to be initialized again at reset. |
| 1449 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1450 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1451 | |
| 1452 | \param hHal - The handle returned by macOpen. |
| 1453 | |
| 1454 | \Param |
| 1455 | pUpdateConfigParam - a pointer to a structure (tCsrUpdateConfigParam) that |
| 1456 | currently provides 11d related information like Country code, |
| 1457 | Regulatory domain, valid channel list, Tx power per channel, a |
| 1458 | list with active/passive scan allowed per valid channel. |
| 1459 | |
| 1460 | \return eHalStatus |
| 1461 | ---------------------------------------------------------------------------*/ |
| 1462 | eHalStatus sme_ChangeConfigParams(tHalHandle hHal, |
| 1463 | tCsrUpdateConfigParam *pUpdateConfigParam) |
| 1464 | { |
| 1465 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1466 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1467 | |
| 1468 | if (NULL == pUpdateConfigParam ) { |
| 1469 | smsLog( pMac, LOGE, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1470 | "Empty config param structure for SME, nothing to reset"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1471 | return status; |
| 1472 | } |
| 1473 | |
| 1474 | status = csrChangeConfigParams(pMac, pUpdateConfigParam); |
| 1475 | |
| 1476 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1477 | smsLog( pMac, LOGE, "csrUpdateConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1478 | status ); |
| 1479 | } |
| 1480 | |
| 1481 | return status; |
| 1482 | |
| 1483 | } |
| 1484 | |
| 1485 | /*-------------------------------------------------------------------------- |
| 1486 | |
| 1487 | \brief sme_HDDReadyInd() - SME sends eWNI_SME_SYS_READY_IND to PE to inform |
| 1488 | that the NIC is ready tio run. |
| 1489 | |
| 1490 | The function is called by HDD at the end of initialization stage so PE/HAL can |
| 1491 | enable the NIC to running state. |
| 1492 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1493 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1494 | \param hHal - The handle returned by macOpen. |
| 1495 | |
| 1496 | \return eHAL_STATUS_SUCCESS - eWNI_SME_SYS_READY_IND is sent to PE |
| 1497 | successfully. |
| 1498 | |
| 1499 | Other status means SME failed to send the message to PE. |
| 1500 | \sa |
| 1501 | |
| 1502 | --------------------------------------------------------------------------*/ |
| 1503 | eHalStatus sme_HDDReadyInd(tHalHandle hHal) |
| 1504 | { |
| 1505 | tSirSmeReadyReq Msg; |
| 1506 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1507 | tPmcPowerState powerState; |
| 1508 | tPmcSwitchState hwWlanSwitchState; |
| 1509 | tPmcSwitchState swWlanSwitchState; |
| 1510 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1511 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1512 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1513 | TRACE_CODE_SME_RX_HDD_MSG_HDDREADYIND, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1514 | do |
| 1515 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1516 | |
| 1517 | Msg.messageType = eWNI_SME_SYS_READY_IND; |
| 1518 | Msg.length = sizeof( tSirSmeReadyReq ); |
| 1519 | |
| 1520 | if (eSIR_FAILURE != uMacPostCtrlMsg( hHal, (tSirMbMsg*)&Msg )) |
| 1521 | { |
| 1522 | status = eHAL_STATUS_SUCCESS; |
| 1523 | } |
| 1524 | else |
| 1525 | { |
| 1526 | smsLog( pMac, LOGE, |
| 1527 | "uMacPostCtrlMsg failed to send eWNI_SME_SYS_READY_IND"); |
| 1528 | break; |
| 1529 | } |
| 1530 | |
| 1531 | status = pmcQueryPowerState( hHal, &powerState, |
| 1532 | &hwWlanSwitchState, &swWlanSwitchState ); |
| 1533 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1534 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1535 | smsLog( pMac, LOGE, "pmcQueryPowerState failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1536 | status ); |
| 1537 | break; |
| 1538 | } |
| 1539 | |
| 1540 | if ( (ePMC_SWITCH_OFF != hwWlanSwitchState) && |
| 1541 | (ePMC_SWITCH_OFF != swWlanSwitchState) ) |
| 1542 | { |
| 1543 | status = csrReady(pMac); |
| 1544 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1545 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1546 | smsLog( pMac, LOGE, "csrReady failed with status=%d", status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1547 | break; |
| 1548 | } |
| 1549 | status = pmcReady(hHal); |
| 1550 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1551 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1552 | smsLog( pMac, LOGE, "pmcReady failed with status=%d", status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1553 | break; |
| 1554 | } |
| 1555 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1556 | if(VOS_STATUS_SUCCESS != btcReady(hHal)) |
| 1557 | { |
| 1558 | status = eHAL_STATUS_FAILURE; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1559 | smsLog( pMac, LOGE, "btcReady failed"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1560 | break; |
| 1561 | } |
| 1562 | #endif |
| 1563 | |
| 1564 | #if defined WLAN_FEATURE_VOWIFI |
| 1565 | if(VOS_STATUS_SUCCESS != rrmReady(hHal)) |
| 1566 | { |
| 1567 | status = eHAL_STATUS_FAILURE; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1568 | smsLog( pMac, LOGE, "rrmReady failed"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1569 | break; |
| 1570 | } |
| 1571 | #endif |
| 1572 | } |
| 1573 | pMac->sme.state = SME_STATE_READY; |
| 1574 | } while( 0 ); |
| 1575 | |
| 1576 | return status; |
| 1577 | } |
| 1578 | |
| 1579 | /*-------------------------------------------------------------------------- |
| 1580 | |
| 1581 | \brief sme_Start() - Put all SME modules at ready state. |
| 1582 | |
| 1583 | The function starts each module in SME, PMC, CCM, CSR, etc. . Upon |
| 1584 | successfully return, all modules are ready to run. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1585 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1586 | \param hHal - The handle returned by macOpen. |
| 1587 | |
| 1588 | \return eHAL_STATUS_SUCCESS - SME is ready. |
| 1589 | |
| 1590 | Other status means SME is failed to start |
| 1591 | \sa |
| 1592 | |
| 1593 | --------------------------------------------------------------------------*/ |
| 1594 | eHalStatus sme_Start(tHalHandle hHal) |
| 1595 | { |
| 1596 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1597 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1598 | |
| 1599 | do |
| 1600 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1601 | status = csrStart(pMac); |
| 1602 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1603 | smsLog( pMac, LOGE, "csrStart failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1604 | status ); |
| 1605 | break; |
| 1606 | } |
| 1607 | |
| 1608 | status = pmcStart(hHal); |
| 1609 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1610 | smsLog( pMac, LOGE, "pmcStart failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1611 | status ); |
| 1612 | break; |
| 1613 | } |
| 1614 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1615 | status = WLANSAP_Start(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 1616 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1617 | smsLog( pMac, LOGE, "WLANSAP_Start failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1618 | status ); |
| 1619 | break; |
| 1620 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1621 | pMac->sme.state = SME_STATE_START; |
| 1622 | }while (0); |
| 1623 | |
| 1624 | return status; |
| 1625 | } |
| 1626 | |
| 1627 | |
| 1628 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 1629 | /****************************************************************************** |
| 1630 | * |
| 1631 | * Name: sme_PCFilterMatchCountResponseHandler |
| 1632 | * |
| 1633 | * Description: |
| 1634 | * Invoke Packet Coalescing Filter Match Count callback routine |
| 1635 | * |
| 1636 | * Parameters: |
| 1637 | * hHal - HAL handle for device |
| 1638 | * pMsg - Pointer to tRcvFltPktMatchRsp structure |
| 1639 | * |
| 1640 | * Returns: eHalStatus |
| 1641 | * |
| 1642 | ******************************************************************************/ |
| 1643 | eHalStatus sme_PCFilterMatchCountResponseHandler(tHalHandle hHal, void* pMsg) |
| 1644 | { |
| 1645 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 1646 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1647 | tpSirRcvFltPktMatchRsp pRcvFltPktMatchRsp = (tpSirRcvFltPktMatchRsp)pMsg; |
| 1648 | |
| 1649 | if (NULL == pMsg) |
| 1650 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1651 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1652 | status = eHAL_STATUS_FAILURE; |
| 1653 | } |
| 1654 | else |
| 1655 | { |
| 1656 | smsLog(pMac, LOG2, "SME: entering " |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1657 | "sme_FilterMatchCountResponseHandler"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1658 | |
| 1659 | /* Call Packet Coalescing Filter Match Count callback routine. */ |
| 1660 | if (pMac->pmc.FilterMatchCountCB != NULL) |
| 1661 | pMac->pmc.FilterMatchCountCB(pMac->pmc.FilterMatchCountCBContext, |
| 1662 | pRcvFltPktMatchRsp); |
| 1663 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1664 | smsLog(pMac, LOG1, "%s: status=0x%x", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1665 | pRcvFltPktMatchRsp->status); |
| 1666 | |
| 1667 | pMac->pmc.FilterMatchCountCB = NULL; |
| 1668 | pMac->pmc.FilterMatchCountCBContext = NULL; |
| 1669 | } |
| 1670 | |
| 1671 | return(status); |
| 1672 | } |
| 1673 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 1674 | |
| 1675 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1676 | #ifdef WLAN_FEATURE_11W |
| 1677 | /*------------------------------------------------------------------ |
| 1678 | * |
| 1679 | * Handle the unprotected management frame indication from LIM and |
| 1680 | * forward it to HDD. |
| 1681 | * |
| 1682 | *------------------------------------------------------------------*/ |
| 1683 | |
| 1684 | eHalStatus sme_UnprotectedMgmtFrmInd( tHalHandle hHal, |
| 1685 | tpSirSmeUnprotMgmtFrameInd pSmeMgmtFrm) |
| 1686 | { |
| 1687 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1688 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1689 | tCsrRoamInfo pRoamInfo = {0}; |
| 1690 | tANI_U32 SessionId = pSmeMgmtFrm->sessionId; |
| 1691 | |
| 1692 | pRoamInfo.nFrameLength = pSmeMgmtFrm->frameLen; |
| 1693 | pRoamInfo.pbFrames = pSmeMgmtFrm->frameBuf; |
| 1694 | pRoamInfo.frameType = pSmeMgmtFrm->frameType; |
| 1695 | |
| 1696 | /* forward the mgmt frame to HDD */ |
| 1697 | csrRoamCallCallback(pMac, SessionId, &pRoamInfo, 0, eCSR_ROAM_UNPROT_MGMT_FRAME_IND, 0); |
| 1698 | |
| 1699 | return status; |
| 1700 | } |
| 1701 | #endif |
| 1702 | |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1703 | #if defined(FEATURE_WLAN_CCX) && defined(FEATURE_WLAN_CCX_UPLOAD) |
| 1704 | /*------------------------------------------------------------------ |
| 1705 | * |
| 1706 | * Handle the tsm ie indication from LIM and forward it to HDD. |
| 1707 | * |
| 1708 | *------------------------------------------------------------------*/ |
| 1709 | |
| 1710 | eHalStatus sme_TsmIeInd(tHalHandle hHal, tSirSmeTsmIEInd *pSmeTsmIeInd) |
| 1711 | { |
| 1712 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1713 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1714 | tCsrRoamInfo pRoamInfo = {0}; |
| 1715 | tANI_U32 SessionId = pSmeTsmIeInd->sessionId; |
| 1716 | |
| 1717 | pRoamInfo.tsmIe.tsid= pSmeTsmIeInd->tsmIe.tsid; |
| 1718 | pRoamInfo.tsmIe.state= pSmeTsmIeInd->tsmIe.state; |
| 1719 | pRoamInfo.tsmIe.msmt_interval= pSmeTsmIeInd->tsmIe.msmt_interval; |
| 1720 | |
| 1721 | /* forward the tsm ie information to HDD */ |
| 1722 | csrRoamCallCallback(pMac, SessionId, &pRoamInfo, 0, eCSR_ROAM_TSM_IE_IND, 0); |
| 1723 | |
| 1724 | return status; |
| 1725 | } |
| 1726 | |
| 1727 | /* --------------------------------------------------------------------------- |
| 1728 | \fn sme_SetCCKMIe |
| 1729 | \brief function to store the CCKM IE passed from supplicant and use it while packing |
| 1730 | reassociation request |
| 1731 | \param hHal - HAL handle for device |
| 1732 | \param pCckmIe - pointer to CCKM IE data |
| 1733 | \param pCckmIeLen - length of the CCKM IE |
| 1734 | \- return Success or failure |
| 1735 | -------------------------------------------------------------------------*/ |
| 1736 | eHalStatus sme_SetCCKMIe(tHalHandle hHal, tANI_U8 sessionId, |
| 1737 | tANI_U8 *pCckmIe, tANI_U8 cckmIeLen) |
| 1738 | { |
| 1739 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1740 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1741 | |
| 1742 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 1743 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 1744 | { |
| 1745 | csrSetCCKMIe(pMac, sessionId, pCckmIe, cckmIeLen); |
| 1746 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 1747 | } |
| 1748 | return status; |
| 1749 | } |
| 1750 | |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1751 | /* --------------------------------------------------------------------------- |
| 1752 | \fn sme_SetCcxBeaconRequest |
| 1753 | \brief function to set CCX beacon request parameters |
| 1754 | \param hHal - HAL handle for device |
| 1755 | \param sessionId - Session id |
| 1756 | \param pCcxBcnReq - pointer to CCX beacon request |
| 1757 | \- return Success or failure |
| 1758 | -------------------------------------------------------------------------*/ |
| 1759 | eHalStatus sme_SetCcxBeaconRequest(tHalHandle hHal, const tANI_U8 sessionId, |
| 1760 | const tCsrCcxBeaconReq* pCcxBcnReq) |
| 1761 | { |
| 1762 | eHalStatus status = eSIR_SUCCESS; |
| 1763 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1764 | tpSirBeaconReportReqInd pSmeBcnReportReq = NULL; |
| 1765 | tCsrCcxBeaconReqParams *pBeaconReq = NULL; |
| 1766 | tANI_U8 counter = 0; |
| 1767 | tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); |
| 1768 | tpRrmSMEContext pSmeRrmContext = &pMac->rrm.rrmSmeContext; |
| 1769 | |
| 1770 | /* Store the info in RRM context */ |
| 1771 | vos_mem_copy(&pSmeRrmContext->ccxBcnReqInfo, pCcxBcnReq, sizeof(tCsrCcxBeaconReq)); |
| 1772 | |
| 1773 | //Prepare the request to send to SME. |
| 1774 | pSmeBcnReportReq = vos_mem_malloc(sizeof( tSirBeaconReportReqInd )); |
| 1775 | if(NULL == pSmeBcnReportReq) |
| 1776 | { |
| 1777 | smsLog(pMac, LOGP, "Memory Allocation Failure!!! CCX BcnReq Ind to SME"); |
| 1778 | return eSIR_FAILURE; |
| 1779 | } |
| 1780 | |
| 1781 | smsLog(pMac, LOGE, "Sending Beacon Report Req to SME"); |
| 1782 | vos_mem_zero( pSmeBcnReportReq, sizeof( tSirBeaconReportReqInd )); |
| 1783 | |
| 1784 | pSmeBcnReportReq->messageType = eWNI_SME_BEACON_REPORT_REQ_IND; |
| 1785 | pSmeBcnReportReq->length = sizeof( tSirBeaconReportReqInd ); |
| 1786 | vos_mem_copy( pSmeBcnReportReq->bssId, pSession->connectedProfile.bssid, sizeof(tSirMacAddr) ); |
| 1787 | pSmeBcnReportReq->channelInfo.channelNum = 255; |
| 1788 | pSmeBcnReportReq->channelList.numChannels = pCcxBcnReq->numBcnReqIe; |
Srinivas Girigowda | 6d1f906 | 2014-02-03 18:15:54 -0800 | [diff] [blame] | 1789 | pSmeBcnReportReq->msgSource = eRRM_MSG_SOURCE_CCX_UPLOAD; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1790 | |
| 1791 | for (counter = 0; counter < pCcxBcnReq->numBcnReqIe; counter++) |
| 1792 | { |
| 1793 | pBeaconReq = (tCsrCcxBeaconReqParams *)&pCcxBcnReq->bcnReq[counter]; |
| 1794 | pSmeBcnReportReq->fMeasurementtype[counter] = pBeaconReq->scanMode; |
| 1795 | pSmeBcnReportReq->measurementDuration[counter] = SYS_TU_TO_MS(pBeaconReq->measurementDuration); |
| 1796 | pSmeBcnReportReq->channelList.channelNumber[counter] = pBeaconReq->channel; |
| 1797 | } |
| 1798 | |
| 1799 | sme_RrmProcessBeaconReportReqInd(pMac, pSmeBcnReportReq); |
| 1800 | return status; |
| 1801 | } |
| 1802 | |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1803 | #endif /* FEATURE_WLAN_CCX && FEATURE_WLAN_CCX_UPLOAD */ |
| 1804 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1805 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1806 | /*-------------------------------------------------------------------------- |
| 1807 | |
| 1808 | \brief sme_ProcessMsg() - The main message processor for SME. |
| 1809 | |
| 1810 | The function is called by a message dispatcher when to process a message |
| 1811 | targeted for SME. |
| 1812 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1813 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1814 | \param hHal - The handle returned by macOpen. |
| 1815 | \param pMsg - A pointer to a caller allocated object of tSirMsgQ. |
| 1816 | |
| 1817 | \return eHAL_STATUS_SUCCESS - SME successfully process the message. |
| 1818 | |
| 1819 | Other status means SME failed to process the message to HAL. |
| 1820 | \sa |
| 1821 | |
| 1822 | --------------------------------------------------------------------------*/ |
| 1823 | eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) |
| 1824 | { |
| 1825 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1826 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1827 | |
| 1828 | if (pMsg == NULL) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1829 | smsLog( pMac, LOGE, "Empty message for SME, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1830 | return status; |
| 1831 | } |
| 1832 | |
| 1833 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 1834 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 1835 | { |
| 1836 | if( SME_IS_START(pMac) ) |
| 1837 | { |
| 1838 | switch (pMsg->type) { // TODO: Will be modified to do a range check for msgs instead of having cases for each msgs |
| 1839 | case eWNI_PMC_ENTER_BMPS_RSP: |
| 1840 | case eWNI_PMC_EXIT_BMPS_RSP: |
| 1841 | case eWNI_PMC_EXIT_BMPS_IND: |
| 1842 | case eWNI_PMC_ENTER_IMPS_RSP: |
| 1843 | case eWNI_PMC_EXIT_IMPS_RSP: |
| 1844 | case eWNI_PMC_SMPS_STATE_IND: |
| 1845 | case eWNI_PMC_ENTER_UAPSD_RSP: |
| 1846 | case eWNI_PMC_EXIT_UAPSD_RSP: |
| 1847 | case eWNI_PMC_ENTER_WOWL_RSP: |
| 1848 | case eWNI_PMC_EXIT_WOWL_RSP: |
| 1849 | //PMC |
| 1850 | if (pMsg->bodyptr) |
| 1851 | { |
| 1852 | pmcMessageProcessor(hHal, pMsg->bodyptr); |
| 1853 | status = eHAL_STATUS_SUCCESS; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 1854 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1855 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1856 | smsLog( pMac, LOGE, "Empty rsp message for PMC, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1857 | } |
| 1858 | break; |
| 1859 | |
| 1860 | case WNI_CFG_SET_CNF: |
| 1861 | case WNI_CFG_DNLD_CNF: |
| 1862 | case WNI_CFG_GET_RSP: |
| 1863 | case WNI_CFG_ADD_GRP_ADDR_CNF: |
| 1864 | case WNI_CFG_DEL_GRP_ADDR_CNF: |
| 1865 | //CCM |
| 1866 | if (pMsg->bodyptr) |
| 1867 | { |
| 1868 | ccmCfgCnfMsgHandler(hHal, pMsg->bodyptr); |
| 1869 | status = eHAL_STATUS_SUCCESS; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 1870 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1871 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1872 | smsLog( pMac, LOGE, "Empty rsp message for CCM, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1873 | } |
| 1874 | break; |
| 1875 | |
| 1876 | case eWNI_SME_ADDTS_RSP: |
| 1877 | case eWNI_SME_DELTS_RSP: |
| 1878 | case eWNI_SME_DELTS_IND: |
| 1879 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1880 | case eWNI_SME_FT_AGGR_QOS_RSP: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1881 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1882 | //QoS |
| 1883 | if (pMsg->bodyptr) |
| 1884 | { |
| 1885 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1886 | status = sme_QosMsgProcessor(pMac, pMsg->type, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 1887 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1888 | #endif |
| 1889 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1890 | smsLog( pMac, LOGE, "Empty rsp message for QoS, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1891 | } |
| 1892 | break; |
| 1893 | #if defined WLAN_FEATURE_VOWIFI |
| 1894 | case eWNI_SME_NEIGHBOR_REPORT_IND: |
| 1895 | case eWNI_SME_BEACON_REPORT_REQ_IND: |
| 1896 | #if defined WLAN_VOWIFI_DEBUG |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1897 | smsLog( pMac, LOGE, "Received RRM message. Message Id = %d", pMsg->type ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1898 | #endif |
| 1899 | if ( pMsg->bodyptr ) |
| 1900 | { |
| 1901 | status = sme_RrmMsgProcessor( pMac, pMsg->type, pMsg->bodyptr ); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 1902 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1903 | } |
| 1904 | else |
| 1905 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1906 | smsLog( pMac, LOGE, "Empty message for RRM, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1907 | } |
| 1908 | break; |
| 1909 | #endif |
| 1910 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1911 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1912 | //Handle the eWNI_SME_OEM_DATA_RSP: |
| 1913 | case eWNI_SME_OEM_DATA_RSP: |
| 1914 | if(pMsg->bodyptr) |
| 1915 | { |
| 1916 | status = sme_HandleOemDataRsp(pMac, pMsg->bodyptr); |
| 1917 | vos_mem_free(pMsg->bodyptr); |
| 1918 | } |
| 1919 | else |
| 1920 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1921 | 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] | 1922 | } |
| 1923 | smeProcessPendingQueue( pMac ); |
| 1924 | break; |
| 1925 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1926 | |
| 1927 | case eWNI_SME_ADD_STA_SELF_RSP: |
| 1928 | if(pMsg->bodyptr) |
| 1929 | { |
| 1930 | status = csrProcessAddStaSessionRsp(pMac, pMsg->bodyptr); |
| 1931 | vos_mem_free(pMsg->bodyptr); |
| 1932 | } |
| 1933 | else |
| 1934 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1935 | 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] | 1936 | } |
| 1937 | break; |
| 1938 | case eWNI_SME_DEL_STA_SELF_RSP: |
| 1939 | if(pMsg->bodyptr) |
| 1940 | { |
| 1941 | status = csrProcessDelStaSessionRsp(pMac, pMsg->bodyptr); |
| 1942 | vos_mem_free(pMsg->bodyptr); |
| 1943 | } |
| 1944 | else |
| 1945 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1946 | 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] | 1947 | } |
| 1948 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1949 | case eWNI_SME_REMAIN_ON_CHN_RSP: |
| 1950 | if(pMsg->bodyptr) |
| 1951 | { |
| 1952 | status = sme_remainOnChnRsp(pMac, pMsg->bodyptr); |
| 1953 | vos_mem_free(pMsg->bodyptr); |
| 1954 | } |
| 1955 | else |
| 1956 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1957 | 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] | 1958 | } |
| 1959 | break; |
| 1960 | case eWNI_SME_REMAIN_ON_CHN_RDY_IND: |
| 1961 | if(pMsg->bodyptr) |
| 1962 | { |
| 1963 | status = sme_remainOnChnReady(pMac, pMsg->bodyptr); |
| 1964 | vos_mem_free(pMsg->bodyptr); |
| 1965 | } |
| 1966 | else |
| 1967 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1968 | 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] | 1969 | } |
| 1970 | break; |
| 1971 | case eWNI_SME_MGMT_FRM_IND: |
| 1972 | if(pMsg->bodyptr) |
| 1973 | { |
| 1974 | sme_mgmtFrmInd(pMac, pMsg->bodyptr); |
| 1975 | vos_mem_free(pMsg->bodyptr); |
| 1976 | } |
| 1977 | else |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1978 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1979 | 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] | 1980 | } |
| 1981 | break; |
| 1982 | case eWNI_SME_ACTION_FRAME_SEND_CNF: |
| 1983 | if(pMsg->bodyptr) |
| 1984 | { |
| 1985 | status = sme_sendActionCnf(pMac, pMsg->bodyptr); |
| 1986 | vos_mem_free(pMsg->bodyptr); |
| 1987 | } |
| 1988 | else |
| 1989 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1990 | 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] | 1991 | } |
| 1992 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1993 | case eWNI_SME_COEX_IND: |
| 1994 | if(pMsg->bodyptr) |
| 1995 | { |
| 1996 | status = btcHandleCoexInd((void *)pMac, pMsg->bodyptr); |
| 1997 | vos_mem_free(pMsg->bodyptr); |
| 1998 | } |
| 1999 | else |
| 2000 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2001 | 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] | 2002 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2003 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2004 | |
| 2005 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 2006 | case eWNI_SME_PREF_NETWORK_FOUND_IND: |
| 2007 | if(pMsg->bodyptr) |
| 2008 | { |
| 2009 | status = sme_PreferredNetworkFoundInd((void *)pMac, pMsg->bodyptr); |
| 2010 | vos_mem_free(pMsg->bodyptr); |
| 2011 | } |
| 2012 | else |
| 2013 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2014 | 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] | 2015 | } |
| 2016 | break; |
| 2017 | #endif // FEATURE_WLAN_SCAN_PNO |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2018 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2019 | case eWNI_SME_TX_PER_HIT_IND: |
| 2020 | if (pMac->sme.pTxPerHitCallback) |
| 2021 | { |
| 2022 | pMac->sme.pTxPerHitCallback(pMac->sme.pTxPerHitCbContext); |
| 2023 | } |
| 2024 | break; |
| 2025 | |
| 2026 | case eWNI_SME_CHANGE_COUNTRY_CODE: |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 2027 | if(pMsg->bodyptr) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2028 | { |
| 2029 | status = sme_HandleChangeCountryCode((void *)pMac, pMsg->bodyptr); |
| 2030 | vos_mem_free(pMsg->bodyptr); |
| 2031 | } |
| 2032 | else |
| 2033 | { |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 2034 | smsLog(pMac, LOGE, "Empty rsp message for message (eWNI_SME_CHANGE_COUNTRY_CODE), nothing to process"); |
| 2035 | } |
| 2036 | break; |
| 2037 | |
| 2038 | case eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE: |
| 2039 | if (pMsg->bodyptr) |
| 2040 | { |
| 2041 | status = sme_HandleGenericChangeCountryCode((void *)pMac, pMsg->bodyptr); |
| 2042 | vos_mem_free(pMsg->bodyptr); |
| 2043 | } |
| 2044 | else |
| 2045 | { |
| 2046 | 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] | 2047 | } |
| 2048 | break; |
| 2049 | |
| 2050 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 2051 | case eWNI_PMC_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP: |
| 2052 | if(pMsg->bodyptr) |
| 2053 | { |
| 2054 | status = sme_PCFilterMatchCountResponseHandler((void *)pMac, pMsg->bodyptr); |
| 2055 | vos_mem_free(pMsg->bodyptr); |
| 2056 | } |
| 2057 | else |
| 2058 | { |
| 2059 | smsLog(pMac, LOGE, "Empty rsp message for meas " |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2060 | "(PACKET_COALESCING_FILTER_MATCH_COUNT_RSP), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2061 | } |
| 2062 | break; |
| 2063 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 2064 | case eWNI_SME_PRE_SWITCH_CHL_IND: |
| 2065 | { |
| 2066 | status = sme_HandlePreChannelSwitchInd(pMac); |
| 2067 | break; |
| 2068 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2069 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2070 | case eWNI_SME_POST_SWITCH_CHL_IND: |
| 2071 | { |
| 2072 | status = sme_HandlePostChannelSwitchInd(pMac); |
| 2073 | break; |
| 2074 | } |
| 2075 | |
| 2076 | #ifdef WLAN_WAKEUP_EVENTS |
| 2077 | case eWNI_SME_WAKE_REASON_IND: |
| 2078 | if(pMsg->bodyptr) |
| 2079 | { |
| 2080 | status = sme_WakeReasonIndCallback((void *)pMac, pMsg->bodyptr); |
| 2081 | vos_mem_free(pMsg->bodyptr); |
| 2082 | } |
| 2083 | else |
| 2084 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2085 | 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] | 2086 | } |
| 2087 | break; |
| 2088 | #endif // WLAN_WAKEUP_EVENTS |
| 2089 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2090 | #ifdef FEATURE_WLAN_TDLS |
| 2091 | /* |
| 2092 | * command rescived from PE, SME tdls msg processor shall be called |
| 2093 | * to process commands recieved from PE |
| 2094 | */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2095 | case eWNI_SME_TDLS_SEND_MGMT_RSP: |
| 2096 | case eWNI_SME_TDLS_ADD_STA_RSP: |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 2097 | case eWNI_SME_TDLS_DEL_STA_RSP: |
| 2098 | case eWNI_SME_TDLS_DEL_STA_IND: |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2099 | case eWNI_SME_TDLS_DEL_ALL_PEER_IND: |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 2100 | case eWNI_SME_MGMT_FRM_TX_COMPLETION_IND: |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 2101 | case eWNI_SME_TDLS_LINK_ESTABLISH_RSP: |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2102 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 2103 | case eWNI_SME_TDLS_DISCOVERY_START_RSP: |
| 2104 | case eWNI_SME_TDLS_DISCOVERY_START_IND: |
| 2105 | case eWNI_SME_TDLS_LINK_START_RSP: |
| 2106 | case eWNI_SME_TDLS_LINK_START_IND: |
| 2107 | case eWNI_SME_TDLS_TEARDOWN_RSP: |
| 2108 | case eWNI_SME_TDLS_TEARDOWN_IND: |
| 2109 | case eWNI_SME_ADD_TDLS_PEER_IND: |
| 2110 | case eWNI_SME_DELETE_TDLS_PEER_IND: |
| 2111 | #endif |
| 2112 | { |
| 2113 | if (pMsg->bodyptr) |
| 2114 | { |
| 2115 | status = tdlsMsgProcessor(pMac, pMsg->type, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2116 | vos_mem_free(pMsg->bodyptr); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2117 | } |
| 2118 | else |
| 2119 | { |
| 2120 | smsLog( pMac, LOGE, "Empty rsp message for TDLS, \ |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2121 | nothing to process"); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2122 | } |
| 2123 | break; |
| 2124 | } |
| 2125 | #endif |
| 2126 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2127 | #ifdef WLAN_FEATURE_11W |
| 2128 | case eWNI_SME_UNPROT_MGMT_FRM_IND: |
| 2129 | if (pMsg->bodyptr) |
| 2130 | { |
| 2131 | sme_UnprotectedMgmtFrmInd(pMac, pMsg->bodyptr); |
| 2132 | vos_mem_free(pMsg->bodyptr); |
| 2133 | } |
| 2134 | else |
| 2135 | { |
| 2136 | smsLog(pMac, LOGE, "Empty rsp message for meas (eWNI_SME_UNPROT_MGMT_FRM_IND), nothing to process"); |
| 2137 | } |
| 2138 | break; |
| 2139 | #endif |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2140 | #if defined(FEATURE_WLAN_CCX) && defined(FEATURE_WLAN_CCX_UPLOAD) |
| 2141 | case eWNI_SME_TSM_IE_IND: |
| 2142 | { |
| 2143 | if (pMsg->bodyptr) |
| 2144 | { |
| 2145 | sme_TsmIeInd(pMac, pMsg->bodyptr); |
| 2146 | vos_mem_free(pMsg->bodyptr); |
| 2147 | } |
| 2148 | else |
| 2149 | { |
| 2150 | smsLog(pMac, LOGE, "Empty rsp message for (eWNI_SME_TSM_IE_IND), nothing to process"); |
| 2151 | } |
| 2152 | break; |
| 2153 | } |
| 2154 | #endif /* FEATURE_WLAN_CCX && FEATURE_WLAN_CCX_UPLOAD */ |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 2155 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 2156 | case eWNI_SME_ROAM_SCAN_OFFLOAD_RSP: |
| 2157 | status = csrRoamOffloadScanRspHdlr((void *)pMac, pMsg->bodyval); |
| 2158 | break; |
| 2159 | #endif // WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2160 | |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 2161 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 2162 | case eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP: |
| 2163 | if (pMsg->bodyptr) |
| 2164 | { |
| 2165 | sme_ProcessGetGtkInfoRsp(pMac, pMsg->bodyptr); |
| 2166 | vos_mem_free(pMsg->bodyptr); |
| 2167 | } |
| 2168 | else |
| 2169 | { |
| 2170 | smsLog(pMac, LOGE, "Empty rsp message for (eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP), nothing to process"); |
| 2171 | } |
| 2172 | break ; |
| 2173 | #endif |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2174 | |
| 2175 | #ifdef FEATURE_WLAN_LPHB |
| 2176 | /* LPHB timeout indication arrived, send IND to client */ |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 2177 | case eWNI_SME_LPHB_IND: |
| 2178 | if (pMac->sme.pLphbIndCb) |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2179 | { |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 2180 | pMac->sme.pLphbIndCb(pMac->pAdapter, pMsg->bodyptr); |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2181 | } |
| 2182 | vos_mem_free(pMsg->bodyptr); |
| 2183 | |
| 2184 | break; |
| 2185 | #endif /* FEATURE_WLAN_LPHB */ |
| 2186 | |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 2187 | #ifdef FEATURE_WLAN_CH_AVOID |
| 2188 | /* LPHB timeout indication arrived, send IND to client */ |
| 2189 | case eWNI_SME_CH_AVOID_IND: |
| 2190 | if (pMac->sme.pChAvoidNotificationCb) |
| 2191 | { |
| 2192 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 2193 | "%s: CH avoid notification", __func__); |
| 2194 | pMac->sme.pChAvoidNotificationCb(pMac->pAdapter, pMsg->bodyptr); |
| 2195 | } |
| 2196 | vos_mem_free(pMsg->bodyptr); |
| 2197 | |
| 2198 | break; |
| 2199 | #endif /* FEATURE_WLAN_CH_AVOID */ |
| 2200 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2201 | default: |
| 2202 | |
| 2203 | if ( ( pMsg->type >= eWNI_SME_MSG_TYPES_BEGIN ) |
| 2204 | && ( pMsg->type <= eWNI_SME_MSG_TYPES_END ) ) |
| 2205 | { |
| 2206 | //CSR |
| 2207 | if (pMsg->bodyptr) |
| 2208 | { |
| 2209 | status = csrMsgProcessor(hHal, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2210 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2211 | } |
| 2212 | else |
| 2213 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2214 | smsLog( pMac, LOGE, "Empty rsp message for CSR, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2215 | } |
| 2216 | } |
| 2217 | else |
| 2218 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2219 | smsLog( pMac, LOGW, "Unknown message type %d, nothing to process", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2220 | pMsg->type); |
| 2221 | if (pMsg->bodyptr) |
| 2222 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2223 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2224 | } |
| 2225 | } |
| 2226 | }//switch |
| 2227 | } //SME_IS_START |
| 2228 | else |
| 2229 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2230 | smsLog( pMac, LOGW, "message type %d in stop state ignored", pMsg->type); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2231 | if (pMsg->bodyptr) |
| 2232 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2233 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2234 | } |
| 2235 | } |
| 2236 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2237 | } |
| 2238 | else |
| 2239 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2240 | smsLog( pMac, LOGW, "Locking failed, bailing out"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2241 | if (pMsg->bodyptr) |
| 2242 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2243 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2244 | } |
| 2245 | } |
| 2246 | |
| 2247 | return status; |
| 2248 | } |
| 2249 | |
| 2250 | |
| 2251 | //No need to hold the global lock here because this function can only be called |
| 2252 | //after sme_Stop. |
| 2253 | v_VOID_t sme_FreeMsg( tHalHandle hHal, vos_msg_t* pMsg ) |
| 2254 | { |
| 2255 | if( pMsg ) |
| 2256 | { |
| 2257 | if (pMsg->bodyptr) |
| 2258 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2259 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2260 | } |
| 2261 | } |
| 2262 | |
| 2263 | } |
| 2264 | |
| 2265 | |
| 2266 | /*-------------------------------------------------------------------------- |
| 2267 | |
| 2268 | \brief sme_Stop() - Stop all SME modules and put them at idle state |
| 2269 | |
| 2270 | The function stops each module in SME, PMC, CCM, CSR, etc. . Upon |
| 2271 | return, all modules are at idle state ready to start. |
| 2272 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2273 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2274 | \param hHal - The handle returned by macOpen |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2275 | \param tHalStopType - reason for stopping |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2276 | |
| 2277 | \return eHAL_STATUS_SUCCESS - SME is stopped. |
| 2278 | |
| 2279 | Other status means SME is failed to stop but caller should still |
| 2280 | consider SME is stopped. |
| 2281 | \sa |
| 2282 | |
| 2283 | --------------------------------------------------------------------------*/ |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2284 | eHalStatus sme_Stop(tHalHandle hHal, tHalStopType stopType) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2285 | { |
| 2286 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2287 | eHalStatus fail_status = eHAL_STATUS_SUCCESS; |
| 2288 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2289 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2290 | status = WLANSAP_Stop(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 2291 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2292 | smsLog( pMac, LOGE, "WLANSAP_Stop failed during smeStop with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2293 | status ); |
| 2294 | fail_status = status; |
| 2295 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2296 | |
| 2297 | p2pStop(hHal); |
| 2298 | |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2299 | status = pmcStop(hHal); |
| 2300 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 2301 | smsLog( pMac, LOGE, "pmcStop failed during smeStop with status=%d", |
| 2302 | status ); |
| 2303 | fail_status = status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2304 | } |
| 2305 | |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2306 | status = csrStop(pMac, stopType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2307 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2308 | smsLog( pMac, LOGE, "csrStop failed during smeStop with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2309 | status ); |
| 2310 | fail_status = status; |
| 2311 | } |
| 2312 | |
| 2313 | ccmStop(hHal); |
| 2314 | |
| 2315 | purgeSmeCmdList(pMac); |
| 2316 | |
| 2317 | if (!HAL_STATUS_SUCCESS( fail_status )) { |
| 2318 | status = fail_status; |
| 2319 | } |
| 2320 | |
| 2321 | pMac->sme.state = SME_STATE_STOP; |
| 2322 | |
| 2323 | return status; |
| 2324 | } |
| 2325 | |
| 2326 | /*-------------------------------------------------------------------------- |
| 2327 | |
| 2328 | \brief sme_Close() - Release all SME modules and their resources. |
| 2329 | |
| 2330 | The function release each module in SME, PMC, CCM, CSR, etc. . Upon |
| 2331 | return, all modules are at closed state. |
| 2332 | |
| 2333 | No SME APIs can be involved after smeClose except smeOpen. |
| 2334 | smeClose must be called before macClose. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2335 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2336 | \param hHal - The handle returned by macOpen |
| 2337 | |
| 2338 | \return eHAL_STATUS_SUCCESS - SME is successfully close. |
| 2339 | |
| 2340 | Other status means SME is failed to be closed but caller still cannot |
| 2341 | call any other SME functions except smeOpen. |
| 2342 | \sa |
| 2343 | |
| 2344 | --------------------------------------------------------------------------*/ |
| 2345 | eHalStatus sme_Close(tHalHandle hHal) |
| 2346 | { |
| 2347 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2348 | eHalStatus fail_status = eHAL_STATUS_SUCCESS; |
| 2349 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2350 | |
| 2351 | status = csrClose(pMac); |
| 2352 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2353 | smsLog( pMac, LOGE, "csrClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2354 | status ); |
| 2355 | fail_status = status; |
| 2356 | } |
| 2357 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2358 | status = WLANSAP_Close(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 2359 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2360 | smsLog( pMac, LOGE, "WLANSAP_close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2361 | status ); |
| 2362 | fail_status = status; |
| 2363 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2364 | |
| 2365 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 2366 | status = btcClose(hHal); |
| 2367 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2368 | smsLog( pMac, LOGE, "BTC close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2369 | status ); |
| 2370 | fail_status = status; |
| 2371 | } |
| 2372 | |
| 2373 | status = sme_QosClose(pMac); |
| 2374 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2375 | smsLog( pMac, LOGE, "Qos close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2376 | status ); |
| 2377 | fail_status = status; |
| 2378 | } |
| 2379 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2380 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 2381 | status = oemData_OemDataReqClose(hHal); |
| 2382 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2383 | 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] | 2384 | status ); |
| 2385 | fail_status = status; |
| 2386 | } |
| 2387 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2388 | |
| 2389 | status = ccmClose(hHal); |
| 2390 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2391 | smsLog( pMac, LOGE, "ccmClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2392 | status ); |
| 2393 | fail_status = status; |
| 2394 | } |
| 2395 | |
| 2396 | status = pmcClose(hHal); |
| 2397 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2398 | smsLog( pMac, LOGE, "pmcClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2399 | status ); |
| 2400 | fail_status = status; |
| 2401 | } |
| 2402 | #if defined WLAN_FEATURE_VOWIFI |
| 2403 | status = rrmClose(hHal); |
| 2404 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2405 | smsLog( pMac, LOGE, "RRM close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2406 | status ); |
| 2407 | fail_status = status; |
| 2408 | } |
| 2409 | #endif |
| 2410 | |
| 2411 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 2412 | sme_FTClose(hHal); |
| 2413 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2414 | sme_p2pClose(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2415 | |
| 2416 | freeSmeCmdList(pMac); |
| 2417 | |
| 2418 | if( !VOS_IS_STATUS_SUCCESS( vos_lock_destroy( &pMac->sme.lkSmeGlobalLock ) ) ) |
| 2419 | { |
| 2420 | fail_status = eHAL_STATUS_FAILURE; |
| 2421 | } |
| 2422 | |
| 2423 | if (!HAL_STATUS_SUCCESS( fail_status )) { |
| 2424 | status = fail_status; |
| 2425 | } |
| 2426 | |
| 2427 | pMac->sme.state = SME_STATE_STOP; |
| 2428 | |
| 2429 | return status; |
| 2430 | } |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2431 | #ifdef FEATURE_WLAN_LFR |
| 2432 | tANI_BOOLEAN csrIsScanAllowed(tpAniSirGlobal pMac) |
| 2433 | { |
Madan Mohan Koyyalamudi | fb534bb | 2012-10-24 14:35:45 -0700 | [diff] [blame] | 2434 | #if 0 |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2435 | switch(pMac->roam.neighborRoamInfo.neighborRoamState) { |
| 2436 | case eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN: |
| 2437 | case eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING: |
| 2438 | case eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE: |
| 2439 | case eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING: |
| 2440 | return eANI_BOOLEAN_FALSE; |
| 2441 | default: |
| 2442 | return eANI_BOOLEAN_TRUE; |
| 2443 | } |
Madan Mohan Koyyalamudi | fb534bb | 2012-10-24 14:35:45 -0700 | [diff] [blame] | 2444 | #else |
| 2445 | /* |
| 2446 | * TODO: always return TRUE for now until |
| 2447 | * we figure out why we could be stuck in |
| 2448 | * one of the roaming states forever. |
| 2449 | */ |
| 2450 | return eANI_BOOLEAN_TRUE; |
| 2451 | #endif |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2452 | } |
| 2453 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2454 | /* --------------------------------------------------------------------------- |
| 2455 | \fn sme_ScanRequest |
| 2456 | \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] | 2457 | This is an asynchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2458 | \param pScanRequestID - pointer to an object to get back the request ID |
| 2459 | \param callback - a callback function that scan calls upon finish, will not |
| 2460 | be called if csrScanRequest returns error |
| 2461 | \param pContext - a pointer passed in for the callback |
| 2462 | \return eHalStatus |
| 2463 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2464 | eHalStatus sme_ScanRequest(tHalHandle hHal, tANI_U8 sessionId, tCsrScanRequest *pscanReq, |
| 2465 | tANI_U32 *pScanRequestID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2466 | csrScanCompleteCallback callback, void *pContext) |
| 2467 | { |
| 2468 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2469 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2470 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2471 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_REQ, sessionId, pscanReq->scanType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2472 | smsLog(pMac, LOG2, FL("enter")); |
| 2473 | do |
| 2474 | { |
| 2475 | if(pMac->scan.fScanEnable) |
| 2476 | { |
| 2477 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2478 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2479 | { |
| 2480 | { |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2481 | #ifdef FEATURE_WLAN_LFR |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2482 | if(csrIsScanAllowed(pMac)) |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2483 | { |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2484 | #endif |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2485 | status = csrScanRequest( hHal, sessionId, pscanReq, |
| 2486 | pScanRequestID, callback, pContext ); |
Vinay Krishna Eranna | 636b7bc | 2013-12-18 20:49:08 +0530 | [diff] [blame] | 2487 | if ( !HAL_STATUS_SUCCESS( status ) ) |
| 2488 | { |
| 2489 | smsLog(pMac, LOGE, FL("csrScanRequest failed" |
| 2490 | " SId=%d"), sessionId); |
| 2491 | } |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2492 | #ifdef FEATURE_WLAN_LFR |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2493 | } |
| 2494 | else |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2495 | { |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 2496 | smsLog(pMac, LOGE, FL("Scan denied in state %s" |
Mahesh A Saptasagar | 14addb6 | 2014-02-17 17:17:51 +0530 | [diff] [blame^] | 2497 | "(sub-state %s)"), |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 2498 | macTraceGetNeighbourRoamState( |
| 2499 | pMac->roam.neighborRoamInfo.neighborRoamState), |
Mahesh A Saptasagar | 14addb6 | 2014-02-17 17:17:51 +0530 | [diff] [blame^] | 2500 | macTraceGetcsrRoamSubState( |
| 2501 | pMac->roam.curSubState[sessionId])); |
Madan Mohan Koyyalamudi | ab4ab0d | 2012-10-24 14:26:50 -0700 | [diff] [blame] | 2502 | /*HandOff is in progress. So schedule this scan later*/ |
| 2503 | status = eHAL_STATUS_RESOURCES; |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2504 | } |
| 2505 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2506 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2507 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2508 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2509 | } //sme_AcquireGlobalLock success |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2510 | else |
| 2511 | { |
| 2512 | smsLog(pMac, LOGE, FL("sme_AcquireGlobalLock failed")); |
| 2513 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2514 | } //if(pMac->scan.fScanEnable) |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2515 | else |
| 2516 | { |
| 2517 | smsLog(pMac, LOGE, FL("fScanEnable FALSE")); |
| 2518 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2519 | } while( 0 ); |
| 2520 | |
| 2521 | return (status); |
| 2522 | |
| 2523 | |
| 2524 | } |
| 2525 | |
| 2526 | /* --------------------------------------------------------------------------- |
| 2527 | \fn sme_ScanGetResult |
| 2528 | \brief a wrapper function to request scan results from CSR. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2529 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2530 | \param pFilter - If pFilter is NULL, all cached results are returned |
| 2531 | \param phResult - an object for the result. |
| 2532 | \return eHalStatus |
| 2533 | ---------------------------------------------------------------------------*/ |
| 2534 | eHalStatus sme_ScanGetResult(tHalHandle hHal, tANI_U8 sessionId, tCsrScanResultFilter *pFilter, |
| 2535 | tScanResultHandle *phResult) |
| 2536 | { |
| 2537 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2538 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2539 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2540 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2541 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_GET_RESULTS, sessionId,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2542 | smsLog(pMac, LOG2, FL("enter")); |
| 2543 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2544 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2545 | { |
Madan Mohan Koyyalamudi | ca43cdf | 2012-09-24 13:15:49 -0700 | [diff] [blame] | 2546 | status = csrScanGetResult( hHal, pFilter, phResult ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2547 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2548 | } |
| 2549 | smsLog(pMac, LOG2, FL("exit status %d"), status); |
| 2550 | |
| 2551 | return (status); |
| 2552 | } |
| 2553 | |
| 2554 | |
| 2555 | /* --------------------------------------------------------------------------- |
| 2556 | \fn sme_ScanFlushResult |
| 2557 | \brief a wrapper function to request CSR to clear scan results. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2558 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2559 | \return eHalStatus |
| 2560 | ---------------------------------------------------------------------------*/ |
| 2561 | eHalStatus sme_ScanFlushResult(tHalHandle hHal, tANI_U8 sessionId) |
| 2562 | { |
| 2563 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2564 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2565 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2566 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2567 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_RESULTS, sessionId,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2568 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2569 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2570 | { |
Madan Mohan Koyyalamudi | ca43cdf | 2012-09-24 13:15:49 -0700 | [diff] [blame] | 2571 | status = csrScanFlushResult( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2572 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2573 | } |
| 2574 | |
| 2575 | return (status); |
| 2576 | } |
| 2577 | |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 2578 | /* --------------------------------------------------------------------------- |
| 2579 | \fn sme_FilterScanResults |
| 2580 | \brief a wrapper function to request CSR to clear scan results. |
| 2581 | This is a synchronous call |
| 2582 | \return eHalStatus |
| 2583 | ---------------------------------------------------------------------------*/ |
| 2584 | eHalStatus sme_FilterScanResults(tHalHandle hHal, tANI_U8 sessionId) |
| 2585 | { |
| 2586 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 2587 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2588 | |
| 2589 | MTRACE(macTraceNew(pMac, VOS_MODULE_ID_SME, |
| 2590 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_RESULTS, sessionId,0 )); |
| 2591 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2592 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2593 | { |
| 2594 | csrScanFilterResults(pMac); |
| 2595 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2596 | } |
| 2597 | |
| 2598 | return (status); |
| 2599 | } |
| 2600 | |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 2601 | eHalStatus sme_ScanFlushP2PResult(tHalHandle hHal, tANI_U8 sessionId) |
| 2602 | { |
| 2603 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2604 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2605 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2606 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2607 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_P2PRESULTS, sessionId,0 )); |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 2608 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2609 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2610 | { |
Madan Mohan Koyyalamudi | 5850f31 | 2012-11-27 19:00:25 +0530 | [diff] [blame] | 2611 | status = csrScanFlushSelectiveResult( hHal, VOS_TRUE ); |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 2612 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2613 | } |
| 2614 | |
| 2615 | return (status); |
| 2616 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2617 | |
| 2618 | /* --------------------------------------------------------------------------- |
| 2619 | \fn sme_ScanResultGetFirst |
| 2620 | \brief a wrapper function to request CSR to returns the first element of |
| 2621 | scan result. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2622 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2623 | \param hScanResult - returned from csrScanGetResult |
| 2624 | \return tCsrScanResultInfo * - NULL if no result |
| 2625 | ---------------------------------------------------------------------------*/ |
| 2626 | tCsrScanResultInfo *sme_ScanResultGetFirst(tHalHandle hHal, |
| 2627 | tScanResultHandle hScanResult) |
| 2628 | { |
| 2629 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2630 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2631 | tCsrScanResultInfo *pRet = NULL; |
| 2632 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2633 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2634 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_GETFIRST, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2635 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2636 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2637 | { |
| 2638 | pRet = csrScanResultGetFirst( pMac, hScanResult ); |
| 2639 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2640 | } |
| 2641 | |
| 2642 | return (pRet); |
| 2643 | } |
| 2644 | |
| 2645 | |
| 2646 | /* --------------------------------------------------------------------------- |
| 2647 | \fn sme_ScanResultGetNext |
| 2648 | \brief a wrapper function to request CSR to returns the next element of |
| 2649 | scan result. It can be called without calling csrScanResultGetFirst |
| 2650 | first |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2651 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2652 | \param hScanResult - returned from csrScanGetResult |
| 2653 | \return Null if no result or reach the end |
| 2654 | ---------------------------------------------------------------------------*/ |
| 2655 | tCsrScanResultInfo *sme_ScanResultGetNext(tHalHandle hHal, |
| 2656 | tScanResultHandle hScanResult) |
| 2657 | { |
| 2658 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2659 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2660 | tCsrScanResultInfo *pRet = NULL; |
| 2661 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2662 | MTRACE(vos_trace(VOS_MODULE_ID_SME , |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2663 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_GETNEXT, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2664 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2665 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2666 | { |
| 2667 | pRet = csrScanResultGetNext( pMac, hScanResult ); |
| 2668 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2669 | } |
| 2670 | |
| 2671 | return (pRet); |
| 2672 | } |
| 2673 | |
| 2674 | |
| 2675 | /* --------------------------------------------------------------------------- |
| 2676 | \fn sme_ScanSetBGScanparams |
| 2677 | \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] | 2678 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2679 | \param pScanReq - BG scan request structure |
| 2680 | \return eHalStatus |
| 2681 | ---------------------------------------------------------------------------*/ |
| 2682 | eHalStatus sme_ScanSetBGScanparams(tHalHandle hHal, tANI_U8 sessionId, tCsrBGScanRequest *pScanReq) |
| 2683 | { |
| 2684 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2685 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2686 | |
| 2687 | if( NULL != pScanReq ) |
| 2688 | { |
| 2689 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2690 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2691 | { |
| 2692 | status = csrScanSetBGScanparams( hHal, pScanReq ); |
| 2693 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2694 | } |
| 2695 | } |
| 2696 | |
| 2697 | return (status); |
| 2698 | } |
| 2699 | |
| 2700 | |
| 2701 | /* --------------------------------------------------------------------------- |
| 2702 | \fn sme_ScanResultPurge |
| 2703 | \brief a wrapper function to request CSR to remove all items(tCsrScanResult) |
| 2704 | in the list and free memory for each item |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2705 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2706 | \param hScanResult - returned from csrScanGetResult. hScanResult is |
| 2707 | considered gone by |
| 2708 | calling this function and even before this function reutrns. |
| 2709 | \return eHalStatus |
| 2710 | ---------------------------------------------------------------------------*/ |
| 2711 | eHalStatus sme_ScanResultPurge(tHalHandle hHal, tScanResultHandle hScanResult) |
| 2712 | { |
| 2713 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2714 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2715 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2716 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2717 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_PURGE, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2718 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2719 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2720 | { |
| 2721 | status = csrScanResultPurge( hHal, hScanResult ); |
| 2722 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2723 | } |
| 2724 | |
| 2725 | return (status); |
| 2726 | } |
| 2727 | |
| 2728 | /* --------------------------------------------------------------------------- |
| 2729 | \fn sme_ScanGetPMKIDCandidateList |
| 2730 | \brief a wrapper function to return the PMKID candidate list |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2731 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2732 | \param pPmkidList - caller allocated buffer point to an array of |
| 2733 | tPmkidCandidateInfo |
| 2734 | \param pNumItems - pointer to a variable that has the number of |
| 2735 | tPmkidCandidateInfo allocated when retruning, this is |
| 2736 | either the number needed or number of items put into |
| 2737 | pPmkidList |
| 2738 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 2739 | big enough and pNumItems |
| 2740 | has the number of tPmkidCandidateInfo. |
| 2741 | \Note: pNumItems is a number of tPmkidCandidateInfo, |
| 2742 | not sizeof(tPmkidCandidateInfo) * something |
| 2743 | ---------------------------------------------------------------------------*/ |
| 2744 | eHalStatus sme_ScanGetPMKIDCandidateList(tHalHandle hHal, tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2745 | tPmkidCandidateInfo *pPmkidList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2746 | tANI_U32 *pNumItems ) |
| 2747 | { |
| 2748 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2749 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2750 | |
| 2751 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2752 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2753 | { |
| 2754 | status = csrScanGetPMKIDCandidateList( pMac, sessionId, pPmkidList, pNumItems ); |
| 2755 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2756 | } |
| 2757 | |
| 2758 | return (status); |
| 2759 | } |
| 2760 | |
| 2761 | /*---------------------------------------------------------------------------- |
| 2762 | \fn sme_RoamRegisterLinkQualityIndCallback |
| 2763 | |
| 2764 | \brief |
| 2765 | a wrapper function to allow HDD to register a callback handler with CSR for |
| 2766 | link quality indications. |
| 2767 | |
| 2768 | Only one callback may be registered at any time. |
| 2769 | In order to deregister the callback, a NULL cback may be provided. |
| 2770 | |
| 2771 | Registration happens in the task context of the caller. |
| 2772 | |
| 2773 | \param callback - Call back being registered |
| 2774 | \param pContext - user data |
| 2775 | |
| 2776 | DEPENDENCIES: After CSR open |
| 2777 | |
| 2778 | \return eHalStatus |
| 2779 | -----------------------------------------------------------------------------*/ |
| 2780 | eHalStatus sme_RoamRegisterLinkQualityIndCallback(tHalHandle hHal, tANI_U8 sessionId, |
| 2781 | csrRoamLinkQualityIndCallback callback, |
| 2782 | void *pContext) |
| 2783 | { |
| 2784 | return(csrRoamRegisterLinkQualityIndCallback((tpAniSirGlobal)hHal, callback, pContext)); |
| 2785 | } |
| 2786 | |
| 2787 | /* --------------------------------------------------------------------------- |
| 2788 | \fn sme_RoamRegisterCallback |
| 2789 | \brief a wrapper function to allow HDD to register a callback with CSR. |
| 2790 | Unlike scan, roam has one callback for all the roam requests |
| 2791 | \param callback - a callback function that roam calls upon when state changes |
| 2792 | \param pContext - a pointer passed in for the callback |
| 2793 | \return eHalStatus |
| 2794 | ---------------------------------------------------------------------------*/ |
| 2795 | eHalStatus sme_RoamRegisterCallback(tHalHandle hHal, |
| 2796 | csrRoamCompleteCallback callback, |
| 2797 | void *pContext) |
| 2798 | { |
| 2799 | return(csrRoamRegisterCallback((tpAniSirGlobal)hHal, callback, pContext)); |
| 2800 | } |
| 2801 | |
| 2802 | eCsrPhyMode sme_GetPhyMode(tHalHandle hHal) |
| 2803 | { |
| 2804 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 2805 | return pMac->roam.configParam.phyMode; |
| 2806 | } |
| 2807 | |
| 2808 | /* --------------------------------------------------------------------------- |
| 2809 | \fn sme_RoamConnect |
| 2810 | \brief a wrapper function to request CSR to inititiate an association |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2811 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2812 | \param sessionId - the sessionId returned by sme_OpenSession. |
| 2813 | \param pProfile - description of the network to which to connect |
| 2814 | \param hBssListIn - a list of BSS descriptor to roam to. It is returned |
| 2815 | from csrScanGetResult |
| 2816 | \param pRoamId - to get back the request ID |
| 2817 | \return eHalStatus |
| 2818 | ---------------------------------------------------------------------------*/ |
| 2819 | eHalStatus sme_RoamConnect(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamProfile *pProfile, |
| 2820 | tANI_U32 *pRoamId) |
| 2821 | { |
| 2822 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2823 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2824 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2825 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2826 | TRACE_CODE_SME_RX_HDD_MSG_CONNECT, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2827 | smsLog(pMac, LOG2, FL("enter")); |
| 2828 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2829 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2830 | { |
| 2831 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 2832 | { |
| 2833 | status = csrRoamConnect( pMac, sessionId, pProfile, NULL, pRoamId ); |
| 2834 | } |
| 2835 | else |
| 2836 | { |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2837 | smsLog(pMac, LOGE, FL("invalid sessionID %d"), sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2838 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 2839 | } |
| 2840 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2841 | } |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2842 | else |
| 2843 | { |
| 2844 | smsLog(pMac, LOGE, FL("sme_AcquireGlobalLock failed")); |
| 2845 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2846 | |
| 2847 | return (status); |
| 2848 | } |
| 2849 | |
| 2850 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | dacbcb5 | 2013-04-18 16:41:54 +0530 | [diff] [blame] | 2851 | |
| 2852 | \fn sme_SetPhyMode |
| 2853 | |
| 2854 | \brief Changes the PhyMode. |
| 2855 | |
| 2856 | \param hHal - The handle returned by macOpen. |
| 2857 | |
| 2858 | \param phyMode new phyMode which is to set |
| 2859 | |
| 2860 | \return eHalStatus SUCCESS. |
| 2861 | |
| 2862 | -------------------------------------------------------------------------------*/ |
| 2863 | eHalStatus sme_SetPhyMode(tHalHandle hHal, eCsrPhyMode phyMode) |
| 2864 | { |
| 2865 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2866 | |
| 2867 | if (NULL == pMac) |
| 2868 | { |
| 2869 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 2870 | "%s: invalid context", __func__); |
| 2871 | return eHAL_STATUS_FAILURE; |
| 2872 | } |
| 2873 | |
| 2874 | pMac->roam.configParam.phyMode = phyMode; |
| 2875 | pMac->roam.configParam.uCfgDot11Mode = csrGetCfgDot11ModeFromCsrPhyMode(NULL, |
| 2876 | pMac->roam.configParam.phyMode, |
| 2877 | pMac->roam.configParam.ProprietaryRatesEnabled); |
| 2878 | |
| 2879 | return eHAL_STATUS_SUCCESS; |
| 2880 | } |
| 2881 | |
| 2882 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2883 | \fn sme_RoamReassoc |
| 2884 | \brief a wrapper function to request CSR to inititiate a re-association |
| 2885 | \param pProfile - can be NULL to join the currently connected AP. In that |
| 2886 | case modProfileFields should carry the modified field(s) which could trigger |
| 2887 | reassoc |
| 2888 | \param modProfileFields - fields which are part of tCsrRoamConnectedProfile |
| 2889 | that might need modification dynamically once STA is up & running and this |
| 2890 | could trigger a reassoc |
| 2891 | \param pRoamId - to get back the request ID |
| 2892 | \return eHalStatus |
| 2893 | -------------------------------------------------------------------------------*/ |
| 2894 | eHalStatus sme_RoamReassoc(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamProfile *pProfile, |
| 2895 | tCsrRoamModifyProfileFields modProfileFields, |
Madan Mohan Koyyalamudi | ea22cdc | 2012-10-18 21:02:23 -0700 | [diff] [blame] | 2896 | tANI_U32 *pRoamId, v_BOOL_t fForce) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2897 | { |
| 2898 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2899 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2900 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2901 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2902 | TRACE_CODE_SME_RX_HDD_ROAM_REASSOC, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2903 | smsLog(pMac, LOG2, FL("enter")); |
| 2904 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2905 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2906 | { |
| 2907 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 2908 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2909 | if((NULL == pProfile) && (fForce == 1)) |
| 2910 | { |
Madan Mohan Koyyalamudi | 0d0e171 | 2012-10-21 12:02:45 -0700 | [diff] [blame] | 2911 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 2912 | /* to force the AP initiate fresh 802.1x authentication need to clear |
| 2913 | * the PMKID cache for that set the following boolean. this is needed |
| 2914 | * by the HS 2.0 passpoint certification 5.2.a and b testcases */ |
| 2915 | pSession->fIgnorePMKIDCache = TRUE; |
Madan Mohan Koyyalamudi | ea22cdc | 2012-10-18 21:02:23 -0700 | [diff] [blame] | 2916 | status = csrReassoc( pMac, sessionId, &modProfileFields, pRoamId , fForce); |
| 2917 | } |
| 2918 | else |
| 2919 | { |
| 2920 | status = csrRoamReassoc( pMac, sessionId, pProfile, modProfileFields, pRoamId ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2921 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2922 | } |
| 2923 | else |
| 2924 | { |
| 2925 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 2926 | } |
| 2927 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2928 | } |
| 2929 | |
| 2930 | return (status); |
| 2931 | } |
| 2932 | |
| 2933 | /* --------------------------------------------------------------------------- |
| 2934 | \fn sme_RoamConnectToLastProfile |
| 2935 | \brief a wrapper function to request CSR to disconnect and reconnect with |
| 2936 | the same profile |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2937 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2938 | \return eHalStatus. It returns fail if currently connected |
| 2939 | ---------------------------------------------------------------------------*/ |
| 2940 | eHalStatus sme_RoamConnectToLastProfile(tHalHandle hHal, tANI_U8 sessionId) |
| 2941 | { |
| 2942 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2943 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2944 | |
| 2945 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2946 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2947 | { |
| 2948 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 2949 | { |
| 2950 | status = csrRoamConnectToLastProfile( pMac, sessionId ); |
| 2951 | } |
| 2952 | else |
| 2953 | { |
| 2954 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 2955 | } |
| 2956 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2957 | } |
| 2958 | |
| 2959 | return (status); |
| 2960 | } |
| 2961 | |
| 2962 | /* --------------------------------------------------------------------------- |
| 2963 | \fn sme_RoamDisconnect |
| 2964 | \brief a wrapper function to request CSR to disconnect from a network |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2965 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2966 | \param reason -- To indicate the reason for disconnecting. Currently, only |
| 2967 | eCSR_DISCONNECT_REASON_MIC_ERROR is meanful. |
| 2968 | \return eHalStatus |
| 2969 | ---------------------------------------------------------------------------*/ |
| 2970 | eHalStatus sme_RoamDisconnect(tHalHandle hHal, tANI_U8 sessionId, eCsrRoamDisconnectReason reason) |
| 2971 | { |
| 2972 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2973 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2974 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2975 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2976 | TRACE_CODE_SME_RX_HDD_ROAM_DISCONNECT, sessionId, reason)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2977 | smsLog(pMac, LOG2, FL("enter")); |
| 2978 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2979 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2980 | { |
| 2981 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 2982 | { |
| 2983 | status = csrRoamDisconnect( pMac, sessionId, reason ); |
| 2984 | } |
| 2985 | else |
| 2986 | { |
| 2987 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 2988 | } |
| 2989 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2990 | } |
| 2991 | |
| 2992 | return (status); |
| 2993 | } |
| 2994 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2995 | /* --------------------------------------------------------------------------- |
| 2996 | \fn sme_RoamStopBss |
| 2997 | \brief To stop BSS for Soft AP. This is an asynchronous API. |
| 2998 | \param hHal - Global structure |
| 2999 | \param sessionId - sessionId of SoftAP |
| 3000 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3001 | -------------------------------------------------------------------------------*/ |
| 3002 | eHalStatus sme_RoamStopBss(tHalHandle hHal, tANI_U8 sessionId) |
| 3003 | { |
| 3004 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3005 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3006 | |
| 3007 | smsLog(pMac, LOG2, FL("enter")); |
| 3008 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3009 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3010 | { |
| 3011 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3012 | { |
Gopichand Nakkala | f44bdc5 | 2013-02-16 00:54:45 +0530 | [diff] [blame] | 3013 | status = csrRoamIssueStopBssCmd( pMac, sessionId, eANI_BOOLEAN_FALSE ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3014 | } |
| 3015 | else |
| 3016 | { |
| 3017 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3018 | } |
| 3019 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3020 | } |
| 3021 | |
| 3022 | return (status); |
| 3023 | } |
| 3024 | |
| 3025 | /* --------------------------------------------------------------------------- |
| 3026 | \fn sme_RoamDisconnectSta |
| 3027 | \brief To disassociate a station. This is an asynchronous API. |
| 3028 | \param hHal - Global structure |
| 3029 | \param sessionId - sessionId of SoftAP |
| 3030 | \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) |
| 3031 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3032 | -------------------------------------------------------------------------------*/ |
| 3033 | eHalStatus sme_RoamDisconnectSta(tHalHandle hHal, tANI_U8 sessionId, |
| 3034 | tANI_U8 *pPeerMacAddr) |
| 3035 | { |
| 3036 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3037 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3038 | |
| 3039 | if ( NULL == pMac ) |
| 3040 | { |
| 3041 | VOS_ASSERT(0); |
| 3042 | return status; |
| 3043 | } |
| 3044 | |
| 3045 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3046 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3047 | { |
| 3048 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3049 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3050 | status = csrRoamIssueDisassociateStaCmd( pMac, sessionId, pPeerMacAddr, |
Madan Mohan Koyyalamudi | 299b486 | 2013-01-30 19:59:23 +0530 | [diff] [blame] | 3051 | eSIR_MAC_DEAUTH_LEAVING_BSS_REASON); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3052 | } |
| 3053 | else |
| 3054 | { |
| 3055 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3056 | } |
| 3057 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3058 | } |
| 3059 | |
| 3060 | return (status); |
| 3061 | } |
| 3062 | |
| 3063 | /* --------------------------------------------------------------------------- |
| 3064 | \fn sme_RoamDeauthSta |
| 3065 | \brief To disassociate a station. This is an asynchronous API. |
| 3066 | \param hHal - Global structure |
| 3067 | \param sessionId - sessionId of SoftAP |
| 3068 | \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) |
| 3069 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3070 | -------------------------------------------------------------------------------*/ |
| 3071 | eHalStatus sme_RoamDeauthSta(tHalHandle hHal, tANI_U8 sessionId, |
| 3072 | tANI_U8 *pPeerMacAddr) |
| 3073 | { |
| 3074 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3075 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3076 | |
| 3077 | if ( NULL == pMac ) |
| 3078 | { |
| 3079 | VOS_ASSERT(0); |
| 3080 | return status; |
| 3081 | } |
| 3082 | |
| 3083 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3084 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3085 | { |
| 3086 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3087 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3088 | status = csrRoamIssueDeauthStaCmd( pMac, sessionId, pPeerMacAddr, |
Madan Mohan Koyyalamudi | 299b486 | 2013-01-30 19:59:23 +0530 | [diff] [blame] | 3089 | eSIR_MAC_DEAUTH_LEAVING_BSS_REASON); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3090 | } |
| 3091 | else |
| 3092 | { |
| 3093 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3094 | } |
| 3095 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3096 | } |
| 3097 | |
| 3098 | return (status); |
| 3099 | } |
| 3100 | |
| 3101 | /* --------------------------------------------------------------------------- |
| 3102 | \fn sme_RoamTKIPCounterMeasures |
| 3103 | \brief To start or stop TKIP counter measures. This is an asynchronous API. |
| 3104 | \param sessionId - sessionId of SoftAP |
| 3105 | \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) |
| 3106 | \return eHalStatus |
| 3107 | -------------------------------------------------------------------------------*/ |
| 3108 | eHalStatus sme_RoamTKIPCounterMeasures(tHalHandle hHal, tANI_U8 sessionId, |
| 3109 | tANI_BOOLEAN bEnable) |
| 3110 | { |
| 3111 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3112 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3113 | |
| 3114 | if ( NULL == pMac ) |
| 3115 | { |
| 3116 | VOS_ASSERT(0); |
| 3117 | return status; |
| 3118 | } |
| 3119 | |
| 3120 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3121 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3122 | { |
| 3123 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3124 | { |
| 3125 | status = csrRoamIssueTkipCounterMeasures( pMac, sessionId, bEnable); |
| 3126 | } |
| 3127 | else |
| 3128 | { |
| 3129 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3130 | } |
| 3131 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3132 | } |
| 3133 | |
| 3134 | return (status); |
| 3135 | } |
| 3136 | |
| 3137 | /* --------------------------------------------------------------------------- |
| 3138 | \fn sme_RoamGetAssociatedStas |
| 3139 | \brief To probe the list of associated stations from various modules of CORE stack. |
| 3140 | \This is an asynchronous API. |
| 3141 | \param sessionId - sessionId of SoftAP |
| 3142 | \param modId - Module from whom list of associtated stations is to be probed. |
| 3143 | If an invalid module is passed then by default VOS_MODULE_ID_PE will be probed |
| 3144 | \param pUsrContext - Opaque HDD context |
| 3145 | \param pfnSapEventCallback - Sap event callback in HDD |
| 3146 | \param pAssocBuf - Caller allocated memory to be filled with associatd stations info |
| 3147 | \return eHalStatus |
| 3148 | -------------------------------------------------------------------------------*/ |
| 3149 | eHalStatus sme_RoamGetAssociatedStas(tHalHandle hHal, tANI_U8 sessionId, |
| 3150 | VOS_MODULE_ID modId, void *pUsrContext, |
| 3151 | void *pfnSapEventCallback, tANI_U8 *pAssocStasBuf) |
| 3152 | { |
| 3153 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3154 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3155 | |
| 3156 | if ( NULL == pMac ) |
| 3157 | { |
| 3158 | VOS_ASSERT(0); |
| 3159 | return status; |
| 3160 | } |
| 3161 | |
| 3162 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3163 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3164 | { |
| 3165 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3166 | { |
| 3167 | status = csrRoamGetAssociatedStas( pMac, sessionId, modId, pUsrContext, pfnSapEventCallback, pAssocStasBuf ); |
| 3168 | } |
| 3169 | else |
| 3170 | { |
| 3171 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3172 | } |
| 3173 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3174 | } |
| 3175 | |
| 3176 | return (status); |
| 3177 | } |
| 3178 | |
| 3179 | /* --------------------------------------------------------------------------- |
| 3180 | \fn sme_RoamGetWpsSessionOverlap |
| 3181 | \brief To get the WPS PBC session overlap information. |
| 3182 | \This is an asynchronous API. |
| 3183 | \param sessionId - sessionId of SoftAP |
| 3184 | \param pUsrContext - Opaque HDD context |
| 3185 | \param pfnSapEventCallback - Sap event callback in HDD |
| 3186 | \pRemoveMac - pointer to Mac address which needs to be removed from session |
| 3187 | \return eHalStatus |
| 3188 | -------------------------------------------------------------------------------*/ |
| 3189 | eHalStatus sme_RoamGetWpsSessionOverlap(tHalHandle hHal, tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3190 | void *pUsrContext, void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3191 | *pfnSapEventCallback, v_MACADDR_t pRemoveMac) |
| 3192 | { |
| 3193 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3194 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3195 | |
| 3196 | if ( NULL == pMac ) |
| 3197 | { |
| 3198 | VOS_ASSERT(0); |
| 3199 | return status; |
| 3200 | } |
| 3201 | |
| 3202 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3203 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3204 | { |
| 3205 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3206 | { |
| 3207 | status = csrRoamGetWpsSessionOverlap( pMac, sessionId, pUsrContext, pfnSapEventCallback, pRemoveMac); |
| 3208 | } |
| 3209 | else |
| 3210 | { |
| 3211 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3212 | } |
| 3213 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3214 | } |
| 3215 | |
| 3216 | return (status); |
| 3217 | } |
| 3218 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3219 | |
| 3220 | /* --------------------------------------------------------------------------- |
| 3221 | \fn sme_RoamGetConnectState |
| 3222 | \brief a wrapper function to request CSR to return the current connect state |
| 3223 | of Roaming |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3224 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3225 | \return eHalStatus |
| 3226 | ---------------------------------------------------------------------------*/ |
| 3227 | eHalStatus sme_RoamGetConnectState(tHalHandle hHal, tANI_U8 sessionId, eCsrConnectState *pState) |
| 3228 | { |
| 3229 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3230 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3231 | |
| 3232 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3233 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3234 | { |
| 3235 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3236 | { |
| 3237 | status = csrRoamGetConnectState( pMac, sessionId, pState ); |
| 3238 | } |
| 3239 | else |
| 3240 | { |
| 3241 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3242 | } |
| 3243 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3244 | } |
| 3245 | |
| 3246 | return (status); |
| 3247 | } |
| 3248 | |
| 3249 | /* --------------------------------------------------------------------------- |
| 3250 | \fn sme_RoamGetConnectProfile |
| 3251 | \brief a wrapper function to request CSR to return the current connect |
| 3252 | profile. Caller must call csrRoamFreeConnectProfile after it is done |
| 3253 | and before reuse for another csrRoamGetConnectProfile call. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3254 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3255 | \param pProfile - pointer to a caller allocated structure |
| 3256 | tCsrRoamConnectedProfile |
| 3257 | \return eHalStatus. Failure if not connected |
| 3258 | ---------------------------------------------------------------------------*/ |
| 3259 | eHalStatus sme_RoamGetConnectProfile(tHalHandle hHal, tANI_U8 sessionId, |
| 3260 | tCsrRoamConnectedProfile *pProfile) |
| 3261 | { |
| 3262 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3263 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3264 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3265 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3266 | TRACE_CODE_SME_RX_HDD_ROAM_GET_CONNECTPROFILE, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3267 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3268 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3269 | { |
| 3270 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3271 | { |
| 3272 | status = csrRoamGetConnectProfile( pMac, sessionId, pProfile ); |
| 3273 | } |
| 3274 | else |
| 3275 | { |
| 3276 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3277 | } |
| 3278 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3279 | } |
| 3280 | |
| 3281 | return (status); |
| 3282 | } |
| 3283 | |
| 3284 | /* --------------------------------------------------------------------------- |
| 3285 | \fn sme_RoamFreeConnectProfile |
| 3286 | \brief a wrapper function to request CSR to free and reinitialize the |
| 3287 | profile returned previously by csrRoamGetConnectProfile. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3288 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3289 | \param pProfile - pointer to a caller allocated structure |
| 3290 | tCsrRoamConnectedProfile |
| 3291 | \return eHalStatus. |
| 3292 | ---------------------------------------------------------------------------*/ |
| 3293 | eHalStatus sme_RoamFreeConnectProfile(tHalHandle hHal, |
| 3294 | tCsrRoamConnectedProfile *pProfile) |
| 3295 | { |
| 3296 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3297 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3298 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3299 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3300 | TRACE_CODE_SME_RX_HDD_ROAM_FREE_CONNECTPROFILE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3301 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3302 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3303 | { |
| 3304 | status = csrRoamFreeConnectProfile( pMac, pProfile ); |
| 3305 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3306 | } |
| 3307 | |
| 3308 | return (status); |
| 3309 | } |
| 3310 | |
| 3311 | /* --------------------------------------------------------------------------- |
| 3312 | \fn sme_RoamSetPMKIDCache |
| 3313 | \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] | 3314 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3315 | \param pPMKIDCache - caller allocated buffer point to an array of |
| 3316 | tPmkidCacheInfo |
| 3317 | \param numItems - a variable that has the number of tPmkidCacheInfo |
| 3318 | allocated when retruning, this is either the number needed |
| 3319 | or number of items put into pPMKIDCache |
| 3320 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3321 | big enough and pNumItems has the number of |
| 3322 | tPmkidCacheInfo. |
| 3323 | \Note: pNumItems is a number of tPmkidCacheInfo, |
| 3324 | not sizeof(tPmkidCacheInfo) * something |
| 3325 | ---------------------------------------------------------------------------*/ |
| 3326 | eHalStatus sme_RoamSetPMKIDCache( tHalHandle hHal, tANI_U8 sessionId, tPmkidCacheInfo *pPMKIDCache, |
| 3327 | tANI_U32 numItems ) |
| 3328 | { |
| 3329 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3330 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3331 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3332 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3333 | TRACE_CODE_SME_RX_HDD_ROAM_SET_PMKIDCACHE, sessionId, numItems)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3334 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3335 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3336 | { |
| 3337 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3338 | { |
| 3339 | status = csrRoamSetPMKIDCache( pMac, sessionId, pPMKIDCache, numItems ); |
| 3340 | } |
| 3341 | else |
| 3342 | { |
| 3343 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3344 | } |
| 3345 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3346 | } |
| 3347 | |
| 3348 | return (status); |
| 3349 | } |
| 3350 | |
Leela Venkata Kiran Kumar Reddy Chirala | ede1065 | 2013-09-11 18:48:46 -0700 | [diff] [blame] | 3351 | eHalStatus sme_RoamDelPMKIDfromCache( tHalHandle hHal, tANI_U8 sessionId, tANI_U8 *pBSSId ) |
| 3352 | { |
| 3353 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3354 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3355 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3356 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3357 | { |
| 3358 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3359 | { |
| 3360 | status = csrRoamDelPMKIDfromCache( pMac, sessionId, pBSSId ); |
| 3361 | } |
| 3362 | else |
| 3363 | { |
| 3364 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3365 | } |
| 3366 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3367 | } |
| 3368 | return (status); |
| 3369 | } |
Wilson Yang | 47b5819 | 2013-12-11 11:40:19 -0800 | [diff] [blame] | 3370 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3371 | /* --------------------------------------------------------------------------- |
| 3372 | \fn sme_RoamGetSecurityReqIE |
| 3373 | \brief a wrapper function to request CSR to return the WPA or RSN or WAPI IE CSR |
| 3374 | passes to PE to JOIN request or START_BSS request |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3375 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3376 | \param pLen - caller allocated memory that has the length of pBuf as input. |
| 3377 | Upon returned, *pLen has the needed or IE length in pBuf. |
| 3378 | \param pBuf - Caller allocated memory that contain the IE field, if any, |
| 3379 | upon return |
| 3380 | \param secType - Specifies whether looking for WPA/WPA2/WAPI IE |
| 3381 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3382 | big enough |
| 3383 | ---------------------------------------------------------------------------*/ |
| 3384 | eHalStatus sme_RoamGetSecurityReqIE(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pLen, |
| 3385 | tANI_U8 *pBuf, eCsrSecurityType secType) |
| 3386 | { |
| 3387 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3388 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3389 | |
| 3390 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3391 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3392 | { |
| 3393 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3394 | { |
| 3395 | status = csrRoamGetWpaRsnReqIE( hHal, sessionId, pLen, pBuf ); |
| 3396 | } |
| 3397 | else |
| 3398 | { |
| 3399 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3400 | } |
| 3401 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3402 | } |
| 3403 | |
| 3404 | return (status); |
| 3405 | } |
| 3406 | |
| 3407 | /* --------------------------------------------------------------------------- |
| 3408 | \fn sme_RoamGetSecurityRspIE |
| 3409 | \brief a wrapper function to request CSR to return the WPA or RSN or WAPI IE from |
| 3410 | the beacon or probe rsp if connected |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3411 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3412 | \param pLen - caller allocated memory that has the length of pBuf as input. |
| 3413 | Upon returned, *pLen has the needed or IE length in pBuf. |
| 3414 | \param pBuf - Caller allocated memory that contain the IE field, if any, |
| 3415 | upon return |
| 3416 | \param secType - Specifies whether looking for WPA/WPA2/WAPI IE |
| 3417 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3418 | big enough |
| 3419 | ---------------------------------------------------------------------------*/ |
| 3420 | eHalStatus sme_RoamGetSecurityRspIE(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pLen, |
| 3421 | tANI_U8 *pBuf, eCsrSecurityType secType) |
| 3422 | { |
| 3423 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3424 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3425 | |
| 3426 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3427 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3428 | { |
| 3429 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3430 | { |
| 3431 | status = csrRoamGetWpaRsnRspIE( pMac, sessionId, pLen, pBuf ); |
| 3432 | } |
| 3433 | else |
| 3434 | { |
| 3435 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3436 | } |
| 3437 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3438 | } |
| 3439 | |
| 3440 | return (status); |
| 3441 | |
| 3442 | } |
| 3443 | |
| 3444 | |
| 3445 | /* --------------------------------------------------------------------------- |
| 3446 | \fn sme_RoamGetNumPMKIDCache |
| 3447 | \brief a wrapper function to request CSR to return number of PMKID cache |
| 3448 | entries |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3449 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3450 | \return tANI_U32 - the number of PMKID cache entries |
| 3451 | ---------------------------------------------------------------------------*/ |
| 3452 | tANI_U32 sme_RoamGetNumPMKIDCache(tHalHandle hHal, tANI_U8 sessionId) |
| 3453 | { |
| 3454 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3455 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3456 | tANI_U32 numPmkidCache = 0; |
| 3457 | |
| 3458 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3459 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3460 | { |
| 3461 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3462 | { |
| 3463 | numPmkidCache = csrRoamGetNumPMKIDCache( pMac, sessionId ); |
| 3464 | status = eHAL_STATUS_SUCCESS; |
| 3465 | } |
| 3466 | else |
| 3467 | { |
| 3468 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3469 | } |
| 3470 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3471 | } |
| 3472 | |
| 3473 | return (numPmkidCache); |
| 3474 | } |
| 3475 | |
| 3476 | /* --------------------------------------------------------------------------- |
| 3477 | \fn sme_RoamGetPMKIDCache |
| 3478 | \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] | 3479 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3480 | \param pNum - caller allocated memory that has the space of the number of |
| 3481 | pBuf tPmkidCacheInfo as input. Upon returned, *pNum has the |
| 3482 | needed or actually number in tPmkidCacheInfo. |
| 3483 | \param pPmkidCache - Caller allocated memory that contains PMKID cache, if |
| 3484 | any, upon return |
| 3485 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3486 | big enough |
| 3487 | ---------------------------------------------------------------------------*/ |
| 3488 | eHalStatus sme_RoamGetPMKIDCache(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pNum, |
| 3489 | tPmkidCacheInfo *pPmkidCache) |
| 3490 | { |
| 3491 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3492 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3493 | |
| 3494 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3495 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3496 | { |
| 3497 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3498 | { |
| 3499 | status = csrRoamGetPMKIDCache( pMac, sessionId, pNum, pPmkidCache ); |
| 3500 | } |
| 3501 | else |
| 3502 | { |
| 3503 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3504 | } |
| 3505 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3506 | } |
| 3507 | |
| 3508 | return (status); |
| 3509 | } |
| 3510 | |
| 3511 | |
| 3512 | /* --------------------------------------------------------------------------- |
| 3513 | \fn sme_GetConfigParam |
| 3514 | \brief a wrapper function that HDD calls to get the global settings |
| 3515 | currently maintained by CSR. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3516 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3517 | \param pParam - caller allocated memory |
| 3518 | \return eHalStatus |
| 3519 | ---------------------------------------------------------------------------*/ |
| 3520 | eHalStatus sme_GetConfigParam(tHalHandle hHal, tSmeConfigParams *pParam) |
| 3521 | { |
| 3522 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3523 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3524 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3525 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3526 | TRACE_CODE_SME_RX_HDD_GET_CONFIGPARAM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3527 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3528 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3529 | { |
| 3530 | status = csrGetConfigParam(pMac, &pParam->csrConfig); |
| 3531 | if (status != eHAL_STATUS_SUCCESS) |
| 3532 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3533 | smsLog( pMac, LOGE, "%s csrGetConfigParam failed", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3534 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3535 | return status; |
| 3536 | } |
| 3537 | #if defined WLAN_FEATURE_P2P_INTERNAL |
| 3538 | status = p2pGetConfigParam(pMac, &pParam->p2pConfig); |
| 3539 | if (status != eHAL_STATUS_SUCCESS) |
| 3540 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3541 | smsLog( pMac, LOGE, "%s p2pGetConfigParam failed", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3542 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3543 | return status; |
| 3544 | } |
| 3545 | #endif |
| 3546 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3547 | } |
| 3548 | |
| 3549 | return (status); |
| 3550 | } |
| 3551 | |
| 3552 | /* --------------------------------------------------------------------------- |
| 3553 | \fn sme_CfgSetInt |
| 3554 | \brief a wrapper function that HDD calls to set parameters in CFG. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3555 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3556 | \param cfgId - Configuration Parameter ID (type) for STA. |
| 3557 | \param ccmValue - The information related to Configuration Parameter ID |
| 3558 | which needs to be saved in CFG |
| 3559 | \param callback - To be registered by CSR with CCM. Once the CFG done with |
| 3560 | saving the information in the database, it notifies CCM & |
| 3561 | then the callback will be invoked to notify. |
| 3562 | \param toBeSaved - To save the request for future reference |
| 3563 | \return eHalStatus |
| 3564 | ---------------------------------------------------------------------------*/ |
| 3565 | eHalStatus sme_CfgSetInt(tHalHandle hHal, tANI_U32 cfgId, tANI_U32 ccmValue, |
| 3566 | tCcmCfgSetCallback callback, eAniBoolean toBeSaved) |
| 3567 | { |
| 3568 | return(ccmCfgSetInt(hHal, cfgId, ccmValue, callback, toBeSaved)); |
| 3569 | } |
| 3570 | |
| 3571 | /* --------------------------------------------------------------------------- |
| 3572 | \fn sme_CfgSetStr |
| 3573 | \brief a wrapper function that HDD calls to set parameters in CFG. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3574 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3575 | \param cfgId - Configuration Parameter ID (type) for STA. |
| 3576 | \param pStr - Pointer to the byte array which carries the information needs |
| 3577 | to be saved in CFG |
| 3578 | \param length - Length of the data to be saved |
| 3579 | \param callback - To be registered by CSR with CCM. Once the CFG done with |
| 3580 | saving the information in the database, it notifies CCM & |
| 3581 | then the callback will be invoked to notify. |
| 3582 | \param toBeSaved - To save the request for future reference |
| 3583 | \return eHalStatus |
| 3584 | ---------------------------------------------------------------------------*/ |
| 3585 | eHalStatus sme_CfgSetStr(tHalHandle hHal, tANI_U32 cfgId, tANI_U8 *pStr, |
| 3586 | tANI_U32 length, tCcmCfgSetCallback callback, |
| 3587 | eAniBoolean toBeSaved) |
| 3588 | { |
| 3589 | return(ccmCfgSetStr(hHal, cfgId, pStr, length, callback, toBeSaved)); |
| 3590 | } |
| 3591 | |
| 3592 | /* --------------------------------------------------------------------------- |
| 3593 | \fn sme_GetModifyProfileFields |
| 3594 | \brief HDD or SME - QOS calls this function to get the current values of |
| 3595 | connected profile fields, changing which can cause reassoc. |
| 3596 | This function must be called after CFG is downloaded and STA is in connected |
| 3597 | state. Also, make sure to call this function to get the current profile |
| 3598 | fields before calling the reassoc. So that pModifyProfileFields will have |
| 3599 | all the latest values plus the one(s) has been updated as part of reassoc |
| 3600 | request. |
| 3601 | \param pModifyProfileFields - pointer to the connected profile fields |
| 3602 | changing which can cause reassoc |
| 3603 | |
| 3604 | \return eHalStatus |
| 3605 | -------------------------------------------------------------------------------*/ |
| 3606 | eHalStatus sme_GetModifyProfileFields(tHalHandle hHal, tANI_U8 sessionId, |
| 3607 | tCsrRoamModifyProfileFields * pModifyProfileFields) |
| 3608 | { |
| 3609 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3610 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3611 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3612 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3613 | TRACE_CODE_SME_RX_HDD_GET_MODPROFFIELDS, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3614 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3615 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3616 | { |
| 3617 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3618 | { |
| 3619 | status = csrGetModifyProfileFields(pMac, sessionId, pModifyProfileFields); |
| 3620 | } |
| 3621 | else |
| 3622 | { |
| 3623 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3624 | } |
| 3625 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3626 | } |
| 3627 | |
| 3628 | return (status); |
| 3629 | } |
| 3630 | |
Sandeep Puligilla | 332ea91 | 2014-02-04 00:16:24 +0530 | [diff] [blame] | 3631 | /* --------------------------------------------------------------------------- |
| 3632 | \fn sme_HT40StopOBSSScan |
| 3633 | \brief HDD or SME - Command to stop the OBSS scan |
| 3634 | THis is implemented only for debugging purpose. |
| 3635 | As per spec while operating in 2.4GHz OBSS scan shouldnt be stopped. |
| 3636 | \param sessionId - sessionId |
| 3637 | changing which can cause reassoc |
| 3638 | |
| 3639 | \return eHalStatus |
| 3640 | -------------------------------------------------------------------------------*/ |
| 3641 | eHalStatus sme_HT40StopOBSSScan(tHalHandle hHal, tANI_U8 sessionId) |
| 3642 | { |
| 3643 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3644 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3645 | |
| 3646 | smsLog(pMac, LOG2, FL("enter")); |
| 3647 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3648 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3649 | { |
| 3650 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3651 | { |
| 3652 | csrHT40StopOBSSScan( pMac, sessionId ); |
| 3653 | } |
| 3654 | else |
| 3655 | { |
| 3656 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 3657 | "%s: Invalid session sessionId %d", __func__,sessionId); |
| 3658 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3659 | } |
| 3660 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3661 | } |
| 3662 | return (status); |
| 3663 | } |
| 3664 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3665 | /*-------------------------------------------------------------------------- |
| 3666 | \fn sme_SetConfigPowerSave |
| 3667 | \brief Wrapper fn to change power save configuration in SME (PMC) module. |
| 3668 | For BMPS related configuration, this function also updates the CFG |
| 3669 | and sends a message to FW to pick up the new values. Note: Calling |
| 3670 | this function only updates the configuration and does not enable |
| 3671 | the specified power save mode. |
| 3672 | \param hHal - The handle returned by macOpen. |
| 3673 | \param psMode - Power Saving mode being modified |
| 3674 | \param pConfigParams - a pointer to a caller allocated object of type |
| 3675 | tPmcSmpsConfigParams or tPmcBmpsConfigParams or tPmcImpsConfigParams |
| 3676 | \return eHalStatus |
| 3677 | --------------------------------------------------------------------------*/ |
| 3678 | eHalStatus sme_SetConfigPowerSave(tHalHandle hHal, tPmcPowerSavingMode psMode, |
| 3679 | void *pConfigParams) |
| 3680 | { |
| 3681 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3682 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3683 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3684 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3685 | TRACE_CODE_SME_RX_HDD_SET_CONFIG_PWRSAVE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3686 | if (NULL == pConfigParams ) { |
| 3687 | smsLog( pMac, LOGE, "Empty config param structure for PMC, " |
| 3688 | "nothing to update"); |
| 3689 | return eHAL_STATUS_FAILURE; |
| 3690 | } |
| 3691 | |
| 3692 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3693 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3694 | { |
| 3695 | status = pmcSetConfigPowerSave(hHal, psMode, pConfigParams); |
| 3696 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3697 | } |
| 3698 | |
| 3699 | return (status); |
| 3700 | } |
| 3701 | |
| 3702 | /*-------------------------------------------------------------------------- |
| 3703 | \fn sme_GetConfigPowerSave |
| 3704 | \brief Wrapper fn to retrieve power save configuration in SME (PMC) module |
| 3705 | \param hHal - The handle returned by macOpen. |
| 3706 | \param psMode - Power Saving mode |
| 3707 | \param pConfigParams - a pointer to a caller allocated object of type |
| 3708 | tPmcSmpsConfigParams or tPmcBmpsConfigParams or tPmcImpsConfigParams |
| 3709 | \return eHalStatus |
| 3710 | --------------------------------------------------------------------------*/ |
| 3711 | eHalStatus sme_GetConfigPowerSave(tHalHandle hHal, tPmcPowerSavingMode psMode, |
| 3712 | void *pConfigParams) |
| 3713 | { |
| 3714 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3715 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3716 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3717 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3718 | TRACE_CODE_SME_RX_HDD_GET_CONFIG_PWRSAVE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3719 | if (NULL == pConfigParams ) { |
| 3720 | smsLog( pMac, LOGE, "Empty config param structure for PMC, " |
| 3721 | "nothing to update"); |
| 3722 | return eHAL_STATUS_FAILURE; |
| 3723 | } |
| 3724 | |
| 3725 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3726 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3727 | { |
| 3728 | status = pmcGetConfigPowerSave(hHal, psMode, pConfigParams); |
| 3729 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3730 | } |
| 3731 | |
| 3732 | return (status); |
| 3733 | } |
| 3734 | |
| 3735 | /* --------------------------------------------------------------------------- |
| 3736 | \fn sme_SignalPowerEvent |
| 3737 | \brief Signals to PMC that a power event has occurred. Used for putting |
| 3738 | the chip into deep sleep mode. |
| 3739 | \param hHal - The handle returned by macOpen. |
| 3740 | \param event - the event that has occurred |
| 3741 | \return eHalStatus |
| 3742 | ---------------------------------------------------------------------------*/ |
| 3743 | eHalStatus sme_SignalPowerEvent (tHalHandle hHal, tPmcPowerEvent event) |
| 3744 | { |
| 3745 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3746 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3747 | |
| 3748 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3749 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3750 | { |
| 3751 | status = pmcSignalPowerEvent(hHal, event); |
| 3752 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3753 | } |
| 3754 | |
| 3755 | return (status); |
| 3756 | } |
| 3757 | |
| 3758 | /* --------------------------------------------------------------------------- |
| 3759 | \fn sme_EnablePowerSave |
| 3760 | \brief Enables one of the power saving modes. |
| 3761 | \param hHal - The handle returned by macOpen. |
| 3762 | \param psMode - The power saving mode to enable. If BMPS mode is enabled |
| 3763 | while the chip is operating in Full Power, PMC will start |
| 3764 | a timer that will try to put the chip in BMPS mode after |
| 3765 | expiry. |
| 3766 | \return eHalStatus |
| 3767 | ---------------------------------------------------------------------------*/ |
| 3768 | eHalStatus sme_EnablePowerSave (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 3769 | { |
| 3770 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3771 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3772 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3773 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3774 | TRACE_CODE_SME_RX_HDD_ENABLE_PWRSAVE, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3775 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3776 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3777 | { |
| 3778 | status = pmcEnablePowerSave(hHal, psMode); |
| 3779 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3780 | } |
| 3781 | |
| 3782 | return (status); |
| 3783 | } |
| 3784 | |
| 3785 | /* --------------------------------------------------------------------------- |
| 3786 | \fn sme_DisablePowerSave |
| 3787 | \brief Disables one of the power saving modes. |
| 3788 | \param hHal - The handle returned by macOpen. |
| 3789 | \param psMode - The power saving mode to disable. Disabling does not imply |
| 3790 | that device will be brought out of the current PS mode. This |
| 3791 | is purely a configuration API. |
| 3792 | \return eHalStatus |
| 3793 | ---------------------------------------------------------------------------*/ |
| 3794 | eHalStatus sme_DisablePowerSave (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 3795 | { |
| 3796 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3797 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3798 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3799 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3800 | TRACE_CODE_SME_RX_HDD_DISABLE_PWRSAVE, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3801 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3802 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3803 | { |
| 3804 | status = pmcDisablePowerSave(hHal, psMode); |
| 3805 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3806 | } |
| 3807 | |
| 3808 | return (status); |
| 3809 | } |
| 3810 | |
| 3811 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 69b3418 | 2013-01-16 08:51:40 +0530 | [diff] [blame] | 3812 | + \fn sme_SetHostPowerSave |
| 3813 | + \brief Enables BMPS logic to be controlled by User level apps |
| 3814 | + \param hHal - The handle returned by macOpen. |
| 3815 | + \param psMode - The power saving mode to disable. Disabling does not imply |
| 3816 | + that device will be brought out of the current PS mode. This |
| 3817 | + is purely a configuration API. |
| 3818 | + \return eHalStatus |
| 3819 | + ---------------------------------------------------------------------------*/ |
| 3820 | eHalStatus sme_SetHostPowerSave (tHalHandle hHal, v_BOOL_t psMode) |
| 3821 | { |
| 3822 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3823 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3824 | |
| 3825 | pMac->pmc.isHostPsEn = psMode; |
| 3826 | |
| 3827 | return (status); |
| 3828 | } |
| 3829 | |
| 3830 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3831 | \fn sme_StartAutoBmpsTimer |
| 3832 | \brief Starts a timer that periodically polls all the registered |
| 3833 | module for entry into Bmps mode. This timer is started only if BMPS is |
| 3834 | enabled and whenever the device is in full power. |
| 3835 | \param hHal - The handle returned by macOpen. |
| 3836 | \return eHalStatus |
| 3837 | ---------------------------------------------------------------------------*/ |
| 3838 | eHalStatus sme_StartAutoBmpsTimer ( tHalHandle hHal) |
| 3839 | { |
| 3840 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3841 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3842 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3843 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3844 | TRACE_CODE_SME_RX_HDD_START_AUTO_BMPSTIMER, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3845 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3846 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3847 | { |
| 3848 | status = pmcStartAutoBmpsTimer(hHal); |
| 3849 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3850 | } |
| 3851 | |
| 3852 | return (status); |
| 3853 | } |
| 3854 | /* --------------------------------------------------------------------------- |
| 3855 | \fn sme_StopAutoBmpsTimer |
| 3856 | \brief Stops the Auto BMPS Timer that was started using sme_startAutoBmpsTimer |
| 3857 | Stopping the timer does not cause a device state change. Only the timer |
| 3858 | is stopped. If "Full Power" is desired, use the sme_RequestFullPower API |
| 3859 | \param hHal - The handle returned by macOpen. |
| 3860 | \return eHalStatus |
| 3861 | ---------------------------------------------------------------------------*/ |
| 3862 | eHalStatus sme_StopAutoBmpsTimer ( tHalHandle hHal) |
| 3863 | { |
| 3864 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3865 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3866 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3867 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3868 | TRACE_CODE_SME_RX_HDD_STOP_AUTO_BMPSTIMER, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3869 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3870 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3871 | { |
| 3872 | status = pmcStopAutoBmpsTimer(hHal); |
| 3873 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3874 | } |
| 3875 | |
| 3876 | return (status); |
| 3877 | } |
| 3878 | /* --------------------------------------------------------------------------- |
| 3879 | \fn sme_QueryPowerState |
| 3880 | \brief Returns the current power state of the device. |
| 3881 | \param hHal - The handle returned by macOpen. |
| 3882 | \param pPowerState - pointer to location to return power state (LOW or HIGH) |
| 3883 | \param pSwWlanSwitchState - ptr to location to return SW WLAN Switch state |
| 3884 | \return eHalStatus |
| 3885 | ---------------------------------------------------------------------------*/ |
| 3886 | eHalStatus sme_QueryPowerState ( |
| 3887 | tHalHandle hHal, |
| 3888 | tPmcPowerState *pPowerState, |
| 3889 | tPmcSwitchState *pSwWlanSwitchState) |
| 3890 | { |
| 3891 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3892 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3893 | |
| 3894 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3895 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3896 | { |
| 3897 | status = pmcQueryPowerState (hHal, pPowerState, NULL, pSwWlanSwitchState); |
| 3898 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3899 | } |
| 3900 | |
| 3901 | return (status); |
| 3902 | } |
| 3903 | |
| 3904 | /* --------------------------------------------------------------------------- |
| 3905 | \fn sme_IsPowerSaveEnabled |
| 3906 | \brief Checks if the device is able to enter a particular power save mode |
| 3907 | This does not imply that the device is in a particular PS mode |
| 3908 | \param hHal - The handle returned by macOpen. |
| 3909 | \param psMode - the power saving mode |
| 3910 | \return eHalStatus |
| 3911 | ---------------------------------------------------------------------------*/ |
| 3912 | tANI_BOOLEAN sme_IsPowerSaveEnabled (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 3913 | { |
| 3914 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3915 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3916 | tANI_BOOLEAN result = false; |
| 3917 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3918 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3919 | TRACE_CODE_SME_RX_HDD_IS_PWRSAVE_ENABLED, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3920 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3921 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3922 | { |
| 3923 | result = pmcIsPowerSaveEnabled(hHal, psMode); |
| 3924 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3925 | return result; |
| 3926 | } |
| 3927 | |
| 3928 | return false; |
| 3929 | } |
| 3930 | |
| 3931 | /* --------------------------------------------------------------------------- |
| 3932 | \fn sme_RequestFullPower |
| 3933 | \brief Request that the device be brought to full power state. When the |
| 3934 | device enters Full Power PMC will start a BMPS timer if BMPS PS mode |
| 3935 | is enabled. On timer expiry PMC will attempt to put the device in |
| 3936 | BMPS mode if following holds true: |
| 3937 | - BMPS mode is enabled |
| 3938 | - Polling of all modules through the Power Save Check routine passes |
| 3939 | - STA is associated to an access point |
| 3940 | \param hHal - The handle returned by macOpen. |
| 3941 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 3942 | \return eHalStatus - status |
| 3943 | eHAL_STATUS_SUCCESS - device brought to full power state |
| 3944 | eHAL_STATUS_FAILURE - device cannot be brought to full power state |
| 3945 | eHAL_STATUS_PMC_PENDING - device is being brought to full power state, |
| 3946 | ---------------------------------------------------------------------------*/ |
| 3947 | eHalStatus sme_RequestFullPower ( |
| 3948 | tHalHandle hHal, |
| 3949 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 3950 | void *callbackContext, |
| 3951 | tRequestFullPowerReason fullPowerReason) |
| 3952 | { |
| 3953 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3954 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 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_REQUEST_FULLPOWER, NO_SESSION, fullPowerReason)); |
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 | status = pmcRequestFullPower(hHal, callbackRoutine, callbackContext, fullPowerReason); |
| 3962 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3963 | } |
| 3964 | |
| 3965 | return (status); |
| 3966 | } |
| 3967 | |
| 3968 | /* --------------------------------------------------------------------------- |
| 3969 | \fn sme_RequestBmps |
| 3970 | \brief Request that the device be put in BMPS state. Request will be |
| 3971 | accepted only if BMPS mode is enabled and power save check routine |
| 3972 | passes. |
| 3973 | \param hHal - The handle returned by macOpen. |
| 3974 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 3975 | \return eHalStatus |
| 3976 | eHAL_STATUS_SUCCESS - device is in BMPS state |
| 3977 | eHAL_STATUS_FAILURE - device cannot be brought to BMPS state |
| 3978 | eHAL_STATUS_PMC_PENDING - device is being brought to BMPS state |
| 3979 | ---------------------------------------------------------------------------*/ |
| 3980 | eHalStatus sme_RequestBmps ( |
| 3981 | tHalHandle hHal, |
| 3982 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 3983 | void *callbackContext) |
| 3984 | { |
| 3985 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3986 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3987 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3988 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3989 | TRACE_CODE_SME_RX_HDD_REQUEST_BMPS, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3990 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3991 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3992 | { |
| 3993 | status = pmcRequestBmps(hHal, callbackRoutine, callbackContext); |
| 3994 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3995 | } |
| 3996 | |
| 3997 | return (status); |
| 3998 | } |
| 3999 | |
| 4000 | |
| 4001 | /* --------------------------------------------------------------------------- |
| 4002 | \fn sme_SetDHCPTillPowerActiveFlag |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4003 | \brief Sets/Clears DHCP related flag in PMC to disable/enable auto BMPS |
| 4004 | entry by PMC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4005 | \param hHal - The handle returned by macOpen. |
| 4006 | ---------------------------------------------------------------------------*/ |
| 4007 | void sme_SetDHCPTillPowerActiveFlag(tHalHandle hHal, tANI_U8 flag) |
| 4008 | { |
| 4009 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4010 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4011 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4012 | TRACE_CODE_SME_RX_HDD_SET_DHCP_FLAG, NO_SESSION, flag)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4013 | // Set/Clear the DHCP flag which will disable/enable auto BMPS entery by PMC |
| 4014 | pMac->pmc.remainInPowerActiveTillDHCP = flag; |
| 4015 | } |
| 4016 | |
| 4017 | |
| 4018 | /* --------------------------------------------------------------------------- |
| 4019 | \fn sme_StartUapsd |
| 4020 | \brief Request that the device be put in UAPSD state. If the device is in |
| 4021 | Full Power it will be put in BMPS mode first and then into UAPSD |
| 4022 | mode. |
| 4023 | \param hHal - The handle returned by macOpen. |
| 4024 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4025 | eHAL_STATUS_SUCCESS - device is in UAPSD state |
| 4026 | eHAL_STATUS_FAILURE - device cannot be brought to UAPSD state |
| 4027 | eHAL_STATUS_PMC_PENDING - device is being brought to UAPSD state |
| 4028 | eHAL_STATUS_PMC_DISABLED - UAPSD is disabled or BMPS mode is disabled |
| 4029 | \return eHalStatus |
| 4030 | ---------------------------------------------------------------------------*/ |
| 4031 | eHalStatus sme_StartUapsd ( |
| 4032 | tHalHandle hHal, |
| 4033 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4034 | void *callbackContext) |
| 4035 | { |
| 4036 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4037 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4038 | |
| 4039 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4040 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4041 | { |
| 4042 | status = pmcStartUapsd(hHal, callbackRoutine, callbackContext); |
| 4043 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4044 | } |
| 4045 | |
| 4046 | return (status); |
| 4047 | } |
| 4048 | |
| 4049 | /* --------------------------------------------------------------------------- |
| 4050 | \fn sme_StopUapsd |
| 4051 | \brief Request that the device be put out of UAPSD state. Device will be |
| 4052 | put in in BMPS state after stop UAPSD completes. |
| 4053 | \param hHal - The handle returned by macOpen. |
| 4054 | \return eHalStatus |
| 4055 | eHAL_STATUS_SUCCESS - device is put out of UAPSD and back in BMPS state |
| 4056 | eHAL_STATUS_FAILURE - device cannot be brought out of UAPSD state |
| 4057 | ---------------------------------------------------------------------------*/ |
| 4058 | eHalStatus sme_StopUapsd (tHalHandle hHal) |
| 4059 | { |
| 4060 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4061 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4062 | |
| 4063 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4064 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4065 | { |
| 4066 | status = pmcStopUapsd(hHal); |
| 4067 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4068 | } |
| 4069 | |
| 4070 | return (status); |
| 4071 | } |
| 4072 | |
| 4073 | /* --------------------------------------------------------------------------- |
| 4074 | \fn sme_RequestStandby |
| 4075 | \brief Request that the device be put in standby. It is HDD's responsibility |
| 4076 | to bring the chip to full power and do a disassoc before calling |
| 4077 | this API. |
| 4078 | \param hHal - The handle returned by macOpen. |
| 4079 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4080 | \return eHalStatus |
| 4081 | eHAL_STATUS_SUCCESS - device is in Standby mode |
| 4082 | eHAL_STATUS_FAILURE - device cannot be put in standby mode |
| 4083 | eHAL_STATUS_PMC_PENDING - device is being put in standby mode |
| 4084 | ---------------------------------------------------------------------------*/ |
| 4085 | eHalStatus sme_RequestStandby ( |
| 4086 | tHalHandle hHal, |
| 4087 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4088 | void *callbackContext) |
| 4089 | { |
| 4090 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4091 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4092 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4093 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4094 | TRACE_CODE_SME_RX_HDD_REQUEST_STANDBY, NO_SESSION, 0)); |
Agarwal Ashish | e3cca2a | 2013-07-21 03:01:48 +0530 | [diff] [blame] | 4095 | smsLog( pMac, LOG1, FL(" called") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4096 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4097 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4098 | { |
| 4099 | status = pmcRequestStandby(hHal, callbackRoutine, callbackContext); |
| 4100 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4101 | } |
| 4102 | |
| 4103 | return (status); |
| 4104 | } |
| 4105 | |
| 4106 | /* --------------------------------------------------------------------------- |
| 4107 | \fn sme_RegisterPowerSaveCheck |
| 4108 | \brief Register a power save check routine that is called whenever |
| 4109 | the device is about to enter one of the power save modes. |
| 4110 | \param hHal - The handle returned by macOpen. |
| 4111 | \param checkRoutine - Power save check routine to be registered |
| 4112 | \return eHalStatus |
| 4113 | eHAL_STATUS_SUCCESS - successfully registered |
| 4114 | eHAL_STATUS_FAILURE - not successfully registered |
| 4115 | ---------------------------------------------------------------------------*/ |
| 4116 | eHalStatus sme_RegisterPowerSaveCheck ( |
| 4117 | tHalHandle hHal, |
| 4118 | tANI_BOOLEAN (*checkRoutine) (void *checkContext), void *checkContext) |
| 4119 | { |
| 4120 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4121 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4122 | |
| 4123 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4124 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4125 | { |
| 4126 | status = pmcRegisterPowerSaveCheck (hHal, checkRoutine, checkContext); |
| 4127 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4128 | } |
| 4129 | |
| 4130 | return (status); |
| 4131 | } |
| 4132 | |
| 4133 | /* --------------------------------------------------------------------------- |
Mihir Shete | fc7ff5b | 2014-01-27 11:30:05 +0530 | [diff] [blame] | 4134 | \fn sme_Register11dScanDoneCallback |
| 4135 | \brief Register a routine of type csrScanCompleteCallback which is |
| 4136 | called whenever an 11d scan is done |
| 4137 | \param hHal - The handle returned by macOpen. |
| 4138 | \param callback - 11d scan complete routine to be registered |
| 4139 | \return eHalStatus |
| 4140 | ---------------------------------------------------------------------------*/ |
| 4141 | eHalStatus sme_Register11dScanDoneCallback ( |
| 4142 | tHalHandle hHal, |
| 4143 | csrScanCompleteCallback callback) |
| 4144 | { |
| 4145 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 4146 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4147 | |
| 4148 | pMac->scan.callback11dScanDone = callback; |
| 4149 | |
| 4150 | return (status); |
| 4151 | } |
| 4152 | |
| 4153 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4154 | \fn sme_DeregisterPowerSaveCheck |
| 4155 | \brief Deregister a power save check routine |
| 4156 | \param hHal - The handle returned by macOpen. |
| 4157 | \param checkRoutine - Power save check routine to be deregistered |
| 4158 | \return eHalStatus |
| 4159 | eHAL_STATUS_SUCCESS - successfully deregistered |
| 4160 | eHAL_STATUS_FAILURE - not successfully deregistered |
| 4161 | ---------------------------------------------------------------------------*/ |
| 4162 | eHalStatus sme_DeregisterPowerSaveCheck ( |
| 4163 | tHalHandle hHal, |
| 4164 | tANI_BOOLEAN (*checkRoutine) (void *checkContext)) |
| 4165 | { |
| 4166 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4167 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4168 | |
| 4169 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4170 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4171 | { |
| 4172 | status = pmcDeregisterPowerSaveCheck (hHal, checkRoutine); |
| 4173 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4174 | } |
| 4175 | |
| 4176 | return (status); |
| 4177 | } |
| 4178 | |
| 4179 | /* --------------------------------------------------------------------------- |
| 4180 | \fn sme_RegisterDeviceStateUpdateInd |
| 4181 | \brief Register a callback routine that is called whenever |
| 4182 | the device enters a new device state (Full Power, BMPS, UAPSD) |
| 4183 | \param hHal - The handle returned by macOpen. |
| 4184 | \param callbackRoutine - Callback routine to be registered |
| 4185 | \param callbackContext - Cookie to be passed back during callback |
| 4186 | \return eHalStatus |
| 4187 | eHAL_STATUS_SUCCESS - successfully registered |
| 4188 | eHAL_STATUS_FAILURE - not successfully registered |
| 4189 | ---------------------------------------------------------------------------*/ |
| 4190 | eHalStatus sme_RegisterDeviceStateUpdateInd ( |
| 4191 | tHalHandle hHal, |
| 4192 | void (*callbackRoutine) (void *callbackContext, tPmcState pmcState), |
| 4193 | void *callbackContext) |
| 4194 | { |
| 4195 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4196 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4197 | |
| 4198 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4199 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4200 | { |
| 4201 | status = pmcRegisterDeviceStateUpdateInd (hHal, callbackRoutine, callbackContext); |
| 4202 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4203 | } |
| 4204 | |
| 4205 | return (status); |
| 4206 | } |
| 4207 | |
| 4208 | /* --------------------------------------------------------------------------- |
| 4209 | \fn sme_DeregisterDeviceStateUpdateInd |
| 4210 | \brief Deregister a routine that was registered for device state changes |
| 4211 | \param hHal - The handle returned by macOpen. |
| 4212 | \param callbackRoutine - Callback routine to be deregistered |
| 4213 | \return eHalStatus |
| 4214 | eHAL_STATUS_SUCCESS - successfully deregistered |
| 4215 | eHAL_STATUS_FAILURE - not successfully deregistered |
| 4216 | ---------------------------------------------------------------------------*/ |
| 4217 | eHalStatus sme_DeregisterDeviceStateUpdateInd ( |
| 4218 | tHalHandle hHal, |
| 4219 | void (*callbackRoutine) (void *callbackContext, tPmcState pmcState)) |
| 4220 | { |
| 4221 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4222 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4223 | |
| 4224 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4225 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4226 | { |
| 4227 | status = pmcDeregisterDeviceStateUpdateInd (hHal, callbackRoutine); |
| 4228 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4229 | } |
| 4230 | |
| 4231 | return (status); |
| 4232 | } |
| 4233 | |
| 4234 | /* --------------------------------------------------------------------------- |
| 4235 | \fn sme_WowlAddBcastPattern |
| 4236 | \brief Add a pattern for Pattern Byte Matching in Wowl mode. Firmware will |
| 4237 | do a pattern match on these patterns when Wowl is enabled during BMPS |
| 4238 | mode. Note that Firmware performs the pattern matching only on |
| 4239 | broadcast frames and while Libra is in BMPS mode. |
| 4240 | \param hHal - The handle returned by macOpen. |
| 4241 | \param pattern - Pattern to be added |
| 4242 | \return eHalStatus |
| 4243 | eHAL_STATUS_FAILURE Cannot add pattern |
| 4244 | eHAL_STATUS_SUCCESS Request accepted. |
| 4245 | ---------------------------------------------------------------------------*/ |
| 4246 | eHalStatus sme_WowlAddBcastPattern ( |
| 4247 | tHalHandle hHal, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4248 | tpSirWowlAddBcastPtrn pattern, |
| 4249 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4250 | { |
| 4251 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4252 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4253 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4254 | TRACE_CODE_SME_RX_HDD_WOWL_ADDBCAST_PATTERN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4255 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4256 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4257 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4258 | status = pmcWowlAddBcastPattern (hHal, pattern, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4259 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4260 | } |
| 4261 | |
| 4262 | return (status); |
| 4263 | } |
| 4264 | |
| 4265 | /* --------------------------------------------------------------------------- |
| 4266 | \fn sme_WowlDelBcastPattern |
| 4267 | \brief Delete a pattern that was added for Pattern Byte Matching. |
| 4268 | \param hHal - The handle returned by macOpen. |
| 4269 | \param pattern - Pattern to be deleted |
| 4270 | \return eHalStatus |
| 4271 | eHAL_STATUS_FAILURE Cannot delete pattern |
| 4272 | eHAL_STATUS_SUCCESS Request accepted. |
| 4273 | ---------------------------------------------------------------------------*/ |
| 4274 | eHalStatus sme_WowlDelBcastPattern ( |
| 4275 | tHalHandle hHal, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4276 | tpSirWowlDelBcastPtrn pattern, |
| 4277 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4278 | { |
| 4279 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4280 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4281 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4282 | TRACE_CODE_SME_RX_HDD_WOWL_DELBCAST_PATTERN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4283 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4284 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4285 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4286 | status = pmcWowlDelBcastPattern (hHal, pattern, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4287 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4288 | } |
| 4289 | |
| 4290 | return (status); |
| 4291 | } |
| 4292 | |
| 4293 | /* --------------------------------------------------------------------------- |
| 4294 | \fn sme_EnterWowl |
| 4295 | \brief This is the SME API exposed to HDD to request enabling of WOWL mode. |
| 4296 | WoWLAN works on top of BMPS mode. If the device is not in BMPS mode, |
| 4297 | SME will will cache the information that WOWL has been enabled and |
| 4298 | attempt to put the device in BMPS. On entry into BMPS, SME will |
| 4299 | enable the WOWL mode. |
| 4300 | Note 1: If we exit BMPS mode (someone requests full power), we |
| 4301 | will NOT resume WOWL when we go back to BMPS again. Request for full |
| 4302 | power (while in WOWL mode) means disable WOWL and go to full power. |
| 4303 | Note 2: Both UAPSD and WOWL work on top of BMPS. On entry into BMPS, SME |
| 4304 | will give priority to UAPSD and enable only UAPSD if both UAPSD and WOWL |
| 4305 | are required. Currently there is no requirement or use case to support |
| 4306 | UAPSD and WOWL at the same time. |
| 4307 | |
| 4308 | \param hHal - The handle returned by macOpen. |
| 4309 | \param enterWowlCallbackRoutine - Callback routine provided by HDD. |
| 4310 | Used for success/failure notification by SME |
| 4311 | \param enterWowlCallbackContext - A cookie passed by HDD, that is passed back to HDD |
| 4312 | at the time of callback. |
| 4313 | \param wakeReasonIndCB - Callback routine provided by HDD. |
| 4314 | Used for Wake Reason Indication by SME |
| 4315 | \param wakeReasonIndCBContext - A cookie passed by HDD, that is passed back to HDD |
| 4316 | at the time of callback. |
| 4317 | \return eHalStatus |
| 4318 | eHAL_STATUS_SUCCESS Device is already in WoWLAN mode |
| 4319 | eHAL_STATUS_FAILURE Device cannot enter WoWLAN mode. |
| 4320 | eHAL_STATUS_PMC_PENDING Request accepted. SME will enable WOWL after |
| 4321 | BMPS mode is entered. |
| 4322 | ---------------------------------------------------------------------------*/ |
| 4323 | eHalStatus sme_EnterWowl ( |
| 4324 | tHalHandle hHal, |
| 4325 | void (*enterWowlCallbackRoutine) (void *callbackContext, eHalStatus status), |
| 4326 | void *enterWowlCallbackContext, |
| 4327 | #ifdef WLAN_WAKEUP_EVENTS |
| 4328 | void (*wakeIndicationCB) (void *callbackContext, tpSirWakeReasonInd pWakeReasonInd), |
| 4329 | void *wakeIndicationCBContext, |
| 4330 | #endif // WLAN_WAKEUP_EVENTS |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4331 | tpSirSmeWowlEnterParams wowlEnterParams, tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4332 | { |
| 4333 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4334 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4335 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4336 | TRACE_CODE_SME_RX_HDD_ENTER_WOWL, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4337 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4338 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4339 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4340 | status = pmcEnterWowl (hHal, enterWowlCallbackRoutine, enterWowlCallbackContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4341 | #ifdef WLAN_WAKEUP_EVENTS |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4342 | wakeIndicationCB, wakeIndicationCBContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4343 | #endif // WLAN_WAKEUP_EVENTS |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4344 | wowlEnterParams, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4345 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4346 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4347 | return (status); |
| 4348 | } |
| 4349 | /* --------------------------------------------------------------------------- |
| 4350 | \fn sme_ExitWowl |
| 4351 | \brief This is the SME API exposed to HDD to request exit from WoWLAN mode. |
| 4352 | SME will initiate exit from WoWLAN mode and device will be put in BMPS |
| 4353 | mode. |
| 4354 | \param hHal - The handle returned by macOpen. |
| 4355 | \return eHalStatus |
| 4356 | eHAL_STATUS_FAILURE Device cannot exit WoWLAN mode. |
| 4357 | eHAL_STATUS_SUCCESS Request accepted to exit WoWLAN mode. |
| 4358 | ---------------------------------------------------------------------------*/ |
| 4359 | eHalStatus sme_ExitWowl (tHalHandle hHal) |
| 4360 | { |
| 4361 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4362 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4363 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4364 | TRACE_CODE_SME_RX_HDD_EXIT_WOWL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4365 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4366 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4367 | { |
| 4368 | status = pmcExitWowl (hHal); |
| 4369 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4370 | } |
| 4371 | |
| 4372 | return (status); |
| 4373 | } |
| 4374 | |
| 4375 | /* --------------------------------------------------------------------------- |
| 4376 | |
| 4377 | \fn sme_RoamSetKey |
| 4378 | |
| 4379 | \brief To set encryption key. This function should be called only when connected |
| 4380 | This is an asynchronous API. |
| 4381 | |
| 4382 | \param pSetKeyInfo - pointer to a caller allocated object of tCsrSetContextInfo |
| 4383 | |
| 4384 | \param pRoamId Upon success return, this is the id caller can use to identify the request in roamcallback |
| 4385 | |
| 4386 | \return eHalStatus SUCCESS Roam callback will be called indicate actually results |
| 4387 | |
| 4388 | FAILURE or RESOURCES The API finished and failed. |
| 4389 | |
| 4390 | -------------------------------------------------------------------------------*/ |
| 4391 | eHalStatus sme_RoamSetKey(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 *pRoamId) |
| 4392 | { |
| 4393 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4394 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4395 | tANI_U32 roamId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4396 | tANI_U32 i; |
| 4397 | tCsrRoamSession *pSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4398 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4399 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4400 | TRACE_CODE_SME_RX_HDD_SET_KEY, sessionId, 0)); |
Jeff Johnson | f89f4b5 | 2013-03-27 10:32:44 -0700 | [diff] [blame] | 4401 | if (pSetKey->keyLength > CSR_MAX_KEY_LEN) |
| 4402 | { |
| 4403 | smsLog(pMac, LOGE, FL("Invalid key length %d"), pSetKey->keyLength); |
| 4404 | return eHAL_STATUS_FAILURE; |
| 4405 | } |
| 4406 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4407 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4408 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4409 | { |
| 4410 | roamId = GET_NEXT_ROAM_ID(&pMac->roam); |
| 4411 | if(pRoamId) |
| 4412 | { |
| 4413 | *pRoamId = roamId; |
| 4414 | } |
| 4415 | |
Jeff Johnson | f89f4b5 | 2013-03-27 10:32:44 -0700 | [diff] [blame] | 4416 | smsLog(pMac, LOG2, FL("keyLength %d"), pSetKey->keyLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4417 | |
| 4418 | for(i=0; i<pSetKey->keyLength; i++) |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4419 | smsLog(pMac, LOG2, FL("%02x"), pSetKey->Key[i]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4420 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4421 | smsLog(pMac, LOG2, "\n sessionId=%d roamId=%d", sessionId, roamId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4422 | |
| 4423 | pSession = CSR_GET_SESSION(pMac, sessionId); |
| 4424 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4425 | if(!pSession) |
| 4426 | { |
| 4427 | 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] | 4428 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4429 | return eHAL_STATUS_FAILURE; |
| 4430 | } |
| 4431 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4432 | if(CSR_IS_INFRA_AP(&pSession->connectedProfile)) |
| 4433 | { |
| 4434 | if(pSetKey->keyDirection == eSIR_TX_DEFAULT) |
| 4435 | { |
| 4436 | if ( ( eCSR_ENCRYPT_TYPE_WEP40 == pSetKey->encType ) || |
| 4437 | ( eCSR_ENCRYPT_TYPE_WEP40_STATICKEY == pSetKey->encType )) |
| 4438 | { |
| 4439 | pSession->pCurRoamProfile->negotiatedUCEncryptionType = eCSR_ENCRYPT_TYPE_WEP40_STATICKEY; |
| 4440 | } |
| 4441 | if ( ( eCSR_ENCRYPT_TYPE_WEP104 == pSetKey->encType ) || |
| 4442 | ( eCSR_ENCRYPT_TYPE_WEP104_STATICKEY == pSetKey->encType )) |
| 4443 | { |
| 4444 | pSession->pCurRoamProfile->negotiatedUCEncryptionType = eCSR_ENCRYPT_TYPE_WEP104_STATICKEY; |
| 4445 | } |
| 4446 | } |
| 4447 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4448 | |
| 4449 | status = csrRoamSetKey ( pMac, sessionId, pSetKey, roamId ); |
| 4450 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4451 | } |
| 4452 | |
| 4453 | return (status); |
| 4454 | } |
| 4455 | |
| 4456 | |
| 4457 | /* --------------------------------------------------------------------------- |
| 4458 | |
| 4459 | \fn sme_RoamRemoveKey |
| 4460 | |
| 4461 | \brief To set encryption key. This is an asynchronous API. |
| 4462 | |
| 4463 | \param pRemoveKey - pointer to a caller allocated object of tCsrRoamRemoveKey |
| 4464 | |
| 4465 | \param pRoamId Upon success return, this is the id caller can use to identify the request in roamcallback |
| 4466 | |
| 4467 | \return eHalStatus SUCCESS Roam callback will be called indicate actually results |
| 4468 | |
| 4469 | FAILURE or RESOURCES The API finished and failed. |
| 4470 | |
| 4471 | -------------------------------------------------------------------------------*/ |
| 4472 | eHalStatus sme_RoamRemoveKey(tHalHandle hHal, tANI_U8 sessionId, |
| 4473 | tCsrRoamRemoveKey *pRemoveKey, tANI_U32 *pRoamId) |
| 4474 | { |
| 4475 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4476 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4477 | tANI_U32 roamId; |
| 4478 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4479 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4480 | TRACE_CODE_SME_RX_HDD_REMOVE_KEY, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4481 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4482 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4483 | { |
| 4484 | roamId = GET_NEXT_ROAM_ID(&pMac->roam); |
| 4485 | if(pRoamId) |
| 4486 | { |
| 4487 | *pRoamId = roamId; |
| 4488 | } |
| 4489 | status = csrRoamIssueRemoveKeyCommand( pMac, sessionId, pRemoveKey, roamId ); |
| 4490 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4491 | } |
| 4492 | |
| 4493 | return (status); |
| 4494 | } |
| 4495 | |
| 4496 | /* --------------------------------------------------------------------------- |
| 4497 | \fn sme_GetRssi |
| 4498 | \brief a wrapper function that client calls to register a callback to get RSSI |
| 4499 | |
| 4500 | \param callback - SME sends back the requested stats using the callback |
| 4501 | \param staId - The station ID for which the stats is requested for |
| 4502 | \param pContext - user context to be passed back along with the callback |
| 4503 | \param pVosContext - vos context |
| 4504 | \return eHalStatus |
| 4505 | ---------------------------------------------------------------------------*/ |
| 4506 | eHalStatus sme_GetRssi(tHalHandle hHal, |
| 4507 | tCsrRssiCallback callback, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4508 | tANI_U8 staId, tCsrBssid bssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4509 | void *pContext, void* pVosContext) |
| 4510 | { |
| 4511 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4512 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4513 | |
| 4514 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4515 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4516 | { |
| 4517 | status = csrGetRssi( pMac, callback, |
| 4518 | staId, bssId, pContext, pVosContext); |
| 4519 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4520 | } |
| 4521 | return (status); |
| 4522 | } |
Madan Mohan Koyyalamudi | d9383fd | 2013-08-13 09:27:30 +0530 | [diff] [blame] | 4523 | |
| 4524 | /* --------------------------------------------------------------------------- |
| 4525 | \fn sme_GetSnr |
| 4526 | \brief a wrapper function that client calls to register a callback to |
| 4527 | get SNR |
| 4528 | |
| 4529 | \param callback - SME sends back the requested stats using the callback |
| 4530 | \param staId - The station ID for which the stats is requested for |
| 4531 | \param pContext - user context to be passed back along with the callback |
| 4532 | \param pVosContext - vos context |
| 4533 | \return eHalStatus |
| 4534 | ---------------------------------------------------------------------------*/ |
| 4535 | eHalStatus sme_GetSnr(tHalHandle hHal, |
| 4536 | tCsrSnrCallback callback, |
| 4537 | tANI_U8 staId, tCsrBssid bssId, |
| 4538 | void *pContext) |
| 4539 | { |
| 4540 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4541 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4542 | |
| 4543 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4544 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4545 | { |
| 4546 | status = csrGetSnr(pMac, callback, |
| 4547 | staId, bssId, pContext); |
| 4548 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4549 | } |
| 4550 | return status; |
| 4551 | } |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 4552 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 4553 | /* --------------------------------------------------------------------------- |
| 4554 | \fn sme_GetRoamRssi |
| 4555 | \brief a wrapper function that client calls to register a callback to get Roam RSSI |
| 4556 | |
| 4557 | \param callback - SME sends back the requested stats using the callback |
| 4558 | \param staId - The station ID for which the stats is requested for |
| 4559 | \param pContext - user context to be passed back along with the callback |
| 4560 | \param pVosContext - vos context |
| 4561 | \return eHalStatus |
| 4562 | ---------------------------------------------------------------------------*/ |
| 4563 | eHalStatus sme_GetRoamRssi(tHalHandle hHal, |
| 4564 | tCsrRssiCallback callback, |
| 4565 | tANI_U8 staId, tCsrBssid bssId, |
| 4566 | void *pContext, void* pVosContext) |
| 4567 | { |
| 4568 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4569 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4570 | |
| 4571 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4572 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4573 | { |
| 4574 | status = csrGetRoamRssi( pMac, callback, |
| 4575 | staId, bssId, pContext, pVosContext); |
| 4576 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4577 | } |
| 4578 | return (status); |
| 4579 | } |
| 4580 | #endif |
| 4581 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4582 | |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4583 | #if defined(FEATURE_WLAN_CCX) && defined(FEATURE_WLAN_CCX_UPLOAD) |
| 4584 | /* --------------------------------------------------------------------------- |
| 4585 | \fn sme_GetTsmStats |
| 4586 | \brief a wrapper function that client calls to register a callback to get TSM Stats |
| 4587 | |
| 4588 | \param callback - SME sends back the requested stats using the callback |
| 4589 | \param staId - The station ID for which the stats is requested for |
| 4590 | \param pContext - user context to be passed back along with the callback |
| 4591 | \param pVosContext - vos context |
| 4592 | \return eHalStatus |
| 4593 | ---------------------------------------------------------------------------*/ |
| 4594 | eHalStatus sme_GetTsmStats(tHalHandle hHal, |
| 4595 | tCsrTsmStatsCallback callback, |
| 4596 | tANI_U8 staId, tCsrBssid bssId, |
| 4597 | void *pContext, void* pVosContext, tANI_U8 tid) |
| 4598 | { |
| 4599 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4600 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4601 | |
| 4602 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4603 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4604 | { |
| 4605 | status = csrGetTsmStats( pMac, callback, |
| 4606 | staId, bssId, pContext, pVosContext, tid); |
| 4607 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4608 | } |
| 4609 | return (status); |
| 4610 | } |
| 4611 | #endif |
| 4612 | |
| 4613 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4614 | /* --------------------------------------------------------------------------- |
| 4615 | \fn sme_GetStatistics |
| 4616 | \brief a wrapper function that client calls to register a callback to get |
| 4617 | different PHY level statistics from CSR. |
| 4618 | |
| 4619 | \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc |
| 4620 | \param statsMask - The different category/categories of stats requester is looking for |
| 4621 | \param callback - SME sends back the requested stats using the callback |
| 4622 | \param periodicity - If requester needs periodic update in millisec, 0 means |
| 4623 | it's an one time request |
| 4624 | \param cache - If requester is happy with cached stats |
| 4625 | \param staId - The station ID for which the stats is requested for |
| 4626 | \param pContext - user context to be passed back along with the callback |
| 4627 | \return eHalStatus |
| 4628 | ---------------------------------------------------------------------------*/ |
| 4629 | eHalStatus sme_GetStatistics(tHalHandle hHal, eCsrStatsRequesterType requesterId, |
| 4630 | tANI_U32 statsMask, |
| 4631 | tCsrStatsCallback callback, |
| 4632 | tANI_U32 periodicity, tANI_BOOLEAN cache, |
| 4633 | tANI_U8 staId, void *pContext) |
| 4634 | { |
| 4635 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4636 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4637 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4638 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4639 | TRACE_CODE_SME_RX_HDD_GET_STATS, NO_SESSION, periodicity)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4640 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4641 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4642 | { |
| 4643 | status = csrGetStatistics( pMac, requesterId , statsMask, callback, |
| 4644 | periodicity, cache, staId, pContext); |
| 4645 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4646 | } |
| 4647 | |
| 4648 | return (status); |
| 4649 | |
| 4650 | } |
| 4651 | |
| 4652 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 8af9b40 | 2013-07-11 14:59:10 +0530 | [diff] [blame] | 4653 | \fn smeGetTLSTAState |
| 4654 | \helper function to get the TL STA State whenever the function is called. |
| 4655 | |
| 4656 | \param staId - The staID to be passed to the TL |
| 4657 | to get the relevant TL STA State |
| 4658 | \return the state as tANI_U16 |
| 4659 | ---------------------------------------------------------------------------*/ |
| 4660 | tANI_U16 smeGetTLSTAState(tHalHandle hHal, tANI_U8 staId) |
| 4661 | { |
| 4662 | tANI_U16 tlSTAState = TL_INIT_STATE; |
| 4663 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4664 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4665 | |
| 4666 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4667 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4668 | { |
| 4669 | tlSTAState = csrGetTLSTAState( pMac, staId); |
| 4670 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4671 | } |
| 4672 | |
| 4673 | return tlSTAState; |
| 4674 | } |
| 4675 | |
| 4676 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4677 | |
| 4678 | \fn sme_GetCountryCode |
| 4679 | |
| 4680 | \brief To return the current country code. If no country code is applied, default country code is |
| 4681 | used to fill the buffer. |
| 4682 | If 11d supported is turned off, an error is return and the last applied/default country code is used. |
| 4683 | This is a synchronous API. |
| 4684 | |
| 4685 | \param pBuf - pointer to a caller allocated buffer for returned country code. |
| 4686 | |
| 4687 | \param pbLen For input, this parameter indicates how big is the buffer. |
| 4688 | Upon return, this parameter has the number of bytes for country. If pBuf |
| 4689 | doesn't have enough space, this function returns |
| 4690 | fail status and this parameter contains the number that is needed. |
| 4691 | |
| 4692 | \return eHalStatus SUCCESS. |
| 4693 | |
| 4694 | FAILURE or RESOURCES The API finished and failed. |
| 4695 | |
| 4696 | -------------------------------------------------------------------------------*/ |
| 4697 | eHalStatus sme_GetCountryCode(tHalHandle hHal, tANI_U8 *pBuf, tANI_U8 *pbLen) |
| 4698 | { |
| 4699 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4700 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4701 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4702 | TRACE_CODE_SME_RX_HDD_GET_CNTRYCODE, NO_SESSION, 0)); |
| 4703 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4704 | return ( csrGetCountryCode( pMac, pBuf, pbLen ) ); |
| 4705 | } |
| 4706 | |
| 4707 | |
| 4708 | /* --------------------------------------------------------------------------- |
| 4709 | |
| 4710 | \fn sme_SetCountryCode |
| 4711 | |
| 4712 | \brief To change the current/default country code. |
| 4713 | If 11d supported is turned off, an error is return. |
| 4714 | This is a synchronous API. |
| 4715 | |
| 4716 | \param pCountry - pointer to a caller allocated buffer for the country code. |
| 4717 | |
| 4718 | \param pfRestartNeeded A pointer to caller allocated memory, upon successful return, it indicates |
| 4719 | whether a reset is required. |
| 4720 | |
| 4721 | \return eHalStatus SUCCESS. |
| 4722 | |
| 4723 | FAILURE or RESOURCES The API finished and failed. |
| 4724 | |
| 4725 | -------------------------------------------------------------------------------*/ |
| 4726 | eHalStatus sme_SetCountryCode(tHalHandle hHal, tANI_U8 *pCountry, tANI_BOOLEAN *pfRestartNeeded) |
| 4727 | { |
| 4728 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4729 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4730 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4731 | TRACE_CODE_SME_RX_HDD_SET_CNTRYCODE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4732 | return ( csrSetCountryCode( pMac, pCountry, pfRestartNeeded ) ); |
| 4733 | } |
| 4734 | |
| 4735 | |
| 4736 | /* --------------------------------------------------------------------------- |
| 4737 | \fn sme_ResetCountryCodeInformation |
| 4738 | \brief this function is to reset the country code current being used back to EEPROM default |
| 4739 | this includes channel list and power setting. This is a synchronous API. |
| 4740 | \param pfRestartNeeded - pointer to a caller allocated space. Upon successful return, it indicates whether |
| 4741 | a restart is needed to apply the change |
| 4742 | \return eHalStatus |
| 4743 | -------------------------------------------------------------------------------*/ |
| 4744 | eHalStatus sme_ResetCountryCodeInformation(tHalHandle hHal, tANI_BOOLEAN *pfRestartNeeded) |
| 4745 | { |
| 4746 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4747 | |
| 4748 | return ( csrResetCountryCodeInformation( pMac, pfRestartNeeded ) ); |
| 4749 | } |
| 4750 | |
| 4751 | |
| 4752 | /* --------------------------------------------------------------------------- |
| 4753 | \fn sme_GetSupportedCountryCode |
| 4754 | \brief this function is to get a list of the country code current being supported |
| 4755 | \param pBuf - Caller allocated buffer with at least 3 bytes, upon success return, |
| 4756 | this has the country code list. 3 bytes for each country code. This may be NULL if |
| 4757 | caller wants to know the needed byte count. |
| 4758 | \param pbLen - Caller allocated, as input, it indicates the length of pBuf. Upon success return, |
| 4759 | this contains the length of the data in pBuf. If pbuf is NULL, as input, *pbLen should be 0. |
| 4760 | \return eHalStatus |
| 4761 | -------------------------------------------------------------------------------*/ |
| 4762 | eHalStatus sme_GetSupportedCountryCode(tHalHandle hHal, tANI_U8 *pBuf, tANI_U32 *pbLen) |
| 4763 | { |
| 4764 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4765 | |
| 4766 | return ( csrGetSupportedCountryCode( pMac, pBuf, pbLen ) ); |
| 4767 | } |
| 4768 | |
| 4769 | |
| 4770 | /* --------------------------------------------------------------------------- |
| 4771 | \fn sme_GetCurrentRegulatoryDomain |
| 4772 | \brief this function is to get the current regulatory domain. This is a synchronous API. |
| 4773 | This function must be called after CFG is downloaded and all the band/mode setting already passed into |
| 4774 | SME. The function fails if 11d support is turned off. |
| 4775 | \param pDomain - Caller allocated buffer to return the current domain. |
| 4776 | \return eHalStatus SUCCESS. |
| 4777 | |
| 4778 | FAILURE or RESOURCES The API finished and failed. |
| 4779 | -------------------------------------------------------------------------------*/ |
| 4780 | eHalStatus sme_GetCurrentRegulatoryDomain(tHalHandle hHal, v_REGDOMAIN_t *pDomain) |
| 4781 | { |
| 4782 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4783 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 4784 | |
| 4785 | if( pDomain ) |
| 4786 | { |
| 4787 | if( csrIs11dSupported( pMac ) ) |
| 4788 | { |
| 4789 | *pDomain = csrGetCurrentRegulatoryDomain( pMac ); |
| 4790 | status = eHAL_STATUS_SUCCESS; |
| 4791 | } |
| 4792 | else |
| 4793 | { |
| 4794 | status = eHAL_STATUS_FAILURE; |
| 4795 | } |
| 4796 | } |
| 4797 | |
| 4798 | return ( status ); |
| 4799 | } |
| 4800 | |
| 4801 | |
| 4802 | /* --------------------------------------------------------------------------- |
| 4803 | \fn sme_SetRegulatoryDomain |
| 4804 | \brief this function is to set the current regulatory domain. |
| 4805 | This function must be called after CFG is downloaded and all the band/mode setting already passed into |
| 4806 | SME. This is a synchronous API. |
| 4807 | \param domainId - indicate the domain (defined in the driver) needs to set to. |
| 4808 | See v_REGDOMAIN_t for definition |
| 4809 | \param pfRestartNeeded - pointer to a caller allocated space. Upon successful return, it indicates whether |
| 4810 | a restart is needed to apply the change |
| 4811 | \return eHalStatus |
| 4812 | -------------------------------------------------------------------------------*/ |
| 4813 | eHalStatus sme_SetRegulatoryDomain(tHalHandle hHal, v_REGDOMAIN_t domainId, tANI_BOOLEAN *pfRestartNeeded) |
| 4814 | { |
| 4815 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4816 | |
| 4817 | return ( csrSetRegulatoryDomain( pMac, domainId, pfRestartNeeded ) ); |
| 4818 | } |
| 4819 | |
| 4820 | |
| 4821 | /* --------------------------------------------------------------------------- |
| 4822 | |
| 4823 | \fn sme_GetRegulatoryDomainForCountry |
| 4824 | |
| 4825 | \brief To return a regulatory domain base on a country code. This is a synchronous API. |
| 4826 | |
| 4827 | \param pCountry - pointer to a caller allocated buffer for input country code. |
| 4828 | |
| 4829 | \param pDomainId Upon successful return, it is the domain that country belongs to. |
| 4830 | If it is NULL, returning success means that the country code is known. |
| 4831 | |
| 4832 | \return eHalStatus SUCCESS. |
| 4833 | |
| 4834 | FAILURE or RESOURCES The API finished and failed. |
| 4835 | |
| 4836 | -------------------------------------------------------------------------------*/ |
| 4837 | eHalStatus sme_GetRegulatoryDomainForCountry(tHalHandle hHal, tANI_U8 *pCountry, v_REGDOMAIN_t *pDomainId) |
| 4838 | { |
| 4839 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4840 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 4841 | return csrGetRegulatoryDomainForCountry(pMac, pCountry, pDomainId, |
| 4842 | COUNTRY_QUERY); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4843 | } |
| 4844 | |
| 4845 | |
| 4846 | |
| 4847 | |
| 4848 | /* --------------------------------------------------------------------------- |
| 4849 | |
| 4850 | \fn sme_GetSupportedRegulatoryDomains |
| 4851 | |
| 4852 | \brief To return a list of supported regulatory domains. This is a synchronous API. |
| 4853 | |
| 4854 | \param pDomains - pointer to a caller allocated buffer for returned regulatory domains. |
| 4855 | |
| 4856 | \param pNumDomains For input, this parameter indicates howm many domains pDomains can hold. |
| 4857 | Upon return, this parameter has the number for supported domains. If pDomains |
| 4858 | doesn't have enough space for all the supported domains, this function returns |
| 4859 | fail status and this parameter contains the number that is needed. |
| 4860 | |
| 4861 | \return eHalStatus SUCCESS. |
| 4862 | |
| 4863 | FAILURE or RESOURCES The API finished and failed. |
| 4864 | |
| 4865 | -------------------------------------------------------------------------------*/ |
| 4866 | eHalStatus sme_GetSupportedRegulatoryDomains(tHalHandle hHal, v_REGDOMAIN_t *pDomains, tANI_U32 *pNumDomains) |
| 4867 | { |
| 4868 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 4869 | |
| 4870 | //We support all domains for now |
| 4871 | if( pNumDomains ) |
| 4872 | { |
| 4873 | if( NUM_REG_DOMAINS <= *pNumDomains ) |
| 4874 | { |
| 4875 | status = eHAL_STATUS_SUCCESS; |
| 4876 | } |
| 4877 | *pNumDomains = NUM_REG_DOMAINS; |
| 4878 | } |
| 4879 | if( HAL_STATUS_SUCCESS( status ) ) |
| 4880 | { |
| 4881 | if( pDomains ) |
| 4882 | { |
| 4883 | pDomains[0] = REGDOMAIN_FCC; |
| 4884 | pDomains[1] = REGDOMAIN_ETSI; |
| 4885 | pDomains[2] = REGDOMAIN_JAPAN; |
| 4886 | pDomains[3] = REGDOMAIN_WORLD; |
| 4887 | pDomains[4] = REGDOMAIN_N_AMER_EXC_FCC; |
| 4888 | pDomains[5] = REGDOMAIN_APAC; |
| 4889 | pDomains[6] = REGDOMAIN_KOREA; |
| 4890 | pDomains[7] = REGDOMAIN_HI_5GHZ; |
| 4891 | pDomains[8] = REGDOMAIN_NO_5GHZ; |
| 4892 | } |
| 4893 | else |
| 4894 | { |
| 4895 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4896 | } |
| 4897 | } |
| 4898 | |
| 4899 | return ( status ); |
| 4900 | } |
| 4901 | |
| 4902 | |
| 4903 | //some support functions |
| 4904 | tANI_BOOLEAN sme_Is11dSupported(tHalHandle hHal) |
| 4905 | { |
| 4906 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4907 | |
| 4908 | return ( csrIs11dSupported( pMac ) ); |
| 4909 | } |
| 4910 | |
| 4911 | |
| 4912 | tANI_BOOLEAN sme_Is11hSupported(tHalHandle hHal) |
| 4913 | { |
| 4914 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4915 | |
| 4916 | return ( csrIs11hSupported( pMac ) ); |
| 4917 | } |
| 4918 | |
| 4919 | |
| 4920 | tANI_BOOLEAN sme_IsWmmSupported(tHalHandle hHal) |
| 4921 | { |
| 4922 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4923 | |
| 4924 | return ( csrIsWmmSupported( pMac ) ); |
| 4925 | } |
| 4926 | |
| 4927 | //Upper layer to get the list of the base channels to scan for passively 11d info from csr |
| 4928 | eHalStatus sme_ScanGetBaseChannels( tHalHandle hHal, tCsrChannelInfo * pChannelInfo ) |
| 4929 | { |
| 4930 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4931 | |
| 4932 | return(csrScanGetBaseChannels(pMac,pChannelInfo) ); |
| 4933 | } |
| 4934 | |
| 4935 | /* --------------------------------------------------------------------------- |
| 4936 | |
| 4937 | \fn sme_ChangeCountryCode |
| 4938 | |
| 4939 | \brief Change Country code from upperlayer during WLAN driver operation. |
| 4940 | This is a synchronous API. |
| 4941 | |
| 4942 | \param hHal - The handle returned by macOpen. |
| 4943 | |
| 4944 | \param pCountry New Country Code String |
| 4945 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 4946 | \param sendRegHint If we want to send reg hint to nl80211 |
| 4947 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4948 | \return eHalStatus SUCCESS. |
| 4949 | |
| 4950 | FAILURE or RESOURCES The API finished and failed. |
| 4951 | |
| 4952 | -------------------------------------------------------------------------------*/ |
| 4953 | eHalStatus sme_ChangeCountryCode( tHalHandle hHal, |
| 4954 | tSmeChangeCountryCallback callback, |
| 4955 | tANI_U8 *pCountry, |
| 4956 | void *pContext, |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 4957 | void* pVosContext, |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 4958 | tAniBool countryFromUserSpace, |
| 4959 | tAniBool sendRegHint ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4960 | { |
| 4961 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4962 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4963 | vos_msg_t msg; |
| 4964 | tAniChangeCountryCodeReq *pMsg; |
| 4965 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4966 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4967 | TRACE_CODE_SME_RX_HDD_CHANGE_CNTRYCODE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4968 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4969 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4970 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4971 | smsLog(pMac, LOG1, FL(" called")); |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 4972 | |
| 4973 | if ((csrGetInfraSessionId(pMac) != -1) && |
| 4974 | (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority)) |
| 4975 | { |
| 4976 | |
| 4977 | smsLog(pMac, LOGW, "Set Country Code Fail since the STA is associated and userspace does not have priority "); |
| 4978 | |
| 4979 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4980 | status = eHAL_STATUS_FAILURE; |
| 4981 | return status; |
| 4982 | } |
| 4983 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 4984 | pMsg = vos_mem_malloc(sizeof(tAniChangeCountryCodeReq)); |
| 4985 | if ( NULL == pMsg ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4986 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4987 | 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] | 4988 | sme_ReleaseGlobalLock( &pMac->sme ); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 4989 | return eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4990 | } |
| 4991 | |
| 4992 | pMsg->msgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_CHANGE_COUNTRY_CODE); |
| 4993 | pMsg->msgLen = (tANI_U16)sizeof(tAniChangeCountryCodeReq); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 4994 | vos_mem_copy(pMsg->countryCode, pCountry, 3); |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 4995 | pMsg->countryFromUserSpace = countryFromUserSpace; |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 4996 | pMsg->sendRegHint = sendRegHint; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4997 | pMsg->changeCCCallback = callback; |
| 4998 | pMsg->pDevContext = pContext; |
| 4999 | pMsg->pVosContext = pVosContext; |
| 5000 | |
| 5001 | msg.type = eWNI_SME_CHANGE_COUNTRY_CODE; |
| 5002 | msg.bodyptr = pMsg; |
| 5003 | msg.reserved = 0; |
| 5004 | |
| 5005 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg)) |
| 5006 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5007 | smsLog(pMac, LOGE, " sme_ChangeCountryCode failed to post msg to self "); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5008 | vos_mem_free((void *)pMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5009 | status = eHAL_STATUS_FAILURE; |
| 5010 | } |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5011 | smsLog(pMac, LOG1, FL(" returned")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5012 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5013 | } |
| 5014 | |
| 5015 | return (status); |
| 5016 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5017 | |
| 5018 | /*-------------------------------------------------------------------------- |
| 5019 | |
| 5020 | \fn sme_GenericChangeCountryCode |
| 5021 | |
| 5022 | \brief Change Country code from upperlayer during WLAN driver operation. |
| 5023 | This is a synchronous API. |
| 5024 | |
| 5025 | \param hHal - The handle returned by macOpen. |
| 5026 | |
| 5027 | \param pCountry New Country Code String |
| 5028 | |
| 5029 | \param reg_domain regulatory domain |
| 5030 | |
| 5031 | \return eHalStatus SUCCESS. |
| 5032 | |
| 5033 | FAILURE or RESOURCES The API finished and failed. |
| 5034 | |
| 5035 | -----------------------------------------------------------------------------*/ |
| 5036 | eHalStatus sme_GenericChangeCountryCode( tHalHandle hHal, |
| 5037 | tANI_U8 *pCountry, |
| 5038 | v_REGDOMAIN_t reg_domain) |
| 5039 | { |
| 5040 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5041 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5042 | vos_msg_t msg; |
| 5043 | tAniGenericChangeCountryCodeReq *pMsg; |
| 5044 | |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 5045 | if (NULL == pMac) |
| 5046 | { |
| 5047 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 5048 | "%s: pMac is null", __func__); |
| 5049 | return status; |
| 5050 | } |
| 5051 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5052 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5053 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5054 | { |
| 5055 | smsLog(pMac, LOG1, FL(" called")); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 5056 | pMsg = vos_mem_malloc(sizeof(tAniGenericChangeCountryCodeReq)); |
| 5057 | if (NULL == pMsg) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5058 | { |
| 5059 | smsLog(pMac, LOGE, " sme_GenericChangeCountryCode: failed to allocate mem for req"); |
| 5060 | sme_ReleaseGlobalLock( &pMac->sme ); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 5061 | return eHAL_STATUS_FAILURE; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5062 | } |
| 5063 | |
| 5064 | pMsg->msgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE); |
| 5065 | pMsg->msgLen = (tANI_U16)sizeof(tAniGenericChangeCountryCodeReq); |
Sameer Thalappil | 7324e8b | 2014-01-15 10:32:54 -0800 | [diff] [blame] | 5066 | vos_mem_copy(pMsg->countryCode, pCountry, 2); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5067 | pMsg->domain_index = reg_domain; |
| 5068 | |
| 5069 | msg.type = eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE; |
| 5070 | msg.bodyptr = pMsg; |
| 5071 | msg.reserved = 0; |
| 5072 | |
| 5073 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg)) |
| 5074 | { |
| 5075 | smsLog(pMac, LOGE, "sme_GenericChangeCountryCode failed to post msg to self"); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 5076 | vos_mem_free(pMsg); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5077 | status = eHAL_STATUS_FAILURE; |
| 5078 | } |
| 5079 | smsLog(pMac, LOG1, FL(" returned")); |
| 5080 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5081 | } |
| 5082 | |
| 5083 | return (status); |
| 5084 | } |
Mihir Shete | e1093ba | 2014-01-21 20:13:32 +0530 | [diff] [blame] | 5085 | |
| 5086 | /* --------------------------------------------------------------------------- |
| 5087 | |
| 5088 | \fn sme_InitChannels |
| 5089 | |
| 5090 | \brief Used to initialize CSR channel lists while driver loading |
| 5091 | |
| 5092 | \param hHal - global pMac structure |
| 5093 | |
| 5094 | \return eHalStatus SUCCESS. |
| 5095 | |
| 5096 | FAILURE or RESOURCES The API finished and failed. |
| 5097 | |
| 5098 | -------------------------------------------------------------------------------*/ |
| 5099 | eHalStatus sme_InitChannels(tHalHandle hHal) |
| 5100 | { |
| 5101 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5102 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 5103 | |
| 5104 | if (NULL == pMac) |
| 5105 | { |
| 5106 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 5107 | "%s: pMac is null", __func__); |
| 5108 | return status; |
| 5109 | } |
| 5110 | |
| 5111 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 5112 | if (HAL_STATUS_SUCCESS(status)) |
| 5113 | { |
| 5114 | status = csrInitChannels(pMac); |
| 5115 | sme_ReleaseGlobalLock(&pMac->sme); |
| 5116 | } |
| 5117 | return status; |
| 5118 | } |
| 5119 | |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5120 | /* --------------------------------------------------------------------------- |
| 5121 | |
| 5122 | \fn sme_DHCPStartInd |
| 5123 | |
| 5124 | \brief API to signal the FW about the DHCP Start event. |
| 5125 | |
| 5126 | \param hHal - HAL handle for device. |
| 5127 | |
| 5128 | \param device_mode - mode(AP,SAP etc) of the device. |
| 5129 | |
| 5130 | \param macAddr - MAC address of the device. |
| 5131 | |
| 5132 | \return eHalStatus SUCCESS. |
| 5133 | |
| 5134 | FAILURE or RESOURCES The API finished and failed. |
| 5135 | --------------------------------------------------------------------------*/ |
| 5136 | eHalStatus sme_DHCPStartInd( tHalHandle hHal, |
| 5137 | tANI_U8 device_mode, |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5138 | tANI_U8 sessionId ) |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5139 | { |
| 5140 | eHalStatus status; |
| 5141 | VOS_STATUS vosStatus; |
| 5142 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5143 | vos_msg_t vosMessage; |
| 5144 | tAniDHCPInd *pMsg; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5145 | tCsrRoamSession *pSession; |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5146 | |
| 5147 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 5148 | if ( eHAL_STATUS_SUCCESS == status) |
| 5149 | { |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5150 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 5151 | |
| 5152 | if (!pSession) |
| 5153 | { |
| 5154 | smsLog(pMac, LOGE, FL("session %d not found "), sessionId); |
| 5155 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5156 | return eHAL_STATUS_FAILURE; |
| 5157 | } |
| 5158 | |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5159 | pMsg = (tAniDHCPInd*)vos_mem_malloc(sizeof(tAniDHCPInd)); |
| 5160 | if (NULL == pMsg) |
| 5161 | { |
| 5162 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5163 | "%s: Not able to allocate memory for dhcp start", __func__); |
| 5164 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5165 | return eHAL_STATUS_FAILURE; |
| 5166 | } |
| 5167 | pMsg->msgType = WDA_DHCP_START_IND; |
| 5168 | pMsg->msgLen = (tANI_U16)sizeof(tAniDHCPInd); |
| 5169 | pMsg->device_mode = device_mode; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5170 | vos_mem_copy(pMsg->macAddr, pSession->connectedProfile.bssid, |
| 5171 | sizeof(tSirMacAddr)); |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5172 | vosMessage.type = WDA_DHCP_START_IND; |
| 5173 | vosMessage.bodyptr = pMsg; |
| 5174 | vosMessage.reserved = 0; |
| 5175 | |
| 5176 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 5177 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 5178 | { |
| 5179 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5180 | "%s: Post DHCP Start MSG fail", __func__); |
| 5181 | vos_mem_free(pMsg); |
| 5182 | status = eHAL_STATUS_FAILURE; |
| 5183 | } |
| 5184 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5185 | } |
| 5186 | return (status); |
| 5187 | } |
| 5188 | /* --------------------------------------------------------------------------- |
| 5189 | \fn sme_DHCPStopInd |
| 5190 | |
| 5191 | \brief API to signal the FW about the DHCP complete event. |
| 5192 | |
| 5193 | \param hHal - HAL handle for device. |
| 5194 | |
| 5195 | \param device_mode - mode(AP, SAP etc) of the device. |
| 5196 | |
| 5197 | \param macAddr - MAC address of the device. |
| 5198 | |
| 5199 | \return eHalStatus SUCCESS. |
| 5200 | FAILURE or RESOURCES The API finished and failed. |
| 5201 | --------------------------------------------------------------------------*/ |
| 5202 | eHalStatus sme_DHCPStopInd( tHalHandle hHal, |
| 5203 | tANI_U8 device_mode, |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5204 | tANI_U8 sessionId ) |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5205 | { |
| 5206 | eHalStatus status; |
| 5207 | VOS_STATUS vosStatus; |
| 5208 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5209 | vos_msg_t vosMessage; |
| 5210 | tAniDHCPInd *pMsg; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5211 | tCsrRoamSession *pSession; |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5212 | |
| 5213 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 5214 | if ( eHAL_STATUS_SUCCESS == status) |
| 5215 | { |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5216 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 5217 | |
| 5218 | if (!pSession) |
| 5219 | { |
| 5220 | smsLog(pMac, LOGE, FL("session %d not found "), sessionId); |
| 5221 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5222 | return eHAL_STATUS_FAILURE; |
| 5223 | } |
| 5224 | |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5225 | pMsg = (tAniDHCPInd*)vos_mem_malloc(sizeof(tAniDHCPInd)); |
| 5226 | if (NULL == pMsg) |
| 5227 | { |
| 5228 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5229 | "%s: Not able to allocate memory for dhcp stop", __func__); |
| 5230 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5231 | return eHAL_STATUS_FAILURE; |
| 5232 | } |
| 5233 | |
| 5234 | pMsg->msgType = WDA_DHCP_STOP_IND; |
| 5235 | pMsg->msgLen = (tANI_U16)sizeof(tAniDHCPInd); |
| 5236 | pMsg->device_mode = device_mode; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5237 | vos_mem_copy(pMsg->macAddr, pSession->connectedProfile.bssid, |
| 5238 | sizeof(tSirMacAddr)); |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5239 | |
| 5240 | vosMessage.type = WDA_DHCP_STOP_IND; |
| 5241 | vosMessage.bodyptr = pMsg; |
| 5242 | vosMessage.reserved = 0; |
| 5243 | |
| 5244 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 5245 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 5246 | { |
| 5247 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5248 | "%s: Post DHCP Stop MSG fail", __func__); |
| 5249 | vos_mem_free(pMsg); |
| 5250 | status = eHAL_STATUS_FAILURE; |
| 5251 | } |
| 5252 | |
| 5253 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5254 | } |
| 5255 | return (status); |
| 5256 | } |
| 5257 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5258 | |
| 5259 | /* --------------------------------------------------------------------------- |
| 5260 | \fn sme_BtcSignalBtEvent |
| 5261 | \brief API to signal Bluetooth (BT) event to the WLAN driver. Based on the |
| 5262 | BT event type and the current operating mode of Libra (full power, |
| 5263 | BMPS, UAPSD etc), appropriate Bluetooth Coexistence (BTC) strategy |
| 5264 | would be employed. |
| 5265 | \param hHal - The handle returned by macOpen. |
| 5266 | \param pBtEvent - Pointer to a caller allocated object of type tSmeBtEvent |
| 5267 | Caller owns the memory and is responsible for freeing it. |
| 5268 | \return VOS_STATUS |
| 5269 | VOS_STATUS_E_FAILURE BT Event not passed to HAL. This can happen |
| 5270 | if BTC execution mode is set to BTC_WLAN_ONLY |
| 5271 | or BTC_PTA_ONLY. |
| 5272 | VOS_STATUS_SUCCESS BT Event passed to HAL |
| 5273 | ---------------------------------------------------------------------------*/ |
| 5274 | VOS_STATUS sme_BtcSignalBtEvent (tHalHandle hHal, tpSmeBtEvent pBtEvent) |
| 5275 | { |
| 5276 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5277 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5278 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 5279 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5280 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5281 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5282 | TRACE_CODE_SME_RX_HDD_BTC_SIGNALEVENT, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5283 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5284 | { |
| 5285 | status = btcSignalBTEvent (hHal, pBtEvent); |
| 5286 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5287 | } |
| 5288 | #endif |
| 5289 | return (status); |
| 5290 | } |
| 5291 | |
| 5292 | /* --------------------------------------------------------------------------- |
| 5293 | \fn sme_BtcSetConfig |
| 5294 | \brief API to change the current Bluetooth Coexistence (BTC) configuration |
| 5295 | This function should be invoked only after CFG download has completed. |
| 5296 | Calling it after sme_HDDReadyInd is recommended. |
| 5297 | \param hHal - The handle returned by macOpen. |
| 5298 | \param pSmeBtcConfig - Pointer to a caller allocated object of type tSmeBtcConfig. |
| 5299 | Caller owns the memory and is responsible for freeing it. |
| 5300 | \return VOS_STATUS |
| 5301 | VOS_STATUS_E_FAILURE Config not passed to HAL. |
| 5302 | VOS_STATUS_SUCCESS Config passed to HAL |
| 5303 | ---------------------------------------------------------------------------*/ |
| 5304 | VOS_STATUS sme_BtcSetConfig (tHalHandle hHal, tpSmeBtcConfig pSmeBtcConfig) |
| 5305 | { |
| 5306 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5307 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 5308 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5309 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5310 | TRACE_CODE_SME_RX_HDD_BTC_SETCONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5311 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5312 | { |
| 5313 | status = btcSetConfig (hHal, pSmeBtcConfig); |
| 5314 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5315 | } |
| 5316 | #endif |
| 5317 | return (status); |
| 5318 | } |
| 5319 | |
| 5320 | /* --------------------------------------------------------------------------- |
| 5321 | \fn sme_BtcGetConfig |
| 5322 | \brief API to retrieve the current Bluetooth Coexistence (BTC) configuration |
| 5323 | \param hHal - The handle returned by macOpen. |
| 5324 | \param pSmeBtcConfig - Pointer to a caller allocated object of type |
| 5325 | tSmeBtcConfig. Caller owns the memory and is responsible |
| 5326 | for freeing it. |
| 5327 | \return VOS_STATUS |
| 5328 | VOS_STATUS_E_FAILURE - failure |
| 5329 | VOS_STATUS_SUCCESS success |
| 5330 | ---------------------------------------------------------------------------*/ |
| 5331 | VOS_STATUS sme_BtcGetConfig (tHalHandle hHal, tpSmeBtcConfig pSmeBtcConfig) |
| 5332 | { |
| 5333 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5334 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 5335 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5336 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5337 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5338 | TRACE_CODE_SME_RX_HDD_BTC_GETCONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5339 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5340 | { |
| 5341 | status = btcGetConfig (hHal, pSmeBtcConfig); |
| 5342 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5343 | } |
| 5344 | #endif |
| 5345 | return (status); |
| 5346 | } |
| 5347 | /* --------------------------------------------------------------------------- |
| 5348 | \fn sme_SetCfgPrivacy |
| 5349 | \brief API to set configure privacy parameters |
| 5350 | \param hHal - The handle returned by macOpen. |
| 5351 | \param pProfile - Pointer CSR Roam profile. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5352 | \param fPrivacy - This parameter indicates status of privacy |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5353 | |
| 5354 | \return void |
| 5355 | ---------------------------------------------------------------------------*/ |
| 5356 | void sme_SetCfgPrivacy( tHalHandle hHal, |
| 5357 | tCsrRoamProfile *pProfile, |
| 5358 | tANI_BOOLEAN fPrivacy |
| 5359 | ) |
| 5360 | { |
| 5361 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5362 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5363 | TRACE_CODE_SME_RX_HDD_SET_CFGPRIVACY, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5364 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5365 | { |
| 5366 | csrSetCfgPrivacy(pMac, pProfile, fPrivacy); |
| 5367 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5368 | } |
| 5369 | } |
| 5370 | |
| 5371 | #if defined WLAN_FEATURE_VOWIFI |
| 5372 | /* --------------------------------------------------------------------------- |
| 5373 | \fn sme_NeighborReportRequest |
| 5374 | \brief API to request neighbor report. |
| 5375 | \param hHal - The handle returned by macOpen. |
| 5376 | \param pRrmNeighborReq - Pointer to a caller allocated object of type |
| 5377 | tRrmNeighborReq. Caller owns the memory and is responsible |
| 5378 | for freeing it. |
| 5379 | \return VOS_STATUS |
| 5380 | VOS_STATUS_E_FAILURE - failure |
| 5381 | VOS_STATUS_SUCCESS success |
| 5382 | ---------------------------------------------------------------------------*/ |
| 5383 | VOS_STATUS sme_NeighborReportRequest (tHalHandle hHal, tANI_U8 sessionId, |
| 5384 | tpRrmNeighborReq pRrmNeighborReq, tpRrmNeighborRspCallbackInfo callbackInfo) |
| 5385 | { |
| 5386 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5387 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5388 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5389 | TRACE_CODE_SME_RX_HDD_NEIGHBOR_REPORTREQ, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5390 | |
| 5391 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5392 | { |
| 5393 | status = sme_RrmNeighborReportRequest (hHal, sessionId, pRrmNeighborReq, callbackInfo); |
| 5394 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5395 | } |
| 5396 | |
| 5397 | return (status); |
| 5398 | } |
| 5399 | #endif |
| 5400 | |
| 5401 | //The following are debug APIs to support direct read/write register/memory |
| 5402 | //They are placed in SME because HW cannot be access when in LOW_POWER state |
| 5403 | //AND not connected. The knowledge and synchronization is done in SME |
| 5404 | |
| 5405 | //sme_DbgReadRegister |
| 5406 | //Caller needs to validate the input values |
| 5407 | VOS_STATUS sme_DbgReadRegister(tHalHandle hHal, v_U32_t regAddr, v_U32_t *pRegValue) |
| 5408 | { |
| 5409 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5410 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5411 | tPmcPowerState PowerState; |
| 5412 | tANI_U32 sessionId = 0; |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5413 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5414 | TRACE_CODE_SME_RX_HDD_DBG_READREG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5415 | |
| 5416 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5417 | |
| 5418 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5419 | { |
Hoonki Lee | 0af6aaf | 2013-02-08 12:26:44 -0800 | [diff] [blame] | 5420 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgReadRegister(regAddr, pRegValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5421 | { |
| 5422 | return VOS_STATUS_SUCCESS; |
| 5423 | } |
| 5424 | return VOS_STATUS_E_FAILURE; |
| 5425 | } |
| 5426 | |
| 5427 | /* 2) NON FTM mode driver *************************************************/ |
| 5428 | |
| 5429 | /* Acquire SME global lock */ |
| 5430 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5431 | { |
| 5432 | return VOS_STATUS_E_FAILURE; |
| 5433 | } |
| 5434 | |
| 5435 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5436 | { |
| 5437 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5438 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5439 | { |
Hoonki Lee | 0af6aaf | 2013-02-08 12:26:44 -0800 | [diff] [blame] | 5440 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgReadRegister(regAddr, pRegValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5441 | { |
| 5442 | status = VOS_STATUS_SUCCESS; |
| 5443 | } |
| 5444 | else |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5445 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5446 | status = VOS_STATUS_E_FAILURE; |
| 5447 | } |
| 5448 | } |
| 5449 | else |
| 5450 | { |
| 5451 | status = VOS_STATUS_E_FAILURE; |
| 5452 | } |
| 5453 | } |
| 5454 | |
| 5455 | /* This is a hack for Qualky/pttWniSocket |
| 5456 | Current implementation doesn't allow pttWniSocket to inform Qualky an error */ |
| 5457 | if ( VOS_STATUS_SUCCESS != status ) |
| 5458 | { |
| 5459 | *pRegValue = 0xDEADBEEF; |
| 5460 | status = VOS_STATUS_SUCCESS; |
| 5461 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5462 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5463 | /* Release SME global lock */ |
| 5464 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5465 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5466 | return (status); |
| 5467 | } |
| 5468 | |
| 5469 | |
| 5470 | //sme_DbgWriteRegister |
| 5471 | //Caller needs to validate the input values |
| 5472 | VOS_STATUS sme_DbgWriteRegister(tHalHandle hHal, v_U32_t regAddr, v_U32_t regValue) |
| 5473 | { |
| 5474 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5475 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5476 | tPmcPowerState PowerState; |
| 5477 | tANI_U32 sessionId = 0; |
| 5478 | |
| 5479 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5480 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5481 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5482 | TRACE_CODE_SME_RX_HDD_DBG_WRITEREG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5483 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5484 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5485 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteRegister(regAddr, regValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5486 | { |
| 5487 | return VOS_STATUS_SUCCESS; |
| 5488 | } |
| 5489 | return VOS_STATUS_E_FAILURE; |
| 5490 | } |
| 5491 | |
| 5492 | /* 2) NON FTM mode driver *************************************************/ |
| 5493 | |
| 5494 | /* Acquire SME global lock */ |
| 5495 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5496 | { |
| 5497 | return VOS_STATUS_E_FAILURE; |
| 5498 | } |
| 5499 | |
| 5500 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5501 | { |
| 5502 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5503 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5504 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5505 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteRegister(regAddr, regValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5506 | { |
| 5507 | status = VOS_STATUS_SUCCESS; |
| 5508 | } |
| 5509 | else |
| 5510 | { |
| 5511 | status = VOS_STATUS_E_FAILURE; |
| 5512 | } |
| 5513 | } |
| 5514 | else |
| 5515 | { |
| 5516 | status = VOS_STATUS_E_FAILURE; |
| 5517 | } |
| 5518 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5519 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5520 | /* Release SME global lock */ |
| 5521 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5522 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5523 | return (status); |
| 5524 | } |
| 5525 | |
| 5526 | |
| 5527 | |
| 5528 | //sme_DbgReadMemory |
| 5529 | //Caller needs to validate the input values |
| 5530 | //pBuf caller allocated buffer has the length of nLen |
| 5531 | VOS_STATUS sme_DbgReadMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U32_t nLen) |
| 5532 | { |
| 5533 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5534 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5535 | tPmcPowerState PowerState; |
| 5536 | tANI_U32 sessionId = 0; |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 5537 | tANI_U32 cmd = READ_MEMORY_DUMP_CMD; |
| 5538 | tANI_U32 arg1 = memAddr; |
| 5539 | tANI_U32 arg2 = nLen/4; |
| 5540 | tANI_U32 arg3 = 4; |
| 5541 | tANI_U32 arg4 = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5542 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5543 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5544 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5545 | TRACE_CODE_SME_RX_HDD_DBG_READMEM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5546 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5547 | { |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 5548 | 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] | 5549 | { |
| 5550 | return VOS_STATUS_SUCCESS; |
| 5551 | } |
| 5552 | return VOS_STATUS_E_FAILURE; |
| 5553 | } |
| 5554 | |
| 5555 | /* 2) NON FTM mode driver *************************************************/ |
| 5556 | |
| 5557 | /* Acquire SME global lock */ |
| 5558 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5559 | { |
| 5560 | return VOS_STATUS_E_FAILURE; |
| 5561 | } |
| 5562 | |
| 5563 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5564 | { |
| 5565 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5566 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5567 | { |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 5568 | 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] | 5569 | { |
| 5570 | status = VOS_STATUS_SUCCESS; |
| 5571 | } |
| 5572 | else |
| 5573 | { |
| 5574 | status = VOS_STATUS_E_FAILURE; |
| 5575 | } |
| 5576 | } |
| 5577 | else |
| 5578 | { |
| 5579 | status = VOS_STATUS_E_FAILURE; |
| 5580 | } |
| 5581 | } |
| 5582 | |
| 5583 | /* This is a hack for Qualky/pttWniSocket |
| 5584 | Current implementation doesn't allow pttWniSocket to inform Qualky an error */ |
| 5585 | if (VOS_STATUS_SUCCESS != status) |
| 5586 | { |
| 5587 | vos_mem_set(pBuf, nLen, 0xCD); |
| 5588 | status = VOS_STATUS_SUCCESS; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5589 | 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] | 5590 | } |
| 5591 | |
| 5592 | /* Release SME lock */ |
| 5593 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5594 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5595 | return (status); |
| 5596 | } |
| 5597 | |
| 5598 | |
| 5599 | //sme_DbgWriteMemory |
| 5600 | //Caller needs to validate the input values |
| 5601 | VOS_STATUS sme_DbgWriteMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U32_t nLen) |
| 5602 | { |
| 5603 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5604 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5605 | tPmcPowerState PowerState; |
| 5606 | tANI_U32 sessionId = 0; |
| 5607 | |
| 5608 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5609 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5610 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5611 | TRACE_CODE_SME_RX_HDD_DBG_WRITEMEM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5612 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5613 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5614 | { |
| 5615 | return VOS_STATUS_SUCCESS; |
| 5616 | } |
| 5617 | return VOS_STATUS_E_FAILURE; |
| 5618 | } |
| 5619 | |
| 5620 | /* 2) NON FTM mode driver *************************************************/ |
| 5621 | |
| 5622 | /* Acquire SME global lock */ |
| 5623 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5624 | { |
| 5625 | return VOS_STATUS_E_FAILURE; |
| 5626 | } |
| 5627 | |
| 5628 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5629 | { |
| 5630 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5631 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5632 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5633 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteMemory(memAddr, (void *)pBuf, nLen)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5634 | { |
| 5635 | status = VOS_STATUS_SUCCESS; |
| 5636 | } |
| 5637 | else |
| 5638 | { |
| 5639 | status = VOS_STATUS_E_FAILURE; |
| 5640 | } |
| 5641 | } |
| 5642 | else |
| 5643 | { |
| 5644 | status = VOS_STATUS_E_FAILURE; |
| 5645 | } |
| 5646 | } |
| 5647 | |
| 5648 | /* Release Global lock */ |
| 5649 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5650 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5651 | return (status); |
| 5652 | } |
| 5653 | |
| 5654 | |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 5655 | void pmcLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString, ...) |
| 5656 | { |
| 5657 | VOS_TRACE_LEVEL vosDebugLevel; |
| 5658 | char logBuffer[LOG_SIZE]; |
| 5659 | va_list marker; |
| 5660 | |
| 5661 | /* getting proper Debug level */ |
| 5662 | vosDebugLevel = getVosDebugLevel(loglevel); |
| 5663 | |
| 5664 | /* extracting arguments from pstring */ |
| 5665 | va_start( marker, pString ); |
| 5666 | vsnprintf(logBuffer, LOG_SIZE, pString, marker); |
| 5667 | |
| 5668 | VOS_TRACE(VOS_MODULE_ID_PMC, vosDebugLevel, "%s", logBuffer); |
| 5669 | va_end( marker ); |
| 5670 | } |
| 5671 | |
| 5672 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5673 | void smsLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString,...) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5674 | { |
| 5675 | #ifdef WLAN_DEBUG |
| 5676 | // Verify against current log level |
| 5677 | if ( loglevel > pMac->utils.gLogDbgLevel[LOG_INDEX_FOR_MODULE( SIR_SMS_MODULE_ID )] ) |
| 5678 | return; |
| 5679 | else |
| 5680 | { |
| 5681 | va_list marker; |
| 5682 | |
| 5683 | va_start( marker, pString ); /* Initialize variable arguments. */ |
| 5684 | |
| 5685 | logDebug(pMac, SIR_SMS_MODULE_ID, loglevel, pString, marker); |
| 5686 | |
| 5687 | va_end( marker ); /* Reset variable arguments. */ |
| 5688 | } |
| 5689 | #endif |
| 5690 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5691 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5692 | /* --------------------------------------------------------------------------- |
| 5693 | \fn sme_GetWcnssWlanCompiledVersion |
| 5694 | \brief This API returns the version of the WCNSS WLAN API with |
| 5695 | which the HOST driver was built |
| 5696 | \param hHal - The handle returned by macOpen. |
| 5697 | \param pVersion - Points to the Version structure to be filled |
| 5698 | \return VOS_STATUS |
| 5699 | VOS_STATUS_E_INVAL - failure |
| 5700 | VOS_STATUS_SUCCESS success |
| 5701 | ---------------------------------------------------------------------------*/ |
| 5702 | VOS_STATUS sme_GetWcnssWlanCompiledVersion(tHalHandle hHal, |
| 5703 | tSirVersionType *pVersion) |
| 5704 | { |
| 5705 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 5706 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5707 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 5708 | |
| 5709 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5710 | { |
| 5711 | if( pVersion != NULL ) |
| 5712 | { |
| 5713 | status = WDA_GetWcnssWlanCompiledVersion(vosContext, pVersion); |
| 5714 | } |
| 5715 | else |
| 5716 | { |
| 5717 | status = VOS_STATUS_E_INVAL; |
| 5718 | } |
| 5719 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5720 | } |
| 5721 | |
| 5722 | return (status); |
| 5723 | } |
| 5724 | |
| 5725 | |
| 5726 | /* --------------------------------------------------------------------------- |
| 5727 | \fn sme_GetWcnssWlanReportedVersion |
| 5728 | \brief This API returns the version of the WCNSS WLAN API with |
| 5729 | which the WCNSS driver reports it was built |
| 5730 | \param hHal - The handle returned by macOpen. |
| 5731 | \param pVersion - Points to the Version structure to be filled |
| 5732 | \return VOS_STATUS |
| 5733 | VOS_STATUS_E_INVAL - failure |
| 5734 | VOS_STATUS_SUCCESS success |
| 5735 | ---------------------------------------------------------------------------*/ |
| 5736 | VOS_STATUS sme_GetWcnssWlanReportedVersion(tHalHandle hHal, |
| 5737 | tSirVersionType *pVersion) |
| 5738 | { |
| 5739 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 5740 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5741 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 5742 | |
| 5743 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5744 | { |
| 5745 | if( pVersion != NULL ) |
| 5746 | { |
| 5747 | status = WDA_GetWcnssWlanReportedVersion(vosContext, pVersion); |
| 5748 | } |
| 5749 | else |
| 5750 | { |
| 5751 | status = VOS_STATUS_E_INVAL; |
| 5752 | } |
| 5753 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5754 | } |
| 5755 | |
| 5756 | return (status); |
| 5757 | } |
| 5758 | |
| 5759 | |
| 5760 | /* --------------------------------------------------------------------------- |
| 5761 | \fn sme_GetWcnssSoftwareVersion |
| 5762 | \brief This API returns the version string of the WCNSS driver |
| 5763 | \param hHal - The handle returned by macOpen. |
| 5764 | \param pVersion - Points to the Version string buffer to be filled |
| 5765 | \param versionBufferSize - THe size of the Version string buffer |
| 5766 | \return VOS_STATUS |
| 5767 | VOS_STATUS_E_INVAL - failure |
| 5768 | VOS_STATUS_SUCCESS success |
| 5769 | ---------------------------------------------------------------------------*/ |
| 5770 | VOS_STATUS sme_GetWcnssSoftwareVersion(tHalHandle hHal, |
| 5771 | tANI_U8 *pVersion, |
| 5772 | tANI_U32 versionBufferSize) |
| 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_GetWcnssSoftwareVersion(vosContext, pVersion, |
| 5783 | versionBufferSize); |
| 5784 | } |
| 5785 | else |
| 5786 | { |
| 5787 | status = VOS_STATUS_E_INVAL; |
| 5788 | } |
| 5789 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5790 | } |
| 5791 | |
| 5792 | return (status); |
| 5793 | } |
| 5794 | |
| 5795 | |
| 5796 | /* --------------------------------------------------------------------------- |
| 5797 | \fn sme_GetWcnssHardwareVersion |
| 5798 | \brief This API returns the version string of the WCNSS hardware |
| 5799 | \param hHal - The handle returned by macOpen. |
| 5800 | \param pVersion - Points to the Version string buffer to be filled |
| 5801 | \param versionBufferSize - THe size of the Version string buffer |
| 5802 | \return VOS_STATUS |
| 5803 | VOS_STATUS_E_INVAL - failure |
| 5804 | VOS_STATUS_SUCCESS success |
| 5805 | ---------------------------------------------------------------------------*/ |
| 5806 | VOS_STATUS sme_GetWcnssHardwareVersion(tHalHandle hHal, |
| 5807 | tANI_U8 *pVersion, |
| 5808 | tANI_U32 versionBufferSize) |
| 5809 | { |
| 5810 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 5811 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5812 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 5813 | |
| 5814 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5815 | { |
| 5816 | if( pVersion != NULL ) |
| 5817 | { |
| 5818 | status = WDA_GetWcnssHardwareVersion(vosContext, pVersion, |
| 5819 | versionBufferSize); |
| 5820 | } |
| 5821 | else |
| 5822 | { |
| 5823 | status = VOS_STATUS_E_INVAL; |
| 5824 | } |
| 5825 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5826 | } |
| 5827 | |
| 5828 | return (status); |
| 5829 | } |
Jeff Johnson | 4824d4c | 2013-02-12 14:23:57 -0800 | [diff] [blame] | 5830 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5831 | |
| 5832 | #ifdef FEATURE_WLAN_WAPI |
| 5833 | /* --------------------------------------------------------------------------- |
| 5834 | \fn sme_RoamSetBKIDCache |
| 5835 | \brief The SME API exposed to HDD to allow HDD to provde SME the BKID |
| 5836 | candidate list. |
| 5837 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 5838 | it is opened (by calling halOpen). |
| 5839 | \param pBKIDCache - caller allocated buffer point to an array of tBkidCacheInfo |
| 5840 | \param numItems - a variable that has the number of tBkidCacheInfo allocated |
| 5841 | when retruning, this is the number of items put into pBKIDCache |
| 5842 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 5843 | big enough and pNumItems has the number of tBkidCacheInfo. |
| 5844 | ---------------------------------------------------------------------------*/ |
| 5845 | eHalStatus sme_RoamSetBKIDCache( tHalHandle hHal, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache, |
| 5846 | tANI_U32 numItems ) |
| 5847 | { |
| 5848 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5849 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5850 | |
| 5851 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5852 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5853 | { |
| 5854 | status = csrRoamSetBKIDCache( pMac, sessionId, pBKIDCache, numItems ); |
| 5855 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5856 | } |
| 5857 | |
| 5858 | return (status); |
| 5859 | } |
| 5860 | |
| 5861 | /* --------------------------------------------------------------------------- |
| 5862 | \fn sme_RoamGetBKIDCache |
| 5863 | \brief The SME API exposed to HDD to allow HDD to request SME to return its |
| 5864 | BKID cache. |
| 5865 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 5866 | it is opened (by calling halOpen). |
| 5867 | \param pNum - caller allocated memory that has the space of the number of |
| 5868 | tBkidCacheInfo as input. Upon returned, *pNum has the needed number of entries |
| 5869 | in SME cache. |
| 5870 | \param pBkidCache - Caller allocated memory that contains BKID cache, if any, |
| 5871 | upon return |
| 5872 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 5873 | big enough. |
| 5874 | ---------------------------------------------------------------------------*/ |
| 5875 | eHalStatus sme_RoamGetBKIDCache(tHalHandle hHal, tANI_U32 *pNum, |
| 5876 | tBkidCacheInfo *pBkidCache) |
| 5877 | { |
| 5878 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5879 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5880 | |
| 5881 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5882 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5883 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5884 | smsLog(pMac, LOGE, FL(" !!!!!!!!!!!!!!!!!!SessionId is hardcoded")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5885 | status = csrRoamGetBKIDCache( pMac, 0, pNum, pBkidCache ); |
| 5886 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5887 | } |
| 5888 | |
| 5889 | return (status); |
| 5890 | } |
| 5891 | |
| 5892 | /* --------------------------------------------------------------------------- |
| 5893 | \fn sme_RoamGetNumBKIDCache |
| 5894 | \brief The SME API exposed to HDD to allow HDD to request SME to return the |
| 5895 | number of BKID cache entries. |
| 5896 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 5897 | it is opened (by calling halOpen). |
| 5898 | \return tANI_U32 - the number of BKID cache entries. |
| 5899 | ---------------------------------------------------------------------------*/ |
| 5900 | tANI_U32 sme_RoamGetNumBKIDCache(tHalHandle hHal, tANI_U32 sessionId) |
| 5901 | { |
| 5902 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5903 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5904 | tANI_U32 numBkidCache = 0; |
| 5905 | |
| 5906 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5907 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5908 | { |
| 5909 | numBkidCache = csrRoamGetNumBKIDCache( pMac, sessionId ); |
| 5910 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5911 | } |
| 5912 | |
| 5913 | return (numBkidCache); |
| 5914 | } |
| 5915 | |
| 5916 | /* --------------------------------------------------------------------------- |
| 5917 | \fn sme_ScanGetBKIDCandidateList |
| 5918 | \brief a wrapper function to return the BKID candidate list |
| 5919 | \param pBkidList - caller allocated buffer point to an array of |
| 5920 | tBkidCandidateInfo |
| 5921 | \param pNumItems - pointer to a variable that has the number of |
| 5922 | tBkidCandidateInfo allocated when retruning, this is |
| 5923 | either the number needed or number of items put into |
| 5924 | pPmkidList |
| 5925 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 5926 | big enough and pNumItems |
| 5927 | has the number of tBkidCandidateInfo. |
| 5928 | \Note: pNumItems is a number of tBkidCandidateInfo, |
| 5929 | not sizeof(tBkidCandidateInfo) * something |
| 5930 | ---------------------------------------------------------------------------*/ |
| 5931 | eHalStatus sme_ScanGetBKIDCandidateList(tHalHandle hHal, tANI_U32 sessionId, |
| 5932 | tBkidCandidateInfo *pBkidList, |
| 5933 | tANI_U32 *pNumItems ) |
| 5934 | { |
| 5935 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5936 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5937 | |
| 5938 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5939 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5940 | { |
| 5941 | status = csrScanGetBKIDCandidateList( pMac, sessionId, pBkidList, pNumItems ); |
| 5942 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5943 | } |
| 5944 | |
| 5945 | return (status); |
| 5946 | } |
| 5947 | #endif /* FEATURE_WLAN_WAPI */ |
| 5948 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5949 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 5950 | |
| 5951 | /***************************************************************************** |
| 5952 | OEM DATA related modifications and function additions |
| 5953 | *****************************************************************************/ |
| 5954 | |
| 5955 | /* --------------------------------------------------------------------------- |
| 5956 | \fn sme_getOemDataRsp |
| 5957 | \brief a wrapper function to obtain the OEM DATA RSP |
| 5958 | \param pOemDataRsp - A pointer to the response object |
| 5959 | \param pContext - a pointer passed in for the callback |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5960 | \return eHalStatus |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5961 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5962 | eHalStatus sme_getOemDataRsp(tHalHandle hHal, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5963 | tOemDataRsp **pOemDataRsp) |
| 5964 | { |
| 5965 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 5966 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 5967 | |
| 5968 | do |
| 5969 | { |
| 5970 | //acquire the lock for the sme object |
| 5971 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 5972 | |
| 5973 | if(!HAL_STATUS_SUCCESS(status)) |
| 5974 | { |
| 5975 | break; |
| 5976 | } |
| 5977 | |
| 5978 | if(pMac->oemData.pOemDataRsp != NULL) |
| 5979 | { |
| 5980 | *pOemDataRsp = pMac->oemData.pOemDataRsp; |
| 5981 | } |
| 5982 | else |
| 5983 | { |
| 5984 | status = eHAL_STATUS_FAILURE; |
| 5985 | } |
| 5986 | |
| 5987 | //release the lock for the sme object |
| 5988 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5989 | |
| 5990 | } while(0); |
| 5991 | |
| 5992 | return status; |
| 5993 | } |
| 5994 | |
| 5995 | /* --------------------------------------------------------------------------- |
| 5996 | \fn sme_OemDataReq |
| 5997 | \brief a wrapper function for OEM DATA REQ |
| 5998 | \param sessionId - session id to be used. |
| 5999 | \param pOemDataReqId - pointer to an object to get back the request ID |
| 6000 | \param callback - a callback function that is called upon finish |
| 6001 | \param pContext - a pointer passed in for the callback |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6002 | \return eHalStatus |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6003 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6004 | eHalStatus sme_OemDataReq(tHalHandle hHal, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6005 | tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6006 | tOemDataReqConfig *pOemDataReqConfig, |
| 6007 | tANI_U32 *pOemDataReqID, |
| 6008 | oemData_OemDataReqCompleteCallback callback, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6009 | void *pContext) |
| 6010 | { |
| 6011 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6012 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6013 | |
| 6014 | do |
| 6015 | { |
| 6016 | //acquire the lock for the sme object |
| 6017 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6018 | if(HAL_STATUS_SUCCESS(status)) |
| 6019 | { |
| 6020 | tANI_U32 lOemDataReqId = pMac->oemData.oemDataReqID++; //let it wrap around |
| 6021 | |
| 6022 | if(pOemDataReqID) |
| 6023 | { |
| 6024 | *pOemDataReqID = lOemDataReqId; |
| 6025 | } |
| 6026 | else |
Leela Venkata Kiran Kumar Reddy Chirala | 090cc1f | 2013-03-07 17:40:17 -0800 | [diff] [blame] | 6027 | { |
| 6028 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6029 | return eHAL_STATUS_FAILURE; |
| 6030 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6031 | |
| 6032 | status = oemData_OemDataReq(hHal, sessionId, pOemDataReqConfig, pOemDataReqID, callback, pContext); |
| 6033 | |
| 6034 | //release the lock for the sme object |
| 6035 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6036 | } |
| 6037 | } while(0); |
| 6038 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6039 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6040 | |
| 6041 | return(status); |
| 6042 | } |
| 6043 | |
| 6044 | #endif /*FEATURE_OEM_DATA_SUPPORT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6045 | |
| 6046 | /*-------------------------------------------------------------------------- |
| 6047 | |
| 6048 | \brief sme_OpenSession() - Open a session for scan/roam operation. |
| 6049 | |
| 6050 | This is a synchronous API. |
| 6051 | |
| 6052 | |
| 6053 | \param hHal - The handle returned by macOpen. |
| 6054 | \param callback - A pointer to the function caller specifies for roam/connect status indication |
| 6055 | \param pContext - The context passed with callback |
| 6056 | \param pSelfMacAddr - Caller allocated memory filled with self MAC address (6 bytes) |
| 6057 | \param pbSessionId - pointer to a caller allocated buffer for returned session ID |
| 6058 | |
| 6059 | \return eHAL_STATUS_SUCCESS - session is opened. sessionId returned. |
| 6060 | |
| 6061 | Other status means SME is failed to open the session. |
| 6062 | eHAL_STATUS_RESOURCES - no more session available. |
| 6063 | \sa |
| 6064 | |
| 6065 | --------------------------------------------------------------------------*/ |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 6066 | eHalStatus sme_OpenSession(tHalHandle hHal, csrRoamCompleteCallback callback, |
| 6067 | void *pContext, tANI_U8 *pSelfMacAddr, |
| 6068 | tANI_U8 *pbSessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6069 | { |
| 6070 | eHalStatus status; |
| 6071 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6072 | |
| 6073 | if( NULL == pbSessionId ) |
| 6074 | { |
| 6075 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 6076 | } |
| 6077 | else |
| 6078 | { |
| 6079 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6080 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6081 | { |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 6082 | status = csrRoamOpenSession(pMac, callback, pContext, |
| 6083 | pSelfMacAddr, pbSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6084 | |
| 6085 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6086 | } |
| 6087 | } |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6088 | if( NULL != pbSessionId ) |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6089 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6090 | TRACE_CODE_SME_RX_HDD_OPEN_SESSION,*pbSessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6091 | |
| 6092 | return ( status ); |
| 6093 | } |
| 6094 | |
| 6095 | |
| 6096 | /*-------------------------------------------------------------------------- |
| 6097 | |
| 6098 | \brief sme_CloseSession() - Open a session for scan/roam operation. |
| 6099 | |
| 6100 | This is a synchronous API. |
| 6101 | |
| 6102 | |
| 6103 | \param hHal - The handle returned by macOpen. |
| 6104 | |
| 6105 | \param sessionId - A previous opened session's ID. |
| 6106 | |
| 6107 | \return eHAL_STATUS_SUCCESS - session is closed. |
| 6108 | |
| 6109 | Other status means SME is failed to open the session. |
| 6110 | eHAL_STATUS_INVALID_PARAMETER - session is not opened. |
| 6111 | \sa |
| 6112 | |
| 6113 | --------------------------------------------------------------------------*/ |
| 6114 | eHalStatus sme_CloseSession(tHalHandle hHal, tANI_U8 sessionId, |
| 6115 | csrRoamSessionCloseCallback callback, void *pContext) |
| 6116 | { |
| 6117 | eHalStatus status; |
| 6118 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6119 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6120 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6121 | TRACE_CODE_SME_RX_HDD_CLOSE_SESSION, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6122 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6123 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6124 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6125 | status = csrRoamCloseSession( pMac, sessionId, FALSE, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6126 | callback, pContext ); |
| 6127 | |
| 6128 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6129 | } |
| 6130 | |
| 6131 | return ( status ); |
| 6132 | } |
| 6133 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6134 | /* --------------------------------------------------------------------------- |
| 6135 | |
| 6136 | \fn sme_RoamUpdateAPWPSIE |
| 6137 | |
| 6138 | \brief To update AP's WPS IE. This function should be called after SME AP session is created |
| 6139 | This is an asynchronous API. |
| 6140 | |
| 6141 | \param pAPWPSIES - pointer to a caller allocated object of tSirAPWPSIEs |
| 6142 | |
| 6143 | \return eHalStatus – SUCCESS – |
| 6144 | |
| 6145 | FAILURE or RESOURCES – The API finished and failed. |
| 6146 | |
| 6147 | -------------------------------------------------------------------------------*/ |
| 6148 | eHalStatus sme_RoamUpdateAPWPSIE(tHalHandle hHal, tANI_U8 sessionId, tSirAPWPSIEs *pAPWPSIES) |
| 6149 | { |
| 6150 | |
| 6151 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6152 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6153 | |
| 6154 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6155 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6156 | { |
| 6157 | |
| 6158 | status = csrRoamUpdateAPWPSIE( pMac, sessionId, pAPWPSIES ); |
| 6159 | |
| 6160 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6161 | } |
| 6162 | |
| 6163 | return (status); |
| 6164 | } |
| 6165 | /* --------------------------------------------------------------------------- |
| 6166 | |
| 6167 | \fn sme_RoamUpdateAPWPARSNIEs |
| 6168 | |
| 6169 | \brief To update AP's WPA/RSN IEs. This function should be called after SME AP session is created |
| 6170 | This is an asynchronous API. |
| 6171 | |
| 6172 | \param pAPSirRSNie - pointer to a caller allocated object of tSirRSNie with WPS/RSN IEs |
| 6173 | |
| 6174 | \return eHalStatus – SUCCESS – |
| 6175 | |
| 6176 | FAILURE or RESOURCES – The API finished and failed. |
| 6177 | |
| 6178 | -------------------------------------------------------------------------------*/ |
| 6179 | eHalStatus sme_RoamUpdateAPWPARSNIEs(tHalHandle hHal, tANI_U8 sessionId, tSirRSNie * pAPSirRSNie) |
| 6180 | { |
| 6181 | |
| 6182 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6183 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6184 | |
| 6185 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6186 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6187 | { |
| 6188 | |
| 6189 | status = csrRoamUpdateWPARSNIEs( pMac, sessionId, pAPSirRSNie); |
| 6190 | |
| 6191 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6192 | } |
| 6193 | |
| 6194 | return (status); |
| 6195 | } |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6196 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6197 | |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6198 | \fn sme_ChangeMCCBeaconInterval |
| 6199 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6200 | \brief To update P2P-GO beaconInterval. This function should be called after |
| 6201 | disassociating all the station is done |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6202 | This is an asynchronous API. |
| 6203 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6204 | \param |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6205 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6206 | \return eHalStatus SUCCESS |
| 6207 | FAILURE or RESOURCES |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 6208 | The API finished and failed. |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6209 | |
| 6210 | -------------------------------------------------------------------------------*/ |
| 6211 | eHalStatus sme_ChangeMCCBeaconInterval(tHalHandle hHal, tANI_U8 sessionId) |
| 6212 | { |
| 6213 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6214 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6215 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6216 | smsLog(pMac, LOG1, FL("Update Beacon PARAMS ")); |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6217 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6218 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6219 | { |
| 6220 | status = csrSendChngMCCBeaconInterval( pMac, sessionId); |
| 6221 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6222 | } |
| 6223 | return (status); |
| 6224 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6225 | |
| 6226 | /*-------------------------------------------------------------------------------* |
| 6227 | |
| 6228 | \fn sme_sendBTAmpEvent |
| 6229 | |
| 6230 | \brief to receive the coex priorty request from BT-AMP PAL |
| 6231 | and send the BT_AMP link state to HAL |
| 6232 | |
| 6233 | \param btAmpEvent - btAmpEvent |
| 6234 | |
Jeff Johnson | feddb2d | 2012-12-10 14:41:22 -0800 | [diff] [blame] | 6235 | \return eHalStatus: SUCCESS : BTAmp event successfully sent to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6236 | |
| 6237 | FAILURE: API failed |
| 6238 | |
| 6239 | -------------------------------------------------------------------------------*/ |
| 6240 | |
| 6241 | eHalStatus sme_sendBTAmpEvent(tHalHandle hHal, tSmeBtAmpEvent btAmpEvent) |
| 6242 | { |
| 6243 | vos_msg_t msg; |
| 6244 | tpSmeBtAmpEvent ptrSmeBtAmpEvent = NULL; |
| 6245 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6246 | |
Leela Venkata Kiran Kumar Reddy Chirala | f7ea543 | 2013-11-15 11:03:04 -0800 | [diff] [blame] | 6247 | ptrSmeBtAmpEvent = vos_mem_malloc(sizeof(tSmeBtAmpEvent)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6248 | if (NULL == ptrSmeBtAmpEvent) |
| 6249 | { |
| 6250 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6251 | "Not able to allocate memory for BTAmp event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6252 | return status; |
| 6253 | } |
| 6254 | |
| 6255 | vos_mem_copy(ptrSmeBtAmpEvent, (void*)&btAmpEvent, sizeof(tSmeBtAmpEvent)); |
| 6256 | msg.type = WDA_SIGNAL_BTAMP_EVENT; |
| 6257 | msg.reserved = 0; |
| 6258 | msg.bodyptr = ptrSmeBtAmpEvent; |
| 6259 | |
| 6260 | //status = halFW_SendBTAmpEventMesg(pMac, event); |
| 6261 | |
| 6262 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 6263 | { |
| 6264 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6265 | "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] | 6266 | vos_mem_free(ptrSmeBtAmpEvent); |
| 6267 | return status; |
| 6268 | } |
| 6269 | |
| 6270 | return eHAL_STATUS_SUCCESS; |
| 6271 | |
| 6272 | } |
| 6273 | |
| 6274 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6275 | \fn smeIssueFastRoamNeighborAPEvent |
| 6276 | \brief API to trigger fast BSS roam independent of RSSI triggers |
| 6277 | \param hHal - The handle returned by macOpen. |
| 6278 | \param bssid - Pointer to the BSSID to roam to. |
| 6279 | \param fastRoamTrig - Trigger to Scan or roam |
| 6280 | \return eHalStatus |
| 6281 | ---------------------------------------------------------------------------*/ |
| 6282 | eHalStatus smeIssueFastRoamNeighborAPEvent (tHalHandle hHal, |
| 6283 | tANI_U8 *bssid, |
| 6284 | tSmeFastRoamTrigger fastRoamTrig) |
| 6285 | { |
| 6286 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6287 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 6288 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 6289 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6290 | |
| 6291 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6292 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6293 | { |
| 6294 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 6295 | "%s: invoked", __func__); |
| 6296 | |
| 6297 | if (eSME_ROAM_TRIGGER_SCAN == fastRoamTrig) |
| 6298 | { |
| 6299 | smsLog(pMac, LOG1, FL("CFG Channel list scan... ")); |
| 6300 | pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_SCAN; |
| 6301 | vos_mem_copy((void *)(&pNeighborRoamInfo->cfgRoambssId), |
| 6302 | (void *)bssid, sizeof(tSirMacAddr)); |
Arif Hussain | a7c8e41 | 2013-11-20 11:06:42 -0800 | [diff] [blame] | 6303 | smsLog(pMac, LOG1, "Calling Roam Look Up down Event BSSID " |
| 6304 | MAC_ADDRESS_STR, MAC_ADDR_ARRAY(pNeighborRoamInfo->cfgRoambssId)); |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6305 | |
| 6306 | vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac); |
| 6307 | if (VOS_STATUS_SUCCESS != vosStatus) |
| 6308 | { |
| 6309 | smsLog(pMac, LOGE, |
| 6310 | FL("CFG Channel list scan state failed with status %d "), |
| 6311 | vosStatus); |
| 6312 | } |
| 6313 | } |
| 6314 | else if (eSME_ROAM_TRIGGER_FAST_ROAM == fastRoamTrig) |
| 6315 | { |
| 6316 | vos_mem_copy((void *)(&pNeighborRoamInfo->cfgRoambssId), |
| 6317 | (void *)bssid, sizeof(tSirMacAddr)); |
| 6318 | pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_FAST_ROAM; |
Arif Hussain | a7c8e41 | 2013-11-20 11:06:42 -0800 | [diff] [blame] | 6319 | smsLog(pMac, LOG1, "Roam to BSSID "MAC_ADDRESS_STR, |
| 6320 | MAC_ADDR_ARRAY(pNeighborRoamInfo->cfgRoambssId)); |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6321 | |
| 6322 | vosStatus = csrNeighborRoamReassocIndCallback(pMac->roam.gVosContext, |
| 6323 | 0, |
| 6324 | pMac, |
| 6325 | 0); |
| 6326 | |
| 6327 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 6328 | { |
| 6329 | smsLog(pMac, |
| 6330 | LOGE, |
| 6331 | FL(" Call to csrNeighborRoamReassocIndCallback failed, status = %d"), |
| 6332 | vosStatus); |
| 6333 | } |
| 6334 | } |
| 6335 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6336 | } |
| 6337 | return vosStatus; |
| 6338 | } |
| 6339 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6340 | \fn sme_SetHostOffload |
| 6341 | \brief API to set the host offload feature. |
| 6342 | \param hHal - The handle returned by macOpen. |
| 6343 | \param pRequest - Pointer to the offload request. |
| 6344 | \return eHalStatus |
| 6345 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6346 | eHalStatus sme_SetHostOffload (tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6347 | tpSirHostOffloadReq pRequest) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6348 | { |
| 6349 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6350 | eHalStatus status = eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6351 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6352 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6353 | TRACE_CODE_SME_RX_HDD_SET_HOSTOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6354 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6355 | { |
| 6356 | #ifdef WLAN_NS_OFFLOAD |
| 6357 | if(SIR_IPV6_NS_OFFLOAD == pRequest->offloadType) |
| 6358 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6359 | status = pmcSetNSOffload( hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6360 | } |
| 6361 | else |
| 6362 | #endif //WLAN_NS_OFFLOAD |
| 6363 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6364 | status = pmcSetHostOffload (hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6365 | } |
| 6366 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6367 | } |
| 6368 | |
| 6369 | return (status); |
| 6370 | } |
| 6371 | |
| 6372 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 6373 | /* --------------------------------------------------------------------------- |
| 6374 | \fn sme_SetGTKOffload |
| 6375 | \brief API to set GTK offload information. |
| 6376 | \param hHal - The handle returned by macOpen. |
| 6377 | \param pRequest - Pointer to the GTK offload request. |
| 6378 | \return eHalStatus |
| 6379 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6380 | eHalStatus sme_SetGTKOffload (tHalHandle hHal, tpSirGtkOffloadParams pRequest, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6381 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6382 | { |
| 6383 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6384 | eHalStatus status; |
| 6385 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6386 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6387 | TRACE_CODE_SME_RX_HDD_SET_GTKOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6388 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6389 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6390 | status = pmcSetGTKOffload( hHal, pRequest, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6391 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6392 | } |
| 6393 | |
| 6394 | return (status); |
| 6395 | } |
| 6396 | |
| 6397 | /* --------------------------------------------------------------------------- |
| 6398 | \fn sme_GetGTKOffload |
| 6399 | \brief API to get GTK offload information. |
| 6400 | \param hHal - The handle returned by macOpen. |
| 6401 | \param pRequest - Pointer to the GTK offload response. |
| 6402 | \return eHalStatus |
| 6403 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6404 | eHalStatus sme_GetGTKOffload (tHalHandle hHal, GTKOffloadGetInfoCallback callbackRoutine, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6405 | void *callbackContext, tANI_U8 sessionId ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6406 | { |
| 6407 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6408 | eHalStatus status; |
| 6409 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6410 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6411 | TRACE_CODE_SME_RX_HDD_GET_GTKOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6412 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6413 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6414 | pmcGetGTKOffload(hHal, callbackRoutine, callbackContext, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6415 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6416 | } |
| 6417 | |
| 6418 | return (status); |
| 6419 | } |
| 6420 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 6421 | |
| 6422 | /* --------------------------------------------------------------------------- |
| 6423 | \fn sme_SetKeepAlive |
| 6424 | \brief API to set the Keep Alive feature. |
| 6425 | \param hHal - The handle returned by macOpen. |
| 6426 | \param pRequest - Pointer to the Keep Alive request. |
| 6427 | \return eHalStatus |
| 6428 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6429 | eHalStatus sme_SetKeepAlive (tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6430 | tpSirKeepAliveReq pRequest) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6431 | { |
| 6432 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6433 | eHalStatus status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6434 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6435 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6436 | status = pmcSetKeepAlive (hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6437 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6438 | } |
| 6439 | |
| 6440 | return (status); |
| 6441 | } |
| 6442 | |
| 6443 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 6444 | /* --------------------------------------------------------------------------- |
| 6445 | \fn sme_SetPreferredNetworkList |
| 6446 | \brief API to set the Preferred Network List Offload feature. |
| 6447 | \param hHal - The handle returned by macOpen. |
| 6448 | \param pRequest - Pointer to the offload request. |
| 6449 | \return eHalStatus |
| 6450 | ---------------------------------------------------------------------------*/ |
| 6451 | eHalStatus sme_SetPreferredNetworkList (tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, void (*callbackRoutine) (void *callbackContext, tSirPrefNetworkFoundInd *pPrefNetworkFoundInd), void *callbackContext ) |
| 6452 | { |
| 6453 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6454 | eHalStatus status; |
| 6455 | |
| 6456 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6457 | { |
| 6458 | pmcSetPreferredNetworkList(hHal, pRequest, sessionId, callbackRoutine, callbackContext); |
| 6459 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6460 | } |
| 6461 | |
| 6462 | return (status); |
| 6463 | } |
| 6464 | |
| 6465 | eHalStatus sme_SetRSSIFilter(tHalHandle hHal, v_U8_t rssiThreshold) |
| 6466 | { |
| 6467 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6468 | eHalStatus status; |
| 6469 | |
| 6470 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6471 | { |
| 6472 | pmcSetRssiFilter(hHal, rssiThreshold); |
| 6473 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6474 | } |
| 6475 | |
| 6476 | return (status); |
| 6477 | } |
| 6478 | |
| 6479 | #endif // FEATURE_WLAN_SCAN_PNO |
| 6480 | |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 6481 | eHalStatus sme_SetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams, tANI_BOOLEAN forced) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6482 | { |
| 6483 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6484 | eHalStatus status; |
| 6485 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6486 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6487 | TRACE_CODE_SME_RX_HDD_SET_POWERPARAMS, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6488 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6489 | { |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 6490 | pmcSetPowerParams(hHal, pwParams, forced); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6491 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6492 | } |
| 6493 | |
| 6494 | return (status); |
| 6495 | } |
| 6496 | |
| 6497 | /* --------------------------------------------------------------------------- |
| 6498 | \fn sme_AbortMacScan |
| 6499 | \brief API to cancel MAC scan. |
| 6500 | \param hHal - The handle returned by macOpen. |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 6501 | \param sessionId - sessionId on which we need to abort scan. |
Srinivas, Dasari | 138af4f | 2014-02-07 11:13:45 +0530 | [diff] [blame] | 6502 | \param reason - Reason to abort the scan. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6503 | \return VOS_STATUS |
| 6504 | VOS_STATUS_E_FAILURE - failure |
| 6505 | VOS_STATUS_SUCCESS success |
| 6506 | ---------------------------------------------------------------------------*/ |
Srinivas, Dasari | 138af4f | 2014-02-07 11:13:45 +0530 | [diff] [blame] | 6507 | eHalStatus sme_AbortMacScan(tHalHandle hHal, tANI_U8 sessionId, |
| 6508 | eCsrAbortReason reason) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6509 | { |
| 6510 | eHalStatus status; |
| 6511 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6512 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6513 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6514 | TRACE_CODE_SME_RX_HDD_ABORT_MACSCAN, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6515 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6516 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6517 | { |
Srinivas, Dasari | 138af4f | 2014-02-07 11:13:45 +0530 | [diff] [blame] | 6518 | status = csrScanAbortMacScan(pMac, sessionId, reason); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6519 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6520 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6521 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6522 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6523 | return ( status ); |
| 6524 | } |
| 6525 | |
| 6526 | /* ---------------------------------------------------------------------------- |
| 6527 | \fn sme_GetOperationChannel |
| 6528 | \brief API to get current channel on which STA is parked |
| 6529 | this function gives channel information only of infra station or IBSS station |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6530 | \param hHal, pointer to memory location and sessionId |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6531 | \returns eHAL_STATUS_SUCCESS |
| 6532 | eHAL_STATUS_FAILURE |
| 6533 | -------------------------------------------------------------------------------*/ |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6534 | eHalStatus sme_GetOperationChannel(tHalHandle hHal, tANI_U32 *pChannel, tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6535 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6536 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6537 | tCsrRoamSession *pSession; |
| 6538 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6539 | if (CSR_IS_SESSION_VALID( pMac, sessionId )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6540 | { |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6541 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6542 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6543 | if(( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_INFRASTRUCTURE ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6544 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_IBSS ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6545 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_INFRA_AP ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6546 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_START_IBSS )) |
| 6547 | { |
| 6548 | *pChannel =pSession->connectedProfile.operationChannel; |
| 6549 | return eHAL_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6550 | } |
| 6551 | } |
| 6552 | return eHAL_STATUS_FAILURE; |
| 6553 | }// sme_GetOperationChannel ends here |
| 6554 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6555 | /* --------------------------------------------------------------------------- |
| 6556 | |
| 6557 | \fn sme_RegisterMgtFrame |
| 6558 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6559 | \brief To register managment frame of specified type and subtype. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6560 | \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] | 6561 | \param matchData - data which needs to be matched before passing frame |
| 6562 | to HDD. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6563 | \param matchDataLen - Length of matched data. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6564 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6565 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6566 | eHalStatus sme_RegisterMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6567 | tANI_U16 frameType, tANI_U8* matchData, tANI_U16 matchLen) |
| 6568 | { |
| 6569 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6570 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6571 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6572 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6573 | TRACE_CODE_SME_RX_HDD_REGISTER_MGMTFR, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6574 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6575 | { |
| 6576 | tSirRegisterMgmtFrame *pMsg; |
| 6577 | tANI_U16 len; |
| 6578 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 6579 | |
| 6580 | if(!pSession) |
| 6581 | { |
| 6582 | 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] | 6583 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 6584 | return eHAL_STATUS_FAILURE; |
| 6585 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6586 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6587 | if( !pSession->sessionActive ) |
| 6588 | { |
| 6589 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6590 | "%s Invalid Sessionid", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6591 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6592 | return eHAL_STATUS_FAILURE; |
| 6593 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6594 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6595 | len = sizeof(tSirRegisterMgmtFrame) + matchLen; |
| 6596 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6597 | pMsg = vos_mem_malloc(len); |
| 6598 | if ( NULL == pMsg ) |
| 6599 | status = eHAL_STATUS_FAILURE; |
| 6600 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6601 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6602 | vos_mem_set(pMsg, len, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6603 | pMsg->messageType = eWNI_SME_REGISTER_MGMT_FRAME_REQ; |
| 6604 | pMsg->length = len; |
| 6605 | pMsg->sessionId = sessionId; |
| 6606 | pMsg->registerFrame = VOS_TRUE; |
| 6607 | pMsg->frameType = frameType; |
| 6608 | pMsg->matchLen = matchLen; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6609 | vos_mem_copy(pMsg->matchData, matchData, matchLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6610 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 6611 | } |
| 6612 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6613 | } |
| 6614 | return status; |
| 6615 | } |
| 6616 | |
| 6617 | /* --------------------------------------------------------------------------- |
| 6618 | |
| 6619 | \fn sme_DeregisterMgtFrame |
| 6620 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6621 | \brief To De-register managment frame of specified type and subtype. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6622 | \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] | 6623 | \param matchData - data which needs to be matched before passing frame |
| 6624 | to HDD. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6625 | \param matchDataLen - Length of matched data. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6626 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6627 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6628 | eHalStatus sme_DeregisterMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6629 | tANI_U16 frameType, tANI_U8* matchData, tANI_U16 matchLen) |
| 6630 | { |
| 6631 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6632 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6633 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6634 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6635 | TRACE_CODE_SME_RX_HDD_DEREGISTER_MGMTFR, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6636 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6637 | { |
| 6638 | tSirRegisterMgmtFrame *pMsg; |
| 6639 | tANI_U16 len; |
| 6640 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 6641 | |
| 6642 | if(!pSession) |
| 6643 | { |
| 6644 | 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] | 6645 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 6646 | return eHAL_STATUS_FAILURE; |
| 6647 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6648 | |
| 6649 | if( !pSession->sessionActive ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6650 | { |
| 6651 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6652 | "%s Invalid Sessionid", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6653 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6654 | return eHAL_STATUS_FAILURE; |
| 6655 | } |
| 6656 | |
| 6657 | len = sizeof(tSirRegisterMgmtFrame) + matchLen; |
| 6658 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6659 | pMsg = vos_mem_malloc(len); |
| 6660 | if ( NULL == pMsg ) |
| 6661 | status = eHAL_STATUS_FAILURE; |
| 6662 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6663 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6664 | vos_mem_set(pMsg, len, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6665 | pMsg->messageType = eWNI_SME_REGISTER_MGMT_FRAME_REQ; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6666 | pMsg->length = len; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6667 | pMsg->registerFrame = VOS_FALSE; |
| 6668 | pMsg->frameType = frameType; |
| 6669 | pMsg->matchLen = matchLen; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6670 | vos_mem_copy(pMsg->matchData, matchData, matchLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6671 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 6672 | } |
| 6673 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6674 | } |
| 6675 | return status; |
| 6676 | } |
| 6677 | |
| 6678 | /* --------------------------------------------------------------------------- |
| 6679 | \fn sme_RemainOnChannel |
| 6680 | \brief API to request remain on channel for 'x' duration. used in p2p in listen state |
| 6681 | \param hHal - The handle returned by macOpen. |
| 6682 | \param pRequest - channel |
| 6683 | \param duration - duration in ms |
| 6684 | \param callback - HDD registered callback to process reaminOnChannelRsp |
| 6685 | \param context - HDD Callback param |
| 6686 | \return eHalStatus |
| 6687 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6688 | eHalStatus sme_RemainOnChannel(tHalHandle hHal, tANI_U8 sessionId, |
| 6689 | tANI_U8 channel, tANI_U32 duration, |
Gopichand Nakkala | 924e455 | 2013-05-08 19:18:14 +0530 | [diff] [blame] | 6690 | remainOnChanCallback callback, |
| 6691 | void *pContext, |
| 6692 | tANI_U8 isP2PProbeReqAllowed) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6693 | { |
| 6694 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6695 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6696 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6697 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6698 | TRACE_CODE_SME_RX_HDD_REMAIN_ONCHAN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6699 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6700 | { |
Gopichand Nakkala | 924e455 | 2013-05-08 19:18:14 +0530 | [diff] [blame] | 6701 | status = p2pRemainOnChannel (hHal, sessionId, channel, duration, callback, pContext, |
| 6702 | isP2PProbeReqAllowed |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6703 | #ifdef WLAN_FEATURE_P2P_INTERNAL |
| 6704 | , eP2PRemainOnChnReasonUnknown |
| 6705 | #endif |
| 6706 | ); |
| 6707 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6708 | } |
| 6709 | return(status); |
| 6710 | } |
| 6711 | |
| 6712 | /* --------------------------------------------------------------------------- |
| 6713 | \fn sme_ReportProbeReq |
| 6714 | \brief API to enable/disable forwarding of probeReq to apps in p2p. |
| 6715 | \param hHal - The handle returned by macOpen. |
| 6716 | \param falg: to set the Probe request forarding to wpa_supplicant in listen state in p2p |
| 6717 | \return eHalStatus |
| 6718 | ---------------------------------------------------------------------------*/ |
| 6719 | |
| 6720 | #ifndef WLAN_FEATURE_CONCURRENT_P2P |
| 6721 | eHalStatus sme_ReportProbeReq(tHalHandle hHal, tANI_U8 flag) |
| 6722 | { |
| 6723 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6724 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6725 | |
| 6726 | do |
| 6727 | { |
| 6728 | //acquire the lock for the sme object |
| 6729 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6730 | if(HAL_STATUS_SUCCESS(status)) |
| 6731 | { |
| 6732 | /* call set in context */ |
| 6733 | pMac->p2pContext.probeReqForwarding = flag; |
| 6734 | //release the lock for the sme object |
| 6735 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6736 | } |
| 6737 | } while(0); |
| 6738 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6739 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6740 | |
| 6741 | return(status); |
| 6742 | } |
| 6743 | |
| 6744 | /* --------------------------------------------------------------------------- |
| 6745 | \fn sme_updateP2pIe |
| 6746 | \brief API to set the P2p Ie in p2p context |
| 6747 | \param hHal - The handle returned by macOpen. |
| 6748 | \param p2pIe - Ptr to p2pIe from HDD. |
| 6749 | \param p2pIeLength: length of p2pIe |
| 6750 | \return eHalStatus |
| 6751 | ---------------------------------------------------------------------------*/ |
| 6752 | |
| 6753 | eHalStatus sme_updateP2pIe(tHalHandle hHal, void *p2pIe, tANI_U32 p2pIeLength) |
| 6754 | { |
| 6755 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6756 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6757 | |
| 6758 | //acquire the lock for the sme object |
| 6759 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6760 | if(HAL_STATUS_SUCCESS(status)) |
| 6761 | { |
| 6762 | if(NULL != pMac->p2pContext.probeRspIe){ |
| 6763 | vos_mem_free(pMac->p2pContext.probeRspIe); |
| 6764 | pMac->p2pContext.probeRspIeLength = 0; |
| 6765 | } |
| 6766 | |
| 6767 | pMac->p2pContext.probeRspIe = vos_mem_malloc(p2pIeLength); |
| 6768 | if (NULL == pMac->p2pContext.probeRspIe) |
| 6769 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6770 | smsLog(pMac, LOGE, "%s: Unable to allocate P2P IE", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6771 | pMac->p2pContext.probeRspIeLength = 0; |
| 6772 | status = eHAL_STATUS_FAILURE; |
| 6773 | } |
| 6774 | else |
| 6775 | { |
| 6776 | pMac->p2pContext.probeRspIeLength = p2pIeLength; |
| 6777 | |
| 6778 | sirDumpBuf( pMac, SIR_LIM_MODULE_ID, LOG2, |
| 6779 | pMac->p2pContext.probeRspIe, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6780 | pMac->p2pContext.probeRspIeLength ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6781 | vos_mem_copy((tANI_U8 *)pMac->p2pContext.probeRspIe, p2pIe, |
| 6782 | p2pIeLength); |
| 6783 | } |
| 6784 | |
| 6785 | //release the lock for the sme object |
| 6786 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6787 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6788 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6789 | smsLog(pMac, LOG2, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6790 | |
| 6791 | return(status); |
| 6792 | } |
| 6793 | #endif |
| 6794 | |
| 6795 | /* --------------------------------------------------------------------------- |
| 6796 | \fn sme_sendAction |
| 6797 | \brief API to send action frame from supplicant. |
| 6798 | \param hHal - The handle returned by macOpen. |
| 6799 | \return eHalStatus |
| 6800 | ---------------------------------------------------------------------------*/ |
| 6801 | |
| 6802 | eHalStatus sme_sendAction(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6803 | const tANI_U8 *pBuf, tANI_U32 len, |
| 6804 | tANI_U16 wait, tANI_BOOLEAN noack) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6805 | { |
| 6806 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6807 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6808 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6809 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6810 | TRACE_CODE_SME_RX_HDD_SEND_ACTION, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6811 | //acquire the lock for the sme object |
| 6812 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6813 | if(HAL_STATUS_SUCCESS(status)) |
| 6814 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6815 | p2pSendAction(hHal, sessionId, pBuf, len, wait, noack); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6816 | //release the lock for the sme object |
| 6817 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6818 | } |
| 6819 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6820 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6821 | |
| 6822 | return(status); |
| 6823 | } |
| 6824 | |
| 6825 | eHalStatus sme_CancelRemainOnChannel(tHalHandle hHal, tANI_U8 sessionId ) |
| 6826 | { |
| 6827 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6828 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6829 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6830 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6831 | TRACE_CODE_SME_RX_HDD_CANCEL_REMAIN_ONCHAN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6832 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6833 | { |
| 6834 | status = p2pCancelRemainOnChannel (hHal, sessionId); |
| 6835 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6836 | } |
| 6837 | return(status); |
| 6838 | } |
| 6839 | |
| 6840 | //Power Save Related |
| 6841 | eHalStatus sme_p2pSetPs(tHalHandle hHal, tP2pPsConfig * data) |
| 6842 | { |
| 6843 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6844 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6845 | |
| 6846 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6847 | { |
| 6848 | status = p2pSetPs (hHal, data); |
| 6849 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6850 | } |
| 6851 | return(status); |
| 6852 | } |
| 6853 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6854 | |
| 6855 | /* --------------------------------------------------------------------------- |
| 6856 | |
| 6857 | \fn sme_ConfigureRxpFilter |
| 6858 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6859 | \brief |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6860 | SME will pass this request to lower mac to set/reset the filter on RXP for |
| 6861 | multicast & broadcast traffic. |
| 6862 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6863 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6864 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6865 | hHal - The handle returned by macOpen. |
| 6866 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6867 | filterMask- Currently the API takes a 1 or 0 (set or reset) as filter. |
| 6868 | Basically to enable/disable the filter (to filter "all" mcbc traffic) based |
| 6869 | on this param. In future we can use this as a mask to set various types of |
| 6870 | filters as suggested below: |
| 6871 | FILTER_ALL_MULTICAST: |
| 6872 | FILTER_ALL_BROADCAST: |
| 6873 | FILTER_ALL_MULTICAST_BROADCAST: |
| 6874 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6875 | |
| 6876 | \return eHalStatus |
| 6877 | |
| 6878 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6879 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6880 | eHalStatus sme_ConfigureRxpFilter( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6881 | tpSirWlanSetRxpFilters wlanRxpFilterParam) |
| 6882 | { |
| 6883 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6884 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 6885 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6886 | vos_msg_t vosMessage; |
| 6887 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6888 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6889 | TRACE_CODE_SME_RX_HDD_CONFIG_RXPFIL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6890 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6891 | { |
| 6892 | /* serialize the req through MC thread */ |
| 6893 | vosMessage.bodyptr = wlanRxpFilterParam; |
| 6894 | vosMessage.type = WDA_CFG_RXP_FILTER_REQ; |
| 6895 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 6896 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 6897 | { |
| 6898 | status = eHAL_STATUS_FAILURE; |
| 6899 | } |
| 6900 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6901 | } |
| 6902 | return(status); |
| 6903 | } |
| 6904 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6905 | /* --------------------------------------------------------------------------- |
| 6906 | |
| 6907 | \fn sme_ConfigureSuspendInd |
| 6908 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6909 | \brief |
| 6910 | 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] | 6911 | be suspended |
| 6912 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6913 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6914 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6915 | hHal - The handle returned by macOpen. |
| 6916 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6917 | wlanSuspendParam- Depicts the wlan suspend params |
| 6918 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6919 | |
| 6920 | \return eHalStatus |
| 6921 | |
| 6922 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6923 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6924 | eHalStatus sme_ConfigureSuspendInd( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6925 | tpSirWlanSuspendParam wlanSuspendParam) |
| 6926 | { |
| 6927 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6928 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 6929 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6930 | vos_msg_t vosMessage; |
| 6931 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6932 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6933 | TRACE_CODE_SME_RX_HDD_CONFIG_SUSPENDIND, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6934 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6935 | { |
| 6936 | /* serialize the req through MC thread */ |
| 6937 | vosMessage.bodyptr = wlanSuspendParam; |
| 6938 | vosMessage.type = WDA_WLAN_SUSPEND_IND; |
| 6939 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 6940 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 6941 | { |
| 6942 | status = eHAL_STATUS_FAILURE; |
| 6943 | } |
| 6944 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6945 | } |
| 6946 | return(status); |
| 6947 | } |
| 6948 | |
| 6949 | /* --------------------------------------------------------------------------- |
| 6950 | |
| 6951 | \fn sme_ConfigureResumeReq |
| 6952 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6953 | \brief |
| 6954 | 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] | 6955 | be Resumed |
| 6956 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6957 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6958 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6959 | hHal - The handle returned by macOpen. |
| 6960 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6961 | wlanResumeParam- Depicts the wlan resume params |
| 6962 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6963 | |
| 6964 | \return eHalStatus |
| 6965 | |
| 6966 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6967 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6968 | eHalStatus sme_ConfigureResumeReq( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6969 | tpSirWlanResumeParam wlanResumeParam) |
| 6970 | { |
| 6971 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6972 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 6973 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6974 | vos_msg_t vosMessage; |
| 6975 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6976 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6977 | TRACE_CODE_SME_RX_HDD_CONFIG_RESUMEREQ, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6978 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6979 | { |
| 6980 | /* serialize the req through MC thread */ |
| 6981 | vosMessage.bodyptr = wlanResumeParam; |
| 6982 | vosMessage.type = WDA_WLAN_RESUME_REQ; |
| 6983 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 6984 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 6985 | { |
| 6986 | status = eHAL_STATUS_FAILURE; |
| 6987 | } |
| 6988 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6989 | } |
| 6990 | return(status); |
| 6991 | } |
| 6992 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6993 | /* --------------------------------------------------------------------------- |
| 6994 | |
| 6995 | \fn sme_GetInfraSessionId |
| 6996 | |
| 6997 | \brief To get the session ID for infra session, if connected |
| 6998 | This is a synchronous API. |
| 6999 | |
| 7000 | \param hHal - The handle returned by macOpen. |
| 7001 | |
| 7002 | \return sessionid, -1 if infra session is not connected |
| 7003 | |
| 7004 | -------------------------------------------------------------------------------*/ |
| 7005 | tANI_S8 sme_GetInfraSessionId(tHalHandle hHal) |
| 7006 | { |
| 7007 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7008 | tANI_S8 sessionid = -1; |
| 7009 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7010 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7011 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7012 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7013 | { |
| 7014 | |
| 7015 | sessionid = csrGetInfraSessionId( pMac); |
| 7016 | |
| 7017 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7018 | } |
| 7019 | |
| 7020 | return (sessionid); |
| 7021 | } |
| 7022 | |
| 7023 | /* --------------------------------------------------------------------------- |
| 7024 | |
| 7025 | \fn sme_GetInfraOperationChannel |
| 7026 | |
| 7027 | \brief To get the operating channel for infra session, if connected |
| 7028 | This is a synchronous API. |
| 7029 | |
| 7030 | \param hHal - The handle returned by macOpen. |
| 7031 | \param sessionId - the sessionId returned by sme_OpenSession. |
| 7032 | |
| 7033 | \return operating channel, 0 if infra session is not connected |
| 7034 | |
| 7035 | -------------------------------------------------------------------------------*/ |
| 7036 | tANI_U8 sme_GetInfraOperationChannel( tHalHandle hHal, tANI_U8 sessionId) |
| 7037 | { |
| 7038 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7039 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7040 | tANI_U8 channel = 0; |
| 7041 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7042 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7043 | { |
| 7044 | |
| 7045 | channel = csrGetInfraOperationChannel( pMac, sessionId); |
| 7046 | |
| 7047 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7048 | } |
| 7049 | |
| 7050 | return (channel); |
| 7051 | } |
| 7052 | |
| 7053 | //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] | 7054 | //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] | 7055 | tANI_U8 sme_GetConcurrentOperationChannel( tHalHandle hHal ) |
| 7056 | { |
| 7057 | eHalStatus status = eHAL_STATUS_FAILURE; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7058 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7059 | tANI_U8 channel = 0; |
| 7060 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7061 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7062 | { |
| 7063 | |
| 7064 | channel = csrGetConcurrentOperationChannel( pMac ); |
| 7065 | 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] | 7066 | " Other Concurrent Channel = %d", __func__,channel); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7067 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7068 | } |
| 7069 | |
| 7070 | return (channel); |
| 7071 | } |
| 7072 | |
| 7073 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 7074 | /****************************************************************************** |
| 7075 | * |
| 7076 | * Name: sme_PreferredNetworkFoundInd |
| 7077 | * |
| 7078 | * Description: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7079 | * Invoke Preferred Network Found Indication |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7080 | * |
| 7081 | * Parameters: |
| 7082 | * hHal - HAL handle for device |
| 7083 | * pMsg - found network description |
| 7084 | * |
| 7085 | * Returns: eHalStatus |
| 7086 | * |
| 7087 | ******************************************************************************/ |
| 7088 | eHalStatus sme_PreferredNetworkFoundInd (tHalHandle hHal, void* pMsg) |
| 7089 | { |
| 7090 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7091 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7092 | tSirPrefNetworkFoundInd *pPrefNetworkFoundInd = (tSirPrefNetworkFoundInd *)pMsg; |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7093 | v_U8_t dumpSsId[SIR_MAC_MAX_SSID_LENGTH + 1]; |
| 7094 | tANI_U8 ssIdLength = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7095 | |
| 7096 | if (NULL == pMsg) |
| 7097 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7098 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7099 | status = eHAL_STATUS_FAILURE; |
| 7100 | } |
| 7101 | else |
| 7102 | { |
| 7103 | if (pPrefNetworkFoundInd->ssId.length > 0) |
| 7104 | { |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7105 | ssIdLength = CSR_MIN(SIR_MAC_MAX_SSID_LENGTH, |
| 7106 | pPrefNetworkFoundInd->ssId.length); |
| 7107 | vos_mem_copy(dumpSsId, pPrefNetworkFoundInd->ssId.ssId, ssIdLength); |
| 7108 | dumpSsId[ssIdLength] = 0; |
| 7109 | smsLog(pMac, LOG2, "%s:SSID=%s frame length %d", |
| 7110 | __func__, dumpSsId, pPrefNetworkFoundInd->frameLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7111 | |
Vinay Krishna Eranna | b13043b | 2013-12-06 11:50:21 +0530 | [diff] [blame] | 7112 | /* Flush scan results, So as to avoid indication/updation of |
| 7113 | * stale entries, which may not have aged out during APPS collapse |
| 7114 | */ |
| 7115 | sme_ScanFlushResult(hHal,0); |
| 7116 | |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7117 | //Save the frame to scan result |
| 7118 | if (pPrefNetworkFoundInd->mesgLen > sizeof(tSirPrefNetworkFoundInd)) |
| 7119 | { |
| 7120 | //we may have a frame |
| 7121 | status = csrScanSavePreferredNetworkFound(pMac, |
| 7122 | pPrefNetworkFoundInd); |
| 7123 | if (!HAL_STATUS_SUCCESS(status)) |
| 7124 | { |
| 7125 | smsLog(pMac, LOGE, FL(" fail to save preferred network")); |
| 7126 | } |
| 7127 | } |
| 7128 | else |
| 7129 | { |
Jeff Johnson | afeb958 | 2013-11-22 18:39:00 -0800 | [diff] [blame] | 7130 | smsLog(pMac, LOGE, FL(" not enough data length %u needed %zu"), |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7131 | pPrefNetworkFoundInd->mesgLen, sizeof(tSirPrefNetworkFoundInd)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7132 | } |
| 7133 | |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7134 | /* Call Preferred Netowrk Found Indication callback routine. */ |
| 7135 | if (HAL_STATUS_SUCCESS(status) && (pMac->pmc.prefNetwFoundCB != NULL)) |
| 7136 | { |
| 7137 | pMac->pmc.prefNetwFoundCB( |
| 7138 | pMac->pmc.preferredNetworkFoundIndCallbackContext, |
| 7139 | pPrefNetworkFoundInd); |
| 7140 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7141 | } |
| 7142 | else |
| 7143 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7144 | smsLog(pMac, LOGE, "%s: callback failed - SSID is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7145 | status = eHAL_STATUS_FAILURE; |
| 7146 | } |
| 7147 | } |
| 7148 | |
| 7149 | |
| 7150 | return(status); |
| 7151 | } |
| 7152 | |
| 7153 | #endif // FEATURE_WLAN_SCAN_PNO |
| 7154 | |
| 7155 | |
| 7156 | eHalStatus sme_GetCfgValidChannels(tHalHandle hHal, tANI_U8 *aValidChannels, tANI_U32 *len) |
| 7157 | { |
| 7158 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7159 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7160 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7161 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7162 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7163 | { |
| 7164 | status = csrGetCfgValidChannels(pMac, aValidChannels, len); |
| 7165 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7166 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7167 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7168 | return (status); |
| 7169 | } |
| 7170 | |
| 7171 | |
| 7172 | /* --------------------------------------------------------------------------- |
| 7173 | |
| 7174 | \fn sme_SetTxPerTracking |
| 7175 | |
| 7176 | \brief Set Tx PER tracking configuration parameters |
| 7177 | |
| 7178 | \param hHal - The handle returned by macOpen. |
| 7179 | \param pTxPerTrackingConf - Tx PER configuration parameters |
| 7180 | |
| 7181 | \return eHalStatus |
| 7182 | |
| 7183 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7184 | eHalStatus sme_SetTxPerTracking(tHalHandle hHal, |
| 7185 | void (*pCallbackfn) (void *pCallbackContext), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7186 | void *pCallbackContext, |
| 7187 | tpSirTxPerTrackingParam pTxPerTrackingParam) |
| 7188 | { |
| 7189 | vos_msg_t msg; |
| 7190 | tpSirTxPerTrackingParam pTxPerTrackingParamReq = NULL; |
| 7191 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7192 | |
| 7193 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 7194 | { |
| 7195 | pMac->sme.pTxPerHitCallback = pCallbackfn; |
| 7196 | pMac->sme.pTxPerHitCbContext = pCallbackContext; |
| 7197 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7198 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7199 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7200 | // free this memory in failure case or WDA request callback function |
| 7201 | pTxPerTrackingParamReq = vos_mem_malloc(sizeof(tSirTxPerTrackingParam)); |
| 7202 | if (NULL == pTxPerTrackingParamReq) |
| 7203 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7204 | 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] | 7205 | return eHAL_STATUS_FAILURE; |
| 7206 | } |
| 7207 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7208 | vos_mem_copy(pTxPerTrackingParamReq, (void*)pTxPerTrackingParam, |
| 7209 | sizeof(tSirTxPerTrackingParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7210 | msg.type = WDA_SET_TX_PER_TRACKING_REQ; |
| 7211 | msg.reserved = 0; |
| 7212 | msg.bodyptr = pTxPerTrackingParamReq; |
| 7213 | |
| 7214 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 7215 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7216 | 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] | 7217 | vos_mem_free(pTxPerTrackingParamReq); |
| 7218 | return eHAL_STATUS_FAILURE; |
| 7219 | } |
| 7220 | |
| 7221 | return eHAL_STATUS_SUCCESS; |
| 7222 | } |
| 7223 | |
| 7224 | /* --------------------------------------------------------------------------- |
| 7225 | |
| 7226 | \fn sme_HandleChangeCountryCode |
| 7227 | |
| 7228 | \brief Change Country code, Reg Domain and channel list |
| 7229 | |
| 7230 | \details Country Code Priority |
| 7231 | 0 = 11D > Configured Country > NV |
| 7232 | 1 = Configured Country > 11D > NV |
| 7233 | If Supplicant country code is priority than 11d is disabled. |
| 7234 | If 11D is enabled, we update the country code after every scan. |
| 7235 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 7236 | Country code from Supplicant is set as current courtry code. |
| 7237 | User can send reset command XX (instead of country code) to reset the |
| 7238 | country code to default values which is read from NV. |
| 7239 | In case of reset, 11D is enabled and default NV code is Set as current country code |
| 7240 | If 11D is priority, |
| 7241 | Than Supplicant country code code is set to default code. But 11D code is set as current country code |
| 7242 | |
| 7243 | \param pMac - The handle returned by macOpen. |
| 7244 | \param pMsgBuf - MSG Buffer |
| 7245 | |
| 7246 | \return eHalStatus |
| 7247 | |
| 7248 | -------------------------------------------------------------------------------*/ |
| 7249 | eHalStatus sme_HandleChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf) |
| 7250 | { |
| 7251 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7252 | tAniChangeCountryCodeReq *pMsg; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7253 | v_REGDOMAIN_t domainIdIoctl; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7254 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 7255 | static uNvTables nvTables; |
| 7256 | pMsg = (tAniChangeCountryCodeReq *)pMsgBuf; |
| 7257 | |
| 7258 | |
| 7259 | /* if the reset Supplicant country code command is triggered, enable 11D, reset the NV country code and return */ |
| 7260 | if( VOS_TRUE == vos_mem_compare(pMsg->countryCode, SME_INVALID_COUNTRY_CODE, 2) ) |
| 7261 | { |
| 7262 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 7263 | |
| 7264 | vosStatus = vos_nv_readDefaultCountryTable( &nvTables ); |
| 7265 | |
| 7266 | /* read the country code from NV and use it */ |
| 7267 | if ( VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 7268 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7269 | vos_mem_copy(pMsg->countryCode, |
| 7270 | nvTables.defaultCountryTable.countryCode, |
| 7271 | WNI_CFG_COUNTRY_CODE_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7272 | } |
| 7273 | else |
| 7274 | { |
| 7275 | status = eHAL_STATUS_FAILURE; |
| 7276 | return status; |
| 7277 | } |
| 7278 | } |
| 7279 | else |
| 7280 | { |
| 7281 | /* if Supplicant country code has priority, disable 11d */ |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 7282 | if(pMac->roam.configParam.fSupplicantCountryCodeHasPriority && |
| 7283 | pMsg->countryFromUserSpace) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7284 | { |
| 7285 | pMac->roam.configParam.Is11dSupportEnabled = eANI_BOOLEAN_FALSE; |
| 7286 | } |
| 7287 | } |
| 7288 | |
| 7289 | /* WEXT set country code means |
| 7290 | * 11D should be supported? |
| 7291 | * 11D Channel should be enforced? |
| 7292 | * 11D Country code should be matched? |
| 7293 | * 11D Reg Domian should be matched? |
| 7294 | * Country string changed */ |
| 7295 | if(pMac->roam.configParam.Is11dSupportEnabled && |
| 7296 | pMac->roam.configParam.fEnforce11dChannels && |
| 7297 | pMac->roam.configParam.fEnforceCountryCodeMatch && |
| 7298 | pMac->roam.configParam.fEnforceDefaultDomain && |
| 7299 | !csrSave11dCountryString(pMac, pMsg->countryCode, eANI_BOOLEAN_TRUE)) |
| 7300 | { |
| 7301 | /* All 11D related options are already enabled |
| 7302 | * Country string is not changed |
| 7303 | * Do not need do anything for country code change request */ |
| 7304 | return eHAL_STATUS_SUCCESS; |
| 7305 | } |
| 7306 | |
| 7307 | /* Set Current Country code and Current Regulatory domain */ |
| 7308 | status = csrSetCountryCode(pMac, pMsg->countryCode, NULL); |
| 7309 | if(eHAL_STATUS_SUCCESS != status) |
| 7310 | { |
| 7311 | /* Supplicant country code failed. So give 11D priority */ |
| 7312 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 7313 | smsLog(pMac, LOGE, "Set Country Code Fail %d", status); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7314 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7315 | } |
| 7316 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7317 | /* overwrite the defualt country code */ |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7318 | vos_mem_copy(pMac->scan.countryCodeDefault, |
| 7319 | pMac->scan.countryCodeCurrent, |
| 7320 | WNI_CFG_COUNTRY_CODE_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7321 | |
| 7322 | /* Get Domain ID from country code */ |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7323 | status = csrGetRegulatoryDomainForCountry(pMac, |
| 7324 | pMac->scan.countryCodeCurrent, |
| 7325 | (v_REGDOMAIN_t *) &domainIdIoctl, |
| 7326 | COUNTRY_QUERY); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7327 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7328 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7329 | smsLog( pMac, LOGE, FL(" fail to get regId %d"), domainIdIoctl ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7330 | return status; |
| 7331 | } |
Tushnim Bhattacharyya | 796ffe8 | 2013-11-05 16:31:36 -0800 | [diff] [blame] | 7332 | else if (REGDOMAIN_WORLD == domainIdIoctl) |
| 7333 | { |
| 7334 | /* Supplicant country code is invalid, so we are on world mode now. So |
| 7335 | give 11D chance to update */ |
| 7336 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 7337 | smsLog(pMac, LOG1, FL("Country Code unrecognized by driver")); |
| 7338 | } |
| 7339 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7340 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 7341 | status = WDA_SetRegDomain(pMac, domainIdIoctl, pMsg->sendRegHint); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7342 | |
| 7343 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7344 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7345 | smsLog( pMac, LOGE, FL(" fail to set regId %d"), domainIdIoctl ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7346 | return status; |
| 7347 | } |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7348 | else |
| 7349 | { |
| 7350 | //if 11d has priority, clear currentCountryBssid & countryCode11d to get |
| 7351 | //set again if we find AP with 11d info during scan |
| 7352 | if (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority) |
| 7353 | { |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7354 | smsLog( pMac, LOGW, FL("Clearing currentCountryBssid, countryCode11d")); |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7355 | vos_mem_zero(&pMac->scan.currentCountryBssid, sizeof(tCsrBssid)); |
| 7356 | vos_mem_zero( pMac->scan.countryCode11d, sizeof( pMac->scan.countryCode11d ) ); |
| 7357 | } |
| 7358 | } |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7359 | #ifndef CONFIG_ENABLE_LINUX_REG |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7360 | /* set to default domain ID */ |
| 7361 | pMac->scan.domainIdDefault = pMac->scan.domainIdCurrent; |
| 7362 | |
| 7363 | /* get the channels based on new cc */ |
| 7364 | status = csrInitGetChannels( pMac ); |
| 7365 | |
| 7366 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7367 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7368 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7369 | return status; |
| 7370 | } |
| 7371 | |
| 7372 | /* reset info based on new cc, and we are done */ |
Gopichand Nakkala | b9185f2 | 2012-12-21 08:03:42 -0800 | [diff] [blame] | 7373 | csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7374 | /* Country code Changed, Purge Only scan result |
| 7375 | * which does not have channel number belong to 11d |
| 7376 | * channel list |
| 7377 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 7378 | csrScanFilterResults(pMac); |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7379 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7380 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7381 | if( pMsg->changeCCCallback ) |
| 7382 | { |
| 7383 | ((tSmeChangeCountryCallback)(pMsg->changeCCCallback))((void *)pMsg->pDevContext); |
| 7384 | } |
| 7385 | |
| 7386 | return eHAL_STATUS_SUCCESS; |
| 7387 | } |
| 7388 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7389 | /* --------------------------------------------------------------------------- |
| 7390 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7391 | \fn sme_HandleChangeCountryCodeByUser |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7392 | |
| 7393 | \brief Change Country code, Reg Domain and channel list |
| 7394 | |
| 7395 | If Supplicant country code is priority than 11d is disabled. |
| 7396 | If 11D is enabled, we update the country code after every scan. |
| 7397 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 7398 | Country code from Supplicant is set as current country code. |
| 7399 | |
| 7400 | \param pMac - The handle returned by macOpen. |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7401 | \param pMsg - Carrying new CC & domain set in kernel by user |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7402 | |
| 7403 | \return eHalStatus |
| 7404 | |
| 7405 | -------------------------------------------------------------------------------*/ |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7406 | eHalStatus sme_HandleChangeCountryCodeByUser(tpAniSirGlobal pMac, |
| 7407 | tAniGenericChangeCountryCodeReq *pMsg) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7408 | { |
| 7409 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7410 | v_REGDOMAIN_t reg_domain_id; |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7411 | v_BOOL_t is11dCountry = VOS_FALSE; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7412 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7413 | smsLog(pMac, LOG1, FL(" called")); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7414 | reg_domain_id = (v_REGDOMAIN_t)pMsg->domain_index; |
| 7415 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7416 | if (memcmp(pMsg->countryCode, pMac->scan.countryCode11d, |
| 7417 | VOS_COUNTRY_CODE_LEN) == 0) |
| 7418 | { |
| 7419 | is11dCountry = VOS_TRUE; |
| 7420 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7421 | |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7422 | if ((!is11dCountry) && (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority) && |
| 7423 | (csrGetInfraSessionId(pMac) != -1 )) |
| 7424 | { |
| 7425 | |
| 7426 | smsLog( pMac, LOGW, FL(" incorrect country being set, nullify this request")); |
| 7427 | |
| 7428 | /* we have got a request for a country that should not have been added since the |
| 7429 | STA is associated; nullify this request */ |
| 7430 | status = csrGetRegulatoryDomainForCountry(pMac, |
| 7431 | pMac->scan.countryCode11d, |
| 7432 | (v_REGDOMAIN_t *) ®_domain_id, |
| 7433 | COUNTRY_IE); |
| 7434 | |
| 7435 | return eHAL_STATUS_FAILURE; |
| 7436 | } |
| 7437 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7438 | /* if Supplicant country code has priority, disable 11d */ |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7439 | if (!is11dCountry && pMac->roam.configParam.fSupplicantCountryCodeHasPriority) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7440 | { |
| 7441 | pMac->roam.configParam.Is11dSupportEnabled = eANI_BOOLEAN_FALSE; |
| 7442 | } |
| 7443 | |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7444 | vos_mem_copy(pMac->scan.countryCodeCurrent, pMsg->countryCode, |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7445 | WNI_CFG_COUNTRY_CODE_LEN); |
| 7446 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 7447 | status = WDA_SetRegDomain(pMac, reg_domain_id, eSIR_TRUE); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7448 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7449 | if (VOS_FALSE == is11dCountry ) |
| 7450 | { |
| 7451 | /* overwrite the defualt country code */ |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7452 | vos_mem_copy(pMac->scan.countryCodeDefault, |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7453 | pMac->scan.countryCodeCurrent, WNI_CFG_COUNTRY_CODE_LEN); |
| 7454 | /* set to default domain ID */ |
| 7455 | pMac->scan.domainIdDefault = pMac->scan.domainIdCurrent; |
| 7456 | } |
| 7457 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7458 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7459 | { |
| 7460 | smsLog( pMac, LOGE, FL(" fail to set regId %d"), reg_domain_id ); |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7461 | return status; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7462 | } |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7463 | else |
| 7464 | { |
| 7465 | //if 11d has priority, clear currentCountryBssid & countryCode11d to get |
| 7466 | //set again if we find AP with 11d info during scan |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7467 | if((!pMac->roam.configParam.fSupplicantCountryCodeHasPriority) && |
| 7468 | (VOS_FALSE == is11dCountry )) |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7469 | { |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7470 | smsLog( pMac, LOGW, FL("Clearing currentCountryBssid, countryCode11d")); |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7471 | vos_mem_zero(&pMac->scan.currentCountryBssid, sizeof(tCsrBssid)); |
| 7472 | vos_mem_zero( pMac->scan.countryCode11d, sizeof( pMac->scan.countryCode11d ) ); |
| 7473 | } |
| 7474 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7475 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7476 | /* get the channels based on new cc */ |
| 7477 | status = csrInitGetChannels(pMac); |
| 7478 | |
| 7479 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7480 | { |
| 7481 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
| 7482 | return status; |
| 7483 | } |
| 7484 | |
| 7485 | /* reset info based on new cc, and we are done */ |
| 7486 | csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7487 | if (VOS_TRUE == is11dCountry) |
| 7488 | { |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7489 | pMac->scan.f11dInfoApplied = eANI_BOOLEAN_TRUE; |
| 7490 | pMac->scan.f11dInfoReset = eANI_BOOLEAN_FALSE; |
| 7491 | } |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7492 | /* Country code Changed, Purge Only scan result |
| 7493 | * which does not have channel number belong to 11d |
| 7494 | * channel list |
| 7495 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 7496 | csrScanFilterResults(pMac); |
Kiet Lam | bd5cd9b | 2013-11-11 19:01:45 +0530 | [diff] [blame] | 7497 | // Do active scans after the country is set by User hints or Country IE |
| 7498 | pMac->scan.curScanType = eSIR_ACTIVE_SCAN; |
| 7499 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7500 | smsLog(pMac, LOG1, FL(" returned")); |
| 7501 | return eHAL_STATUS_SUCCESS; |
| 7502 | } |
| 7503 | |
| 7504 | /* --------------------------------------------------------------------------- |
| 7505 | |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7506 | \fn sme_HandleChangeCountryCodeByCore |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7507 | |
| 7508 | \brief Update Country code in the driver if set by kernel as world |
| 7509 | |
| 7510 | If 11D is enabled, we update the country code after every scan & notify kernel. |
| 7511 | This is to make sure kernel & driver are in sync in case of CC found in |
| 7512 | driver but not in kernel database |
| 7513 | |
| 7514 | \param pMac - The handle returned by macOpen. |
| 7515 | \param pMsg - Carrying new CC set in kernel |
| 7516 | |
| 7517 | \return eHalStatus |
| 7518 | |
| 7519 | -------------------------------------------------------------------------------*/ |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7520 | eHalStatus sme_HandleChangeCountryCodeByCore(tpAniSirGlobal pMac, tAniGenericChangeCountryCodeReq *pMsg) |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7521 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7522 | eHalStatus status; |
| 7523 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7524 | smsLog(pMac, LOG1, FL(" called")); |
| 7525 | |
| 7526 | //this is to make sure kernel & driver are in sync in case of CC found in |
| 7527 | //driver but not in kernel database |
| 7528 | if (('0' == pMsg->countryCode[0]) && ('0' == pMsg->countryCode[1])) |
| 7529 | { |
Tushnim Bhattacharyya | 582ac1d | 2013-11-07 23:44:09 -0800 | [diff] [blame] | 7530 | smsLog( pMac, LOGW, FL("Setting countryCode11d & countryCodeCurrent to world CC")); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7531 | vos_mem_copy(pMac->scan.countryCode11d, pMsg->countryCode, |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7532 | WNI_CFG_COUNTRY_CODE_LEN); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7533 | vos_mem_copy(pMac->scan.countryCodeCurrent, pMsg->countryCode, |
Tushnim Bhattacharyya | 582ac1d | 2013-11-07 23:44:09 -0800 | [diff] [blame] | 7534 | WNI_CFG_COUNTRY_CODE_LEN); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7535 | } |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7536 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 7537 | status = WDA_SetRegDomain(pMac, REGDOMAIN_WORLD, eSIR_TRUE); |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7538 | |
| 7539 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7540 | { |
| 7541 | smsLog( pMac, LOGE, FL(" fail to set regId") ); |
| 7542 | return status; |
| 7543 | } |
| 7544 | else |
| 7545 | { |
| 7546 | status = csrInitGetChannels(pMac); |
| 7547 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7548 | { |
| 7549 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
| 7550 | } |
| 7551 | else |
| 7552 | { |
| 7553 | csrInitChannelList(pMac); |
| 7554 | } |
| 7555 | } |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7556 | /* Country code Changed, Purge Only scan result |
| 7557 | * which does not have channel number belong to 11d |
| 7558 | * channel list |
| 7559 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 7560 | csrScanFilterResults(pMac); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7561 | smsLog(pMac, LOG1, FL(" returned")); |
| 7562 | return eHAL_STATUS_SUCCESS; |
| 7563 | } |
| 7564 | |
| 7565 | /* --------------------------------------------------------------------------- |
| 7566 | |
| 7567 | \fn sme_HandleGenericChangeCountryCode |
| 7568 | |
| 7569 | \brief Change Country code, Reg Domain and channel list |
| 7570 | |
| 7571 | If Supplicant country code is priority than 11d is disabled. |
| 7572 | If 11D is enabled, we update the country code after every scan. |
| 7573 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 7574 | Country code from kernel is set as current country code. |
| 7575 | |
| 7576 | \param pMac - The handle returned by macOpen. |
| 7577 | \param pMsgBuf - message buffer |
| 7578 | |
| 7579 | \return eHalStatus |
| 7580 | |
| 7581 | -------------------------------------------------------------------------------*/ |
| 7582 | eHalStatus sme_HandleGenericChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf) |
| 7583 | { |
| 7584 | tAniGenericChangeCountryCodeReq *pMsg; |
| 7585 | v_REGDOMAIN_t reg_domain_id; |
| 7586 | |
| 7587 | smsLog(pMac, LOG1, FL(" called")); |
| 7588 | pMsg = (tAniGenericChangeCountryCodeReq *)pMsgBuf; |
| 7589 | reg_domain_id = (v_REGDOMAIN_t)pMsg->domain_index; |
| 7590 | |
| 7591 | if (REGDOMAIN_COUNT == reg_domain_id) |
| 7592 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7593 | sme_HandleChangeCountryCodeByCore(pMac, pMsg); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7594 | } |
| 7595 | else |
| 7596 | { |
| 7597 | sme_HandleChangeCountryCodeByUser(pMac, pMsg); |
| 7598 | } |
| 7599 | smsLog(pMac, LOG1, FL(" returned")); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7600 | return eHAL_STATUS_SUCCESS; |
| 7601 | } |
| 7602 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7603 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 7604 | eHalStatus sme_8023MulticastList (tHalHandle hHal, tANI_U8 sessionId, tpSirRcvFltMcAddrList pMulticastAddrs) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7605 | { |
| 7606 | tpSirRcvFltMcAddrList pRequestBuf; |
| 7607 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7608 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7609 | tCsrRoamSession *pSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7610 | |
| 7611 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: " |
Gopichand Nakkala | 66c0bd0 | 2013-04-10 11:36:29 +0530 | [diff] [blame] | 7612 | "ulMulticastAddrCnt=%d, multicastAddr[0]=%p", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7613 | pMulticastAddrs->ulMulticastAddrCnt, |
| 7614 | pMulticastAddrs->multicastAddr[0]); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7615 | |
| 7616 | /* |
| 7617 | *Find the connected Infra / P2P_client connected session |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 7618 | */ |
| 7619 | if (CSR_IS_SESSION_VALID(pMac, sessionId) && |
| 7620 | csrIsConnStateInfra(pMac, sessionId)) |
| 7621 | { |
| 7622 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 7623 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7624 | |
| 7625 | if(pSession == NULL ) |
| 7626 | { |
| 7627 | 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] | 7628 | "the right session", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7629 | return eHAL_STATUS_FAILURE; |
| 7630 | } |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 7631 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7632 | pRequestBuf = vos_mem_malloc(sizeof(tSirRcvFltMcAddrList)); |
| 7633 | if (NULL == pRequestBuf) |
| 7634 | { |
| 7635 | 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] | 7636 | "allocate memory for 8023 Multicast List request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7637 | return eHAL_STATUS_FAILED_ALLOC; |
| 7638 | } |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 7639 | |
| 7640 | if( !csrIsConnStateConnectedInfra (pMac, sessionId )) |
| 7641 | { |
| 7642 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Ignoring the " |
| 7643 | "indication as we are not connected", __func__); |
| 7644 | vos_mem_free(pRequestBuf); |
| 7645 | return eHAL_STATUS_FAILURE; |
| 7646 | } |
| 7647 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7648 | vos_mem_copy(pRequestBuf, pMulticastAddrs, sizeof(tSirRcvFltMcAddrList)); |
| 7649 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7650 | vos_mem_copy(pRequestBuf->selfMacAddr, pSession->selfMacAddr, |
| 7651 | sizeof(tSirMacAddr)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7652 | vos_mem_copy(pRequestBuf->bssId, pSession->connectedProfile.bssid, |
| 7653 | sizeof(tSirMacAddr)); |
| 7654 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7655 | msg.type = WDA_8023_MULTICAST_LIST_REQ; |
| 7656 | msg.reserved = 0; |
| 7657 | msg.bodyptr = pRequestBuf; |
| 7658 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 7659 | { |
| 7660 | 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] | 7661 | "post WDA_8023_MULTICAST_LIST message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7662 | vos_mem_free(pRequestBuf); |
| 7663 | return eHAL_STATUS_FAILURE; |
| 7664 | } |
| 7665 | |
| 7666 | return eHAL_STATUS_SUCCESS; |
| 7667 | } |
| 7668 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7669 | eHalStatus sme_ReceiveFilterSetFilter(tHalHandle hHal, tpSirRcvPktFilterCfgType pRcvPktFilterCfg, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7670 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7671 | { |
| 7672 | tpSirRcvPktFilterCfgType pRequestBuf; |
| 7673 | v_SINT_t allocSize; |
| 7674 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7675 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7676 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7677 | v_U8_t idx=0; |
| 7678 | |
| 7679 | 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] | 7680 | "filterId = %d", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7681 | pRcvPktFilterCfg->filterType, pRcvPktFilterCfg->filterId); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7682 | |
Madan Mohan Koyyalamudi | d402962 | 2012-10-18 20:30:17 -0700 | [diff] [blame] | 7683 | allocSize = sizeof(tSirRcvPktFilterCfgType); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7684 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7685 | pRequestBuf = vos_mem_malloc(allocSize); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7686 | |
| 7687 | if (NULL == pRequestBuf) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7688 | { |
| 7689 | 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] | 7690 | "allocate memory for Receive Filter Set Filter request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7691 | return eHAL_STATUS_FAILED_ALLOC; |
| 7692 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7693 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7694 | if( NULL == pSession ) |
| 7695 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7696 | 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] | 7697 | vos_mem_free(pRequestBuf); |
| 7698 | return eHAL_STATUS_FAILURE; |
| 7699 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7700 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7701 | vos_mem_copy(pRcvPktFilterCfg->selfMacAddr, pSession->selfMacAddr, |
| 7702 | sizeof(tSirMacAddr)); |
| 7703 | vos_mem_copy(pRcvPktFilterCfg->bssId, pSession->connectedProfile.bssid, |
| 7704 | sizeof(tSirMacAddr)); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7705 | vos_mem_copy(pRequestBuf, pRcvPktFilterCfg, allocSize); |
| 7706 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7707 | msg.type = WDA_RECEIVE_FILTER_SET_FILTER_REQ; |
| 7708 | msg.reserved = 0; |
| 7709 | msg.bodyptr = pRequestBuf; |
| 7710 | |
| 7711 | 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] | 7712 | "FT %d FID %d ", |
| 7713 | pRequestBuf->filterType, pRequestBuf->filterId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7714 | |
| 7715 | 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] | 7716 | "params %d CT %d", |
| 7717 | pRequestBuf->numFieldParams, pRequestBuf->coalesceTime); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7718 | |
| 7719 | for (idx=0; idx<pRequestBuf->numFieldParams; idx++) |
| 7720 | { |
| 7721 | |
| 7722 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7723 | "Proto %d Comp Flag %d ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7724 | pRequestBuf->paramsData[idx].protocolLayer, |
| 7725 | pRequestBuf->paramsData[idx].cmpFlag); |
| 7726 | |
| 7727 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7728 | "Data Offset %d Data Len %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7729 | pRequestBuf->paramsData[idx].dataOffset, |
| 7730 | pRequestBuf->paramsData[idx].dataLength); |
| 7731 | |
| 7732 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7733 | "CData: %d:%d:%d:%d:%d:%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7734 | pRequestBuf->paramsData[idx].compareData[0], |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7735 | pRequestBuf->paramsData[idx].compareData[1], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7736 | pRequestBuf->paramsData[idx].compareData[2], |
| 7737 | pRequestBuf->paramsData[idx].compareData[3], |
| 7738 | pRequestBuf->paramsData[idx].compareData[4], |
| 7739 | pRequestBuf->paramsData[idx].compareData[5]); |
| 7740 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7741 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7742 | "MData: %d:%d:%d:%d:%d:%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7743 | pRequestBuf->paramsData[idx].dataMask[0], |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7744 | pRequestBuf->paramsData[idx].dataMask[1], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7745 | pRequestBuf->paramsData[idx].dataMask[2], |
| 7746 | pRequestBuf->paramsData[idx].dataMask[3], |
| 7747 | pRequestBuf->paramsData[idx].dataMask[4], |
| 7748 | pRequestBuf->paramsData[idx].dataMask[5]); |
| 7749 | |
| 7750 | } |
| 7751 | |
| 7752 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 7753 | { |
| 7754 | 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] | 7755 | "WDA_RECEIVE_FILTER_SET_FILTER message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7756 | vos_mem_free(pRequestBuf); |
| 7757 | return eHAL_STATUS_FAILURE; |
| 7758 | } |
| 7759 | |
| 7760 | return eHAL_STATUS_SUCCESS; |
| 7761 | } |
| 7762 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7763 | eHalStatus sme_GetFilterMatchCount(tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7764 | FilterMatchCountCallback callbackRoutine, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7765 | void *callbackContext, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7766 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7767 | { |
| 7768 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7769 | eHalStatus status; |
| 7770 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7771 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "+%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7772 | |
| 7773 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme))) |
| 7774 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7775 | pmcGetFilterMatchCount(hHal, callbackRoutine, callbackContext, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7776 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7777 | } |
| 7778 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7779 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "-%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7780 | |
| 7781 | return (status); |
| 7782 | } |
| 7783 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7784 | eHalStatus sme_ReceiveFilterClearFilter(tHalHandle hHal, tpSirRcvFltPktClearParam pRcvFltPktClearParam, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7785 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7786 | { |
| 7787 | tpSirRcvFltPktClearParam pRequestBuf; |
| 7788 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7789 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7790 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7791 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7792 | 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] | 7793 | pRcvFltPktClearParam->filterId); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7794 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7795 | pRequestBuf = vos_mem_malloc(sizeof(tSirRcvFltPktClearParam)); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7796 | if (NULL == pRequestBuf) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7797 | { |
| 7798 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 7799 | "%s: Not able to allocate memory for Receive Filter " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7800 | "Clear Filter request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7801 | return eHAL_STATUS_FAILED_ALLOC; |
| 7802 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7803 | if( NULL == pSession ) |
| 7804 | { |
| 7805 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7806 | "%s: Session Not find ", __func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7807 | vos_mem_free(pRequestBuf); |
| 7808 | return eHAL_STATUS_FAILURE; |
| 7809 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7810 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7811 | vos_mem_copy(pRcvFltPktClearParam->selfMacAddr, pSession->selfMacAddr, |
| 7812 | sizeof(tSirMacAddr)); |
| 7813 | vos_mem_copy(pRcvFltPktClearParam->bssId, pSession->connectedProfile.bssid, |
| 7814 | sizeof(tSirMacAddr)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7815 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7816 | vos_mem_copy(pRequestBuf, pRcvFltPktClearParam, sizeof(tSirRcvFltPktClearParam)); |
| 7817 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7818 | msg.type = WDA_RECEIVE_FILTER_CLEAR_FILTER_REQ; |
| 7819 | msg.reserved = 0; |
| 7820 | msg.bodyptr = pRequestBuf; |
| 7821 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 7822 | { |
| 7823 | 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] | 7824 | "WDA_RECEIVE_FILTER_CLEAR_FILTER message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7825 | vos_mem_free(pRequestBuf); |
| 7826 | return eHAL_STATUS_FAILURE; |
| 7827 | } |
| 7828 | |
| 7829 | return eHAL_STATUS_SUCCESS; |
| 7830 | } |
| 7831 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 7832 | |
| 7833 | /* --------------------------------------------------------------------------- |
| 7834 | \fn sme_PreChannelSwitchIndFullPowerCB |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7835 | \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] | 7836 | channel switch. |
| 7837 | \param callbackContext |
| 7838 | \param status |
| 7839 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7840 | void sme_PreChannelSwitchIndFullPowerCB(void *callbackContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7841 | eHalStatus status) |
| 7842 | { |
| 7843 | tpAniSirGlobal pMac = (tpAniSirGlobal)callbackContext; |
| 7844 | tSirMbMsg *pMsg; |
| 7845 | tANI_U16 msgLen; |
| 7846 | |
| 7847 | msgLen = (tANI_U16)(sizeof( tSirMbMsg )); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7848 | pMsg = vos_mem_malloc(msgLen); |
| 7849 | if ( NULL != pMsg ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7850 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7851 | vos_mem_set(pMsg, msgLen, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7852 | pMsg->type = pal_cpu_to_be16((tANI_U16)eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER); |
| 7853 | pMsg->msgLen = pal_cpu_to_be16(msgLen); |
| 7854 | status = palSendMBMessage(pMac->hHdd, pMsg); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7855 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7856 | |
| 7857 | return; |
| 7858 | } |
| 7859 | |
| 7860 | /* --------------------------------------------------------------------------- |
| 7861 | \fn sme_HandlePreChannelSwitchInd |
| 7862 | \brief Processes the indcation from PE for pre-channel switch. |
| 7863 | \param hHal |
| 7864 | \- The handle returned by macOpen. return eHalStatus |
| 7865 | ---------------------------------------------------------------------------*/ |
| 7866 | eHalStatus sme_HandlePreChannelSwitchInd(tHalHandle hHal) |
| 7867 | { |
| 7868 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7869 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7870 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7871 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7872 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7873 | status = pmcRequestFullPower(hHal, sme_PreChannelSwitchIndFullPowerCB, |
| 7874 | pMac, eSME_FULL_PWR_NEEDED_BY_CHANNEL_SWITCH); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7875 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7876 | } |
| 7877 | |
| 7878 | return (status); |
| 7879 | } |
| 7880 | |
| 7881 | /* --------------------------------------------------------------------------- |
| 7882 | \fn sme_HandlePostChannelSwitchInd |
| 7883 | \brief Processes the indcation from PE for post-channel switch. |
| 7884 | \param hHal |
| 7885 | \- The handle returned by macOpen. return eHalStatus |
| 7886 | ---------------------------------------------------------------------------*/ |
| 7887 | eHalStatus sme_HandlePostChannelSwitchInd(tHalHandle hHal) |
| 7888 | { |
| 7889 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7890 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7891 | |
| 7892 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7893 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7894 | { |
| 7895 | status = pmcRequestBmps(hHal, NULL, NULL); |
| 7896 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7897 | } |
| 7898 | |
| 7899 | return (status); |
| 7900 | } |
| 7901 | |
| 7902 | /* --------------------------------------------------------------------------- |
| 7903 | |
| 7904 | \fn sme_IsChannelValid |
| 7905 | |
| 7906 | \brief To check if the channel is valid for currently established domain |
| 7907 | This is a synchronous API. |
| 7908 | |
| 7909 | \param hHal - The handle returned by macOpen. |
| 7910 | \param channel - channel to verify |
| 7911 | |
| 7912 | \return TRUE/FALSE, TRUE if channel is valid |
| 7913 | |
| 7914 | -------------------------------------------------------------------------------*/ |
| 7915 | tANI_BOOLEAN sme_IsChannelValid(tHalHandle hHal, tANI_U8 channel) |
| 7916 | { |
| 7917 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7918 | tANI_BOOLEAN valid = FALSE; |
| 7919 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7920 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7921 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7922 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7923 | { |
| 7924 | |
| 7925 | valid = csrRoamIsChannelValid( pMac, channel); |
| 7926 | |
| 7927 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7928 | } |
| 7929 | |
| 7930 | return (valid); |
| 7931 | } |
| 7932 | |
| 7933 | /* --------------------------------------------------------------------------- |
| 7934 | \fn sme_SetFreqBand |
| 7935 | \brief Used to set frequency band. |
| 7936 | \param hHal |
| 7937 | \eBand band value to be configured |
| 7938 | \- return eHalStatus |
| 7939 | -------------------------------------------------------------------------*/ |
| 7940 | eHalStatus sme_SetFreqBand(tHalHandle hHal, eCsrBand eBand) |
| 7941 | { |
| 7942 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7943 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7944 | |
| 7945 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7946 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7947 | { |
| 7948 | status = csrSetBand(hHal, eBand); |
| 7949 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7950 | } |
| 7951 | return status; |
| 7952 | } |
| 7953 | |
| 7954 | /* --------------------------------------------------------------------------- |
| 7955 | \fn sme_GetFreqBand |
| 7956 | \brief Used to get the current band settings. |
| 7957 | \param hHal |
| 7958 | \pBand pointer to hold band value |
| 7959 | \- return eHalStatus |
| 7960 | -------------------------------------------------------------------------*/ |
| 7961 | eHalStatus sme_GetFreqBand(tHalHandle hHal, eCsrBand *pBand) |
| 7962 | { |
| 7963 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7964 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7965 | |
| 7966 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7967 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7968 | { |
| 7969 | *pBand = csrGetCurrentBand( hHal ); |
| 7970 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7971 | } |
| 7972 | return status; |
| 7973 | } |
| 7974 | |
| 7975 | #ifdef WLAN_WAKEUP_EVENTS |
| 7976 | /****************************************************************************** |
| 7977 | \fn sme_WakeReasonIndCallback |
| 7978 | |
| 7979 | \brief |
| 7980 | a callback function called when SME received eWNI_SME_WAKE_REASON_IND event from WDA |
| 7981 | |
| 7982 | \param hHal - HAL handle for device |
| 7983 | \param pMsg - Message body passed from WDA; includes Wake Reason Indication parameter |
| 7984 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7985 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7986 | ******************************************************************************/ |
| 7987 | eHalStatus sme_WakeReasonIndCallback (tHalHandle hHal, void* pMsg) |
| 7988 | { |
| 7989 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7990 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7991 | tSirWakeReasonInd *pWakeReasonInd = (tSirWakeReasonInd *)pMsg; |
| 7992 | |
| 7993 | if (NULL == pMsg) |
| 7994 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7995 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7996 | status = eHAL_STATUS_FAILURE; |
| 7997 | } |
| 7998 | else |
| 7999 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8000 | smsLog(pMac, LOG2, "SME: entering sme_WakeReasonIndCallback"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8001 | |
| 8002 | /* Call Wake Reason Indication callback routine. */ |
| 8003 | if (pMac->pmc.wakeReasonIndCB != NULL) |
| 8004 | pMac->pmc.wakeReasonIndCB(pMac->pmc.wakeReasonIndCBContext, pWakeReasonInd); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8005 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8006 | pMac->pmc.wakeReasonIndCB = NULL; |
| 8007 | pMac->pmc.wakeReasonIndCBContext = NULL; |
| 8008 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8009 | 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] | 8010 | } |
| 8011 | |
| 8012 | return(status); |
| 8013 | } |
| 8014 | #endif // WLAN_WAKEUP_EVENTS |
| 8015 | |
| 8016 | |
| 8017 | /* --------------------------------------------------------------------------- |
| 8018 | |
| 8019 | \fn sme_SetMaxTxPower |
| 8020 | |
| 8021 | \brief Set the Maximum Transmit Power dynamically. Note: this setting will |
| 8022 | not persist over reboots. |
| 8023 | |
| 8024 | \param hHal |
| 8025 | \param pBssid BSSID to set the power cap for |
| 8026 | \param pBssid pSelfMacAddress self MAC Address |
| 8027 | \param pBssid power to set in dB |
| 8028 | \- return eHalStatus |
| 8029 | |
| 8030 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8031 | eHalStatus sme_SetMaxTxPower(tHalHandle hHal, tSirMacAddr pBssid, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8032 | tSirMacAddr pSelfMacAddress, v_S7_t dB) |
| 8033 | { |
| 8034 | vos_msg_t msg; |
| 8035 | tpMaxTxPowerParams pMaxTxParams = NULL; |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8036 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8037 | TRACE_CODE_SME_RX_HDD_SET_MAXTXPOW, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8038 | pMaxTxParams = vos_mem_malloc(sizeof(tMaxTxPowerParams)); |
| 8039 | if (NULL == pMaxTxParams) |
| 8040 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8041 | 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] | 8042 | return eHAL_STATUS_FAILURE; |
| 8043 | } |
| 8044 | |
| 8045 | vos_mem_copy(pMaxTxParams->bssId, pBssid, SIR_MAC_ADDR_LENGTH); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8046 | vos_mem_copy(pMaxTxParams->selfStaMacAddr, pSelfMacAddress, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8047 | SIR_MAC_ADDR_LENGTH); |
| 8048 | pMaxTxParams->power = dB; |
| 8049 | |
| 8050 | msg.type = WDA_SET_MAX_TX_POWER_REQ; |
| 8051 | msg.reserved = 0; |
| 8052 | msg.bodyptr = pMaxTxParams; |
| 8053 | |
| 8054 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8055 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8056 | 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] | 8057 | vos_mem_free(pMaxTxParams); |
| 8058 | return eHAL_STATUS_FAILURE; |
| 8059 | } |
| 8060 | |
| 8061 | return eHAL_STATUS_SUCCESS; |
| 8062 | } |
| 8063 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8064 | /* --------------------------------------------------------------------------- |
| 8065 | |
Arif Hussain | a5ebce0 | 2013-08-09 15:09:58 -0700 | [diff] [blame] | 8066 | \fn sme_SetMaxTxPowerPerBand |
| 8067 | |
| 8068 | \brief Set the Maximum Transmit Power specific to band dynamically. |
| 8069 | Note: this setting will not persist over reboots. |
| 8070 | |
| 8071 | \param band |
| 8072 | \param power to set in dB |
| 8073 | \- return eHalStatus |
| 8074 | |
| 8075 | ----------------------------------------------------------------------------*/ |
| 8076 | eHalStatus sme_SetMaxTxPowerPerBand(eCsrBand band, v_S7_t dB) |
| 8077 | { |
| 8078 | vos_msg_t msg; |
| 8079 | tpMaxTxPowerPerBandParams pMaxTxPowerPerBandParams = NULL; |
| 8080 | |
| 8081 | pMaxTxPowerPerBandParams = vos_mem_malloc(sizeof(tMaxTxPowerPerBandParams)); |
| 8082 | if (NULL == pMaxTxPowerPerBandParams) |
| 8083 | { |
| 8084 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8085 | "%s:Not able to allocate memory for pMaxTxPowerPerBandParams", |
| 8086 | __func__); |
| 8087 | return eHAL_STATUS_FAILURE; |
| 8088 | } |
| 8089 | |
| 8090 | pMaxTxPowerPerBandParams->power = dB; |
| 8091 | pMaxTxPowerPerBandParams->bandInfo = band; |
| 8092 | |
| 8093 | msg.type = WDA_SET_MAX_TX_POWER_PER_BAND_REQ; |
| 8094 | msg.reserved = 0; |
| 8095 | msg.bodyptr = pMaxTxPowerPerBandParams; |
| 8096 | |
| 8097 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8098 | { |
| 8099 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8100 | "%s:Not able to post WDA_SET_MAX_TX_POWER_PER_BAND_REQ", |
| 8101 | __func__); |
| 8102 | vos_mem_free(pMaxTxPowerPerBandParams); |
| 8103 | return eHAL_STATUS_FAILURE; |
| 8104 | } |
| 8105 | |
| 8106 | return eHAL_STATUS_SUCCESS; |
| 8107 | } |
| 8108 | |
| 8109 | /* --------------------------------------------------------------------------- |
| 8110 | |
schang | 86c22c4 | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 8111 | \fn sme_SetTxPower |
| 8112 | |
| 8113 | \brief Set Transmit Power dynamically. Note: this setting will |
| 8114 | not persist over reboots. |
| 8115 | |
| 8116 | \param hHal |
| 8117 | \param sessionId Target Session ID |
| 8118 | \param mW power to set in mW |
| 8119 | \- return eHalStatus |
| 8120 | |
| 8121 | -------------------------------------------------------------------------------*/ |
| 8122 | eHalStatus sme_SetTxPower(tHalHandle hHal, v_U8_t sessionId, v_U8_t mW) |
| 8123 | { |
| 8124 | |
| 8125 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8126 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8127 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8128 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8129 | TRACE_CODE_SME_RX_HDD_SET_TXPOW, NO_SESSION, 0)); |
schang | 86c22c4 | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 8130 | smsLog(pMac, LOG1, FL("set tx power %dmW"), mW); |
| 8131 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 8132 | if (HAL_STATUS_SUCCESS(status)) |
| 8133 | { |
| 8134 | status = csrSetTxPower(pMac, sessionId, mW); |
| 8135 | sme_ReleaseGlobalLock(&pMac->sme); |
| 8136 | } |
| 8137 | return status; |
| 8138 | } |
| 8139 | |
| 8140 | /* --------------------------------------------------------------------------- |
| 8141 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8142 | \fn sme_HideSSID |
| 8143 | |
| 8144 | \brief hide/show SSID dynamically. Note: this setting will |
| 8145 | not persist over reboots. |
| 8146 | |
| 8147 | \param hHal |
| 8148 | \param sessionId |
| 8149 | \param ssidHidden 0 - Broadcast SSID, 1 - Disable broadcast SSID |
| 8150 | \- return eHalStatus |
| 8151 | |
| 8152 | -------------------------------------------------------------------------------*/ |
| 8153 | eHalStatus sme_HideSSID(tHalHandle hHal, v_U8_t sessionId, v_U8_t ssidHidden) |
| 8154 | { |
| 8155 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8156 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8157 | tANI_U16 len; |
| 8158 | |
| 8159 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8160 | { |
| 8161 | tpSirUpdateParams pMsg; |
| 8162 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 8163 | |
| 8164 | if(!pSession) |
| 8165 | { |
| 8166 | 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] | 8167 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 8168 | return eHAL_STATUS_FAILURE; |
| 8169 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8170 | |
| 8171 | if( !pSession->sessionActive ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8172 | VOS_ASSERT(0); |
| 8173 | |
| 8174 | /* Create the message and send to lim */ |
| 8175 | len = sizeof(tSirUpdateParams); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8176 | pMsg = vos_mem_malloc(len); |
| 8177 | if ( NULL == pMsg ) |
| 8178 | status = eHAL_STATUS_FAILURE; |
| 8179 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8180 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8181 | vos_mem_set(pMsg, sizeof(tSirUpdateParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8182 | pMsg->messageType = eWNI_SME_HIDE_SSID_REQ; |
| 8183 | pMsg->length = len; |
| 8184 | /* Data starts from here */ |
| 8185 | pMsg->sessionId = sessionId; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8186 | pMsg->ssidHidden = ssidHidden; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8187 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 8188 | } |
| 8189 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8190 | } |
| 8191 | return status; |
| 8192 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8193 | |
| 8194 | /* --------------------------------------------------------------------------- |
| 8195 | |
| 8196 | \fn sme_SetTmLevel |
| 8197 | \brief Set Thermal Mitigation Level to RIVA |
| 8198 | \param hHal - The handle returned by macOpen. |
| 8199 | \param newTMLevel - new Thermal Mitigation Level |
| 8200 | \param tmMode - Thermal Mitigation handle mode, default 0 |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8201 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8202 | ---------------------------------------------------------------------------*/ |
| 8203 | eHalStatus sme_SetTmLevel(tHalHandle hHal, v_U16_t newTMLevel, v_U16_t tmMode) |
| 8204 | { |
| 8205 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8206 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 8207 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8208 | vos_msg_t vosMessage; |
| 8209 | tAniSetTmLevelReq *setTmLevelReq = NULL; |
| 8210 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8211 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8212 | TRACE_CODE_SME_RX_HDD_SET_TMLEVEL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8213 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8214 | { |
| 8215 | setTmLevelReq = (tAniSetTmLevelReq *)vos_mem_malloc(sizeof(tAniSetTmLevelReq)); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8216 | if (NULL == setTmLevelReq) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8217 | { |
| 8218 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8219 | "%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] | 8220 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8221 | return eHAL_STATUS_FAILURE; |
| 8222 | } |
| 8223 | |
| 8224 | setTmLevelReq->tmMode = tmMode; |
| 8225 | setTmLevelReq->newTmLevel = newTMLevel; |
| 8226 | |
| 8227 | /* serialize the req through MC thread */ |
| 8228 | vosMessage.bodyptr = setTmLevelReq; |
| 8229 | vosMessage.type = WDA_SET_TM_LEVEL_REQ; |
| 8230 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 8231 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 8232 | { |
| 8233 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8234 | "%s: Post Set TM Level MSG fail", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8235 | vos_mem_free(setTmLevelReq); |
| 8236 | status = eHAL_STATUS_FAILURE; |
| 8237 | } |
| 8238 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8239 | } |
| 8240 | return(status); |
| 8241 | } |
| 8242 | |
| 8243 | /*--------------------------------------------------------------------------- |
| 8244 | |
| 8245 | \brief sme_featureCapsExchange() - SME interface to exchange capabilities between |
| 8246 | Host and FW. |
| 8247 | |
| 8248 | \param hHal - HAL handle for device |
| 8249 | |
| 8250 | \return NONE |
| 8251 | |
| 8252 | ---------------------------------------------------------------------------*/ |
| 8253 | void sme_featureCapsExchange( tHalHandle hHal) |
| 8254 | { |
| 8255 | 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] | 8256 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8257 | TRACE_CODE_SME_RX_HDD_CAPS_EXCH, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8258 | WDA_featureCapsExchange(vosContext); |
| 8259 | } |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8260 | |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 8261 | /*--------------------------------------------------------------------------- |
| 8262 | |
| 8263 | \brief sme_disableFeatureCapablity() - SME interface to disable Active mode offload capablity |
| 8264 | in Host. |
| 8265 | |
| 8266 | \param hHal - HAL handle for device |
| 8267 | |
| 8268 | \return NONE |
| 8269 | |
| 8270 | ---------------------------------------------------------------------------*/ |
| 8271 | void sme_disableFeatureCapablity(tANI_U8 feature_index) |
| 8272 | { |
| 8273 | WDA_disableCapablityFeature(feature_index); |
| 8274 | } |
| 8275 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8276 | /* --------------------------------------------------------------------------- |
| 8277 | |
| 8278 | \fn sme_GetDefaultCountryCode |
| 8279 | |
| 8280 | \brief Get the default country code from NV |
| 8281 | |
| 8282 | \param hHal |
| 8283 | \param pCountry |
| 8284 | \- return eHalStatus |
| 8285 | |
| 8286 | -------------------------------------------------------------------------------*/ |
| 8287 | eHalStatus sme_GetDefaultCountryCodeFrmNv(tHalHandle hHal, tANI_U8 *pCountry) |
| 8288 | { |
| 8289 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8290 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8291 | TRACE_CODE_SME_RX_HDD_GET_DEFCCNV, NO_SESSION, 0)); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8292 | return csrGetDefaultCountryCodeFrmNv(pMac, pCountry); |
| 8293 | } |
| 8294 | |
| 8295 | /* --------------------------------------------------------------------------- |
| 8296 | |
| 8297 | \fn sme_GetCurrentCountryCode |
| 8298 | |
| 8299 | \brief Get the current country code |
| 8300 | |
| 8301 | \param hHal |
| 8302 | \param pCountry |
| 8303 | \- return eHalStatus |
| 8304 | |
| 8305 | -------------------------------------------------------------------------------*/ |
| 8306 | eHalStatus sme_GetCurrentCountryCode(tHalHandle hHal, tANI_U8 *pCountry) |
| 8307 | { |
| 8308 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8309 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8310 | TRACE_CODE_SME_RX_HDD_GET_CURCC, NO_SESSION, 0)); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8311 | return csrGetCurrentCountryCode(pMac, pCountry); |
| 8312 | } |
| 8313 | |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 8314 | /* --------------------------------------------------------------------------- |
| 8315 | \fn sme_transportDebug |
| 8316 | \brief Dynamically monitoring Transport channels |
| 8317 | Private IOCTL will querry transport channel status if driver loaded |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 8318 | \param hHal Upper MAC context |
Jeff Johnson | b88db98 | 2012-12-10 13:34:59 -0800 | [diff] [blame] | 8319 | \param displaySnapshot Display transport channel snapshot option |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 8320 | \param toggleStallDetect Enable stall detect feature |
| 8321 | This feature will take effect to data performance |
| 8322 | Not integrate till fully verification |
| 8323 | \- return NONE |
| 8324 | -------------------------------------------------------------------------*/ |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 8325 | 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] | 8326 | { |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 8327 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8328 | |
| 8329 | if (NULL == pMac) |
| 8330 | { |
| 8331 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8332 | "%s: invalid context", __func__); |
| 8333 | return; |
| 8334 | } |
| 8335 | WDA_TransportChannelDebug(pMac, displaySnapshot, toggleStallDetect); |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 8336 | } |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 8337 | |
Kiran | 4a17ebe | 2013-01-31 10:43:43 -0800 | [diff] [blame] | 8338 | /* --------------------------------------------------------------------------- |
| 8339 | \fn sme_ResetPowerValuesFor5G |
| 8340 | \brief Reset the power values for 5G band with NV power values. |
| 8341 | \param hHal - HAL handle for device |
| 8342 | \- return NONE |
| 8343 | -------------------------------------------------------------------------*/ |
| 8344 | void sme_ResetPowerValuesFor5G (tHalHandle hHal) |
| 8345 | { |
| 8346 | tpAniSirGlobal pMac = PMAC_STRUCT (hHal); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8347 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8348 | TRACE_CODE_SME_RX_HDD_RESET_PW5G, NO_SESSION, 0)); |
Kiran | 4a17ebe | 2013-01-31 10:43:43 -0800 | [diff] [blame] | 8349 | csrSaveChannelPowerForBand(pMac, eANI_BOOLEAN_TRUE); |
| 8350 | csrApplyPower2Current(pMac); // Store the channel+power info in the global place: Cfg |
| 8351 | } |
| 8352 | |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 8353 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) |
| 8354 | /* --------------------------------------------------------------------------- |
| 8355 | \fn sme_UpdateRoamPrefer5GHz |
| 8356 | \brief enable/disable Roam prefer 5G runtime option |
| 8357 | This function is called through dynamic setConfig callback function |
| 8358 | to configure the Roam prefer 5G runtime option |
| 8359 | \param hHal - HAL handle for device |
| 8360 | \param nRoamPrefer5GHz Enable/Disable Roam prefer 5G runtime option |
| 8361 | \- return Success or failure |
| 8362 | -------------------------------------------------------------------------*/ |
| 8363 | |
| 8364 | eHalStatus sme_UpdateRoamPrefer5GHz(tHalHandle hHal, v_BOOL_t nRoamPrefer5GHz) |
| 8365 | { |
| 8366 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8367 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8368 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8369 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8370 | TRACE_CODE_SME_RX_HDD_UPDATE_RP5G, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8371 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8372 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8373 | { |
| 8374 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8375 | "%s: gRoamPrefer5GHz is changed from %d to %d", __func__, |
| 8376 | pMac->roam.configParam.nRoamPrefer5GHz, |
| 8377 | nRoamPrefer5GHz); |
| 8378 | pMac->roam.configParam.nRoamPrefer5GHz = nRoamPrefer5GHz; |
| 8379 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8380 | } |
| 8381 | |
| 8382 | return status ; |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 8383 | } |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 8384 | |
| 8385 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8386 | \fn sme_setRoamIntraBand |
| 8387 | \brief enable/disable Intra band roaming |
| 8388 | This function is called through dynamic setConfig callback function |
| 8389 | to configure the intra band roaming |
| 8390 | \param hHal - HAL handle for device |
| 8391 | \param nRoamIntraBand Enable/Disable Intra band roaming |
| 8392 | \- return Success or failure |
| 8393 | -------------------------------------------------------------------------*/ |
| 8394 | eHalStatus sme_setRoamIntraBand(tHalHandle hHal, const v_BOOL_t nRoamIntraBand) |
| 8395 | { |
| 8396 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8397 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8398 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8399 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8400 | TRACE_CODE_SME_RX_HDD_SET_ROAMIBAND, NO_SESSION, 0)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8401 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8402 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8403 | { |
| 8404 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8405 | "%s: gRoamIntraBand is changed from %d to %d", __func__, |
| 8406 | pMac->roam.configParam.nRoamIntraBand, |
| 8407 | nRoamIntraBand); |
| 8408 | pMac->roam.configParam.nRoamIntraBand = nRoamIntraBand; |
| 8409 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8410 | } |
| 8411 | |
| 8412 | return status ; |
| 8413 | } |
| 8414 | |
| 8415 | /* --------------------------------------------------------------------------- |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8416 | \fn sme_UpdateRoamScanNProbes |
| 8417 | \brief function to update roam scan N probes |
| 8418 | This function is called through dynamic setConfig callback function |
| 8419 | to update roam scan N probes |
| 8420 | \param hHal - HAL handle for device |
| 8421 | \param nProbes number of probe requests to be sent out |
| 8422 | \- return Success or failure |
| 8423 | -------------------------------------------------------------------------*/ |
| 8424 | eHalStatus sme_UpdateRoamScanNProbes(tHalHandle hHal, const v_U8_t nProbes) |
| 8425 | { |
| 8426 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8427 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8428 | |
| 8429 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8430 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8431 | { |
| 8432 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8433 | "%s: gRoamScanNProbes is changed from %d to %d", __func__, |
| 8434 | pMac->roam.configParam.nProbes, |
| 8435 | nProbes); |
| 8436 | pMac->roam.configParam.nProbes = nProbes; |
| 8437 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8438 | } |
| 8439 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8440 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8441 | { |
| 8442 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 8443 | REASON_NPROBES_CHANGED); |
| 8444 | } |
| 8445 | #endif |
| 8446 | return status ; |
| 8447 | } |
| 8448 | |
| 8449 | /* --------------------------------------------------------------------------- |
| 8450 | \fn sme_UpdateRoamScanHomeAwayTime |
| 8451 | \brief function to update roam scan Home away time |
| 8452 | This function is called through dynamic setConfig callback function |
| 8453 | to update roam scan home away time |
| 8454 | \param hHal - HAL handle for device |
| 8455 | \param nRoamScanAwayTime Scan home away time |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 8456 | \param bSendOffloadCmd If TRUE then send offload command to firmware |
| 8457 | If FALSE then command is not sent to firmware |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8458 | \- return Success or failure |
| 8459 | -------------------------------------------------------------------------*/ |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 8460 | eHalStatus sme_UpdateRoamScanHomeAwayTime(tHalHandle hHal, const v_U16_t nRoamScanHomeAwayTime, |
| 8461 | const eAniBoolean bSendOffloadCmd) |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8462 | { |
| 8463 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8464 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8465 | |
| 8466 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8467 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8468 | { |
| 8469 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8470 | "%s: gRoamScanHomeAwayTime is changed from %d to %d", __func__, |
| 8471 | pMac->roam.configParam.nRoamScanHomeAwayTime, |
| 8472 | nRoamScanHomeAwayTime); |
| 8473 | pMac->roam.configParam.nRoamScanHomeAwayTime = nRoamScanHomeAwayTime; |
| 8474 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8475 | } |
| 8476 | |
| 8477 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 8478 | if (pMac->roam.configParam.isRoamOffloadScanEnabled && bSendOffloadCmd) |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8479 | { |
| 8480 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 8481 | REASON_HOME_AWAY_TIME_CHANGED); |
| 8482 | } |
| 8483 | #endif |
| 8484 | return status; |
| 8485 | } |
| 8486 | |
| 8487 | |
| 8488 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8489 | \fn sme_getRoamIntraBand |
| 8490 | \brief get Intra band roaming |
| 8491 | \param hHal - HAL handle for device |
| 8492 | \- return Success or failure |
| 8493 | -------------------------------------------------------------------------*/ |
| 8494 | v_BOOL_t sme_getRoamIntraBand(tHalHandle hHal) |
| 8495 | { |
| 8496 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8497 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8498 | TRACE_CODE_SME_RX_HDD_GET_ROAMIBAND, NO_SESSION, 0)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8499 | return pMac->roam.configParam.nRoamIntraBand; |
| 8500 | } |
| 8501 | |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8502 | /* --------------------------------------------------------------------------- |
| 8503 | \fn sme_getRoamScanNProbes |
| 8504 | \brief get N Probes |
| 8505 | \param hHal - HAL handle for device |
| 8506 | \- return Success or failure |
| 8507 | -------------------------------------------------------------------------*/ |
| 8508 | v_U8_t sme_getRoamScanNProbes(tHalHandle hHal) |
| 8509 | { |
| 8510 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8511 | return pMac->roam.configParam.nProbes; |
| 8512 | } |
| 8513 | |
| 8514 | /* --------------------------------------------------------------------------- |
| 8515 | \fn sme_getRoamScanHomeAwayTime |
| 8516 | \brief get Roam scan home away time |
| 8517 | \param hHal - HAL handle for device |
| 8518 | \- return Success or failure |
| 8519 | -------------------------------------------------------------------------*/ |
| 8520 | v_U16_t sme_getRoamScanHomeAwayTime(tHalHandle hHal) |
| 8521 | { |
| 8522 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8523 | return pMac->roam.configParam.nRoamScanHomeAwayTime; |
| 8524 | } |
| 8525 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8526 | |
| 8527 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 8528 | \fn sme_UpdateImmediateRoamRssiDiff |
| 8529 | \brief Update nImmediateRoamRssiDiff |
| 8530 | This function is called through dynamic setConfig callback function |
| 8531 | to configure nImmediateRoamRssiDiff |
| 8532 | Usage: adb shell iwpriv wlan0 setConfig gImmediateRoamRssiDiff=[0 .. 125] |
| 8533 | \param hHal - HAL handle for device |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8534 | \param nImmediateRoamRssiDiff - minimum rssi difference between potential |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 8535 | candidate and current AP. |
| 8536 | \- return Success or failure |
| 8537 | -------------------------------------------------------------------------*/ |
| 8538 | |
| 8539 | eHalStatus sme_UpdateImmediateRoamRssiDiff(tHalHandle hHal, v_U8_t nImmediateRoamRssiDiff) |
| 8540 | { |
| 8541 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8542 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8543 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8544 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8545 | TRACE_CODE_SME_RX_HDD_UPDATE_IMMRSSIDIFF, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8546 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8547 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8548 | { |
| 8549 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8550 | "LFR runtime successfully set immediate roam rssi diff to" |
| 8551 | "%d - old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8552 | nImmediateRoamRssiDiff, |
| 8553 | pMac->roam.configParam.nImmediateRoamRssiDiff, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8554 | macTraceGetNeighbourRoamState( |
| 8555 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8556 | pMac->roam.configParam.nImmediateRoamRssiDiff = nImmediateRoamRssiDiff; |
| 8557 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8558 | } |
| 8559 | |
| 8560 | return status ; |
| 8561 | } |
| 8562 | |
| 8563 | /* --------------------------------------------------------------------------- |
| 8564 | \fn sme_UpdateRoamRssiDiff |
| 8565 | \brief Update RoamRssiDiff |
| 8566 | This function is called through dynamic setConfig callback function |
| 8567 | to configure RoamRssiDiff |
| 8568 | Usage: adb shell iwpriv wlan0 setConfig RoamRssiDiff=[0 .. 125] |
| 8569 | \param hHal - HAL handle for device |
| 8570 | \param RoamRssiDiff - minimum rssi difference between potential |
| 8571 | candidate and current AP. |
| 8572 | \- return Success or failure |
| 8573 | -------------------------------------------------------------------------*/ |
| 8574 | |
| 8575 | eHalStatus sme_UpdateRoamRssiDiff(tHalHandle hHal, v_U8_t RoamRssiDiff) |
| 8576 | { |
| 8577 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8578 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8579 | |
| 8580 | status = sme_AcquireGlobalLock( &pMac->sme ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8581 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8582 | TRACE_CODE_SME_RX_HDD_UPDATE_RSSIDIFF, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8583 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8584 | { |
| 8585 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8586 | "LFR runtime successfully set roam rssi diff to %d" |
| 8587 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8588 | RoamRssiDiff, |
| 8589 | pMac->roam.configParam.RoamRssiDiff, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8590 | macTraceGetNeighbourRoamState( |
| 8591 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8592 | pMac->roam.configParam.RoamRssiDiff = RoamRssiDiff; |
| 8593 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8594 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 8595 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8596 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8597 | { |
| 8598 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_RSSI_DIFF_CHANGED); |
| 8599 | } |
| 8600 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8601 | return status ; |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 8602 | } |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8603 | |
| 8604 | /*-------------------------------------------------------------------------- |
| 8605 | \brief sme_UpdateFastTransitionEnabled() - enable/disable Fast Transition support at runtime |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8606 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8607 | isFastTransitionEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8608 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8609 | \param hHal - The handle returned by macOpen. |
| 8610 | \return eHAL_STATUS_SUCCESS - SME update isFastTransitionEnabled config successfully. |
| 8611 | Other status means SME is failed to update isFastTransitionEnabled. |
| 8612 | \sa |
| 8613 | --------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8614 | eHalStatus sme_UpdateFastTransitionEnabled(tHalHandle hHal, |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8615 | v_BOOL_t isFastTransitionEnabled) |
| 8616 | { |
| 8617 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8618 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8619 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8620 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8621 | TRACE_CODE_SME_RX_HDD_UPDATE_FTENABLED, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8622 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8623 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8624 | { |
| 8625 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8626 | "%s: FastTransitionEnabled is changed from %d to %d", __func__, |
| 8627 | pMac->roam.configParam.isFastTransitionEnabled, |
| 8628 | isFastTransitionEnabled); |
| 8629 | pMac->roam.configParam.isFastTransitionEnabled = isFastTransitionEnabled; |
| 8630 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8631 | } |
| 8632 | |
| 8633 | return status ; |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8634 | } |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 8635 | |
| 8636 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 8637 | \fn sme_UpdateWESMode |
| 8638 | \brief Update WES Mode |
| 8639 | This function is called through dynamic setConfig callback function |
| 8640 | to configure isWESModeEnabled |
| 8641 | \param hHal - HAL handle for device |
| 8642 | \return eHAL_STATUS_SUCCESS - SME update isWESModeEnabled config successfully. |
| 8643 | Other status means SME is failed to update isWESModeEnabled. |
| 8644 | -------------------------------------------------------------------------*/ |
| 8645 | |
| 8646 | eHalStatus sme_UpdateWESMode(tHalHandle hHal, v_BOOL_t isWESModeEnabled) |
| 8647 | { |
| 8648 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8649 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8650 | |
| 8651 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8652 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8653 | { |
| 8654 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8655 | "LFR runtime successfully set WES Mode to %d" |
| 8656 | "- old value is %d - roam state is %s", |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 8657 | isWESModeEnabled, |
| 8658 | pMac->roam.configParam.isWESModeEnabled, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8659 | macTraceGetNeighbourRoamState( |
| 8660 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 8661 | pMac->roam.configParam.isWESModeEnabled = isWESModeEnabled; |
| 8662 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8663 | } |
| 8664 | |
| 8665 | return status ; |
| 8666 | } |
| 8667 | |
| 8668 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 8669 | \fn sme_SetRoamScanControl |
| 8670 | \brief Set roam scan control |
| 8671 | This function is called to set roam scan control |
| 8672 | if roam scan control is set to 0, roaming scan cache is cleared |
| 8673 | any value other than 0 is treated as invalid value |
| 8674 | \param hHal - HAL handle for device |
| 8675 | \return eHAL_STATUS_SUCCESS - SME update config successfully. |
| 8676 | Other status means SME failure to update |
| 8677 | -------------------------------------------------------------------------*/ |
| 8678 | eHalStatus sme_SetRoamScanControl(tHalHandle hHal, v_BOOL_t roamScanControl) |
| 8679 | { |
| 8680 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8681 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8682 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8683 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8684 | TRACE_CODE_SME_RX_HDD_SET_SCANCTRL, NO_SESSION, 0)); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 8685 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8686 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8687 | { |
| 8688 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8689 | "LFR runtime successfully set roam scan control to %d" |
| 8690 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 8691 | roamScanControl, |
| 8692 | pMac->roam.configParam.nRoamScanControl, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8693 | macTraceGetNeighbourRoamState( |
| 8694 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 8695 | pMac->roam.configParam.nRoamScanControl = roamScanControl; |
| 8696 | if ( 0 == roamScanControl) |
| 8697 | { |
| 8698 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 8699 | "LFR runtime successfully cleared roam scan cache"); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 8700 | csrFlushCfgBgScanRoamChannelList(pMac); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 8701 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8702 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8703 | { |
| 8704 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_FLUSH_CHANNEL_LIST); |
| 8705 | } |
| 8706 | #endif |
| 8707 | } |
| 8708 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8709 | } |
| 8710 | return status ; |
| 8711 | } |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8712 | #endif /* (WLAN_FEATURE_VOWIFI_11R) || (FEATURE_WLAN_CCX) || (FEATURE_WLAN_LFR) */ |
| 8713 | |
| 8714 | #ifdef FEATURE_WLAN_LFR |
| 8715 | /*-------------------------------------------------------------------------- |
| 8716 | \brief sme_UpdateIsFastRoamIniFeatureEnabled() - enable/disable LFR support at runtime |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8717 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8718 | isFastRoamIniFeatureEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8719 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8720 | \param hHal - The handle returned by macOpen. |
| 8721 | \return eHAL_STATUS_SUCCESS - SME update isFastRoamIniFeatureEnabled config successfully. |
| 8722 | Other status means SME is failed to update isFastRoamIniFeatureEnabled. |
| 8723 | \sa |
| 8724 | --------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8725 | eHalStatus sme_UpdateIsFastRoamIniFeatureEnabled(tHalHandle hHal, |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8726 | const v_BOOL_t isFastRoamIniFeatureEnabled) |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8727 | { |
| 8728 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8729 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8730 | if (pMac->roam.configParam.isFastRoamIniFeatureEnabled == isFastRoamIniFeatureEnabled) |
| 8731 | { |
| 8732 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8733 | "%s: FastRoam is already enabled or disabled, nothing to do (returning) old(%d) new(%d)", __func__, |
| 8734 | pMac->roam.configParam.isFastRoamIniFeatureEnabled, |
| 8735 | isFastRoamIniFeatureEnabled); |
| 8736 | return eHAL_STATUS_SUCCESS; |
| 8737 | } |
| 8738 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8739 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8740 | "%s: FastRoamEnabled is changed from %d to %d", __func__, |
| 8741 | pMac->roam.configParam.isFastRoamIniFeatureEnabled, |
| 8742 | isFastRoamIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8743 | pMac->roam.configParam.isFastRoamIniFeatureEnabled = isFastRoamIniFeatureEnabled; |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8744 | csrNeighborRoamUpdateFastRoamingEnabled(pMac, isFastRoamIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8745 | |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8746 | return eHAL_STATUS_SUCCESS; |
| 8747 | } |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 8748 | |
Sameer Thalappil | 4ae66ec | 2013-11-05 14:17:35 -0800 | [diff] [blame] | 8749 | /*-------------------------------------------------------------------------- |
| 8750 | \brief sme_UpdateIsMAWCIniFeatureEnabled() - |
| 8751 | Enable/disable LFR MAWC support at runtime |
| 8752 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 8753 | isMAWCIniFeatureEnabled. |
| 8754 | This is a synchronous call |
| 8755 | \param hHal - The handle returned by macOpen. |
| 8756 | \return eHAL_STATUS_SUCCESS - SME update MAWCEnabled config successfully. |
| 8757 | Other status means SME is failed to update MAWCEnabled. |
| 8758 | \sa |
| 8759 | --------------------------------------------------------------------------*/ |
| 8760 | eHalStatus sme_UpdateIsMAWCIniFeatureEnabled(tHalHandle hHal, |
| 8761 | const v_BOOL_t MAWCEnabled) |
| 8762 | { |
| 8763 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8764 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8765 | |
| 8766 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8767 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8768 | { |
| 8769 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8770 | "%s: MAWCEnabled is changed from %d to %d", __func__, |
| 8771 | pMac->roam.configParam.MAWCEnabled, |
| 8772 | MAWCEnabled); |
| 8773 | pMac->roam.configParam.MAWCEnabled = MAWCEnabled; |
| 8774 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8775 | } |
| 8776 | |
| 8777 | return status ; |
| 8778 | |
| 8779 | } |
| 8780 | |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 8781 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8782 | /*-------------------------------------------------------------------------- |
| 8783 | \brief sme_UpdateEnableFastRoamInConcurrency() - enable/disable LFR if Concurrent session exists |
| 8784 | This is a synchronuous call |
| 8785 | \param hHal - The handle returned by macOpen. |
| 8786 | \return eHAL_STATUS_SUCCESS |
| 8787 | Other status means SME is failed |
| 8788 | \sa |
| 8789 | --------------------------------------------------------------------------*/ |
| 8790 | |
| 8791 | eHalStatus sme_UpdateEnableFastRoamInConcurrency(tHalHandle hHal, |
| 8792 | v_BOOL_t bFastRoamInConIniFeatureEnabled) |
| 8793 | { |
| 8794 | |
| 8795 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8796 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8797 | |
| 8798 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8799 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8800 | { |
| 8801 | pMac->roam.configParam.bFastRoamInConIniFeatureEnabled = bFastRoamInConIniFeatureEnabled; |
| 8802 | if (0 == pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8803 | { |
| 8804 | pMac->roam.configParam.bFastRoamInConIniFeatureEnabled = 0; |
| 8805 | } |
| 8806 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8807 | } |
| 8808 | |
| 8809 | return status; |
| 8810 | } |
| 8811 | #endif |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8812 | #endif /* FEATURE_WLAN_LFR */ |
| 8813 | |
| 8814 | #ifdef FEATURE_WLAN_CCX |
| 8815 | /*-------------------------------------------------------------------------- |
| 8816 | \brief sme_UpdateIsCcxFeatureEnabled() - enable/disable CCX support at runtime |
| 8817 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 8818 | isCcxIniFeatureEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8819 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8820 | \param hHal - The handle returned by macOpen. |
| 8821 | \return eHAL_STATUS_SUCCESS - SME update isCcxIniFeatureEnabled config successfully. |
| 8822 | Other status means SME is failed to update isCcxIniFeatureEnabled. |
| 8823 | \sa |
| 8824 | --------------------------------------------------------------------------*/ |
| 8825 | |
| 8826 | eHalStatus sme_UpdateIsCcxFeatureEnabled(tHalHandle hHal, |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8827 | const v_BOOL_t isCcxIniFeatureEnabled) |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8828 | { |
| 8829 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8830 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8831 | if (pMac->roam.configParam.isCcxIniFeatureEnabled == isCcxIniFeatureEnabled) |
| 8832 | { |
| 8833 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8834 | "%s: CCX Mode is already enabled or disabled, nothing to do (returning) old(%d) new(%d)", __func__, |
| 8835 | pMac->roam.configParam.isCcxIniFeatureEnabled, |
| 8836 | isCcxIniFeatureEnabled); |
| 8837 | return eHAL_STATUS_SUCCESS; |
| 8838 | } |
| 8839 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8840 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8841 | "%s: CcxEnabled is changed from %d to %d", __func__, |
| 8842 | pMac->roam.configParam.isCcxIniFeatureEnabled, |
| 8843 | isCcxIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8844 | pMac->roam.configParam.isCcxIniFeatureEnabled = isCcxIniFeatureEnabled; |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8845 | csrNeighborRoamUpdateCcxModeEnabled(pMac, isCcxIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8846 | |
| 8847 | if(TRUE == isCcxIniFeatureEnabled) |
| 8848 | { |
| 8849 | sme_UpdateFastTransitionEnabled(hHal, TRUE); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8850 | } |
Srinivas Girigowda | ba17369 | 2013-08-07 11:55:38 -0700 | [diff] [blame] | 8851 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 8852 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8853 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8854 | { |
| 8855 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CCX_INI_CFG_CHANGED); |
| 8856 | } |
| 8857 | #endif |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8858 | return eHAL_STATUS_SUCCESS; |
| 8859 | } |
| 8860 | #endif /* FEATURE_WLAN_CCX */ |
| 8861 | |
| 8862 | /*-------------------------------------------------------------------------- |
| 8863 | \brief sme_UpdateConfigFwRssiMonitoring() - enable/disable firmware RSSI Monitoring at runtime |
| 8864 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 8865 | fEnableFwRssiMonitoring. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8866 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8867 | \param hHal - The handle returned by macOpen. |
| 8868 | \return eHAL_STATUS_SUCCESS - SME update fEnableFwRssiMonitoring. config successfully. |
| 8869 | Other status means SME is failed to update fEnableFwRssiMonitoring. |
| 8870 | \sa |
| 8871 | --------------------------------------------------------------------------*/ |
| 8872 | |
| 8873 | eHalStatus sme_UpdateConfigFwRssiMonitoring(tHalHandle hHal, |
| 8874 | v_BOOL_t fEnableFwRssiMonitoring) |
| 8875 | { |
| 8876 | eHalStatus halStatus = eHAL_STATUS_SUCCESS; |
| 8877 | |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8878 | if (ccmCfgSetInt(hHal, WNI_CFG_PS_ENABLE_RSSI_MONITOR, fEnableFwRssiMonitoring, |
| 8879 | NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE) |
| 8880 | { |
| 8881 | halStatus = eHAL_STATUS_FAILURE; |
| 8882 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8883 | "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] | 8884 | } |
| 8885 | |
| 8886 | return (halStatus); |
| 8887 | } |
| 8888 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8889 | #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8890 | /*-------------------------------------------------------------------------- |
| 8891 | \brief sme_setNeighborLookupRssiThreshold() - update neighbor lookup rssi threshold |
| 8892 | This is a synchronous call |
| 8893 | \param hHal - The handle returned by macOpen. |
| 8894 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 8895 | Other status means SME is failed to update |
| 8896 | \sa |
| 8897 | --------------------------------------------------------------------------*/ |
| 8898 | eHalStatus sme_setNeighborLookupRssiThreshold(tHalHandle hHal, |
| 8899 | v_U8_t neighborLookupRssiThreshold) |
| 8900 | { |
| 8901 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8902 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8903 | |
| 8904 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8905 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8906 | { |
| 8907 | status = csrNeighborRoamSetLookupRssiThreshold(pMac, neighborLookupRssiThreshold); |
| 8908 | if (HAL_STATUS_SUCCESS(status)) |
| 8909 | { |
| 8910 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8911 | "LFR runtime successfully set Lookup threshold to %d" |
| 8912 | " - old value is %d - roam state is %s", |
| 8913 | neighborLookupRssiThreshold, |
| 8914 | pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold, |
| 8915 | macTraceGetNeighbourRoamState( |
| 8916 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8917 | pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold = |
| 8918 | neighborLookupRssiThreshold; |
| 8919 | } |
| 8920 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8921 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8922 | return status; |
| 8923 | } |
| 8924 | |
| 8925 | /*-------------------------------------------------------------------------- |
| 8926 | \brief sme_setNeighborReassocRssiThreshold() - update neighbor reassoc rssi threshold |
| 8927 | This is a synchronous call |
| 8928 | \param hHal - The handle returned by macOpen. |
| 8929 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 8930 | Other status means SME is failed to update |
| 8931 | \sa |
| 8932 | --------------------------------------------------------------------------*/ |
| 8933 | eHalStatus sme_setNeighborReassocRssiThreshold(tHalHandle hHal, |
| 8934 | v_U8_t neighborReassocRssiThreshold) |
| 8935 | { |
| 8936 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8937 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8938 | |
| 8939 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8940 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8941 | { |
| 8942 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8943 | "LFR runtime successfully set Reassoc threshold to %d" |
| 8944 | "- old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8945 | neighborReassocRssiThreshold, |
| 8946 | pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8947 | macTraceGetNeighbourRoamState( |
| 8948 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8949 | pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold = |
| 8950 | neighborReassocRssiThreshold; |
| 8951 | pMac->roam.neighborRoamInfo.cfgParams.neighborReassocThreshold = |
| 8952 | neighborReassocRssiThreshold; |
| 8953 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8954 | } |
| 8955 | |
| 8956 | return status ; |
| 8957 | } |
| 8958 | |
| 8959 | |
| 8960 | /*-------------------------------------------------------------------------- |
| 8961 | \brief sme_getNeighborLookupRssiThreshold() - get neighbor lookup rssi threshold |
| 8962 | This is a synchronous call |
| 8963 | \param hHal - The handle returned by macOpen. |
| 8964 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 8965 | Other status means SME is failed to update |
| 8966 | \sa |
| 8967 | --------------------------------------------------------------------------*/ |
| 8968 | v_U8_t sme_getNeighborLookupRssiThreshold(tHalHandle hHal) |
| 8969 | { |
| 8970 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8971 | return pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold; |
| 8972 | } |
| 8973 | |
| 8974 | /*-------------------------------------------------------------------------- |
| 8975 | \brief sme_setNeighborScanRefreshPeriod() - set neighbor scan results refresh period |
| 8976 | This is a synchronous call |
| 8977 | \param hHal - The handle returned by macOpen. |
| 8978 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 8979 | Other status means SME is failed to update |
| 8980 | \sa |
| 8981 | --------------------------------------------------------------------------*/ |
| 8982 | eHalStatus sme_setNeighborScanRefreshPeriod(tHalHandle hHal, |
| 8983 | v_U16_t neighborScanResultsRefreshPeriod) |
| 8984 | { |
| 8985 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8986 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8987 | |
| 8988 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8989 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8990 | { |
| 8991 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8992 | "LFR runtime successfully set roam scan refresh period to %d" |
| 8993 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8994 | neighborScanResultsRefreshPeriod, |
| 8995 | pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8996 | macTraceGetNeighbourRoamState( |
| 8997 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8998 | pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod = |
| 8999 | neighborScanResultsRefreshPeriod; |
| 9000 | pMac->roam.neighborRoamInfo.cfgParams.neighborResultsRefreshPeriod = |
| 9001 | neighborScanResultsRefreshPeriod; |
| 9002 | |
| 9003 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9004 | } |
| 9005 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9006 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9007 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9008 | { |
| 9009 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9010 | REASON_NEIGHBOR_SCAN_REFRESH_PERIOD_CHANGED); |
| 9011 | } |
| 9012 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9013 | return status ; |
| 9014 | } |
| 9015 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9016 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9017 | /*-------------------------------------------------------------------------- |
| 9018 | \brief sme_UpdateRoamScanOffloadEnabled() - enable/disable roam scan offload feaure |
| 9019 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 9020 | gRoamScanOffloadEnabled. |
| 9021 | This is a synchronous call |
| 9022 | \param hHal - The handle returned by macOpen. |
| 9023 | \return eHAL_STATUS_SUCCESS - SME update config successfully. |
| 9024 | Other status means SME is failed to update. |
| 9025 | \sa |
| 9026 | --------------------------------------------------------------------------*/ |
| 9027 | |
| 9028 | eHalStatus sme_UpdateRoamScanOffloadEnabled(tHalHandle hHal, |
| 9029 | v_BOOL_t nRoamScanOffloadEnabled) |
| 9030 | { |
| 9031 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9032 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9033 | |
| 9034 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9035 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9036 | { |
| 9037 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9038 | "%s: gRoamScanOffloadEnabled is changed from %d to %d", __func__, |
| 9039 | pMac->roam.configParam.isRoamOffloadScanEnabled, |
| 9040 | nRoamScanOffloadEnabled); |
| 9041 | pMac->roam.configParam.isRoamOffloadScanEnabled = nRoamScanOffloadEnabled; |
| 9042 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9043 | } |
| 9044 | |
| 9045 | return status ; |
| 9046 | } |
| 9047 | #endif |
| 9048 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9049 | /*-------------------------------------------------------------------------- |
| 9050 | \brief sme_getNeighborScanRefreshPeriod() - get neighbor scan results refresh period |
| 9051 | This is a synchronous call |
| 9052 | \param hHal - The handle returned by macOpen. |
| 9053 | \return v_U16_t - Neighbor scan results refresh period value |
| 9054 | \sa |
| 9055 | --------------------------------------------------------------------------*/ |
| 9056 | v_U16_t sme_getNeighborScanRefreshPeriod(tHalHandle hHal) |
| 9057 | { |
| 9058 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9059 | return pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod; |
| 9060 | } |
| 9061 | |
| 9062 | /*-------------------------------------------------------------------------- |
| 9063 | \brief sme_getEmptyScanRefreshPeriod() - get empty scan refresh period |
| 9064 | This is a synchronuous call |
| 9065 | \param hHal - The handle returned by macOpen. |
| 9066 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9067 | Other status means SME is failed to update |
| 9068 | \sa |
| 9069 | --------------------------------------------------------------------------*/ |
| 9070 | v_U16_t sme_getEmptyScanRefreshPeriod(tHalHandle hHal) |
| 9071 | { |
| 9072 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9073 | return pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod; |
| 9074 | } |
| 9075 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9076 | /* --------------------------------------------------------------------------- |
| 9077 | \fn sme_UpdateEmptyScanRefreshPeriod |
| 9078 | \brief Update nEmptyScanRefreshPeriod |
| 9079 | This function is called through dynamic setConfig callback function |
| 9080 | to configure nEmptyScanRefreshPeriod |
| 9081 | Usage: adb shell iwpriv wlan0 setConfig nEmptyScanRefreshPeriod=[0 .. 60] |
| 9082 | \param hHal - HAL handle for device |
| 9083 | \param nEmptyScanRefreshPeriod - scan period following empty scan results. |
| 9084 | \- return Success or failure |
| 9085 | -------------------------------------------------------------------------*/ |
| 9086 | |
| 9087 | eHalStatus sme_UpdateEmptyScanRefreshPeriod(tHalHandle hHal, v_U16_t nEmptyScanRefreshPeriod) |
| 9088 | { |
| 9089 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9090 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9091 | |
| 9092 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9093 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9094 | { |
| 9095 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9096 | "LFR runtime successfully set roam scan period to %d -" |
| 9097 | "old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9098 | nEmptyScanRefreshPeriod, |
| 9099 | pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9100 | macTraceGetNeighbourRoamState( |
| 9101 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9102 | pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod = nEmptyScanRefreshPeriod; |
| 9103 | pMac->roam.neighborRoamInfo.cfgParams.emptyScanRefreshPeriod = nEmptyScanRefreshPeriod; |
| 9104 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9105 | } |
| 9106 | |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9107 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9108 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9109 | { |
| 9110 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9111 | REASON_EMPTY_SCAN_REF_PERIOD_CHANGED); |
| 9112 | } |
| 9113 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9114 | return status ; |
| 9115 | } |
| 9116 | |
| 9117 | /* --------------------------------------------------------------------------- |
| 9118 | \fn sme_setNeighborScanMinChanTime |
| 9119 | \brief Update nNeighborScanMinChanTime |
| 9120 | This function is called through dynamic setConfig callback function |
| 9121 | to configure gNeighborScanChannelMinTime |
| 9122 | Usage: adb shell iwpriv wlan0 setConfig gNeighborScanChannelMinTime=[0 .. 60] |
| 9123 | \param hHal - HAL handle for device |
| 9124 | \param nNeighborScanMinChanTime - Channel minimum dwell time |
| 9125 | \- return Success or failure |
| 9126 | -------------------------------------------------------------------------*/ |
| 9127 | eHalStatus sme_setNeighborScanMinChanTime(tHalHandle hHal, const v_U16_t nNeighborScanMinChanTime) |
| 9128 | { |
| 9129 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9130 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9131 | |
| 9132 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9133 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9134 | { |
| 9135 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9136 | "LFR runtime successfully set channel min dwell time to %d" |
| 9137 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9138 | nNeighborScanMinChanTime, |
| 9139 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9140 | macTraceGetNeighbourRoamState( |
| 9141 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9142 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime = nNeighborScanMinChanTime; |
| 9143 | pMac->roam.neighborRoamInfo.cfgParams.minChannelScanTime = nNeighborScanMinChanTime; |
| 9144 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9145 | } |
| 9146 | |
| 9147 | return status ; |
| 9148 | } |
| 9149 | |
| 9150 | /* --------------------------------------------------------------------------- |
| 9151 | \fn sme_setNeighborScanMaxChanTime |
| 9152 | \brief Update nNeighborScanMaxChanTime |
| 9153 | This function is called through dynamic setConfig callback function |
| 9154 | to configure gNeighborScanChannelMaxTime |
| 9155 | Usage: adb shell iwpriv wlan0 setConfig gNeighborScanChannelMaxTime=[0 .. 60] |
| 9156 | \param hHal - HAL handle for device |
| 9157 | \param nNeighborScanMinChanTime - Channel maximum dwell time |
| 9158 | \- return Success or failure |
| 9159 | -------------------------------------------------------------------------*/ |
| 9160 | eHalStatus sme_setNeighborScanMaxChanTime(tHalHandle hHal, const v_U16_t nNeighborScanMaxChanTime) |
| 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 channel max dwell time to %d" |
| 9170 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9171 | nNeighborScanMaxChanTime, |
| 9172 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMaxChanTime, |
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.nNeighborScanMaxChanTime = nNeighborScanMaxChanTime; |
| 9176 | pMac->roam.neighborRoamInfo.cfgParams.maxChannelScanTime = nNeighborScanMaxChanTime; |
| 9177 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9178 | } |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9179 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9180 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9181 | { |
| 9182 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9183 | REASON_SCAN_CH_TIME_CHANGED); |
| 9184 | } |
| 9185 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9186 | |
| 9187 | return status ; |
| 9188 | } |
| 9189 | |
| 9190 | /* --------------------------------------------------------------------------- |
| 9191 | \fn sme_getNeighborScanMinChanTime |
| 9192 | \brief get neighbor scan min channel time |
| 9193 | \param hHal - The handle returned by macOpen. |
| 9194 | \return v_U16_t - channel min time value |
| 9195 | -------------------------------------------------------------------------*/ |
| 9196 | v_U16_t sme_getNeighborScanMinChanTime(tHalHandle hHal) |
| 9197 | { |
| 9198 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9199 | return pMac->roam.neighborRoamInfo.cfgParams.minChannelScanTime; |
| 9200 | } |
| 9201 | |
| 9202 | /* --------------------------------------------------------------------------- |
| 9203 | \fn sme_getNeighborScanMaxChanTime |
| 9204 | \brief get neighbor scan max channel time |
| 9205 | \param hHal - The handle returned by macOpen. |
| 9206 | \return v_U16_t - channel max time value |
| 9207 | -------------------------------------------------------------------------*/ |
| 9208 | v_U16_t sme_getNeighborScanMaxChanTime(tHalHandle hHal) |
| 9209 | { |
| 9210 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9211 | return pMac->roam.neighborRoamInfo.cfgParams.maxChannelScanTime; |
| 9212 | } |
| 9213 | |
| 9214 | /* --------------------------------------------------------------------------- |
| 9215 | \fn sme_setNeighborScanPeriod |
| 9216 | \brief Update nNeighborScanPeriod |
| 9217 | This function is called through dynamic setConfig callback function |
| 9218 | to configure nNeighborScanPeriod |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9219 | Usage: adb shell iwpriv wlan0 setConfig nNeighborScanPeriod=[0 .. 1000] |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9220 | \param hHal - HAL handle for device |
| 9221 | \param nNeighborScanPeriod - neighbor scan period |
| 9222 | \- return Success or failure |
| 9223 | -------------------------------------------------------------------------*/ |
| 9224 | eHalStatus sme_setNeighborScanPeriod(tHalHandle hHal, const v_U16_t nNeighborScanPeriod) |
| 9225 | { |
| 9226 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9227 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9228 | |
| 9229 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9230 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9231 | { |
| 9232 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9233 | "LFR runtime successfully set neighbor scan period to %d" |
| 9234 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9235 | nNeighborScanPeriod, |
| 9236 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9237 | macTraceGetNeighbourRoamState( |
| 9238 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9239 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod = nNeighborScanPeriod; |
| 9240 | pMac->roam.neighborRoamInfo.cfgParams.neighborScanPeriod = nNeighborScanPeriod; |
| 9241 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9242 | } |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9243 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9244 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9245 | { |
| 9246 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9247 | REASON_SCAN_HOME_TIME_CHANGED); |
| 9248 | } |
| 9249 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9250 | |
| 9251 | return status ; |
| 9252 | } |
| 9253 | |
| 9254 | /* --------------------------------------------------------------------------- |
| 9255 | \fn sme_getNeighborScanPeriod |
| 9256 | \brief get neighbor scan period |
| 9257 | \param hHal - The handle returned by macOpen. |
| 9258 | \return v_U16_t - neighbor scan period |
| 9259 | -------------------------------------------------------------------------*/ |
| 9260 | v_U16_t sme_getNeighborScanPeriod(tHalHandle hHal) |
| 9261 | { |
| 9262 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9263 | return pMac->roam.neighborRoamInfo.cfgParams.neighborScanPeriod; |
| 9264 | } |
| 9265 | |
| 9266 | #endif |
| 9267 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9268 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9269 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9270 | /*-------------------------------------------------------------------------- |
| 9271 | \brief sme_getRoamRssiDiff() - get Roam rssi diff |
| 9272 | This is a synchronous call |
| 9273 | \param hHal - The handle returned by macOpen. |
| 9274 | \return v_U16_t - Rssi diff value |
| 9275 | \sa |
| 9276 | --------------------------------------------------------------------------*/ |
| 9277 | v_U8_t sme_getRoamRssiDiff(tHalHandle hHal) |
| 9278 | { |
| 9279 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9280 | return pMac->roam.configParam.RoamRssiDiff; |
| 9281 | } |
| 9282 | |
| 9283 | /*-------------------------------------------------------------------------- |
| 9284 | \brief sme_ChangeRoamScanChannelList() - Change roam scan channel list |
| 9285 | This is a synchronous call |
| 9286 | \param hHal - The handle returned by macOpen. |
| 9287 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9288 | Other status means SME is failed to update |
| 9289 | \sa |
| 9290 | --------------------------------------------------------------------------*/ |
| 9291 | eHalStatus sme_ChangeRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, |
| 9292 | tANI_U8 numChannels) |
| 9293 | { |
| 9294 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9295 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9296 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9297 | tANI_U8 oldChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
Kiet Lam | 600d3ca | 2013-08-31 16:33:32 +0530 | [diff] [blame] | 9298 | tANI_U8 newChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9299 | tANI_U8 i = 0, j = 0; |
| 9300 | |
| 9301 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9302 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9303 | { |
| 9304 | if (NULL != pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
| 9305 | { |
| 9306 | for (i = 0; i < pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; i++) |
| 9307 | { |
| 9308 | j += snprintf(oldChannelList + j, sizeof(oldChannelList) - j," %d", |
| 9309 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]); |
| 9310 | } |
| 9311 | } |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9312 | csrFlushCfgBgScanRoamChannelList(pMac); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9313 | csrCreateBgScanRoamChannelList(pMac, pChannelList, numChannels); |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9314 | sme_SetRoamScanControl(hHal, 1); |
| 9315 | if (NULL != pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9316 | { |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9317 | j = 0; |
| 9318 | for (i = 0; i < pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; i++) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9319 | { |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9320 | j += snprintf(newChannelList + j, sizeof(newChannelList) - j," %d", |
| 9321 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9322 | } |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9323 | } |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9324 | |
| 9325 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9326 | "LFR runtime successfully set roam scan channels to %s" |
| 9327 | "- old value is %s - roam state is %s", |
| 9328 | newChannelList, oldChannelList, |
| 9329 | macTraceGetNeighbourRoamState( |
| 9330 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9331 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9332 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9333 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9334 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9335 | { |
| 9336 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); |
| 9337 | } |
| 9338 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9339 | |
| 9340 | return status ; |
| 9341 | } |
| 9342 | |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9343 | |
| 9344 | #ifdef FEATURE_WLAN_CCX_UPLOAD |
| 9345 | /*-------------------------------------------------------------------------- |
| 9346 | \brief sme_SetCcxRoamScanChannelList() - set ccx roam scan channel list |
| 9347 | This is a synchronuous call |
| 9348 | \param hHal - The handle returned by macOpen. |
| 9349 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9350 | Other status means SME is failed to update |
| 9351 | \sa |
| 9352 | --------------------------------------------------------------------------*/ |
| 9353 | eHalStatus sme_SetCcxRoamScanChannelList(tHalHandle hHal, |
| 9354 | tANI_U8 *pChannelList, |
| 9355 | tANI_U8 numChannels) |
| 9356 | { |
| 9357 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9358 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9359 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 9360 | tpCsrChannelInfo currChannelListInfo = &pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo; |
| 9361 | tANI_U8 oldChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
| 9362 | tANI_U8 newChannelList[128] = {0}; |
| 9363 | tANI_U8 i = 0, j = 0; |
| 9364 | |
| 9365 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9366 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9367 | { |
| 9368 | if (NULL != currChannelListInfo->ChannelList) |
| 9369 | { |
| 9370 | for (i = 0; i < currChannelListInfo->numOfChannels; i++) |
| 9371 | { |
| 9372 | j += snprintf(oldChannelList + j, sizeof(oldChannelList) - j," %d", |
| 9373 | currChannelListInfo->ChannelList[i]); |
| 9374 | } |
| 9375 | } |
| 9376 | status = csrCreateRoamScanChannelList(pMac, pChannelList, numChannels, csrGetCurrentBand(hHal)); |
| 9377 | |
| 9378 | if ( HAL_STATUS_SUCCESS( status )) |
| 9379 | { |
| 9380 | if (NULL != currChannelListInfo->ChannelList) |
| 9381 | { |
| 9382 | j = 0; |
| 9383 | for (i = 0; i < currChannelListInfo->numOfChannels; i++) |
| 9384 | { |
| 9385 | j += snprintf(newChannelList + j, sizeof(newChannelList) - j," %d", |
| 9386 | currChannelListInfo->ChannelList[i]); |
| 9387 | } |
| 9388 | } |
| 9389 | |
| 9390 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9391 | "CCX roam scan channel list successfully set to %s" |
| 9392 | " - old value is %s - roam state is %s", |
| 9393 | newChannelList, oldChannelList, |
| 9394 | macTraceGetNeighbourRoamState( |
| 9395 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9396 | } |
| 9397 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9398 | } |
| 9399 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9400 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9401 | { |
| 9402 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); |
| 9403 | } |
| 9404 | #endif |
| 9405 | |
| 9406 | return status ; |
| 9407 | } |
| 9408 | #endif |
| 9409 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9410 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9411 | \brief sme_getRoamScanChannelList() - get roam scan channel list |
| 9412 | This is a synchronous call |
| 9413 | \param hHal - The handle returned by macOpen. |
| 9414 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9415 | Other status means SME is failed to update |
| 9416 | \sa |
| 9417 | --------------------------------------------------------------------------*/ |
| 9418 | eHalStatus sme_getRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, |
| 9419 | tANI_U8 *pNumChannels) |
| 9420 | { |
| 9421 | int i = 0; |
| 9422 | tANI_U8 *pOutPtr = pChannelList; |
| 9423 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9424 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 9425 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9426 | |
| 9427 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9428 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9429 | { |
| 9430 | if (NULL == pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
| 9431 | { |
| 9432 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, |
| 9433 | "Roam Scan channel list is NOT yet initialized"); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9434 | *pNumChannels = 0; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9435 | sme_ReleaseGlobalLock( &pMac->sme ); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9436 | return status; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9437 | } |
| 9438 | |
| 9439 | *pNumChannels = pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; |
| 9440 | for (i = 0; i < (*pNumChannels); i++) |
| 9441 | { |
| 9442 | pOutPtr[i] = pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]; |
| 9443 | } |
| 9444 | pOutPtr[i] = '\0'; |
| 9445 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9446 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9447 | return status ; |
| 9448 | } |
| 9449 | |
| 9450 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9451 | \brief sme_getIsCcxFeatureEnabled() - get CCX feature enabled or not |
| 9452 | This is a synchronuous call |
| 9453 | \param hHal - The handle returned by macOpen. |
| 9454 | \return TRUE (1) - if the CCX feature is enabled |
| 9455 | FALSE (0) - if feature is disabled (compile or runtime) |
| 9456 | \sa |
| 9457 | --------------------------------------------------------------------------*/ |
| 9458 | tANI_BOOLEAN sme_getIsCcxFeatureEnabled(tHalHandle hHal) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9459 | { |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9460 | #ifdef FEATURE_WLAN_CCX |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9461 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9462 | return csrRoamIsCcxIniFeatureEnabled(pMac); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9463 | #else |
| 9464 | return eANI_BOOLEAN_FALSE; |
| 9465 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9466 | } |
| 9467 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9468 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 9469 | \brief sme_GetWESMode() - get WES Mode |
| 9470 | This is a synchronous call |
| 9471 | \param hHal - The handle returned by macOpen |
| 9472 | \return v_U8_t - WES Mode Enabled(1)/Disabled(0) |
| 9473 | \sa |
| 9474 | --------------------------------------------------------------------------*/ |
| 9475 | v_BOOL_t sme_GetWESMode(tHalHandle hHal) |
| 9476 | { |
| 9477 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9478 | return pMac->roam.configParam.isWESModeEnabled; |
| 9479 | } |
| 9480 | |
| 9481 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9482 | \brief sme_GetRoamScanControl() - get scan control |
| 9483 | This is a synchronous call |
| 9484 | \param hHal - The handle returned by macOpen. |
| 9485 | \return v_BOOL_t - Enabled(1)/Disabled(0) |
| 9486 | \sa |
| 9487 | --------------------------------------------------------------------------*/ |
| 9488 | v_BOOL_t sme_GetRoamScanControl(tHalHandle hHal) |
| 9489 | { |
| 9490 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9491 | return pMac->roam.configParam.nRoamScanControl; |
| 9492 | } |
| 9493 | #endif |
| 9494 | |
| 9495 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9496 | \brief sme_getIsLfrFeatureEnabled() - get LFR feature enabled or not |
| 9497 | This is a synchronuous call |
| 9498 | \param hHal - The handle returned by macOpen. |
| 9499 | \return TRUE (1) - if the feature is enabled |
| 9500 | FALSE (0) - if feature is disabled (compile or runtime) |
| 9501 | \sa |
| 9502 | --------------------------------------------------------------------------*/ |
| 9503 | tANI_BOOLEAN sme_getIsLfrFeatureEnabled(tHalHandle hHal) |
| 9504 | { |
| 9505 | #ifdef FEATURE_WLAN_LFR |
| 9506 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9507 | return pMac->roam.configParam.isFastRoamIniFeatureEnabled; |
| 9508 | #else |
| 9509 | return eANI_BOOLEAN_FALSE; |
| 9510 | #endif |
| 9511 | } |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 9512 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9513 | /*-------------------------------------------------------------------------- |
| 9514 | \brief sme_getIsFtFeatureEnabled() - get FT feature enabled or not |
| 9515 | This is a synchronuous call |
| 9516 | \param hHal - The handle returned by macOpen. |
| 9517 | \return TRUE (1) - if the feature is enabled |
| 9518 | FALSE (0) - if feature is disabled (compile or runtime) |
| 9519 | \sa |
| 9520 | --------------------------------------------------------------------------*/ |
| 9521 | tANI_BOOLEAN sme_getIsFtFeatureEnabled(tHalHandle hHal) |
| 9522 | { |
| 9523 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 9524 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9525 | return pMac->roam.configParam.isFastTransitionEnabled; |
| 9526 | #else |
| 9527 | return eANI_BOOLEAN_FALSE; |
| 9528 | #endif |
| 9529 | } |
| 9530 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9531 | /* --------------------------------------------------------------------------- |
| 9532 | \fn sme_IsFeatureSupportedByFW |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9533 | |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 9534 | \brief Check if a feature is enabled by FW |
| 9535 | |
| 9536 | \param featEnumValue - Enumeration value from placeHolderInCapBitmap |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9537 | |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 9538 | \- return 1/0 (TRUE/FALSE) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9539 | -------------------------------------------------------------------------*/ |
| 9540 | tANI_U8 sme_IsFeatureSupportedByFW(tANI_U8 featEnumValue) |
| 9541 | { |
| 9542 | return IS_FEATURE_SUPPORTED_BY_FW(featEnumValue); |
| 9543 | } |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 9544 | |
| 9545 | /* --------------------------------------------------------------------------- |
| 9546 | \fn sme_IsFeatureSupportedByDriver |
| 9547 | \brief Check if a feature is enabled by Driver |
| 9548 | |
| 9549 | \param featEnumValue - Enumeration value from placeHolderInCapBitmap |
| 9550 | \- return 1/0 (TRUE/FALSE) |
| 9551 | -------------------------------------------------------------------------*/ |
| 9552 | |
| 9553 | tANI_U8 sme_IsFeatureSupportedByDriver(tANI_U8 featEnumValue) |
| 9554 | { |
| 9555 | return IS_FEATURE_SUPPORTED_BY_DRIVER(featEnumValue); |
| 9556 | } |
| 9557 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9558 | #ifdef FEATURE_WLAN_TDLS |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 9559 | |
| 9560 | /* --------------------------------------------------------------------------- |
| 9561 | \fn sme_SendTdlsMgmtFrame |
| 9562 | \brief API to send TDLS management frames. |
| 9563 | |
| 9564 | \param peerMac - peer's Mac Adress. |
| 9565 | \param tdlsLinkEstablishParams - TDLS Peer Link Establishment Parameters |
| 9566 | \- return VOS_STATUS_SUCCES |
| 9567 | -------------------------------------------------------------------------*/ |
| 9568 | VOS_STATUS sme_SendTdlsLinkEstablishParams(tHalHandle hHal, |
| 9569 | tANI_U8 sessionId, |
| 9570 | tSirMacAddr peerMac, |
| 9571 | tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams) |
| 9572 | { |
| 9573 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9574 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9575 | |
| 9576 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9577 | |
| 9578 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9579 | { |
| 9580 | status = csrTdlsSendLinkEstablishParams(hHal, sessionId, peerMac, tdlsLinkEstablishParams) ; |
| 9581 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9582 | } |
| 9583 | return status ; |
| 9584 | } |
| 9585 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9586 | /* --------------------------------------------------------------------------- |
| 9587 | \fn sme_SendTdlsMgmtFrame |
| 9588 | \brief API to send TDLS management frames. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9589 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9590 | \param peerMac - peer's Mac Adress. |
| 9591 | \param frame_type - Type of TDLS mgmt frame to be sent. |
| 9592 | \param dialog - dialog token used in the frame. |
| 9593 | \param status - status to be incuded in the frame. |
| 9594 | \param buf - additional IEs to be included |
| 9595 | \param len - lenght of additional Ies |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 9596 | \param responder - Tdls request type |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9597 | \- return VOS_STATUS_SUCCES |
| 9598 | -------------------------------------------------------------------------*/ |
| 9599 | VOS_STATUS sme_SendTdlsMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 9600 | tANI_U8 frame_type, tANI_U8 dialog, tANI_U16 statusCode, tANI_U8 *buf, tANI_U8 len, tANI_U8 responder) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9601 | { |
| 9602 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9603 | tCsrTdlsSendMgmt sendTdlsReq = {{0}} ; |
| 9604 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9605 | |
| 9606 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9607 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9608 | { |
| 9609 | vos_mem_copy(sendTdlsReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 9610 | sendTdlsReq.frameType = frame_type; |
| 9611 | sendTdlsReq.buf = buf; |
| 9612 | sendTdlsReq.len = len; |
| 9613 | sendTdlsReq.dialog = dialog; |
| 9614 | sendTdlsReq.statusCode = statusCode; |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 9615 | sendTdlsReq.responder = responder; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9616 | |
| 9617 | status = csrTdlsSendMgmtReq(hHal, sessionId, &sendTdlsReq) ; |
| 9618 | |
| 9619 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9620 | } |
| 9621 | |
| 9622 | return status ; |
| 9623 | |
| 9624 | } |
| 9625 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 9626 | \fn sme_ChangeTdlsPeerSta |
| 9627 | \brief API to Update TDLS peer sta parameters. |
| 9628 | |
| 9629 | \param peerMac - peer's Mac Adress. |
| 9630 | \param staParams - Peer Station Parameters |
| 9631 | \- return VOS_STATUS_SUCCES |
| 9632 | -------------------------------------------------------------------------*/ |
| 9633 | VOS_STATUS sme_ChangeTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, |
| 9634 | tCsrStaParams *pstaParams) |
| 9635 | { |
| 9636 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9637 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9638 | |
| 9639 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9640 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9641 | { |
| 9642 | status = csrTdlsChangePeerSta(hHal, sessionId, peerMac,pstaParams); |
| 9643 | |
| 9644 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9645 | } |
| 9646 | |
| 9647 | return status ; |
| 9648 | |
| 9649 | } |
| 9650 | |
| 9651 | /* --------------------------------------------------------------------------- |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9652 | \fn sme_AddTdlsPeerSta |
| 9653 | \brief API to Add TDLS peer sta entry. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9654 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9655 | \param peerMac - peer's Mac Adress. |
| 9656 | \- return VOS_STATUS_SUCCES |
| 9657 | -------------------------------------------------------------------------*/ |
| 9658 | VOS_STATUS sme_AddTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 9659 | { |
| 9660 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9661 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9662 | |
| 9663 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9664 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9665 | { |
| 9666 | status = csrTdlsAddPeerSta(hHal, sessionId, peerMac); |
| 9667 | |
| 9668 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9669 | } |
| 9670 | |
| 9671 | return status ; |
| 9672 | |
| 9673 | } |
| 9674 | /* --------------------------------------------------------------------------- |
| 9675 | \fn sme_DeleteTdlsPeerSta |
| 9676 | \brief API to Delete TDLS peer sta entry. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9677 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9678 | \param peerMac - peer's Mac Adress. |
| 9679 | \- return VOS_STATUS_SUCCES |
| 9680 | -------------------------------------------------------------------------*/ |
| 9681 | VOS_STATUS sme_DeleteTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 9682 | { |
| 9683 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9684 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9685 | |
| 9686 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9687 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9688 | { |
| 9689 | status = csrTdlsDelPeerSta(hHal, sessionId, peerMac) ; |
| 9690 | |
| 9691 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9692 | } |
| 9693 | |
| 9694 | return status ; |
| 9695 | |
| 9696 | } |
Gopichand Nakkala | 75e7b28 | 2013-03-15 18:37:13 -0700 | [diff] [blame] | 9697 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | ccd3a38 | 2013-03-19 13:56:10 -0700 | [diff] [blame] | 9698 | \fn sme_SetTdlsPowerSaveProhibited |
| 9699 | \API to set/reset the isTdlsPowerSaveProhibited. |
| 9700 | |
| 9701 | \- return void |
| 9702 | -------------------------------------------------------------------------*/ |
| 9703 | void sme_SetTdlsPowerSaveProhibited(tHalHandle hHal, v_BOOL_t val) |
| 9704 | { |
| 9705 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9706 | |
| 9707 | pMac->isTdlsPowerSaveProhibited = val; |
| 9708 | return; |
| 9709 | } |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9710 | #endif |
Gopichand Nakkala | fe7246d | 2013-06-10 17:43:37 +0530 | [diff] [blame] | 9711 | /* --------------------------------------------------------------------------- |
| 9712 | \fn sme_IsPmcBmps |
| 9713 | \API to Check if PMC state is BMPS. |
| 9714 | |
| 9715 | \- return v_BOOL_t |
| 9716 | -------------------------------------------------------------------------*/ |
| 9717 | v_BOOL_t sme_IsPmcBmps(tHalHandle hHal) |
| 9718 | { |
| 9719 | return (BMPS == pmcGetPmcState(hHal)); |
| 9720 | } |
| 9721 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9722 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 9723 | /* |
| 9724 | * SME API to start TDLS discovery Procedure |
| 9725 | */ |
| 9726 | VOS_STATUS sme_StartTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 9727 | { |
| 9728 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 9729 | tCsrTdlsDisRequest disReq = {{0}} ; |
| 9730 | vos_mem_copy(disReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 9731 | status = csrTdlsDiscoveryReq(hHal, sessionId, &disReq) ; |
| 9732 | |
| 9733 | return status ; |
| 9734 | |
| 9735 | } |
| 9736 | |
| 9737 | /* |
| 9738 | * Process TDLS discovery results |
| 9739 | */ |
| 9740 | v_U8_t sme_GetTdlsDiscoveryResult(tHalHandle hHal, |
| 9741 | tSmeTdlsDisResult *disResult, v_U8_t listType) |
| 9742 | { |
| 9743 | tCsrTdlsPeerLinkinfo *peerLinkInfo = NULL ; |
| 9744 | tSirTdlsPeerInfo *peerInfo = NULL ; |
| 9745 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9746 | tCsrTdlsCtxStruct *disInfo = &pMac->tdlsCtx ; |
| 9747 | tDblLinkList *peerList = &disInfo->tdlsPotentialPeerList ; |
| 9748 | tListElem *pEntry = NULL ; |
| 9749 | v_U8_t peerCnt = 0 ; |
| 9750 | |
| 9751 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 9752 | ("TDLS peer count = %d"),disInfo->tdlsPeerCount ) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9753 | pEntry = csrLLPeekHead( peerList, LL_ACCESS_LOCK ); |
| 9754 | while(pEntry) |
| 9755 | { |
| 9756 | peerLinkInfo = GET_BASE_ADDR( pEntry, tCsrTdlsPeerLinkinfo, |
| 9757 | tdlsPeerStaLink) ; |
| 9758 | peerInfo = &peerLinkInfo->tdlsDisPeerInfo ; |
| 9759 | |
| 9760 | switch(listType) |
| 9761 | { |
| 9762 | case TDLS_SETUP_LIST: |
| 9763 | { |
| 9764 | if(TDLS_LINK_SETUP_STATE == peerInfo->tdlsPeerState) |
| 9765 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 9766 | vos_mem_copy(disResult[peerCnt].tdlsPeerMac, |
| 9767 | peerInfo->peerMac, sizeof(tSirMacAddr)); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9768 | disResult[peerCnt].tdlsPeerRssi = peerInfo->tdlsPeerRssi ; |
| 9769 | peerCnt++ ; |
| 9770 | } |
| 9771 | break ; |
| 9772 | } |
| 9773 | case TDLS_DIS_LIST: |
| 9774 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 9775 | vos_mem_copy(disResult[peerCnt].tdlsPeerMac, |
| 9776 | peerInfo->peerMac, sizeof(tSirMacAddr)); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9777 | disResult[peerCnt].tdlsPeerRssi = peerInfo->tdlsPeerRssi ; |
| 9778 | peerCnt++ ; |
| 9779 | break ; |
| 9780 | } |
| 9781 | default: |
| 9782 | { |
| 9783 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 9784 | ("unknown list type ")) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9785 | break ; |
| 9786 | } |
| 9787 | } |
| 9788 | |
| 9789 | pEntry = csrLLNext( peerList, pEntry, LL_ACCESS_LOCK) ; |
| 9790 | } |
| 9791 | |
| 9792 | return peerCnt ; |
| 9793 | |
| 9794 | } |
| 9795 | |
| 9796 | /* |
| 9797 | * SME API to start TDLS link setup Procedure. |
| 9798 | */ |
| 9799 | VOS_STATUS sme_StartTdlsLinkSetupReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 9800 | { |
| 9801 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 9802 | tCsrTdlsSetupRequest setupReq = {{0}} ; |
| 9803 | vos_mem_copy(setupReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 9804 | status = csrTdlsSetupReq(hHal, sessionId, &setupReq) ; |
| 9805 | return status ; |
| 9806 | |
| 9807 | } |
| 9808 | |
| 9809 | /* |
| 9810 | * SME API to start TDLS link Teardown Procedure. |
| 9811 | */ |
| 9812 | VOS_STATUS sme_StartTdlsLinkTeardownReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 9813 | { |
| 9814 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 9815 | tCsrTdlsTeardownRequest teardownReq = {{0}} ; |
| 9816 | vos_mem_copy(teardownReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 9817 | status = csrTdlsTeardownReq(hHal, sessionId, &teardownReq) ; |
| 9818 | return status ; |
| 9819 | |
| 9820 | } |
| 9821 | |
| 9822 | #endif /* FEATURE_WLAN_TDLS */ |
| 9823 | |
Tushnim Bhattacharyya | 9cdf608 | 2013-04-21 16:33:30 -0700 | [diff] [blame] | 9824 | eHalStatus sme_UpdateDfsSetting(tHalHandle hHal, tANI_U8 fUpdateEnableDFSChnlScan) |
| 9825 | { |
| 9826 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 9827 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9828 | |
| 9829 | smsLog(pMac, LOG2, FL("enter")); |
| 9830 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9831 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9832 | { |
| 9833 | pMac->scan.fEnableDFSChnlScan = fUpdateEnableDFSChnlScan; |
| 9834 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9835 | } |
| 9836 | smsLog(pMac, LOG2, FL("exit status %d"), status); |
| 9837 | |
| 9838 | return (status); |
| 9839 | } |
| 9840 | |
Gopichand Nakkala | e620d5a | 2013-04-26 05:45:57 -0700 | [diff] [blame] | 9841 | /* |
| 9842 | * SME API to enable/disable WLAN driver initiated SSR |
| 9843 | */ |
| 9844 | void sme_UpdateEnableSSR(tHalHandle hHal, tANI_BOOLEAN enableSSR) |
| 9845 | { |
| 9846 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9847 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9848 | |
| 9849 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 9850 | if (HAL_STATUS_SUCCESS(status)) |
| 9851 | { |
| 9852 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 9853 | "SSR level is changed %d", enableSSR); |
| 9854 | /* not serializing this messsage, as this is only going |
| 9855 | * to set a variable in WDA/WDI |
| 9856 | */ |
| 9857 | WDA_SetEnableSSR(enableSSR); |
| 9858 | sme_ReleaseGlobalLock(&pMac->sme); |
| 9859 | } |
| 9860 | return; |
| 9861 | } |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 9862 | |
| 9863 | /* |
| 9864 | * SME API to determine the channel bonding mode |
| 9865 | */ |
| 9866 | VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 channel) |
| 9867 | { |
| 9868 | tSmeConfigParams smeConfig; |
| 9869 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9870 | |
| 9871 | if ( |
| 9872 | #ifdef WLAN_FEATURE_11AC |
| 9873 | eCSR_DOT11_MODE_11ac != eCsrPhyMode && |
| 9874 | eCSR_DOT11_MODE_11ac_ONLY != eCsrPhyMode && |
| 9875 | #endif |
| 9876 | eCSR_DOT11_MODE_11n != eCsrPhyMode && |
| 9877 | eCSR_DOT11_MODE_11n_ONLY != eCsrPhyMode |
| 9878 | ) |
| 9879 | { |
| 9880 | return VOS_STATUS_SUCCESS; |
| 9881 | } |
| 9882 | |
| 9883 | /* If channel bonding mode is not required */ |
| 9884 | if ( !pMac->roam.configParam.channelBondingMode5GHz ) { |
| 9885 | return VOS_STATUS_SUCCESS; |
| 9886 | } |
| 9887 | |
| 9888 | vos_mem_zero(&smeConfig, sizeof (tSmeConfigParams)); |
| 9889 | sme_GetConfigParam(pMac, &smeConfig); |
| 9890 | |
| 9891 | #ifdef WLAN_FEATURE_11AC |
| 9892 | if ( eCSR_DOT11_MODE_11ac == eCsrPhyMode || |
| 9893 | eCSR_DOT11_MODE_11ac_ONLY == eCsrPhyMode ) |
| 9894 | { |
| 9895 | if ( channel== 36 || channel == 52 || channel == 100 || |
| 9896 | channel == 116 || channel == 149 ) |
| 9897 | { |
| 9898 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 9899 | PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW - 1; |
| 9900 | } |
| 9901 | else if ( channel == 40 || channel == 56 || channel == 104 || |
| 9902 | channel == 120 || channel == 153 ) |
| 9903 | { |
| 9904 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 9905 | PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW - 1; |
| 9906 | } |
| 9907 | else if ( channel == 44 || channel == 60 || channel == 108 || |
| 9908 | channel == 124 || channel == 157 ) |
| 9909 | { |
| 9910 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 9911 | PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH -1; |
| 9912 | } |
| 9913 | else if ( channel == 48 || channel == 64 || channel == 112 || |
Leo Chang | d0a4984 | 2013-12-30 11:41:04 -0800 | [diff] [blame] | 9914 | channel == 128 || channel == 144 || channel == 161 ) |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 9915 | { |
| 9916 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 9917 | PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH - 1; |
| 9918 | } |
| 9919 | else if ( channel == 165 ) |
| 9920 | { |
| 9921 | smeConfig.csrConfig.channelBondingMode5GHz = 0; |
| 9922 | } |
| 9923 | } |
| 9924 | #endif |
| 9925 | |
| 9926 | if ( eCSR_DOT11_MODE_11n == eCsrPhyMode || |
| 9927 | eCSR_DOT11_MODE_11n_ONLY == eCsrPhyMode ) |
| 9928 | { |
| 9929 | if ( channel== 40 || channel == 48 || channel == 56 || |
| 9930 | channel == 64 || channel == 104 || channel == 112 || |
| 9931 | channel == 120 || channel == 128 || channel == 136 || |
| 9932 | channel == 144 || channel == 153 || channel == 161 ) |
| 9933 | { |
| 9934 | smeConfig.csrConfig.channelBondingMode5GHz = 1; |
| 9935 | } |
| 9936 | else if ( channel== 36 || channel == 44 || channel == 52 || |
| 9937 | channel == 60 || channel == 100 || channel == 108 || |
| 9938 | channel == 116 || channel == 124 || channel == 132 || |
| 9939 | channel == 140 || channel == 149 || channel == 157 ) |
| 9940 | { |
| 9941 | smeConfig.csrConfig.channelBondingMode5GHz = 2; |
| 9942 | } |
| 9943 | else if ( channel == 165 ) |
| 9944 | { |
| 9945 | smeConfig.csrConfig.channelBondingMode5GHz = 0; |
| 9946 | } |
| 9947 | } |
| 9948 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Jeff Johnson | ce8ad51 | 2013-10-30 12:34:42 -0700 | [diff] [blame] | 9949 | "cbmode selected=%d", smeConfig.csrConfig.channelBondingMode5GHz); |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 9950 | |
| 9951 | sme_UpdateConfig (pMac, &smeConfig); |
| 9952 | return VOS_STATUS_SUCCESS; |
| 9953 | } |
| 9954 | |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 9955 | /*-------------------------------------------------------------------------- |
| 9956 | |
| 9957 | \brief sme_SetCurrDeviceMode() - Sets the current operating device mode. |
| 9958 | \param hHal - The handle returned by macOpen. |
| 9959 | \param currDeviceMode - Current operating device mode. |
| 9960 | --------------------------------------------------------------------------*/ |
| 9961 | |
| 9962 | void sme_SetCurrDeviceMode (tHalHandle hHal, tVOS_CON_MODE currDeviceMode) |
| 9963 | { |
| 9964 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9965 | pMac->sme.currDeviceMode = currDeviceMode; |
| 9966 | return; |
| 9967 | } |
| 9968 | |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 9969 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9970 | /*-------------------------------------------------------------------------- |
| 9971 | \brief sme_HandoffRequest() - a wrapper function to Request a handoff |
| 9972 | from CSR. |
| 9973 | This is a synchronous call |
| 9974 | \param hHal - The handle returned by macOpen |
| 9975 | \param pHandoffInfo - info provided by HDD with the handoff request (namely: |
| 9976 | BSSID, channel etc.) |
| 9977 | \return eHAL_STATUS_SUCCESS - SME passed the request to CSR successfully. |
| 9978 | Other status means SME is failed to send the request. |
| 9979 | \sa |
| 9980 | --------------------------------------------------------------------------*/ |
| 9981 | |
| 9982 | eHalStatus sme_HandoffRequest(tHalHandle hHal, |
| 9983 | tCsrHandoffRequest *pHandoffInfo) |
| 9984 | { |
| 9985 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9986 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9987 | |
| 9988 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9989 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9990 | { |
| 9991 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9992 | "%s: invoked", __func__); |
| 9993 | status = csrHandoffRequest(pMac, pHandoffInfo); |
| 9994 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9995 | } |
| 9996 | |
| 9997 | return status ; |
| 9998 | } |
| 9999 | #endif |
| 10000 | |
Sudhir Sattayappa Kohalli | b1d8c3a | 2013-06-18 14:47:20 -0700 | [diff] [blame] | 10001 | /* |
| 10002 | * SME API to check if there is any infra station or |
| 10003 | * P2P client is connected |
| 10004 | */ |
| 10005 | VOS_STATUS sme_isSta_p2p_clientConnected(tHalHandle hHal) |
| 10006 | { |
| 10007 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10008 | if(csrIsInfraConnected(pMac)) |
| 10009 | { |
| 10010 | return VOS_STATUS_SUCCESS; |
| 10011 | } |
| 10012 | return VOS_STATUS_E_FAILURE; |
| 10013 | } |
| 10014 | |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10015 | |
| 10016 | #ifdef FEATURE_WLAN_LPHB |
| 10017 | /* --------------------------------------------------------------------------- |
| 10018 | \fn sme_LPHBConfigReq |
| 10019 | \API to make configuration LPHB within FW. |
| 10020 | \param hHal - The handle returned by macOpen |
| 10021 | \param lphdReq - LPHB request argument by client |
| 10022 | \param pCallbackfn - LPHB timeout notification callback function pointer |
| 10023 | \- return Configuration message posting status, SUCCESS or Fail |
| 10024 | -------------------------------------------------------------------------*/ |
| 10025 | eHalStatus sme_LPHBConfigReq |
| 10026 | ( |
| 10027 | tHalHandle hHal, |
| 10028 | tSirLPHBReq *lphdReq, |
| 10029 | void (*pCallbackfn)(void *pAdapter, void *indParam) |
| 10030 | ) |
| 10031 | { |
| 10032 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10033 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 10034 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10035 | vos_msg_t vosMessage; |
| 10036 | |
| 10037 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 10038 | if (eHAL_STATUS_SUCCESS == status) |
| 10039 | { |
| 10040 | if ((LPHB_SET_EN_PARAMS_INDID == lphdReq->cmd) && |
| 10041 | (NULL == pCallbackfn) && |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 10042 | (NULL == pMac->sme.pLphbIndCb)) |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10043 | { |
| 10044 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10045 | "%s: Indication Call back did not registered", __func__); |
| 10046 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10047 | return eHAL_STATUS_FAILURE; |
| 10048 | } |
| 10049 | else if (NULL != pCallbackfn) |
| 10050 | { |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 10051 | pMac->sme.pLphbIndCb = pCallbackfn; |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10052 | } |
| 10053 | |
| 10054 | /* serialize the req through MC thread */ |
| 10055 | vosMessage.bodyptr = lphdReq; |
| 10056 | vosMessage.type = WDA_LPHB_CONF_REQ; |
| 10057 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 10058 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 10059 | { |
| 10060 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10061 | "%s: Post Config LPHB MSG fail", __func__); |
| 10062 | status = eHAL_STATUS_FAILURE; |
| 10063 | } |
| 10064 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10065 | } |
| 10066 | |
| 10067 | return(status); |
| 10068 | } |
| 10069 | #endif /* FEATURE_WLAN_LPHB */ |
Sudhir Sattayappa Kohalli | 3762069 | 2013-08-05 14:02:26 -0700 | [diff] [blame] | 10070 | /*-------------------------------------------------------------------------- |
| 10071 | \brief sme_enable_disable_split_scan() - a wrapper function to set the split |
| 10072 | scan parameter. |
| 10073 | This is a synchronous call |
| 10074 | \param hHal - The handle returned by macOpen |
| 10075 | \return NONE. |
| 10076 | \sa |
| 10077 | --------------------------------------------------------------------------*/ |
| 10078 | void sme_enable_disable_split_scan (tHalHandle hHal, tANI_U8 nNumStaChan, |
| 10079 | tANI_U8 nNumP2PChan) |
| 10080 | { |
| 10081 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10082 | |
| 10083 | pMac->roam.configParam.nNumStaChanCombinedConc = nNumStaChan; |
| 10084 | pMac->roam.configParam.nNumP2PChanCombinedConc = nNumP2PChan; |
| 10085 | |
| 10086 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10087 | "%s: SCAN nNumStaChanCombinedConc : %d," |
| 10088 | "nNumP2PChanCombinedConc : %d ", |
| 10089 | __func__, nNumStaChan, nNumP2PChan); |
| 10090 | |
| 10091 | return; |
| 10092 | |
| 10093 | } |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10094 | |
Yue Ma | b9c86f4 | 2013-08-14 15:59:08 -0700 | [diff] [blame] | 10095 | /* --------------------------------------------------------------------------- |
| 10096 | \fn sme_AddPeriodicTxPtrn |
| 10097 | \brief API to Periodic TX Pattern Offload feature |
| 10098 | \param hHal - The handle returned by macOpen |
| 10099 | \param addPeriodicTxPtrnParams - Pointer to the add pattern structure |
| 10100 | \return eHalStatus |
| 10101 | ---------------------------------------------------------------------------*/ |
| 10102 | eHalStatus sme_AddPeriodicTxPtrn(tHalHandle hHal, tSirAddPeriodicTxPtrn |
| 10103 | *addPeriodicTxPtrnParams) |
| 10104 | { |
| 10105 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10106 | eHalStatus status; |
| 10107 | vos_msg_t msg; |
| 10108 | |
| 10109 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 10110 | { |
| 10111 | msg.type = WDA_ADD_PERIODIC_TX_PTRN_IND; |
| 10112 | msg.bodyptr = addPeriodicTxPtrnParams; |
| 10113 | |
| 10114 | if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 10115 | { |
| 10116 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " |
| 10117 | "to post WDA_ADD_PERIODIC_TX_PTRN_IND to WDA!", |
| 10118 | __func__); |
| 10119 | |
| 10120 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10121 | return eHAL_STATUS_FAILURE; |
| 10122 | } |
| 10123 | |
| 10124 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10125 | return eHAL_STATUS_SUCCESS; |
| 10126 | } |
| 10127 | |
| 10128 | return status; |
| 10129 | } |
| 10130 | |
| 10131 | /* --------------------------------------------------------------------------- |
| 10132 | \fn sme_DelPeriodicTxPtrn |
| 10133 | \brief API to Periodic TX Pattern Offload feature |
| 10134 | \param hHal - The handle returned by macOpen |
| 10135 | \param delPeriodicTxPtrnParams - Pointer to the delete pattern structure |
| 10136 | \return eHalStatus |
| 10137 | ---------------------------------------------------------------------------*/ |
| 10138 | eHalStatus sme_DelPeriodicTxPtrn(tHalHandle hHal, tSirDelPeriodicTxPtrn |
| 10139 | *delPeriodicTxPtrnParams) |
| 10140 | { |
| 10141 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10142 | eHalStatus status; |
| 10143 | vos_msg_t msg; |
| 10144 | |
| 10145 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 10146 | { |
| 10147 | msg.type = WDA_DEL_PERIODIC_TX_PTRN_IND; |
| 10148 | msg.bodyptr = delPeriodicTxPtrnParams; |
| 10149 | |
| 10150 | if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 10151 | { |
| 10152 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " |
| 10153 | "to post WDA_DEL_PERIODIC_TX_PTRN_IND to WDA!", |
| 10154 | __func__); |
| 10155 | |
| 10156 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10157 | return eHAL_STATUS_FAILURE; |
| 10158 | } |
| 10159 | |
| 10160 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10161 | return eHAL_STATUS_SUCCESS; |
| 10162 | } |
| 10163 | |
| 10164 | return status; |
| 10165 | } |
| 10166 | |
Tushnim Bhattacharyya | ad37df1 | 2013-10-02 12:01:33 -0700 | [diff] [blame] | 10167 | void smeGetCommandQStatus( tHalHandle hHal ) |
| 10168 | { |
| 10169 | tSmeCmd *pTempCmd = NULL; |
| 10170 | tListElem *pEntry; |
| 10171 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10172 | |
| 10173 | if (NULL == pMac) |
| 10174 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 10175 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 10176 | "%s: pMac is null", __func__); |
Tushnim Bhattacharyya | ad37df1 | 2013-10-02 12:01:33 -0700 | [diff] [blame] | 10177 | return; |
| 10178 | } |
| 10179 | |
| 10180 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK ); |
| 10181 | if( pEntry ) |
| 10182 | { |
| 10183 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 10184 | } |
| 10185 | smsLog( pMac, LOGE, "Currently smeCmdActiveList has command (0x%X)", |
| 10186 | (pTempCmd) ? pTempCmd->command : eSmeNoCommand ); |
| 10187 | if(pTempCmd) |
| 10188 | { |
| 10189 | if( eSmeCsrCommandMask & pTempCmd->command ) |
| 10190 | { |
| 10191 | //CSR command is stuck. See what the reason code is for that command |
| 10192 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 10193 | } |
| 10194 | } //if(pTempCmd) |
| 10195 | |
| 10196 | smsLog( pMac, LOGE, "Currently smeCmdPendingList has %d commands", |
| 10197 | csrLLCount(&pMac->sme.smeCmdPendingList)); |
| 10198 | |
| 10199 | smsLog( pMac, LOGE, "Currently roamCmdPendingList has %d commands", |
| 10200 | csrLLCount(&pMac->roam.roamCmdPendingList)); |
| 10201 | |
| 10202 | return; |
| 10203 | } |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 10204 | |
| 10205 | #ifdef FEATURE_WLAN_BATCH_SCAN |
| 10206 | /* --------------------------------------------------------------------------- |
| 10207 | \fn sme_SetBatchScanReq |
| 10208 | \brief API to set batch scan request in FW |
| 10209 | \param hHal - The handle returned by macOpen. |
| 10210 | \param pRequest - Pointer to the batch request. |
| 10211 | \param sessionId - session ID |
| 10212 | \param callbackRoutine - HDD callback which needs to be invoked after |
| 10213 | getting set batch scan response from FW |
| 10214 | \param callbackContext - pAdapter context |
| 10215 | \return eHalStatus |
| 10216 | ---------------------------------------------------------------------------*/ |
| 10217 | eHalStatus sme_SetBatchScanReq |
| 10218 | ( |
| 10219 | tHalHandle hHal, tSirSetBatchScanReq *pRequest, tANI_U8 sessionId, |
| 10220 | void (*callbackRoutine) (void *callbackCtx, tSirSetBatchScanRsp *pRsp), |
| 10221 | void *callbackContext |
| 10222 | ) |
| 10223 | { |
| 10224 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10225 | eHalStatus status; |
| 10226 | |
| 10227 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 10228 | { |
| 10229 | status = pmcSetBatchScanReq(hHal, pRequest, sessionId, callbackRoutine, |
| 10230 | callbackContext); |
| 10231 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10232 | } |
| 10233 | |
| 10234 | return status; |
| 10235 | } |
| 10236 | |
| 10237 | /* --------------------------------------------------------------------------- |
Chittajit Mitra | f5413a4 | 2013-10-18 14:20:08 -0700 | [diff] [blame] | 10238 | \fn sme_SendRateUpdateInd |
| 10239 | \brief API to Update rate |
| 10240 | \param hHal - The handle returned by macOpen |
| 10241 | \param rateUpdateParams - Pointer to rate update params |
| 10242 | \return eHalStatus |
| 10243 | ---------------------------------------------------------------------------*/ |
| 10244 | eHalStatus sme_SendRateUpdateInd(tHalHandle hHal, tSirRateUpdateInd *rateUpdateParams) |
| 10245 | { |
| 10246 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10247 | eHalStatus status; |
| 10248 | vos_msg_t msg; |
| 10249 | |
| 10250 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 10251 | { |
| 10252 | msg.type = WDA_RATE_UPDATE_IND; |
| 10253 | msg.bodyptr = rateUpdateParams; |
| 10254 | |
| 10255 | if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 10256 | { |
| 10257 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " |
| 10258 | "to post WDA_SET_RMC_RATE_IND to WDA!", |
| 10259 | __func__); |
| 10260 | |
| 10261 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10262 | return eHAL_STATUS_FAILURE; |
| 10263 | } |
| 10264 | |
| 10265 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10266 | return eHAL_STATUS_SUCCESS; |
| 10267 | } |
| 10268 | |
| 10269 | return status; |
| 10270 | } |
| 10271 | |
| 10272 | /* --------------------------------------------------------------------------- |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 10273 | \fn sme_TriggerBatchScanResultInd |
| 10274 | \brief API to trigger batch scan result indications from FW |
| 10275 | \param hHal - The handle returned by macOpen. |
| 10276 | \param pRequest - Pointer to get batch request. |
| 10277 | \param sessionId - session ID |
| 10278 | \param callbackRoutine - HDD callback which needs to be invoked after |
| 10279 | getting batch scan result indication from FW |
| 10280 | \param callbackContext - pAdapter context |
| 10281 | \return eHalStatus |
| 10282 | ---------------------------------------------------------------------------*/ |
| 10283 | eHalStatus sme_TriggerBatchScanResultInd |
| 10284 | ( |
| 10285 | tHalHandle hHal, tSirTriggerBatchScanResultInd *pRequest, tANI_U8 sessionId, |
| 10286 | void (*callbackRoutine) (void *callbackCtx, void *pRsp), |
| 10287 | void *callbackContext |
| 10288 | ) |
| 10289 | { |
| 10290 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10291 | eHalStatus status; |
| 10292 | |
| 10293 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 10294 | { |
| 10295 | status = pmcTriggerBatchScanResultInd(hHal, pRequest, sessionId, |
| 10296 | callbackRoutine, callbackContext); |
| 10297 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10298 | } |
| 10299 | |
| 10300 | return status; |
| 10301 | } |
| 10302 | |
| 10303 | |
| 10304 | /* --------------------------------------------------------------------------- |
| 10305 | \fn sme_StopBatchScanInd |
| 10306 | \brief API to stop batch scan request in FW |
| 10307 | \param hHal - The handle returned by macOpen. |
| 10308 | \param pRequest - Pointer to the batch request. |
| 10309 | \param sessionId - session ID |
| 10310 | \return eHalStatus |
| 10311 | ---------------------------------------------------------------------------*/ |
| 10312 | eHalStatus sme_StopBatchScanInd |
| 10313 | ( |
| 10314 | tHalHandle hHal, tSirStopBatchScanInd *pRequest, tANI_U8 sessionId |
| 10315 | ) |
| 10316 | { |
| 10317 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10318 | eHalStatus status; |
| 10319 | |
| 10320 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 10321 | { |
| 10322 | status = pmcStopBatchScanInd(hHal, pRequest, sessionId); |
| 10323 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10324 | } |
| 10325 | |
| 10326 | return status; |
| 10327 | } |
| 10328 | |
| 10329 | #endif |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 10330 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10331 | |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 10332 | #ifdef FEATURE_WLAN_CH_AVOID |
| 10333 | /* --------------------------------------------------------------------------- |
| 10334 | \fn sme_AddChAvoidCallback |
| 10335 | \brief Used to plug in callback function |
| 10336 | Which notify channel may not be used with SAP or P2PGO mode. |
| 10337 | Notification come from FW. |
| 10338 | \param hHal |
| 10339 | \param pCallbackfn : callback function pointer should be plugged in |
| 10340 | \- return eHalStatus |
| 10341 | -------------------------------------------------------------------------*/ |
| 10342 | eHalStatus sme_AddChAvoidCallback |
| 10343 | ( |
| 10344 | tHalHandle hHal, |
| 10345 | void (*pCallbackfn)(void *pAdapter, void *indParam) |
| 10346 | ) |
| 10347 | { |
| 10348 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10349 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10350 | |
| 10351 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10352 | "%s: Plug in CH AVOID CB", __func__); |
| 10353 | |
| 10354 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 10355 | if (eHAL_STATUS_SUCCESS == status) |
| 10356 | { |
| 10357 | if (NULL != pCallbackfn) |
| 10358 | { |
| 10359 | pMac->sme.pChAvoidNotificationCb = pCallbackfn; |
| 10360 | } |
| 10361 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10362 | } |
| 10363 | |
| 10364 | return(status); |
| 10365 | } |
| 10366 | #endif /* FEATURE_WLAN_CH_AVOID */ |
| 10367 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10368 | |
| 10369 | void activeListCmdTimeoutHandle(void *userData) |
| 10370 | { |
| 10371 | if (NULL == userData) |
| 10372 | return; |
| 10373 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10374 | "%s: Active List command timeout Cmd List Count %d", __func__, |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 10375 | csrLLCount(&((tpAniSirGlobal) userData)->sme.smeCmdActiveList) ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10376 | smeGetCommandQStatus((tHalHandle) userData); |
| 10377 | } |
| 10378 | |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 10379 | eHalStatus sme_UpdateConnectDebug(tHalHandle hHal, tANI_U32 set_value) |
| 10380 | { |
| 10381 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10382 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10383 | pMac->fEnableDebugLog = set_value; |
| 10384 | return (status); |
| 10385 | } |
| 10386 | |