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 | a7f454d | 2014-07-24 12:04:06 -0700 | [diff] [blame] | 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 26 | */ |
Kiet Lam | 0fb93dd | 2014-02-19 00:32:59 -0800 | [diff] [blame] | 27 | |
| 28 | |
Kiet Lam | a7f454d | 2014-07-24 12:04:06 -0700 | [diff] [blame] | 29 | |
| 30 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 31 | /**========================================================================= |
| 32 | |
| 33 | \file smeApi.c |
| 34 | |
| 35 | \brief Definitions for SME APIs |
| 36 | |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame] | 37 | Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. |
| 38 | |
| 39 | Qualcomm Confidential and Proprietary. |
| 40 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 41 | ========================================================================*/ |
| 42 | |
| 43 | /*=========================================================================== |
| 44 | |
| 45 | EDIT HISTORY FOR FILE |
| 46 | |
| 47 | |
| 48 | This section contains comments describing changes made to the module. |
| 49 | Notice that changes are listed in reverse chronological order. |
| 50 | |
| 51 | |
| 52 | |
| 53 | when who what, where, why |
| 54 | ---------- --- -------------------------------------------------------- |
| 55 | 06/03/10 js Added support to hostapd driven |
| 56 | * deauth/disassoc/mic failure |
| 57 | |
| 58 | ===========================================================================*/ |
| 59 | |
| 60 | /*-------------------------------------------------------------------------- |
| 61 | Include Files |
| 62 | ------------------------------------------------------------------------*/ |
| 63 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 64 | |
| 65 | #include "smsDebug.h" |
| 66 | #include "sme_Api.h" |
| 67 | #include "csrInsideApi.h" |
| 68 | #include "smeInside.h" |
| 69 | #include "csrInternal.h" |
| 70 | #include "wlan_qct_wda.h" |
| 71 | #include "halMsgApi.h" |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 72 | #include "vos_trace.h" |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 73 | #include "sme_Trace.h" |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 74 | #include "vos_types.h" |
| 75 | #include "vos_trace.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 76 | #include "sapApi.h" |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 77 | #include "macTrace.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 78 | |
| 79 | |
Mukul Sharma | be91e2f | 2014-06-29 22:09:20 +0530 | [diff] [blame] | 80 | #ifdef DEBUG_ROAM_DELAY |
| 81 | #include "vos_utils.h" |
| 82 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 83 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 84 | extern tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); |
| 85 | |
| 86 | #include <wlan_qct_pal_api.h> |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 87 | #define LOG_SIZE 256 |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 88 | #define READ_MEMORY_DUMP_CMD 9 |
Madan Mohan Koyyalamudi | 8af9b40 | 2013-07-11 14:59:10 +0530 | [diff] [blame] | 89 | #define TL_INIT_STATE 0 |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 90 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 91 | |
| 92 | #define CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE 1000*30 //30s |
| 93 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 94 | // TxMB Functions |
| 95 | extern eHalStatus pmcPrepareCommand( tpAniSirGlobal pMac, eSmeCommandType cmdType, void *pvParam, |
| 96 | tANI_U32 size, tSmeCmd **ppCmd ); |
| 97 | extern void pmcReleaseCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 98 | extern void qosReleaseCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 99 | extern eHalStatus p2pProcessRemainOnChannelCmd(tpAniSirGlobal pMac, tSmeCmd *p2pRemainonChn); |
| 100 | extern eHalStatus sme_remainOnChnRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg); |
| 101 | extern eHalStatus sme_mgmtFrmInd( tHalHandle hHal, tpSirSmeMgmtFrameInd pSmeMgmtFrm); |
| 102 | extern eHalStatus sme_remainOnChnReady( tHalHandle hHal, tANI_U8* pMsg); |
| 103 | extern eHalStatus sme_sendActionCnf( tHalHandle hHal, tANI_U8* pMsg); |
| 104 | extern eHalStatus p2pProcessNoAReq(tpAniSirGlobal pMac, tSmeCmd *pNoACmd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 105 | |
| 106 | static eHalStatus initSmeCmdList(tpAniSirGlobal pMac); |
| 107 | static void smeAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping ); |
| 108 | |
| 109 | eCsrPhyMode sme_GetPhyMode(tHalHandle hHal); |
| 110 | |
| 111 | eHalStatus sme_HandleChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf); |
| 112 | |
Sushant Kaushik | 1d73256 | 2014-05-21 14:15:37 +0530 | [diff] [blame] | 113 | void sme_DisconnectConnectedSessions(tpAniSirGlobal pMac); |
| 114 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 115 | eHalStatus sme_HandleGenericChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf); |
| 116 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 117 | eHalStatus sme_HandlePreChannelSwitchInd(tHalHandle hHal); |
| 118 | |
| 119 | eHalStatus sme_HandlePostChannelSwitchInd(tHalHandle hHal); |
| 120 | |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 121 | #ifdef FEATURE_WLAN_LFR |
| 122 | tANI_BOOLEAN csrIsScanAllowed(tpAniSirGlobal pMac); |
| 123 | #endif |
| 124 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 125 | #ifdef WLAN_FEATURE_11W |
| 126 | eHalStatus sme_UnprotectedMgmtFrmInd( tHalHandle hHal, |
| 127 | tpSirSmeUnprotMgmtFrameInd pSmeMgmtFrm ); |
| 128 | #endif |
| 129 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 130 | //Internal SME APIs |
| 131 | eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme) |
| 132 | { |
| 133 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 134 | |
| 135 | if(psSme) |
| 136 | { |
| 137 | if( VOS_IS_STATUS_SUCCESS( vos_lock_acquire( &psSme->lkSmeGlobalLock) ) ) |
| 138 | { |
| 139 | status = eHAL_STATUS_SUCCESS; |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | return (status); |
| 144 | } |
| 145 | |
| 146 | |
| 147 | eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme) |
| 148 | { |
| 149 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 150 | |
| 151 | if(psSme) |
| 152 | { |
| 153 | if( VOS_IS_STATUS_SUCCESS( vos_lock_release( &psSme->lkSmeGlobalLock) ) ) |
| 154 | { |
| 155 | status = eHAL_STATUS_SUCCESS; |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | return (status); |
| 160 | } |
| 161 | |
| 162 | |
| 163 | |
| 164 | static eHalStatus initSmeCmdList(tpAniSirGlobal pMac) |
| 165 | { |
| 166 | eHalStatus status; |
| 167 | tSmeCmd *pCmd; |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 168 | tANI_U32 cmd_idx; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 169 | VOS_STATUS vosStatus; |
| 170 | vos_timer_t* cmdTimeoutTimer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 171 | |
| 172 | pMac->sme.totalSmeCmd = SME_TOTAL_COMMAND; |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 173 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 174 | &pMac->sme.smeCmdActiveList))) |
| 175 | goto end; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 176 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 177 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 178 | &pMac->sme.smeCmdPendingList))) |
| 179 | goto end; |
| 180 | |
| 181 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 182 | &pMac->sme.smeScanCmdActiveList))) |
| 183 | goto end; |
| 184 | |
| 185 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 186 | &pMac->sme.smeScanCmdPendingList))) |
| 187 | goto end; |
| 188 | |
| 189 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 190 | &pMac->sme.smeCmdFreeList))) |
| 191 | goto end; |
| 192 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 193 | pCmd = vos_mem_malloc(sizeof(tSmeCmd) * pMac->sme.totalSmeCmd); |
| 194 | if ( NULL == pCmd ) |
| 195 | status = eHAL_STATUS_FAILURE; |
| 196 | else |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 197 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 198 | status = eHAL_STATUS_SUCCESS; |
| 199 | |
| 200 | vos_mem_set(pCmd, sizeof(tSmeCmd) * pMac->sme.totalSmeCmd, 0); |
| 201 | pMac->sme.pSmeCmdBufAddr = pCmd; |
| 202 | |
| 203 | for (cmd_idx = 0; cmd_idx < pMac->sme.totalSmeCmd; cmd_idx++) |
| 204 | { |
| 205 | csrLLInsertTail(&pMac->sme.smeCmdFreeList, |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 206 | &pCmd[cmd_idx].Link, LL_ACCESS_LOCK); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 207 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 208 | } |
| 209 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 210 | /* This timer is only to debug the active list command timeout */ |
| 211 | |
| 212 | cmdTimeoutTimer = (vos_timer_t*)vos_mem_malloc(sizeof(vos_timer_t)); |
| 213 | if (cmdTimeoutTimer) |
| 214 | { |
| 215 | pMac->sme.smeCmdActiveList.cmdTimeoutTimer = cmdTimeoutTimer; |
| 216 | vosStatus = |
| 217 | vos_timer_init( pMac->sme.smeCmdActiveList.cmdTimeoutTimer, |
| 218 | VOS_TIMER_TYPE_SW, |
| 219 | activeListCmdTimeoutHandle, |
| 220 | (void*) pMac); |
| 221 | |
| 222 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 223 | { |
| 224 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 225 | "Init Timer fail for active list command process time out"); |
| 226 | vos_mem_free(pMac->sme.smeCmdActiveList.cmdTimeoutTimer); |
| 227 | } |
| 228 | else |
| 229 | { |
| 230 | pMac->sme.smeCmdActiveList.cmdTimeoutDuration = |
| 231 | CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE; |
| 232 | } |
| 233 | } |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 234 | end: |
| 235 | if (!HAL_STATUS_SUCCESS(status)) |
| 236 | smsLog(pMac, LOGE, "failed to initialize sme command list:%d\n", |
| 237 | status); |
| 238 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 239 | return (status); |
| 240 | } |
| 241 | |
| 242 | |
| 243 | void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd) |
| 244 | { |
| 245 | pCmd->command = eSmeNoCommand; |
| 246 | csrLLInsertTail(&pMac->sme.smeCmdFreeList, &pCmd->Link, LL_ACCESS_LOCK); |
| 247 | } |
| 248 | |
| 249 | |
| 250 | |
| 251 | static void smeReleaseCmdList(tpAniSirGlobal pMac, tDblLinkList *pList) |
| 252 | { |
| 253 | tListElem *pEntry; |
| 254 | tSmeCmd *pCommand; |
| 255 | |
| 256 | while((pEntry = csrLLRemoveHead(pList, LL_ACCESS_LOCK)) != NULL) |
| 257 | { |
| 258 | //TODO: base on command type to call release functions |
| 259 | //reinitialize different command types so they can be reused |
| 260 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 261 | smeAbortCommand(pMac, pCommand, eANI_BOOLEAN_TRUE); |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | static void purgeSmeCmdList(tpAniSirGlobal pMac) |
| 266 | { |
| 267 | //release any out standing commands back to free command list |
| 268 | smeReleaseCmdList(pMac, &pMac->sme.smeCmdPendingList); |
| 269 | smeReleaseCmdList(pMac, &pMac->sme.smeCmdActiveList); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 270 | smeReleaseCmdList(pMac, &pMac->sme.smeScanCmdPendingList); |
| 271 | smeReleaseCmdList(pMac, &pMac->sme.smeScanCmdActiveList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 272 | } |
| 273 | |
Madan Mohan Koyyalamudi | 2125599 | 2013-08-01 18:00:25 +0530 | [diff] [blame] | 274 | void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId, |
| 275 | tDblLinkList *pList) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 276 | { |
| 277 | //release any out standing commands back to free command list |
| 278 | tListElem *pEntry, *pNext; |
| 279 | tSmeCmd *pCommand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 280 | tDblLinkList localList; |
| 281 | |
| 282 | vos_mem_zero(&localList, sizeof(tDblLinkList)); |
| 283 | if(!HAL_STATUS_SUCCESS(csrLLOpen(pMac->hHdd, &localList))) |
| 284 | { |
| 285 | smsLog(pMac, LOGE, FL(" failed to open list")); |
| 286 | return; |
| 287 | } |
| 288 | |
| 289 | csrLLLock(pList); |
| 290 | pEntry = csrLLPeekHead(pList, LL_ACCESS_NOLOCK); |
| 291 | while(pEntry != NULL) |
| 292 | { |
| 293 | pNext = csrLLNext(pList, pEntry, LL_ACCESS_NOLOCK); |
| 294 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 295 | if(pCommand->sessionId == sessionId) |
| 296 | { |
| 297 | if(csrLLRemoveEntry(pList, pEntry, LL_ACCESS_NOLOCK)) |
| 298 | { |
| 299 | csrLLInsertTail(&localList, pEntry, LL_ACCESS_NOLOCK); |
| 300 | } |
| 301 | } |
| 302 | pEntry = pNext; |
| 303 | } |
| 304 | csrLLUnlock(pList); |
| 305 | |
| 306 | while( (pEntry = csrLLRemoveHead(&localList, LL_ACCESS_NOLOCK)) ) |
| 307 | { |
| 308 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 309 | smeAbortCommand(pMac, pCommand, eANI_BOOLEAN_TRUE); |
| 310 | } |
| 311 | csrLLClose(&localList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 312 | } |
| 313 | |
| 314 | |
| 315 | static eHalStatus freeSmeCmdList(tpAniSirGlobal pMac) |
| 316 | { |
| 317 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 318 | |
| 319 | purgeSmeCmdList(pMac); |
| 320 | csrLLClose(&pMac->sme.smeCmdPendingList); |
| 321 | csrLLClose(&pMac->sme.smeCmdActiveList); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 322 | csrLLClose(&pMac->sme.smeScanCmdPendingList); |
| 323 | csrLLClose(&pMac->sme.smeScanCmdActiveList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 324 | csrLLClose(&pMac->sme.smeCmdFreeList); |
| 325 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 326 | /*destroy active list command time out timer */ |
| 327 | vos_timer_destroy(pMac->sme.smeCmdActiveList.cmdTimeoutTimer); |
| 328 | vos_mem_free(pMac->sme.smeCmdActiveList.cmdTimeoutTimer); |
| 329 | pMac->sme.smeCmdActiveList.cmdTimeoutTimer = NULL; |
| 330 | |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 331 | status = vos_lock_acquire(&pMac->sme.lkSmeGlobalLock); |
| 332 | if(status != eHAL_STATUS_SUCCESS) |
| 333 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 334 | smsLog(pMac, LOGE, |
| 335 | FL("Failed to acquire the lock status = %d"), status); |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 336 | goto done; |
| 337 | } |
| 338 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 339 | if(NULL != pMac->sme.pSmeCmdBufAddr) |
| 340 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 341 | vos_mem_free(pMac->sme.pSmeCmdBufAddr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 342 | pMac->sme.pSmeCmdBufAddr = NULL; |
| 343 | } |
| 344 | |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 345 | status = vos_lock_release(&pMac->sme.lkSmeGlobalLock); |
| 346 | if(status != eHAL_STATUS_SUCCESS) |
| 347 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 348 | smsLog(pMac, LOGE, |
| 349 | FL("Failed to release the lock status = %d"), status); |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 350 | } |
| 351 | done: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 352 | return (status); |
| 353 | } |
| 354 | |
| 355 | |
| 356 | void dumpCsrCommandInfo(tpAniSirGlobal pMac, tSmeCmd *pCmd) |
| 357 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 358 | switch( pCmd->command ) |
| 359 | { |
| 360 | case eSmeCommandScan: |
| 361 | smsLog( pMac, LOGE, " scan command reason is %d", pCmd->u.scanCmd.reason ); |
| 362 | break; |
| 363 | |
| 364 | case eSmeCommandRoam: |
| 365 | smsLog( pMac, LOGE, " roam command reason is %d", pCmd->u.roamCmd.roamReason ); |
| 366 | break; |
| 367 | |
| 368 | case eSmeCommandWmStatusChange: |
| 369 | smsLog( pMac, LOGE, " WMStatusChange command type is %d", pCmd->u.wmStatusChangeCmd.Type ); |
| 370 | break; |
| 371 | |
| 372 | case eSmeCommandSetKey: |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 373 | smsLog( pMac, LOGE, " setKey command auth(%d) enc(%d)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 374 | pCmd->u.setKeyCmd.authType, pCmd->u.setKeyCmd.encType ); |
| 375 | break; |
| 376 | |
| 377 | case eSmeCommandRemoveKey: |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 378 | smsLog( pMac, LOGE, " removeKey command auth(%d) enc(%d)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 379 | pCmd->u.removeKeyCmd.authType, pCmd->u.removeKeyCmd.encType ); |
| 380 | break; |
| 381 | |
| 382 | default: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 383 | smsLog( pMac, LOGE, " default: Unhandled command %d", |
| 384 | pCmd->command); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 385 | break; |
| 386 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 387 | } |
| 388 | |
| 389 | tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac ) |
| 390 | { |
| 391 | tSmeCmd *pRetCmd = NULL, *pTempCmd = NULL; |
| 392 | tListElem *pEntry; |
Sushant Kaushik | c9d0f42 | 2014-06-23 18:59:30 +0530 | [diff] [blame] | 393 | static int smeCommandQueueFull = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 394 | pEntry = csrLLRemoveHead( &pMac->sme.smeCmdFreeList, LL_ACCESS_LOCK ); |
| 395 | |
| 396 | // If we can get another MS Msg buffer, then we are ok. Just link |
| 397 | // the entry onto the linked list. (We are using the linked list |
| 398 | // to keep track of tfhe message buffers). |
| 399 | if ( pEntry ) |
| 400 | { |
| 401 | pRetCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Sushant Kaushik | c9d0f42 | 2014-06-23 18:59:30 +0530 | [diff] [blame] | 402 | /* reset when free list is available */ |
| 403 | smeCommandQueueFull = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 404 | } |
| 405 | else { |
| 406 | int idx = 1; |
| 407 | |
| 408 | //Cannot change pRetCmd here since it needs to return later. |
| 409 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK ); |
| 410 | if( pEntry ) |
| 411 | { |
| 412 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 413 | } |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 414 | smsLog( pMac, LOGE, "Out of command buffer.... command (0x%X) stuck", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 415 | (pTempCmd) ? pTempCmd->command : eSmeNoCommand ); |
| 416 | if(pTempCmd) |
| 417 | { |
| 418 | if( eSmeCsrCommandMask & pTempCmd->command ) |
| 419 | { |
| 420 | //CSR command is stuck. See what the reason code is for that command |
| 421 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 422 | } |
| 423 | } //if(pTempCmd) |
| 424 | |
| 425 | //dump what is in the pending queue |
| 426 | csrLLLock(&pMac->sme.smeCmdPendingList); |
| 427 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK ); |
Sushant Kaushik | c9d0f42 | 2014-06-23 18:59:30 +0530 | [diff] [blame] | 428 | while(pEntry && !smeCommandQueueFull) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 429 | { |
| 430 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Sushant Kaushik | c9d0f42 | 2014-06-23 18:59:30 +0530 | [diff] [blame] | 431 | /* Print only 1st five commands from pending queue. */ |
| 432 | if (idx <= 5) |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 433 | smsLog( pMac, LOGE, "Out of command buffer.... SME pending command #%d (0x%X)", |
Sushant Kaushik | c9d0f42 | 2014-06-23 18:59:30 +0530 | [diff] [blame] | 434 | idx, pTempCmd->command ); |
| 435 | idx++; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 436 | if( eSmeCsrCommandMask & pTempCmd->command ) |
| 437 | { |
| 438 | //CSR command is stuck. See what the reason code is for that command |
| 439 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 440 | } |
| 441 | pEntry = csrLLNext( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_NOLOCK ); |
| 442 | } |
Sushant Kaushik | c9d0f42 | 2014-06-23 18:59:30 +0530 | [diff] [blame] | 443 | /* Increament static variable so that it prints pending command only once*/ |
| 444 | smeCommandQueueFull++; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 445 | csrLLUnlock(&pMac->sme.smeCmdPendingList); |
| 446 | |
| 447 | //There may be some more command in CSR's own pending queue |
| 448 | csrLLLock(&pMac->roam.roamCmdPendingList); |
| 449 | pEntry = csrLLPeekHead( &pMac->roam.roamCmdPendingList, LL_ACCESS_NOLOCK ); |
| 450 | while(pEntry) |
| 451 | { |
| 452 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 453 | 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] | 454 | idx++, pTempCmd->command ); |
| 455 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 456 | pEntry = csrLLNext( &pMac->roam.roamCmdPendingList, pEntry, LL_ACCESS_NOLOCK ); |
| 457 | } |
| 458 | csrLLUnlock(&pMac->roam.roamCmdPendingList); |
| 459 | } |
| 460 | |
| 461 | return( pRetCmd ); |
| 462 | } |
| 463 | |
| 464 | |
| 465 | void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority ) |
| 466 | { |
| 467 | if ( fHighPriority ) |
| 468 | { |
| 469 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pCmd->Link, LL_ACCESS_LOCK ); |
| 470 | } |
| 471 | else |
| 472 | { |
| 473 | csrLLInsertTail( &pMac->sme.smeCmdPendingList, &pCmd->Link, LL_ACCESS_LOCK ); |
| 474 | } |
| 475 | |
| 476 | // process the command queue... |
| 477 | smeProcessPendingQueue( pMac ); |
| 478 | |
| 479 | return; |
| 480 | } |
| 481 | |
| 482 | |
| 483 | static eSmeCommandType smeIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand ) |
| 484 | { |
| 485 | eSmeCommandType pmcCommand = eSmeNoCommand; |
| 486 | tANI_BOOLEAN fFullPowerNeeded = eANI_BOOLEAN_FALSE; |
| 487 | tPmcState pmcState; |
| 488 | eHalStatus status; |
| 489 | |
| 490 | do |
| 491 | { |
| 492 | pmcState = pmcGetPmcState(pMac); |
| 493 | |
| 494 | status = csrIsFullPowerNeeded( pMac, pCommand, NULL, &fFullPowerNeeded ); |
| 495 | if( !HAL_STATUS_SUCCESS(status) ) |
| 496 | { |
| 497 | //PMC state is not right for the command, drop it |
| 498 | return ( eSmeDropCommand ); |
| 499 | } |
| 500 | if( fFullPowerNeeded ) break; |
| 501 | fFullPowerNeeded = ( ( eSmeCommandAddTs == pCommand->command ) || |
| 502 | ( eSmeCommandDelTs == pCommand->command ) ); |
| 503 | if( fFullPowerNeeded ) break; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 504 | #ifdef FEATURE_OEM_DATA_SUPPORT |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 505 | fFullPowerNeeded = (pmcState == IMPS && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 506 | eSmeCommandOemDataReq == pCommand->command); |
| 507 | if(fFullPowerNeeded) break; |
| 508 | #endif |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 509 | fFullPowerNeeded = (pmcState == IMPS && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 510 | eSmeCommandRemainOnChannel == pCommand->command); |
| 511 | if(fFullPowerNeeded) break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 512 | } while(0); |
| 513 | |
| 514 | if( fFullPowerNeeded ) |
| 515 | { |
| 516 | switch( pmcState ) |
| 517 | { |
| 518 | case IMPS: |
| 519 | case STANDBY: |
| 520 | pmcCommand = eSmeCommandExitImps; |
| 521 | break; |
| 522 | |
| 523 | case BMPS: |
| 524 | pmcCommand = eSmeCommandExitBmps; |
| 525 | break; |
| 526 | |
| 527 | case UAPSD: |
| 528 | pmcCommand = eSmeCommandExitUapsd; |
| 529 | break; |
| 530 | |
| 531 | case WOWL: |
| 532 | pmcCommand = eSmeCommandExitWowl; |
| 533 | break; |
| 534 | |
| 535 | default: |
| 536 | break; |
| 537 | } |
| 538 | } |
| 539 | |
| 540 | return ( pmcCommand ); |
| 541 | } |
| 542 | |
| 543 | |
| 544 | //For commands that need to do extra cleanup. |
| 545 | static void smeAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping ) |
| 546 | { |
| 547 | if( eSmePmcCommandMask & pCommand->command ) |
| 548 | { |
| 549 | pmcAbortCommand( pMac, pCommand, fStopping ); |
| 550 | } |
| 551 | else if ( eSmeCsrCommandMask & pCommand->command ) |
| 552 | { |
| 553 | csrAbortCommand( pMac, pCommand, fStopping ); |
| 554 | } |
| 555 | else |
| 556 | { |
| 557 | switch( pCommand->command ) |
| 558 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 559 | case eSmeCommandRemainOnChannel: |
| 560 | if (NULL != pCommand->u.remainChlCmd.callback) |
| 561 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 562 | remainOnChanCallback callback = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 563 | pCommand->u.remainChlCmd.callback; |
| 564 | /* process the msg */ |
| 565 | if( callback ) |
| 566 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 567 | callback(pMac, pCommand->u.remainChlCmd.callbackCtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 568 | eCSR_SCAN_ABORT ); |
| 569 | } |
| 570 | } |
| 571 | smeReleaseCommand( pMac, pCommand ); |
| 572 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 573 | default: |
| 574 | smeReleaseCommand( pMac, pCommand ); |
| 575 | break; |
| 576 | } |
| 577 | } |
| 578 | } |
| 579 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 580 | tListElem *csrGetCmdToProcess(tpAniSirGlobal pMac, tDblLinkList *pList, |
| 581 | tANI_U8 sessionId, tANI_BOOLEAN fInterlocked) |
| 582 | { |
| 583 | tListElem *pCurEntry = NULL; |
| 584 | tSmeCmd *pCommand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 585 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 586 | /* Go through the list and return the command whose session id is not |
| 587 | * matching with the current ongoing scan cmd sessionId */ |
| 588 | pCurEntry = csrLLPeekHead( pList, LL_ACCESS_LOCK ); |
| 589 | while (pCurEntry) |
| 590 | { |
| 591 | pCommand = GET_BASE_ADDR(pCurEntry, tSmeCmd, Link); |
| 592 | if (pCommand->sessionId != sessionId) |
| 593 | { |
| 594 | smsLog(pMac, LOG1, "selected the command with different sessionId"); |
| 595 | return pCurEntry; |
| 596 | } |
| 597 | |
| 598 | pCurEntry = csrLLNext(pList, pCurEntry, fInterlocked); |
| 599 | } |
| 600 | |
| 601 | smsLog(pMac, LOG1, "No command pending with different sessionId"); |
| 602 | return NULL; |
| 603 | } |
| 604 | |
| 605 | tANI_BOOLEAN smeProcessScanQueue(tpAniSirGlobal pMac) |
| 606 | { |
| 607 | tListElem *pEntry; |
| 608 | tSmeCmd *pCommand; |
| 609 | tListElem *pSmeEntry; |
| 610 | tSmeCmd *pSmeCommand; |
| 611 | tANI_BOOLEAN status = eANI_BOOLEAN_TRUE; |
| 612 | |
| 613 | csrLLLock( &pMac->sme.smeScanCmdActiveList ); |
| 614 | if (csrLLIsListEmpty( &pMac->sme.smeScanCmdActiveList, |
| 615 | LL_ACCESS_NOLOCK )) |
| 616 | { |
| 617 | if (!csrLLIsListEmpty(&pMac->sme.smeScanCmdPendingList, |
| 618 | LL_ACCESS_LOCK)) |
| 619 | { |
| 620 | pEntry = csrLLPeekHead( &pMac->sme.smeScanCmdPendingList, |
| 621 | LL_ACCESS_LOCK ); |
| 622 | if (pEntry) |
| 623 | { |
| 624 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 625 | //We cannot execute any command in wait-for-key state until setKey is through. |
| 626 | if (CSR_IS_WAIT_FOR_KEY( pMac, pCommand->sessionId)) |
| 627 | { |
| 628 | if (!CSR_IS_SET_KEY_COMMAND(pCommand)) |
| 629 | { |
| 630 | smsLog(pMac, LOGE, |
| 631 | " Cannot process command(%d) while waiting for key", |
| 632 | pCommand->command); |
| 633 | status = eANI_BOOLEAN_FALSE; |
| 634 | goto end; |
| 635 | } |
| 636 | } |
| 637 | |
| 638 | if ((!csrLLIsListEmpty(&pMac->sme.smeCmdActiveList, |
| 639 | LL_ACCESS_LOCK ))) |
| 640 | { |
| 641 | pSmeEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, |
| 642 | LL_ACCESS_LOCK); |
| 643 | if (pEntry) |
| 644 | { |
| 645 | pSmeCommand = GET_BASE_ADDR(pEntry, tSmeCmd, |
| 646 | Link) ; |
| 647 | |
| 648 | /* if scan is running on one interface and SME recei |
| 649 | ves the next command on the same interface then |
| 650 | dont the allow the command to be queued to |
| 651 | smeCmdPendingList. If next scan is allowed on |
| 652 | the same interface the CSR state machine will |
| 653 | get screwed up. */ |
| 654 | if (pSmeCommand->sessionId == pCommand->sessionId) |
| 655 | { |
| 656 | status = eANI_BOOLEAN_FALSE; |
| 657 | goto end; |
| 658 | } |
| 659 | } |
| 660 | } |
| 661 | if ( csrLLRemoveEntry( &pMac->sme.smeScanCmdPendingList, |
| 662 | pEntry, LL_ACCESS_LOCK ) ) |
| 663 | { |
| 664 | csrLLInsertHead( &pMac->sme.smeScanCmdActiveList, |
| 665 | &pCommand->Link, LL_ACCESS_NOLOCK ); |
| 666 | |
| 667 | switch (pCommand->command) |
| 668 | { |
| 669 | case eSmeCommandScan: |
| 670 | smsLog(pMac, LOG1, |
| 671 | " Processing scan offload command "); |
| 672 | csrProcessScanCommand( pMac, pCommand ); |
| 673 | break; |
| 674 | default: |
| 675 | smsLog(pMac, LOGE, |
| 676 | " Something wrong, wrong command enqueued" |
| 677 | " to smeScanCmdPendingList"); |
| 678 | pEntry = csrLLRemoveHead( |
| 679 | &pMac->sme.smeScanCmdActiveList, |
| 680 | LL_ACCESS_NOLOCK ); |
| 681 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 682 | smeReleaseCommand( pMac, pCommand ); |
| 683 | break; |
| 684 | } |
| 685 | } |
| 686 | } |
| 687 | } |
| 688 | } |
| 689 | end: |
| 690 | csrLLUnlock(&pMac->sme.smeScanCmdActiveList); |
| 691 | return status; |
| 692 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 693 | |
| 694 | tANI_BOOLEAN smeProcessCommand( tpAniSirGlobal pMac ) |
| 695 | { |
| 696 | tANI_BOOLEAN fContinue = eANI_BOOLEAN_FALSE; |
| 697 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 698 | tListElem *pEntry; |
| 699 | tSmeCmd *pCommand; |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 700 | tListElem *pSmeEntry; |
| 701 | tSmeCmd *pSmeCommand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 702 | eSmeCommandType pmcCommand = eSmeNoCommand; |
| 703 | |
| 704 | // if the ActiveList is empty, then nothing is active so we can process a |
| 705 | // pending command... |
| 706 | //alwasy lock active list before locking pending list |
| 707 | csrLLLock( &pMac->sme.smeCmdActiveList ); |
| 708 | if ( csrLLIsListEmpty( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ) ) |
| 709 | { |
| 710 | if(!csrLLIsListEmpty(&pMac->sme.smeCmdPendingList, LL_ACCESS_LOCK)) |
| 711 | { |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 712 | /* If scan command is pending in the smeScanCmdActive list |
| 713 | * then pick the command from smeCmdPendingList which is |
| 714 | * not matching with the scan command session id. |
| 715 | * At any point of time only one command will be allowed |
| 716 | * on a single session. */ |
| 717 | if ((pMac->fScanOffload) && |
| 718 | (!csrLLIsListEmpty(&pMac->sme.smeScanCmdActiveList, |
| 719 | LL_ACCESS_LOCK))) |
| 720 | { |
| 721 | pSmeEntry = csrLLPeekHead(&pMac->sme.smeScanCmdActiveList, |
| 722 | LL_ACCESS_LOCK); |
| 723 | if (pSmeEntry) |
| 724 | { |
| 725 | pSmeCommand = GET_BASE_ADDR(pSmeEntry, tSmeCmd, Link); |
| 726 | |
| 727 | pEntry = csrGetCmdToProcess(pMac, |
| 728 | &pMac->sme.smeCmdPendingList, |
| 729 | pSmeCommand->sessionId, |
| 730 | LL_ACCESS_LOCK); |
| 731 | goto sme_process_cmd; |
| 732 | } |
| 733 | } |
| 734 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 735 | //Peek the command |
| 736 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdPendingList, LL_ACCESS_LOCK ); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 737 | sme_process_cmd: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 738 | if( pEntry ) |
| 739 | { |
| 740 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 741 | |
Abhishek Singh | f4669da | 2014-05-26 15:07:49 +0530 | [diff] [blame] | 742 | /* Allow only disconnect command |
| 743 | * in wait-for-key state until setKey is through. |
| 744 | */ |
| 745 | if( CSR_IS_WAIT_FOR_KEY( pMac, pCommand->sessionId ) && |
| 746 | !CSR_IS_DISCONNECT_COMMAND( pCommand ) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 747 | { |
| 748 | if( !CSR_IS_SET_KEY_COMMAND( pCommand ) ) |
| 749 | { |
| 750 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
Abhishek Singh | f4669da | 2014-05-26 15:07:49 +0530 | [diff] [blame] | 751 | smsLog(pMac, LOGE, FL("SessionId %d: Cannot process " |
| 752 | "command(%d) while waiting for key"), |
| 753 | pCommand->sessionId, pCommand->command); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 754 | fContinue = eANI_BOOLEAN_FALSE; |
| 755 | goto sme_process_scan_queue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 756 | } |
| 757 | } |
| 758 | pmcCommand = smeIsFullPowerNeeded( pMac, pCommand ); |
| 759 | if( eSmeDropCommand == pmcCommand ) |
| 760 | { |
| 761 | //This command is not ok for current PMC state |
| 762 | if( csrLLRemoveEntry( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_LOCK ) ) |
| 763 | { |
| 764 | smeAbortCommand( pMac, pCommand, eANI_BOOLEAN_FALSE ); |
| 765 | } |
| 766 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 767 | //tell caller to continue |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 768 | fContinue = eANI_BOOLEAN_TRUE; |
| 769 | goto sme_process_scan_queue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 770 | } |
| 771 | else if( eSmeNoCommand != pmcCommand ) |
| 772 | { |
| 773 | tExitBmpsInfo exitBmpsInfo; |
| 774 | void *pv = NULL; |
| 775 | tANI_U32 size = 0; |
| 776 | tSmeCmd *pPmcCmd = NULL; |
| 777 | |
| 778 | if( eSmeCommandExitBmps == pmcCommand ) |
| 779 | { |
| 780 | exitBmpsInfo.exitBmpsReason = eSME_REASON_OTHER; |
| 781 | pv = (void *)&exitBmpsInfo; |
| 782 | size = sizeof(tExitBmpsInfo); |
| 783 | } |
| 784 | //pmcCommand has to be one of the exit power save command |
| 785 | status = pmcPrepareCommand( pMac, pmcCommand, pv, size, &pPmcCmd ); |
| 786 | if( HAL_STATUS_SUCCESS( status ) && pPmcCmd ) |
| 787 | { |
| 788 | //Force this command to wake up the chip |
| 789 | csrLLInsertHead( &pMac->sme.smeCmdActiveList, &pPmcCmd->Link, LL_ACCESS_NOLOCK ); |
| 790 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 791 | fContinue = pmcProcessCommand( pMac, pPmcCmd ); |
| 792 | if( fContinue ) |
| 793 | { |
| 794 | //The command failed, remove it |
| 795 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, &pPmcCmd->Link, LL_ACCESS_NOLOCK ) ) |
| 796 | { |
| 797 | pmcReleaseCommand( pMac, pPmcCmd ); |
| 798 | } |
| 799 | } |
| 800 | } |
| 801 | else |
| 802 | { |
| 803 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 804 | 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] | 805 | //Let it retry |
| 806 | fContinue = eANI_BOOLEAN_TRUE; |
| 807 | } |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 808 | goto sme_process_scan_queue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 809 | } |
| 810 | if ( csrLLRemoveEntry( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_LOCK ) ) |
| 811 | { |
| 812 | // we can reuse the pCommand |
| 813 | |
| 814 | // Insert the command onto the ActiveList... |
| 815 | csrLLInsertHead( &pMac->sme.smeCmdActiveList, &pCommand->Link, LL_ACCESS_NOLOCK ); |
| 816 | |
Rashmi Ramanna | 68b309c | 2014-05-20 11:52:22 +0530 | [diff] [blame] | 817 | if( pMac->deferImps ) |
| 818 | { |
| 819 | /* IMPS timer is already running so stop it and |
| 820 | * it will get restarted when no command is pending |
| 821 | */ |
| 822 | csrScanStopIdleScanTimer( pMac ); |
| 823 | pMac->scan.fRestartIdleScan = eANI_BOOLEAN_TRUE; |
| 824 | pMac->deferImps = eANI_BOOLEAN_FALSE; |
| 825 | } |
| 826 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 827 | // .... and process the command. |
| 828 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 829 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 830 | TRACE_CODE_SME_COMMAND, pCommand->sessionId, pCommand->command)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 831 | switch ( pCommand->command ) |
| 832 | { |
| 833 | |
| 834 | case eSmeCommandScan: |
| 835 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 836 | status = csrProcessScanCommand( pMac, pCommand ); |
| 837 | break; |
| 838 | |
| 839 | case eSmeCommandRoam: |
| 840 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 841 | status = csrRoamProcessCommand( pMac, pCommand ); |
Madan Mohan Koyyalamudi | 59efbe0 | 2013-01-10 15:38:42 -0800 | [diff] [blame] | 842 | if(!HAL_STATUS_SUCCESS(status)) |
| 843 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 844 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Madan Mohan Koyyalamudi | 59efbe0 | 2013-01-10 15:38:42 -0800 | [diff] [blame] | 845 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 846 | { |
| 847 | csrReleaseCommandRoam( pMac, pCommand ); |
| 848 | } |
| 849 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 850 | break; |
| 851 | |
| 852 | case eSmeCommandWmStatusChange: |
| 853 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 854 | csrRoamProcessWmStatusChangeCommand(pMac, pCommand); |
| 855 | break; |
| 856 | |
| 857 | case eSmeCommandSetKey: |
| 858 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 859 | status = csrRoamProcessSetKeyCommand( pMac, pCommand ); |
| 860 | if(!HAL_STATUS_SUCCESS(status)) |
| 861 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 862 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 863 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 864 | { |
| 865 | csrReleaseCommandSetKey( pMac, pCommand ); |
| 866 | } |
| 867 | } |
| 868 | break; |
| 869 | |
| 870 | case eSmeCommandRemoveKey: |
| 871 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 872 | status = csrRoamProcessRemoveKeyCommand( pMac, pCommand ); |
| 873 | if(!HAL_STATUS_SUCCESS(status)) |
| 874 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 875 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 876 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 877 | { |
| 878 | csrReleaseCommandRemoveKey( pMac, pCommand ); |
| 879 | } |
| 880 | } |
| 881 | break; |
| 882 | |
| 883 | case eSmeCommandAddStaSession: |
| 884 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 885 | csrProcessAddStaSessionCommand( pMac, pCommand ); |
| 886 | break; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 887 | case eSmeCommandDelStaSession: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 888 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 889 | csrProcessDelStaSessionCommand( pMac, pCommand ); |
| 890 | break; |
| 891 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 892 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 893 | case eSmeCommandOemDataReq: |
| 894 | csrLLUnlock(&pMac->sme.smeCmdActiveList); |
| 895 | oemData_ProcessOemDataReqCommand(pMac, pCommand); |
| 896 | break; |
| 897 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 898 | case eSmeCommandRemainOnChannel: |
| 899 | csrLLUnlock(&pMac->sme.smeCmdActiveList); |
| 900 | p2pProcessRemainOnChannelCmd(pMac, pCommand); |
| 901 | break; |
| 902 | case eSmeCommandNoAUpdate: |
| 903 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 904 | p2pProcessNoAReq(pMac,pCommand); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 905 | case eSmeCommandEnterImps: |
| 906 | case eSmeCommandExitImps: |
| 907 | case eSmeCommandEnterBmps: |
| 908 | case eSmeCommandExitBmps: |
| 909 | case eSmeCommandEnterUapsd: |
| 910 | case eSmeCommandExitUapsd: |
| 911 | case eSmeCommandEnterWowl: |
| 912 | case eSmeCommandExitWowl: |
| 913 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 914 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 915 | if( fContinue ) |
| 916 | { |
| 917 | //The command failed, remove it |
| 918 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 919 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 920 | { |
| 921 | pmcReleaseCommand( pMac, pCommand ); |
| 922 | } |
| 923 | } |
| 924 | break; |
| 925 | |
| 926 | //Treat standby differently here because caller may not be able to handle |
| 927 | //the failure so we do our best here |
| 928 | case eSmeCommandEnterStandby: |
| 929 | if( csrIsConnStateDisconnected( pMac, pCommand->sessionId ) ) |
| 930 | { |
| 931 | //It can continue |
| 932 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 933 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 934 | if( fContinue ) |
| 935 | { |
| 936 | //The command failed, remove it |
| 937 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 938 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 939 | { |
| 940 | pmcReleaseCommand( pMac, pCommand ); |
| 941 | } |
| 942 | } |
| 943 | } |
| 944 | else |
| 945 | { |
| 946 | //Need to issue a disconnect first before processing this command |
| 947 | tSmeCmd *pNewCmd; |
| 948 | |
| 949 | //We need to re-run the command |
| 950 | fContinue = eANI_BOOLEAN_TRUE; |
| 951 | //Pull off the standby command first |
| 952 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 953 | &pCommand->Link, LL_ACCESS_NOLOCK ) ) |
| 954 | { |
| 955 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 956 | //Need to call CSR function here because the disconnect command |
| 957 | //is handled by CSR |
| 958 | pNewCmd = csrGetCommandBuffer( pMac ); |
| 959 | if( NULL != pNewCmd ) |
| 960 | { |
| 961 | //Put the standby command to the head of the pending list first |
| 962 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pCommand->Link, |
| 963 | LL_ACCESS_LOCK ); |
| 964 | pNewCmd->command = eSmeCommandRoam; |
| 965 | pNewCmd->u.roamCmd.roamReason = eCsrForcedDisassoc; |
| 966 | //Put the disassoc command before the standby command |
| 967 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pNewCmd->Link, |
| 968 | LL_ACCESS_LOCK ); |
| 969 | } |
| 970 | else |
| 971 | { |
| 972 | //Continue the command here |
| 973 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 974 | if( fContinue ) |
| 975 | { |
| 976 | //The command failed, remove it |
| 977 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 978 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 979 | { |
| 980 | pmcReleaseCommand( pMac, pCommand ); |
| 981 | } |
| 982 | } |
| 983 | } |
| 984 | } |
| 985 | else |
| 986 | { |
| 987 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 988 | smsLog( pMac, LOGE, FL(" failed to remove standby command") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 989 | VOS_ASSERT(0); |
| 990 | } |
| 991 | } |
| 992 | break; |
| 993 | |
| 994 | case eSmeCommandAddTs: |
| 995 | case eSmeCommandDelTs: |
| 996 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 997 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 998 | fContinue = qosProcessCommand( pMac, pCommand ); |
| 999 | if( fContinue ) |
| 1000 | { |
| 1001 | //The command failed, remove it |
| 1002 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 1003 | &pCommand->Link, LL_ACCESS_NOLOCK ) ) |
| 1004 | { |
| 1005 | //#ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1006 | qosReleaseCommand( pMac, pCommand ); |
| 1007 | //#endif /* WLAN_MDM_CODE_REDUCTION_OPT*/ |
| 1008 | } |
| 1009 | } |
| 1010 | #endif |
| 1011 | break; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1012 | #ifdef FEATURE_WLAN_TDLS |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1013 | case eSmeCommandTdlsSendMgmt: |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1014 | case eSmeCommandTdlsAddPeer: |
| 1015 | case eSmeCommandTdlsDelPeer: |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1016 | case eSmeCommandTdlsLinkEstablish: |
Atul Mittal | c0f739f | 2014-07-31 13:47:47 +0530 | [diff] [blame] | 1017 | case eSmeCommandTdlsChannelSwitch: // tdlsoffchan |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1018 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 1019 | case eSmeCommandTdlsDiscovery: |
| 1020 | case eSmeCommandTdlsLinkSetup: |
| 1021 | case eSmeCommandTdlsLinkTear: |
| 1022 | case eSmeCommandTdlsEnterUapsd: |
| 1023 | case eSmeCommandTdlsExitUapsd: |
| 1024 | #endif |
| 1025 | { |
Hoonki Lee | 1090c6a | 2013-01-16 17:40:54 -0800 | [diff] [blame] | 1026 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1027 | "sending TDLS Command 0x%x to PE", pCommand->command); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1028 | |
| 1029 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1030 | status = csrTdlsProcessCmd( pMac, pCommand ); |
| 1031 | } |
| 1032 | break ; |
| 1033 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1034 | |
| 1035 | default: |
| 1036 | //something is wrong |
| 1037 | //remove it from the active list |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1038 | smsLog(pMac, LOGE, " csrProcessCommand processes an unknown command %d", pCommand->command); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1039 | pEntry = csrLLRemoveHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ); |
| 1040 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1041 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 1042 | smeReleaseCommand( pMac, pCommand ); |
| 1043 | status = eHAL_STATUS_FAILURE; |
| 1044 | break; |
| 1045 | } |
| 1046 | if(!HAL_STATUS_SUCCESS(status)) |
| 1047 | { |
| 1048 | fContinue = eANI_BOOLEAN_TRUE; |
| 1049 | } |
| 1050 | }//if(pEntry) |
| 1051 | else |
| 1052 | { |
| 1053 | //This is odd. Some one else pull off the command. |
| 1054 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1055 | } |
| 1056 | } |
| 1057 | else |
| 1058 | { |
| 1059 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1060 | } |
| 1061 | } |
| 1062 | else |
| 1063 | { |
| 1064 | //No command waiting |
| 1065 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1066 | //This is only used to restart an idle mode scan, it means at least one other idle scan has finished. |
| 1067 | if(pMac->scan.fRestartIdleScan && eANI_BOOLEAN_FALSE == pMac->scan.fCancelIdleScan) |
| 1068 | { |
| 1069 | tANI_U32 nTime = 0; |
| 1070 | |
| 1071 | pMac->scan.fRestartIdleScan = eANI_BOOLEAN_FALSE; |
| 1072 | if(!HAL_STATUS_SUCCESS(csrScanTriggerIdleScan(pMac, &nTime))) |
| 1073 | { |
| 1074 | csrScanStartIdleScanTimer(pMac, nTime); |
| 1075 | } |
| 1076 | } |
| 1077 | } |
| 1078 | } |
| 1079 | else { |
| 1080 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1081 | } |
| 1082 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 1083 | sme_process_scan_queue: |
| 1084 | if (pMac->fScanOffload && !(smeProcessScanQueue(pMac))) |
| 1085 | fContinue = eANI_BOOLEAN_FALSE; |
| 1086 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1087 | return ( fContinue ); |
| 1088 | } |
| 1089 | |
| 1090 | void smeProcessPendingQueue( tpAniSirGlobal pMac ) |
| 1091 | { |
| 1092 | while( smeProcessCommand( pMac ) ); |
| 1093 | } |
| 1094 | |
| 1095 | |
| 1096 | tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac) |
| 1097 | { |
| 1098 | return ( !csrLLIsListEmpty( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ) || |
| 1099 | !csrLLIsListEmpty(&pMac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK) ); |
| 1100 | } |
| 1101 | |
| 1102 | |
| 1103 | |
| 1104 | //Global APIs |
| 1105 | |
| 1106 | /*-------------------------------------------------------------------------- |
| 1107 | |
| 1108 | \brief sme_Open() - Initialze all SME modules and put them at idle state |
| 1109 | |
| 1110 | The function initializes each module inside SME, PMC, CCM, CSR, etc. . Upon |
| 1111 | successfully return, all modules are at idle state ready to start. |
| 1112 | |
| 1113 | smeOpen must be called before any other SME APIs can be involved. |
| 1114 | smeOpen must be called after macOpen. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1115 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1116 | \param hHal - The handle returned by macOpen. |
| 1117 | |
| 1118 | \return eHAL_STATUS_SUCCESS - SME is successfully initialized. |
| 1119 | |
| 1120 | Other status means SME is failed to be initialized |
| 1121 | \sa |
| 1122 | |
| 1123 | --------------------------------------------------------------------------*/ |
| 1124 | eHalStatus sme_Open(tHalHandle hHal) |
| 1125 | { |
| 1126 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1127 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1128 | |
| 1129 | do { |
| 1130 | pMac->sme.state = SME_STATE_STOP; |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 1131 | pMac->sme.currDeviceMode = VOS_STA_MODE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1132 | if( !VOS_IS_STATUS_SUCCESS( vos_lock_init( &pMac->sme.lkSmeGlobalLock ) ) ) |
| 1133 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1134 | smsLog( pMac, LOGE, "sme_Open failed init lock" ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1135 | status = eHAL_STATUS_FAILURE; |
| 1136 | break; |
| 1137 | } |
| 1138 | |
| 1139 | status = ccmOpen(hHal); |
| 1140 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1141 | smsLog( pMac, LOGE, |
| 1142 | "ccmOpen failed during initialization with status=%d", status ); |
| 1143 | break; |
| 1144 | } |
| 1145 | |
| 1146 | status = csrOpen(pMac); |
| 1147 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1148 | smsLog( pMac, LOGE, |
| 1149 | "csrOpen failed during initialization with status=%d", status ); |
| 1150 | break; |
| 1151 | } |
| 1152 | |
| 1153 | status = pmcOpen(hHal); |
| 1154 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1155 | smsLog( pMac, LOGE, |
| 1156 | "pmcOpen failed during initialization with status=%d", status ); |
| 1157 | break; |
| 1158 | } |
| 1159 | |
Gopichand Nakkala | 34d1b06 | 2013-03-19 15:28:33 -0700 | [diff] [blame] | 1160 | #ifdef FEATURE_WLAN_TDLS |
| 1161 | pMac->isTdlsPowerSaveProhibited = 0; |
| 1162 | #endif |
| 1163 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1164 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1165 | status = sme_QosOpen(pMac); |
| 1166 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1167 | smsLog( pMac, LOGE, |
| 1168 | "Qos open failed during initialization with status=%d", status ); |
| 1169 | break; |
| 1170 | } |
| 1171 | |
| 1172 | status = btcOpen(pMac); |
| 1173 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1174 | smsLog( pMac, LOGE, |
| 1175 | "btcOpen open failed during initialization with status=%d", status ); |
| 1176 | break; |
| 1177 | } |
| 1178 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1179 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1180 | status = oemData_OemDataReqOpen(pMac); |
| 1181 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1182 | smsLog(pMac, LOGE, |
| 1183 | "oemData_OemDataReqOpen failed during initialization with status=%d", status ); |
| 1184 | break; |
| 1185 | } |
| 1186 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1187 | |
| 1188 | if(!HAL_STATUS_SUCCESS((status = initSmeCmdList(pMac)))) |
| 1189 | break; |
| 1190 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1191 | { |
| 1192 | v_PVOID_t pvosGCtx = vos_get_global_context(VOS_MODULE_ID_SAP, NULL); |
| 1193 | if ( NULL == pvosGCtx ){ |
| 1194 | smsLog( pMac, LOGE, "WLANSAP_Open open failed during initialization"); |
| 1195 | status = eHAL_STATUS_FAILURE; |
| 1196 | break; |
| 1197 | } |
| 1198 | |
| 1199 | status = WLANSAP_Open( pvosGCtx ); |
| 1200 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1201 | smsLog( pMac, LOGE, |
| 1202 | "WLANSAP_Open open failed during initialization with status=%d", status ); |
| 1203 | break; |
| 1204 | } |
| 1205 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1206 | #if defined WLAN_FEATURE_VOWIFI |
| 1207 | status = rrmOpen(pMac); |
| 1208 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1209 | smsLog( pMac, LOGE, |
| 1210 | "rrmOpen open failed during initialization with status=%d", status ); |
| 1211 | break; |
| 1212 | } |
| 1213 | #endif |
| 1214 | |
| 1215 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 1216 | sme_FTOpen(pMac); |
| 1217 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1218 | sme_p2pOpen(pMac); |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1219 | smeTraceInit(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1220 | |
| 1221 | }while (0); |
| 1222 | |
| 1223 | return status; |
| 1224 | } |
| 1225 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1226 | /*-------------------------------------------------------------------------- |
| 1227 | |
| 1228 | \brief sme_set11dinfo() - Set the 11d information about valid channels |
| 1229 | and there power using information from nvRAM |
| 1230 | This function is called only for AP. |
| 1231 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1232 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1233 | |
| 1234 | \param hHal - The handle returned by macOpen. |
| 1235 | \Param pSmeConfigParams - a pointer to a caller allocated object of |
| 1236 | typedef struct _smeConfigParams. |
| 1237 | |
| 1238 | \return eHAL_STATUS_SUCCESS - SME update the config parameters successfully. |
| 1239 | |
| 1240 | Other status means SME is failed to update the config parameters. |
| 1241 | \sa |
| 1242 | --------------------------------------------------------------------------*/ |
| 1243 | |
| 1244 | eHalStatus sme_set11dinfo(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) |
| 1245 | { |
| 1246 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1247 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1248 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1249 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1250 | TRACE_CODE_SME_RX_HDD_MSG_SET_11DINFO, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1251 | if (NULL == pSmeConfigParams ) { |
| 1252 | smsLog( pMac, LOGE, |
| 1253 | "Empty config param structure for SME, nothing to update"); |
| 1254 | return status; |
| 1255 | } |
| 1256 | |
| 1257 | status = csrSetChannels(hHal, &pSmeConfigParams->csrConfig ); |
| 1258 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1259 | smsLog( pMac, LOGE, "csrChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1260 | status ); |
| 1261 | } |
| 1262 | return status; |
| 1263 | } |
| 1264 | |
| 1265 | /*-------------------------------------------------------------------------- |
| 1266 | |
| 1267 | \brief sme_getSoftApDomain() - Get the current regulatory domain of softAp. |
| 1268 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1269 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1270 | |
| 1271 | \param hHal - The handle returned by HostapdAdapter. |
| 1272 | \Param v_REGDOMAIN_t - The current Regulatory Domain requested for SoftAp. |
| 1273 | |
| 1274 | \return eHAL_STATUS_SUCCESS - SME successfully completed the request. |
| 1275 | |
| 1276 | Other status means, failed to get the current regulatory domain. |
| 1277 | \sa |
| 1278 | --------------------------------------------------------------------------*/ |
| 1279 | |
| 1280 | eHalStatus sme_getSoftApDomain(tHalHandle hHal, v_REGDOMAIN_t *domainIdSoftAp) |
| 1281 | { |
| 1282 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1283 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1284 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1285 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1286 | TRACE_CODE_SME_RX_HDD_MSG_GET_SOFTAP_DOMAIN, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1287 | if (NULL == domainIdSoftAp ) { |
| 1288 | smsLog( pMac, LOGE, "Uninitialized domain Id"); |
| 1289 | return status; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1290 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1291 | |
| 1292 | *domainIdSoftAp = pMac->scan.domainIdCurrent; |
| 1293 | status = eHAL_STATUS_SUCCESS; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1294 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1295 | return status; |
| 1296 | } |
| 1297 | |
| 1298 | |
| 1299 | eHalStatus sme_setRegInfo(tHalHandle hHal, tANI_U8 *apCntryCode) |
| 1300 | { |
| 1301 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1302 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1303 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1304 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1305 | TRACE_CODE_SME_RX_HDD_MSG_SET_REGINFO, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1306 | if (NULL == apCntryCode ) { |
| 1307 | smsLog( pMac, LOGE, "Empty Country Code, nothing to update"); |
| 1308 | return status; |
| 1309 | } |
| 1310 | |
| 1311 | status = csrSetRegInfo(hHal, apCntryCode ); |
| 1312 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1313 | smsLog( pMac, LOGE, "csrSetRegInfo failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1314 | status ); |
| 1315 | } |
| 1316 | return status; |
| 1317 | } |
| 1318 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1319 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 1320 | /*-------------------------------------------------------------------------- |
| 1321 | |
| 1322 | \brief sme_UpdateChannelConfig() - Update channel configuration in RIVA. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1323 | |
| 1324 | It is used at driver start up to inform RIVA of the default channel |
| 1325 | configuration. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1326 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1327 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1328 | |
| 1329 | \param hHal - The handle returned by macOpen. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1330 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1331 | \return eHAL_STATUS_SUCCESS - SME update the channel config successfully. |
| 1332 | |
| 1333 | Other status means SME is failed to update the channel config. |
| 1334 | \sa |
| 1335 | |
| 1336 | --------------------------------------------------------------------------*/ |
| 1337 | eHalStatus sme_UpdateChannelConfig(tHalHandle hHal) |
| 1338 | { |
| 1339 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1340 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1341 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1342 | TRACE_CODE_SME_RX_HDD_MSG_UPDATE_CHANNEL_CONFIG, NO_SESSION, 0)); |
| 1343 | pmcUpdateScanParams( pMac, &(pMac->roam.configParam), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1344 | &pMac->scan.base20MHzChannels, FALSE); |
| 1345 | return eHAL_STATUS_SUCCESS; |
| 1346 | } |
| 1347 | #endif // FEATURE_WLAN_SCAN_PNLO |
| 1348 | |
Abhishek Singh | f644b27 | 2014-08-21 02:59:39 +0530 | [diff] [blame] | 1349 | eHalStatus sme_UpdateChannelList(tHalHandle hHal) |
| 1350 | { |
| 1351 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1352 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1353 | |
| 1354 | status = csrUpdateChannelList(pMac); |
| 1355 | |
| 1356 | if (eHAL_STATUS_SUCCESS != status) |
| 1357 | { |
| 1358 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1359 | "failed to update the supported channel list"); |
| 1360 | } |
| 1361 | return status; |
| 1362 | } |
| 1363 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1364 | /*-------------------------------------------------------------------------- |
| 1365 | |
| 1366 | \brief sme_UpdateConfig() - Change configurations for all SME moduels |
| 1367 | |
| 1368 | The function updates some configuration for modules in SME, CCM, CSR, etc |
| 1369 | during SMEs close open sequence. |
| 1370 | |
| 1371 | Modules inside SME apply the new configuration at the next transaction. |
| 1372 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1373 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1374 | |
| 1375 | \param hHal - The handle returned by macOpen. |
| 1376 | \Param pSmeConfigParams - a pointer to a caller allocated object of |
| 1377 | typedef struct _smeConfigParams. |
| 1378 | |
| 1379 | \return eHAL_STATUS_SUCCESS - SME update the config parameters successfully. |
| 1380 | |
| 1381 | Other status means SME is failed to update the config parameters. |
| 1382 | \sa |
| 1383 | |
| 1384 | --------------------------------------------------------------------------*/ |
| 1385 | eHalStatus sme_UpdateConfig(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) |
| 1386 | { |
| 1387 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1388 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1389 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1390 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1391 | TRACE_CODE_SME_RX_HDD_MSG_UPDATE_CONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1392 | if (NULL == pSmeConfigParams ) { |
| 1393 | smsLog( pMac, LOGE, |
| 1394 | "Empty config param structure for SME, nothing to update"); |
| 1395 | return status; |
| 1396 | } |
| 1397 | |
| 1398 | status = csrChangeDefaultConfigParam(pMac, &pSmeConfigParams->csrConfig); |
| 1399 | |
| 1400 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1401 | smsLog( pMac, LOGE, "csrChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1402 | status ); |
| 1403 | } |
| 1404 | #if defined WLAN_FEATURE_P2P_INTERNAL |
| 1405 | status = p2pChangeDefaultConfigParam(pMac, &pSmeConfigParams->p2pConfig); |
| 1406 | |
| 1407 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1408 | smsLog( pMac, LOGE, "p2pChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1409 | status ); |
| 1410 | } |
| 1411 | #endif |
| 1412 | #if defined WLAN_FEATURE_VOWIFI |
| 1413 | status = rrmChangeDefaultConfigParam(hHal, &pSmeConfigParams->rrmConfig); |
| 1414 | |
| 1415 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1416 | smsLog( pMac, LOGE, "rrmChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1417 | status ); |
| 1418 | } |
| 1419 | #endif |
| 1420 | //For SOC, CFG is set before start |
| 1421 | //We don't want to apply global CFG in connect state because that may cause some side affect |
| 1422 | if( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1423 | csrIsAllSessionDisconnected( pMac) ) |
| 1424 | { |
| 1425 | csrSetGlobalCfgs(pMac); |
| 1426 | } |
| 1427 | |
Gopichand Nakkala | 86e4266 | 2013-06-11 17:44:11 +0530 | [diff] [blame] | 1428 | /* update the directed scan offload setting */ |
| 1429 | pMac->fScanOffload = pSmeConfigParams->fScanOffload; |
| 1430 | |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 1431 | /* Enable channel bonding mode in 2.4GHz */ |
| 1432 | if ((pSmeConfigParams->csrConfig.channelBondingMode24GHz == TRUE) && |
| 1433 | (IS_HT40_OBSS_SCAN_FEATURE_ENABLE)) |
| 1434 | { |
| 1435 | ccmCfgSetInt(hHal,WNI_CFG_CHANNEL_BONDING_24G, |
| 1436 | eANI_BOOLEAN_TRUE, NULL,eANI_BOOLEAN_FALSE); |
| 1437 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, |
| 1438 | "Setting channelBondingMode24GHz:%d " , |
| 1439 | pSmeConfigParams->csrConfig.channelBondingMode24GHz); |
| 1440 | } |
Madan Mohan Koyyalamudi | d89feb7 | 2013-07-31 15:47:12 +0530 | [diff] [blame] | 1441 | if (pMac->fScanOffload) |
| 1442 | { |
| 1443 | /* If scan offload is enabled then lim has allow the sending of |
| 1444 | scan request to firmware even in powersave mode. The firmware has |
| 1445 | to take care of exiting from power save mode */ |
| 1446 | status = ccmCfgSetInt(hHal, WNI_CFG_SCAN_IN_POWERSAVE, |
| 1447 | eANI_BOOLEAN_TRUE, NULL, eANI_BOOLEAN_FALSE); |
| 1448 | |
| 1449 | if (eHAL_STATUS_SUCCESS != status) |
| 1450 | { |
| 1451 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1452 | "Could not pass on WNI_CFG_SCAN_IN_POWERSAVE to CCM"); |
| 1453 | } |
| 1454 | } |
krunal soni | e9002db | 2013-11-25 14:24:17 -0800 | [diff] [blame] | 1455 | pMac->isCoalesingInIBSSAllowed = |
| 1456 | pSmeConfigParams->csrConfig.isCoalesingInIBSSAllowed; |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 1457 | pMac->fEnableDebugLog = pSmeConfigParams->fEnableDebugLog; |
Rashmi Ramanna | 68b309c | 2014-05-20 11:52:22 +0530 | [diff] [blame] | 1458 | pMac->fDeferIMPSTime = pSmeConfigParams->fDeferIMPSTime; |
| 1459 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1460 | return status; |
| 1461 | } |
| 1462 | |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 1463 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 1464 | void sme_ProcessGetGtkInfoRsp( tHalHandle hHal, |
| 1465 | tpSirGtkOffloadGetInfoRspParams pGtkOffloadGetInfoRsp) |
| 1466 | { |
| 1467 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1468 | |
| 1469 | if (NULL == pMac) |
| 1470 | { |
| 1471 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 1472 | "%s: pMac is null", __func__); |
| 1473 | return ; |
| 1474 | } |
| 1475 | if (pMac->pmc.GtkOffloadGetInfoCB == NULL) |
| 1476 | { |
| 1477 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1478 | "%s: HDD callback is null", __func__); |
| 1479 | return ; |
| 1480 | } |
| 1481 | pMac->pmc.GtkOffloadGetInfoCB(pMac->pmc.GtkOffloadGetInfoCBContext, |
| 1482 | pGtkOffloadGetInfoRsp); |
| 1483 | } |
| 1484 | #endif |
| 1485 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1486 | /* --------------------------------------------------------------------------- |
| 1487 | \fn sme_ChangeConfigParams |
| 1488 | \brief The SME API exposed for HDD to provide config params to SME during |
| 1489 | SMEs stop -> start sequence. |
| 1490 | |
| 1491 | If HDD changed the domain that will cause a reset. This function will |
| 1492 | provide the new set of 11d information for the new domain. Currrently this |
| 1493 | API provides info regarding 11d only at reset but we can extend this for |
| 1494 | other params (PMC, QoS) which needs to be initialized again at reset. |
| 1495 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1496 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1497 | |
| 1498 | \param hHal - The handle returned by macOpen. |
| 1499 | |
| 1500 | \Param |
| 1501 | pUpdateConfigParam - a pointer to a structure (tCsrUpdateConfigParam) that |
| 1502 | currently provides 11d related information like Country code, |
| 1503 | Regulatory domain, valid channel list, Tx power per channel, a |
| 1504 | list with active/passive scan allowed per valid channel. |
| 1505 | |
| 1506 | \return eHalStatus |
| 1507 | ---------------------------------------------------------------------------*/ |
| 1508 | eHalStatus sme_ChangeConfigParams(tHalHandle hHal, |
| 1509 | tCsrUpdateConfigParam *pUpdateConfigParam) |
| 1510 | { |
| 1511 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1512 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1513 | |
| 1514 | if (NULL == pUpdateConfigParam ) { |
| 1515 | smsLog( pMac, LOGE, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1516 | "Empty config param structure for SME, nothing to reset"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1517 | return status; |
| 1518 | } |
| 1519 | |
| 1520 | status = csrChangeConfigParams(pMac, pUpdateConfigParam); |
| 1521 | |
| 1522 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1523 | smsLog( pMac, LOGE, "csrUpdateConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1524 | status ); |
| 1525 | } |
| 1526 | |
| 1527 | return status; |
| 1528 | |
| 1529 | } |
| 1530 | |
| 1531 | /*-------------------------------------------------------------------------- |
| 1532 | |
| 1533 | \brief sme_HDDReadyInd() - SME sends eWNI_SME_SYS_READY_IND to PE to inform |
| 1534 | that the NIC is ready tio run. |
| 1535 | |
| 1536 | The function is called by HDD at the end of initialization stage so PE/HAL can |
| 1537 | enable the NIC to running state. |
| 1538 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1539 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1540 | \param hHal - The handle returned by macOpen. |
| 1541 | |
| 1542 | \return eHAL_STATUS_SUCCESS - eWNI_SME_SYS_READY_IND is sent to PE |
| 1543 | successfully. |
| 1544 | |
| 1545 | Other status means SME failed to send the message to PE. |
| 1546 | \sa |
| 1547 | |
| 1548 | --------------------------------------------------------------------------*/ |
| 1549 | eHalStatus sme_HDDReadyInd(tHalHandle hHal) |
| 1550 | { |
| 1551 | tSirSmeReadyReq Msg; |
| 1552 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1553 | tPmcPowerState powerState; |
| 1554 | tPmcSwitchState hwWlanSwitchState; |
| 1555 | tPmcSwitchState swWlanSwitchState; |
| 1556 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1557 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1558 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1559 | TRACE_CODE_SME_RX_HDD_MSG_HDDREADYIND, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1560 | do |
| 1561 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1562 | |
| 1563 | Msg.messageType = eWNI_SME_SYS_READY_IND; |
| 1564 | Msg.length = sizeof( tSirSmeReadyReq ); |
| 1565 | |
| 1566 | if (eSIR_FAILURE != uMacPostCtrlMsg( hHal, (tSirMbMsg*)&Msg )) |
| 1567 | { |
| 1568 | status = eHAL_STATUS_SUCCESS; |
| 1569 | } |
| 1570 | else |
| 1571 | { |
| 1572 | smsLog( pMac, LOGE, |
| 1573 | "uMacPostCtrlMsg failed to send eWNI_SME_SYS_READY_IND"); |
| 1574 | break; |
| 1575 | } |
| 1576 | |
| 1577 | status = pmcQueryPowerState( hHal, &powerState, |
| 1578 | &hwWlanSwitchState, &swWlanSwitchState ); |
| 1579 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1580 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1581 | smsLog( pMac, LOGE, "pmcQueryPowerState failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1582 | status ); |
| 1583 | break; |
| 1584 | } |
| 1585 | |
| 1586 | if ( (ePMC_SWITCH_OFF != hwWlanSwitchState) && |
| 1587 | (ePMC_SWITCH_OFF != swWlanSwitchState) ) |
| 1588 | { |
| 1589 | status = csrReady(pMac); |
| 1590 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1591 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1592 | smsLog( pMac, LOGE, "csrReady failed with status=%d", status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1593 | break; |
| 1594 | } |
| 1595 | status = pmcReady(hHal); |
| 1596 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1597 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1598 | smsLog( pMac, LOGE, "pmcReady failed with status=%d", status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1599 | break; |
| 1600 | } |
| 1601 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1602 | if(VOS_STATUS_SUCCESS != btcReady(hHal)) |
| 1603 | { |
| 1604 | status = eHAL_STATUS_FAILURE; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1605 | smsLog( pMac, LOGE, "btcReady failed"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1606 | break; |
| 1607 | } |
| 1608 | #endif |
| 1609 | |
| 1610 | #if defined WLAN_FEATURE_VOWIFI |
| 1611 | if(VOS_STATUS_SUCCESS != rrmReady(hHal)) |
| 1612 | { |
| 1613 | status = eHAL_STATUS_FAILURE; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1614 | smsLog( pMac, LOGE, "rrmReady failed"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1615 | break; |
| 1616 | } |
| 1617 | #endif |
| 1618 | } |
| 1619 | pMac->sme.state = SME_STATE_READY; |
| 1620 | } while( 0 ); |
| 1621 | |
| 1622 | return status; |
| 1623 | } |
| 1624 | |
| 1625 | /*-------------------------------------------------------------------------- |
| 1626 | |
| 1627 | \brief sme_Start() - Put all SME modules at ready state. |
| 1628 | |
| 1629 | The function starts each module in SME, PMC, CCM, CSR, etc. . Upon |
| 1630 | successfully return, all modules are ready to run. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1631 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1632 | \param hHal - The handle returned by macOpen. |
| 1633 | |
| 1634 | \return eHAL_STATUS_SUCCESS - SME is ready. |
| 1635 | |
| 1636 | Other status means SME is failed to start |
| 1637 | \sa |
| 1638 | |
| 1639 | --------------------------------------------------------------------------*/ |
| 1640 | eHalStatus sme_Start(tHalHandle hHal) |
| 1641 | { |
| 1642 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1643 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1644 | |
| 1645 | do |
| 1646 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1647 | status = csrStart(pMac); |
| 1648 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1649 | smsLog( pMac, LOGE, "csrStart failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1650 | status ); |
| 1651 | break; |
| 1652 | } |
| 1653 | |
| 1654 | status = pmcStart(hHal); |
| 1655 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1656 | smsLog( pMac, LOGE, "pmcStart failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1657 | status ); |
| 1658 | break; |
| 1659 | } |
| 1660 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1661 | status = WLANSAP_Start(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 1662 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1663 | smsLog( pMac, LOGE, "WLANSAP_Start failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1664 | status ); |
| 1665 | break; |
| 1666 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1667 | pMac->sme.state = SME_STATE_START; |
| 1668 | }while (0); |
| 1669 | |
| 1670 | return status; |
| 1671 | } |
| 1672 | |
| 1673 | |
| 1674 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 1675 | /****************************************************************************** |
| 1676 | * |
| 1677 | * Name: sme_PCFilterMatchCountResponseHandler |
| 1678 | * |
| 1679 | * Description: |
| 1680 | * Invoke Packet Coalescing Filter Match Count callback routine |
| 1681 | * |
| 1682 | * Parameters: |
| 1683 | * hHal - HAL handle for device |
| 1684 | * pMsg - Pointer to tRcvFltPktMatchRsp structure |
| 1685 | * |
| 1686 | * Returns: eHalStatus |
| 1687 | * |
| 1688 | ******************************************************************************/ |
| 1689 | eHalStatus sme_PCFilterMatchCountResponseHandler(tHalHandle hHal, void* pMsg) |
| 1690 | { |
| 1691 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 1692 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1693 | tpSirRcvFltPktMatchRsp pRcvFltPktMatchRsp = (tpSirRcvFltPktMatchRsp)pMsg; |
| 1694 | |
| 1695 | if (NULL == pMsg) |
| 1696 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1697 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1698 | status = eHAL_STATUS_FAILURE; |
| 1699 | } |
| 1700 | else |
| 1701 | { |
| 1702 | smsLog(pMac, LOG2, "SME: entering " |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1703 | "sme_FilterMatchCountResponseHandler"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1704 | |
| 1705 | /* Call Packet Coalescing Filter Match Count callback routine. */ |
| 1706 | if (pMac->pmc.FilterMatchCountCB != NULL) |
| 1707 | pMac->pmc.FilterMatchCountCB(pMac->pmc.FilterMatchCountCBContext, |
| 1708 | pRcvFltPktMatchRsp); |
| 1709 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1710 | smsLog(pMac, LOG1, "%s: status=0x%x", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1711 | pRcvFltPktMatchRsp->status); |
| 1712 | |
| 1713 | pMac->pmc.FilterMatchCountCB = NULL; |
| 1714 | pMac->pmc.FilterMatchCountCBContext = NULL; |
| 1715 | } |
| 1716 | |
| 1717 | return(status); |
| 1718 | } |
| 1719 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 1720 | |
| 1721 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1722 | #ifdef WLAN_FEATURE_11W |
| 1723 | /*------------------------------------------------------------------ |
| 1724 | * |
| 1725 | * Handle the unprotected management frame indication from LIM and |
| 1726 | * forward it to HDD. |
| 1727 | * |
| 1728 | *------------------------------------------------------------------*/ |
| 1729 | |
| 1730 | eHalStatus sme_UnprotectedMgmtFrmInd( tHalHandle hHal, |
| 1731 | tpSirSmeUnprotMgmtFrameInd pSmeMgmtFrm) |
| 1732 | { |
| 1733 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1734 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1735 | tCsrRoamInfo pRoamInfo = {0}; |
| 1736 | tANI_U32 SessionId = pSmeMgmtFrm->sessionId; |
| 1737 | |
| 1738 | pRoamInfo.nFrameLength = pSmeMgmtFrm->frameLen; |
| 1739 | pRoamInfo.pbFrames = pSmeMgmtFrm->frameBuf; |
| 1740 | pRoamInfo.frameType = pSmeMgmtFrm->frameType; |
| 1741 | |
| 1742 | /* forward the mgmt frame to HDD */ |
| 1743 | csrRoamCallCallback(pMac, SessionId, &pRoamInfo, 0, eCSR_ROAM_UNPROT_MGMT_FRAME_IND, 0); |
| 1744 | |
| 1745 | return status; |
| 1746 | } |
| 1747 | #endif |
| 1748 | |
Hardik Kantilal Patel | 81f7634 | 2014-11-14 12:45:26 -0800 | [diff] [blame^] | 1749 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 1750 | /* --------------------------------------------------------------------------- |
| 1751 | \fn sme_HT2040CoexInfoInd |
| 1752 | \brief a Send 20/40 Coex info to SAP layer |
| 1753 | |
| 1754 | \param tpSirHT2040CoexInfoInd - 20/40 Coex info param |
| 1755 | \return eHalStatus |
| 1756 | ---------------------------------------------------------------------------*/ |
| 1757 | |
| 1758 | eHalStatus sme_HT2040CoexInfoInd( tHalHandle hHal, |
| 1759 | tpSirHT2040CoexInfoInd pSmeHT2040CoexInfoInd) |
| 1760 | { |
| 1761 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1762 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1763 | tANI_U32 SessionId = pSmeHT2040CoexInfoInd->sessionId; |
| 1764 | tCsrRoamInfo roamInfo = {0}; |
| 1765 | |
| 1766 | roamInfo.pSmeHT2040CoexInfoInd = pSmeHT2040CoexInfoInd; |
| 1767 | |
| 1768 | smsLog(pMac, LOGW, FL("HT40MHzIntolerant: %d HT20MHzBssWidthReq: %d"), |
| 1769 | roamInfo.pSmeHT2040CoexInfoInd->HT40MHzIntolerant, |
| 1770 | roamInfo.pSmeHT2040CoexInfoInd->HT20MHzBssWidthReq); |
| 1771 | |
| 1772 | smsLog(pMac, LOGW, FL("Total Intolerant Channel: %d"), |
| 1773 | roamInfo.pSmeHT2040CoexInfoInd->channel_num); |
| 1774 | |
| 1775 | /* forward the 20/40 BSS Coex information to HDD */ |
| 1776 | smsLog(pMac, LOGW, FL("Sending eCSR_ROAM_2040_COEX_INFO_IND" |
| 1777 | " to WLANSAP_RoamCallback ")); |
| 1778 | |
| 1779 | csrRoamCallCallback(pMac, SessionId, &roamInfo, |
| 1780 | 0, eCSR_ROAM_2040_COEX_INFO_IND, 0); |
| 1781 | return status; |
| 1782 | } |
| 1783 | #endif |
| 1784 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1785 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1786 | /*------------------------------------------------------------------ |
| 1787 | * |
| 1788 | * Handle the tsm ie indication from LIM and forward it to HDD. |
| 1789 | * |
| 1790 | *------------------------------------------------------------------*/ |
| 1791 | |
| 1792 | eHalStatus sme_TsmIeInd(tHalHandle hHal, tSirSmeTsmIEInd *pSmeTsmIeInd) |
| 1793 | { |
| 1794 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1795 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1796 | tCsrRoamInfo pRoamInfo = {0}; |
| 1797 | tANI_U32 SessionId = pSmeTsmIeInd->sessionId; |
| 1798 | |
| 1799 | pRoamInfo.tsmIe.tsid= pSmeTsmIeInd->tsmIe.tsid; |
| 1800 | pRoamInfo.tsmIe.state= pSmeTsmIeInd->tsmIe.state; |
| 1801 | pRoamInfo.tsmIe.msmt_interval= pSmeTsmIeInd->tsmIe.msmt_interval; |
| 1802 | |
| 1803 | /* forward the tsm ie information to HDD */ |
| 1804 | csrRoamCallCallback(pMac, SessionId, &pRoamInfo, 0, eCSR_ROAM_TSM_IE_IND, 0); |
| 1805 | |
| 1806 | return status; |
| 1807 | } |
| 1808 | |
| 1809 | /* --------------------------------------------------------------------------- |
| 1810 | \fn sme_SetCCKMIe |
| 1811 | \brief function to store the CCKM IE passed from supplicant and use it while packing |
| 1812 | reassociation request |
| 1813 | \param hHal - HAL handle for device |
| 1814 | \param pCckmIe - pointer to CCKM IE data |
| 1815 | \param pCckmIeLen - length of the CCKM IE |
| 1816 | \- return Success or failure |
| 1817 | -------------------------------------------------------------------------*/ |
| 1818 | eHalStatus sme_SetCCKMIe(tHalHandle hHal, tANI_U8 sessionId, |
| 1819 | tANI_U8 *pCckmIe, tANI_U8 cckmIeLen) |
| 1820 | { |
| 1821 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1822 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1823 | |
| 1824 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 1825 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 1826 | { |
| 1827 | csrSetCCKMIe(pMac, sessionId, pCckmIe, cckmIeLen); |
| 1828 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 1829 | } |
| 1830 | return status; |
| 1831 | } |
| 1832 | |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1833 | /* --------------------------------------------------------------------------- |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1834 | \fn sme_SetEseBeaconRequest |
| 1835 | \brief function to set Ese beacon request parameters |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1836 | \param hHal - HAL handle for device |
| 1837 | \param sessionId - Session id |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1838 | \param pEseBcnReq - pointer to Ese beacon request |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1839 | \- return Success or failure |
| 1840 | -------------------------------------------------------------------------*/ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1841 | eHalStatus sme_SetEseBeaconRequest(tHalHandle hHal, const tANI_U8 sessionId, |
| 1842 | const tCsrEseBeaconReq* pEseBcnReq) |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1843 | { |
| 1844 | eHalStatus status = eSIR_SUCCESS; |
| 1845 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1846 | tpSirBeaconReportReqInd pSmeBcnReportReq = NULL; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1847 | tCsrEseBeaconReqParams *pBeaconReq = NULL; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1848 | tANI_U8 counter = 0; |
| 1849 | tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); |
| 1850 | tpRrmSMEContext pSmeRrmContext = &pMac->rrm.rrmSmeContext; |
| 1851 | |
| 1852 | /* Store the info in RRM context */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1853 | vos_mem_copy(&pSmeRrmContext->eseBcnReqInfo, pEseBcnReq, sizeof(tCsrEseBeaconReq)); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1854 | |
| 1855 | //Prepare the request to send to SME. |
| 1856 | pSmeBcnReportReq = vos_mem_malloc(sizeof( tSirBeaconReportReqInd )); |
| 1857 | if(NULL == pSmeBcnReportReq) |
| 1858 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1859 | smsLog(pMac, LOGP, "Memory Allocation Failure!!! Ese BcnReq Ind to SME"); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1860 | return eSIR_FAILURE; |
| 1861 | } |
| 1862 | |
| 1863 | smsLog(pMac, LOGE, "Sending Beacon Report Req to SME"); |
| 1864 | vos_mem_zero( pSmeBcnReportReq, sizeof( tSirBeaconReportReqInd )); |
| 1865 | |
| 1866 | pSmeBcnReportReq->messageType = eWNI_SME_BEACON_REPORT_REQ_IND; |
| 1867 | pSmeBcnReportReq->length = sizeof( tSirBeaconReportReqInd ); |
| 1868 | vos_mem_copy( pSmeBcnReportReq->bssId, pSession->connectedProfile.bssid, sizeof(tSirMacAddr) ); |
| 1869 | pSmeBcnReportReq->channelInfo.channelNum = 255; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1870 | pSmeBcnReportReq->channelList.numChannels = pEseBcnReq->numBcnReqIe; |
| 1871 | pSmeBcnReportReq->msgSource = eRRM_MSG_SOURCE_ESE_UPLOAD; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1872 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1873 | for (counter = 0; counter < pEseBcnReq->numBcnReqIe; counter++) |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1874 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1875 | pBeaconReq = (tCsrEseBeaconReqParams *)&pEseBcnReq->bcnReq[counter]; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1876 | pSmeBcnReportReq->fMeasurementtype[counter] = pBeaconReq->scanMode; |
| 1877 | pSmeBcnReportReq->measurementDuration[counter] = SYS_TU_TO_MS(pBeaconReq->measurementDuration); |
| 1878 | pSmeBcnReportReq->channelList.channelNumber[counter] = pBeaconReq->channel; |
| 1879 | } |
| 1880 | |
| 1881 | sme_RrmProcessBeaconReportReqInd(pMac, pSmeBcnReportReq); |
| 1882 | return status; |
| 1883 | } |
| 1884 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1885 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1886 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1887 | |
c_hpothu | 9236791 | 2014-05-01 15:18:17 +0530 | [diff] [blame] | 1888 | /* --------------------------------------------------------------------------- |
| 1889 | \fn sme_getBcnMissRate |
| 1890 | \brief function sends 'WDA_GET_BCN_MISS_RATE_REQ' to WDA layer, |
| 1891 | \param hHal - HAL handle for device. |
| 1892 | \param sessionId - session ID. |
| 1893 | \- return Success or Failure. |
| 1894 | -------------------------------------------------------------------------*/ |
| 1895 | |
| 1896 | eHalStatus sme_getBcnMissRate(tHalHandle hHal, tANI_U8 sessionId, void *callback, void *data) |
| 1897 | { |
| 1898 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1899 | VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; |
| 1900 | vos_msg_t vosMessage; |
| 1901 | tSirBcnMissRateReq *pMsg; |
| 1902 | tCsrRoamSession *pSession; |
| 1903 | |
| 1904 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 1905 | { |
| 1906 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 1907 | |
| 1908 | if (!pSession) |
| 1909 | { |
| 1910 | smsLog(pMac, LOGE, FL("session %d not found"), sessionId); |
| 1911 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 1912 | return eHAL_STATUS_FAILURE; |
| 1913 | } |
| 1914 | |
c_hpothu | 402de81 | 2014-07-10 15:55:45 +0530 | [diff] [blame] | 1915 | pMsg = (tSirBcnMissRateReq *) vos_mem_malloc(sizeof(tSirBcnMissRateReq)); |
c_hpothu | 9236791 | 2014-05-01 15:18:17 +0530 | [diff] [blame] | 1916 | if (NULL == pMsg) |
| 1917 | { |
| 1918 | smsLog(pMac, LOGE, FL("failed to allocated memory")); |
| 1919 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 1920 | return eHAL_STATUS_FAILURE; |
| 1921 | } |
| 1922 | |
| 1923 | vos_mem_copy(pMsg->bssid, pSession->connectedProfile.bssid, |
| 1924 | sizeof(tSirMacAddr)); |
| 1925 | |
| 1926 | pMsg->msgLen = sizeof(tSirBcnMissRateReq); |
| 1927 | pMsg->callback = callback; |
| 1928 | pMsg->data = data; |
| 1929 | |
| 1930 | vosMessage.type = WDA_GET_BCN_MISS_RATE_REQ; |
| 1931 | vosMessage.bodyptr = pMsg; |
| 1932 | vosMessage.reserved = 0; |
| 1933 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 1934 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 1935 | { |
| 1936 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1937 | "%s: Post Set TM Level MSG fail", __func__); |
| 1938 | vos_mem_free(pMsg); |
| 1939 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 1940 | return eHAL_STATUS_FAILURE; |
| 1941 | } |
| 1942 | sme_ReleaseGlobalLock( &pMac->sme); |
| 1943 | return eHAL_STATUS_SUCCESS; |
| 1944 | } |
| 1945 | return eHAL_STATUS_FAILURE; |
| 1946 | } |
| 1947 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1948 | /*-------------------------------------------------------------------------- |
| 1949 | |
| 1950 | \brief sme_ProcessMsg() - The main message processor for SME. |
| 1951 | |
| 1952 | The function is called by a message dispatcher when to process a message |
| 1953 | targeted for SME. |
| 1954 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1955 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1956 | \param hHal - The handle returned by macOpen. |
| 1957 | \param pMsg - A pointer to a caller allocated object of tSirMsgQ. |
| 1958 | |
| 1959 | \return eHAL_STATUS_SUCCESS - SME successfully process the message. |
| 1960 | |
| 1961 | Other status means SME failed to process the message to HAL. |
| 1962 | \sa |
| 1963 | |
| 1964 | --------------------------------------------------------------------------*/ |
| 1965 | eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) |
| 1966 | { |
| 1967 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1968 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1969 | |
| 1970 | if (pMsg == NULL) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1971 | smsLog( pMac, LOGE, "Empty message for SME, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1972 | return status; |
| 1973 | } |
| 1974 | |
| 1975 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 1976 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 1977 | { |
| 1978 | if( SME_IS_START(pMac) ) |
| 1979 | { |
| 1980 | switch (pMsg->type) { // TODO: Will be modified to do a range check for msgs instead of having cases for each msgs |
| 1981 | case eWNI_PMC_ENTER_BMPS_RSP: |
| 1982 | case eWNI_PMC_EXIT_BMPS_RSP: |
| 1983 | case eWNI_PMC_EXIT_BMPS_IND: |
| 1984 | case eWNI_PMC_ENTER_IMPS_RSP: |
| 1985 | case eWNI_PMC_EXIT_IMPS_RSP: |
| 1986 | case eWNI_PMC_SMPS_STATE_IND: |
| 1987 | case eWNI_PMC_ENTER_UAPSD_RSP: |
| 1988 | case eWNI_PMC_EXIT_UAPSD_RSP: |
| 1989 | case eWNI_PMC_ENTER_WOWL_RSP: |
| 1990 | case eWNI_PMC_EXIT_WOWL_RSP: |
| 1991 | //PMC |
| 1992 | if (pMsg->bodyptr) |
| 1993 | { |
| 1994 | pmcMessageProcessor(hHal, pMsg->bodyptr); |
| 1995 | status = eHAL_STATUS_SUCCESS; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 1996 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1997 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1998 | smsLog( pMac, LOGE, "Empty rsp message for PMC, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1999 | } |
| 2000 | break; |
| 2001 | |
| 2002 | case WNI_CFG_SET_CNF: |
| 2003 | case WNI_CFG_DNLD_CNF: |
| 2004 | case WNI_CFG_GET_RSP: |
| 2005 | case WNI_CFG_ADD_GRP_ADDR_CNF: |
| 2006 | case WNI_CFG_DEL_GRP_ADDR_CNF: |
| 2007 | //CCM |
| 2008 | if (pMsg->bodyptr) |
| 2009 | { |
| 2010 | ccmCfgCnfMsgHandler(hHal, pMsg->bodyptr); |
| 2011 | status = eHAL_STATUS_SUCCESS; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2012 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2013 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2014 | smsLog( pMac, LOGE, "Empty rsp message for CCM, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2015 | } |
| 2016 | break; |
| 2017 | |
| 2018 | case eWNI_SME_ADDTS_RSP: |
| 2019 | case eWNI_SME_DELTS_RSP: |
| 2020 | case eWNI_SME_DELTS_IND: |
| 2021 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 2022 | case eWNI_SME_FT_AGGR_QOS_RSP: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2023 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2024 | //QoS |
| 2025 | if (pMsg->bodyptr) |
| 2026 | { |
| 2027 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 2028 | status = sme_QosMsgProcessor(pMac, pMsg->type, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2029 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2030 | #endif |
| 2031 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2032 | smsLog( pMac, LOGE, "Empty rsp message for QoS, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2033 | } |
| 2034 | break; |
| 2035 | #if defined WLAN_FEATURE_VOWIFI |
| 2036 | case eWNI_SME_NEIGHBOR_REPORT_IND: |
| 2037 | case eWNI_SME_BEACON_REPORT_REQ_IND: |
| 2038 | #if defined WLAN_VOWIFI_DEBUG |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2039 | smsLog( pMac, LOGE, "Received RRM message. Message Id = %d", pMsg->type ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2040 | #endif |
| 2041 | if ( pMsg->bodyptr ) |
| 2042 | { |
| 2043 | status = sme_RrmMsgProcessor( pMac, pMsg->type, pMsg->bodyptr ); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2044 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2045 | } |
| 2046 | else |
| 2047 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2048 | smsLog( pMac, LOGE, "Empty message for RRM, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2049 | } |
| 2050 | break; |
| 2051 | #endif |
| 2052 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2053 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 2054 | //Handle the eWNI_SME_OEM_DATA_RSP: |
| 2055 | case eWNI_SME_OEM_DATA_RSP: |
| 2056 | if(pMsg->bodyptr) |
| 2057 | { |
| 2058 | status = sme_HandleOemDataRsp(pMac, pMsg->bodyptr); |
| 2059 | vos_mem_free(pMsg->bodyptr); |
| 2060 | } |
| 2061 | else |
| 2062 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2063 | 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] | 2064 | } |
| 2065 | smeProcessPendingQueue( pMac ); |
| 2066 | break; |
| 2067 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2068 | |
| 2069 | case eWNI_SME_ADD_STA_SELF_RSP: |
| 2070 | if(pMsg->bodyptr) |
| 2071 | { |
| 2072 | status = csrProcessAddStaSessionRsp(pMac, pMsg->bodyptr); |
| 2073 | vos_mem_free(pMsg->bodyptr); |
| 2074 | } |
| 2075 | else |
| 2076 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2077 | 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] | 2078 | } |
| 2079 | break; |
| 2080 | case eWNI_SME_DEL_STA_SELF_RSP: |
| 2081 | if(pMsg->bodyptr) |
| 2082 | { |
| 2083 | status = csrProcessDelStaSessionRsp(pMac, pMsg->bodyptr); |
| 2084 | vos_mem_free(pMsg->bodyptr); |
| 2085 | } |
| 2086 | else |
| 2087 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2088 | 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] | 2089 | } |
| 2090 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2091 | case eWNI_SME_REMAIN_ON_CHN_RSP: |
| 2092 | if(pMsg->bodyptr) |
| 2093 | { |
| 2094 | status = sme_remainOnChnRsp(pMac, pMsg->bodyptr); |
| 2095 | vos_mem_free(pMsg->bodyptr); |
| 2096 | } |
| 2097 | else |
| 2098 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2099 | 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] | 2100 | } |
| 2101 | break; |
| 2102 | case eWNI_SME_REMAIN_ON_CHN_RDY_IND: |
| 2103 | if(pMsg->bodyptr) |
| 2104 | { |
| 2105 | status = sme_remainOnChnReady(pMac, pMsg->bodyptr); |
| 2106 | vos_mem_free(pMsg->bodyptr); |
| 2107 | } |
| 2108 | else |
| 2109 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2110 | 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] | 2111 | } |
| 2112 | break; |
| 2113 | case eWNI_SME_MGMT_FRM_IND: |
| 2114 | if(pMsg->bodyptr) |
| 2115 | { |
| 2116 | sme_mgmtFrmInd(pMac, pMsg->bodyptr); |
| 2117 | vos_mem_free(pMsg->bodyptr); |
| 2118 | } |
| 2119 | else |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2120 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2121 | 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] | 2122 | } |
| 2123 | break; |
Hardik Kantilal Patel | 81f7634 | 2014-11-14 12:45:26 -0800 | [diff] [blame^] | 2124 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 2125 | case eWNI_SME_2040_COEX_IND: |
| 2126 | if(pMsg->bodyptr) |
| 2127 | { |
| 2128 | sme_HT2040CoexInfoInd(pMac, pMsg->bodyptr); |
| 2129 | vos_mem_free(pMsg->bodyptr); |
| 2130 | } |
| 2131 | else |
| 2132 | { |
| 2133 | smsLog( pMac, LOGE, "Empty rsp message for meas (eWNI_SME_2040_COEX_IND), nothing to process"); |
| 2134 | } |
| 2135 | break; |
| 2136 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2137 | case eWNI_SME_ACTION_FRAME_SEND_CNF: |
| 2138 | if(pMsg->bodyptr) |
| 2139 | { |
| 2140 | status = sme_sendActionCnf(pMac, pMsg->bodyptr); |
| 2141 | vos_mem_free(pMsg->bodyptr); |
| 2142 | } |
| 2143 | else |
| 2144 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2145 | 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] | 2146 | } |
| 2147 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2148 | case eWNI_SME_COEX_IND: |
| 2149 | if(pMsg->bodyptr) |
| 2150 | { |
c_hpothu | 3ba2a51 | 2014-08-06 14:02:54 +0530 | [diff] [blame] | 2151 | tSirSmeCoexInd *pSmeCoexInd = (tSirSmeCoexInd *)pMsg->bodyptr; |
| 2152 | |
| 2153 | if (pSmeCoexInd->coexIndType == SIR_COEX_IND_TYPE_DISABLE_AGGREGATION_IN_2p4) |
| 2154 | { |
| 2155 | smsLog( pMac, LOG1, FL("SIR_COEX_IND_TYPE_DISABLE_AGGREGATION_IN_2p4")); |
| 2156 | sme_RequestFullPower(hHal, NULL, NULL, eSME_REASON_OTHER); |
| 2157 | pMac->isCoexScoIndSet = 1; |
| 2158 | } |
| 2159 | else if (pSmeCoexInd->coexIndType == SIR_COEX_IND_TYPE_ENABLE_AGGREGATION_IN_2p4) |
| 2160 | { |
| 2161 | smsLog( pMac, LOG1, FL("SIR_COEX_IND_TYPE_ENABLE_AGGREGATION_IN_2p4")); |
| 2162 | pMac->isCoexScoIndSet = 0; |
| 2163 | sme_RequestBmps(hHal, NULL, NULL); |
| 2164 | } |
| 2165 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2166 | status = btcHandleCoexInd((void *)pMac, pMsg->bodyptr); |
| 2167 | vos_mem_free(pMsg->bodyptr); |
| 2168 | } |
| 2169 | else |
| 2170 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2171 | 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] | 2172 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2173 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2174 | |
| 2175 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 2176 | case eWNI_SME_PREF_NETWORK_FOUND_IND: |
| 2177 | if(pMsg->bodyptr) |
| 2178 | { |
| 2179 | status = sme_PreferredNetworkFoundInd((void *)pMac, pMsg->bodyptr); |
| 2180 | vos_mem_free(pMsg->bodyptr); |
| 2181 | } |
| 2182 | else |
| 2183 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2184 | 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] | 2185 | } |
| 2186 | break; |
| 2187 | #endif // FEATURE_WLAN_SCAN_PNO |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2188 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2189 | case eWNI_SME_TX_PER_HIT_IND: |
| 2190 | if (pMac->sme.pTxPerHitCallback) |
| 2191 | { |
| 2192 | pMac->sme.pTxPerHitCallback(pMac->sme.pTxPerHitCbContext); |
| 2193 | } |
| 2194 | break; |
| 2195 | |
| 2196 | case eWNI_SME_CHANGE_COUNTRY_CODE: |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 2197 | if(pMsg->bodyptr) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2198 | { |
| 2199 | status = sme_HandleChangeCountryCode((void *)pMac, pMsg->bodyptr); |
| 2200 | vos_mem_free(pMsg->bodyptr); |
| 2201 | } |
| 2202 | else |
| 2203 | { |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 2204 | smsLog(pMac, LOGE, "Empty rsp message for message (eWNI_SME_CHANGE_COUNTRY_CODE), nothing to process"); |
| 2205 | } |
| 2206 | break; |
| 2207 | |
| 2208 | case eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE: |
| 2209 | if (pMsg->bodyptr) |
| 2210 | { |
| 2211 | status = sme_HandleGenericChangeCountryCode((void *)pMac, pMsg->bodyptr); |
| 2212 | vos_mem_free(pMsg->bodyptr); |
| 2213 | } |
| 2214 | else |
| 2215 | { |
| 2216 | 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] | 2217 | } |
| 2218 | break; |
| 2219 | |
| 2220 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 2221 | case eWNI_PMC_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP: |
| 2222 | if(pMsg->bodyptr) |
| 2223 | { |
| 2224 | status = sme_PCFilterMatchCountResponseHandler((void *)pMac, pMsg->bodyptr); |
| 2225 | vos_mem_free(pMsg->bodyptr); |
| 2226 | } |
| 2227 | else |
| 2228 | { |
| 2229 | smsLog(pMac, LOGE, "Empty rsp message for meas " |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2230 | "(PACKET_COALESCING_FILTER_MATCH_COUNT_RSP), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2231 | } |
| 2232 | break; |
| 2233 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 2234 | case eWNI_SME_PRE_SWITCH_CHL_IND: |
| 2235 | { |
| 2236 | status = sme_HandlePreChannelSwitchInd(pMac); |
| 2237 | break; |
| 2238 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2239 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2240 | case eWNI_SME_POST_SWITCH_CHL_IND: |
| 2241 | { |
| 2242 | status = sme_HandlePostChannelSwitchInd(pMac); |
| 2243 | break; |
| 2244 | } |
| 2245 | |
| 2246 | #ifdef WLAN_WAKEUP_EVENTS |
| 2247 | case eWNI_SME_WAKE_REASON_IND: |
| 2248 | if(pMsg->bodyptr) |
| 2249 | { |
| 2250 | status = sme_WakeReasonIndCallback((void *)pMac, pMsg->bodyptr); |
| 2251 | vos_mem_free(pMsg->bodyptr); |
| 2252 | } |
| 2253 | else |
| 2254 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2255 | 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] | 2256 | } |
| 2257 | break; |
| 2258 | #endif // WLAN_WAKEUP_EVENTS |
| 2259 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2260 | #ifdef FEATURE_WLAN_TDLS |
| 2261 | /* |
| 2262 | * command rescived from PE, SME tdls msg processor shall be called |
| 2263 | * to process commands recieved from PE |
| 2264 | */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2265 | case eWNI_SME_TDLS_SEND_MGMT_RSP: |
| 2266 | case eWNI_SME_TDLS_ADD_STA_RSP: |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 2267 | case eWNI_SME_TDLS_DEL_STA_RSP: |
| 2268 | case eWNI_SME_TDLS_DEL_STA_IND: |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2269 | case eWNI_SME_TDLS_DEL_ALL_PEER_IND: |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 2270 | case eWNI_SME_MGMT_FRM_TX_COMPLETION_IND: |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 2271 | case eWNI_SME_TDLS_LINK_ESTABLISH_RSP: |
Atul Mittal | 60bd429 | 2014-08-14 12:19:27 +0530 | [diff] [blame] | 2272 | case eWNI_SME_TDLS_CHANNEL_SWITCH_RSP: |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2273 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 2274 | case eWNI_SME_TDLS_DISCOVERY_START_RSP: |
| 2275 | case eWNI_SME_TDLS_DISCOVERY_START_IND: |
| 2276 | case eWNI_SME_TDLS_LINK_START_RSP: |
| 2277 | case eWNI_SME_TDLS_LINK_START_IND: |
| 2278 | case eWNI_SME_TDLS_TEARDOWN_RSP: |
| 2279 | case eWNI_SME_TDLS_TEARDOWN_IND: |
| 2280 | case eWNI_SME_ADD_TDLS_PEER_IND: |
| 2281 | case eWNI_SME_DELETE_TDLS_PEER_IND: |
| 2282 | #endif |
| 2283 | { |
| 2284 | if (pMsg->bodyptr) |
| 2285 | { |
| 2286 | status = tdlsMsgProcessor(pMac, pMsg->type, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2287 | vos_mem_free(pMsg->bodyptr); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2288 | } |
| 2289 | else |
| 2290 | { |
| 2291 | smsLog( pMac, LOGE, "Empty rsp message for TDLS, \ |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2292 | nothing to process"); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2293 | } |
| 2294 | break; |
| 2295 | } |
| 2296 | #endif |
| 2297 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2298 | #ifdef WLAN_FEATURE_11W |
| 2299 | case eWNI_SME_UNPROT_MGMT_FRM_IND: |
| 2300 | if (pMsg->bodyptr) |
| 2301 | { |
| 2302 | sme_UnprotectedMgmtFrmInd(pMac, pMsg->bodyptr); |
| 2303 | vos_mem_free(pMsg->bodyptr); |
| 2304 | } |
| 2305 | else |
| 2306 | { |
| 2307 | smsLog(pMac, LOGE, "Empty rsp message for meas (eWNI_SME_UNPROT_MGMT_FRM_IND), nothing to process"); |
| 2308 | } |
| 2309 | break; |
| 2310 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2311 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2312 | case eWNI_SME_TSM_IE_IND: |
| 2313 | { |
| 2314 | if (pMsg->bodyptr) |
| 2315 | { |
| 2316 | sme_TsmIeInd(pMac, pMsg->bodyptr); |
| 2317 | vos_mem_free(pMsg->bodyptr); |
| 2318 | } |
| 2319 | else |
| 2320 | { |
| 2321 | smsLog(pMac, LOGE, "Empty rsp message for (eWNI_SME_TSM_IE_IND), nothing to process"); |
| 2322 | } |
| 2323 | break; |
| 2324 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2325 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 2326 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 2327 | case eWNI_SME_ROAM_SCAN_OFFLOAD_RSP: |
| 2328 | status = csrRoamOffloadScanRspHdlr((void *)pMac, pMsg->bodyval); |
| 2329 | break; |
| 2330 | #endif // WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2331 | |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 2332 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 2333 | case eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP: |
| 2334 | if (pMsg->bodyptr) |
| 2335 | { |
| 2336 | sme_ProcessGetGtkInfoRsp(pMac, pMsg->bodyptr); |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 2337 | vos_mem_zero(pMsg->bodyptr, |
| 2338 | sizeof(tSirGtkOffloadGetInfoRspParams)); |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 2339 | vos_mem_free(pMsg->bodyptr); |
| 2340 | } |
| 2341 | else |
| 2342 | { |
| 2343 | smsLog(pMac, LOGE, "Empty rsp message for (eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP), nothing to process"); |
| 2344 | } |
| 2345 | break ; |
| 2346 | #endif |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2347 | |
| 2348 | #ifdef FEATURE_WLAN_LPHB |
| 2349 | /* LPHB timeout indication arrived, send IND to client */ |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 2350 | case eWNI_SME_LPHB_IND: |
| 2351 | if (pMac->sme.pLphbIndCb) |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2352 | { |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 2353 | pMac->sme.pLphbIndCb(pMac->pAdapter, pMsg->bodyptr); |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2354 | } |
| 2355 | vos_mem_free(pMsg->bodyptr); |
| 2356 | |
| 2357 | break; |
| 2358 | #endif /* FEATURE_WLAN_LPHB */ |
| 2359 | |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 2360 | #ifdef FEATURE_WLAN_CH_AVOID |
| 2361 | /* LPHB timeout indication arrived, send IND to client */ |
| 2362 | case eWNI_SME_CH_AVOID_IND: |
| 2363 | if (pMac->sme.pChAvoidNotificationCb) |
| 2364 | { |
| 2365 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 2366 | "%s: CH avoid notification", __func__); |
| 2367 | pMac->sme.pChAvoidNotificationCb(pMac->pAdapter, pMsg->bodyptr); |
| 2368 | } |
| 2369 | vos_mem_free(pMsg->bodyptr); |
| 2370 | |
| 2371 | break; |
| 2372 | #endif /* FEATURE_WLAN_CH_AVOID */ |
| 2373 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2374 | default: |
| 2375 | |
| 2376 | if ( ( pMsg->type >= eWNI_SME_MSG_TYPES_BEGIN ) |
| 2377 | && ( pMsg->type <= eWNI_SME_MSG_TYPES_END ) ) |
| 2378 | { |
| 2379 | //CSR |
| 2380 | if (pMsg->bodyptr) |
| 2381 | { |
| 2382 | status = csrMsgProcessor(hHal, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2383 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2384 | } |
| 2385 | else |
| 2386 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2387 | smsLog( pMac, LOGE, "Empty rsp message for CSR, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2388 | } |
| 2389 | } |
| 2390 | else |
| 2391 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2392 | smsLog( pMac, LOGW, "Unknown message type %d, nothing to process", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2393 | pMsg->type); |
| 2394 | if (pMsg->bodyptr) |
| 2395 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2396 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2397 | } |
| 2398 | } |
| 2399 | }//switch |
| 2400 | } //SME_IS_START |
| 2401 | else |
| 2402 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2403 | smsLog( pMac, LOGW, "message type %d in stop state ignored", pMsg->type); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2404 | if (pMsg->bodyptr) |
| 2405 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2406 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2407 | } |
| 2408 | } |
| 2409 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2410 | } |
| 2411 | else |
| 2412 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2413 | smsLog( pMac, LOGW, "Locking failed, bailing out"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2414 | if (pMsg->bodyptr) |
| 2415 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2416 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2417 | } |
| 2418 | } |
| 2419 | |
| 2420 | return status; |
| 2421 | } |
| 2422 | |
| 2423 | |
| 2424 | //No need to hold the global lock here because this function can only be called |
| 2425 | //after sme_Stop. |
| 2426 | v_VOID_t sme_FreeMsg( tHalHandle hHal, vos_msg_t* pMsg ) |
| 2427 | { |
| 2428 | if( pMsg ) |
| 2429 | { |
| 2430 | if (pMsg->bodyptr) |
| 2431 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2432 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2433 | } |
| 2434 | } |
| 2435 | |
| 2436 | } |
| 2437 | |
| 2438 | |
| 2439 | /*-------------------------------------------------------------------------- |
| 2440 | |
| 2441 | \brief sme_Stop() - Stop all SME modules and put them at idle state |
| 2442 | |
| 2443 | The function stops each module in SME, PMC, CCM, CSR, etc. . Upon |
| 2444 | return, all modules are at idle state ready to start. |
| 2445 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2446 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2447 | \param hHal - The handle returned by macOpen |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2448 | \param tHalStopType - reason for stopping |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2449 | |
| 2450 | \return eHAL_STATUS_SUCCESS - SME is stopped. |
| 2451 | |
| 2452 | Other status means SME is failed to stop but caller should still |
| 2453 | consider SME is stopped. |
| 2454 | \sa |
| 2455 | |
| 2456 | --------------------------------------------------------------------------*/ |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2457 | eHalStatus sme_Stop(tHalHandle hHal, tHalStopType stopType) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2458 | { |
| 2459 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2460 | eHalStatus fail_status = eHAL_STATUS_SUCCESS; |
| 2461 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2462 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2463 | status = WLANSAP_Stop(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 2464 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2465 | smsLog( pMac, LOGE, "WLANSAP_Stop failed during smeStop with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2466 | status ); |
| 2467 | fail_status = status; |
| 2468 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2469 | |
| 2470 | p2pStop(hHal); |
| 2471 | |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2472 | status = pmcStop(hHal); |
| 2473 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 2474 | smsLog( pMac, LOGE, "pmcStop failed during smeStop with status=%d", |
| 2475 | status ); |
| 2476 | fail_status = status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2477 | } |
| 2478 | |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2479 | status = csrStop(pMac, stopType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2480 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2481 | smsLog( pMac, LOGE, "csrStop failed during smeStop with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2482 | status ); |
| 2483 | fail_status = status; |
| 2484 | } |
| 2485 | |
| 2486 | ccmStop(hHal); |
| 2487 | |
| 2488 | purgeSmeCmdList(pMac); |
| 2489 | |
| 2490 | if (!HAL_STATUS_SUCCESS( fail_status )) { |
| 2491 | status = fail_status; |
| 2492 | } |
| 2493 | |
| 2494 | pMac->sme.state = SME_STATE_STOP; |
| 2495 | |
| 2496 | return status; |
| 2497 | } |
| 2498 | |
| 2499 | /*-------------------------------------------------------------------------- |
| 2500 | |
| 2501 | \brief sme_Close() - Release all SME modules and their resources. |
| 2502 | |
| 2503 | The function release each module in SME, PMC, CCM, CSR, etc. . Upon |
| 2504 | return, all modules are at closed state. |
| 2505 | |
| 2506 | No SME APIs can be involved after smeClose except smeOpen. |
| 2507 | smeClose must be called before macClose. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2508 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2509 | \param hHal - The handle returned by macOpen |
| 2510 | |
| 2511 | \return eHAL_STATUS_SUCCESS - SME is successfully close. |
| 2512 | |
| 2513 | Other status means SME is failed to be closed but caller still cannot |
| 2514 | call any other SME functions except smeOpen. |
| 2515 | \sa |
| 2516 | |
| 2517 | --------------------------------------------------------------------------*/ |
| 2518 | eHalStatus sme_Close(tHalHandle hHal) |
| 2519 | { |
| 2520 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2521 | eHalStatus fail_status = eHAL_STATUS_SUCCESS; |
| 2522 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2523 | |
| 2524 | status = csrClose(pMac); |
| 2525 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2526 | smsLog( pMac, LOGE, "csrClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2527 | status ); |
| 2528 | fail_status = status; |
| 2529 | } |
| 2530 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2531 | status = WLANSAP_Close(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 2532 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2533 | smsLog( pMac, LOGE, "WLANSAP_close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2534 | status ); |
| 2535 | fail_status = status; |
| 2536 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2537 | |
| 2538 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 2539 | status = btcClose(hHal); |
| 2540 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2541 | smsLog( pMac, LOGE, "BTC close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2542 | status ); |
| 2543 | fail_status = status; |
| 2544 | } |
| 2545 | |
| 2546 | status = sme_QosClose(pMac); |
| 2547 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2548 | smsLog( pMac, LOGE, "Qos close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2549 | status ); |
| 2550 | fail_status = status; |
| 2551 | } |
| 2552 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2553 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 2554 | status = oemData_OemDataReqClose(hHal); |
| 2555 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2556 | 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] | 2557 | status ); |
| 2558 | fail_status = status; |
| 2559 | } |
| 2560 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2561 | |
| 2562 | status = ccmClose(hHal); |
| 2563 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2564 | smsLog( pMac, LOGE, "ccmClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2565 | status ); |
| 2566 | fail_status = status; |
| 2567 | } |
| 2568 | |
| 2569 | status = pmcClose(hHal); |
| 2570 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2571 | smsLog( pMac, LOGE, "pmcClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2572 | status ); |
| 2573 | fail_status = status; |
| 2574 | } |
| 2575 | #if defined WLAN_FEATURE_VOWIFI |
| 2576 | status = rrmClose(hHal); |
| 2577 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2578 | smsLog( pMac, LOGE, "RRM close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2579 | status ); |
| 2580 | fail_status = status; |
| 2581 | } |
| 2582 | #endif |
| 2583 | |
| 2584 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 2585 | sme_FTClose(hHal); |
| 2586 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2587 | sme_p2pClose(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2588 | |
| 2589 | freeSmeCmdList(pMac); |
| 2590 | |
| 2591 | if( !VOS_IS_STATUS_SUCCESS( vos_lock_destroy( &pMac->sme.lkSmeGlobalLock ) ) ) |
| 2592 | { |
| 2593 | fail_status = eHAL_STATUS_FAILURE; |
| 2594 | } |
| 2595 | |
| 2596 | if (!HAL_STATUS_SUCCESS( fail_status )) { |
| 2597 | status = fail_status; |
| 2598 | } |
| 2599 | |
| 2600 | pMac->sme.state = SME_STATE_STOP; |
| 2601 | |
| 2602 | return status; |
| 2603 | } |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2604 | #ifdef FEATURE_WLAN_LFR |
| 2605 | tANI_BOOLEAN csrIsScanAllowed(tpAniSirGlobal pMac) |
| 2606 | { |
Madan Mohan Koyyalamudi | fb534bb | 2012-10-24 14:35:45 -0700 | [diff] [blame] | 2607 | #if 0 |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2608 | switch(pMac->roam.neighborRoamInfo.neighborRoamState) { |
| 2609 | case eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN: |
| 2610 | case eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING: |
| 2611 | case eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE: |
| 2612 | case eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING: |
| 2613 | return eANI_BOOLEAN_FALSE; |
| 2614 | default: |
| 2615 | return eANI_BOOLEAN_TRUE; |
| 2616 | } |
Madan Mohan Koyyalamudi | fb534bb | 2012-10-24 14:35:45 -0700 | [diff] [blame] | 2617 | #else |
| 2618 | /* |
| 2619 | * TODO: always return TRUE for now until |
| 2620 | * we figure out why we could be stuck in |
| 2621 | * one of the roaming states forever. |
| 2622 | */ |
| 2623 | return eANI_BOOLEAN_TRUE; |
| 2624 | #endif |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2625 | } |
| 2626 | #endif |
c_hpothu | 5890146 | 2014-11-01 16:44:34 +0530 | [diff] [blame] | 2627 | |
| 2628 | /* --------------------------------------------------------------------------- |
| 2629 | \fn sco_isScanAllowed |
| 2630 | \brief check for scan interface connection status |
| 2631 | \param pMac - Pointer to the global MAC parameter structure |
| 2632 | \param pScanReq - scan request structure. |
| 2633 | |
| 2634 | \return tANI_BOOLEAN TRUE to allow scan otherwise FALSE |
| 2635 | ---------------------------------------------------------------------------*/ |
| 2636 | tANI_BOOLEAN sco_isScanAllowed(tpAniSirGlobal pMac, tCsrScanRequest *pscanReq) |
| 2637 | { |
| 2638 | tANI_BOOLEAN ret; |
| 2639 | |
| 2640 | if (pscanReq->p2pSearch) |
| 2641 | ret = csrIsP2pSessionConnected(pMac); |
| 2642 | else |
| 2643 | ret = csrIsStaSessionConnected(pMac); |
| 2644 | |
| 2645 | return !ret; |
| 2646 | } |
| 2647 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2648 | /* --------------------------------------------------------------------------- |
| 2649 | \fn sme_ScanRequest |
| 2650 | \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] | 2651 | This is an asynchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2652 | \param pScanRequestID - pointer to an object to get back the request ID |
| 2653 | \param callback - a callback function that scan calls upon finish, will not |
| 2654 | be called if csrScanRequest returns error |
| 2655 | \param pContext - a pointer passed in for the callback |
| 2656 | \return eHalStatus |
| 2657 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2658 | eHalStatus sme_ScanRequest(tHalHandle hHal, tANI_U8 sessionId, tCsrScanRequest *pscanReq, |
| 2659 | tANI_U32 *pScanRequestID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2660 | csrScanCompleteCallback callback, void *pContext) |
| 2661 | { |
| 2662 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2663 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2664 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2665 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_REQ, sessionId, pscanReq->scanType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2666 | smsLog(pMac, LOG2, FL("enter")); |
| 2667 | do |
| 2668 | { |
c_hpothu | 304c052 | 2014-09-30 10:22:57 +0530 | [diff] [blame] | 2669 | if(pMac->scan.fScanEnable && |
c_hpothu | 5890146 | 2014-11-01 16:44:34 +0530 | [diff] [blame] | 2670 | (pMac->isCoexScoIndSet ? sco_isScanAllowed(pMac, pscanReq) : TRUE)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2671 | { |
| 2672 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2673 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2674 | { |
| 2675 | { |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2676 | #ifdef FEATURE_WLAN_LFR |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2677 | if(csrIsScanAllowed(pMac)) |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2678 | { |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2679 | #endif |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2680 | status = csrScanRequest( hHal, sessionId, pscanReq, |
| 2681 | pScanRequestID, callback, pContext ); |
Vinay Krishna Eranna | 636b7bc | 2013-12-18 20:49:08 +0530 | [diff] [blame] | 2682 | if ( !HAL_STATUS_SUCCESS( status ) ) |
| 2683 | { |
| 2684 | smsLog(pMac, LOGE, FL("csrScanRequest failed" |
| 2685 | " SId=%d"), sessionId); |
| 2686 | } |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2687 | #ifdef FEATURE_WLAN_LFR |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2688 | } |
| 2689 | else |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2690 | { |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 2691 | smsLog(pMac, LOGE, FL("Scan denied in state %s" |
Mahesh A Saptasagar | 14addb6 | 2014-02-17 17:17:51 +0530 | [diff] [blame] | 2692 | "(sub-state %s)"), |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 2693 | macTraceGetNeighbourRoamState( |
| 2694 | pMac->roam.neighborRoamInfo.neighborRoamState), |
Mahesh A Saptasagar | 14addb6 | 2014-02-17 17:17:51 +0530 | [diff] [blame] | 2695 | macTraceGetcsrRoamSubState( |
| 2696 | pMac->roam.curSubState[sessionId])); |
Madan Mohan Koyyalamudi | ab4ab0d | 2012-10-24 14:26:50 -0700 | [diff] [blame] | 2697 | /*HandOff is in progress. So schedule this scan later*/ |
| 2698 | status = eHAL_STATUS_RESOURCES; |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2699 | } |
| 2700 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2701 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2702 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2703 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2704 | } //sme_AcquireGlobalLock success |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2705 | else |
| 2706 | { |
| 2707 | smsLog(pMac, LOGE, FL("sme_AcquireGlobalLock failed")); |
| 2708 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2709 | } //if(pMac->scan.fScanEnable) |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2710 | else |
| 2711 | { |
c_hpothu | 3ba2a51 | 2014-08-06 14:02:54 +0530 | [diff] [blame] | 2712 | smsLog(pMac, LOGE, FL("fScanEnable %d isCoexScoIndSet: %d "), |
| 2713 | pMac->scan.fScanEnable, pMac->isCoexScoIndSet); |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2714 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2715 | } while( 0 ); |
| 2716 | |
| 2717 | return (status); |
| 2718 | |
| 2719 | |
| 2720 | } |
| 2721 | |
| 2722 | /* --------------------------------------------------------------------------- |
| 2723 | \fn sme_ScanGetResult |
| 2724 | \brief a wrapper function to request scan results from CSR. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2725 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2726 | \param pFilter - If pFilter is NULL, all cached results are returned |
| 2727 | \param phResult - an object for the result. |
| 2728 | \return eHalStatus |
| 2729 | ---------------------------------------------------------------------------*/ |
| 2730 | eHalStatus sme_ScanGetResult(tHalHandle hHal, tANI_U8 sessionId, tCsrScanResultFilter *pFilter, |
| 2731 | tScanResultHandle *phResult) |
| 2732 | { |
| 2733 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2734 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2735 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2736 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2737 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_GET_RESULTS, sessionId,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2738 | smsLog(pMac, LOG2, FL("enter")); |
| 2739 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2740 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2741 | { |
Madan Mohan Koyyalamudi | ca43cdf | 2012-09-24 13:15:49 -0700 | [diff] [blame] | 2742 | status = csrScanGetResult( hHal, pFilter, phResult ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2743 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2744 | } |
| 2745 | smsLog(pMac, LOG2, FL("exit status %d"), status); |
| 2746 | |
| 2747 | return (status); |
| 2748 | } |
| 2749 | |
| 2750 | |
| 2751 | /* --------------------------------------------------------------------------- |
| 2752 | \fn sme_ScanFlushResult |
| 2753 | \brief a wrapper function to request CSR to clear scan results. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2754 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2755 | \return eHalStatus |
| 2756 | ---------------------------------------------------------------------------*/ |
| 2757 | eHalStatus sme_ScanFlushResult(tHalHandle hHal, tANI_U8 sessionId) |
| 2758 | { |
| 2759 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2760 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2761 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2762 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2763 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_RESULTS, sessionId,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2764 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2765 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2766 | { |
Madan Mohan Koyyalamudi | ca43cdf | 2012-09-24 13:15:49 -0700 | [diff] [blame] | 2767 | status = csrScanFlushResult( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2768 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2769 | } |
| 2770 | |
| 2771 | return (status); |
| 2772 | } |
| 2773 | |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 2774 | /* --------------------------------------------------------------------------- |
| 2775 | \fn sme_FilterScanResults |
| 2776 | \brief a wrapper function to request CSR to clear scan results. |
| 2777 | This is a synchronous call |
| 2778 | \return eHalStatus |
| 2779 | ---------------------------------------------------------------------------*/ |
| 2780 | eHalStatus sme_FilterScanResults(tHalHandle hHal, tANI_U8 sessionId) |
| 2781 | { |
| 2782 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 2783 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2784 | |
| 2785 | MTRACE(macTraceNew(pMac, VOS_MODULE_ID_SME, |
| 2786 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_RESULTS, sessionId,0 )); |
| 2787 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2788 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2789 | { |
| 2790 | csrScanFilterResults(pMac); |
| 2791 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2792 | } |
| 2793 | |
| 2794 | return (status); |
| 2795 | } |
| 2796 | |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 2797 | eHalStatus sme_ScanFlushP2PResult(tHalHandle hHal, tANI_U8 sessionId) |
| 2798 | { |
| 2799 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2800 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2801 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2802 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2803 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_P2PRESULTS, sessionId,0 )); |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 2804 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2805 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2806 | { |
Madan Mohan Koyyalamudi | 5850f31 | 2012-11-27 19:00:25 +0530 | [diff] [blame] | 2807 | status = csrScanFlushSelectiveResult( hHal, VOS_TRUE ); |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 2808 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2809 | } |
| 2810 | |
| 2811 | return (status); |
| 2812 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2813 | |
| 2814 | /* --------------------------------------------------------------------------- |
| 2815 | \fn sme_ScanResultGetFirst |
| 2816 | \brief a wrapper function to request CSR to returns the first element of |
| 2817 | scan result. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2818 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2819 | \param hScanResult - returned from csrScanGetResult |
| 2820 | \return tCsrScanResultInfo * - NULL if no result |
| 2821 | ---------------------------------------------------------------------------*/ |
| 2822 | tCsrScanResultInfo *sme_ScanResultGetFirst(tHalHandle hHal, |
| 2823 | tScanResultHandle hScanResult) |
| 2824 | { |
| 2825 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2826 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2827 | tCsrScanResultInfo *pRet = NULL; |
| 2828 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2829 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2830 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_GETFIRST, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2831 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2832 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2833 | { |
| 2834 | pRet = csrScanResultGetFirst( pMac, hScanResult ); |
| 2835 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2836 | } |
| 2837 | |
| 2838 | return (pRet); |
| 2839 | } |
| 2840 | |
| 2841 | |
| 2842 | /* --------------------------------------------------------------------------- |
| 2843 | \fn sme_ScanResultGetNext |
| 2844 | \brief a wrapper function to request CSR to returns the next element of |
| 2845 | scan result. It can be called without calling csrScanResultGetFirst |
| 2846 | first |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2847 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2848 | \param hScanResult - returned from csrScanGetResult |
| 2849 | \return Null if no result or reach the end |
| 2850 | ---------------------------------------------------------------------------*/ |
| 2851 | tCsrScanResultInfo *sme_ScanResultGetNext(tHalHandle hHal, |
| 2852 | tScanResultHandle hScanResult) |
| 2853 | { |
| 2854 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2855 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2856 | tCsrScanResultInfo *pRet = NULL; |
| 2857 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2858 | MTRACE(vos_trace(VOS_MODULE_ID_SME , |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2859 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_GETNEXT, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2860 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2861 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2862 | { |
| 2863 | pRet = csrScanResultGetNext( pMac, hScanResult ); |
| 2864 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2865 | } |
| 2866 | |
| 2867 | return (pRet); |
| 2868 | } |
| 2869 | |
| 2870 | |
| 2871 | /* --------------------------------------------------------------------------- |
| 2872 | \fn sme_ScanSetBGScanparams |
| 2873 | \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] | 2874 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2875 | \param pScanReq - BG scan request structure |
| 2876 | \return eHalStatus |
| 2877 | ---------------------------------------------------------------------------*/ |
| 2878 | eHalStatus sme_ScanSetBGScanparams(tHalHandle hHal, tANI_U8 sessionId, tCsrBGScanRequest *pScanReq) |
| 2879 | { |
| 2880 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2881 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2882 | |
| 2883 | if( NULL != pScanReq ) |
| 2884 | { |
| 2885 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2886 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2887 | { |
| 2888 | status = csrScanSetBGScanparams( hHal, pScanReq ); |
| 2889 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2890 | } |
| 2891 | } |
| 2892 | |
| 2893 | return (status); |
| 2894 | } |
| 2895 | |
| 2896 | |
| 2897 | /* --------------------------------------------------------------------------- |
| 2898 | \fn sme_ScanResultPurge |
| 2899 | \brief a wrapper function to request CSR to remove all items(tCsrScanResult) |
| 2900 | in the list and free memory for each item |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2901 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2902 | \param hScanResult - returned from csrScanGetResult. hScanResult is |
| 2903 | considered gone by |
| 2904 | calling this function and even before this function reutrns. |
| 2905 | \return eHalStatus |
| 2906 | ---------------------------------------------------------------------------*/ |
| 2907 | eHalStatus sme_ScanResultPurge(tHalHandle hHal, tScanResultHandle hScanResult) |
| 2908 | { |
| 2909 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2910 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2911 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2912 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2913 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_PURGE, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2914 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2915 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2916 | { |
| 2917 | status = csrScanResultPurge( hHal, hScanResult ); |
| 2918 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2919 | } |
| 2920 | |
| 2921 | return (status); |
| 2922 | } |
| 2923 | |
| 2924 | /* --------------------------------------------------------------------------- |
| 2925 | \fn sme_ScanGetPMKIDCandidateList |
| 2926 | \brief a wrapper function to return the PMKID candidate list |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2927 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2928 | \param pPmkidList - caller allocated buffer point to an array of |
| 2929 | tPmkidCandidateInfo |
| 2930 | \param pNumItems - pointer to a variable that has the number of |
| 2931 | tPmkidCandidateInfo allocated when retruning, this is |
| 2932 | either the number needed or number of items put into |
| 2933 | pPmkidList |
| 2934 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 2935 | big enough and pNumItems |
| 2936 | has the number of tPmkidCandidateInfo. |
| 2937 | \Note: pNumItems is a number of tPmkidCandidateInfo, |
| 2938 | not sizeof(tPmkidCandidateInfo) * something |
| 2939 | ---------------------------------------------------------------------------*/ |
| 2940 | eHalStatus sme_ScanGetPMKIDCandidateList(tHalHandle hHal, tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2941 | tPmkidCandidateInfo *pPmkidList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2942 | tANI_U32 *pNumItems ) |
| 2943 | { |
| 2944 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2945 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2946 | |
| 2947 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2948 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2949 | { |
| 2950 | status = csrScanGetPMKIDCandidateList( pMac, sessionId, pPmkidList, pNumItems ); |
| 2951 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2952 | } |
| 2953 | |
| 2954 | return (status); |
| 2955 | } |
| 2956 | |
| 2957 | /*---------------------------------------------------------------------------- |
| 2958 | \fn sme_RoamRegisterLinkQualityIndCallback |
| 2959 | |
| 2960 | \brief |
| 2961 | a wrapper function to allow HDD to register a callback handler with CSR for |
| 2962 | link quality indications. |
| 2963 | |
| 2964 | Only one callback may be registered at any time. |
| 2965 | In order to deregister the callback, a NULL cback may be provided. |
| 2966 | |
| 2967 | Registration happens in the task context of the caller. |
| 2968 | |
| 2969 | \param callback - Call back being registered |
| 2970 | \param pContext - user data |
| 2971 | |
| 2972 | DEPENDENCIES: After CSR open |
| 2973 | |
| 2974 | \return eHalStatus |
| 2975 | -----------------------------------------------------------------------------*/ |
| 2976 | eHalStatus sme_RoamRegisterLinkQualityIndCallback(tHalHandle hHal, tANI_U8 sessionId, |
| 2977 | csrRoamLinkQualityIndCallback callback, |
| 2978 | void *pContext) |
| 2979 | { |
| 2980 | return(csrRoamRegisterLinkQualityIndCallback((tpAniSirGlobal)hHal, callback, pContext)); |
| 2981 | } |
| 2982 | |
| 2983 | /* --------------------------------------------------------------------------- |
| 2984 | \fn sme_RoamRegisterCallback |
| 2985 | \brief a wrapper function to allow HDD to register a callback with CSR. |
| 2986 | Unlike scan, roam has one callback for all the roam requests |
| 2987 | \param callback - a callback function that roam calls upon when state changes |
| 2988 | \param pContext - a pointer passed in for the callback |
| 2989 | \return eHalStatus |
| 2990 | ---------------------------------------------------------------------------*/ |
| 2991 | eHalStatus sme_RoamRegisterCallback(tHalHandle hHal, |
| 2992 | csrRoamCompleteCallback callback, |
| 2993 | void *pContext) |
| 2994 | { |
| 2995 | return(csrRoamRegisterCallback((tpAniSirGlobal)hHal, callback, pContext)); |
| 2996 | } |
| 2997 | |
| 2998 | eCsrPhyMode sme_GetPhyMode(tHalHandle hHal) |
| 2999 | { |
| 3000 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 3001 | return pMac->roam.configParam.phyMode; |
| 3002 | } |
| 3003 | |
| 3004 | /* --------------------------------------------------------------------------- |
Peng Xu | 117eab4 | 2014-09-25 13:33:27 +0530 | [diff] [blame] | 3005 | \fn sme_GetChannelBondingMode5G |
| 3006 | \brief get the channel bonding mode for 5G band |
| 3007 | \param hHal - HAL handle |
| 3008 | \return channel bonding mode for 5G |
| 3009 | ---------------------------------------------------------------------------*/ |
| 3010 | tANI_U32 sme_GetChannelBondingMode5G(tHalHandle hHal) |
| 3011 | { |
| 3012 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 3013 | tSmeConfigParams smeConfig; |
| 3014 | |
| 3015 | sme_GetConfigParam(pMac, &smeConfig); |
| 3016 | |
| 3017 | return smeConfig.csrConfig.channelBondingMode5GHz; |
| 3018 | } |
| 3019 | |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 3020 | #ifdef WLAN_FEATURE_AP_HT40_24G |
Peng Xu | 117eab4 | 2014-09-25 13:33:27 +0530 | [diff] [blame] | 3021 | /* --------------------------------------------------------------------------- |
| 3022 | \fn sme_GetChannelBondingMode24G |
| 3023 | \brief get the channel bonding mode for 2.4G band |
| 3024 | \param hHal - HAL handle |
| 3025 | \return channel bonding mode for 2.4G |
| 3026 | ---------------------------------------------------------------------------*/ |
| 3027 | tANI_U32 sme_GetChannelBondingMode24G(tHalHandle hHal) |
| 3028 | { |
| 3029 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 3030 | tSmeConfigParams smeConfig; |
| 3031 | |
| 3032 | sme_GetConfigParam(pMac, &smeConfig); |
| 3033 | |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 3034 | return smeConfig.csrConfig.channelBondingAPMode24GHz; |
Peng Xu | 117eab4 | 2014-09-25 13:33:27 +0530 | [diff] [blame] | 3035 | } |
| 3036 | |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 3037 | /* --------------------------------------------------------------------------- |
| 3038 | \fn sme_UpdateChannelBondingMode24G |
| 3039 | \brief update the channel bonding mode for 2.4G band |
| 3040 | \param hHal - HAL handle |
| 3041 | \param cbMode - channel bonding mode |
| 3042 | \return |
| 3043 | ---------------------------------------------------------------------------*/ |
| 3044 | void sme_UpdateChannelBondingMode24G(tHalHandle hHal, tANI_U8 cbMode) |
| 3045 | { |
| 3046 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 3047 | tSmeConfigParams smeConfig; |
| 3048 | |
| 3049 | vos_mem_zero(&smeConfig, sizeof (tSmeConfigParams)); |
| 3050 | sme_GetConfigParam(pMac, &smeConfig); |
| 3051 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, |
| 3052 | FL("Previous Channel Bonding : = %d"), |
| 3053 | smeConfig.csrConfig.channelBondingAPMode24GHz); |
| 3054 | |
| 3055 | smeConfig.csrConfig.channelBondingAPMode24GHz = cbMode; |
| 3056 | sme_UpdateConfig(hHal, &smeConfig); |
| 3057 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, |
| 3058 | FL("New Channel Bonding : = %d"), |
| 3059 | sme_GetChannelBondingMode24G(hHal)); |
| 3060 | return; |
| 3061 | } |
Hardik Kantilal Patel | 62a3a76 | 2014-11-21 12:55:57 +0530 | [diff] [blame] | 3062 | |
| 3063 | /* --------------------------------------------------------------------------- |
| 3064 | |
| 3065 | \fn sme_SetHT2040Mode |
| 3066 | |
| 3067 | \brief To update HT Operation beacon IE & Channel Bonding. |
| 3068 | |
| 3069 | \param |
| 3070 | |
| 3071 | \return eHalStatus SUCCESS |
| 3072 | FAILURE or RESOURCES |
| 3073 | The API finished and failed. |
| 3074 | |
| 3075 | -------------------------------------------------------------------------------*/ |
| 3076 | eHalStatus sme_SetHT2040Mode(tHalHandle hHal, tANI_U8 sessionId, tANI_U8 cbMode) |
| 3077 | { |
| 3078 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3079 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3080 | |
| 3081 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 3082 | FL("Channel Bonding =%d"), |
| 3083 | cbMode); |
| 3084 | |
| 3085 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 3086 | if (HAL_STATUS_SUCCESS(status)) |
| 3087 | { |
| 3088 | status = csrSetHT2040Mode(pMac, sessionId, cbMode); |
| 3089 | sme_ReleaseGlobalLock(&pMac->sme ); |
| 3090 | } |
| 3091 | return (status); |
| 3092 | } |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 3093 | #endif |
Peng Xu | 117eab4 | 2014-09-25 13:33:27 +0530 | [diff] [blame] | 3094 | |
| 3095 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3096 | \fn sme_RoamConnect |
| 3097 | \brief a wrapper function to request CSR to inititiate an association |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3098 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3099 | \param sessionId - the sessionId returned by sme_OpenSession. |
| 3100 | \param pProfile - description of the network to which to connect |
| 3101 | \param hBssListIn - a list of BSS descriptor to roam to. It is returned |
| 3102 | from csrScanGetResult |
| 3103 | \param pRoamId - to get back the request ID |
| 3104 | \return eHalStatus |
| 3105 | ---------------------------------------------------------------------------*/ |
| 3106 | eHalStatus sme_RoamConnect(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamProfile *pProfile, |
| 3107 | tANI_U32 *pRoamId) |
| 3108 | { |
| 3109 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3110 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3111 | |
Yue Ma | e36e355 | 2014-03-05 17:06:20 -0800 | [diff] [blame] | 3112 | if (!pMac) |
| 3113 | { |
| 3114 | return eHAL_STATUS_FAILURE; |
| 3115 | } |
| 3116 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3117 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3118 | TRACE_CODE_SME_RX_HDD_MSG_CONNECT, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3119 | smsLog(pMac, LOG2, FL("enter")); |
| 3120 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3121 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3122 | { |
| 3123 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3124 | { |
| 3125 | status = csrRoamConnect( pMac, sessionId, pProfile, NULL, pRoamId ); |
| 3126 | } |
| 3127 | else |
| 3128 | { |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 3129 | smsLog(pMac, LOGE, FL("invalid sessionID %d"), sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3130 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3131 | } |
| 3132 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3133 | } |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 3134 | else |
| 3135 | { |
| 3136 | smsLog(pMac, LOGE, FL("sme_AcquireGlobalLock failed")); |
| 3137 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3138 | |
| 3139 | return (status); |
| 3140 | } |
| 3141 | |
| 3142 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | dacbcb5 | 2013-04-18 16:41:54 +0530 | [diff] [blame] | 3143 | |
| 3144 | \fn sme_SetPhyMode |
| 3145 | |
| 3146 | \brief Changes the PhyMode. |
| 3147 | |
| 3148 | \param hHal - The handle returned by macOpen. |
| 3149 | |
| 3150 | \param phyMode new phyMode which is to set |
| 3151 | |
| 3152 | \return eHalStatus SUCCESS. |
| 3153 | |
| 3154 | -------------------------------------------------------------------------------*/ |
| 3155 | eHalStatus sme_SetPhyMode(tHalHandle hHal, eCsrPhyMode phyMode) |
| 3156 | { |
| 3157 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3158 | |
| 3159 | if (NULL == pMac) |
| 3160 | { |
| 3161 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 3162 | "%s: invalid context", __func__); |
| 3163 | return eHAL_STATUS_FAILURE; |
| 3164 | } |
| 3165 | |
| 3166 | pMac->roam.configParam.phyMode = phyMode; |
| 3167 | pMac->roam.configParam.uCfgDot11Mode = csrGetCfgDot11ModeFromCsrPhyMode(NULL, |
| 3168 | pMac->roam.configParam.phyMode, |
| 3169 | pMac->roam.configParam.ProprietaryRatesEnabled); |
| 3170 | |
| 3171 | return eHAL_STATUS_SUCCESS; |
| 3172 | } |
| 3173 | |
| 3174 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3175 | \fn sme_RoamReassoc |
| 3176 | \brief a wrapper function to request CSR to inititiate a re-association |
| 3177 | \param pProfile - can be NULL to join the currently connected AP. In that |
| 3178 | case modProfileFields should carry the modified field(s) which could trigger |
| 3179 | reassoc |
| 3180 | \param modProfileFields - fields which are part of tCsrRoamConnectedProfile |
| 3181 | that might need modification dynamically once STA is up & running and this |
| 3182 | could trigger a reassoc |
| 3183 | \param pRoamId - to get back the request ID |
| 3184 | \return eHalStatus |
| 3185 | -------------------------------------------------------------------------------*/ |
| 3186 | eHalStatus sme_RoamReassoc(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamProfile *pProfile, |
| 3187 | tCsrRoamModifyProfileFields modProfileFields, |
Madan Mohan Koyyalamudi | ea22cdc | 2012-10-18 21:02:23 -0700 | [diff] [blame] | 3188 | tANI_U32 *pRoamId, v_BOOL_t fForce) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3189 | { |
| 3190 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3191 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3192 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3193 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3194 | TRACE_CODE_SME_RX_HDD_ROAM_REASSOC, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3195 | smsLog(pMac, LOG2, FL("enter")); |
| 3196 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3197 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3198 | { |
| 3199 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3200 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3201 | if((NULL == pProfile) && (fForce == 1)) |
| 3202 | { |
Madan Mohan Koyyalamudi | 0d0e171 | 2012-10-21 12:02:45 -0700 | [diff] [blame] | 3203 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 3204 | /* to force the AP initiate fresh 802.1x authentication need to clear |
| 3205 | * the PMKID cache for that set the following boolean. this is needed |
| 3206 | * by the HS 2.0 passpoint certification 5.2.a and b testcases */ |
| 3207 | pSession->fIgnorePMKIDCache = TRUE; |
Madan Mohan Koyyalamudi | ea22cdc | 2012-10-18 21:02:23 -0700 | [diff] [blame] | 3208 | status = csrReassoc( pMac, sessionId, &modProfileFields, pRoamId , fForce); |
| 3209 | } |
| 3210 | else |
| 3211 | { |
| 3212 | status = csrRoamReassoc( pMac, sessionId, pProfile, modProfileFields, pRoamId ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3213 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3214 | } |
| 3215 | else |
| 3216 | { |
| 3217 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3218 | } |
| 3219 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3220 | } |
| 3221 | |
| 3222 | return (status); |
| 3223 | } |
| 3224 | |
| 3225 | /* --------------------------------------------------------------------------- |
| 3226 | \fn sme_RoamConnectToLastProfile |
| 3227 | \brief a wrapper function to request CSR to disconnect and reconnect with |
| 3228 | the same profile |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3229 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3230 | \return eHalStatus. It returns fail if currently connected |
| 3231 | ---------------------------------------------------------------------------*/ |
| 3232 | eHalStatus sme_RoamConnectToLastProfile(tHalHandle hHal, tANI_U8 sessionId) |
| 3233 | { |
| 3234 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3235 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3236 | |
| 3237 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3238 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3239 | { |
| 3240 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3241 | { |
| 3242 | status = csrRoamConnectToLastProfile( pMac, sessionId ); |
| 3243 | } |
| 3244 | else |
| 3245 | { |
| 3246 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3247 | } |
| 3248 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3249 | } |
| 3250 | |
| 3251 | return (status); |
| 3252 | } |
| 3253 | |
| 3254 | /* --------------------------------------------------------------------------- |
| 3255 | \fn sme_RoamDisconnect |
| 3256 | \brief a wrapper function to request CSR to disconnect from a network |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3257 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3258 | \param reason -- To indicate the reason for disconnecting. Currently, only |
| 3259 | eCSR_DISCONNECT_REASON_MIC_ERROR is meanful. |
| 3260 | \return eHalStatus |
| 3261 | ---------------------------------------------------------------------------*/ |
| 3262 | eHalStatus sme_RoamDisconnect(tHalHandle hHal, tANI_U8 sessionId, eCsrRoamDisconnectReason reason) |
| 3263 | { |
| 3264 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3265 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3266 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3267 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3268 | TRACE_CODE_SME_RX_HDD_ROAM_DISCONNECT, sessionId, reason)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3269 | smsLog(pMac, LOG2, FL("enter")); |
| 3270 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3271 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3272 | { |
| 3273 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3274 | { |
| 3275 | status = csrRoamDisconnect( pMac, sessionId, reason ); |
| 3276 | } |
| 3277 | else |
| 3278 | { |
| 3279 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3280 | } |
| 3281 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3282 | } |
| 3283 | |
| 3284 | return (status); |
| 3285 | } |
| 3286 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3287 | /* --------------------------------------------------------------------------- |
| 3288 | \fn sme_RoamStopBss |
| 3289 | \brief To stop BSS for Soft AP. This is an asynchronous API. |
| 3290 | \param hHal - Global structure |
| 3291 | \param sessionId - sessionId of SoftAP |
| 3292 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3293 | -------------------------------------------------------------------------------*/ |
| 3294 | eHalStatus sme_RoamStopBss(tHalHandle hHal, tANI_U8 sessionId) |
| 3295 | { |
| 3296 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3297 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3298 | |
| 3299 | smsLog(pMac, LOG2, FL("enter")); |
| 3300 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3301 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3302 | { |
| 3303 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3304 | { |
Gopichand Nakkala | f44bdc5 | 2013-02-16 00:54:45 +0530 | [diff] [blame] | 3305 | status = csrRoamIssueStopBssCmd( pMac, sessionId, eANI_BOOLEAN_FALSE ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3306 | } |
| 3307 | else |
| 3308 | { |
| 3309 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3310 | } |
| 3311 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3312 | } |
| 3313 | |
| 3314 | return (status); |
| 3315 | } |
| 3316 | |
| 3317 | /* --------------------------------------------------------------------------- |
| 3318 | \fn sme_RoamDisconnectSta |
| 3319 | \brief To disassociate a station. This is an asynchronous API. |
| 3320 | \param hHal - Global structure |
| 3321 | \param sessionId - sessionId of SoftAP |
| 3322 | \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) |
| 3323 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3324 | -------------------------------------------------------------------------------*/ |
| 3325 | eHalStatus sme_RoamDisconnectSta(tHalHandle hHal, tANI_U8 sessionId, |
| 3326 | tANI_U8 *pPeerMacAddr) |
| 3327 | { |
| 3328 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3329 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3330 | |
| 3331 | if ( NULL == pMac ) |
| 3332 | { |
| 3333 | VOS_ASSERT(0); |
| 3334 | return status; |
| 3335 | } |
| 3336 | |
| 3337 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3338 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3339 | { |
| 3340 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3341 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3342 | status = csrRoamIssueDisassociateStaCmd( pMac, sessionId, pPeerMacAddr, |
Madan Mohan Koyyalamudi | 299b486 | 2013-01-30 19:59:23 +0530 | [diff] [blame] | 3343 | eSIR_MAC_DEAUTH_LEAVING_BSS_REASON); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3344 | } |
| 3345 | else |
| 3346 | { |
| 3347 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3348 | } |
| 3349 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3350 | } |
| 3351 | |
| 3352 | return (status); |
| 3353 | } |
| 3354 | |
| 3355 | /* --------------------------------------------------------------------------- |
| 3356 | \fn sme_RoamDeauthSta |
| 3357 | \brief To disassociate a station. This is an asynchronous API. |
| 3358 | \param hHal - Global structure |
| 3359 | \param sessionId - sessionId of SoftAP |
Hanumantha Reddy Pothula | f57da15 | 2014-10-31 13:02:08 +0530 | [diff] [blame] | 3360 | \param pDelStaParams -Pointer to parameters of the station to deauthenticate |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3361 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3362 | -------------------------------------------------------------------------------*/ |
| 3363 | eHalStatus sme_RoamDeauthSta(tHalHandle hHal, tANI_U8 sessionId, |
Hanumantha Reddy Pothula | f57da15 | 2014-10-31 13:02:08 +0530 | [diff] [blame] | 3364 | struct tagCsrDelStaParams *pDelStaParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3365 | { |
| 3366 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3367 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3368 | |
| 3369 | if ( NULL == pMac ) |
| 3370 | { |
| 3371 | VOS_ASSERT(0); |
| 3372 | return status; |
| 3373 | } |
| 3374 | |
| 3375 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3376 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3377 | { |
| 3378 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3379 | { |
Hanumantha Reddy Pothula | f57da15 | 2014-10-31 13:02:08 +0530 | [diff] [blame] | 3380 | status = csrRoamIssueDeauthStaCmd( pMac, sessionId, pDelStaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3381 | } |
| 3382 | else |
| 3383 | { |
| 3384 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3385 | } |
| 3386 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3387 | } |
| 3388 | |
| 3389 | return (status); |
| 3390 | } |
| 3391 | |
| 3392 | /* --------------------------------------------------------------------------- |
| 3393 | \fn sme_RoamTKIPCounterMeasures |
| 3394 | \brief To start or stop TKIP counter measures. This is an asynchronous API. |
| 3395 | \param sessionId - sessionId of SoftAP |
| 3396 | \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) |
| 3397 | \return eHalStatus |
| 3398 | -------------------------------------------------------------------------------*/ |
| 3399 | eHalStatus sme_RoamTKIPCounterMeasures(tHalHandle hHal, tANI_U8 sessionId, |
| 3400 | tANI_BOOLEAN bEnable) |
| 3401 | { |
| 3402 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3403 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3404 | |
| 3405 | if ( NULL == pMac ) |
| 3406 | { |
| 3407 | VOS_ASSERT(0); |
| 3408 | return status; |
| 3409 | } |
| 3410 | |
| 3411 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3412 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3413 | { |
| 3414 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3415 | { |
| 3416 | status = csrRoamIssueTkipCounterMeasures( pMac, sessionId, bEnable); |
| 3417 | } |
| 3418 | else |
| 3419 | { |
| 3420 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3421 | } |
| 3422 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3423 | } |
| 3424 | |
| 3425 | return (status); |
| 3426 | } |
| 3427 | |
| 3428 | /* --------------------------------------------------------------------------- |
| 3429 | \fn sme_RoamGetAssociatedStas |
| 3430 | \brief To probe the list of associated stations from various modules of CORE stack. |
| 3431 | \This is an asynchronous API. |
| 3432 | \param sessionId - sessionId of SoftAP |
| 3433 | \param modId - Module from whom list of associtated stations is to be probed. |
| 3434 | If an invalid module is passed then by default VOS_MODULE_ID_PE will be probed |
| 3435 | \param pUsrContext - Opaque HDD context |
| 3436 | \param pfnSapEventCallback - Sap event callback in HDD |
| 3437 | \param pAssocBuf - Caller allocated memory to be filled with associatd stations info |
| 3438 | \return eHalStatus |
| 3439 | -------------------------------------------------------------------------------*/ |
| 3440 | eHalStatus sme_RoamGetAssociatedStas(tHalHandle hHal, tANI_U8 sessionId, |
| 3441 | VOS_MODULE_ID modId, void *pUsrContext, |
| 3442 | void *pfnSapEventCallback, tANI_U8 *pAssocStasBuf) |
| 3443 | { |
| 3444 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3445 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3446 | |
| 3447 | if ( NULL == pMac ) |
| 3448 | { |
| 3449 | VOS_ASSERT(0); |
| 3450 | return status; |
| 3451 | } |
| 3452 | |
| 3453 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3454 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3455 | { |
| 3456 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3457 | { |
| 3458 | status = csrRoamGetAssociatedStas( pMac, sessionId, modId, pUsrContext, pfnSapEventCallback, pAssocStasBuf ); |
| 3459 | } |
| 3460 | else |
| 3461 | { |
| 3462 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3463 | } |
| 3464 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3465 | } |
| 3466 | |
| 3467 | return (status); |
| 3468 | } |
| 3469 | |
| 3470 | /* --------------------------------------------------------------------------- |
| 3471 | \fn sme_RoamGetWpsSessionOverlap |
| 3472 | \brief To get the WPS PBC session overlap information. |
| 3473 | \This is an asynchronous API. |
| 3474 | \param sessionId - sessionId of SoftAP |
| 3475 | \param pUsrContext - Opaque HDD context |
| 3476 | \param pfnSapEventCallback - Sap event callback in HDD |
| 3477 | \pRemoveMac - pointer to Mac address which needs to be removed from session |
| 3478 | \return eHalStatus |
| 3479 | -------------------------------------------------------------------------------*/ |
| 3480 | eHalStatus sme_RoamGetWpsSessionOverlap(tHalHandle hHal, tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3481 | void *pUsrContext, void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3482 | *pfnSapEventCallback, v_MACADDR_t pRemoveMac) |
| 3483 | { |
| 3484 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3485 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3486 | |
| 3487 | if ( NULL == pMac ) |
| 3488 | { |
| 3489 | VOS_ASSERT(0); |
| 3490 | return status; |
| 3491 | } |
| 3492 | |
| 3493 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3494 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3495 | { |
| 3496 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3497 | { |
| 3498 | status = csrRoamGetWpsSessionOverlap( pMac, sessionId, pUsrContext, pfnSapEventCallback, pRemoveMac); |
| 3499 | } |
| 3500 | else |
| 3501 | { |
| 3502 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3503 | } |
| 3504 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3505 | } |
| 3506 | |
| 3507 | return (status); |
| 3508 | } |
| 3509 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3510 | |
| 3511 | /* --------------------------------------------------------------------------- |
| 3512 | \fn sme_RoamGetConnectState |
| 3513 | \brief a wrapper function to request CSR to return the current connect state |
| 3514 | of Roaming |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3515 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3516 | \return eHalStatus |
| 3517 | ---------------------------------------------------------------------------*/ |
| 3518 | eHalStatus sme_RoamGetConnectState(tHalHandle hHal, tANI_U8 sessionId, eCsrConnectState *pState) |
| 3519 | { |
| 3520 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3521 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3522 | |
| 3523 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3524 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3525 | { |
| 3526 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3527 | { |
| 3528 | status = csrRoamGetConnectState( pMac, sessionId, pState ); |
| 3529 | } |
| 3530 | else |
| 3531 | { |
| 3532 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3533 | } |
| 3534 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3535 | } |
| 3536 | |
| 3537 | return (status); |
| 3538 | } |
| 3539 | |
| 3540 | /* --------------------------------------------------------------------------- |
| 3541 | \fn sme_RoamGetConnectProfile |
| 3542 | \brief a wrapper function to request CSR to return the current connect |
| 3543 | profile. Caller must call csrRoamFreeConnectProfile after it is done |
| 3544 | and before reuse for another csrRoamGetConnectProfile call. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3545 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3546 | \param pProfile - pointer to a caller allocated structure |
| 3547 | tCsrRoamConnectedProfile |
| 3548 | \return eHalStatus. Failure if not connected |
| 3549 | ---------------------------------------------------------------------------*/ |
| 3550 | eHalStatus sme_RoamGetConnectProfile(tHalHandle hHal, tANI_U8 sessionId, |
| 3551 | tCsrRoamConnectedProfile *pProfile) |
| 3552 | { |
| 3553 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3554 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3555 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3556 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3557 | TRACE_CODE_SME_RX_HDD_ROAM_GET_CONNECTPROFILE, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3558 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3559 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3560 | { |
| 3561 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3562 | { |
| 3563 | status = csrRoamGetConnectProfile( pMac, sessionId, pProfile ); |
| 3564 | } |
| 3565 | else |
| 3566 | { |
| 3567 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3568 | } |
| 3569 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3570 | } |
| 3571 | |
| 3572 | return (status); |
| 3573 | } |
| 3574 | |
| 3575 | /* --------------------------------------------------------------------------- |
| 3576 | \fn sme_RoamFreeConnectProfile |
| 3577 | \brief a wrapper function to request CSR to free and reinitialize the |
| 3578 | profile returned previously by csrRoamGetConnectProfile. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3579 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3580 | \param pProfile - pointer to a caller allocated structure |
| 3581 | tCsrRoamConnectedProfile |
| 3582 | \return eHalStatus. |
| 3583 | ---------------------------------------------------------------------------*/ |
| 3584 | eHalStatus sme_RoamFreeConnectProfile(tHalHandle hHal, |
| 3585 | tCsrRoamConnectedProfile *pProfile) |
| 3586 | { |
| 3587 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3588 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3589 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3590 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3591 | TRACE_CODE_SME_RX_HDD_ROAM_FREE_CONNECTPROFILE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3592 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3593 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3594 | { |
| 3595 | status = csrRoamFreeConnectProfile( pMac, pProfile ); |
| 3596 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3597 | } |
| 3598 | |
| 3599 | return (status); |
| 3600 | } |
| 3601 | |
| 3602 | /* --------------------------------------------------------------------------- |
| 3603 | \fn sme_RoamSetPMKIDCache |
| 3604 | \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] | 3605 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3606 | \param pPMKIDCache - caller allocated buffer point to an array of |
| 3607 | tPmkidCacheInfo |
| 3608 | \param numItems - a variable that has the number of tPmkidCacheInfo |
| 3609 | allocated when retruning, this is either the number needed |
| 3610 | or number of items put into pPMKIDCache |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 3611 | \param update_entire_cache - this bool value specifies if the entire pmkid |
| 3612 | cache should be overwritten or should it be |
| 3613 | updated entry by entry. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3614 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3615 | big enough and pNumItems has the number of |
| 3616 | tPmkidCacheInfo. |
| 3617 | \Note: pNumItems is a number of tPmkidCacheInfo, |
| 3618 | not sizeof(tPmkidCacheInfo) * something |
| 3619 | ---------------------------------------------------------------------------*/ |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 3620 | eHalStatus sme_RoamSetPMKIDCache( tHalHandle hHal, tANI_U8 sessionId, |
| 3621 | tPmkidCacheInfo *pPMKIDCache, |
| 3622 | tANI_U32 numItems, |
| 3623 | tANI_BOOLEAN update_entire_cache ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3624 | { |
| 3625 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3626 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3627 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3628 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3629 | TRACE_CODE_SME_RX_HDD_ROAM_SET_PMKIDCACHE, sessionId, numItems)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3630 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3631 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3632 | { |
| 3633 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3634 | { |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 3635 | status = csrRoamSetPMKIDCache( pMac, sessionId, pPMKIDCache, |
| 3636 | numItems, update_entire_cache ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3637 | } |
| 3638 | else |
| 3639 | { |
| 3640 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3641 | } |
| 3642 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3643 | } |
| 3644 | |
| 3645 | return (status); |
| 3646 | } |
| 3647 | |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 3648 | eHalStatus sme_RoamDelPMKIDfromCache( tHalHandle hHal, tANI_U8 sessionId, |
| 3649 | tANI_U8 *pBSSId, |
| 3650 | tANI_BOOLEAN flush_cache ) |
Leela Venkata Kiran Kumar Reddy Chirala | ede1065 | 2013-09-11 18:48:46 -0700 | [diff] [blame] | 3651 | { |
| 3652 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3653 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3654 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3655 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3656 | { |
| 3657 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3658 | { |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 3659 | status = csrRoamDelPMKIDfromCache( pMac, sessionId, |
| 3660 | pBSSId, flush_cache ); |
Leela Venkata Kiran Kumar Reddy Chirala | ede1065 | 2013-09-11 18:48:46 -0700 | [diff] [blame] | 3661 | } |
| 3662 | else |
| 3663 | { |
| 3664 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3665 | } |
| 3666 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3667 | } |
| 3668 | return (status); |
| 3669 | } |
Wilson Yang | 47b5819 | 2013-12-11 11:40:19 -0800 | [diff] [blame] | 3670 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3671 | /* --------------------------------------------------------------------------- |
| 3672 | \fn sme_RoamGetSecurityReqIE |
| 3673 | \brief a wrapper function to request CSR to return the WPA or RSN or WAPI IE CSR |
| 3674 | passes to PE to JOIN request or START_BSS request |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3675 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3676 | \param pLen - caller allocated memory that has the length of pBuf as input. |
| 3677 | Upon returned, *pLen has the needed or IE length in pBuf. |
| 3678 | \param pBuf - Caller allocated memory that contain the IE field, if any, |
| 3679 | upon return |
| 3680 | \param secType - Specifies whether looking for WPA/WPA2/WAPI IE |
| 3681 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3682 | big enough |
| 3683 | ---------------------------------------------------------------------------*/ |
| 3684 | eHalStatus sme_RoamGetSecurityReqIE(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pLen, |
| 3685 | tANI_U8 *pBuf, eCsrSecurityType secType) |
| 3686 | { |
| 3687 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3688 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3689 | |
| 3690 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3691 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3692 | { |
| 3693 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3694 | { |
| 3695 | status = csrRoamGetWpaRsnReqIE( hHal, sessionId, pLen, pBuf ); |
| 3696 | } |
| 3697 | else |
| 3698 | { |
| 3699 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3700 | } |
| 3701 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3702 | } |
| 3703 | |
| 3704 | return (status); |
| 3705 | } |
| 3706 | |
| 3707 | /* --------------------------------------------------------------------------- |
| 3708 | \fn sme_RoamGetSecurityRspIE |
| 3709 | \brief a wrapper function to request CSR to return the WPA or RSN or WAPI IE from |
| 3710 | the beacon or probe rsp if connected |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3711 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3712 | \param pLen - caller allocated memory that has the length of pBuf as input. |
| 3713 | Upon returned, *pLen has the needed or IE length in pBuf. |
| 3714 | \param pBuf - Caller allocated memory that contain the IE field, if any, |
| 3715 | upon return |
| 3716 | \param secType - Specifies whether looking for WPA/WPA2/WAPI IE |
| 3717 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3718 | big enough |
| 3719 | ---------------------------------------------------------------------------*/ |
| 3720 | eHalStatus sme_RoamGetSecurityRspIE(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pLen, |
| 3721 | tANI_U8 *pBuf, eCsrSecurityType secType) |
| 3722 | { |
| 3723 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3724 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3725 | |
| 3726 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3727 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3728 | { |
| 3729 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3730 | { |
| 3731 | status = csrRoamGetWpaRsnRspIE( pMac, sessionId, pLen, pBuf ); |
| 3732 | } |
| 3733 | else |
| 3734 | { |
| 3735 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3736 | } |
| 3737 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3738 | } |
| 3739 | |
| 3740 | return (status); |
| 3741 | |
| 3742 | } |
| 3743 | |
| 3744 | |
| 3745 | /* --------------------------------------------------------------------------- |
| 3746 | \fn sme_RoamGetNumPMKIDCache |
| 3747 | \brief a wrapper function to request CSR to return number of PMKID cache |
| 3748 | entries |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3749 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3750 | \return tANI_U32 - the number of PMKID cache entries |
| 3751 | ---------------------------------------------------------------------------*/ |
| 3752 | tANI_U32 sme_RoamGetNumPMKIDCache(tHalHandle hHal, tANI_U8 sessionId) |
| 3753 | { |
| 3754 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3755 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3756 | tANI_U32 numPmkidCache = 0; |
| 3757 | |
| 3758 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3759 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3760 | { |
| 3761 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3762 | { |
| 3763 | numPmkidCache = csrRoamGetNumPMKIDCache( pMac, sessionId ); |
| 3764 | status = eHAL_STATUS_SUCCESS; |
| 3765 | } |
| 3766 | else |
| 3767 | { |
| 3768 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3769 | } |
| 3770 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3771 | } |
| 3772 | |
| 3773 | return (numPmkidCache); |
| 3774 | } |
| 3775 | |
| 3776 | /* --------------------------------------------------------------------------- |
| 3777 | \fn sme_RoamGetPMKIDCache |
| 3778 | \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] | 3779 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3780 | \param pNum - caller allocated memory that has the space of the number of |
| 3781 | pBuf tPmkidCacheInfo as input. Upon returned, *pNum has the |
| 3782 | needed or actually number in tPmkidCacheInfo. |
| 3783 | \param pPmkidCache - Caller allocated memory that contains PMKID cache, if |
| 3784 | any, upon return |
| 3785 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3786 | big enough |
| 3787 | ---------------------------------------------------------------------------*/ |
| 3788 | eHalStatus sme_RoamGetPMKIDCache(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pNum, |
| 3789 | tPmkidCacheInfo *pPmkidCache) |
| 3790 | { |
| 3791 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3792 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3793 | |
| 3794 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3795 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3796 | { |
| 3797 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3798 | { |
| 3799 | status = csrRoamGetPMKIDCache( pMac, sessionId, pNum, pPmkidCache ); |
| 3800 | } |
| 3801 | else |
| 3802 | { |
| 3803 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3804 | } |
| 3805 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3806 | } |
| 3807 | |
| 3808 | return (status); |
| 3809 | } |
| 3810 | |
| 3811 | |
| 3812 | /* --------------------------------------------------------------------------- |
| 3813 | \fn sme_GetConfigParam |
| 3814 | \brief a wrapper function that HDD calls to get the global settings |
| 3815 | currently maintained by CSR. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3816 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3817 | \param pParam - caller allocated memory |
| 3818 | \return eHalStatus |
| 3819 | ---------------------------------------------------------------------------*/ |
| 3820 | eHalStatus sme_GetConfigParam(tHalHandle hHal, tSmeConfigParams *pParam) |
| 3821 | { |
| 3822 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3823 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3824 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3825 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3826 | TRACE_CODE_SME_RX_HDD_GET_CONFIGPARAM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3827 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3828 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3829 | { |
| 3830 | status = csrGetConfigParam(pMac, &pParam->csrConfig); |
| 3831 | if (status != eHAL_STATUS_SUCCESS) |
| 3832 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3833 | smsLog( pMac, LOGE, "%s csrGetConfigParam failed", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3834 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3835 | return status; |
| 3836 | } |
| 3837 | #if defined WLAN_FEATURE_P2P_INTERNAL |
| 3838 | status = p2pGetConfigParam(pMac, &pParam->p2pConfig); |
| 3839 | if (status != eHAL_STATUS_SUCCESS) |
| 3840 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3841 | smsLog( pMac, LOGE, "%s p2pGetConfigParam failed", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3842 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3843 | return status; |
| 3844 | } |
| 3845 | #endif |
| 3846 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3847 | } |
| 3848 | |
| 3849 | return (status); |
| 3850 | } |
| 3851 | |
| 3852 | /* --------------------------------------------------------------------------- |
| 3853 | \fn sme_CfgSetInt |
| 3854 | \brief a wrapper function that HDD calls to set parameters in CFG. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3855 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3856 | \param cfgId - Configuration Parameter ID (type) for STA. |
| 3857 | \param ccmValue - The information related to Configuration Parameter ID |
| 3858 | which needs to be saved in CFG |
| 3859 | \param callback - To be registered by CSR with CCM. Once the CFG done with |
| 3860 | saving the information in the database, it notifies CCM & |
| 3861 | then the callback will be invoked to notify. |
| 3862 | \param toBeSaved - To save the request for future reference |
| 3863 | \return eHalStatus |
| 3864 | ---------------------------------------------------------------------------*/ |
| 3865 | eHalStatus sme_CfgSetInt(tHalHandle hHal, tANI_U32 cfgId, tANI_U32 ccmValue, |
| 3866 | tCcmCfgSetCallback callback, eAniBoolean toBeSaved) |
| 3867 | { |
| 3868 | return(ccmCfgSetInt(hHal, cfgId, ccmValue, callback, toBeSaved)); |
| 3869 | } |
| 3870 | |
| 3871 | /* --------------------------------------------------------------------------- |
| 3872 | \fn sme_CfgSetStr |
| 3873 | \brief a wrapper function that HDD calls to set parameters in CFG. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3874 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3875 | \param cfgId - Configuration Parameter ID (type) for STA. |
| 3876 | \param pStr - Pointer to the byte array which carries the information needs |
| 3877 | to be saved in CFG |
| 3878 | \param length - Length of the data to be saved |
| 3879 | \param callback - To be registered by CSR with CCM. Once the CFG done with |
| 3880 | saving the information in the database, it notifies CCM & |
| 3881 | then the callback will be invoked to notify. |
| 3882 | \param toBeSaved - To save the request for future reference |
| 3883 | \return eHalStatus |
| 3884 | ---------------------------------------------------------------------------*/ |
| 3885 | eHalStatus sme_CfgSetStr(tHalHandle hHal, tANI_U32 cfgId, tANI_U8 *pStr, |
| 3886 | tANI_U32 length, tCcmCfgSetCallback callback, |
| 3887 | eAniBoolean toBeSaved) |
| 3888 | { |
| 3889 | return(ccmCfgSetStr(hHal, cfgId, pStr, length, callback, toBeSaved)); |
| 3890 | } |
| 3891 | |
| 3892 | /* --------------------------------------------------------------------------- |
Sandeep Puligilla | a3e7695 | 2014-06-23 15:53:11 +0530 | [diff] [blame] | 3893 | \fn sme_GetModifyProfileFields |
| 3894 | \brief HDD or SME - QOS calls this function to get the current values of |
| 3895 | connected profile fields, changing which can cause reassoc. |
| 3896 | This function must be called after CFG is downloaded and STA is in connected |
| 3897 | state. Also, make sure to call this function to get the current profile |
| 3898 | fields before calling the reassoc. So that pModifyProfileFields will have |
| 3899 | all the latest values plus the one(s) has been updated as part of reassoc |
| 3900 | request. |
| 3901 | \param pModifyProfileFields - pointer to the connected profile fields |
| 3902 | changing which can cause reassoc |
| 3903 | |
| 3904 | \return eHalStatus |
| 3905 | -------------------------------------------------------------------------------*/ |
| 3906 | eHalStatus sme_GetModifyProfileFields(tHalHandle hHal, tANI_U8 sessionId, |
| 3907 | tCsrRoamModifyProfileFields * pModifyProfileFields) |
| 3908 | { |
| 3909 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3910 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3911 | |
| 3912 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 3913 | TRACE_CODE_SME_RX_HDD_GET_MODPROFFIELDS, sessionId, 0)); |
| 3914 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3915 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3916 | { |
| 3917 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3918 | { |
| 3919 | status = csrGetModifyProfileFields(pMac, sessionId, pModifyProfileFields); |
| 3920 | } |
| 3921 | else |
| 3922 | { |
| 3923 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3924 | } |
| 3925 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3926 | } |
| 3927 | |
| 3928 | return (status); |
| 3929 | } |
| 3930 | |
| 3931 | /* --------------------------------------------------------------------------- |
Sandeep Puligilla | 332ea91 | 2014-02-04 00:16:24 +0530 | [diff] [blame] | 3932 | \fn sme_HT40StopOBSSScan |
| 3933 | \brief HDD or SME - Command to stop the OBSS scan |
| 3934 | THis is implemented only for debugging purpose. |
| 3935 | As per spec while operating in 2.4GHz OBSS scan shouldnt be stopped. |
| 3936 | \param sessionId - sessionId |
| 3937 | changing which can cause reassoc |
| 3938 | |
| 3939 | \return eHalStatus |
| 3940 | -------------------------------------------------------------------------------*/ |
| 3941 | eHalStatus sme_HT40StopOBSSScan(tHalHandle hHal, tANI_U8 sessionId) |
| 3942 | { |
| 3943 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3944 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3945 | |
| 3946 | smsLog(pMac, LOG2, FL("enter")); |
| 3947 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3948 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3949 | { |
| 3950 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3951 | { |
| 3952 | csrHT40StopOBSSScan( pMac, sessionId ); |
| 3953 | } |
| 3954 | else |
| 3955 | { |
| 3956 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 3957 | "%s: Invalid session sessionId %d", __func__,sessionId); |
| 3958 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3959 | } |
| 3960 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3961 | } |
| 3962 | return (status); |
| 3963 | } |
| 3964 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3965 | /*-------------------------------------------------------------------------- |
| 3966 | \fn sme_SetConfigPowerSave |
| 3967 | \brief Wrapper fn to change power save configuration in SME (PMC) module. |
| 3968 | For BMPS related configuration, this function also updates the CFG |
| 3969 | and sends a message to FW to pick up the new values. Note: Calling |
| 3970 | this function only updates the configuration and does not enable |
| 3971 | the specified power save mode. |
| 3972 | \param hHal - The handle returned by macOpen. |
| 3973 | \param psMode - Power Saving mode being modified |
| 3974 | \param pConfigParams - a pointer to a caller allocated object of type |
| 3975 | tPmcSmpsConfigParams or tPmcBmpsConfigParams or tPmcImpsConfigParams |
| 3976 | \return eHalStatus |
| 3977 | --------------------------------------------------------------------------*/ |
| 3978 | eHalStatus sme_SetConfigPowerSave(tHalHandle hHal, tPmcPowerSavingMode psMode, |
| 3979 | void *pConfigParams) |
| 3980 | { |
| 3981 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3982 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3983 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3984 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3985 | TRACE_CODE_SME_RX_HDD_SET_CONFIG_PWRSAVE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3986 | if (NULL == pConfigParams ) { |
| 3987 | smsLog( pMac, LOGE, "Empty config param structure for PMC, " |
| 3988 | "nothing to update"); |
| 3989 | return eHAL_STATUS_FAILURE; |
| 3990 | } |
| 3991 | |
| 3992 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3993 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3994 | { |
| 3995 | status = pmcSetConfigPowerSave(hHal, psMode, pConfigParams); |
| 3996 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3997 | } |
| 3998 | |
| 3999 | return (status); |
| 4000 | } |
| 4001 | |
| 4002 | /*-------------------------------------------------------------------------- |
| 4003 | \fn sme_GetConfigPowerSave |
| 4004 | \brief Wrapper fn to retrieve power save configuration in SME (PMC) module |
| 4005 | \param hHal - The handle returned by macOpen. |
| 4006 | \param psMode - Power Saving mode |
| 4007 | \param pConfigParams - a pointer to a caller allocated object of type |
| 4008 | tPmcSmpsConfigParams or tPmcBmpsConfigParams or tPmcImpsConfigParams |
| 4009 | \return eHalStatus |
| 4010 | --------------------------------------------------------------------------*/ |
| 4011 | eHalStatus sme_GetConfigPowerSave(tHalHandle hHal, tPmcPowerSavingMode psMode, |
| 4012 | void *pConfigParams) |
| 4013 | { |
| 4014 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4015 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4016 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4017 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4018 | TRACE_CODE_SME_RX_HDD_GET_CONFIG_PWRSAVE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4019 | if (NULL == pConfigParams ) { |
| 4020 | smsLog( pMac, LOGE, "Empty config param structure for PMC, " |
| 4021 | "nothing to update"); |
| 4022 | return eHAL_STATUS_FAILURE; |
| 4023 | } |
| 4024 | |
| 4025 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4026 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4027 | { |
| 4028 | status = pmcGetConfigPowerSave(hHal, psMode, pConfigParams); |
| 4029 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4030 | } |
| 4031 | |
| 4032 | return (status); |
| 4033 | } |
| 4034 | |
| 4035 | /* --------------------------------------------------------------------------- |
| 4036 | \fn sme_SignalPowerEvent |
| 4037 | \brief Signals to PMC that a power event has occurred. Used for putting |
| 4038 | the chip into deep sleep mode. |
| 4039 | \param hHal - The handle returned by macOpen. |
| 4040 | \param event - the event that has occurred |
| 4041 | \return eHalStatus |
| 4042 | ---------------------------------------------------------------------------*/ |
| 4043 | eHalStatus sme_SignalPowerEvent (tHalHandle hHal, tPmcPowerEvent event) |
| 4044 | { |
| 4045 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4046 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4047 | |
| 4048 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4049 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4050 | { |
| 4051 | status = pmcSignalPowerEvent(hHal, event); |
| 4052 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4053 | } |
| 4054 | |
| 4055 | return (status); |
| 4056 | } |
| 4057 | |
| 4058 | /* --------------------------------------------------------------------------- |
| 4059 | \fn sme_EnablePowerSave |
| 4060 | \brief Enables one of the power saving modes. |
| 4061 | \param hHal - The handle returned by macOpen. |
| 4062 | \param psMode - The power saving mode to enable. If BMPS mode is enabled |
| 4063 | while the chip is operating in Full Power, PMC will start |
| 4064 | a timer that will try to put the chip in BMPS mode after |
| 4065 | expiry. |
| 4066 | \return eHalStatus |
| 4067 | ---------------------------------------------------------------------------*/ |
| 4068 | eHalStatus sme_EnablePowerSave (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 4069 | { |
| 4070 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4071 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4072 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4073 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4074 | TRACE_CODE_SME_RX_HDD_ENABLE_PWRSAVE, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4075 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4076 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4077 | { |
| 4078 | status = pmcEnablePowerSave(hHal, psMode); |
| 4079 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4080 | } |
| 4081 | |
| 4082 | return (status); |
| 4083 | } |
| 4084 | |
| 4085 | /* --------------------------------------------------------------------------- |
| 4086 | \fn sme_DisablePowerSave |
| 4087 | \brief Disables one of the power saving modes. |
| 4088 | \param hHal - The handle returned by macOpen. |
| 4089 | \param psMode - The power saving mode to disable. Disabling does not imply |
| 4090 | that device will be brought out of the current PS mode. This |
| 4091 | is purely a configuration API. |
| 4092 | \return eHalStatus |
| 4093 | ---------------------------------------------------------------------------*/ |
| 4094 | eHalStatus sme_DisablePowerSave (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 4095 | { |
| 4096 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4097 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4098 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4099 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4100 | TRACE_CODE_SME_RX_HDD_DISABLE_PWRSAVE, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4101 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4102 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4103 | { |
| 4104 | status = pmcDisablePowerSave(hHal, psMode); |
| 4105 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4106 | } |
| 4107 | |
| 4108 | return (status); |
| 4109 | } |
| 4110 | |
| 4111 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 69b3418 | 2013-01-16 08:51:40 +0530 | [diff] [blame] | 4112 | + \fn sme_SetHostPowerSave |
| 4113 | + \brief Enables BMPS logic to be controlled by User level apps |
| 4114 | + \param hHal - The handle returned by macOpen. |
| 4115 | + \param psMode - The power saving mode to disable. Disabling does not imply |
| 4116 | + that device will be brought out of the current PS mode. This |
| 4117 | + is purely a configuration API. |
| 4118 | + \return eHalStatus |
| 4119 | + ---------------------------------------------------------------------------*/ |
| 4120 | eHalStatus sme_SetHostPowerSave (tHalHandle hHal, v_BOOL_t psMode) |
| 4121 | { |
| 4122 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4123 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4124 | |
| 4125 | pMac->pmc.isHostPsEn = psMode; |
| 4126 | |
| 4127 | return (status); |
| 4128 | } |
| 4129 | |
| 4130 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4131 | \fn sme_StartAutoBmpsTimer |
| 4132 | \brief Starts a timer that periodically polls all the registered |
| 4133 | module for entry into Bmps mode. This timer is started only if BMPS is |
| 4134 | enabled and whenever the device is in full power. |
| 4135 | \param hHal - The handle returned by macOpen. |
| 4136 | \return eHalStatus |
| 4137 | ---------------------------------------------------------------------------*/ |
| 4138 | eHalStatus sme_StartAutoBmpsTimer ( tHalHandle hHal) |
| 4139 | { |
| 4140 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4141 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4142 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4143 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4144 | TRACE_CODE_SME_RX_HDD_START_AUTO_BMPSTIMER, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4145 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4146 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4147 | { |
| 4148 | status = pmcStartAutoBmpsTimer(hHal); |
| 4149 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4150 | } |
| 4151 | |
| 4152 | return (status); |
| 4153 | } |
| 4154 | /* --------------------------------------------------------------------------- |
| 4155 | \fn sme_StopAutoBmpsTimer |
| 4156 | \brief Stops the Auto BMPS Timer that was started using sme_startAutoBmpsTimer |
| 4157 | Stopping the timer does not cause a device state change. Only the timer |
| 4158 | is stopped. If "Full Power" is desired, use the sme_RequestFullPower API |
| 4159 | \param hHal - The handle returned by macOpen. |
| 4160 | \return eHalStatus |
| 4161 | ---------------------------------------------------------------------------*/ |
| 4162 | eHalStatus sme_StopAutoBmpsTimer ( tHalHandle hHal) |
| 4163 | { |
| 4164 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4165 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4166 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4167 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4168 | TRACE_CODE_SME_RX_HDD_STOP_AUTO_BMPSTIMER, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4169 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4170 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4171 | { |
| 4172 | status = pmcStopAutoBmpsTimer(hHal); |
| 4173 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4174 | } |
| 4175 | |
| 4176 | return (status); |
| 4177 | } |
| 4178 | /* --------------------------------------------------------------------------- |
| 4179 | \fn sme_QueryPowerState |
| 4180 | \brief Returns the current power state of the device. |
| 4181 | \param hHal - The handle returned by macOpen. |
| 4182 | \param pPowerState - pointer to location to return power state (LOW or HIGH) |
| 4183 | \param pSwWlanSwitchState - ptr to location to return SW WLAN Switch state |
| 4184 | \return eHalStatus |
| 4185 | ---------------------------------------------------------------------------*/ |
| 4186 | eHalStatus sme_QueryPowerState ( |
| 4187 | tHalHandle hHal, |
| 4188 | tPmcPowerState *pPowerState, |
| 4189 | tPmcSwitchState *pSwWlanSwitchState) |
| 4190 | { |
| 4191 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4192 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4193 | |
| 4194 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4195 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4196 | { |
| 4197 | status = pmcQueryPowerState (hHal, pPowerState, NULL, pSwWlanSwitchState); |
| 4198 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4199 | } |
| 4200 | |
| 4201 | return (status); |
| 4202 | } |
| 4203 | |
| 4204 | /* --------------------------------------------------------------------------- |
| 4205 | \fn sme_IsPowerSaveEnabled |
| 4206 | \brief Checks if the device is able to enter a particular power save mode |
| 4207 | This does not imply that the device is in a particular PS mode |
| 4208 | \param hHal - The handle returned by macOpen. |
| 4209 | \param psMode - the power saving mode |
| 4210 | \return eHalStatus |
| 4211 | ---------------------------------------------------------------------------*/ |
| 4212 | tANI_BOOLEAN sme_IsPowerSaveEnabled (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 4213 | { |
| 4214 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4215 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4216 | tANI_BOOLEAN result = false; |
| 4217 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4218 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4219 | TRACE_CODE_SME_RX_HDD_IS_PWRSAVE_ENABLED, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4220 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4221 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4222 | { |
| 4223 | result = pmcIsPowerSaveEnabled(hHal, psMode); |
| 4224 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4225 | return result; |
| 4226 | } |
| 4227 | |
| 4228 | return false; |
| 4229 | } |
| 4230 | |
| 4231 | /* --------------------------------------------------------------------------- |
| 4232 | \fn sme_RequestFullPower |
| 4233 | \brief Request that the device be brought to full power state. When the |
| 4234 | device enters Full Power PMC will start a BMPS timer if BMPS PS mode |
| 4235 | is enabled. On timer expiry PMC will attempt to put the device in |
| 4236 | BMPS mode if following holds true: |
| 4237 | - BMPS mode is enabled |
| 4238 | - Polling of all modules through the Power Save Check routine passes |
| 4239 | - STA is associated to an access point |
| 4240 | \param hHal - The handle returned by macOpen. |
| 4241 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4242 | \return eHalStatus - status |
| 4243 | eHAL_STATUS_SUCCESS - device brought to full power state |
| 4244 | eHAL_STATUS_FAILURE - device cannot be brought to full power state |
| 4245 | eHAL_STATUS_PMC_PENDING - device is being brought to full power state, |
| 4246 | ---------------------------------------------------------------------------*/ |
| 4247 | eHalStatus sme_RequestFullPower ( |
| 4248 | tHalHandle hHal, |
| 4249 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4250 | void *callbackContext, |
| 4251 | tRequestFullPowerReason fullPowerReason) |
| 4252 | { |
| 4253 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4254 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4255 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4256 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4257 | TRACE_CODE_SME_RX_HDD_REQUEST_FULLPOWER, NO_SESSION, fullPowerReason)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4258 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4259 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4260 | { |
| 4261 | status = pmcRequestFullPower(hHal, callbackRoutine, callbackContext, fullPowerReason); |
| 4262 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4263 | } |
| 4264 | |
| 4265 | return (status); |
| 4266 | } |
| 4267 | |
| 4268 | /* --------------------------------------------------------------------------- |
| 4269 | \fn sme_RequestBmps |
| 4270 | \brief Request that the device be put in BMPS state. Request will be |
| 4271 | accepted only if BMPS mode is enabled and power save check routine |
| 4272 | passes. |
| 4273 | \param hHal - The handle returned by macOpen. |
| 4274 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4275 | \return eHalStatus |
| 4276 | eHAL_STATUS_SUCCESS - device is in BMPS state |
| 4277 | eHAL_STATUS_FAILURE - device cannot be brought to BMPS state |
| 4278 | eHAL_STATUS_PMC_PENDING - device is being brought to BMPS state |
| 4279 | ---------------------------------------------------------------------------*/ |
| 4280 | eHalStatus sme_RequestBmps ( |
| 4281 | tHalHandle hHal, |
| 4282 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4283 | void *callbackContext) |
| 4284 | { |
| 4285 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4286 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4287 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4288 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4289 | TRACE_CODE_SME_RX_HDD_REQUEST_BMPS, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4290 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4291 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4292 | { |
| 4293 | status = pmcRequestBmps(hHal, callbackRoutine, callbackContext); |
| 4294 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4295 | } |
| 4296 | |
| 4297 | return (status); |
| 4298 | } |
| 4299 | |
| 4300 | |
| 4301 | /* --------------------------------------------------------------------------- |
| 4302 | \fn sme_SetDHCPTillPowerActiveFlag |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4303 | \brief Sets/Clears DHCP related flag in PMC to disable/enable auto BMPS |
| 4304 | entry by PMC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4305 | \param hHal - The handle returned by macOpen. |
| 4306 | ---------------------------------------------------------------------------*/ |
| 4307 | void sme_SetDHCPTillPowerActiveFlag(tHalHandle hHal, tANI_U8 flag) |
| 4308 | { |
| 4309 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4310 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4311 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4312 | TRACE_CODE_SME_RX_HDD_SET_DHCP_FLAG, NO_SESSION, flag)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4313 | // Set/Clear the DHCP flag which will disable/enable auto BMPS entery by PMC |
| 4314 | pMac->pmc.remainInPowerActiveTillDHCP = flag; |
| 4315 | } |
| 4316 | |
| 4317 | |
| 4318 | /* --------------------------------------------------------------------------- |
| 4319 | \fn sme_StartUapsd |
| 4320 | \brief Request that the device be put in UAPSD state. If the device is in |
| 4321 | Full Power it will be put in BMPS mode first and then into UAPSD |
| 4322 | mode. |
| 4323 | \param hHal - The handle returned by macOpen. |
| 4324 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4325 | eHAL_STATUS_SUCCESS - device is in UAPSD state |
| 4326 | eHAL_STATUS_FAILURE - device cannot be brought to UAPSD state |
| 4327 | eHAL_STATUS_PMC_PENDING - device is being brought to UAPSD state |
| 4328 | eHAL_STATUS_PMC_DISABLED - UAPSD is disabled or BMPS mode is disabled |
| 4329 | \return eHalStatus |
| 4330 | ---------------------------------------------------------------------------*/ |
| 4331 | eHalStatus sme_StartUapsd ( |
| 4332 | tHalHandle hHal, |
| 4333 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4334 | void *callbackContext) |
| 4335 | { |
| 4336 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4337 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4338 | |
| 4339 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4340 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4341 | { |
| 4342 | status = pmcStartUapsd(hHal, callbackRoutine, callbackContext); |
| 4343 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4344 | } |
| 4345 | |
| 4346 | return (status); |
| 4347 | } |
| 4348 | |
| 4349 | /* --------------------------------------------------------------------------- |
| 4350 | \fn sme_StopUapsd |
| 4351 | \brief Request that the device be put out of UAPSD state. Device will be |
| 4352 | put in in BMPS state after stop UAPSD completes. |
| 4353 | \param hHal - The handle returned by macOpen. |
| 4354 | \return eHalStatus |
| 4355 | eHAL_STATUS_SUCCESS - device is put out of UAPSD and back in BMPS state |
| 4356 | eHAL_STATUS_FAILURE - device cannot be brought out of UAPSD state |
| 4357 | ---------------------------------------------------------------------------*/ |
| 4358 | eHalStatus sme_StopUapsd (tHalHandle hHal) |
| 4359 | { |
| 4360 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4361 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4362 | |
| 4363 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4364 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4365 | { |
| 4366 | status = pmcStopUapsd(hHal); |
| 4367 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4368 | } |
| 4369 | |
| 4370 | return (status); |
| 4371 | } |
| 4372 | |
| 4373 | /* --------------------------------------------------------------------------- |
| 4374 | \fn sme_RequestStandby |
| 4375 | \brief Request that the device be put in standby. It is HDD's responsibility |
| 4376 | to bring the chip to full power and do a disassoc before calling |
| 4377 | this API. |
| 4378 | \param hHal - The handle returned by macOpen. |
| 4379 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4380 | \return eHalStatus |
| 4381 | eHAL_STATUS_SUCCESS - device is in Standby mode |
| 4382 | eHAL_STATUS_FAILURE - device cannot be put in standby mode |
| 4383 | eHAL_STATUS_PMC_PENDING - device is being put in standby mode |
| 4384 | ---------------------------------------------------------------------------*/ |
| 4385 | eHalStatus sme_RequestStandby ( |
| 4386 | tHalHandle hHal, |
| 4387 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4388 | void *callbackContext) |
| 4389 | { |
| 4390 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4391 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4392 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4393 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4394 | TRACE_CODE_SME_RX_HDD_REQUEST_STANDBY, NO_SESSION, 0)); |
Agarwal Ashish | e3cca2a | 2013-07-21 03:01:48 +0530 | [diff] [blame] | 4395 | smsLog( pMac, LOG1, FL(" called") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4396 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4397 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4398 | { |
| 4399 | status = pmcRequestStandby(hHal, callbackRoutine, callbackContext); |
| 4400 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4401 | } |
| 4402 | |
| 4403 | return (status); |
| 4404 | } |
| 4405 | |
| 4406 | /* --------------------------------------------------------------------------- |
| 4407 | \fn sme_RegisterPowerSaveCheck |
| 4408 | \brief Register a power save check routine that is called whenever |
| 4409 | the device is about to enter one of the power save modes. |
| 4410 | \param hHal - The handle returned by macOpen. |
| 4411 | \param checkRoutine - Power save check routine to be registered |
| 4412 | \return eHalStatus |
| 4413 | eHAL_STATUS_SUCCESS - successfully registered |
| 4414 | eHAL_STATUS_FAILURE - not successfully registered |
| 4415 | ---------------------------------------------------------------------------*/ |
| 4416 | eHalStatus sme_RegisterPowerSaveCheck ( |
| 4417 | tHalHandle hHal, |
| 4418 | tANI_BOOLEAN (*checkRoutine) (void *checkContext), void *checkContext) |
| 4419 | { |
| 4420 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4421 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4422 | |
| 4423 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4424 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4425 | { |
| 4426 | status = pmcRegisterPowerSaveCheck (hHal, checkRoutine, checkContext); |
| 4427 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4428 | } |
| 4429 | |
| 4430 | return (status); |
| 4431 | } |
| 4432 | |
| 4433 | /* --------------------------------------------------------------------------- |
Mihir Shete | fc7ff5b | 2014-01-27 11:30:05 +0530 | [diff] [blame] | 4434 | \fn sme_Register11dScanDoneCallback |
| 4435 | \brief Register a routine of type csrScanCompleteCallback which is |
| 4436 | called whenever an 11d scan is done |
| 4437 | \param hHal - The handle returned by macOpen. |
| 4438 | \param callback - 11d scan complete routine to be registered |
| 4439 | \return eHalStatus |
| 4440 | ---------------------------------------------------------------------------*/ |
| 4441 | eHalStatus sme_Register11dScanDoneCallback ( |
| 4442 | tHalHandle hHal, |
| 4443 | csrScanCompleteCallback callback) |
| 4444 | { |
| 4445 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 4446 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4447 | |
| 4448 | pMac->scan.callback11dScanDone = callback; |
| 4449 | |
| 4450 | return (status); |
| 4451 | } |
| 4452 | |
| 4453 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4454 | \fn sme_DeregisterPowerSaveCheck |
| 4455 | \brief Deregister a power save check routine |
| 4456 | \param hHal - The handle returned by macOpen. |
| 4457 | \param checkRoutine - Power save check routine to be deregistered |
| 4458 | \return eHalStatus |
| 4459 | eHAL_STATUS_SUCCESS - successfully deregistered |
| 4460 | eHAL_STATUS_FAILURE - not successfully deregistered |
| 4461 | ---------------------------------------------------------------------------*/ |
| 4462 | eHalStatus sme_DeregisterPowerSaveCheck ( |
| 4463 | tHalHandle hHal, |
| 4464 | tANI_BOOLEAN (*checkRoutine) (void *checkContext)) |
| 4465 | { |
| 4466 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4467 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4468 | |
| 4469 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4470 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4471 | { |
| 4472 | status = pmcDeregisterPowerSaveCheck (hHal, checkRoutine); |
| 4473 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4474 | } |
| 4475 | |
| 4476 | return (status); |
| 4477 | } |
| 4478 | |
| 4479 | /* --------------------------------------------------------------------------- |
| 4480 | \fn sme_RegisterDeviceStateUpdateInd |
| 4481 | \brief Register a callback routine that is called whenever |
| 4482 | the device enters a new device state (Full Power, BMPS, UAPSD) |
| 4483 | \param hHal - The handle returned by macOpen. |
| 4484 | \param callbackRoutine - Callback routine to be registered |
| 4485 | \param callbackContext - Cookie to be passed back during callback |
| 4486 | \return eHalStatus |
| 4487 | eHAL_STATUS_SUCCESS - successfully registered |
| 4488 | eHAL_STATUS_FAILURE - not successfully registered |
| 4489 | ---------------------------------------------------------------------------*/ |
| 4490 | eHalStatus sme_RegisterDeviceStateUpdateInd ( |
| 4491 | tHalHandle hHal, |
| 4492 | void (*callbackRoutine) (void *callbackContext, tPmcState pmcState), |
| 4493 | void *callbackContext) |
| 4494 | { |
| 4495 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4496 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4497 | |
| 4498 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4499 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4500 | { |
| 4501 | status = pmcRegisterDeviceStateUpdateInd (hHal, callbackRoutine, callbackContext); |
| 4502 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4503 | } |
| 4504 | |
| 4505 | return (status); |
| 4506 | } |
| 4507 | |
| 4508 | /* --------------------------------------------------------------------------- |
| 4509 | \fn sme_DeregisterDeviceStateUpdateInd |
| 4510 | \brief Deregister a routine that was registered for device state changes |
| 4511 | \param hHal - The handle returned by macOpen. |
| 4512 | \param callbackRoutine - Callback routine to be deregistered |
| 4513 | \return eHalStatus |
| 4514 | eHAL_STATUS_SUCCESS - successfully deregistered |
| 4515 | eHAL_STATUS_FAILURE - not successfully deregistered |
| 4516 | ---------------------------------------------------------------------------*/ |
| 4517 | eHalStatus sme_DeregisterDeviceStateUpdateInd ( |
| 4518 | tHalHandle hHal, |
| 4519 | void (*callbackRoutine) (void *callbackContext, tPmcState pmcState)) |
| 4520 | { |
| 4521 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4522 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4523 | |
| 4524 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4525 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4526 | { |
| 4527 | status = pmcDeregisterDeviceStateUpdateInd (hHal, callbackRoutine); |
| 4528 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4529 | } |
| 4530 | |
| 4531 | return (status); |
| 4532 | } |
| 4533 | |
| 4534 | /* --------------------------------------------------------------------------- |
| 4535 | \fn sme_WowlAddBcastPattern |
| 4536 | \brief Add a pattern for Pattern Byte Matching in Wowl mode. Firmware will |
| 4537 | do a pattern match on these patterns when Wowl is enabled during BMPS |
| 4538 | mode. Note that Firmware performs the pattern matching only on |
| 4539 | broadcast frames and while Libra is in BMPS mode. |
| 4540 | \param hHal - The handle returned by macOpen. |
| 4541 | \param pattern - Pattern to be added |
| 4542 | \return eHalStatus |
| 4543 | eHAL_STATUS_FAILURE Cannot add pattern |
| 4544 | eHAL_STATUS_SUCCESS Request accepted. |
| 4545 | ---------------------------------------------------------------------------*/ |
| 4546 | eHalStatus sme_WowlAddBcastPattern ( |
| 4547 | tHalHandle hHal, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4548 | tpSirWowlAddBcastPtrn pattern, |
| 4549 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4550 | { |
| 4551 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4552 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4553 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4554 | TRACE_CODE_SME_RX_HDD_WOWL_ADDBCAST_PATTERN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4555 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4556 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4557 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4558 | status = pmcWowlAddBcastPattern (hHal, pattern, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4559 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4560 | } |
| 4561 | |
| 4562 | return (status); |
| 4563 | } |
| 4564 | |
| 4565 | /* --------------------------------------------------------------------------- |
| 4566 | \fn sme_WowlDelBcastPattern |
| 4567 | \brief Delete a pattern that was added for Pattern Byte Matching. |
| 4568 | \param hHal - The handle returned by macOpen. |
| 4569 | \param pattern - Pattern to be deleted |
| 4570 | \return eHalStatus |
| 4571 | eHAL_STATUS_FAILURE Cannot delete pattern |
| 4572 | eHAL_STATUS_SUCCESS Request accepted. |
| 4573 | ---------------------------------------------------------------------------*/ |
| 4574 | eHalStatus sme_WowlDelBcastPattern ( |
| 4575 | tHalHandle hHal, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4576 | tpSirWowlDelBcastPtrn pattern, |
| 4577 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4578 | { |
| 4579 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4580 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4581 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4582 | TRACE_CODE_SME_RX_HDD_WOWL_DELBCAST_PATTERN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4583 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4584 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4585 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4586 | status = pmcWowlDelBcastPattern (hHal, pattern, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4587 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4588 | } |
| 4589 | |
| 4590 | return (status); |
| 4591 | } |
| 4592 | |
| 4593 | /* --------------------------------------------------------------------------- |
| 4594 | \fn sme_EnterWowl |
| 4595 | \brief This is the SME API exposed to HDD to request enabling of WOWL mode. |
| 4596 | WoWLAN works on top of BMPS mode. If the device is not in BMPS mode, |
| 4597 | SME will will cache the information that WOWL has been enabled and |
| 4598 | attempt to put the device in BMPS. On entry into BMPS, SME will |
| 4599 | enable the WOWL mode. |
| 4600 | Note 1: If we exit BMPS mode (someone requests full power), we |
| 4601 | will NOT resume WOWL when we go back to BMPS again. Request for full |
| 4602 | power (while in WOWL mode) means disable WOWL and go to full power. |
| 4603 | Note 2: Both UAPSD and WOWL work on top of BMPS. On entry into BMPS, SME |
| 4604 | will give priority to UAPSD and enable only UAPSD if both UAPSD and WOWL |
| 4605 | are required. Currently there is no requirement or use case to support |
| 4606 | UAPSD and WOWL at the same time. |
| 4607 | |
| 4608 | \param hHal - The handle returned by macOpen. |
| 4609 | \param enterWowlCallbackRoutine - Callback routine provided by HDD. |
| 4610 | Used for success/failure notification by SME |
| 4611 | \param enterWowlCallbackContext - A cookie passed by HDD, that is passed back to HDD |
| 4612 | at the time of callback. |
| 4613 | \param wakeReasonIndCB - Callback routine provided by HDD. |
| 4614 | Used for Wake Reason Indication by SME |
| 4615 | \param wakeReasonIndCBContext - A cookie passed by HDD, that is passed back to HDD |
| 4616 | at the time of callback. |
| 4617 | \return eHalStatus |
| 4618 | eHAL_STATUS_SUCCESS Device is already in WoWLAN mode |
| 4619 | eHAL_STATUS_FAILURE Device cannot enter WoWLAN mode. |
| 4620 | eHAL_STATUS_PMC_PENDING Request accepted. SME will enable WOWL after |
| 4621 | BMPS mode is entered. |
| 4622 | ---------------------------------------------------------------------------*/ |
| 4623 | eHalStatus sme_EnterWowl ( |
| 4624 | tHalHandle hHal, |
| 4625 | void (*enterWowlCallbackRoutine) (void *callbackContext, eHalStatus status), |
| 4626 | void *enterWowlCallbackContext, |
| 4627 | #ifdef WLAN_WAKEUP_EVENTS |
| 4628 | void (*wakeIndicationCB) (void *callbackContext, tpSirWakeReasonInd pWakeReasonInd), |
| 4629 | void *wakeIndicationCBContext, |
| 4630 | #endif // WLAN_WAKEUP_EVENTS |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4631 | tpSirSmeWowlEnterParams wowlEnterParams, tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4632 | { |
| 4633 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4634 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4635 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4636 | TRACE_CODE_SME_RX_HDD_ENTER_WOWL, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4637 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4638 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4639 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4640 | status = pmcEnterWowl (hHal, enterWowlCallbackRoutine, enterWowlCallbackContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4641 | #ifdef WLAN_WAKEUP_EVENTS |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4642 | wakeIndicationCB, wakeIndicationCBContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4643 | #endif // WLAN_WAKEUP_EVENTS |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4644 | wowlEnterParams, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4645 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4646 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4647 | return (status); |
| 4648 | } |
| 4649 | /* --------------------------------------------------------------------------- |
| 4650 | \fn sme_ExitWowl |
| 4651 | \brief This is the SME API exposed to HDD to request exit from WoWLAN mode. |
| 4652 | SME will initiate exit from WoWLAN mode and device will be put in BMPS |
| 4653 | mode. |
| 4654 | \param hHal - The handle returned by macOpen. |
| 4655 | \return eHalStatus |
| 4656 | eHAL_STATUS_FAILURE Device cannot exit WoWLAN mode. |
| 4657 | eHAL_STATUS_SUCCESS Request accepted to exit WoWLAN mode. |
| 4658 | ---------------------------------------------------------------------------*/ |
c_hpothu | 01484c0 | 2014-05-16 14:05:15 +0530 | [diff] [blame] | 4659 | eHalStatus sme_ExitWowl (tHalHandle hHal, tWowlExitSource wowlExitSrc) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4660 | { |
| 4661 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4662 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4663 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4664 | TRACE_CODE_SME_RX_HDD_EXIT_WOWL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4665 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4666 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4667 | { |
c_hpothu | 01484c0 | 2014-05-16 14:05:15 +0530 | [diff] [blame] | 4668 | status = pmcExitWowl (hHal, wowlExitSrc); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4669 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4670 | } |
| 4671 | |
| 4672 | return (status); |
| 4673 | } |
| 4674 | |
| 4675 | /* --------------------------------------------------------------------------- |
| 4676 | |
| 4677 | \fn sme_RoamSetKey |
| 4678 | |
| 4679 | \brief To set encryption key. This function should be called only when connected |
| 4680 | This is an asynchronous API. |
| 4681 | |
| 4682 | \param pSetKeyInfo - pointer to a caller allocated object of tCsrSetContextInfo |
| 4683 | |
| 4684 | \param pRoamId Upon success return, this is the id caller can use to identify the request in roamcallback |
| 4685 | |
| 4686 | \return eHalStatus SUCCESS Roam callback will be called indicate actually results |
| 4687 | |
| 4688 | FAILURE or RESOURCES The API finished and failed. |
| 4689 | |
| 4690 | -------------------------------------------------------------------------------*/ |
| 4691 | eHalStatus sme_RoamSetKey(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 *pRoamId) |
| 4692 | { |
| 4693 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4694 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4695 | tANI_U32 roamId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4696 | tANI_U32 i; |
| 4697 | tCsrRoamSession *pSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4698 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4699 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4700 | TRACE_CODE_SME_RX_HDD_SET_KEY, sessionId, 0)); |
Jeff Johnson | f89f4b5 | 2013-03-27 10:32:44 -0700 | [diff] [blame] | 4701 | if (pSetKey->keyLength > CSR_MAX_KEY_LEN) |
| 4702 | { |
| 4703 | smsLog(pMac, LOGE, FL("Invalid key length %d"), pSetKey->keyLength); |
| 4704 | return eHAL_STATUS_FAILURE; |
| 4705 | } |
Abhishek Singh | 36abbcb | 2014-03-20 13:04:09 +0530 | [diff] [blame] | 4706 | /*Once Setkey is done, we can go in BMPS*/ |
| 4707 | if(pSetKey->keyLength) |
Abhishek Singh | 65d939e | 2014-04-25 13:33:07 +0530 | [diff] [blame] | 4708 | { |
Abhishek Singh | 36abbcb | 2014-03-20 13:04:09 +0530 | [diff] [blame] | 4709 | pMac->pmc.remainInPowerActiveTillDHCP = FALSE; |
Abhishek Singh | 65d939e | 2014-04-25 13:33:07 +0530 | [diff] [blame] | 4710 | smsLog(pMac, LOG1, FL("Reset remainInPowerActiveTillDHCP" |
| 4711 | " to allow BMPS")); |
| 4712 | } |
Jeff Johnson | f89f4b5 | 2013-03-27 10:32:44 -0700 | [diff] [blame] | 4713 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4714 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4715 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4716 | { |
| 4717 | roamId = GET_NEXT_ROAM_ID(&pMac->roam); |
| 4718 | if(pRoamId) |
| 4719 | { |
| 4720 | *pRoamId = roamId; |
| 4721 | } |
| 4722 | |
Jeff Johnson | f89f4b5 | 2013-03-27 10:32:44 -0700 | [diff] [blame] | 4723 | smsLog(pMac, LOG2, FL("keyLength %d"), pSetKey->keyLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4724 | |
| 4725 | for(i=0; i<pSetKey->keyLength; i++) |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4726 | smsLog(pMac, LOG2, FL("%02x"), pSetKey->Key[i]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4727 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4728 | smsLog(pMac, LOG2, "\n sessionId=%d roamId=%d", sessionId, roamId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4729 | |
| 4730 | pSession = CSR_GET_SESSION(pMac, sessionId); |
| 4731 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4732 | if(!pSession) |
| 4733 | { |
| 4734 | 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] | 4735 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4736 | return eHAL_STATUS_FAILURE; |
| 4737 | } |
| 4738 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4739 | if(CSR_IS_INFRA_AP(&pSession->connectedProfile)) |
| 4740 | { |
| 4741 | if(pSetKey->keyDirection == eSIR_TX_DEFAULT) |
| 4742 | { |
| 4743 | if ( ( eCSR_ENCRYPT_TYPE_WEP40 == pSetKey->encType ) || |
| 4744 | ( eCSR_ENCRYPT_TYPE_WEP40_STATICKEY == pSetKey->encType )) |
| 4745 | { |
| 4746 | pSession->pCurRoamProfile->negotiatedUCEncryptionType = eCSR_ENCRYPT_TYPE_WEP40_STATICKEY; |
| 4747 | } |
| 4748 | if ( ( eCSR_ENCRYPT_TYPE_WEP104 == pSetKey->encType ) || |
| 4749 | ( eCSR_ENCRYPT_TYPE_WEP104_STATICKEY == pSetKey->encType )) |
| 4750 | { |
| 4751 | pSession->pCurRoamProfile->negotiatedUCEncryptionType = eCSR_ENCRYPT_TYPE_WEP104_STATICKEY; |
| 4752 | } |
| 4753 | } |
| 4754 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4755 | |
| 4756 | status = csrRoamSetKey ( pMac, sessionId, pSetKey, roamId ); |
| 4757 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4758 | } |
Mukul Sharma | be91e2f | 2014-06-29 22:09:20 +0530 | [diff] [blame] | 4759 | #ifdef DEBUG_ROAM_DELAY |
| 4760 | //Store sent PTK key time |
| 4761 | if(pSetKey->keyDirection == eSIR_TX_RX) |
| 4762 | { |
| 4763 | vos_record_roam_event(e_HDD_SET_PTK_REQ, NULL, 0); |
| 4764 | } |
| 4765 | else if(pSetKey->keyDirection == eSIR_RX_ONLY) |
| 4766 | { |
| 4767 | vos_record_roam_event(e_HDD_SET_GTK_REQ, NULL, 0); |
| 4768 | } |
| 4769 | else |
| 4770 | { |
| 4771 | return (status); |
| 4772 | } |
| 4773 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4774 | |
| 4775 | return (status); |
| 4776 | } |
| 4777 | |
| 4778 | |
| 4779 | /* --------------------------------------------------------------------------- |
| 4780 | |
| 4781 | \fn sme_RoamRemoveKey |
| 4782 | |
| 4783 | \brief To set encryption key. This is an asynchronous API. |
| 4784 | |
| 4785 | \param pRemoveKey - pointer to a caller allocated object of tCsrRoamRemoveKey |
| 4786 | |
| 4787 | \param pRoamId Upon success return, this is the id caller can use to identify the request in roamcallback |
| 4788 | |
| 4789 | \return eHalStatus SUCCESS Roam callback will be called indicate actually results |
| 4790 | |
| 4791 | FAILURE or RESOURCES The API finished and failed. |
| 4792 | |
| 4793 | -------------------------------------------------------------------------------*/ |
| 4794 | eHalStatus sme_RoamRemoveKey(tHalHandle hHal, tANI_U8 sessionId, |
| 4795 | tCsrRoamRemoveKey *pRemoveKey, tANI_U32 *pRoamId) |
| 4796 | { |
| 4797 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4798 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4799 | tANI_U32 roamId; |
| 4800 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4801 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4802 | TRACE_CODE_SME_RX_HDD_REMOVE_KEY, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4803 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4804 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4805 | { |
| 4806 | roamId = GET_NEXT_ROAM_ID(&pMac->roam); |
| 4807 | if(pRoamId) |
| 4808 | { |
| 4809 | *pRoamId = roamId; |
| 4810 | } |
| 4811 | status = csrRoamIssueRemoveKeyCommand( pMac, sessionId, pRemoveKey, roamId ); |
| 4812 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4813 | } |
| 4814 | |
| 4815 | return (status); |
| 4816 | } |
| 4817 | |
| 4818 | /* --------------------------------------------------------------------------- |
| 4819 | \fn sme_GetRssi |
| 4820 | \brief a wrapper function that client calls to register a callback to get RSSI |
| 4821 | |
| 4822 | \param callback - SME sends back the requested stats using the callback |
| 4823 | \param staId - The station ID for which the stats is requested for |
| 4824 | \param pContext - user context to be passed back along with the callback |
| 4825 | \param pVosContext - vos context |
| 4826 | \return eHalStatus |
| 4827 | ---------------------------------------------------------------------------*/ |
| 4828 | eHalStatus sme_GetRssi(tHalHandle hHal, |
| 4829 | tCsrRssiCallback callback, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4830 | tANI_U8 staId, tCsrBssid bssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4831 | void *pContext, void* pVosContext) |
| 4832 | { |
| 4833 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4834 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4835 | |
| 4836 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4837 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4838 | { |
| 4839 | status = csrGetRssi( pMac, callback, |
| 4840 | staId, bssId, pContext, pVosContext); |
| 4841 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4842 | } |
| 4843 | return (status); |
| 4844 | } |
Madan Mohan Koyyalamudi | d9383fd | 2013-08-13 09:27:30 +0530 | [diff] [blame] | 4845 | |
| 4846 | /* --------------------------------------------------------------------------- |
| 4847 | \fn sme_GetSnr |
| 4848 | \brief a wrapper function that client calls to register a callback to |
| 4849 | get SNR |
| 4850 | |
| 4851 | \param callback - SME sends back the requested stats using the callback |
| 4852 | \param staId - The station ID for which the stats is requested for |
| 4853 | \param pContext - user context to be passed back along with the callback |
| 4854 | \param pVosContext - vos context |
| 4855 | \return eHalStatus |
| 4856 | ---------------------------------------------------------------------------*/ |
| 4857 | eHalStatus sme_GetSnr(tHalHandle hHal, |
| 4858 | tCsrSnrCallback callback, |
| 4859 | tANI_U8 staId, tCsrBssid bssId, |
| 4860 | void *pContext) |
| 4861 | { |
| 4862 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4863 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4864 | |
| 4865 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4866 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4867 | { |
| 4868 | status = csrGetSnr(pMac, callback, |
| 4869 | staId, bssId, pContext); |
| 4870 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4871 | } |
| 4872 | return status; |
| 4873 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4874 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 4875 | /* --------------------------------------------------------------------------- |
| 4876 | \fn sme_GetRoamRssi |
| 4877 | \brief a wrapper function that client calls to register a callback to get Roam RSSI |
| 4878 | |
| 4879 | \param callback - SME sends back the requested stats using the callback |
| 4880 | \param staId - The station ID for which the stats is requested for |
| 4881 | \param pContext - user context to be passed back along with the callback |
| 4882 | \param pVosContext - vos context |
| 4883 | \return eHalStatus |
| 4884 | ---------------------------------------------------------------------------*/ |
| 4885 | eHalStatus sme_GetRoamRssi(tHalHandle hHal, |
| 4886 | tCsrRssiCallback callback, |
| 4887 | tANI_U8 staId, tCsrBssid bssId, |
| 4888 | void *pContext, void* pVosContext) |
| 4889 | { |
| 4890 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4891 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4892 | |
| 4893 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4894 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4895 | { |
| 4896 | status = csrGetRoamRssi( pMac, callback, |
| 4897 | staId, bssId, pContext, pVosContext); |
| 4898 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4899 | } |
| 4900 | return (status); |
| 4901 | } |
| 4902 | #endif |
| 4903 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4904 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4905 | /* --------------------------------------------------------------------------- |
| 4906 | \fn sme_GetTsmStats |
| 4907 | \brief a wrapper function that client calls to register a callback to get TSM Stats |
| 4908 | |
| 4909 | \param callback - SME sends back the requested stats using the callback |
| 4910 | \param staId - The station ID for which the stats is requested for |
| 4911 | \param pContext - user context to be passed back along with the callback |
| 4912 | \param pVosContext - vos context |
| 4913 | \return eHalStatus |
| 4914 | ---------------------------------------------------------------------------*/ |
| 4915 | eHalStatus sme_GetTsmStats(tHalHandle hHal, |
| 4916 | tCsrTsmStatsCallback callback, |
| 4917 | tANI_U8 staId, tCsrBssid bssId, |
| 4918 | void *pContext, void* pVosContext, tANI_U8 tid) |
| 4919 | { |
| 4920 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4921 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4922 | |
| 4923 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4924 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4925 | { |
| 4926 | status = csrGetTsmStats( pMac, callback, |
| 4927 | staId, bssId, pContext, pVosContext, tid); |
| 4928 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4929 | } |
| 4930 | return (status); |
| 4931 | } |
| 4932 | #endif |
| 4933 | |
| 4934 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4935 | /* --------------------------------------------------------------------------- |
| 4936 | \fn sme_GetStatistics |
| 4937 | \brief a wrapper function that client calls to register a callback to get |
| 4938 | different PHY level statistics from CSR. |
| 4939 | |
| 4940 | \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc |
| 4941 | \param statsMask - The different category/categories of stats requester is looking for |
| 4942 | \param callback - SME sends back the requested stats using the callback |
| 4943 | \param periodicity - If requester needs periodic update in millisec, 0 means |
| 4944 | it's an one time request |
| 4945 | \param cache - If requester is happy with cached stats |
| 4946 | \param staId - The station ID for which the stats is requested for |
| 4947 | \param pContext - user context to be passed back along with the callback |
| 4948 | \return eHalStatus |
| 4949 | ---------------------------------------------------------------------------*/ |
| 4950 | eHalStatus sme_GetStatistics(tHalHandle hHal, eCsrStatsRequesterType requesterId, |
| 4951 | tANI_U32 statsMask, |
| 4952 | tCsrStatsCallback callback, |
| 4953 | tANI_U32 periodicity, tANI_BOOLEAN cache, |
| 4954 | tANI_U8 staId, void *pContext) |
| 4955 | { |
| 4956 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4957 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4958 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4959 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4960 | TRACE_CODE_SME_RX_HDD_GET_STATS, NO_SESSION, periodicity)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4961 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4962 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4963 | { |
| 4964 | status = csrGetStatistics( pMac, requesterId , statsMask, callback, |
| 4965 | periodicity, cache, staId, pContext); |
| 4966 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4967 | } |
| 4968 | |
| 4969 | return (status); |
| 4970 | |
| 4971 | } |
| 4972 | |
| 4973 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 8af9b40 | 2013-07-11 14:59:10 +0530 | [diff] [blame] | 4974 | \fn smeGetTLSTAState |
| 4975 | \helper function to get the TL STA State whenever the function is called. |
| 4976 | |
| 4977 | \param staId - The staID to be passed to the TL |
| 4978 | to get the relevant TL STA State |
| 4979 | \return the state as tANI_U16 |
| 4980 | ---------------------------------------------------------------------------*/ |
| 4981 | tANI_U16 smeGetTLSTAState(tHalHandle hHal, tANI_U8 staId) |
| 4982 | { |
| 4983 | tANI_U16 tlSTAState = TL_INIT_STATE; |
| 4984 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4985 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4986 | |
| 4987 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4988 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4989 | { |
| 4990 | tlSTAState = csrGetTLSTAState( pMac, staId); |
| 4991 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4992 | } |
| 4993 | |
| 4994 | return tlSTAState; |
| 4995 | } |
| 4996 | |
| 4997 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4998 | |
| 4999 | \fn sme_GetCountryCode |
| 5000 | |
| 5001 | \brief To return the current country code. If no country code is applied, default country code is |
| 5002 | used to fill the buffer. |
| 5003 | If 11d supported is turned off, an error is return and the last applied/default country code is used. |
| 5004 | This is a synchronous API. |
| 5005 | |
| 5006 | \param pBuf - pointer to a caller allocated buffer for returned country code. |
| 5007 | |
| 5008 | \param pbLen For input, this parameter indicates how big is the buffer. |
| 5009 | Upon return, this parameter has the number of bytes for country. If pBuf |
| 5010 | doesn't have enough space, this function returns |
| 5011 | fail status and this parameter contains the number that is needed. |
| 5012 | |
| 5013 | \return eHalStatus SUCCESS. |
| 5014 | |
| 5015 | FAILURE or RESOURCES The API finished and failed. |
| 5016 | |
| 5017 | -------------------------------------------------------------------------------*/ |
| 5018 | eHalStatus sme_GetCountryCode(tHalHandle hHal, tANI_U8 *pBuf, tANI_U8 *pbLen) |
| 5019 | { |
| 5020 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5021 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5022 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5023 | TRACE_CODE_SME_RX_HDD_GET_CNTRYCODE, NO_SESSION, 0)); |
| 5024 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5025 | return ( csrGetCountryCode( pMac, pBuf, pbLen ) ); |
| 5026 | } |
| 5027 | |
| 5028 | |
| 5029 | /* --------------------------------------------------------------------------- |
| 5030 | |
| 5031 | \fn sme_SetCountryCode |
| 5032 | |
| 5033 | \brief To change the current/default country code. |
| 5034 | If 11d supported is turned off, an error is return. |
| 5035 | This is a synchronous API. |
| 5036 | |
| 5037 | \param pCountry - pointer to a caller allocated buffer for the country code. |
| 5038 | |
| 5039 | \param pfRestartNeeded A pointer to caller allocated memory, upon successful return, it indicates |
| 5040 | whether a reset is required. |
| 5041 | |
| 5042 | \return eHalStatus SUCCESS. |
| 5043 | |
| 5044 | FAILURE or RESOURCES The API finished and failed. |
| 5045 | |
| 5046 | -------------------------------------------------------------------------------*/ |
| 5047 | eHalStatus sme_SetCountryCode(tHalHandle hHal, tANI_U8 *pCountry, tANI_BOOLEAN *pfRestartNeeded) |
| 5048 | { |
| 5049 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5050 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5051 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5052 | TRACE_CODE_SME_RX_HDD_SET_CNTRYCODE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5053 | return ( csrSetCountryCode( pMac, pCountry, pfRestartNeeded ) ); |
| 5054 | } |
| 5055 | |
| 5056 | |
| 5057 | /* --------------------------------------------------------------------------- |
| 5058 | \fn sme_ResetCountryCodeInformation |
| 5059 | \brief this function is to reset the country code current being used back to EEPROM default |
| 5060 | this includes channel list and power setting. This is a synchronous API. |
| 5061 | \param pfRestartNeeded - pointer to a caller allocated space. Upon successful return, it indicates whether |
| 5062 | a restart is needed to apply the change |
| 5063 | \return eHalStatus |
| 5064 | -------------------------------------------------------------------------------*/ |
| 5065 | eHalStatus sme_ResetCountryCodeInformation(tHalHandle hHal, tANI_BOOLEAN *pfRestartNeeded) |
| 5066 | { |
| 5067 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5068 | |
| 5069 | return ( csrResetCountryCodeInformation( pMac, pfRestartNeeded ) ); |
| 5070 | } |
| 5071 | |
| 5072 | |
| 5073 | /* --------------------------------------------------------------------------- |
| 5074 | \fn sme_GetSupportedCountryCode |
| 5075 | \brief this function is to get a list of the country code current being supported |
| 5076 | \param pBuf - Caller allocated buffer with at least 3 bytes, upon success return, |
| 5077 | this has the country code list. 3 bytes for each country code. This may be NULL if |
| 5078 | caller wants to know the needed byte count. |
| 5079 | \param pbLen - Caller allocated, as input, it indicates the length of pBuf. Upon success return, |
| 5080 | this contains the length of the data in pBuf. If pbuf is NULL, as input, *pbLen should be 0. |
| 5081 | \return eHalStatus |
| 5082 | -------------------------------------------------------------------------------*/ |
| 5083 | eHalStatus sme_GetSupportedCountryCode(tHalHandle hHal, tANI_U8 *pBuf, tANI_U32 *pbLen) |
| 5084 | { |
| 5085 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5086 | |
| 5087 | return ( csrGetSupportedCountryCode( pMac, pBuf, pbLen ) ); |
| 5088 | } |
| 5089 | |
| 5090 | |
| 5091 | /* --------------------------------------------------------------------------- |
| 5092 | \fn sme_GetCurrentRegulatoryDomain |
| 5093 | \brief this function is to get the current regulatory domain. This is a synchronous API. |
| 5094 | This function must be called after CFG is downloaded and all the band/mode setting already passed into |
| 5095 | SME. The function fails if 11d support is turned off. |
| 5096 | \param pDomain - Caller allocated buffer to return the current domain. |
| 5097 | \return eHalStatus SUCCESS. |
| 5098 | |
| 5099 | FAILURE or RESOURCES The API finished and failed. |
| 5100 | -------------------------------------------------------------------------------*/ |
| 5101 | eHalStatus sme_GetCurrentRegulatoryDomain(tHalHandle hHal, v_REGDOMAIN_t *pDomain) |
| 5102 | { |
| 5103 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5104 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 5105 | |
| 5106 | if( pDomain ) |
| 5107 | { |
| 5108 | if( csrIs11dSupported( pMac ) ) |
| 5109 | { |
| 5110 | *pDomain = csrGetCurrentRegulatoryDomain( pMac ); |
| 5111 | status = eHAL_STATUS_SUCCESS; |
| 5112 | } |
| 5113 | else |
| 5114 | { |
| 5115 | status = eHAL_STATUS_FAILURE; |
| 5116 | } |
| 5117 | } |
| 5118 | |
| 5119 | return ( status ); |
| 5120 | } |
| 5121 | |
| 5122 | |
| 5123 | /* --------------------------------------------------------------------------- |
| 5124 | \fn sme_SetRegulatoryDomain |
| 5125 | \brief this function is to set the current regulatory domain. |
| 5126 | This function must be called after CFG is downloaded and all the band/mode setting already passed into |
| 5127 | SME. This is a synchronous API. |
| 5128 | \param domainId - indicate the domain (defined in the driver) needs to set to. |
| 5129 | See v_REGDOMAIN_t for definition |
| 5130 | \param pfRestartNeeded - pointer to a caller allocated space. Upon successful return, it indicates whether |
| 5131 | a restart is needed to apply the change |
| 5132 | \return eHalStatus |
| 5133 | -------------------------------------------------------------------------------*/ |
| 5134 | eHalStatus sme_SetRegulatoryDomain(tHalHandle hHal, v_REGDOMAIN_t domainId, tANI_BOOLEAN *pfRestartNeeded) |
| 5135 | { |
| 5136 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5137 | |
| 5138 | return ( csrSetRegulatoryDomain( pMac, domainId, pfRestartNeeded ) ); |
| 5139 | } |
| 5140 | |
| 5141 | |
| 5142 | /* --------------------------------------------------------------------------- |
| 5143 | |
| 5144 | \fn sme_GetRegulatoryDomainForCountry |
| 5145 | |
| 5146 | \brief To return a regulatory domain base on a country code. This is a synchronous API. |
| 5147 | |
| 5148 | \param pCountry - pointer to a caller allocated buffer for input country code. |
| 5149 | |
| 5150 | \param pDomainId Upon successful return, it is the domain that country belongs to. |
| 5151 | If it is NULL, returning success means that the country code is known. |
| 5152 | |
| 5153 | \return eHalStatus SUCCESS. |
| 5154 | |
| 5155 | FAILURE or RESOURCES The API finished and failed. |
| 5156 | |
| 5157 | -------------------------------------------------------------------------------*/ |
| 5158 | eHalStatus sme_GetRegulatoryDomainForCountry(tHalHandle hHal, tANI_U8 *pCountry, v_REGDOMAIN_t *pDomainId) |
| 5159 | { |
| 5160 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5161 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 5162 | return csrGetRegulatoryDomainForCountry(pMac, pCountry, pDomainId, |
| 5163 | COUNTRY_QUERY); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5164 | } |
| 5165 | |
| 5166 | |
| 5167 | |
| 5168 | |
| 5169 | /* --------------------------------------------------------------------------- |
| 5170 | |
| 5171 | \fn sme_GetSupportedRegulatoryDomains |
| 5172 | |
| 5173 | \brief To return a list of supported regulatory domains. This is a synchronous API. |
| 5174 | |
| 5175 | \param pDomains - pointer to a caller allocated buffer for returned regulatory domains. |
| 5176 | |
| 5177 | \param pNumDomains For input, this parameter indicates howm many domains pDomains can hold. |
| 5178 | Upon return, this parameter has the number for supported domains. If pDomains |
| 5179 | doesn't have enough space for all the supported domains, this function returns |
| 5180 | fail status and this parameter contains the number that is needed. |
| 5181 | |
| 5182 | \return eHalStatus SUCCESS. |
| 5183 | |
| 5184 | FAILURE or RESOURCES The API finished and failed. |
| 5185 | |
| 5186 | -------------------------------------------------------------------------------*/ |
| 5187 | eHalStatus sme_GetSupportedRegulatoryDomains(tHalHandle hHal, v_REGDOMAIN_t *pDomains, tANI_U32 *pNumDomains) |
| 5188 | { |
| 5189 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 5190 | |
| 5191 | //We support all domains for now |
| 5192 | if( pNumDomains ) |
| 5193 | { |
| 5194 | if( NUM_REG_DOMAINS <= *pNumDomains ) |
| 5195 | { |
| 5196 | status = eHAL_STATUS_SUCCESS; |
| 5197 | } |
| 5198 | *pNumDomains = NUM_REG_DOMAINS; |
| 5199 | } |
| 5200 | if( HAL_STATUS_SUCCESS( status ) ) |
| 5201 | { |
| 5202 | if( pDomains ) |
| 5203 | { |
| 5204 | pDomains[0] = REGDOMAIN_FCC; |
| 5205 | pDomains[1] = REGDOMAIN_ETSI; |
| 5206 | pDomains[2] = REGDOMAIN_JAPAN; |
| 5207 | pDomains[3] = REGDOMAIN_WORLD; |
| 5208 | pDomains[4] = REGDOMAIN_N_AMER_EXC_FCC; |
| 5209 | pDomains[5] = REGDOMAIN_APAC; |
| 5210 | pDomains[6] = REGDOMAIN_KOREA; |
| 5211 | pDomains[7] = REGDOMAIN_HI_5GHZ; |
| 5212 | pDomains[8] = REGDOMAIN_NO_5GHZ; |
| 5213 | } |
| 5214 | else |
| 5215 | { |
| 5216 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 5217 | } |
| 5218 | } |
| 5219 | |
| 5220 | return ( status ); |
| 5221 | } |
| 5222 | |
| 5223 | |
| 5224 | //some support functions |
| 5225 | tANI_BOOLEAN sme_Is11dSupported(tHalHandle hHal) |
| 5226 | { |
| 5227 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5228 | |
| 5229 | return ( csrIs11dSupported( pMac ) ); |
| 5230 | } |
| 5231 | |
| 5232 | |
| 5233 | tANI_BOOLEAN sme_Is11hSupported(tHalHandle hHal) |
| 5234 | { |
| 5235 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5236 | |
| 5237 | return ( csrIs11hSupported( pMac ) ); |
| 5238 | } |
| 5239 | |
| 5240 | |
| 5241 | tANI_BOOLEAN sme_IsWmmSupported(tHalHandle hHal) |
| 5242 | { |
| 5243 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5244 | |
| 5245 | return ( csrIsWmmSupported( pMac ) ); |
| 5246 | } |
| 5247 | |
| 5248 | //Upper layer to get the list of the base channels to scan for passively 11d info from csr |
| 5249 | eHalStatus sme_ScanGetBaseChannels( tHalHandle hHal, tCsrChannelInfo * pChannelInfo ) |
| 5250 | { |
| 5251 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5252 | |
| 5253 | return(csrScanGetBaseChannels(pMac,pChannelInfo) ); |
| 5254 | } |
| 5255 | |
| 5256 | /* --------------------------------------------------------------------------- |
| 5257 | |
| 5258 | \fn sme_ChangeCountryCode |
| 5259 | |
| 5260 | \brief Change Country code from upperlayer during WLAN driver operation. |
| 5261 | This is a synchronous API. |
| 5262 | |
| 5263 | \param hHal - The handle returned by macOpen. |
| 5264 | |
| 5265 | \param pCountry New Country Code String |
| 5266 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 5267 | \param sendRegHint If we want to send reg hint to nl80211 |
| 5268 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5269 | \return eHalStatus SUCCESS. |
| 5270 | |
| 5271 | FAILURE or RESOURCES The API finished and failed. |
| 5272 | |
| 5273 | -------------------------------------------------------------------------------*/ |
| 5274 | eHalStatus sme_ChangeCountryCode( tHalHandle hHal, |
| 5275 | tSmeChangeCountryCallback callback, |
| 5276 | tANI_U8 *pCountry, |
| 5277 | void *pContext, |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 5278 | void* pVosContext, |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 5279 | tAniBool countryFromUserSpace, |
| 5280 | tAniBool sendRegHint ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5281 | { |
| 5282 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5283 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5284 | vos_msg_t msg; |
| 5285 | tAniChangeCountryCodeReq *pMsg; |
| 5286 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5287 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5288 | TRACE_CODE_SME_RX_HDD_CHANGE_CNTRYCODE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5289 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5290 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5291 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5292 | smsLog(pMac, LOG1, FL(" called")); |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 5293 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 5294 | if ((pMac->roam.configParam.Is11dSupportEnabledOriginal == true) && |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 5295 | (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority)) |
| 5296 | { |
| 5297 | |
| 5298 | smsLog(pMac, LOGW, "Set Country Code Fail since the STA is associated and userspace does not have priority "); |
| 5299 | |
| 5300 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5301 | status = eHAL_STATUS_FAILURE; |
| 5302 | return status; |
| 5303 | } |
| 5304 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5305 | pMsg = vos_mem_malloc(sizeof(tAniChangeCountryCodeReq)); |
| 5306 | if ( NULL == pMsg ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5307 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5308 | 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] | 5309 | sme_ReleaseGlobalLock( &pMac->sme ); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5310 | return eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5311 | } |
| 5312 | |
| 5313 | pMsg->msgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_CHANGE_COUNTRY_CODE); |
| 5314 | pMsg->msgLen = (tANI_U16)sizeof(tAniChangeCountryCodeReq); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5315 | vos_mem_copy(pMsg->countryCode, pCountry, 3); |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 5316 | pMsg->countryFromUserSpace = countryFromUserSpace; |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 5317 | pMsg->sendRegHint = sendRegHint; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5318 | pMsg->changeCCCallback = callback; |
| 5319 | pMsg->pDevContext = pContext; |
| 5320 | pMsg->pVosContext = pVosContext; |
| 5321 | |
| 5322 | msg.type = eWNI_SME_CHANGE_COUNTRY_CODE; |
| 5323 | msg.bodyptr = pMsg; |
| 5324 | msg.reserved = 0; |
| 5325 | |
| 5326 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg)) |
| 5327 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5328 | smsLog(pMac, LOGE, " sme_ChangeCountryCode failed to post msg to self "); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5329 | vos_mem_free((void *)pMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5330 | status = eHAL_STATUS_FAILURE; |
| 5331 | } |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5332 | smsLog(pMac, LOG1, FL(" returned")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5333 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5334 | } |
| 5335 | |
| 5336 | return (status); |
| 5337 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5338 | |
| 5339 | /*-------------------------------------------------------------------------- |
| 5340 | |
| 5341 | \fn sme_GenericChangeCountryCode |
| 5342 | |
| 5343 | \brief Change Country code from upperlayer during WLAN driver operation. |
| 5344 | This is a synchronous API. |
| 5345 | |
| 5346 | \param hHal - The handle returned by macOpen. |
| 5347 | |
| 5348 | \param pCountry New Country Code String |
| 5349 | |
| 5350 | \param reg_domain regulatory domain |
| 5351 | |
| 5352 | \return eHalStatus SUCCESS. |
| 5353 | |
| 5354 | FAILURE or RESOURCES The API finished and failed. |
| 5355 | |
| 5356 | -----------------------------------------------------------------------------*/ |
| 5357 | eHalStatus sme_GenericChangeCountryCode( tHalHandle hHal, |
| 5358 | tANI_U8 *pCountry, |
| 5359 | v_REGDOMAIN_t reg_domain) |
| 5360 | { |
| 5361 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5362 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5363 | vos_msg_t msg; |
| 5364 | tAniGenericChangeCountryCodeReq *pMsg; |
| 5365 | |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 5366 | if (NULL == pMac) |
| 5367 | { |
| 5368 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 5369 | "%s: pMac is null", __func__); |
| 5370 | return status; |
| 5371 | } |
| 5372 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5373 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5374 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5375 | { |
| 5376 | smsLog(pMac, LOG1, FL(" called")); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 5377 | pMsg = vos_mem_malloc(sizeof(tAniGenericChangeCountryCodeReq)); |
| 5378 | if (NULL == pMsg) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5379 | { |
| 5380 | smsLog(pMac, LOGE, " sme_GenericChangeCountryCode: failed to allocate mem for req"); |
| 5381 | sme_ReleaseGlobalLock( &pMac->sme ); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 5382 | return eHAL_STATUS_FAILURE; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5383 | } |
| 5384 | |
| 5385 | pMsg->msgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE); |
| 5386 | pMsg->msgLen = (tANI_U16)sizeof(tAniGenericChangeCountryCodeReq); |
Sameer Thalappil | 7324e8b | 2014-01-15 10:32:54 -0800 | [diff] [blame] | 5387 | vos_mem_copy(pMsg->countryCode, pCountry, 2); |
Dino Mycle | 6c77a96 | 2014-08-19 15:34:23 +0530 | [diff] [blame] | 5388 | |
| 5389 | pMsg->countryCode[2] = ' '; /* For ASCII space */ |
| 5390 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5391 | pMsg->domain_index = reg_domain; |
| 5392 | |
| 5393 | msg.type = eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE; |
| 5394 | msg.bodyptr = pMsg; |
| 5395 | msg.reserved = 0; |
| 5396 | |
| 5397 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg)) |
| 5398 | { |
| 5399 | smsLog(pMac, LOGE, "sme_GenericChangeCountryCode failed to post msg to self"); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 5400 | vos_mem_free(pMsg); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5401 | status = eHAL_STATUS_FAILURE; |
| 5402 | } |
| 5403 | smsLog(pMac, LOG1, FL(" returned")); |
| 5404 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5405 | } |
| 5406 | |
| 5407 | return (status); |
| 5408 | } |
Mihir Shete | e1093ba | 2014-01-21 20:13:32 +0530 | [diff] [blame] | 5409 | |
| 5410 | /* --------------------------------------------------------------------------- |
| 5411 | |
| 5412 | \fn sme_InitChannels |
| 5413 | |
| 5414 | \brief Used to initialize CSR channel lists while driver loading |
| 5415 | |
| 5416 | \param hHal - global pMac structure |
| 5417 | |
| 5418 | \return eHalStatus SUCCESS. |
| 5419 | |
| 5420 | FAILURE or RESOURCES The API finished and failed. |
| 5421 | |
| 5422 | -------------------------------------------------------------------------------*/ |
| 5423 | eHalStatus sme_InitChannels(tHalHandle hHal) |
| 5424 | { |
| 5425 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5426 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 5427 | |
| 5428 | if (NULL == pMac) |
| 5429 | { |
| 5430 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 5431 | "%s: pMac is null", __func__); |
| 5432 | return status; |
| 5433 | } |
| 5434 | |
Vinay Krishna Eranna | b9295ae | 2014-05-09 13:43:23 +0530 | [diff] [blame] | 5435 | status = csrInitChannels(pMac); |
| 5436 | |
Mihir Shete | e1093ba | 2014-01-21 20:13:32 +0530 | [diff] [blame] | 5437 | return status; |
| 5438 | } |
| 5439 | |
Mahesh A Saptasagar | 74289d2 | 2014-05-14 12:43:37 +0530 | [diff] [blame] | 5440 | /*------------------------------------------------------------------------- |
| 5441 | \fn sme_InitChannelsForCC |
| 5442 | |
| 5443 | \brief Used to issue regulatory hint to user |
| 5444 | |
| 5445 | \param hHal - global pMac structure |
| 5446 | |
| 5447 | \return eHalStatus SUCCESS. |
| 5448 | |
| 5449 | FAILURE or RESOURCES The API finished and failed. |
| 5450 | --------------------------------------------------------------------------*/ |
| 5451 | |
Agarwal Ashish | 6db9d53 | 2014-09-30 18:19:10 +0530 | [diff] [blame] | 5452 | eHalStatus sme_InitChannelsForCC(tHalHandle hHal, driver_load_type init) |
Mahesh A Saptasagar | 74289d2 | 2014-05-14 12:43:37 +0530 | [diff] [blame] | 5453 | { |
| 5454 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5455 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 5456 | |
| 5457 | if (NULL == pMac) |
| 5458 | { |
| 5459 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 5460 | "%s: pMac is null", __func__); |
| 5461 | return status; |
| 5462 | } |
Agarwal Ashish | 6db9d53 | 2014-09-30 18:19:10 +0530 | [diff] [blame] | 5463 | status = csrInitChannelsForCC(pMac, init); |
Mahesh A Saptasagar | 74289d2 | 2014-05-14 12:43:37 +0530 | [diff] [blame] | 5464 | |
| 5465 | return status; |
| 5466 | } |
| 5467 | |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5468 | /* --------------------------------------------------------------------------- |
| 5469 | |
| 5470 | \fn sme_DHCPStartInd |
| 5471 | |
| 5472 | \brief API to signal the FW about the DHCP Start event. |
| 5473 | |
| 5474 | \param hHal - HAL handle for device. |
| 5475 | |
| 5476 | \param device_mode - mode(AP,SAP etc) of the device. |
| 5477 | |
| 5478 | \param macAddr - MAC address of the device. |
| 5479 | |
| 5480 | \return eHalStatus SUCCESS. |
| 5481 | |
| 5482 | FAILURE or RESOURCES The API finished and failed. |
| 5483 | --------------------------------------------------------------------------*/ |
| 5484 | eHalStatus sme_DHCPStartInd( tHalHandle hHal, |
| 5485 | tANI_U8 device_mode, |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5486 | tANI_U8 sessionId ) |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5487 | { |
| 5488 | eHalStatus status; |
| 5489 | VOS_STATUS vosStatus; |
| 5490 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5491 | vos_msg_t vosMessage; |
| 5492 | tAniDHCPInd *pMsg; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5493 | tCsrRoamSession *pSession; |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5494 | |
| 5495 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 5496 | if ( eHAL_STATUS_SUCCESS == status) |
| 5497 | { |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5498 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 5499 | |
| 5500 | if (!pSession) |
| 5501 | { |
| 5502 | smsLog(pMac, LOGE, FL("session %d not found "), sessionId); |
| 5503 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5504 | return eHAL_STATUS_FAILURE; |
| 5505 | } |
| 5506 | |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5507 | pMsg = (tAniDHCPInd*)vos_mem_malloc(sizeof(tAniDHCPInd)); |
| 5508 | if (NULL == pMsg) |
| 5509 | { |
| 5510 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5511 | "%s: Not able to allocate memory for dhcp start", __func__); |
| 5512 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5513 | return eHAL_STATUS_FAILURE; |
| 5514 | } |
| 5515 | pMsg->msgType = WDA_DHCP_START_IND; |
| 5516 | pMsg->msgLen = (tANI_U16)sizeof(tAniDHCPInd); |
| 5517 | pMsg->device_mode = device_mode; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5518 | vos_mem_copy(pMsg->macAddr, pSession->connectedProfile.bssid, |
| 5519 | sizeof(tSirMacAddr)); |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5520 | vosMessage.type = WDA_DHCP_START_IND; |
| 5521 | vosMessage.bodyptr = pMsg; |
| 5522 | vosMessage.reserved = 0; |
| 5523 | |
| 5524 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 5525 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 5526 | { |
| 5527 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5528 | "%s: Post DHCP Start MSG fail", __func__); |
| 5529 | vos_mem_free(pMsg); |
| 5530 | status = eHAL_STATUS_FAILURE; |
| 5531 | } |
| 5532 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5533 | } |
| 5534 | return (status); |
| 5535 | } |
| 5536 | /* --------------------------------------------------------------------------- |
| 5537 | \fn sme_DHCPStopInd |
| 5538 | |
| 5539 | \brief API to signal the FW about the DHCP complete event. |
| 5540 | |
| 5541 | \param hHal - HAL handle for device. |
| 5542 | |
| 5543 | \param device_mode - mode(AP, SAP etc) of the device. |
| 5544 | |
| 5545 | \param macAddr - MAC address of the device. |
| 5546 | |
| 5547 | \return eHalStatus SUCCESS. |
| 5548 | FAILURE or RESOURCES The API finished and failed. |
| 5549 | --------------------------------------------------------------------------*/ |
| 5550 | eHalStatus sme_DHCPStopInd( tHalHandle hHal, |
| 5551 | tANI_U8 device_mode, |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5552 | tANI_U8 sessionId ) |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5553 | { |
| 5554 | eHalStatus status; |
| 5555 | VOS_STATUS vosStatus; |
| 5556 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5557 | vos_msg_t vosMessage; |
| 5558 | tAniDHCPInd *pMsg; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5559 | tCsrRoamSession *pSession; |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5560 | |
| 5561 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 5562 | if ( eHAL_STATUS_SUCCESS == status) |
| 5563 | { |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5564 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 5565 | |
| 5566 | if (!pSession) |
| 5567 | { |
| 5568 | smsLog(pMac, LOGE, FL("session %d not found "), sessionId); |
| 5569 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5570 | return eHAL_STATUS_FAILURE; |
| 5571 | } |
| 5572 | |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5573 | pMsg = (tAniDHCPInd*)vos_mem_malloc(sizeof(tAniDHCPInd)); |
| 5574 | if (NULL == pMsg) |
| 5575 | { |
| 5576 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5577 | "%s: Not able to allocate memory for dhcp stop", __func__); |
| 5578 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5579 | return eHAL_STATUS_FAILURE; |
| 5580 | } |
| 5581 | |
| 5582 | pMsg->msgType = WDA_DHCP_STOP_IND; |
| 5583 | pMsg->msgLen = (tANI_U16)sizeof(tAniDHCPInd); |
| 5584 | pMsg->device_mode = device_mode; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5585 | vos_mem_copy(pMsg->macAddr, pSession->connectedProfile.bssid, |
| 5586 | sizeof(tSirMacAddr)); |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5587 | |
| 5588 | vosMessage.type = WDA_DHCP_STOP_IND; |
| 5589 | vosMessage.bodyptr = pMsg; |
| 5590 | vosMessage.reserved = 0; |
| 5591 | |
| 5592 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 5593 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 5594 | { |
| 5595 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5596 | "%s: Post DHCP Stop MSG fail", __func__); |
| 5597 | vos_mem_free(pMsg); |
| 5598 | status = eHAL_STATUS_FAILURE; |
| 5599 | } |
| 5600 | |
| 5601 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5602 | } |
| 5603 | return (status); |
| 5604 | } |
| 5605 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5606 | |
| 5607 | /* --------------------------------------------------------------------------- |
| 5608 | \fn sme_BtcSignalBtEvent |
| 5609 | \brief API to signal Bluetooth (BT) event to the WLAN driver. Based on the |
| 5610 | BT event type and the current operating mode of Libra (full power, |
| 5611 | BMPS, UAPSD etc), appropriate Bluetooth Coexistence (BTC) strategy |
| 5612 | would be employed. |
| 5613 | \param hHal - The handle returned by macOpen. |
| 5614 | \param pBtEvent - Pointer to a caller allocated object of type tSmeBtEvent |
| 5615 | Caller owns the memory and is responsible for freeing it. |
| 5616 | \return VOS_STATUS |
| 5617 | VOS_STATUS_E_FAILURE BT Event not passed to HAL. This can happen |
| 5618 | if BTC execution mode is set to BTC_WLAN_ONLY |
| 5619 | or BTC_PTA_ONLY. |
| 5620 | VOS_STATUS_SUCCESS BT Event passed to HAL |
| 5621 | ---------------------------------------------------------------------------*/ |
| 5622 | VOS_STATUS sme_BtcSignalBtEvent (tHalHandle hHal, tpSmeBtEvent pBtEvent) |
| 5623 | { |
| 5624 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5625 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5626 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 5627 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5628 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5629 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5630 | TRACE_CODE_SME_RX_HDD_BTC_SIGNALEVENT, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5631 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5632 | { |
| 5633 | status = btcSignalBTEvent (hHal, pBtEvent); |
| 5634 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5635 | } |
| 5636 | #endif |
| 5637 | return (status); |
| 5638 | } |
| 5639 | |
| 5640 | /* --------------------------------------------------------------------------- |
| 5641 | \fn sme_BtcSetConfig |
| 5642 | \brief API to change the current Bluetooth Coexistence (BTC) configuration |
| 5643 | This function should be invoked only after CFG download has completed. |
| 5644 | Calling it after sme_HDDReadyInd is recommended. |
| 5645 | \param hHal - The handle returned by macOpen. |
| 5646 | \param pSmeBtcConfig - Pointer to a caller allocated object of type tSmeBtcConfig. |
| 5647 | Caller owns the memory and is responsible for freeing it. |
| 5648 | \return VOS_STATUS |
| 5649 | VOS_STATUS_E_FAILURE Config not passed to HAL. |
| 5650 | VOS_STATUS_SUCCESS Config passed to HAL |
| 5651 | ---------------------------------------------------------------------------*/ |
| 5652 | VOS_STATUS sme_BtcSetConfig (tHalHandle hHal, tpSmeBtcConfig pSmeBtcConfig) |
| 5653 | { |
| 5654 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5655 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 5656 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5657 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5658 | TRACE_CODE_SME_RX_HDD_BTC_SETCONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5659 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5660 | { |
| 5661 | status = btcSetConfig (hHal, pSmeBtcConfig); |
| 5662 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5663 | } |
| 5664 | #endif |
| 5665 | return (status); |
| 5666 | } |
| 5667 | |
| 5668 | /* --------------------------------------------------------------------------- |
| 5669 | \fn sme_BtcGetConfig |
| 5670 | \brief API to retrieve the current Bluetooth Coexistence (BTC) configuration |
| 5671 | \param hHal - The handle returned by macOpen. |
| 5672 | \param pSmeBtcConfig - Pointer to a caller allocated object of type |
| 5673 | tSmeBtcConfig. Caller owns the memory and is responsible |
| 5674 | for freeing it. |
| 5675 | \return VOS_STATUS |
| 5676 | VOS_STATUS_E_FAILURE - failure |
| 5677 | VOS_STATUS_SUCCESS success |
| 5678 | ---------------------------------------------------------------------------*/ |
| 5679 | VOS_STATUS sme_BtcGetConfig (tHalHandle hHal, tpSmeBtcConfig pSmeBtcConfig) |
| 5680 | { |
| 5681 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5682 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 5683 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5684 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5685 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5686 | TRACE_CODE_SME_RX_HDD_BTC_GETCONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5687 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5688 | { |
| 5689 | status = btcGetConfig (hHal, pSmeBtcConfig); |
| 5690 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5691 | } |
| 5692 | #endif |
| 5693 | return (status); |
| 5694 | } |
| 5695 | /* --------------------------------------------------------------------------- |
| 5696 | \fn sme_SetCfgPrivacy |
| 5697 | \brief API to set configure privacy parameters |
| 5698 | \param hHal - The handle returned by macOpen. |
| 5699 | \param pProfile - Pointer CSR Roam profile. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5700 | \param fPrivacy - This parameter indicates status of privacy |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5701 | |
| 5702 | \return void |
| 5703 | ---------------------------------------------------------------------------*/ |
| 5704 | void sme_SetCfgPrivacy( tHalHandle hHal, |
| 5705 | tCsrRoamProfile *pProfile, |
| 5706 | tANI_BOOLEAN fPrivacy |
| 5707 | ) |
| 5708 | { |
| 5709 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5710 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5711 | TRACE_CODE_SME_RX_HDD_SET_CFGPRIVACY, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5712 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5713 | { |
| 5714 | csrSetCfgPrivacy(pMac, pProfile, fPrivacy); |
| 5715 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5716 | } |
| 5717 | } |
| 5718 | |
| 5719 | #if defined WLAN_FEATURE_VOWIFI |
| 5720 | /* --------------------------------------------------------------------------- |
| 5721 | \fn sme_NeighborReportRequest |
| 5722 | \brief API to request neighbor report. |
| 5723 | \param hHal - The handle returned by macOpen. |
| 5724 | \param pRrmNeighborReq - Pointer to a caller allocated object of type |
| 5725 | tRrmNeighborReq. Caller owns the memory and is responsible |
| 5726 | for freeing it. |
| 5727 | \return VOS_STATUS |
| 5728 | VOS_STATUS_E_FAILURE - failure |
| 5729 | VOS_STATUS_SUCCESS success |
| 5730 | ---------------------------------------------------------------------------*/ |
| 5731 | VOS_STATUS sme_NeighborReportRequest (tHalHandle hHal, tANI_U8 sessionId, |
| 5732 | tpRrmNeighborReq pRrmNeighborReq, tpRrmNeighborRspCallbackInfo callbackInfo) |
| 5733 | { |
| 5734 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5735 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5736 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5737 | TRACE_CODE_SME_RX_HDD_NEIGHBOR_REPORTREQ, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5738 | |
| 5739 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5740 | { |
| 5741 | status = sme_RrmNeighborReportRequest (hHal, sessionId, pRrmNeighborReq, callbackInfo); |
| 5742 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5743 | } |
| 5744 | |
| 5745 | return (status); |
| 5746 | } |
| 5747 | #endif |
| 5748 | |
| 5749 | //The following are debug APIs to support direct read/write register/memory |
| 5750 | //They are placed in SME because HW cannot be access when in LOW_POWER state |
| 5751 | //AND not connected. The knowledge and synchronization is done in SME |
| 5752 | |
| 5753 | //sme_DbgReadRegister |
| 5754 | //Caller needs to validate the input values |
| 5755 | VOS_STATUS sme_DbgReadRegister(tHalHandle hHal, v_U32_t regAddr, v_U32_t *pRegValue) |
| 5756 | { |
| 5757 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5758 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5759 | tPmcPowerState PowerState; |
| 5760 | tANI_U32 sessionId = 0; |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5761 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5762 | TRACE_CODE_SME_RX_HDD_DBG_READREG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5763 | |
| 5764 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5765 | |
| 5766 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5767 | { |
Hoonki Lee | 0af6aaf | 2013-02-08 12:26:44 -0800 | [diff] [blame] | 5768 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgReadRegister(regAddr, pRegValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5769 | { |
| 5770 | return VOS_STATUS_SUCCESS; |
| 5771 | } |
| 5772 | return VOS_STATUS_E_FAILURE; |
| 5773 | } |
| 5774 | |
| 5775 | /* 2) NON FTM mode driver *************************************************/ |
| 5776 | |
| 5777 | /* Acquire SME global lock */ |
| 5778 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5779 | { |
| 5780 | return VOS_STATUS_E_FAILURE; |
| 5781 | } |
| 5782 | |
| 5783 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5784 | { |
| 5785 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5786 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5787 | { |
Hoonki Lee | 0af6aaf | 2013-02-08 12:26:44 -0800 | [diff] [blame] | 5788 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgReadRegister(regAddr, pRegValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5789 | { |
| 5790 | status = VOS_STATUS_SUCCESS; |
| 5791 | } |
| 5792 | else |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5793 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5794 | status = VOS_STATUS_E_FAILURE; |
| 5795 | } |
| 5796 | } |
| 5797 | else |
| 5798 | { |
| 5799 | status = VOS_STATUS_E_FAILURE; |
| 5800 | } |
| 5801 | } |
| 5802 | |
| 5803 | /* This is a hack for Qualky/pttWniSocket |
| 5804 | Current implementation doesn't allow pttWniSocket to inform Qualky an error */ |
| 5805 | if ( VOS_STATUS_SUCCESS != status ) |
| 5806 | { |
| 5807 | *pRegValue = 0xDEADBEEF; |
| 5808 | status = VOS_STATUS_SUCCESS; |
| 5809 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5810 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5811 | /* Release SME global lock */ |
| 5812 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5813 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5814 | return (status); |
| 5815 | } |
| 5816 | |
| 5817 | |
| 5818 | //sme_DbgWriteRegister |
| 5819 | //Caller needs to validate the input values |
| 5820 | VOS_STATUS sme_DbgWriteRegister(tHalHandle hHal, v_U32_t regAddr, v_U32_t regValue) |
| 5821 | { |
| 5822 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5823 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5824 | tPmcPowerState PowerState; |
| 5825 | tANI_U32 sessionId = 0; |
| 5826 | |
| 5827 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5828 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5829 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5830 | TRACE_CODE_SME_RX_HDD_DBG_WRITEREG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5831 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5832 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5833 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteRegister(regAddr, regValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5834 | { |
| 5835 | return VOS_STATUS_SUCCESS; |
| 5836 | } |
| 5837 | return VOS_STATUS_E_FAILURE; |
| 5838 | } |
| 5839 | |
| 5840 | /* 2) NON FTM mode driver *************************************************/ |
| 5841 | |
| 5842 | /* Acquire SME global lock */ |
| 5843 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5844 | { |
| 5845 | return VOS_STATUS_E_FAILURE; |
| 5846 | } |
| 5847 | |
| 5848 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5849 | { |
| 5850 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5851 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5852 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5853 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteRegister(regAddr, regValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5854 | { |
| 5855 | status = VOS_STATUS_SUCCESS; |
| 5856 | } |
| 5857 | else |
| 5858 | { |
| 5859 | status = VOS_STATUS_E_FAILURE; |
| 5860 | } |
| 5861 | } |
| 5862 | else |
| 5863 | { |
| 5864 | status = VOS_STATUS_E_FAILURE; |
| 5865 | } |
| 5866 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5867 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5868 | /* Release SME global lock */ |
| 5869 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5870 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5871 | return (status); |
| 5872 | } |
| 5873 | |
| 5874 | |
| 5875 | |
| 5876 | //sme_DbgReadMemory |
| 5877 | //Caller needs to validate the input values |
| 5878 | //pBuf caller allocated buffer has the length of nLen |
| 5879 | VOS_STATUS sme_DbgReadMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U32_t nLen) |
| 5880 | { |
| 5881 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5882 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5883 | tPmcPowerState PowerState; |
| 5884 | tANI_U32 sessionId = 0; |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 5885 | tANI_U32 cmd = READ_MEMORY_DUMP_CMD; |
| 5886 | tANI_U32 arg1 = memAddr; |
| 5887 | tANI_U32 arg2 = nLen/4; |
| 5888 | tANI_U32 arg3 = 4; |
| 5889 | tANI_U32 arg4 = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5890 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5891 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5892 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5893 | TRACE_CODE_SME_RX_HDD_DBG_READMEM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5894 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5895 | { |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 5896 | 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] | 5897 | { |
| 5898 | return VOS_STATUS_SUCCESS; |
| 5899 | } |
| 5900 | return VOS_STATUS_E_FAILURE; |
| 5901 | } |
| 5902 | |
| 5903 | /* 2) NON FTM mode driver *************************************************/ |
| 5904 | |
| 5905 | /* Acquire SME global lock */ |
| 5906 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5907 | { |
| 5908 | return VOS_STATUS_E_FAILURE; |
| 5909 | } |
| 5910 | |
| 5911 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5912 | { |
| 5913 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5914 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5915 | { |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 5916 | 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] | 5917 | { |
| 5918 | status = VOS_STATUS_SUCCESS; |
| 5919 | } |
| 5920 | else |
| 5921 | { |
| 5922 | status = VOS_STATUS_E_FAILURE; |
| 5923 | } |
| 5924 | } |
| 5925 | else |
| 5926 | { |
| 5927 | status = VOS_STATUS_E_FAILURE; |
| 5928 | } |
| 5929 | } |
| 5930 | |
| 5931 | /* This is a hack for Qualky/pttWniSocket |
| 5932 | Current implementation doesn't allow pttWniSocket to inform Qualky an error */ |
| 5933 | if (VOS_STATUS_SUCCESS != status) |
| 5934 | { |
| 5935 | vos_mem_set(pBuf, nLen, 0xCD); |
| 5936 | status = VOS_STATUS_SUCCESS; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5937 | 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] | 5938 | } |
| 5939 | |
| 5940 | /* Release SME lock */ |
| 5941 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5942 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5943 | return (status); |
| 5944 | } |
| 5945 | |
| 5946 | |
| 5947 | //sme_DbgWriteMemory |
| 5948 | //Caller needs to validate the input values |
| 5949 | VOS_STATUS sme_DbgWriteMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U32_t nLen) |
| 5950 | { |
| 5951 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5952 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5953 | tPmcPowerState PowerState; |
| 5954 | tANI_U32 sessionId = 0; |
| 5955 | |
| 5956 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5957 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5958 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5959 | TRACE_CODE_SME_RX_HDD_DBG_WRITEMEM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5960 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5961 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5962 | { |
| 5963 | return VOS_STATUS_SUCCESS; |
| 5964 | } |
| 5965 | return VOS_STATUS_E_FAILURE; |
| 5966 | } |
| 5967 | |
| 5968 | /* 2) NON FTM mode driver *************************************************/ |
| 5969 | |
| 5970 | /* Acquire SME global lock */ |
| 5971 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5972 | { |
| 5973 | return VOS_STATUS_E_FAILURE; |
| 5974 | } |
| 5975 | |
| 5976 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5977 | { |
| 5978 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5979 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5980 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5981 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteMemory(memAddr, (void *)pBuf, nLen)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5982 | { |
| 5983 | status = VOS_STATUS_SUCCESS; |
| 5984 | } |
| 5985 | else |
| 5986 | { |
| 5987 | status = VOS_STATUS_E_FAILURE; |
| 5988 | } |
| 5989 | } |
| 5990 | else |
| 5991 | { |
| 5992 | status = VOS_STATUS_E_FAILURE; |
| 5993 | } |
| 5994 | } |
| 5995 | |
| 5996 | /* Release Global lock */ |
| 5997 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5998 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5999 | return (status); |
| 6000 | } |
| 6001 | |
| 6002 | |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 6003 | void pmcLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString, ...) |
| 6004 | { |
| 6005 | VOS_TRACE_LEVEL vosDebugLevel; |
| 6006 | char logBuffer[LOG_SIZE]; |
| 6007 | va_list marker; |
| 6008 | |
| 6009 | /* getting proper Debug level */ |
| 6010 | vosDebugLevel = getVosDebugLevel(loglevel); |
| 6011 | |
| 6012 | /* extracting arguments from pstring */ |
| 6013 | va_start( marker, pString ); |
| 6014 | vsnprintf(logBuffer, LOG_SIZE, pString, marker); |
| 6015 | |
| 6016 | VOS_TRACE(VOS_MODULE_ID_PMC, vosDebugLevel, "%s", logBuffer); |
| 6017 | va_end( marker ); |
| 6018 | } |
| 6019 | |
| 6020 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6021 | void smsLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString,...) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6022 | { |
| 6023 | #ifdef WLAN_DEBUG |
| 6024 | // Verify against current log level |
| 6025 | if ( loglevel > pMac->utils.gLogDbgLevel[LOG_INDEX_FOR_MODULE( SIR_SMS_MODULE_ID )] ) |
| 6026 | return; |
| 6027 | else |
| 6028 | { |
| 6029 | va_list marker; |
| 6030 | |
| 6031 | va_start( marker, pString ); /* Initialize variable arguments. */ |
| 6032 | |
| 6033 | logDebug(pMac, SIR_SMS_MODULE_ID, loglevel, pString, marker); |
| 6034 | |
| 6035 | va_end( marker ); /* Reset variable arguments. */ |
| 6036 | } |
| 6037 | #endif |
| 6038 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6039 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6040 | /* --------------------------------------------------------------------------- |
| 6041 | \fn sme_GetWcnssWlanCompiledVersion |
| 6042 | \brief This API returns the version of the WCNSS WLAN API with |
| 6043 | which the HOST driver was built |
| 6044 | \param hHal - The handle returned by macOpen. |
| 6045 | \param pVersion - Points to the Version structure to be filled |
| 6046 | \return VOS_STATUS |
| 6047 | VOS_STATUS_E_INVAL - failure |
| 6048 | VOS_STATUS_SUCCESS success |
| 6049 | ---------------------------------------------------------------------------*/ |
| 6050 | VOS_STATUS sme_GetWcnssWlanCompiledVersion(tHalHandle hHal, |
| 6051 | tSirVersionType *pVersion) |
| 6052 | { |
| 6053 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 6054 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6055 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 6056 | |
| 6057 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6058 | { |
| 6059 | if( pVersion != NULL ) |
| 6060 | { |
| 6061 | status = WDA_GetWcnssWlanCompiledVersion(vosContext, pVersion); |
| 6062 | } |
| 6063 | else |
| 6064 | { |
| 6065 | status = VOS_STATUS_E_INVAL; |
| 6066 | } |
| 6067 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6068 | } |
| 6069 | |
| 6070 | return (status); |
| 6071 | } |
| 6072 | |
| 6073 | |
| 6074 | /* --------------------------------------------------------------------------- |
| 6075 | \fn sme_GetWcnssWlanReportedVersion |
| 6076 | \brief This API returns the version of the WCNSS WLAN API with |
| 6077 | which the WCNSS driver reports it was built |
| 6078 | \param hHal - The handle returned by macOpen. |
| 6079 | \param pVersion - Points to the Version structure to be filled |
| 6080 | \return VOS_STATUS |
| 6081 | VOS_STATUS_E_INVAL - failure |
| 6082 | VOS_STATUS_SUCCESS success |
| 6083 | ---------------------------------------------------------------------------*/ |
| 6084 | VOS_STATUS sme_GetWcnssWlanReportedVersion(tHalHandle hHal, |
| 6085 | tSirVersionType *pVersion) |
| 6086 | { |
| 6087 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 6088 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6089 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 6090 | |
| 6091 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6092 | { |
| 6093 | if( pVersion != NULL ) |
| 6094 | { |
| 6095 | status = WDA_GetWcnssWlanReportedVersion(vosContext, pVersion); |
| 6096 | } |
| 6097 | else |
| 6098 | { |
| 6099 | status = VOS_STATUS_E_INVAL; |
| 6100 | } |
| 6101 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6102 | } |
| 6103 | |
| 6104 | return (status); |
| 6105 | } |
| 6106 | |
| 6107 | |
| 6108 | /* --------------------------------------------------------------------------- |
| 6109 | \fn sme_GetWcnssSoftwareVersion |
| 6110 | \brief This API returns the version string of the WCNSS driver |
| 6111 | \param hHal - The handle returned by macOpen. |
| 6112 | \param pVersion - Points to the Version string buffer to be filled |
| 6113 | \param versionBufferSize - THe size of the Version string buffer |
| 6114 | \return VOS_STATUS |
| 6115 | VOS_STATUS_E_INVAL - failure |
| 6116 | VOS_STATUS_SUCCESS success |
| 6117 | ---------------------------------------------------------------------------*/ |
| 6118 | VOS_STATUS sme_GetWcnssSoftwareVersion(tHalHandle hHal, |
| 6119 | tANI_U8 *pVersion, |
| 6120 | tANI_U32 versionBufferSize) |
| 6121 | { |
| 6122 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 6123 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6124 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 6125 | |
| 6126 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6127 | { |
| 6128 | if( pVersion != NULL ) |
| 6129 | { |
| 6130 | status = WDA_GetWcnssSoftwareVersion(vosContext, pVersion, |
| 6131 | versionBufferSize); |
| 6132 | } |
| 6133 | else |
| 6134 | { |
| 6135 | status = VOS_STATUS_E_INVAL; |
| 6136 | } |
| 6137 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6138 | } |
| 6139 | |
| 6140 | return (status); |
| 6141 | } |
| 6142 | |
| 6143 | |
| 6144 | /* --------------------------------------------------------------------------- |
| 6145 | \fn sme_GetWcnssHardwareVersion |
| 6146 | \brief This API returns the version string of the WCNSS hardware |
| 6147 | \param hHal - The handle returned by macOpen. |
| 6148 | \param pVersion - Points to the Version string buffer to be filled |
| 6149 | \param versionBufferSize - THe size of the Version string buffer |
| 6150 | \return VOS_STATUS |
| 6151 | VOS_STATUS_E_INVAL - failure |
| 6152 | VOS_STATUS_SUCCESS success |
| 6153 | ---------------------------------------------------------------------------*/ |
| 6154 | VOS_STATUS sme_GetWcnssHardwareVersion(tHalHandle hHal, |
| 6155 | tANI_U8 *pVersion, |
| 6156 | tANI_U32 versionBufferSize) |
| 6157 | { |
| 6158 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 6159 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6160 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 6161 | |
| 6162 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6163 | { |
| 6164 | if( pVersion != NULL ) |
| 6165 | { |
| 6166 | status = WDA_GetWcnssHardwareVersion(vosContext, pVersion, |
| 6167 | versionBufferSize); |
| 6168 | } |
| 6169 | else |
| 6170 | { |
| 6171 | status = VOS_STATUS_E_INVAL; |
| 6172 | } |
| 6173 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6174 | } |
| 6175 | |
| 6176 | return (status); |
| 6177 | } |
Jeff Johnson | 4824d4c | 2013-02-12 14:23:57 -0800 | [diff] [blame] | 6178 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6179 | |
| 6180 | #ifdef FEATURE_WLAN_WAPI |
| 6181 | /* --------------------------------------------------------------------------- |
| 6182 | \fn sme_RoamSetBKIDCache |
| 6183 | \brief The SME API exposed to HDD to allow HDD to provde SME the BKID |
| 6184 | candidate list. |
| 6185 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 6186 | it is opened (by calling halOpen). |
| 6187 | \param pBKIDCache - caller allocated buffer point to an array of tBkidCacheInfo |
| 6188 | \param numItems - a variable that has the number of tBkidCacheInfo allocated |
| 6189 | when retruning, this is the number of items put into pBKIDCache |
| 6190 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 6191 | big enough and pNumItems has the number of tBkidCacheInfo. |
| 6192 | ---------------------------------------------------------------------------*/ |
| 6193 | eHalStatus sme_RoamSetBKIDCache( tHalHandle hHal, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache, |
| 6194 | tANI_U32 numItems ) |
| 6195 | { |
| 6196 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6197 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6198 | |
| 6199 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6200 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6201 | { |
| 6202 | status = csrRoamSetBKIDCache( pMac, sessionId, pBKIDCache, numItems ); |
| 6203 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6204 | } |
| 6205 | |
| 6206 | return (status); |
| 6207 | } |
| 6208 | |
| 6209 | /* --------------------------------------------------------------------------- |
| 6210 | \fn sme_RoamGetBKIDCache |
| 6211 | \brief The SME API exposed to HDD to allow HDD to request SME to return its |
| 6212 | BKID cache. |
| 6213 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 6214 | it is opened (by calling halOpen). |
| 6215 | \param pNum - caller allocated memory that has the space of the number of |
| 6216 | tBkidCacheInfo as input. Upon returned, *pNum has the needed number of entries |
| 6217 | in SME cache. |
| 6218 | \param pBkidCache - Caller allocated memory that contains BKID cache, if any, |
| 6219 | upon return |
| 6220 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 6221 | big enough. |
| 6222 | ---------------------------------------------------------------------------*/ |
| 6223 | eHalStatus sme_RoamGetBKIDCache(tHalHandle hHal, tANI_U32 *pNum, |
| 6224 | tBkidCacheInfo *pBkidCache) |
| 6225 | { |
| 6226 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6227 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6228 | |
| 6229 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6230 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6231 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6232 | smsLog(pMac, LOGE, FL(" !!!!!!!!!!!!!!!!!!SessionId is hardcoded")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6233 | status = csrRoamGetBKIDCache( pMac, 0, pNum, pBkidCache ); |
| 6234 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6235 | } |
| 6236 | |
| 6237 | return (status); |
| 6238 | } |
| 6239 | |
| 6240 | /* --------------------------------------------------------------------------- |
| 6241 | \fn sme_RoamGetNumBKIDCache |
| 6242 | \brief The SME API exposed to HDD to allow HDD to request SME to return the |
| 6243 | number of BKID cache entries. |
| 6244 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 6245 | it is opened (by calling halOpen). |
| 6246 | \return tANI_U32 - the number of BKID cache entries. |
| 6247 | ---------------------------------------------------------------------------*/ |
| 6248 | tANI_U32 sme_RoamGetNumBKIDCache(tHalHandle hHal, tANI_U32 sessionId) |
| 6249 | { |
| 6250 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6251 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6252 | tANI_U32 numBkidCache = 0; |
| 6253 | |
| 6254 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6255 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6256 | { |
| 6257 | numBkidCache = csrRoamGetNumBKIDCache( pMac, sessionId ); |
| 6258 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6259 | } |
| 6260 | |
| 6261 | return (numBkidCache); |
| 6262 | } |
| 6263 | |
| 6264 | /* --------------------------------------------------------------------------- |
| 6265 | \fn sme_ScanGetBKIDCandidateList |
| 6266 | \brief a wrapper function to return the BKID candidate list |
| 6267 | \param pBkidList - caller allocated buffer point to an array of |
| 6268 | tBkidCandidateInfo |
| 6269 | \param pNumItems - pointer to a variable that has the number of |
| 6270 | tBkidCandidateInfo allocated when retruning, this is |
| 6271 | either the number needed or number of items put into |
| 6272 | pPmkidList |
| 6273 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 6274 | big enough and pNumItems |
| 6275 | has the number of tBkidCandidateInfo. |
| 6276 | \Note: pNumItems is a number of tBkidCandidateInfo, |
| 6277 | not sizeof(tBkidCandidateInfo) * something |
| 6278 | ---------------------------------------------------------------------------*/ |
| 6279 | eHalStatus sme_ScanGetBKIDCandidateList(tHalHandle hHal, tANI_U32 sessionId, |
| 6280 | tBkidCandidateInfo *pBkidList, |
| 6281 | tANI_U32 *pNumItems ) |
| 6282 | { |
| 6283 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6284 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6285 | |
| 6286 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6287 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6288 | { |
| 6289 | status = csrScanGetBKIDCandidateList( pMac, sessionId, pBkidList, pNumItems ); |
| 6290 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6291 | } |
| 6292 | |
| 6293 | return (status); |
| 6294 | } |
| 6295 | #endif /* FEATURE_WLAN_WAPI */ |
| 6296 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6297 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 6298 | |
| 6299 | /***************************************************************************** |
| 6300 | OEM DATA related modifications and function additions |
| 6301 | *****************************************************************************/ |
| 6302 | |
| 6303 | /* --------------------------------------------------------------------------- |
| 6304 | \fn sme_getOemDataRsp |
| 6305 | \brief a wrapper function to obtain the OEM DATA RSP |
| 6306 | \param pOemDataRsp - A pointer to the response object |
| 6307 | \param pContext - a pointer passed in for the callback |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6308 | \return eHalStatus |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6309 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6310 | eHalStatus sme_getOemDataRsp(tHalHandle hHal, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6311 | tOemDataRsp **pOemDataRsp) |
| 6312 | { |
| 6313 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6314 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6315 | |
| 6316 | do |
| 6317 | { |
| 6318 | //acquire the lock for the sme object |
| 6319 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6320 | |
| 6321 | if(!HAL_STATUS_SUCCESS(status)) |
| 6322 | { |
| 6323 | break; |
| 6324 | } |
| 6325 | |
| 6326 | if(pMac->oemData.pOemDataRsp != NULL) |
| 6327 | { |
| 6328 | *pOemDataRsp = pMac->oemData.pOemDataRsp; |
| 6329 | } |
| 6330 | else |
| 6331 | { |
| 6332 | status = eHAL_STATUS_FAILURE; |
| 6333 | } |
| 6334 | |
| 6335 | //release the lock for the sme object |
| 6336 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6337 | |
| 6338 | } while(0); |
| 6339 | |
| 6340 | return status; |
| 6341 | } |
| 6342 | |
| 6343 | /* --------------------------------------------------------------------------- |
| 6344 | \fn sme_OemDataReq |
| 6345 | \brief a wrapper function for OEM DATA REQ |
| 6346 | \param sessionId - session id to be used. |
| 6347 | \param pOemDataReqId - pointer to an object to get back the request ID |
| 6348 | \param callback - a callback function that is called upon finish |
| 6349 | \param pContext - a pointer passed in for the callback |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6350 | \return eHalStatus |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6351 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6352 | eHalStatus sme_OemDataReq(tHalHandle hHal, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6353 | tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6354 | tOemDataReqConfig *pOemDataReqConfig, |
| 6355 | tANI_U32 *pOemDataReqID, |
| 6356 | oemData_OemDataReqCompleteCallback callback, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6357 | void *pContext) |
| 6358 | { |
| 6359 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6360 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6361 | |
| 6362 | do |
| 6363 | { |
| 6364 | //acquire the lock for the sme object |
| 6365 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6366 | if(HAL_STATUS_SUCCESS(status)) |
| 6367 | { |
| 6368 | tANI_U32 lOemDataReqId = pMac->oemData.oemDataReqID++; //let it wrap around |
| 6369 | |
| 6370 | if(pOemDataReqID) |
| 6371 | { |
| 6372 | *pOemDataReqID = lOemDataReqId; |
| 6373 | } |
| 6374 | else |
Leela Venkata Kiran Kumar Reddy Chirala | 090cc1f | 2013-03-07 17:40:17 -0800 | [diff] [blame] | 6375 | { |
| 6376 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6377 | return eHAL_STATUS_FAILURE; |
| 6378 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6379 | |
| 6380 | status = oemData_OemDataReq(hHal, sessionId, pOemDataReqConfig, pOemDataReqID, callback, pContext); |
| 6381 | |
| 6382 | //release the lock for the sme object |
| 6383 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6384 | } |
| 6385 | } while(0); |
| 6386 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6387 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6388 | |
| 6389 | return(status); |
| 6390 | } |
| 6391 | |
| 6392 | #endif /*FEATURE_OEM_DATA_SUPPORT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6393 | |
| 6394 | /*-------------------------------------------------------------------------- |
| 6395 | |
| 6396 | \brief sme_OpenSession() - Open a session for scan/roam operation. |
| 6397 | |
| 6398 | This is a synchronous API. |
| 6399 | |
| 6400 | |
| 6401 | \param hHal - The handle returned by macOpen. |
| 6402 | \param callback - A pointer to the function caller specifies for roam/connect status indication |
| 6403 | \param pContext - The context passed with callback |
| 6404 | \param pSelfMacAddr - Caller allocated memory filled with self MAC address (6 bytes) |
| 6405 | \param pbSessionId - pointer to a caller allocated buffer for returned session ID |
| 6406 | |
| 6407 | \return eHAL_STATUS_SUCCESS - session is opened. sessionId returned. |
| 6408 | |
| 6409 | Other status means SME is failed to open the session. |
| 6410 | eHAL_STATUS_RESOURCES - no more session available. |
| 6411 | \sa |
| 6412 | |
| 6413 | --------------------------------------------------------------------------*/ |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 6414 | eHalStatus sme_OpenSession(tHalHandle hHal, csrRoamCompleteCallback callback, |
| 6415 | void *pContext, tANI_U8 *pSelfMacAddr, |
| 6416 | tANI_U8 *pbSessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6417 | { |
| 6418 | eHalStatus status; |
| 6419 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6420 | |
| 6421 | if( NULL == pbSessionId ) |
| 6422 | { |
| 6423 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 6424 | } |
| 6425 | else |
| 6426 | { |
| 6427 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6428 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6429 | { |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 6430 | status = csrRoamOpenSession(pMac, callback, pContext, |
| 6431 | pSelfMacAddr, pbSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6432 | |
| 6433 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6434 | } |
| 6435 | } |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6436 | if( NULL != pbSessionId ) |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6437 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6438 | TRACE_CODE_SME_RX_HDD_OPEN_SESSION,*pbSessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6439 | |
| 6440 | return ( status ); |
| 6441 | } |
| 6442 | |
| 6443 | |
| 6444 | /*-------------------------------------------------------------------------- |
| 6445 | |
| 6446 | \brief sme_CloseSession() - Open a session for scan/roam operation. |
| 6447 | |
| 6448 | This is a synchronous API. |
| 6449 | |
| 6450 | |
| 6451 | \param hHal - The handle returned by macOpen. |
| 6452 | |
| 6453 | \param sessionId - A previous opened session's ID. |
| 6454 | |
| 6455 | \return eHAL_STATUS_SUCCESS - session is closed. |
| 6456 | |
| 6457 | Other status means SME is failed to open the session. |
| 6458 | eHAL_STATUS_INVALID_PARAMETER - session is not opened. |
| 6459 | \sa |
| 6460 | |
| 6461 | --------------------------------------------------------------------------*/ |
| 6462 | eHalStatus sme_CloseSession(tHalHandle hHal, tANI_U8 sessionId, |
| 6463 | csrRoamSessionCloseCallback callback, void *pContext) |
| 6464 | { |
| 6465 | eHalStatus status; |
| 6466 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6467 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6468 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6469 | TRACE_CODE_SME_RX_HDD_CLOSE_SESSION, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6470 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6471 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6472 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6473 | status = csrRoamCloseSession( pMac, sessionId, FALSE, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6474 | callback, pContext ); |
| 6475 | |
| 6476 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6477 | } |
| 6478 | |
| 6479 | return ( status ); |
| 6480 | } |
| 6481 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6482 | /* --------------------------------------------------------------------------- |
| 6483 | |
| 6484 | \fn sme_RoamUpdateAPWPSIE |
| 6485 | |
| 6486 | \brief To update AP's WPS IE. This function should be called after SME AP session is created |
| 6487 | This is an asynchronous API. |
| 6488 | |
| 6489 | \param pAPWPSIES - pointer to a caller allocated object of tSirAPWPSIEs |
| 6490 | |
| 6491 | \return eHalStatus – SUCCESS – |
| 6492 | |
| 6493 | FAILURE or RESOURCES – The API finished and failed. |
| 6494 | |
| 6495 | -------------------------------------------------------------------------------*/ |
| 6496 | eHalStatus sme_RoamUpdateAPWPSIE(tHalHandle hHal, tANI_U8 sessionId, tSirAPWPSIEs *pAPWPSIES) |
| 6497 | { |
| 6498 | |
| 6499 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6500 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6501 | |
| 6502 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6503 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6504 | { |
| 6505 | |
| 6506 | status = csrRoamUpdateAPWPSIE( pMac, sessionId, pAPWPSIES ); |
| 6507 | |
| 6508 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6509 | } |
| 6510 | |
| 6511 | return (status); |
| 6512 | } |
| 6513 | /* --------------------------------------------------------------------------- |
| 6514 | |
| 6515 | \fn sme_RoamUpdateAPWPARSNIEs |
| 6516 | |
| 6517 | \brief To update AP's WPA/RSN IEs. This function should be called after SME AP session is created |
| 6518 | This is an asynchronous API. |
| 6519 | |
| 6520 | \param pAPSirRSNie - pointer to a caller allocated object of tSirRSNie with WPS/RSN IEs |
| 6521 | |
| 6522 | \return eHalStatus – SUCCESS – |
| 6523 | |
| 6524 | FAILURE or RESOURCES – The API finished and failed. |
| 6525 | |
| 6526 | -------------------------------------------------------------------------------*/ |
| 6527 | eHalStatus sme_RoamUpdateAPWPARSNIEs(tHalHandle hHal, tANI_U8 sessionId, tSirRSNie * pAPSirRSNie) |
| 6528 | { |
| 6529 | |
| 6530 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6531 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6532 | |
| 6533 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6534 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6535 | { |
| 6536 | |
| 6537 | status = csrRoamUpdateWPARSNIEs( pMac, sessionId, pAPSirRSNie); |
| 6538 | |
| 6539 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6540 | } |
| 6541 | |
| 6542 | return (status); |
| 6543 | } |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6544 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6545 | |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6546 | \fn sme_ChangeMCCBeaconInterval |
| 6547 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6548 | \brief To update P2P-GO beaconInterval. This function should be called after |
| 6549 | disassociating all the station is done |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6550 | This is an asynchronous API. |
| 6551 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6552 | \param |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6553 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6554 | \return eHalStatus SUCCESS |
| 6555 | FAILURE or RESOURCES |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 6556 | The API finished and failed. |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6557 | |
| 6558 | -------------------------------------------------------------------------------*/ |
| 6559 | eHalStatus sme_ChangeMCCBeaconInterval(tHalHandle hHal, tANI_U8 sessionId) |
| 6560 | { |
| 6561 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6562 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6563 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6564 | smsLog(pMac, LOG1, FL("Update Beacon PARAMS ")); |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6565 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6566 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6567 | { |
| 6568 | status = csrSendChngMCCBeaconInterval( pMac, sessionId); |
| 6569 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6570 | } |
| 6571 | return (status); |
| 6572 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6573 | |
| 6574 | /*-------------------------------------------------------------------------------* |
| 6575 | |
| 6576 | \fn sme_sendBTAmpEvent |
| 6577 | |
| 6578 | \brief to receive the coex priorty request from BT-AMP PAL |
| 6579 | and send the BT_AMP link state to HAL |
| 6580 | |
| 6581 | \param btAmpEvent - btAmpEvent |
| 6582 | |
Jeff Johnson | feddb2d | 2012-12-10 14:41:22 -0800 | [diff] [blame] | 6583 | \return eHalStatus: SUCCESS : BTAmp event successfully sent to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6584 | |
| 6585 | FAILURE: API failed |
| 6586 | |
| 6587 | -------------------------------------------------------------------------------*/ |
| 6588 | |
| 6589 | eHalStatus sme_sendBTAmpEvent(tHalHandle hHal, tSmeBtAmpEvent btAmpEvent) |
| 6590 | { |
| 6591 | vos_msg_t msg; |
| 6592 | tpSmeBtAmpEvent ptrSmeBtAmpEvent = NULL; |
| 6593 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6594 | |
Leela Venkata Kiran Kumar Reddy Chirala | f7ea543 | 2013-11-15 11:03:04 -0800 | [diff] [blame] | 6595 | ptrSmeBtAmpEvent = vos_mem_malloc(sizeof(tSmeBtAmpEvent)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6596 | if (NULL == ptrSmeBtAmpEvent) |
| 6597 | { |
| 6598 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6599 | "Not able to allocate memory for BTAmp event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6600 | return status; |
| 6601 | } |
| 6602 | |
| 6603 | vos_mem_copy(ptrSmeBtAmpEvent, (void*)&btAmpEvent, sizeof(tSmeBtAmpEvent)); |
| 6604 | msg.type = WDA_SIGNAL_BTAMP_EVENT; |
| 6605 | msg.reserved = 0; |
| 6606 | msg.bodyptr = ptrSmeBtAmpEvent; |
| 6607 | |
| 6608 | //status = halFW_SendBTAmpEventMesg(pMac, event); |
| 6609 | |
| 6610 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 6611 | { |
| 6612 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6613 | "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] | 6614 | vos_mem_free(ptrSmeBtAmpEvent); |
| 6615 | return status; |
| 6616 | } |
| 6617 | |
| 6618 | return eHAL_STATUS_SUCCESS; |
| 6619 | |
| 6620 | } |
| 6621 | |
| 6622 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6623 | \fn smeIssueFastRoamNeighborAPEvent |
| 6624 | \brief API to trigger fast BSS roam independent of RSSI triggers |
| 6625 | \param hHal - The handle returned by macOpen. |
| 6626 | \param bssid - Pointer to the BSSID to roam to. |
| 6627 | \param fastRoamTrig - Trigger to Scan or roam |
| 6628 | \return eHalStatus |
| 6629 | ---------------------------------------------------------------------------*/ |
| 6630 | eHalStatus smeIssueFastRoamNeighborAPEvent (tHalHandle hHal, |
| 6631 | tANI_U8 *bssid, |
| 6632 | tSmeFastRoamTrigger fastRoamTrig) |
| 6633 | { |
| 6634 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6635 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 6636 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 6637 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6638 | |
| 6639 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6640 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6641 | { |
| 6642 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 6643 | "%s: invoked", __func__); |
| 6644 | |
| 6645 | if (eSME_ROAM_TRIGGER_SCAN == fastRoamTrig) |
| 6646 | { |
| 6647 | smsLog(pMac, LOG1, FL("CFG Channel list scan... ")); |
| 6648 | pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_SCAN; |
| 6649 | vos_mem_copy((void *)(&pNeighborRoamInfo->cfgRoambssId), |
| 6650 | (void *)bssid, sizeof(tSirMacAddr)); |
Arif Hussain | a7c8e41 | 2013-11-20 11:06:42 -0800 | [diff] [blame] | 6651 | smsLog(pMac, LOG1, "Calling Roam Look Up down Event BSSID " |
| 6652 | MAC_ADDRESS_STR, MAC_ADDR_ARRAY(pNeighborRoamInfo->cfgRoambssId)); |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6653 | |
| 6654 | vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac); |
| 6655 | if (VOS_STATUS_SUCCESS != vosStatus) |
| 6656 | { |
| 6657 | smsLog(pMac, LOGE, |
| 6658 | FL("CFG Channel list scan state failed with status %d "), |
| 6659 | vosStatus); |
| 6660 | } |
| 6661 | } |
| 6662 | else if (eSME_ROAM_TRIGGER_FAST_ROAM == fastRoamTrig) |
| 6663 | { |
| 6664 | vos_mem_copy((void *)(&pNeighborRoamInfo->cfgRoambssId), |
| 6665 | (void *)bssid, sizeof(tSirMacAddr)); |
| 6666 | pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_FAST_ROAM; |
Arif Hussain | a7c8e41 | 2013-11-20 11:06:42 -0800 | [diff] [blame] | 6667 | smsLog(pMac, LOG1, "Roam to BSSID "MAC_ADDRESS_STR, |
| 6668 | MAC_ADDR_ARRAY(pNeighborRoamInfo->cfgRoambssId)); |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6669 | |
| 6670 | vosStatus = csrNeighborRoamReassocIndCallback(pMac->roam.gVosContext, |
| 6671 | 0, |
| 6672 | pMac, |
| 6673 | 0); |
| 6674 | |
| 6675 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 6676 | { |
| 6677 | smsLog(pMac, |
| 6678 | LOGE, |
| 6679 | FL(" Call to csrNeighborRoamReassocIndCallback failed, status = %d"), |
| 6680 | vosStatus); |
| 6681 | } |
| 6682 | } |
| 6683 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6684 | } |
| 6685 | return vosStatus; |
| 6686 | } |
| 6687 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6688 | \fn sme_SetHostOffload |
| 6689 | \brief API to set the host offload feature. |
| 6690 | \param hHal - The handle returned by macOpen. |
| 6691 | \param pRequest - Pointer to the offload request. |
| 6692 | \return eHalStatus |
| 6693 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6694 | eHalStatus sme_SetHostOffload (tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6695 | tpSirHostOffloadReq pRequest) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6696 | { |
| 6697 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6698 | eHalStatus status = eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6699 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6700 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6701 | TRACE_CODE_SME_RX_HDD_SET_HOSTOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6702 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6703 | { |
| 6704 | #ifdef WLAN_NS_OFFLOAD |
| 6705 | if(SIR_IPV6_NS_OFFLOAD == pRequest->offloadType) |
| 6706 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6707 | status = pmcSetNSOffload( hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6708 | } |
| 6709 | else |
| 6710 | #endif //WLAN_NS_OFFLOAD |
| 6711 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6712 | status = pmcSetHostOffload (hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6713 | } |
| 6714 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6715 | } |
| 6716 | |
| 6717 | return (status); |
| 6718 | } |
| 6719 | |
| 6720 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 6721 | /* --------------------------------------------------------------------------- |
| 6722 | \fn sme_SetGTKOffload |
| 6723 | \brief API to set GTK offload information. |
| 6724 | \param hHal - The handle returned by macOpen. |
| 6725 | \param pRequest - Pointer to the GTK offload request. |
| 6726 | \return eHalStatus |
| 6727 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6728 | eHalStatus sme_SetGTKOffload (tHalHandle hHal, tpSirGtkOffloadParams pRequest, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6729 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6730 | { |
| 6731 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6732 | eHalStatus status; |
| 6733 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6734 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6735 | TRACE_CODE_SME_RX_HDD_SET_GTKOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6736 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6737 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6738 | status = pmcSetGTKOffload( hHal, pRequest, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6739 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6740 | } |
| 6741 | |
| 6742 | return (status); |
| 6743 | } |
| 6744 | |
| 6745 | /* --------------------------------------------------------------------------- |
| 6746 | \fn sme_GetGTKOffload |
| 6747 | \brief API to get GTK offload information. |
| 6748 | \param hHal - The handle returned by macOpen. |
| 6749 | \param pRequest - Pointer to the GTK offload response. |
| 6750 | \return eHalStatus |
| 6751 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6752 | eHalStatus sme_GetGTKOffload (tHalHandle hHal, GTKOffloadGetInfoCallback callbackRoutine, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6753 | void *callbackContext, tANI_U8 sessionId ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6754 | { |
| 6755 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6756 | eHalStatus status; |
| 6757 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6758 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6759 | TRACE_CODE_SME_RX_HDD_GET_GTKOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6760 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6761 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6762 | pmcGetGTKOffload(hHal, callbackRoutine, callbackContext, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6763 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6764 | } |
| 6765 | |
| 6766 | return (status); |
| 6767 | } |
| 6768 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 6769 | |
| 6770 | /* --------------------------------------------------------------------------- |
| 6771 | \fn sme_SetKeepAlive |
| 6772 | \brief API to set the Keep Alive feature. |
| 6773 | \param hHal - The handle returned by macOpen. |
| 6774 | \param pRequest - Pointer to the Keep Alive request. |
| 6775 | \return eHalStatus |
| 6776 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6777 | eHalStatus sme_SetKeepAlive (tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6778 | tpSirKeepAliveReq pRequest) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6779 | { |
| 6780 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6781 | eHalStatus status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6782 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6783 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6784 | status = pmcSetKeepAlive (hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6785 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6786 | } |
| 6787 | |
| 6788 | return (status); |
| 6789 | } |
| 6790 | |
| 6791 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 6792 | /* --------------------------------------------------------------------------- |
| 6793 | \fn sme_SetPreferredNetworkList |
| 6794 | \brief API to set the Preferred Network List Offload feature. |
| 6795 | \param hHal - The handle returned by macOpen. |
| 6796 | \param pRequest - Pointer to the offload request. |
| 6797 | \return eHalStatus |
| 6798 | ---------------------------------------------------------------------------*/ |
| 6799 | eHalStatus sme_SetPreferredNetworkList (tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, void (*callbackRoutine) (void *callbackContext, tSirPrefNetworkFoundInd *pPrefNetworkFoundInd), void *callbackContext ) |
| 6800 | { |
| 6801 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6802 | eHalStatus status; |
| 6803 | |
| 6804 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6805 | { |
| 6806 | pmcSetPreferredNetworkList(hHal, pRequest, sessionId, callbackRoutine, callbackContext); |
| 6807 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6808 | } |
| 6809 | |
| 6810 | return (status); |
| 6811 | } |
| 6812 | |
| 6813 | eHalStatus sme_SetRSSIFilter(tHalHandle hHal, v_U8_t rssiThreshold) |
| 6814 | { |
| 6815 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6816 | eHalStatus status; |
| 6817 | |
| 6818 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6819 | { |
| 6820 | pmcSetRssiFilter(hHal, rssiThreshold); |
| 6821 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6822 | } |
| 6823 | |
| 6824 | return (status); |
| 6825 | } |
| 6826 | |
| 6827 | #endif // FEATURE_WLAN_SCAN_PNO |
| 6828 | |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 6829 | eHalStatus sme_SetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams, tANI_BOOLEAN forced) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6830 | { |
| 6831 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6832 | eHalStatus status; |
| 6833 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6834 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6835 | TRACE_CODE_SME_RX_HDD_SET_POWERPARAMS, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6836 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6837 | { |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 6838 | pmcSetPowerParams(hHal, pwParams, forced); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6839 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6840 | } |
| 6841 | |
| 6842 | return (status); |
| 6843 | } |
| 6844 | |
| 6845 | /* --------------------------------------------------------------------------- |
| 6846 | \fn sme_AbortMacScan |
| 6847 | \brief API to cancel MAC scan. |
| 6848 | \param hHal - The handle returned by macOpen. |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 6849 | \param sessionId - sessionId on which we need to abort scan. |
Srinivas, Dasari | 138af4f | 2014-02-07 11:13:45 +0530 | [diff] [blame] | 6850 | \param reason - Reason to abort the scan. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6851 | \return VOS_STATUS |
| 6852 | VOS_STATUS_E_FAILURE - failure |
| 6853 | VOS_STATUS_SUCCESS success |
| 6854 | ---------------------------------------------------------------------------*/ |
Srinivas, Dasari | 138af4f | 2014-02-07 11:13:45 +0530 | [diff] [blame] | 6855 | eHalStatus sme_AbortMacScan(tHalHandle hHal, tANI_U8 sessionId, |
| 6856 | eCsrAbortReason reason) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6857 | { |
| 6858 | eHalStatus status; |
| 6859 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6860 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6861 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6862 | TRACE_CODE_SME_RX_HDD_ABORT_MACSCAN, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6863 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6864 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6865 | { |
Srinivas, Dasari | 138af4f | 2014-02-07 11:13:45 +0530 | [diff] [blame] | 6866 | status = csrScanAbortMacScan(pMac, sessionId, reason); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6867 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6868 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6869 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6870 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6871 | return ( status ); |
| 6872 | } |
| 6873 | |
| 6874 | /* ---------------------------------------------------------------------------- |
| 6875 | \fn sme_GetOperationChannel |
| 6876 | \brief API to get current channel on which STA is parked |
| 6877 | this function gives channel information only of infra station or IBSS station |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6878 | \param hHal, pointer to memory location and sessionId |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6879 | \returns eHAL_STATUS_SUCCESS |
| 6880 | eHAL_STATUS_FAILURE |
| 6881 | -------------------------------------------------------------------------------*/ |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6882 | eHalStatus sme_GetOperationChannel(tHalHandle hHal, tANI_U32 *pChannel, tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6883 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6884 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6885 | tCsrRoamSession *pSession; |
| 6886 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6887 | if (CSR_IS_SESSION_VALID( pMac, sessionId )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6888 | { |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6889 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6890 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6891 | if(( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_INFRASTRUCTURE ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6892 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_IBSS ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6893 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_INFRA_AP ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6894 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_START_IBSS )) |
| 6895 | { |
| 6896 | *pChannel =pSession->connectedProfile.operationChannel; |
| 6897 | return eHAL_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6898 | } |
| 6899 | } |
| 6900 | return eHAL_STATUS_FAILURE; |
| 6901 | }// sme_GetOperationChannel ends here |
| 6902 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6903 | /* --------------------------------------------------------------------------- |
| 6904 | |
| 6905 | \fn sme_RegisterMgtFrame |
| 6906 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6907 | \brief To register managment frame of specified type and subtype. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6908 | \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] | 6909 | \param matchData - data which needs to be matched before passing frame |
| 6910 | to HDD. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6911 | \param matchDataLen - Length of matched data. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6912 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6913 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6914 | eHalStatus sme_RegisterMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6915 | tANI_U16 frameType, tANI_U8* matchData, tANI_U16 matchLen) |
| 6916 | { |
| 6917 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6918 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6919 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6920 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6921 | TRACE_CODE_SME_RX_HDD_REGISTER_MGMTFR, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6922 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6923 | { |
| 6924 | tSirRegisterMgmtFrame *pMsg; |
| 6925 | tANI_U16 len; |
| 6926 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 6927 | |
| 6928 | if(!pSession) |
| 6929 | { |
| 6930 | 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] | 6931 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 6932 | return eHAL_STATUS_FAILURE; |
| 6933 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6934 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6935 | if( !pSession->sessionActive ) |
| 6936 | { |
| 6937 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6938 | "%s Invalid Sessionid", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6939 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6940 | return eHAL_STATUS_FAILURE; |
| 6941 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6942 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6943 | len = sizeof(tSirRegisterMgmtFrame) + matchLen; |
| 6944 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6945 | pMsg = vos_mem_malloc(len); |
| 6946 | if ( NULL == pMsg ) |
| 6947 | status = eHAL_STATUS_FAILURE; |
| 6948 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6949 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6950 | vos_mem_set(pMsg, len, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6951 | pMsg->messageType = eWNI_SME_REGISTER_MGMT_FRAME_REQ; |
| 6952 | pMsg->length = len; |
| 6953 | pMsg->sessionId = sessionId; |
| 6954 | pMsg->registerFrame = VOS_TRUE; |
| 6955 | pMsg->frameType = frameType; |
| 6956 | pMsg->matchLen = matchLen; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6957 | vos_mem_copy(pMsg->matchData, matchData, matchLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6958 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 6959 | } |
| 6960 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6961 | } |
| 6962 | return status; |
| 6963 | } |
| 6964 | |
| 6965 | /* --------------------------------------------------------------------------- |
| 6966 | |
| 6967 | \fn sme_DeregisterMgtFrame |
| 6968 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6969 | \brief To De-register managment frame of specified type and subtype. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6970 | \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] | 6971 | \param matchData - data which needs to be matched before passing frame |
| 6972 | to HDD. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6973 | \param matchDataLen - Length of matched data. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6974 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6975 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6976 | eHalStatus sme_DeregisterMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6977 | tANI_U16 frameType, tANI_U8* matchData, tANI_U16 matchLen) |
| 6978 | { |
| 6979 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6980 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6981 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6982 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6983 | TRACE_CODE_SME_RX_HDD_DEREGISTER_MGMTFR, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6984 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6985 | { |
| 6986 | tSirRegisterMgmtFrame *pMsg; |
| 6987 | tANI_U16 len; |
| 6988 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 6989 | |
| 6990 | if(!pSession) |
| 6991 | { |
| 6992 | 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] | 6993 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 6994 | return eHAL_STATUS_FAILURE; |
| 6995 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6996 | |
| 6997 | if( !pSession->sessionActive ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6998 | { |
| 6999 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7000 | "%s Invalid Sessionid", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7001 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7002 | return eHAL_STATUS_FAILURE; |
| 7003 | } |
| 7004 | |
| 7005 | len = sizeof(tSirRegisterMgmtFrame) + matchLen; |
| 7006 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7007 | pMsg = vos_mem_malloc(len); |
| 7008 | if ( NULL == pMsg ) |
| 7009 | status = eHAL_STATUS_FAILURE; |
| 7010 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7011 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7012 | vos_mem_set(pMsg, len, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7013 | pMsg->messageType = eWNI_SME_REGISTER_MGMT_FRAME_REQ; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7014 | pMsg->length = len; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7015 | pMsg->registerFrame = VOS_FALSE; |
| 7016 | pMsg->frameType = frameType; |
| 7017 | pMsg->matchLen = matchLen; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7018 | vos_mem_copy(pMsg->matchData, matchData, matchLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7019 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 7020 | } |
| 7021 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7022 | } |
| 7023 | return status; |
| 7024 | } |
| 7025 | |
| 7026 | /* --------------------------------------------------------------------------- |
| 7027 | \fn sme_RemainOnChannel |
| 7028 | \brief API to request remain on channel for 'x' duration. used in p2p in listen state |
| 7029 | \param hHal - The handle returned by macOpen. |
| 7030 | \param pRequest - channel |
| 7031 | \param duration - duration in ms |
| 7032 | \param callback - HDD registered callback to process reaminOnChannelRsp |
| 7033 | \param context - HDD Callback param |
| 7034 | \return eHalStatus |
| 7035 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7036 | eHalStatus sme_RemainOnChannel(tHalHandle hHal, tANI_U8 sessionId, |
| 7037 | tANI_U8 channel, tANI_U32 duration, |
Gopichand Nakkala | 924e455 | 2013-05-08 19:18:14 +0530 | [diff] [blame] | 7038 | remainOnChanCallback callback, |
| 7039 | void *pContext, |
| 7040 | tANI_U8 isP2PProbeReqAllowed) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7041 | { |
| 7042 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7043 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7044 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7045 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7046 | TRACE_CODE_SME_RX_HDD_REMAIN_ONCHAN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7047 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7048 | { |
Gopichand Nakkala | 924e455 | 2013-05-08 19:18:14 +0530 | [diff] [blame] | 7049 | status = p2pRemainOnChannel (hHal, sessionId, channel, duration, callback, pContext, |
| 7050 | isP2PProbeReqAllowed |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7051 | #ifdef WLAN_FEATURE_P2P_INTERNAL |
| 7052 | , eP2PRemainOnChnReasonUnknown |
| 7053 | #endif |
| 7054 | ); |
| 7055 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7056 | } |
| 7057 | return(status); |
| 7058 | } |
| 7059 | |
| 7060 | /* --------------------------------------------------------------------------- |
| 7061 | \fn sme_ReportProbeReq |
| 7062 | \brief API to enable/disable forwarding of probeReq to apps in p2p. |
| 7063 | \param hHal - The handle returned by macOpen. |
| 7064 | \param falg: to set the Probe request forarding to wpa_supplicant in listen state in p2p |
| 7065 | \return eHalStatus |
| 7066 | ---------------------------------------------------------------------------*/ |
| 7067 | |
| 7068 | #ifndef WLAN_FEATURE_CONCURRENT_P2P |
| 7069 | eHalStatus sme_ReportProbeReq(tHalHandle hHal, tANI_U8 flag) |
| 7070 | { |
| 7071 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7072 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7073 | |
| 7074 | do |
| 7075 | { |
| 7076 | //acquire the lock for the sme object |
| 7077 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 7078 | if(HAL_STATUS_SUCCESS(status)) |
| 7079 | { |
| 7080 | /* call set in context */ |
| 7081 | pMac->p2pContext.probeReqForwarding = flag; |
| 7082 | //release the lock for the sme object |
| 7083 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7084 | } |
| 7085 | } while(0); |
| 7086 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7087 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7088 | |
| 7089 | return(status); |
| 7090 | } |
| 7091 | |
| 7092 | /* --------------------------------------------------------------------------- |
| 7093 | \fn sme_updateP2pIe |
| 7094 | \brief API to set the P2p Ie in p2p context |
| 7095 | \param hHal - The handle returned by macOpen. |
| 7096 | \param p2pIe - Ptr to p2pIe from HDD. |
| 7097 | \param p2pIeLength: length of p2pIe |
| 7098 | \return eHalStatus |
| 7099 | ---------------------------------------------------------------------------*/ |
| 7100 | |
| 7101 | eHalStatus sme_updateP2pIe(tHalHandle hHal, void *p2pIe, tANI_U32 p2pIeLength) |
| 7102 | { |
| 7103 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7104 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7105 | |
| 7106 | //acquire the lock for the sme object |
| 7107 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 7108 | if(HAL_STATUS_SUCCESS(status)) |
| 7109 | { |
| 7110 | if(NULL != pMac->p2pContext.probeRspIe){ |
| 7111 | vos_mem_free(pMac->p2pContext.probeRspIe); |
| 7112 | pMac->p2pContext.probeRspIeLength = 0; |
| 7113 | } |
| 7114 | |
| 7115 | pMac->p2pContext.probeRspIe = vos_mem_malloc(p2pIeLength); |
| 7116 | if (NULL == pMac->p2pContext.probeRspIe) |
| 7117 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7118 | smsLog(pMac, LOGE, "%s: Unable to allocate P2P IE", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7119 | pMac->p2pContext.probeRspIeLength = 0; |
| 7120 | status = eHAL_STATUS_FAILURE; |
| 7121 | } |
| 7122 | else |
| 7123 | { |
| 7124 | pMac->p2pContext.probeRspIeLength = p2pIeLength; |
| 7125 | |
| 7126 | sirDumpBuf( pMac, SIR_LIM_MODULE_ID, LOG2, |
| 7127 | pMac->p2pContext.probeRspIe, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7128 | pMac->p2pContext.probeRspIeLength ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7129 | vos_mem_copy((tANI_U8 *)pMac->p2pContext.probeRspIe, p2pIe, |
| 7130 | p2pIeLength); |
| 7131 | } |
| 7132 | |
| 7133 | //release the lock for the sme object |
| 7134 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7135 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7136 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7137 | smsLog(pMac, LOG2, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7138 | |
| 7139 | return(status); |
| 7140 | } |
| 7141 | #endif |
| 7142 | |
| 7143 | /* --------------------------------------------------------------------------- |
| 7144 | \fn sme_sendAction |
| 7145 | \brief API to send action frame from supplicant. |
| 7146 | \param hHal - The handle returned by macOpen. |
| 7147 | \return eHalStatus |
| 7148 | ---------------------------------------------------------------------------*/ |
| 7149 | |
| 7150 | eHalStatus sme_sendAction(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7151 | const tANI_U8 *pBuf, tANI_U32 len, |
| 7152 | tANI_U16 wait, tANI_BOOLEAN noack) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7153 | { |
| 7154 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7155 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7156 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7157 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7158 | TRACE_CODE_SME_RX_HDD_SEND_ACTION, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7159 | //acquire the lock for the sme object |
| 7160 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 7161 | if(HAL_STATUS_SUCCESS(status)) |
| 7162 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7163 | p2pSendAction(hHal, sessionId, pBuf, len, wait, noack); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7164 | //release the lock for the sme object |
| 7165 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7166 | } |
| 7167 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7168 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7169 | |
| 7170 | return(status); |
| 7171 | } |
| 7172 | |
| 7173 | eHalStatus sme_CancelRemainOnChannel(tHalHandle hHal, tANI_U8 sessionId ) |
| 7174 | { |
| 7175 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7176 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7177 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7178 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7179 | TRACE_CODE_SME_RX_HDD_CANCEL_REMAIN_ONCHAN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7180 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7181 | { |
| 7182 | status = p2pCancelRemainOnChannel (hHal, sessionId); |
| 7183 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7184 | } |
| 7185 | return(status); |
| 7186 | } |
| 7187 | |
| 7188 | //Power Save Related |
| 7189 | eHalStatus sme_p2pSetPs(tHalHandle hHal, tP2pPsConfig * data) |
| 7190 | { |
| 7191 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7192 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7193 | |
| 7194 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7195 | { |
| 7196 | status = p2pSetPs (hHal, data); |
| 7197 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7198 | } |
| 7199 | return(status); |
| 7200 | } |
| 7201 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7202 | |
| 7203 | /* --------------------------------------------------------------------------- |
| 7204 | |
| 7205 | \fn sme_ConfigureRxpFilter |
| 7206 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7207 | \brief |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7208 | SME will pass this request to lower mac to set/reset the filter on RXP for |
| 7209 | multicast & broadcast traffic. |
| 7210 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7211 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7212 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7213 | hHal - The handle returned by macOpen. |
| 7214 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7215 | filterMask- Currently the API takes a 1 or 0 (set or reset) as filter. |
| 7216 | Basically to enable/disable the filter (to filter "all" mcbc traffic) based |
| 7217 | on this param. In future we can use this as a mask to set various types of |
| 7218 | filters as suggested below: |
| 7219 | FILTER_ALL_MULTICAST: |
| 7220 | FILTER_ALL_BROADCAST: |
| 7221 | FILTER_ALL_MULTICAST_BROADCAST: |
| 7222 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7223 | |
| 7224 | \return eHalStatus |
| 7225 | |
| 7226 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7227 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7228 | eHalStatus sme_ConfigureRxpFilter( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7229 | tpSirWlanSetRxpFilters wlanRxpFilterParam) |
| 7230 | { |
| 7231 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7232 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 7233 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7234 | vos_msg_t vosMessage; |
| 7235 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7236 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7237 | TRACE_CODE_SME_RX_HDD_CONFIG_RXPFIL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7238 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7239 | { |
| 7240 | /* serialize the req through MC thread */ |
| 7241 | vosMessage.bodyptr = wlanRxpFilterParam; |
| 7242 | vosMessage.type = WDA_CFG_RXP_FILTER_REQ; |
| 7243 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 7244 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 7245 | { |
| 7246 | status = eHAL_STATUS_FAILURE; |
| 7247 | } |
| 7248 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7249 | } |
| 7250 | return(status); |
| 7251 | } |
| 7252 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7253 | /* --------------------------------------------------------------------------- |
| 7254 | |
| 7255 | \fn sme_ConfigureSuspendInd |
| 7256 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7257 | \brief |
| 7258 | 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] | 7259 | be suspended |
| 7260 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7261 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7262 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7263 | hHal - The handle returned by macOpen. |
| 7264 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7265 | wlanSuspendParam- Depicts the wlan suspend params |
| 7266 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7267 | |
| 7268 | \return eHalStatus |
| 7269 | |
| 7270 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7271 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7272 | eHalStatus sme_ConfigureSuspendInd( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7273 | tpSirWlanSuspendParam wlanSuspendParam) |
| 7274 | { |
| 7275 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7276 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 7277 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7278 | vos_msg_t vosMessage; |
| 7279 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7280 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7281 | TRACE_CODE_SME_RX_HDD_CONFIG_SUSPENDIND, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7282 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7283 | { |
| 7284 | /* serialize the req through MC thread */ |
| 7285 | vosMessage.bodyptr = wlanSuspendParam; |
| 7286 | vosMessage.type = WDA_WLAN_SUSPEND_IND; |
| 7287 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 7288 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 7289 | { |
| 7290 | status = eHAL_STATUS_FAILURE; |
| 7291 | } |
| 7292 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7293 | } |
| 7294 | return(status); |
| 7295 | } |
| 7296 | |
| 7297 | /* --------------------------------------------------------------------------- |
| 7298 | |
| 7299 | \fn sme_ConfigureResumeReq |
| 7300 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7301 | \brief |
| 7302 | 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] | 7303 | be Resumed |
| 7304 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7305 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7306 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7307 | hHal - The handle returned by macOpen. |
| 7308 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7309 | wlanResumeParam- Depicts the wlan resume params |
| 7310 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7311 | |
| 7312 | \return eHalStatus |
| 7313 | |
| 7314 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7315 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7316 | eHalStatus sme_ConfigureResumeReq( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7317 | tpSirWlanResumeParam wlanResumeParam) |
| 7318 | { |
| 7319 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7320 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 7321 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7322 | vos_msg_t vosMessage; |
| 7323 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7324 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7325 | TRACE_CODE_SME_RX_HDD_CONFIG_RESUMEREQ, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7326 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7327 | { |
| 7328 | /* serialize the req through MC thread */ |
| 7329 | vosMessage.bodyptr = wlanResumeParam; |
| 7330 | vosMessage.type = WDA_WLAN_RESUME_REQ; |
| 7331 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 7332 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 7333 | { |
| 7334 | status = eHAL_STATUS_FAILURE; |
| 7335 | } |
| 7336 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7337 | } |
| 7338 | return(status); |
| 7339 | } |
| 7340 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7341 | /* --------------------------------------------------------------------------- |
| 7342 | |
| 7343 | \fn sme_GetInfraSessionId |
| 7344 | |
| 7345 | \brief To get the session ID for infra session, if connected |
| 7346 | This is a synchronous API. |
| 7347 | |
| 7348 | \param hHal - The handle returned by macOpen. |
| 7349 | |
| 7350 | \return sessionid, -1 if infra session is not connected |
| 7351 | |
| 7352 | -------------------------------------------------------------------------------*/ |
| 7353 | tANI_S8 sme_GetInfraSessionId(tHalHandle hHal) |
| 7354 | { |
| 7355 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7356 | tANI_S8 sessionid = -1; |
| 7357 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7358 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7359 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7360 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7361 | { |
| 7362 | |
| 7363 | sessionid = csrGetInfraSessionId( pMac); |
| 7364 | |
| 7365 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7366 | } |
| 7367 | |
| 7368 | return (sessionid); |
| 7369 | } |
| 7370 | |
| 7371 | /* --------------------------------------------------------------------------- |
| 7372 | |
| 7373 | \fn sme_GetInfraOperationChannel |
| 7374 | |
| 7375 | \brief To get the operating channel for infra session, if connected |
| 7376 | This is a synchronous API. |
| 7377 | |
| 7378 | \param hHal - The handle returned by macOpen. |
| 7379 | \param sessionId - the sessionId returned by sme_OpenSession. |
| 7380 | |
| 7381 | \return operating channel, 0 if infra session is not connected |
| 7382 | |
| 7383 | -------------------------------------------------------------------------------*/ |
| 7384 | tANI_U8 sme_GetInfraOperationChannel( tHalHandle hHal, tANI_U8 sessionId) |
| 7385 | { |
| 7386 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7387 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7388 | tANI_U8 channel = 0; |
| 7389 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7390 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7391 | { |
| 7392 | |
| 7393 | channel = csrGetInfraOperationChannel( pMac, sessionId); |
| 7394 | |
| 7395 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7396 | } |
| 7397 | |
| 7398 | return (channel); |
| 7399 | } |
| 7400 | |
| 7401 | //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] | 7402 | //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] | 7403 | tANI_U8 sme_GetConcurrentOperationChannel( tHalHandle hHal ) |
| 7404 | { |
| 7405 | eHalStatus status = eHAL_STATUS_FAILURE; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7406 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7407 | tANI_U8 channel = 0; |
| 7408 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7409 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7410 | { |
| 7411 | |
| 7412 | channel = csrGetConcurrentOperationChannel( pMac ); |
| 7413 | 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] | 7414 | " Other Concurrent Channel = %d", __func__,channel); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7415 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7416 | } |
| 7417 | |
| 7418 | return (channel); |
| 7419 | } |
| 7420 | |
| 7421 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 7422 | /****************************************************************************** |
| 7423 | * |
| 7424 | * Name: sme_PreferredNetworkFoundInd |
| 7425 | * |
| 7426 | * Description: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7427 | * Invoke Preferred Network Found Indication |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7428 | * |
| 7429 | * Parameters: |
| 7430 | * hHal - HAL handle for device |
| 7431 | * pMsg - found network description |
| 7432 | * |
| 7433 | * Returns: eHalStatus |
| 7434 | * |
| 7435 | ******************************************************************************/ |
| 7436 | eHalStatus sme_PreferredNetworkFoundInd (tHalHandle hHal, void* pMsg) |
| 7437 | { |
| 7438 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7439 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7440 | tSirPrefNetworkFoundInd *pPrefNetworkFoundInd = (tSirPrefNetworkFoundInd *)pMsg; |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7441 | v_U8_t dumpSsId[SIR_MAC_MAX_SSID_LENGTH + 1]; |
| 7442 | tANI_U8 ssIdLength = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7443 | |
| 7444 | if (NULL == pMsg) |
| 7445 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7446 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7447 | status = eHAL_STATUS_FAILURE; |
| 7448 | } |
| 7449 | else |
| 7450 | { |
| 7451 | if (pPrefNetworkFoundInd->ssId.length > 0) |
| 7452 | { |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7453 | ssIdLength = CSR_MIN(SIR_MAC_MAX_SSID_LENGTH, |
| 7454 | pPrefNetworkFoundInd->ssId.length); |
| 7455 | vos_mem_copy(dumpSsId, pPrefNetworkFoundInd->ssId.ssId, ssIdLength); |
| 7456 | dumpSsId[ssIdLength] = 0; |
Abhishek Singh | 195c03e | 2014-05-14 17:21:30 +0530 | [diff] [blame] | 7457 | smsLog(pMac, LOG1, FL(" SSID=%s frame length %d"), |
| 7458 | dumpSsId, pPrefNetworkFoundInd->frameLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7459 | |
Vinay Krishna Eranna | b13043b | 2013-12-06 11:50:21 +0530 | [diff] [blame] | 7460 | /* Flush scan results, So as to avoid indication/updation of |
| 7461 | * stale entries, which may not have aged out during APPS collapse |
| 7462 | */ |
| 7463 | sme_ScanFlushResult(hHal,0); |
| 7464 | |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7465 | //Save the frame to scan result |
| 7466 | if (pPrefNetworkFoundInd->mesgLen > sizeof(tSirPrefNetworkFoundInd)) |
| 7467 | { |
| 7468 | //we may have a frame |
| 7469 | status = csrScanSavePreferredNetworkFound(pMac, |
| 7470 | pPrefNetworkFoundInd); |
| 7471 | if (!HAL_STATUS_SUCCESS(status)) |
| 7472 | { |
| 7473 | smsLog(pMac, LOGE, FL(" fail to save preferred network")); |
| 7474 | } |
| 7475 | } |
| 7476 | else |
| 7477 | { |
Jeff Johnson | afeb958 | 2013-11-22 18:39:00 -0800 | [diff] [blame] | 7478 | smsLog(pMac, LOGE, FL(" not enough data length %u needed %zu"), |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7479 | pPrefNetworkFoundInd->mesgLen, sizeof(tSirPrefNetworkFoundInd)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7480 | } |
| 7481 | |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7482 | /* Call Preferred Netowrk Found Indication callback routine. */ |
| 7483 | if (HAL_STATUS_SUCCESS(status) && (pMac->pmc.prefNetwFoundCB != NULL)) |
| 7484 | { |
| 7485 | pMac->pmc.prefNetwFoundCB( |
| 7486 | pMac->pmc.preferredNetworkFoundIndCallbackContext, |
| 7487 | pPrefNetworkFoundInd); |
| 7488 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7489 | } |
| 7490 | else |
| 7491 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7492 | smsLog(pMac, LOGE, "%s: callback failed - SSID is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7493 | status = eHAL_STATUS_FAILURE; |
| 7494 | } |
| 7495 | } |
| 7496 | |
| 7497 | |
| 7498 | return(status); |
| 7499 | } |
| 7500 | |
| 7501 | #endif // FEATURE_WLAN_SCAN_PNO |
| 7502 | |
| 7503 | |
| 7504 | eHalStatus sme_GetCfgValidChannels(tHalHandle hHal, tANI_U8 *aValidChannels, tANI_U32 *len) |
| 7505 | { |
| 7506 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7507 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7508 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7509 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7510 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7511 | { |
| 7512 | status = csrGetCfgValidChannels(pMac, aValidChannels, len); |
| 7513 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7514 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7515 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7516 | return (status); |
| 7517 | } |
| 7518 | |
| 7519 | |
| 7520 | /* --------------------------------------------------------------------------- |
| 7521 | |
| 7522 | \fn sme_SetTxPerTracking |
| 7523 | |
| 7524 | \brief Set Tx PER tracking configuration parameters |
| 7525 | |
| 7526 | \param hHal - The handle returned by macOpen. |
| 7527 | \param pTxPerTrackingConf - Tx PER configuration parameters |
| 7528 | |
| 7529 | \return eHalStatus |
| 7530 | |
| 7531 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7532 | eHalStatus sme_SetTxPerTracking(tHalHandle hHal, |
| 7533 | void (*pCallbackfn) (void *pCallbackContext), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7534 | void *pCallbackContext, |
| 7535 | tpSirTxPerTrackingParam pTxPerTrackingParam) |
| 7536 | { |
| 7537 | vos_msg_t msg; |
| 7538 | tpSirTxPerTrackingParam pTxPerTrackingParamReq = NULL; |
| 7539 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7540 | |
| 7541 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 7542 | { |
| 7543 | pMac->sme.pTxPerHitCallback = pCallbackfn; |
| 7544 | pMac->sme.pTxPerHitCbContext = pCallbackContext; |
| 7545 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7546 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7547 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7548 | // free this memory in failure case or WDA request callback function |
| 7549 | pTxPerTrackingParamReq = vos_mem_malloc(sizeof(tSirTxPerTrackingParam)); |
| 7550 | if (NULL == pTxPerTrackingParamReq) |
| 7551 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7552 | 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] | 7553 | return eHAL_STATUS_FAILURE; |
| 7554 | } |
| 7555 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7556 | vos_mem_copy(pTxPerTrackingParamReq, (void*)pTxPerTrackingParam, |
| 7557 | sizeof(tSirTxPerTrackingParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7558 | msg.type = WDA_SET_TX_PER_TRACKING_REQ; |
| 7559 | msg.reserved = 0; |
| 7560 | msg.bodyptr = pTxPerTrackingParamReq; |
| 7561 | |
| 7562 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 7563 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7564 | 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] | 7565 | vos_mem_free(pTxPerTrackingParamReq); |
| 7566 | return eHAL_STATUS_FAILURE; |
| 7567 | } |
| 7568 | |
| 7569 | return eHAL_STATUS_SUCCESS; |
| 7570 | } |
| 7571 | |
| 7572 | /* --------------------------------------------------------------------------- |
| 7573 | |
| 7574 | \fn sme_HandleChangeCountryCode |
| 7575 | |
| 7576 | \brief Change Country code, Reg Domain and channel list |
| 7577 | |
| 7578 | \details Country Code Priority |
| 7579 | 0 = 11D > Configured Country > NV |
| 7580 | 1 = Configured Country > 11D > NV |
| 7581 | If Supplicant country code is priority than 11d is disabled. |
| 7582 | If 11D is enabled, we update the country code after every scan. |
| 7583 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 7584 | Country code from Supplicant is set as current courtry code. |
| 7585 | User can send reset command XX (instead of country code) to reset the |
| 7586 | country code to default values which is read from NV. |
| 7587 | In case of reset, 11D is enabled and default NV code is Set as current country code |
| 7588 | If 11D is priority, |
| 7589 | Than Supplicant country code code is set to default code. But 11D code is set as current country code |
| 7590 | |
| 7591 | \param pMac - The handle returned by macOpen. |
| 7592 | \param pMsgBuf - MSG Buffer |
| 7593 | |
| 7594 | \return eHalStatus |
| 7595 | |
| 7596 | -------------------------------------------------------------------------------*/ |
| 7597 | eHalStatus sme_HandleChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf) |
| 7598 | { |
| 7599 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7600 | tAniChangeCountryCodeReq *pMsg; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7601 | v_REGDOMAIN_t domainIdIoctl; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7602 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 7603 | static uNvTables nvTables; |
| 7604 | pMsg = (tAniChangeCountryCodeReq *)pMsgBuf; |
| 7605 | |
| 7606 | |
| 7607 | /* if the reset Supplicant country code command is triggered, enable 11D, reset the NV country code and return */ |
| 7608 | if( VOS_TRUE == vos_mem_compare(pMsg->countryCode, SME_INVALID_COUNTRY_CODE, 2) ) |
| 7609 | { |
| 7610 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 7611 | |
| 7612 | vosStatus = vos_nv_readDefaultCountryTable( &nvTables ); |
| 7613 | |
| 7614 | /* read the country code from NV and use it */ |
| 7615 | if ( VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 7616 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7617 | vos_mem_copy(pMsg->countryCode, |
| 7618 | nvTables.defaultCountryTable.countryCode, |
| 7619 | WNI_CFG_COUNTRY_CODE_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7620 | } |
| 7621 | else |
| 7622 | { |
| 7623 | status = eHAL_STATUS_FAILURE; |
| 7624 | return status; |
| 7625 | } |
Abhishek Singh | 4d6b54c | 2014-10-14 12:31:00 +0530 | [diff] [blame] | 7626 | /* Update the 11d country to default country from NV bin so that when |
| 7627 | * callback is received for this default country, driver will not |
| 7628 | * disable the 11d taking it as valid country by user. |
| 7629 | */ |
| 7630 | smsLog(pMac, LOG1, |
| 7631 | FL("Set default country code (%c%c) from NV as invalid country received"), |
| 7632 | pMsg->countryCode[0],pMsg->countryCode[1]); |
| 7633 | vos_mem_copy(pMac->scan.countryCode11d, pMsg->countryCode, |
| 7634 | WNI_CFG_COUNTRY_CODE_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7635 | } |
| 7636 | else |
| 7637 | { |
| 7638 | /* if Supplicant country code has priority, disable 11d */ |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 7639 | if(pMac->roam.configParam.fSupplicantCountryCodeHasPriority && |
| 7640 | pMsg->countryFromUserSpace) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7641 | { |
| 7642 | pMac->roam.configParam.Is11dSupportEnabled = eANI_BOOLEAN_FALSE; |
| 7643 | } |
| 7644 | } |
| 7645 | |
| 7646 | /* WEXT set country code means |
| 7647 | * 11D should be supported? |
| 7648 | * 11D Channel should be enforced? |
| 7649 | * 11D Country code should be matched? |
| 7650 | * 11D Reg Domian should be matched? |
| 7651 | * Country string changed */ |
| 7652 | if(pMac->roam.configParam.Is11dSupportEnabled && |
| 7653 | pMac->roam.configParam.fEnforce11dChannels && |
| 7654 | pMac->roam.configParam.fEnforceCountryCodeMatch && |
| 7655 | pMac->roam.configParam.fEnforceDefaultDomain && |
| 7656 | !csrSave11dCountryString(pMac, pMsg->countryCode, eANI_BOOLEAN_TRUE)) |
| 7657 | { |
| 7658 | /* All 11D related options are already enabled |
| 7659 | * Country string is not changed |
| 7660 | * Do not need do anything for country code change request */ |
| 7661 | return eHAL_STATUS_SUCCESS; |
| 7662 | } |
| 7663 | |
| 7664 | /* Set Current Country code and Current Regulatory domain */ |
| 7665 | status = csrSetCountryCode(pMac, pMsg->countryCode, NULL); |
| 7666 | if(eHAL_STATUS_SUCCESS != status) |
| 7667 | { |
| 7668 | /* Supplicant country code failed. So give 11D priority */ |
| 7669 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 7670 | smsLog(pMac, LOGE, "Set Country Code Fail %d", status); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7671 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7672 | } |
| 7673 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7674 | /* overwrite the defualt country code */ |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7675 | vos_mem_copy(pMac->scan.countryCodeDefault, |
| 7676 | pMac->scan.countryCodeCurrent, |
| 7677 | WNI_CFG_COUNTRY_CODE_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7678 | |
| 7679 | /* Get Domain ID from country code */ |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7680 | status = csrGetRegulatoryDomainForCountry(pMac, |
| 7681 | pMac->scan.countryCodeCurrent, |
| 7682 | (v_REGDOMAIN_t *) &domainIdIoctl, |
| 7683 | COUNTRY_QUERY); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7684 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7685 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7686 | smsLog( pMac, LOGE, FL(" fail to get regId %d"), domainIdIoctl ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7687 | return status; |
| 7688 | } |
Tushnim Bhattacharyya | 796ffe8 | 2013-11-05 16:31:36 -0800 | [diff] [blame] | 7689 | else if (REGDOMAIN_WORLD == domainIdIoctl) |
| 7690 | { |
| 7691 | /* Supplicant country code is invalid, so we are on world mode now. So |
| 7692 | give 11D chance to update */ |
| 7693 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 7694 | smsLog(pMac, LOG1, FL("Country Code unrecognized by driver")); |
| 7695 | } |
| 7696 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7697 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 7698 | status = WDA_SetRegDomain(pMac, domainIdIoctl, pMsg->sendRegHint); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7699 | |
| 7700 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7701 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7702 | smsLog( pMac, LOGE, FL(" fail to set regId %d"), domainIdIoctl ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7703 | return status; |
| 7704 | } |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7705 | else |
| 7706 | { |
| 7707 | //if 11d has priority, clear currentCountryBssid & countryCode11d to get |
| 7708 | //set again if we find AP with 11d info during scan |
| 7709 | if (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority) |
| 7710 | { |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7711 | smsLog( pMac, LOGW, FL("Clearing currentCountryBssid, countryCode11d")); |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7712 | vos_mem_zero(&pMac->scan.currentCountryBssid, sizeof(tCsrBssid)); |
| 7713 | vos_mem_zero( pMac->scan.countryCode11d, sizeof( pMac->scan.countryCode11d ) ); |
| 7714 | } |
| 7715 | } |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7716 | #ifndef CONFIG_ENABLE_LINUX_REG |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7717 | /* set to default domain ID */ |
| 7718 | pMac->scan.domainIdDefault = pMac->scan.domainIdCurrent; |
| 7719 | |
| 7720 | /* get the channels based on new cc */ |
| 7721 | status = csrInitGetChannels( pMac ); |
| 7722 | |
| 7723 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7724 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7725 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7726 | return status; |
| 7727 | } |
| 7728 | |
| 7729 | /* reset info based on new cc, and we are done */ |
Gopichand Nakkala | b9185f2 | 2012-12-21 08:03:42 -0800 | [diff] [blame] | 7730 | csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7731 | /* Country code Changed, Purge Only scan result |
| 7732 | * which does not have channel number belong to 11d |
| 7733 | * channel list |
| 7734 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 7735 | csrScanFilterResults(pMac); |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7736 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7737 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7738 | if( pMsg->changeCCCallback ) |
| 7739 | { |
| 7740 | ((tSmeChangeCountryCallback)(pMsg->changeCCCallback))((void *)pMsg->pDevContext); |
| 7741 | } |
| 7742 | |
| 7743 | return eHAL_STATUS_SUCCESS; |
| 7744 | } |
| 7745 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7746 | /* --------------------------------------------------------------------------- |
| 7747 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7748 | \fn sme_HandleChangeCountryCodeByUser |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7749 | |
| 7750 | \brief Change Country code, Reg Domain and channel list |
| 7751 | |
| 7752 | If Supplicant country code is priority than 11d is disabled. |
| 7753 | If 11D is enabled, we update the country code after every scan. |
| 7754 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 7755 | Country code from Supplicant is set as current country code. |
| 7756 | |
| 7757 | \param pMac - The handle returned by macOpen. |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7758 | \param pMsg - Carrying new CC & domain set in kernel by user |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7759 | |
| 7760 | \return eHalStatus |
| 7761 | |
| 7762 | -------------------------------------------------------------------------------*/ |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7763 | eHalStatus sme_HandleChangeCountryCodeByUser(tpAniSirGlobal pMac, |
| 7764 | tAniGenericChangeCountryCodeReq *pMsg) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7765 | { |
| 7766 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7767 | v_REGDOMAIN_t reg_domain_id; |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7768 | v_BOOL_t is11dCountry = VOS_FALSE; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7769 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7770 | smsLog(pMac, LOG1, FL(" called")); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7771 | reg_domain_id = (v_REGDOMAIN_t)pMsg->domain_index; |
| 7772 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7773 | if (memcmp(pMsg->countryCode, pMac->scan.countryCode11d, |
| 7774 | VOS_COUNTRY_CODE_LEN) == 0) |
| 7775 | { |
| 7776 | is11dCountry = VOS_TRUE; |
| 7777 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7778 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 7779 | /* Set the country code given by userspace when 11dOriginal is FALSE |
| 7780 | * when 11doriginal is True,is11dCountry =0 and |
| 7781 | * fSupplicantCountryCodeHasPriority = 0, then revert the country code, |
| 7782 | * and return failure |
| 7783 | */ |
| 7784 | if (pMac->roam.configParam.Is11dSupportEnabledOriginal == true) |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7785 | { |
Abhishek Singh | 2ec36ab | 2014-08-07 16:14:25 +0530 | [diff] [blame] | 7786 | if ((!is11dCountry) && (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority)&& |
| 7787 | (!pMac->roam.configParam.fEnforceCountryCode) ) |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 7788 | { |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7789 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 7790 | smsLog( pMac, LOGW, FL(" incorrect country being set, nullify this request")); |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7791 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 7792 | status = csrGetRegulatoryDomainForCountry(pMac, |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7793 | pMac->scan.countryCode11d, |
| 7794 | (v_REGDOMAIN_t *) ®_domain_id, |
| 7795 | COUNTRY_IE); |
| 7796 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 7797 | return eHAL_STATUS_FAILURE; |
| 7798 | } |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7799 | } |
Abhishek Singh | 2ec36ab | 2014-08-07 16:14:25 +0530 | [diff] [blame] | 7800 | pMac->roam.configParam.fEnforceCountryCode = eANI_BOOLEAN_FALSE; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7801 | /* if Supplicant country code has priority, disable 11d */ |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7802 | if (!is11dCountry && pMac->roam.configParam.fSupplicantCountryCodeHasPriority) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7803 | { |
| 7804 | pMac->roam.configParam.Is11dSupportEnabled = eANI_BOOLEAN_FALSE; |
Agarwal Ashish | cd9b8e6 | 2014-07-21 19:48:24 +0530 | [diff] [blame] | 7805 | smsLog( pMac, LOG1, FL(" 11d is being disabled")); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7806 | } |
| 7807 | |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7808 | vos_mem_copy(pMac->scan.countryCodeCurrent, pMsg->countryCode, |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7809 | WNI_CFG_COUNTRY_CODE_LEN); |
| 7810 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 7811 | status = WDA_SetRegDomain(pMac, reg_domain_id, eSIR_TRUE); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7812 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7813 | if (VOS_FALSE == is11dCountry ) |
| 7814 | { |
| 7815 | /* overwrite the defualt country code */ |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7816 | vos_mem_copy(pMac->scan.countryCodeDefault, |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7817 | pMac->scan.countryCodeCurrent, WNI_CFG_COUNTRY_CODE_LEN); |
| 7818 | /* set to default domain ID */ |
| 7819 | pMac->scan.domainIdDefault = pMac->scan.domainIdCurrent; |
| 7820 | } |
| 7821 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7822 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7823 | { |
| 7824 | smsLog( pMac, LOGE, FL(" fail to set regId %d"), reg_domain_id ); |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7825 | return status; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7826 | } |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7827 | else |
| 7828 | { |
| 7829 | //if 11d has priority, clear currentCountryBssid & countryCode11d to get |
| 7830 | //set again if we find AP with 11d info during scan |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7831 | if((!pMac->roam.configParam.fSupplicantCountryCodeHasPriority) && |
| 7832 | (VOS_FALSE == is11dCountry )) |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7833 | { |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7834 | smsLog( pMac, LOGW, FL("Clearing currentCountryBssid, countryCode11d")); |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7835 | vos_mem_zero(&pMac->scan.currentCountryBssid, sizeof(tCsrBssid)); |
| 7836 | vos_mem_zero( pMac->scan.countryCode11d, sizeof( pMac->scan.countryCode11d ) ); |
| 7837 | } |
| 7838 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7839 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7840 | /* get the channels based on new cc */ |
| 7841 | status = csrInitGetChannels(pMac); |
| 7842 | |
| 7843 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7844 | { |
| 7845 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
| 7846 | return status; |
| 7847 | } |
| 7848 | |
| 7849 | /* reset info based on new cc, and we are done */ |
| 7850 | csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7851 | if (VOS_TRUE == is11dCountry) |
| 7852 | { |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7853 | pMac->scan.f11dInfoApplied = eANI_BOOLEAN_TRUE; |
| 7854 | pMac->scan.f11dInfoReset = eANI_BOOLEAN_FALSE; |
| 7855 | } |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7856 | /* Country code Changed, Purge Only scan result |
| 7857 | * which does not have channel number belong to 11d |
| 7858 | * channel list |
| 7859 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 7860 | csrScanFilterResults(pMac); |
Kiet Lam | bd5cd9b | 2013-11-11 19:01:45 +0530 | [diff] [blame] | 7861 | // Do active scans after the country is set by User hints or Country IE |
| 7862 | pMac->scan.curScanType = eSIR_ACTIVE_SCAN; |
Sushant Kaushik | 1d73256 | 2014-05-21 14:15:37 +0530 | [diff] [blame] | 7863 | sme_DisconnectConnectedSessions(pMac); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7864 | smsLog(pMac, LOG1, FL(" returned")); |
| 7865 | return eHAL_STATUS_SUCCESS; |
| 7866 | } |
| 7867 | |
| 7868 | /* --------------------------------------------------------------------------- |
| 7869 | |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7870 | \fn sme_HandleChangeCountryCodeByCore |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7871 | |
| 7872 | \brief Update Country code in the driver if set by kernel as world |
| 7873 | |
| 7874 | If 11D is enabled, we update the country code after every scan & notify kernel. |
| 7875 | This is to make sure kernel & driver are in sync in case of CC found in |
| 7876 | driver but not in kernel database |
| 7877 | |
| 7878 | \param pMac - The handle returned by macOpen. |
| 7879 | \param pMsg - Carrying new CC set in kernel |
| 7880 | |
| 7881 | \return eHalStatus |
| 7882 | |
| 7883 | -------------------------------------------------------------------------------*/ |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7884 | eHalStatus sme_HandleChangeCountryCodeByCore(tpAniSirGlobal pMac, tAniGenericChangeCountryCodeReq *pMsg) |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7885 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7886 | eHalStatus status; |
| 7887 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7888 | smsLog(pMac, LOG1, FL(" called")); |
| 7889 | |
| 7890 | //this is to make sure kernel & driver are in sync in case of CC found in |
| 7891 | //driver but not in kernel database |
| 7892 | if (('0' == pMsg->countryCode[0]) && ('0' == pMsg->countryCode[1])) |
| 7893 | { |
Tushnim Bhattacharyya | 582ac1d | 2013-11-07 23:44:09 -0800 | [diff] [blame] | 7894 | smsLog( pMac, LOGW, FL("Setting countryCode11d & countryCodeCurrent to world CC")); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7895 | vos_mem_copy(pMac->scan.countryCode11d, pMsg->countryCode, |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7896 | WNI_CFG_COUNTRY_CODE_LEN); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7897 | vos_mem_copy(pMac->scan.countryCodeCurrent, pMsg->countryCode, |
Tushnim Bhattacharyya | 582ac1d | 2013-11-07 23:44:09 -0800 | [diff] [blame] | 7898 | WNI_CFG_COUNTRY_CODE_LEN); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7899 | } |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7900 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 7901 | status = WDA_SetRegDomain(pMac, REGDOMAIN_WORLD, eSIR_TRUE); |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7902 | |
| 7903 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7904 | { |
| 7905 | smsLog( pMac, LOGE, FL(" fail to set regId") ); |
| 7906 | return status; |
| 7907 | } |
| 7908 | else |
| 7909 | { |
| 7910 | status = csrInitGetChannels(pMac); |
| 7911 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7912 | { |
| 7913 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
| 7914 | } |
| 7915 | else |
| 7916 | { |
| 7917 | csrInitChannelList(pMac); |
| 7918 | } |
| 7919 | } |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7920 | /* Country code Changed, Purge Only scan result |
| 7921 | * which does not have channel number belong to 11d |
| 7922 | * channel list |
| 7923 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 7924 | csrScanFilterResults(pMac); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7925 | smsLog(pMac, LOG1, FL(" returned")); |
| 7926 | return eHAL_STATUS_SUCCESS; |
| 7927 | } |
| 7928 | |
| 7929 | /* --------------------------------------------------------------------------- |
| 7930 | |
Sushant Kaushik | 1d73256 | 2014-05-21 14:15:37 +0530 | [diff] [blame] | 7931 | \fn sme_DisconnectConnectedSessions |
| 7932 | |
| 7933 | \brief Disconnect STA and P2P client session if channel is not supported |
| 7934 | |
| 7935 | If new country code does not support the channel on which STA/P2P client |
| 7936 | is connetced, it sends the disconnect to the AP/P2P GO |
| 7937 | |
| 7938 | \param pMac - The handle returned by macOpen |
| 7939 | |
| 7940 | \return eHalStatus |
| 7941 | |
| 7942 | -------------------------------------------------------------------------------*/ |
| 7943 | |
| 7944 | void sme_DisconnectConnectedSessions(tpAniSirGlobal pMac) |
| 7945 | { |
| 7946 | v_U8_t i, sessionId, isChanFound = false; |
| 7947 | tANI_U8 currChannel; |
| 7948 | |
| 7949 | for (sessionId=0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++) |
| 7950 | { |
| 7951 | if (csrIsSessionClientAndConnected(pMac, sessionId)) |
| 7952 | { |
| 7953 | isChanFound = false; |
| 7954 | //Session is connected.Check the channel |
| 7955 | currChannel = csrGetInfraOperationChannel(pMac, sessionId); |
| 7956 | smsLog(pMac, LOGW, "Current Operating channel : %d, session :%d", |
| 7957 | currChannel, sessionId); |
| 7958 | for (i=0; i < pMac->scan.base20MHzChannels.numChannels; i++) |
| 7959 | { |
| 7960 | if (pMac->scan.base20MHzChannels.channelList[i] == currChannel) |
| 7961 | { |
| 7962 | isChanFound = true; |
| 7963 | break; |
| 7964 | } |
| 7965 | } |
| 7966 | |
| 7967 | if (!isChanFound) |
| 7968 | { |
| 7969 | for (i=0; i < pMac->scan.base40MHzChannels.numChannels; i++) |
| 7970 | { |
| 7971 | if (pMac->scan.base40MHzChannels.channelList[i] == currChannel) |
| 7972 | { |
| 7973 | isChanFound = true; |
| 7974 | break; |
| 7975 | } |
| 7976 | } |
| 7977 | } |
| 7978 | if (!isChanFound) |
| 7979 | { |
| 7980 | smsLog(pMac, LOGW, "%s : Disconnect Session :%d", __func__, sessionId); |
| 7981 | csrRoamDisconnect(pMac, sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); |
| 7982 | } |
| 7983 | } |
| 7984 | } |
| 7985 | } |
| 7986 | /* --------------------------------------------------------------------------- |
| 7987 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7988 | \fn sme_HandleGenericChangeCountryCode |
| 7989 | |
| 7990 | \brief Change Country code, Reg Domain and channel list |
| 7991 | |
| 7992 | If Supplicant country code is priority than 11d is disabled. |
| 7993 | If 11D is enabled, we update the country code after every scan. |
| 7994 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 7995 | Country code from kernel is set as current country code. |
| 7996 | |
| 7997 | \param pMac - The handle returned by macOpen. |
| 7998 | \param pMsgBuf - message buffer |
| 7999 | |
| 8000 | \return eHalStatus |
| 8001 | |
| 8002 | -------------------------------------------------------------------------------*/ |
| 8003 | eHalStatus sme_HandleGenericChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf) |
| 8004 | { |
| 8005 | tAniGenericChangeCountryCodeReq *pMsg; |
| 8006 | v_REGDOMAIN_t reg_domain_id; |
| 8007 | |
| 8008 | smsLog(pMac, LOG1, FL(" called")); |
| 8009 | pMsg = (tAniGenericChangeCountryCodeReq *)pMsgBuf; |
| 8010 | reg_domain_id = (v_REGDOMAIN_t)pMsg->domain_index; |
| 8011 | |
| 8012 | if (REGDOMAIN_COUNT == reg_domain_id) |
| 8013 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 8014 | sme_HandleChangeCountryCodeByCore(pMac, pMsg); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8015 | } |
| 8016 | else |
| 8017 | { |
| 8018 | sme_HandleChangeCountryCodeByUser(pMac, pMsg); |
| 8019 | } |
| 8020 | smsLog(pMac, LOG1, FL(" returned")); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 8021 | return eHAL_STATUS_SUCCESS; |
| 8022 | } |
| 8023 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8024 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 8025 | eHalStatus sme_8023MulticastList (tHalHandle hHal, tANI_U8 sessionId, tpSirRcvFltMcAddrList pMulticastAddrs) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8026 | { |
| 8027 | tpSirRcvFltMcAddrList pRequestBuf; |
| 8028 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8029 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8030 | tCsrRoamSession *pSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8031 | |
| 8032 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: " |
Gopichand Nakkala | 66c0bd0 | 2013-04-10 11:36:29 +0530 | [diff] [blame] | 8033 | "ulMulticastAddrCnt=%d, multicastAddr[0]=%p", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8034 | pMulticastAddrs->ulMulticastAddrCnt, |
| 8035 | pMulticastAddrs->multicastAddr[0]); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8036 | |
| 8037 | /* |
| 8038 | *Find the connected Infra / P2P_client connected session |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 8039 | */ |
| 8040 | if (CSR_IS_SESSION_VALID(pMac, sessionId) && |
| 8041 | csrIsConnStateInfra(pMac, sessionId)) |
| 8042 | { |
| 8043 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 8044 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8045 | |
| 8046 | if(pSession == NULL ) |
| 8047 | { |
| 8048 | 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] | 8049 | "the right session", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8050 | return eHAL_STATUS_FAILURE; |
| 8051 | } |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 8052 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8053 | pRequestBuf = vos_mem_malloc(sizeof(tSirRcvFltMcAddrList)); |
| 8054 | if (NULL == pRequestBuf) |
| 8055 | { |
| 8056 | 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] | 8057 | "allocate memory for 8023 Multicast List request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8058 | return eHAL_STATUS_FAILED_ALLOC; |
| 8059 | } |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 8060 | |
| 8061 | if( !csrIsConnStateConnectedInfra (pMac, sessionId )) |
| 8062 | { |
| 8063 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Ignoring the " |
| 8064 | "indication as we are not connected", __func__); |
| 8065 | vos_mem_free(pRequestBuf); |
| 8066 | return eHAL_STATUS_FAILURE; |
| 8067 | } |
| 8068 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8069 | vos_mem_copy(pRequestBuf, pMulticastAddrs, sizeof(tSirRcvFltMcAddrList)); |
| 8070 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8071 | vos_mem_copy(pRequestBuf->selfMacAddr, pSession->selfMacAddr, |
| 8072 | sizeof(tSirMacAddr)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8073 | vos_mem_copy(pRequestBuf->bssId, pSession->connectedProfile.bssid, |
| 8074 | sizeof(tSirMacAddr)); |
| 8075 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8076 | msg.type = WDA_8023_MULTICAST_LIST_REQ; |
| 8077 | msg.reserved = 0; |
| 8078 | msg.bodyptr = pRequestBuf; |
| 8079 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8080 | { |
| 8081 | 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] | 8082 | "post WDA_8023_MULTICAST_LIST message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8083 | vos_mem_free(pRequestBuf); |
| 8084 | return eHAL_STATUS_FAILURE; |
| 8085 | } |
| 8086 | |
| 8087 | return eHAL_STATUS_SUCCESS; |
| 8088 | } |
| 8089 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8090 | eHalStatus sme_ReceiveFilterSetFilter(tHalHandle hHal, tpSirRcvPktFilterCfgType pRcvPktFilterCfg, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8091 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8092 | { |
| 8093 | tpSirRcvPktFilterCfgType pRequestBuf; |
| 8094 | v_SINT_t allocSize; |
| 8095 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8096 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8097 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8098 | v_U8_t idx=0; |
| 8099 | |
| 8100 | 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] | 8101 | "filterId = %d", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8102 | pRcvPktFilterCfg->filterType, pRcvPktFilterCfg->filterId); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8103 | |
Madan Mohan Koyyalamudi | d402962 | 2012-10-18 20:30:17 -0700 | [diff] [blame] | 8104 | allocSize = sizeof(tSirRcvPktFilterCfgType); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8105 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8106 | pRequestBuf = vos_mem_malloc(allocSize); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8107 | |
| 8108 | if (NULL == pRequestBuf) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8109 | { |
| 8110 | 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] | 8111 | "allocate memory for Receive Filter Set Filter request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8112 | return eHAL_STATUS_FAILED_ALLOC; |
| 8113 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8114 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8115 | if( NULL == pSession ) |
| 8116 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8117 | 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] | 8118 | vos_mem_free(pRequestBuf); |
| 8119 | return eHAL_STATUS_FAILURE; |
| 8120 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8121 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8122 | vos_mem_copy(pRcvPktFilterCfg->selfMacAddr, pSession->selfMacAddr, |
| 8123 | sizeof(tSirMacAddr)); |
| 8124 | vos_mem_copy(pRcvPktFilterCfg->bssId, pSession->connectedProfile.bssid, |
| 8125 | sizeof(tSirMacAddr)); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8126 | vos_mem_copy(pRequestBuf, pRcvPktFilterCfg, allocSize); |
| 8127 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8128 | msg.type = WDA_RECEIVE_FILTER_SET_FILTER_REQ; |
| 8129 | msg.reserved = 0; |
| 8130 | msg.bodyptr = pRequestBuf; |
| 8131 | |
| 8132 | 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] | 8133 | "FT %d FID %d ", |
| 8134 | pRequestBuf->filterType, pRequestBuf->filterId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8135 | |
| 8136 | 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] | 8137 | "params %d CT %d", |
| 8138 | pRequestBuf->numFieldParams, pRequestBuf->coalesceTime); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8139 | |
| 8140 | for (idx=0; idx<pRequestBuf->numFieldParams; idx++) |
| 8141 | { |
| 8142 | |
| 8143 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8144 | "Proto %d Comp Flag %d ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8145 | pRequestBuf->paramsData[idx].protocolLayer, |
| 8146 | pRequestBuf->paramsData[idx].cmpFlag); |
| 8147 | |
| 8148 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8149 | "Data Offset %d Data Len %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8150 | pRequestBuf->paramsData[idx].dataOffset, |
| 8151 | pRequestBuf->paramsData[idx].dataLength); |
| 8152 | |
| 8153 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8154 | "CData: %d:%d:%d:%d:%d:%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8155 | pRequestBuf->paramsData[idx].compareData[0], |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8156 | pRequestBuf->paramsData[idx].compareData[1], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8157 | pRequestBuf->paramsData[idx].compareData[2], |
| 8158 | pRequestBuf->paramsData[idx].compareData[3], |
| 8159 | pRequestBuf->paramsData[idx].compareData[4], |
| 8160 | pRequestBuf->paramsData[idx].compareData[5]); |
| 8161 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8162 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8163 | "MData: %d:%d:%d:%d:%d:%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8164 | pRequestBuf->paramsData[idx].dataMask[0], |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8165 | pRequestBuf->paramsData[idx].dataMask[1], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8166 | pRequestBuf->paramsData[idx].dataMask[2], |
| 8167 | pRequestBuf->paramsData[idx].dataMask[3], |
| 8168 | pRequestBuf->paramsData[idx].dataMask[4], |
| 8169 | pRequestBuf->paramsData[idx].dataMask[5]); |
| 8170 | |
| 8171 | } |
| 8172 | |
| 8173 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8174 | { |
| 8175 | 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] | 8176 | "WDA_RECEIVE_FILTER_SET_FILTER message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8177 | vos_mem_free(pRequestBuf); |
| 8178 | return eHAL_STATUS_FAILURE; |
| 8179 | } |
| 8180 | |
| 8181 | return eHAL_STATUS_SUCCESS; |
| 8182 | } |
| 8183 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8184 | eHalStatus sme_GetFilterMatchCount(tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8185 | FilterMatchCountCallback callbackRoutine, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8186 | void *callbackContext, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8187 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8188 | { |
| 8189 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8190 | eHalStatus status; |
| 8191 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8192 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "+%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8193 | |
| 8194 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme))) |
| 8195 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8196 | pmcGetFilterMatchCount(hHal, callbackRoutine, callbackContext, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8197 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8198 | } |
| 8199 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8200 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "-%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8201 | |
| 8202 | return (status); |
| 8203 | } |
| 8204 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8205 | eHalStatus sme_ReceiveFilterClearFilter(tHalHandle hHal, tpSirRcvFltPktClearParam pRcvFltPktClearParam, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8206 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8207 | { |
| 8208 | tpSirRcvFltPktClearParam pRequestBuf; |
| 8209 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8210 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8211 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8212 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8213 | 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] | 8214 | pRcvFltPktClearParam->filterId); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8215 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8216 | pRequestBuf = vos_mem_malloc(sizeof(tSirRcvFltPktClearParam)); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8217 | if (NULL == pRequestBuf) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8218 | { |
| 8219 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8220 | "%s: Not able to allocate memory for Receive Filter " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8221 | "Clear Filter request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8222 | return eHAL_STATUS_FAILED_ALLOC; |
| 8223 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8224 | if( NULL == pSession ) |
| 8225 | { |
| 8226 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8227 | "%s: Session Not find ", __func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8228 | vos_mem_free(pRequestBuf); |
| 8229 | return eHAL_STATUS_FAILURE; |
| 8230 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8231 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8232 | vos_mem_copy(pRcvFltPktClearParam->selfMacAddr, pSession->selfMacAddr, |
| 8233 | sizeof(tSirMacAddr)); |
| 8234 | vos_mem_copy(pRcvFltPktClearParam->bssId, pSession->connectedProfile.bssid, |
| 8235 | sizeof(tSirMacAddr)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8236 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8237 | vos_mem_copy(pRequestBuf, pRcvFltPktClearParam, sizeof(tSirRcvFltPktClearParam)); |
| 8238 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8239 | msg.type = WDA_RECEIVE_FILTER_CLEAR_FILTER_REQ; |
| 8240 | msg.reserved = 0; |
| 8241 | msg.bodyptr = pRequestBuf; |
| 8242 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8243 | { |
| 8244 | 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] | 8245 | "WDA_RECEIVE_FILTER_CLEAR_FILTER message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8246 | vos_mem_free(pRequestBuf); |
| 8247 | return eHAL_STATUS_FAILURE; |
| 8248 | } |
| 8249 | |
| 8250 | return eHAL_STATUS_SUCCESS; |
| 8251 | } |
| 8252 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 8253 | |
| 8254 | /* --------------------------------------------------------------------------- |
| 8255 | \fn sme_PreChannelSwitchIndFullPowerCB |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8256 | \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] | 8257 | channel switch. |
| 8258 | \param callbackContext |
| 8259 | \param status |
| 8260 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8261 | void sme_PreChannelSwitchIndFullPowerCB(void *callbackContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8262 | eHalStatus status) |
| 8263 | { |
| 8264 | tpAniSirGlobal pMac = (tpAniSirGlobal)callbackContext; |
| 8265 | tSirMbMsg *pMsg; |
| 8266 | tANI_U16 msgLen; |
| 8267 | |
| 8268 | msgLen = (tANI_U16)(sizeof( tSirMbMsg )); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8269 | pMsg = vos_mem_malloc(msgLen); |
| 8270 | if ( NULL != pMsg ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8271 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8272 | vos_mem_set(pMsg, msgLen, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8273 | pMsg->type = pal_cpu_to_be16((tANI_U16)eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER); |
| 8274 | pMsg->msgLen = pal_cpu_to_be16(msgLen); |
| 8275 | status = palSendMBMessage(pMac->hHdd, pMsg); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8276 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8277 | |
| 8278 | return; |
| 8279 | } |
| 8280 | |
| 8281 | /* --------------------------------------------------------------------------- |
| 8282 | \fn sme_HandlePreChannelSwitchInd |
| 8283 | \brief Processes the indcation from PE for pre-channel switch. |
| 8284 | \param hHal |
| 8285 | \- The handle returned by macOpen. return eHalStatus |
| 8286 | ---------------------------------------------------------------------------*/ |
| 8287 | eHalStatus sme_HandlePreChannelSwitchInd(tHalHandle hHal) |
| 8288 | { |
| 8289 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8290 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8291 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8292 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8293 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8294 | status = pmcRequestFullPower(hHal, sme_PreChannelSwitchIndFullPowerCB, |
| 8295 | pMac, eSME_FULL_PWR_NEEDED_BY_CHANNEL_SWITCH); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8296 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8297 | } |
| 8298 | |
| 8299 | return (status); |
| 8300 | } |
| 8301 | |
| 8302 | /* --------------------------------------------------------------------------- |
| 8303 | \fn sme_HandlePostChannelSwitchInd |
| 8304 | \brief Processes the indcation from PE for post-channel switch. |
| 8305 | \param hHal |
| 8306 | \- The handle returned by macOpen. return eHalStatus |
| 8307 | ---------------------------------------------------------------------------*/ |
| 8308 | eHalStatus sme_HandlePostChannelSwitchInd(tHalHandle hHal) |
| 8309 | { |
| 8310 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8311 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8312 | |
| 8313 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8314 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8315 | { |
| 8316 | status = pmcRequestBmps(hHal, NULL, NULL); |
| 8317 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8318 | } |
| 8319 | |
| 8320 | return (status); |
| 8321 | } |
| 8322 | |
| 8323 | /* --------------------------------------------------------------------------- |
| 8324 | |
| 8325 | \fn sme_IsChannelValid |
| 8326 | |
| 8327 | \brief To check if the channel is valid for currently established domain |
| 8328 | This is a synchronous API. |
| 8329 | |
| 8330 | \param hHal - The handle returned by macOpen. |
| 8331 | \param channel - channel to verify |
| 8332 | |
| 8333 | \return TRUE/FALSE, TRUE if channel is valid |
| 8334 | |
| 8335 | -------------------------------------------------------------------------------*/ |
| 8336 | tANI_BOOLEAN sme_IsChannelValid(tHalHandle hHal, tANI_U8 channel) |
| 8337 | { |
| 8338 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8339 | tANI_BOOLEAN valid = FALSE; |
| 8340 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8341 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8342 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8343 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8344 | { |
| 8345 | |
| 8346 | valid = csrRoamIsChannelValid( pMac, channel); |
| 8347 | |
| 8348 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8349 | } |
| 8350 | |
| 8351 | return (valid); |
| 8352 | } |
| 8353 | |
| 8354 | /* --------------------------------------------------------------------------- |
| 8355 | \fn sme_SetFreqBand |
| 8356 | \brief Used to set frequency band. |
| 8357 | \param hHal |
| 8358 | \eBand band value to be configured |
| 8359 | \- return eHalStatus |
| 8360 | -------------------------------------------------------------------------*/ |
| 8361 | eHalStatus sme_SetFreqBand(tHalHandle hHal, eCsrBand eBand) |
| 8362 | { |
| 8363 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8364 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8365 | |
| 8366 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8367 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8368 | { |
| 8369 | status = csrSetBand(hHal, eBand); |
| 8370 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8371 | } |
| 8372 | return status; |
| 8373 | } |
| 8374 | |
| 8375 | /* --------------------------------------------------------------------------- |
| 8376 | \fn sme_GetFreqBand |
| 8377 | \brief Used to get the current band settings. |
| 8378 | \param hHal |
| 8379 | \pBand pointer to hold band value |
| 8380 | \- return eHalStatus |
| 8381 | -------------------------------------------------------------------------*/ |
| 8382 | eHalStatus sme_GetFreqBand(tHalHandle hHal, eCsrBand *pBand) |
| 8383 | { |
| 8384 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8385 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8386 | |
| 8387 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8388 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8389 | { |
| 8390 | *pBand = csrGetCurrentBand( hHal ); |
| 8391 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8392 | } |
| 8393 | return status; |
| 8394 | } |
| 8395 | |
| 8396 | #ifdef WLAN_WAKEUP_EVENTS |
| 8397 | /****************************************************************************** |
| 8398 | \fn sme_WakeReasonIndCallback |
| 8399 | |
| 8400 | \brief |
| 8401 | a callback function called when SME received eWNI_SME_WAKE_REASON_IND event from WDA |
| 8402 | |
| 8403 | \param hHal - HAL handle for device |
| 8404 | \param pMsg - Message body passed from WDA; includes Wake Reason Indication parameter |
| 8405 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8406 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8407 | ******************************************************************************/ |
| 8408 | eHalStatus sme_WakeReasonIndCallback (tHalHandle hHal, void* pMsg) |
| 8409 | { |
| 8410 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8411 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8412 | tSirWakeReasonInd *pWakeReasonInd = (tSirWakeReasonInd *)pMsg; |
| 8413 | |
| 8414 | if (NULL == pMsg) |
| 8415 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8416 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8417 | status = eHAL_STATUS_FAILURE; |
| 8418 | } |
| 8419 | else |
| 8420 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8421 | smsLog(pMac, LOG2, "SME: entering sme_WakeReasonIndCallback"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8422 | |
| 8423 | /* Call Wake Reason Indication callback routine. */ |
| 8424 | if (pMac->pmc.wakeReasonIndCB != NULL) |
| 8425 | pMac->pmc.wakeReasonIndCB(pMac->pmc.wakeReasonIndCBContext, pWakeReasonInd); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8426 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8427 | 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] | 8428 | } |
| 8429 | |
| 8430 | return(status); |
| 8431 | } |
| 8432 | #endif // WLAN_WAKEUP_EVENTS |
| 8433 | |
| 8434 | |
| 8435 | /* --------------------------------------------------------------------------- |
| 8436 | |
| 8437 | \fn sme_SetMaxTxPower |
| 8438 | |
| 8439 | \brief Set the Maximum Transmit Power dynamically. Note: this setting will |
| 8440 | not persist over reboots. |
| 8441 | |
| 8442 | \param hHal |
| 8443 | \param pBssid BSSID to set the power cap for |
| 8444 | \param pBssid pSelfMacAddress self MAC Address |
| 8445 | \param pBssid power to set in dB |
| 8446 | \- return eHalStatus |
| 8447 | |
| 8448 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8449 | eHalStatus sme_SetMaxTxPower(tHalHandle hHal, tSirMacAddr pBssid, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8450 | tSirMacAddr pSelfMacAddress, v_S7_t dB) |
| 8451 | { |
| 8452 | vos_msg_t msg; |
| 8453 | tpMaxTxPowerParams pMaxTxParams = NULL; |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8454 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8455 | TRACE_CODE_SME_RX_HDD_SET_MAXTXPOW, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8456 | pMaxTxParams = vos_mem_malloc(sizeof(tMaxTxPowerParams)); |
| 8457 | if (NULL == pMaxTxParams) |
| 8458 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8459 | 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] | 8460 | return eHAL_STATUS_FAILURE; |
| 8461 | } |
| 8462 | |
| 8463 | vos_mem_copy(pMaxTxParams->bssId, pBssid, SIR_MAC_ADDR_LENGTH); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8464 | vos_mem_copy(pMaxTxParams->selfStaMacAddr, pSelfMacAddress, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8465 | SIR_MAC_ADDR_LENGTH); |
| 8466 | pMaxTxParams->power = dB; |
| 8467 | |
| 8468 | msg.type = WDA_SET_MAX_TX_POWER_REQ; |
| 8469 | msg.reserved = 0; |
| 8470 | msg.bodyptr = pMaxTxParams; |
| 8471 | |
| 8472 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8473 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8474 | 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] | 8475 | vos_mem_free(pMaxTxParams); |
| 8476 | return eHAL_STATUS_FAILURE; |
| 8477 | } |
| 8478 | |
| 8479 | return eHAL_STATUS_SUCCESS; |
| 8480 | } |
| 8481 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8482 | /* --------------------------------------------------------------------------- |
| 8483 | |
Arif Hussain | a5ebce0 | 2013-08-09 15:09:58 -0700 | [diff] [blame] | 8484 | \fn sme_SetMaxTxPowerPerBand |
| 8485 | |
| 8486 | \brief Set the Maximum Transmit Power specific to band dynamically. |
| 8487 | Note: this setting will not persist over reboots. |
| 8488 | |
| 8489 | \param band |
| 8490 | \param power to set in dB |
| 8491 | \- return eHalStatus |
| 8492 | |
| 8493 | ----------------------------------------------------------------------------*/ |
| 8494 | eHalStatus sme_SetMaxTxPowerPerBand(eCsrBand band, v_S7_t dB) |
| 8495 | { |
| 8496 | vos_msg_t msg; |
| 8497 | tpMaxTxPowerPerBandParams pMaxTxPowerPerBandParams = NULL; |
| 8498 | |
| 8499 | pMaxTxPowerPerBandParams = vos_mem_malloc(sizeof(tMaxTxPowerPerBandParams)); |
| 8500 | if (NULL == pMaxTxPowerPerBandParams) |
| 8501 | { |
| 8502 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8503 | "%s:Not able to allocate memory for pMaxTxPowerPerBandParams", |
| 8504 | __func__); |
| 8505 | return eHAL_STATUS_FAILURE; |
| 8506 | } |
| 8507 | |
| 8508 | pMaxTxPowerPerBandParams->power = dB; |
| 8509 | pMaxTxPowerPerBandParams->bandInfo = band; |
| 8510 | |
| 8511 | msg.type = WDA_SET_MAX_TX_POWER_PER_BAND_REQ; |
| 8512 | msg.reserved = 0; |
| 8513 | msg.bodyptr = pMaxTxPowerPerBandParams; |
| 8514 | |
| 8515 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8516 | { |
| 8517 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8518 | "%s:Not able to post WDA_SET_MAX_TX_POWER_PER_BAND_REQ", |
| 8519 | __func__); |
| 8520 | vos_mem_free(pMaxTxPowerPerBandParams); |
| 8521 | return eHAL_STATUS_FAILURE; |
| 8522 | } |
| 8523 | |
| 8524 | return eHAL_STATUS_SUCCESS; |
| 8525 | } |
| 8526 | |
| 8527 | /* --------------------------------------------------------------------------- |
| 8528 | |
schang | 86c22c4 | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 8529 | \fn sme_SetTxPower |
| 8530 | |
| 8531 | \brief Set Transmit Power dynamically. Note: this setting will |
| 8532 | not persist over reboots. |
| 8533 | |
| 8534 | \param hHal |
| 8535 | \param sessionId Target Session ID |
| 8536 | \param mW power to set in mW |
| 8537 | \- return eHalStatus |
| 8538 | |
| 8539 | -------------------------------------------------------------------------------*/ |
| 8540 | eHalStatus sme_SetTxPower(tHalHandle hHal, v_U8_t sessionId, v_U8_t mW) |
| 8541 | { |
| 8542 | |
| 8543 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8544 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8545 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8546 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8547 | TRACE_CODE_SME_RX_HDD_SET_TXPOW, NO_SESSION, 0)); |
schang | 86c22c4 | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 8548 | smsLog(pMac, LOG1, FL("set tx power %dmW"), mW); |
| 8549 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 8550 | if (HAL_STATUS_SUCCESS(status)) |
| 8551 | { |
| 8552 | status = csrSetTxPower(pMac, sessionId, mW); |
| 8553 | sme_ReleaseGlobalLock(&pMac->sme); |
| 8554 | } |
| 8555 | return status; |
| 8556 | } |
| 8557 | |
| 8558 | /* --------------------------------------------------------------------------- |
| 8559 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8560 | \fn sme_HideSSID |
| 8561 | |
| 8562 | \brief hide/show SSID dynamically. Note: this setting will |
| 8563 | not persist over reboots. |
| 8564 | |
| 8565 | \param hHal |
| 8566 | \param sessionId |
| 8567 | \param ssidHidden 0 - Broadcast SSID, 1 - Disable broadcast SSID |
| 8568 | \- return eHalStatus |
| 8569 | |
| 8570 | -------------------------------------------------------------------------------*/ |
| 8571 | eHalStatus sme_HideSSID(tHalHandle hHal, v_U8_t sessionId, v_U8_t ssidHidden) |
| 8572 | { |
| 8573 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8574 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8575 | tANI_U16 len; |
| 8576 | |
| 8577 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8578 | { |
| 8579 | tpSirUpdateParams pMsg; |
| 8580 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 8581 | |
| 8582 | if(!pSession) |
| 8583 | { |
| 8584 | 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] | 8585 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 8586 | return eHAL_STATUS_FAILURE; |
| 8587 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8588 | |
| 8589 | if( !pSession->sessionActive ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8590 | VOS_ASSERT(0); |
| 8591 | |
| 8592 | /* Create the message and send to lim */ |
| 8593 | len = sizeof(tSirUpdateParams); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8594 | pMsg = vos_mem_malloc(len); |
| 8595 | if ( NULL == pMsg ) |
| 8596 | status = eHAL_STATUS_FAILURE; |
| 8597 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8598 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8599 | vos_mem_set(pMsg, sizeof(tSirUpdateParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8600 | pMsg->messageType = eWNI_SME_HIDE_SSID_REQ; |
| 8601 | pMsg->length = len; |
| 8602 | /* Data starts from here */ |
| 8603 | pMsg->sessionId = sessionId; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8604 | pMsg->ssidHidden = ssidHidden; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8605 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 8606 | } |
| 8607 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8608 | } |
| 8609 | return status; |
| 8610 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8611 | |
| 8612 | /* --------------------------------------------------------------------------- |
| 8613 | |
| 8614 | \fn sme_SetTmLevel |
| 8615 | \brief Set Thermal Mitigation Level to RIVA |
| 8616 | \param hHal - The handle returned by macOpen. |
| 8617 | \param newTMLevel - new Thermal Mitigation Level |
| 8618 | \param tmMode - Thermal Mitigation handle mode, default 0 |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8619 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8620 | ---------------------------------------------------------------------------*/ |
| 8621 | eHalStatus sme_SetTmLevel(tHalHandle hHal, v_U16_t newTMLevel, v_U16_t tmMode) |
| 8622 | { |
| 8623 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8624 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 8625 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8626 | vos_msg_t vosMessage; |
| 8627 | tAniSetTmLevelReq *setTmLevelReq = NULL; |
| 8628 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8629 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8630 | TRACE_CODE_SME_RX_HDD_SET_TMLEVEL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8631 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8632 | { |
| 8633 | setTmLevelReq = (tAniSetTmLevelReq *)vos_mem_malloc(sizeof(tAniSetTmLevelReq)); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8634 | if (NULL == setTmLevelReq) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8635 | { |
| 8636 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8637 | "%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] | 8638 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8639 | return eHAL_STATUS_FAILURE; |
| 8640 | } |
| 8641 | |
| 8642 | setTmLevelReq->tmMode = tmMode; |
| 8643 | setTmLevelReq->newTmLevel = newTMLevel; |
| 8644 | |
| 8645 | /* serialize the req through MC thread */ |
| 8646 | vosMessage.bodyptr = setTmLevelReq; |
| 8647 | vosMessage.type = WDA_SET_TM_LEVEL_REQ; |
| 8648 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 8649 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 8650 | { |
| 8651 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8652 | "%s: Post Set TM Level MSG fail", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8653 | vos_mem_free(setTmLevelReq); |
| 8654 | status = eHAL_STATUS_FAILURE; |
| 8655 | } |
| 8656 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8657 | } |
| 8658 | return(status); |
| 8659 | } |
| 8660 | |
| 8661 | /*--------------------------------------------------------------------------- |
| 8662 | |
| 8663 | \brief sme_featureCapsExchange() - SME interface to exchange capabilities between |
| 8664 | Host and FW. |
| 8665 | |
| 8666 | \param hHal - HAL handle for device |
| 8667 | |
| 8668 | \return NONE |
| 8669 | |
| 8670 | ---------------------------------------------------------------------------*/ |
| 8671 | void sme_featureCapsExchange( tHalHandle hHal) |
| 8672 | { |
| 8673 | 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] | 8674 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8675 | TRACE_CODE_SME_RX_HDD_CAPS_EXCH, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8676 | WDA_featureCapsExchange(vosContext); |
| 8677 | } |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8678 | |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 8679 | /*--------------------------------------------------------------------------- |
| 8680 | |
| 8681 | \brief sme_disableFeatureCapablity() - SME interface to disable Active mode offload capablity |
| 8682 | in Host. |
| 8683 | |
| 8684 | \param hHal - HAL handle for device |
| 8685 | |
| 8686 | \return NONE |
| 8687 | |
| 8688 | ---------------------------------------------------------------------------*/ |
| 8689 | void sme_disableFeatureCapablity(tANI_U8 feature_index) |
| 8690 | { |
| 8691 | WDA_disableCapablityFeature(feature_index); |
| 8692 | } |
| 8693 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8694 | /* --------------------------------------------------------------------------- |
| 8695 | |
| 8696 | \fn sme_GetDefaultCountryCode |
| 8697 | |
| 8698 | \brief Get the default country code from NV |
| 8699 | |
| 8700 | \param hHal |
| 8701 | \param pCountry |
| 8702 | \- return eHalStatus |
| 8703 | |
| 8704 | -------------------------------------------------------------------------------*/ |
| 8705 | eHalStatus sme_GetDefaultCountryCodeFrmNv(tHalHandle hHal, tANI_U8 *pCountry) |
| 8706 | { |
| 8707 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8708 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8709 | TRACE_CODE_SME_RX_HDD_GET_DEFCCNV, NO_SESSION, 0)); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8710 | return csrGetDefaultCountryCodeFrmNv(pMac, pCountry); |
| 8711 | } |
| 8712 | |
| 8713 | /* --------------------------------------------------------------------------- |
| 8714 | |
| 8715 | \fn sme_GetCurrentCountryCode |
| 8716 | |
| 8717 | \brief Get the current country code |
| 8718 | |
| 8719 | \param hHal |
| 8720 | \param pCountry |
| 8721 | \- return eHalStatus |
| 8722 | |
| 8723 | -------------------------------------------------------------------------------*/ |
| 8724 | eHalStatus sme_GetCurrentCountryCode(tHalHandle hHal, tANI_U8 *pCountry) |
| 8725 | { |
| 8726 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8727 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8728 | TRACE_CODE_SME_RX_HDD_GET_CURCC, NO_SESSION, 0)); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8729 | return csrGetCurrentCountryCode(pMac, pCountry); |
| 8730 | } |
| 8731 | |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 8732 | /* --------------------------------------------------------------------------- |
| 8733 | \fn sme_transportDebug |
| 8734 | \brief Dynamically monitoring Transport channels |
| 8735 | Private IOCTL will querry transport channel status if driver loaded |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 8736 | \param hHal Upper MAC context |
Jeff Johnson | b88db98 | 2012-12-10 13:34:59 -0800 | [diff] [blame] | 8737 | \param displaySnapshot Display transport channel snapshot option |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 8738 | \param toggleStallDetect Enable stall detect feature |
| 8739 | This feature will take effect to data performance |
| 8740 | Not integrate till fully verification |
| 8741 | \- return NONE |
| 8742 | -------------------------------------------------------------------------*/ |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 8743 | 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] | 8744 | { |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 8745 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8746 | |
| 8747 | if (NULL == pMac) |
| 8748 | { |
| 8749 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8750 | "%s: invalid context", __func__); |
| 8751 | return; |
| 8752 | } |
| 8753 | WDA_TransportChannelDebug(pMac, displaySnapshot, toggleStallDetect); |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 8754 | } |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 8755 | |
Kiran | 4a17ebe | 2013-01-31 10:43:43 -0800 | [diff] [blame] | 8756 | /* --------------------------------------------------------------------------- |
| 8757 | \fn sme_ResetPowerValuesFor5G |
| 8758 | \brief Reset the power values for 5G band with NV power values. |
| 8759 | \param hHal - HAL handle for device |
| 8760 | \- return NONE |
| 8761 | -------------------------------------------------------------------------*/ |
| 8762 | void sme_ResetPowerValuesFor5G (tHalHandle hHal) |
| 8763 | { |
| 8764 | tpAniSirGlobal pMac = PMAC_STRUCT (hHal); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8765 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8766 | TRACE_CODE_SME_RX_HDD_RESET_PW5G, NO_SESSION, 0)); |
Kiran | 4a17ebe | 2013-01-31 10:43:43 -0800 | [diff] [blame] | 8767 | csrSaveChannelPowerForBand(pMac, eANI_BOOLEAN_TRUE); |
| 8768 | csrApplyPower2Current(pMac); // Store the channel+power info in the global place: Cfg |
| 8769 | } |
| 8770 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 8771 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 8772 | /* --------------------------------------------------------------------------- |
| 8773 | \fn sme_UpdateRoamPrefer5GHz |
| 8774 | \brief enable/disable Roam prefer 5G runtime option |
| 8775 | This function is called through dynamic setConfig callback function |
| 8776 | to configure the Roam prefer 5G runtime option |
| 8777 | \param hHal - HAL handle for device |
| 8778 | \param nRoamPrefer5GHz Enable/Disable Roam prefer 5G runtime option |
| 8779 | \- return Success or failure |
| 8780 | -------------------------------------------------------------------------*/ |
| 8781 | |
| 8782 | eHalStatus sme_UpdateRoamPrefer5GHz(tHalHandle hHal, v_BOOL_t nRoamPrefer5GHz) |
| 8783 | { |
| 8784 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8785 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8786 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8787 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8788 | TRACE_CODE_SME_RX_HDD_UPDATE_RP5G, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8789 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8790 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8791 | { |
| 8792 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8793 | "%s: gRoamPrefer5GHz is changed from %d to %d", __func__, |
| 8794 | pMac->roam.configParam.nRoamPrefer5GHz, |
| 8795 | nRoamPrefer5GHz); |
| 8796 | pMac->roam.configParam.nRoamPrefer5GHz = nRoamPrefer5GHz; |
| 8797 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8798 | } |
| 8799 | |
| 8800 | return status ; |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 8801 | } |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 8802 | |
| 8803 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8804 | \fn sme_setRoamIntraBand |
| 8805 | \brief enable/disable Intra band roaming |
| 8806 | This function is called through dynamic setConfig callback function |
| 8807 | to configure the intra band roaming |
| 8808 | \param hHal - HAL handle for device |
| 8809 | \param nRoamIntraBand Enable/Disable Intra band roaming |
| 8810 | \- return Success or failure |
| 8811 | -------------------------------------------------------------------------*/ |
| 8812 | eHalStatus sme_setRoamIntraBand(tHalHandle hHal, const v_BOOL_t nRoamIntraBand) |
| 8813 | { |
| 8814 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8815 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8816 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8817 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8818 | TRACE_CODE_SME_RX_HDD_SET_ROAMIBAND, NO_SESSION, 0)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8819 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8820 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8821 | { |
| 8822 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8823 | "%s: gRoamIntraBand is changed from %d to %d", __func__, |
| 8824 | pMac->roam.configParam.nRoamIntraBand, |
| 8825 | nRoamIntraBand); |
| 8826 | pMac->roam.configParam.nRoamIntraBand = nRoamIntraBand; |
| 8827 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8828 | } |
| 8829 | |
| 8830 | return status ; |
| 8831 | } |
| 8832 | |
| 8833 | /* --------------------------------------------------------------------------- |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8834 | \fn sme_UpdateRoamScanNProbes |
| 8835 | \brief function to update roam scan N probes |
| 8836 | This function is called through dynamic setConfig callback function |
| 8837 | to update roam scan N probes |
| 8838 | \param hHal - HAL handle for device |
| 8839 | \param nProbes number of probe requests to be sent out |
| 8840 | \- return Success or failure |
| 8841 | -------------------------------------------------------------------------*/ |
| 8842 | eHalStatus sme_UpdateRoamScanNProbes(tHalHandle hHal, const v_U8_t nProbes) |
| 8843 | { |
| 8844 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8845 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8846 | |
| 8847 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8848 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8849 | { |
| 8850 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8851 | "%s: gRoamScanNProbes is changed from %d to %d", __func__, |
| 8852 | pMac->roam.configParam.nProbes, |
| 8853 | nProbes); |
| 8854 | pMac->roam.configParam.nProbes = nProbes; |
| 8855 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8856 | } |
| 8857 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8858 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8859 | { |
| 8860 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 8861 | REASON_NPROBES_CHANGED); |
| 8862 | } |
| 8863 | #endif |
| 8864 | return status ; |
| 8865 | } |
| 8866 | |
| 8867 | /* --------------------------------------------------------------------------- |
| 8868 | \fn sme_UpdateRoamScanHomeAwayTime |
| 8869 | \brief function to update roam scan Home away time |
| 8870 | This function is called through dynamic setConfig callback function |
| 8871 | to update roam scan home away time |
| 8872 | \param hHal - HAL handle for device |
| 8873 | \param nRoamScanAwayTime Scan home away time |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 8874 | \param bSendOffloadCmd If TRUE then send offload command to firmware |
| 8875 | If FALSE then command is not sent to firmware |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8876 | \- return Success or failure |
| 8877 | -------------------------------------------------------------------------*/ |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 8878 | eHalStatus sme_UpdateRoamScanHomeAwayTime(tHalHandle hHal, const v_U16_t nRoamScanHomeAwayTime, |
| 8879 | const eAniBoolean bSendOffloadCmd) |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8880 | { |
| 8881 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8882 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8883 | |
| 8884 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8885 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8886 | { |
| 8887 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8888 | "%s: gRoamScanHomeAwayTime is changed from %d to %d", __func__, |
| 8889 | pMac->roam.configParam.nRoamScanHomeAwayTime, |
| 8890 | nRoamScanHomeAwayTime); |
| 8891 | pMac->roam.configParam.nRoamScanHomeAwayTime = nRoamScanHomeAwayTime; |
| 8892 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8893 | } |
| 8894 | |
| 8895 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 8896 | if (pMac->roam.configParam.isRoamOffloadScanEnabled && bSendOffloadCmd) |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8897 | { |
| 8898 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 8899 | REASON_HOME_AWAY_TIME_CHANGED); |
| 8900 | } |
| 8901 | #endif |
| 8902 | return status; |
| 8903 | } |
| 8904 | |
| 8905 | |
| 8906 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8907 | \fn sme_getRoamIntraBand |
| 8908 | \brief get Intra band roaming |
| 8909 | \param hHal - HAL handle for device |
| 8910 | \- return Success or failure |
| 8911 | -------------------------------------------------------------------------*/ |
| 8912 | v_BOOL_t sme_getRoamIntraBand(tHalHandle hHal) |
| 8913 | { |
| 8914 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8915 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8916 | TRACE_CODE_SME_RX_HDD_GET_ROAMIBAND, NO_SESSION, 0)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8917 | return pMac->roam.configParam.nRoamIntraBand; |
| 8918 | } |
| 8919 | |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8920 | /* --------------------------------------------------------------------------- |
| 8921 | \fn sme_getRoamScanNProbes |
| 8922 | \brief get N Probes |
| 8923 | \param hHal - HAL handle for device |
| 8924 | \- return Success or failure |
| 8925 | -------------------------------------------------------------------------*/ |
| 8926 | v_U8_t sme_getRoamScanNProbes(tHalHandle hHal) |
| 8927 | { |
| 8928 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8929 | return pMac->roam.configParam.nProbes; |
| 8930 | } |
| 8931 | |
| 8932 | /* --------------------------------------------------------------------------- |
| 8933 | \fn sme_getRoamScanHomeAwayTime |
| 8934 | \brief get Roam scan home away time |
| 8935 | \param hHal - HAL handle for device |
| 8936 | \- return Success or failure |
| 8937 | -------------------------------------------------------------------------*/ |
| 8938 | v_U16_t sme_getRoamScanHomeAwayTime(tHalHandle hHal) |
| 8939 | { |
| 8940 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8941 | return pMac->roam.configParam.nRoamScanHomeAwayTime; |
| 8942 | } |
| 8943 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8944 | |
| 8945 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 8946 | \fn sme_UpdateImmediateRoamRssiDiff |
| 8947 | \brief Update nImmediateRoamRssiDiff |
| 8948 | This function is called through dynamic setConfig callback function |
| 8949 | to configure nImmediateRoamRssiDiff |
| 8950 | Usage: adb shell iwpriv wlan0 setConfig gImmediateRoamRssiDiff=[0 .. 125] |
| 8951 | \param hHal - HAL handle for device |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8952 | \param nImmediateRoamRssiDiff - minimum rssi difference between potential |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 8953 | candidate and current AP. |
| 8954 | \- return Success or failure |
| 8955 | -------------------------------------------------------------------------*/ |
| 8956 | |
| 8957 | eHalStatus sme_UpdateImmediateRoamRssiDiff(tHalHandle hHal, v_U8_t nImmediateRoamRssiDiff) |
| 8958 | { |
| 8959 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8960 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8961 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8962 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8963 | TRACE_CODE_SME_RX_HDD_UPDATE_IMMRSSIDIFF, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8964 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8965 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8966 | { |
| 8967 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8968 | "LFR runtime successfully set immediate roam rssi diff to" |
| 8969 | "%d - old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8970 | nImmediateRoamRssiDiff, |
| 8971 | pMac->roam.configParam.nImmediateRoamRssiDiff, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 8972 | macTraceGetNeighbourRoamState( |
| 8973 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8974 | pMac->roam.configParam.nImmediateRoamRssiDiff = nImmediateRoamRssiDiff; |
| 8975 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8976 | } |
| 8977 | |
| 8978 | return status ; |
| 8979 | } |
| 8980 | |
| 8981 | /* --------------------------------------------------------------------------- |
| 8982 | \fn sme_UpdateRoamRssiDiff |
| 8983 | \brief Update RoamRssiDiff |
| 8984 | This function is called through dynamic setConfig callback function |
| 8985 | to configure RoamRssiDiff |
| 8986 | Usage: adb shell iwpriv wlan0 setConfig RoamRssiDiff=[0 .. 125] |
| 8987 | \param hHal - HAL handle for device |
| 8988 | \param RoamRssiDiff - minimum rssi difference between potential |
| 8989 | candidate and current AP. |
| 8990 | \- return Success or failure |
| 8991 | -------------------------------------------------------------------------*/ |
| 8992 | |
| 8993 | eHalStatus sme_UpdateRoamRssiDiff(tHalHandle hHal, v_U8_t RoamRssiDiff) |
| 8994 | { |
| 8995 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8996 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8997 | |
| 8998 | status = sme_AcquireGlobalLock( &pMac->sme ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8999 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 9000 | TRACE_CODE_SME_RX_HDD_UPDATE_RSSIDIFF, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9001 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9002 | { |
| 9003 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9004 | "LFR runtime successfully set roam rssi diff to %d" |
| 9005 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9006 | RoamRssiDiff, |
| 9007 | pMac->roam.configParam.RoamRssiDiff, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9008 | macTraceGetNeighbourRoamState( |
| 9009 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9010 | pMac->roam.configParam.RoamRssiDiff = RoamRssiDiff; |
| 9011 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9012 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9013 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9014 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9015 | { |
| 9016 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_RSSI_DIFF_CHANGED); |
| 9017 | } |
| 9018 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9019 | return status ; |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 9020 | } |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9021 | |
| 9022 | /*-------------------------------------------------------------------------- |
| 9023 | \brief sme_UpdateFastTransitionEnabled() - enable/disable Fast Transition support at runtime |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9024 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9025 | isFastTransitionEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9026 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9027 | \param hHal - The handle returned by macOpen. |
| 9028 | \return eHAL_STATUS_SUCCESS - SME update isFastTransitionEnabled config successfully. |
| 9029 | Other status means SME is failed to update isFastTransitionEnabled. |
| 9030 | \sa |
| 9031 | --------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9032 | eHalStatus sme_UpdateFastTransitionEnabled(tHalHandle hHal, |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9033 | v_BOOL_t isFastTransitionEnabled) |
| 9034 | { |
| 9035 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9036 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9037 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 9038 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 9039 | TRACE_CODE_SME_RX_HDD_UPDATE_FTENABLED, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9040 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9041 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9042 | { |
| 9043 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9044 | "%s: FastTransitionEnabled is changed from %d to %d", __func__, |
| 9045 | pMac->roam.configParam.isFastTransitionEnabled, |
| 9046 | isFastTransitionEnabled); |
| 9047 | pMac->roam.configParam.isFastTransitionEnabled = isFastTransitionEnabled; |
| 9048 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9049 | } |
| 9050 | |
| 9051 | return status ; |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9052 | } |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9053 | |
| 9054 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 9055 | \fn sme_UpdateWESMode |
| 9056 | \brief Update WES Mode |
| 9057 | This function is called through dynamic setConfig callback function |
| 9058 | to configure isWESModeEnabled |
| 9059 | \param hHal - HAL handle for device |
| 9060 | \return eHAL_STATUS_SUCCESS - SME update isWESModeEnabled config successfully. |
| 9061 | Other status means SME is failed to update isWESModeEnabled. |
| 9062 | -------------------------------------------------------------------------*/ |
| 9063 | |
| 9064 | eHalStatus sme_UpdateWESMode(tHalHandle hHal, v_BOOL_t isWESModeEnabled) |
| 9065 | { |
| 9066 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9067 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9068 | |
| 9069 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9070 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9071 | { |
| 9072 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9073 | "LFR runtime successfully set WES Mode to %d" |
| 9074 | "- old value is %d - roam state is %s", |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 9075 | isWESModeEnabled, |
| 9076 | pMac->roam.configParam.isWESModeEnabled, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9077 | macTraceGetNeighbourRoamState( |
| 9078 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 9079 | pMac->roam.configParam.isWESModeEnabled = isWESModeEnabled; |
| 9080 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9081 | } |
| 9082 | |
| 9083 | return status ; |
| 9084 | } |
| 9085 | |
| 9086 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9087 | \fn sme_SetRoamScanControl |
| 9088 | \brief Set roam scan control |
| 9089 | This function is called to set roam scan control |
| 9090 | if roam scan control is set to 0, roaming scan cache is cleared |
| 9091 | any value other than 0 is treated as invalid value |
| 9092 | \param hHal - HAL handle for device |
| 9093 | \return eHAL_STATUS_SUCCESS - SME update config successfully. |
| 9094 | Other status means SME failure to update |
| 9095 | -------------------------------------------------------------------------*/ |
| 9096 | eHalStatus sme_SetRoamScanControl(tHalHandle hHal, v_BOOL_t roamScanControl) |
| 9097 | { |
| 9098 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9099 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9100 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 9101 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 9102 | TRACE_CODE_SME_RX_HDD_SET_SCANCTRL, NO_SESSION, 0)); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9103 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9104 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9105 | { |
| 9106 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9107 | "LFR runtime successfully set roam scan control to %d" |
| 9108 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9109 | roamScanControl, |
| 9110 | pMac->roam.configParam.nRoamScanControl, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9111 | macTraceGetNeighbourRoamState( |
| 9112 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9113 | pMac->roam.configParam.nRoamScanControl = roamScanControl; |
| 9114 | if ( 0 == roamScanControl) |
| 9115 | { |
| 9116 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 9117 | "LFR runtime successfully cleared roam scan cache"); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9118 | csrFlushCfgBgScanRoamChannelList(pMac); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9119 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9120 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9121 | { |
| 9122 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_FLUSH_CHANNEL_LIST); |
| 9123 | } |
| 9124 | #endif |
| 9125 | } |
| 9126 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9127 | } |
| 9128 | return status ; |
| 9129 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9130 | #endif /* (WLAN_FEATURE_VOWIFI_11R) || (FEATURE_WLAN_ESE) || (FEATURE_WLAN_LFR) */ |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9131 | |
| 9132 | #ifdef FEATURE_WLAN_LFR |
| 9133 | /*-------------------------------------------------------------------------- |
| 9134 | \brief sme_UpdateIsFastRoamIniFeatureEnabled() - enable/disable LFR support at runtime |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9135 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9136 | isFastRoamIniFeatureEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9137 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9138 | \param hHal - The handle returned by macOpen. |
| 9139 | \return eHAL_STATUS_SUCCESS - SME update isFastRoamIniFeatureEnabled config successfully. |
| 9140 | Other status means SME is failed to update isFastRoamIniFeatureEnabled. |
| 9141 | \sa |
| 9142 | --------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9143 | eHalStatus sme_UpdateIsFastRoamIniFeatureEnabled(tHalHandle hHal, |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9144 | const v_BOOL_t isFastRoamIniFeatureEnabled) |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9145 | { |
| 9146 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9147 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9148 | if (pMac->roam.configParam.isFastRoamIniFeatureEnabled == isFastRoamIniFeatureEnabled) |
| 9149 | { |
| 9150 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9151 | "%s: FastRoam is already enabled or disabled, nothing to do (returning) old(%d) new(%d)", __func__, |
| 9152 | pMac->roam.configParam.isFastRoamIniFeatureEnabled, |
| 9153 | isFastRoamIniFeatureEnabled); |
| 9154 | return eHAL_STATUS_SUCCESS; |
| 9155 | } |
| 9156 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9157 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9158 | "%s: FastRoamEnabled is changed from %d to %d", __func__, |
| 9159 | pMac->roam.configParam.isFastRoamIniFeatureEnabled, |
| 9160 | isFastRoamIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9161 | pMac->roam.configParam.isFastRoamIniFeatureEnabled = isFastRoamIniFeatureEnabled; |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9162 | csrNeighborRoamUpdateFastRoamingEnabled(pMac, isFastRoamIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9163 | |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9164 | return eHAL_STATUS_SUCCESS; |
| 9165 | } |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 9166 | |
Sameer Thalappil | 4ae66ec | 2013-11-05 14:17:35 -0800 | [diff] [blame] | 9167 | /*-------------------------------------------------------------------------- |
Mukul Sharma | 2a27163 | 2014-10-13 14:59:01 +0530 | [diff] [blame] | 9168 | \brief sme_ConfigFwrRoaming() - enable/disable LFR support at runtime |
| 9169 | When Supplicant issue enabled / disable fwr based roaming on the basis |
| 9170 | of the Bssid modification in network block ( e.g. AutoJoin mody N/W block) |
| 9171 | |
| 9172 | This is a synchronous call |
| 9173 | \param hHal - The handle returned by macOpen. |
| 9174 | \return eHAL_STATUS_SUCCESS - SME (enabled/disabled) offload scan successfully. |
| 9175 | Other status means SME is failed to (enabled/disabled) offload scan. |
| 9176 | \sa |
| 9177 | --------------------------------------------------------------------------*/ |
| 9178 | |
| 9179 | eHalStatus sme_ConfigFwrRoaming(tHalHandle hHal, |
| 9180 | const v_BOOL_t isFastRoamEnabled) |
| 9181 | { |
| 9182 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9183 | if (!pMac->roam.configParam.isFastRoamIniFeatureEnabled) |
| 9184 | { |
| 9185 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9186 | "%s: FastRoam is disabled through ini", __func__); |
| 9187 | return eHAL_STATUS_FAILURE; |
| 9188 | } |
| 9189 | csrNeighborRoamUpdateFastRoamingEnabled(pMac, isFastRoamEnabled); |
| 9190 | return eHAL_STATUS_SUCCESS; |
| 9191 | } |
| 9192 | |
| 9193 | /*-------------------------------------------------------------------------- |
Sameer Thalappil | 4ae66ec | 2013-11-05 14:17:35 -0800 | [diff] [blame] | 9194 | \brief sme_UpdateIsMAWCIniFeatureEnabled() - |
| 9195 | Enable/disable LFR MAWC support at runtime |
| 9196 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 9197 | isMAWCIniFeatureEnabled. |
| 9198 | This is a synchronous call |
| 9199 | \param hHal - The handle returned by macOpen. |
| 9200 | \return eHAL_STATUS_SUCCESS - SME update MAWCEnabled config successfully. |
| 9201 | Other status means SME is failed to update MAWCEnabled. |
| 9202 | \sa |
| 9203 | --------------------------------------------------------------------------*/ |
| 9204 | eHalStatus sme_UpdateIsMAWCIniFeatureEnabled(tHalHandle hHal, |
| 9205 | const v_BOOL_t MAWCEnabled) |
| 9206 | { |
| 9207 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9208 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9209 | |
| 9210 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9211 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9212 | { |
| 9213 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9214 | "%s: MAWCEnabled is changed from %d to %d", __func__, |
| 9215 | pMac->roam.configParam.MAWCEnabled, |
| 9216 | MAWCEnabled); |
| 9217 | pMac->roam.configParam.MAWCEnabled = MAWCEnabled; |
| 9218 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9219 | } |
| 9220 | |
| 9221 | return status ; |
| 9222 | |
| 9223 | } |
| 9224 | |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 9225 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9226 | /*-------------------------------------------------------------------------- |
| 9227 | \brief sme_UpdateEnableFastRoamInConcurrency() - enable/disable LFR if Concurrent session exists |
| 9228 | This is a synchronuous call |
| 9229 | \param hHal - The handle returned by macOpen. |
| 9230 | \return eHAL_STATUS_SUCCESS |
| 9231 | Other status means SME is failed |
| 9232 | \sa |
| 9233 | --------------------------------------------------------------------------*/ |
| 9234 | |
| 9235 | eHalStatus sme_UpdateEnableFastRoamInConcurrency(tHalHandle hHal, |
| 9236 | v_BOOL_t bFastRoamInConIniFeatureEnabled) |
| 9237 | { |
| 9238 | |
| 9239 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9240 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9241 | |
| 9242 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9243 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9244 | { |
| 9245 | pMac->roam.configParam.bFastRoamInConIniFeatureEnabled = bFastRoamInConIniFeatureEnabled; |
| 9246 | if (0 == pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9247 | { |
| 9248 | pMac->roam.configParam.bFastRoamInConIniFeatureEnabled = 0; |
| 9249 | } |
| 9250 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9251 | } |
| 9252 | |
| 9253 | return status; |
| 9254 | } |
| 9255 | #endif |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9256 | #endif /* FEATURE_WLAN_LFR */ |
| 9257 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9258 | #ifdef FEATURE_WLAN_ESE |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9259 | /*-------------------------------------------------------------------------- |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9260 | \brief sme_UpdateIsEseFeatureEnabled() - enable/disable Ese support at runtime |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9261 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9262 | isEseIniFeatureEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9263 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9264 | \param hHal - The handle returned by macOpen. |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9265 | \return eHAL_STATUS_SUCCESS - SME update isEseIniFeatureEnabled config successfully. |
| 9266 | Other status means SME is failed to update isEseIniFeatureEnabled. |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9267 | \sa |
| 9268 | --------------------------------------------------------------------------*/ |
| 9269 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9270 | eHalStatus sme_UpdateIsEseFeatureEnabled(tHalHandle hHal, |
| 9271 | const v_BOOL_t isEseIniFeatureEnabled) |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9272 | { |
| 9273 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9274 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9275 | if (pMac->roam.configParam.isEseIniFeatureEnabled == isEseIniFeatureEnabled) |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9276 | { |
| 9277 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9278 | "%s: Ese Mode is already enabled or disabled, nothing to do (returning) old(%d) new(%d)", __func__, |
| 9279 | pMac->roam.configParam.isEseIniFeatureEnabled, |
| 9280 | isEseIniFeatureEnabled); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9281 | return eHAL_STATUS_SUCCESS; |
| 9282 | } |
| 9283 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9284 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9285 | "%s: EseEnabled is changed from %d to %d", __func__, |
| 9286 | pMac->roam.configParam.isEseIniFeatureEnabled, |
| 9287 | isEseIniFeatureEnabled); |
| 9288 | pMac->roam.configParam.isEseIniFeatureEnabled = isEseIniFeatureEnabled; |
| 9289 | csrNeighborRoamUpdateEseModeEnabled(pMac, isEseIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9290 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9291 | if(TRUE == isEseIniFeatureEnabled) |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9292 | { |
| 9293 | sme_UpdateFastTransitionEnabled(hHal, TRUE); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9294 | } |
Srinivas Girigowda | ba17369 | 2013-08-07 11:55:38 -0700 | [diff] [blame] | 9295 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9296 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9297 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9298 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9299 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_ESE_INI_CFG_CHANGED); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9300 | } |
| 9301 | #endif |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9302 | return eHAL_STATUS_SUCCESS; |
| 9303 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9304 | #endif /* FEATURE_WLAN_ESE */ |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9305 | |
| 9306 | /*-------------------------------------------------------------------------- |
| 9307 | \brief sme_UpdateConfigFwRssiMonitoring() - enable/disable firmware RSSI Monitoring at runtime |
| 9308 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 9309 | fEnableFwRssiMonitoring. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9310 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9311 | \param hHal - The handle returned by macOpen. |
| 9312 | \return eHAL_STATUS_SUCCESS - SME update fEnableFwRssiMonitoring. config successfully. |
| 9313 | Other status means SME is failed to update fEnableFwRssiMonitoring. |
| 9314 | \sa |
| 9315 | --------------------------------------------------------------------------*/ |
| 9316 | |
| 9317 | eHalStatus sme_UpdateConfigFwRssiMonitoring(tHalHandle hHal, |
| 9318 | v_BOOL_t fEnableFwRssiMonitoring) |
| 9319 | { |
| 9320 | eHalStatus halStatus = eHAL_STATUS_SUCCESS; |
| 9321 | |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9322 | if (ccmCfgSetInt(hHal, WNI_CFG_PS_ENABLE_RSSI_MONITOR, fEnableFwRssiMonitoring, |
| 9323 | NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE) |
| 9324 | { |
| 9325 | halStatus = eHAL_STATUS_FAILURE; |
| 9326 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 9327 | "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] | 9328 | } |
| 9329 | |
| 9330 | return (halStatus); |
| 9331 | } |
| 9332 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9333 | #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9334 | /*-------------------------------------------------------------------------- |
| 9335 | \brief sme_setNeighborLookupRssiThreshold() - update neighbor lookup rssi threshold |
| 9336 | This is a synchronous call |
| 9337 | \param hHal - The handle returned by macOpen. |
| 9338 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9339 | Other status means SME is failed to update |
| 9340 | \sa |
| 9341 | --------------------------------------------------------------------------*/ |
| 9342 | eHalStatus sme_setNeighborLookupRssiThreshold(tHalHandle hHal, |
| 9343 | v_U8_t neighborLookupRssiThreshold) |
| 9344 | { |
| 9345 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9346 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9347 | |
| 9348 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9349 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9350 | { |
| 9351 | status = csrNeighborRoamSetLookupRssiThreshold(pMac, neighborLookupRssiThreshold); |
| 9352 | if (HAL_STATUS_SUCCESS(status)) |
| 9353 | { |
| 9354 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9355 | "LFR runtime successfully set Lookup threshold to %d" |
| 9356 | " - old value is %d - roam state is %s", |
| 9357 | neighborLookupRssiThreshold, |
| 9358 | pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold, |
| 9359 | macTraceGetNeighbourRoamState( |
| 9360 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9361 | pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold = |
| 9362 | neighborLookupRssiThreshold; |
| 9363 | } |
| 9364 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9365 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9366 | return status; |
| 9367 | } |
| 9368 | |
| 9369 | /*-------------------------------------------------------------------------- |
| 9370 | \brief sme_setNeighborReassocRssiThreshold() - update neighbor reassoc rssi threshold |
| 9371 | This is a synchronous call |
| 9372 | \param hHal - The handle returned by macOpen. |
| 9373 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9374 | Other status means SME is failed to update |
| 9375 | \sa |
| 9376 | --------------------------------------------------------------------------*/ |
| 9377 | eHalStatus sme_setNeighborReassocRssiThreshold(tHalHandle hHal, |
| 9378 | v_U8_t neighborReassocRssiThreshold) |
| 9379 | { |
| 9380 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9381 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9382 | |
| 9383 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9384 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9385 | { |
| 9386 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9387 | "LFR runtime successfully set Reassoc threshold to %d" |
| 9388 | "- old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9389 | neighborReassocRssiThreshold, |
| 9390 | pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9391 | macTraceGetNeighbourRoamState( |
| 9392 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9393 | pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold = |
| 9394 | neighborReassocRssiThreshold; |
| 9395 | pMac->roam.neighborRoamInfo.cfgParams.neighborReassocThreshold = |
| 9396 | neighborReassocRssiThreshold; |
| 9397 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9398 | } |
| 9399 | |
| 9400 | return status ; |
| 9401 | } |
| 9402 | |
| 9403 | |
| 9404 | /*-------------------------------------------------------------------------- |
| 9405 | \brief sme_getNeighborLookupRssiThreshold() - get neighbor lookup rssi threshold |
| 9406 | This is a synchronous call |
| 9407 | \param hHal - The handle returned by macOpen. |
| 9408 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9409 | Other status means SME is failed to update |
| 9410 | \sa |
| 9411 | --------------------------------------------------------------------------*/ |
| 9412 | v_U8_t sme_getNeighborLookupRssiThreshold(tHalHandle hHal) |
| 9413 | { |
| 9414 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9415 | return pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold; |
| 9416 | } |
| 9417 | |
| 9418 | /*-------------------------------------------------------------------------- |
| 9419 | \brief sme_setNeighborScanRefreshPeriod() - set neighbor scan results refresh period |
| 9420 | This is a synchronous call |
| 9421 | \param hHal - The handle returned by macOpen. |
| 9422 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9423 | Other status means SME is failed to update |
| 9424 | \sa |
| 9425 | --------------------------------------------------------------------------*/ |
| 9426 | eHalStatus sme_setNeighborScanRefreshPeriod(tHalHandle hHal, |
| 9427 | v_U16_t neighborScanResultsRefreshPeriod) |
| 9428 | { |
| 9429 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9430 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9431 | |
| 9432 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9433 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9434 | { |
| 9435 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9436 | "LFR runtime successfully set roam scan refresh period to %d" |
| 9437 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9438 | neighborScanResultsRefreshPeriod, |
| 9439 | pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9440 | macTraceGetNeighbourRoamState( |
| 9441 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9442 | pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod = |
| 9443 | neighborScanResultsRefreshPeriod; |
| 9444 | pMac->roam.neighborRoamInfo.cfgParams.neighborResultsRefreshPeriod = |
| 9445 | neighborScanResultsRefreshPeriod; |
| 9446 | |
| 9447 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9448 | } |
| 9449 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9450 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9451 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9452 | { |
| 9453 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9454 | REASON_NEIGHBOR_SCAN_REFRESH_PERIOD_CHANGED); |
| 9455 | } |
| 9456 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9457 | return status ; |
| 9458 | } |
| 9459 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9460 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9461 | /*-------------------------------------------------------------------------- |
| 9462 | \brief sme_UpdateRoamScanOffloadEnabled() - enable/disable roam scan offload feaure |
| 9463 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 9464 | gRoamScanOffloadEnabled. |
| 9465 | This is a synchronous call |
| 9466 | \param hHal - The handle returned by macOpen. |
| 9467 | \return eHAL_STATUS_SUCCESS - SME update config successfully. |
| 9468 | Other status means SME is failed to update. |
| 9469 | \sa |
| 9470 | --------------------------------------------------------------------------*/ |
| 9471 | |
| 9472 | eHalStatus sme_UpdateRoamScanOffloadEnabled(tHalHandle hHal, |
| 9473 | v_BOOL_t nRoamScanOffloadEnabled) |
| 9474 | { |
| 9475 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9476 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9477 | |
| 9478 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9479 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9480 | { |
| 9481 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9482 | "%s: gRoamScanOffloadEnabled is changed from %d to %d", __func__, |
| 9483 | pMac->roam.configParam.isRoamOffloadScanEnabled, |
| 9484 | nRoamScanOffloadEnabled); |
| 9485 | pMac->roam.configParam.isRoamOffloadScanEnabled = nRoamScanOffloadEnabled; |
| 9486 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9487 | } |
| 9488 | |
| 9489 | return status ; |
| 9490 | } |
| 9491 | #endif |
| 9492 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9493 | /*-------------------------------------------------------------------------- |
| 9494 | \brief sme_getNeighborScanRefreshPeriod() - get neighbor scan results refresh period |
| 9495 | This is a synchronous call |
| 9496 | \param hHal - The handle returned by macOpen. |
| 9497 | \return v_U16_t - Neighbor scan results refresh period value |
| 9498 | \sa |
| 9499 | --------------------------------------------------------------------------*/ |
| 9500 | v_U16_t sme_getNeighborScanRefreshPeriod(tHalHandle hHal) |
| 9501 | { |
| 9502 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9503 | return pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod; |
| 9504 | } |
| 9505 | |
| 9506 | /*-------------------------------------------------------------------------- |
| 9507 | \brief sme_getEmptyScanRefreshPeriod() - get empty scan refresh period |
| 9508 | This is a synchronuous call |
| 9509 | \param hHal - The handle returned by macOpen. |
| 9510 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9511 | Other status means SME is failed to update |
| 9512 | \sa |
| 9513 | --------------------------------------------------------------------------*/ |
| 9514 | v_U16_t sme_getEmptyScanRefreshPeriod(tHalHandle hHal) |
| 9515 | { |
| 9516 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9517 | return pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod; |
| 9518 | } |
| 9519 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9520 | /* --------------------------------------------------------------------------- |
| 9521 | \fn sme_UpdateEmptyScanRefreshPeriod |
| 9522 | \brief Update nEmptyScanRefreshPeriod |
| 9523 | This function is called through dynamic setConfig callback function |
| 9524 | to configure nEmptyScanRefreshPeriod |
| 9525 | Usage: adb shell iwpriv wlan0 setConfig nEmptyScanRefreshPeriod=[0 .. 60] |
| 9526 | \param hHal - HAL handle for device |
| 9527 | \param nEmptyScanRefreshPeriod - scan period following empty scan results. |
| 9528 | \- return Success or failure |
| 9529 | -------------------------------------------------------------------------*/ |
| 9530 | |
| 9531 | eHalStatus sme_UpdateEmptyScanRefreshPeriod(tHalHandle hHal, v_U16_t nEmptyScanRefreshPeriod) |
| 9532 | { |
| 9533 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9534 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9535 | |
| 9536 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9537 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9538 | { |
| 9539 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9540 | "LFR runtime successfully set roam scan period to %d -" |
| 9541 | "old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9542 | nEmptyScanRefreshPeriod, |
| 9543 | pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9544 | macTraceGetNeighbourRoamState( |
| 9545 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9546 | pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod = nEmptyScanRefreshPeriod; |
| 9547 | pMac->roam.neighborRoamInfo.cfgParams.emptyScanRefreshPeriod = nEmptyScanRefreshPeriod; |
| 9548 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9549 | } |
| 9550 | |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9551 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9552 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9553 | { |
| 9554 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9555 | REASON_EMPTY_SCAN_REF_PERIOD_CHANGED); |
| 9556 | } |
| 9557 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9558 | return status ; |
| 9559 | } |
| 9560 | |
| 9561 | /* --------------------------------------------------------------------------- |
| 9562 | \fn sme_setNeighborScanMinChanTime |
| 9563 | \brief Update nNeighborScanMinChanTime |
| 9564 | This function is called through dynamic setConfig callback function |
| 9565 | to configure gNeighborScanChannelMinTime |
| 9566 | Usage: adb shell iwpriv wlan0 setConfig gNeighborScanChannelMinTime=[0 .. 60] |
| 9567 | \param hHal - HAL handle for device |
| 9568 | \param nNeighborScanMinChanTime - Channel minimum dwell time |
| 9569 | \- return Success or failure |
| 9570 | -------------------------------------------------------------------------*/ |
| 9571 | eHalStatus sme_setNeighborScanMinChanTime(tHalHandle hHal, const v_U16_t nNeighborScanMinChanTime) |
| 9572 | { |
| 9573 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9574 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9575 | |
| 9576 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9577 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9578 | { |
| 9579 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9580 | "LFR runtime successfully set channel min dwell time to %d" |
| 9581 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9582 | nNeighborScanMinChanTime, |
| 9583 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9584 | macTraceGetNeighbourRoamState( |
| 9585 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9586 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime = nNeighborScanMinChanTime; |
| 9587 | pMac->roam.neighborRoamInfo.cfgParams.minChannelScanTime = nNeighborScanMinChanTime; |
| 9588 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9589 | } |
| 9590 | |
| 9591 | return status ; |
| 9592 | } |
| 9593 | |
| 9594 | /* --------------------------------------------------------------------------- |
| 9595 | \fn sme_setNeighborScanMaxChanTime |
| 9596 | \brief Update nNeighborScanMaxChanTime |
| 9597 | This function is called through dynamic setConfig callback function |
| 9598 | to configure gNeighborScanChannelMaxTime |
| 9599 | Usage: adb shell iwpriv wlan0 setConfig gNeighborScanChannelMaxTime=[0 .. 60] |
| 9600 | \param hHal - HAL handle for device |
| 9601 | \param nNeighborScanMinChanTime - Channel maximum dwell time |
| 9602 | \- return Success or failure |
| 9603 | -------------------------------------------------------------------------*/ |
| 9604 | eHalStatus sme_setNeighborScanMaxChanTime(tHalHandle hHal, const v_U16_t nNeighborScanMaxChanTime) |
| 9605 | { |
| 9606 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9607 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9608 | |
| 9609 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9610 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9611 | { |
| 9612 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9613 | "LFR runtime successfully set channel max dwell time to %d" |
| 9614 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9615 | nNeighborScanMaxChanTime, |
| 9616 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMaxChanTime, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9617 | macTraceGetNeighbourRoamState( |
| 9618 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9619 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMaxChanTime = nNeighborScanMaxChanTime; |
| 9620 | pMac->roam.neighborRoamInfo.cfgParams.maxChannelScanTime = nNeighborScanMaxChanTime; |
| 9621 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9622 | } |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9623 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9624 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9625 | { |
| 9626 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9627 | REASON_SCAN_CH_TIME_CHANGED); |
| 9628 | } |
| 9629 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9630 | |
| 9631 | return status ; |
| 9632 | } |
| 9633 | |
| 9634 | /* --------------------------------------------------------------------------- |
| 9635 | \fn sme_getNeighborScanMinChanTime |
| 9636 | \brief get neighbor scan min channel time |
| 9637 | \param hHal - The handle returned by macOpen. |
| 9638 | \return v_U16_t - channel min time value |
| 9639 | -------------------------------------------------------------------------*/ |
| 9640 | v_U16_t sme_getNeighborScanMinChanTime(tHalHandle hHal) |
| 9641 | { |
| 9642 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9643 | return pMac->roam.neighborRoamInfo.cfgParams.minChannelScanTime; |
| 9644 | } |
| 9645 | |
| 9646 | /* --------------------------------------------------------------------------- |
| 9647 | \fn sme_getNeighborScanMaxChanTime |
| 9648 | \brief get neighbor scan max channel time |
| 9649 | \param hHal - The handle returned by macOpen. |
| 9650 | \return v_U16_t - channel max time value |
| 9651 | -------------------------------------------------------------------------*/ |
| 9652 | v_U16_t sme_getNeighborScanMaxChanTime(tHalHandle hHal) |
| 9653 | { |
| 9654 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9655 | return pMac->roam.neighborRoamInfo.cfgParams.maxChannelScanTime; |
| 9656 | } |
| 9657 | |
| 9658 | /* --------------------------------------------------------------------------- |
| 9659 | \fn sme_setNeighborScanPeriod |
| 9660 | \brief Update nNeighborScanPeriod |
| 9661 | This function is called through dynamic setConfig callback function |
| 9662 | to configure nNeighborScanPeriod |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9663 | Usage: adb shell iwpriv wlan0 setConfig nNeighborScanPeriod=[0 .. 1000] |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9664 | \param hHal - HAL handle for device |
| 9665 | \param nNeighborScanPeriod - neighbor scan period |
| 9666 | \- return Success or failure |
| 9667 | -------------------------------------------------------------------------*/ |
| 9668 | eHalStatus sme_setNeighborScanPeriod(tHalHandle hHal, const v_U16_t nNeighborScanPeriod) |
| 9669 | { |
| 9670 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9671 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9672 | |
| 9673 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9674 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9675 | { |
| 9676 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9677 | "LFR runtime successfully set neighbor scan period to %d" |
| 9678 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9679 | nNeighborScanPeriod, |
| 9680 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9681 | macTraceGetNeighbourRoamState( |
| 9682 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9683 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod = nNeighborScanPeriod; |
| 9684 | pMac->roam.neighborRoamInfo.cfgParams.neighborScanPeriod = nNeighborScanPeriod; |
| 9685 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9686 | } |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9687 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9688 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9689 | { |
| 9690 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9691 | REASON_SCAN_HOME_TIME_CHANGED); |
| 9692 | } |
| 9693 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9694 | |
| 9695 | return status ; |
| 9696 | } |
| 9697 | |
| 9698 | /* --------------------------------------------------------------------------- |
| 9699 | \fn sme_getNeighborScanPeriod |
| 9700 | \brief get neighbor scan period |
| 9701 | \param hHal - The handle returned by macOpen. |
| 9702 | \return v_U16_t - neighbor scan period |
| 9703 | -------------------------------------------------------------------------*/ |
| 9704 | v_U16_t sme_getNeighborScanPeriod(tHalHandle hHal) |
| 9705 | { |
| 9706 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9707 | return pMac->roam.neighborRoamInfo.cfgParams.neighborScanPeriod; |
| 9708 | } |
| 9709 | |
| 9710 | #endif |
| 9711 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9712 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9713 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9714 | /*-------------------------------------------------------------------------- |
| 9715 | \brief sme_getRoamRssiDiff() - get Roam rssi diff |
| 9716 | This is a synchronous call |
| 9717 | \param hHal - The handle returned by macOpen. |
| 9718 | \return v_U16_t - Rssi diff value |
| 9719 | \sa |
| 9720 | --------------------------------------------------------------------------*/ |
| 9721 | v_U8_t sme_getRoamRssiDiff(tHalHandle hHal) |
| 9722 | { |
| 9723 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9724 | return pMac->roam.configParam.RoamRssiDiff; |
| 9725 | } |
| 9726 | |
| 9727 | /*-------------------------------------------------------------------------- |
| 9728 | \brief sme_ChangeRoamScanChannelList() - Change roam scan channel list |
| 9729 | This is a synchronous call |
| 9730 | \param hHal - The handle returned by macOpen. |
| 9731 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9732 | Other status means SME is failed to update |
| 9733 | \sa |
| 9734 | --------------------------------------------------------------------------*/ |
| 9735 | eHalStatus sme_ChangeRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, |
| 9736 | tANI_U8 numChannels) |
| 9737 | { |
| 9738 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9739 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9740 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9741 | tANI_U8 oldChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
Kiet Lam | 600d3ca | 2013-08-31 16:33:32 +0530 | [diff] [blame] | 9742 | tANI_U8 newChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9743 | tANI_U8 i = 0, j = 0; |
| 9744 | |
| 9745 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9746 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9747 | { |
| 9748 | if (NULL != pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
| 9749 | { |
| 9750 | for (i = 0; i < pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; i++) |
| 9751 | { |
Kaushik, Sushant | d39915b | 2014-04-23 15:12:28 +0530 | [diff] [blame] | 9752 | if (j < sizeof(oldChannelList)) |
| 9753 | { |
| 9754 | j += snprintf(oldChannelList + j, sizeof(oldChannelList) - j," %d", |
| 9755 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]); |
| 9756 | } |
| 9757 | else |
| 9758 | { |
| 9759 | break; |
| 9760 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9761 | } |
| 9762 | } |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9763 | csrFlushCfgBgScanRoamChannelList(pMac); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9764 | csrCreateBgScanRoamChannelList(pMac, pChannelList, numChannels); |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9765 | sme_SetRoamScanControl(hHal, 1); |
| 9766 | if (NULL != pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9767 | { |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9768 | j = 0; |
| 9769 | for (i = 0; i < pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; i++) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9770 | { |
Kaushik, Sushant | d39915b | 2014-04-23 15:12:28 +0530 | [diff] [blame] | 9771 | if (j < sizeof(oldChannelList)) |
| 9772 | { |
| 9773 | j += snprintf(newChannelList + j, sizeof(newChannelList) - j," %d", |
| 9774 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]); |
| 9775 | } |
| 9776 | else |
| 9777 | { |
| 9778 | break; |
| 9779 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9780 | } |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9781 | } |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9782 | |
| 9783 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9784 | "LFR runtime successfully set roam scan channels to %s" |
| 9785 | "- old value is %s - roam state is %s", |
| 9786 | newChannelList, oldChannelList, |
| 9787 | macTraceGetNeighbourRoamState( |
| 9788 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9789 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9790 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9791 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9792 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9793 | { |
| 9794 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); |
| 9795 | } |
| 9796 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9797 | |
| 9798 | return status ; |
| 9799 | } |
| 9800 | |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9801 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9802 | #ifdef FEATURE_WLAN_ESE_UPLOAD |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9803 | /*-------------------------------------------------------------------------- |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9804 | \brief sme_SetEseRoamScanChannelList() - set ese roam scan channel list |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9805 | This is a synchronuous call |
| 9806 | \param hHal - The handle returned by macOpen. |
| 9807 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9808 | Other status means SME is failed to update |
| 9809 | \sa |
| 9810 | --------------------------------------------------------------------------*/ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9811 | eHalStatus sme_SetEseRoamScanChannelList(tHalHandle hHal, |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9812 | tANI_U8 *pChannelList, |
| 9813 | tANI_U8 numChannels) |
| 9814 | { |
| 9815 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9816 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9817 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 9818 | tpCsrChannelInfo currChannelListInfo = &pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo; |
| 9819 | tANI_U8 oldChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
| 9820 | tANI_U8 newChannelList[128] = {0}; |
| 9821 | tANI_U8 i = 0, j = 0; |
| 9822 | |
| 9823 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9824 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9825 | { |
| 9826 | if (NULL != currChannelListInfo->ChannelList) |
| 9827 | { |
| 9828 | for (i = 0; i < currChannelListInfo->numOfChannels; i++) |
| 9829 | { |
| 9830 | j += snprintf(oldChannelList + j, sizeof(oldChannelList) - j," %d", |
| 9831 | currChannelListInfo->ChannelList[i]); |
| 9832 | } |
| 9833 | } |
| 9834 | status = csrCreateRoamScanChannelList(pMac, pChannelList, numChannels, csrGetCurrentBand(hHal)); |
| 9835 | |
| 9836 | if ( HAL_STATUS_SUCCESS( status )) |
| 9837 | { |
| 9838 | if (NULL != currChannelListInfo->ChannelList) |
| 9839 | { |
| 9840 | j = 0; |
| 9841 | for (i = 0; i < currChannelListInfo->numOfChannels; i++) |
| 9842 | { |
| 9843 | j += snprintf(newChannelList + j, sizeof(newChannelList) - j," %d", |
| 9844 | currChannelListInfo->ChannelList[i]); |
| 9845 | } |
| 9846 | } |
| 9847 | |
| 9848 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9849 | "ESE roam scan channel list successfully set to %s - old value is %s - roam state is %s", |
| 9850 | newChannelList, oldChannelList, |
| 9851 | macTraceGetNeighbourRoamState(pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9852 | } |
| 9853 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9854 | } |
| 9855 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9856 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9857 | { |
| 9858 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); |
| 9859 | } |
| 9860 | #endif |
| 9861 | |
| 9862 | return status ; |
| 9863 | } |
| 9864 | #endif |
| 9865 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9866 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9867 | \brief sme_getRoamScanChannelList() - get roam scan channel list |
| 9868 | This is a synchronous call |
| 9869 | \param hHal - The handle returned by macOpen. |
| 9870 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9871 | Other status means SME is failed to update |
| 9872 | \sa |
| 9873 | --------------------------------------------------------------------------*/ |
| 9874 | eHalStatus sme_getRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, |
| 9875 | tANI_U8 *pNumChannels) |
| 9876 | { |
| 9877 | int i = 0; |
| 9878 | tANI_U8 *pOutPtr = pChannelList; |
| 9879 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9880 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 9881 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9882 | |
| 9883 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9884 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9885 | { |
| 9886 | if (NULL == pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
| 9887 | { |
| 9888 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, |
| 9889 | "Roam Scan channel list is NOT yet initialized"); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9890 | *pNumChannels = 0; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9891 | sme_ReleaseGlobalLock( &pMac->sme ); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9892 | return status; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9893 | } |
| 9894 | |
| 9895 | *pNumChannels = pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; |
| 9896 | for (i = 0; i < (*pNumChannels); i++) |
| 9897 | { |
| 9898 | pOutPtr[i] = pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]; |
| 9899 | } |
| 9900 | pOutPtr[i] = '\0'; |
| 9901 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9902 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9903 | return status ; |
| 9904 | } |
| 9905 | |
| 9906 | /*-------------------------------------------------------------------------- |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9907 | \brief sme_getIsEseFeatureEnabled() - get Ese feature enabled or not |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9908 | This is a synchronuous call |
| 9909 | \param hHal - The handle returned by macOpen. |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9910 | \return TRUE (1) - if the Ese feature is enabled |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9911 | FALSE (0) - if feature is disabled (compile or runtime) |
| 9912 | \sa |
| 9913 | --------------------------------------------------------------------------*/ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9914 | tANI_BOOLEAN sme_getIsEseFeatureEnabled(tHalHandle hHal) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9915 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9916 | #ifdef FEATURE_WLAN_ESE |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9917 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9918 | return csrRoamIsEseIniFeatureEnabled(pMac); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9919 | #else |
| 9920 | return eANI_BOOLEAN_FALSE; |
| 9921 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9922 | } |
| 9923 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9924 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 9925 | \brief sme_GetWESMode() - get WES Mode |
| 9926 | This is a synchronous call |
| 9927 | \param hHal - The handle returned by macOpen |
| 9928 | \return v_U8_t - WES Mode Enabled(1)/Disabled(0) |
| 9929 | \sa |
| 9930 | --------------------------------------------------------------------------*/ |
| 9931 | v_BOOL_t sme_GetWESMode(tHalHandle hHal) |
| 9932 | { |
| 9933 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9934 | return pMac->roam.configParam.isWESModeEnabled; |
| 9935 | } |
| 9936 | |
| 9937 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9938 | \brief sme_GetRoamScanControl() - get scan control |
| 9939 | This is a synchronous call |
| 9940 | \param hHal - The handle returned by macOpen. |
| 9941 | \return v_BOOL_t - Enabled(1)/Disabled(0) |
| 9942 | \sa |
| 9943 | --------------------------------------------------------------------------*/ |
| 9944 | v_BOOL_t sme_GetRoamScanControl(tHalHandle hHal) |
| 9945 | { |
| 9946 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9947 | return pMac->roam.configParam.nRoamScanControl; |
| 9948 | } |
| 9949 | #endif |
| 9950 | |
| 9951 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9952 | \brief sme_getIsLfrFeatureEnabled() - get LFR feature enabled or not |
| 9953 | This is a synchronuous call |
| 9954 | \param hHal - The handle returned by macOpen. |
| 9955 | \return TRUE (1) - if the feature is enabled |
| 9956 | FALSE (0) - if feature is disabled (compile or runtime) |
| 9957 | \sa |
| 9958 | --------------------------------------------------------------------------*/ |
| 9959 | tANI_BOOLEAN sme_getIsLfrFeatureEnabled(tHalHandle hHal) |
| 9960 | { |
| 9961 | #ifdef FEATURE_WLAN_LFR |
| 9962 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9963 | return pMac->roam.configParam.isFastRoamIniFeatureEnabled; |
| 9964 | #else |
| 9965 | return eANI_BOOLEAN_FALSE; |
| 9966 | #endif |
| 9967 | } |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 9968 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9969 | /*-------------------------------------------------------------------------- |
| 9970 | \brief sme_getIsFtFeatureEnabled() - get FT feature enabled or not |
| 9971 | This is a synchronuous call |
| 9972 | \param hHal - The handle returned by macOpen. |
| 9973 | \return TRUE (1) - if the feature is enabled |
| 9974 | FALSE (0) - if feature is disabled (compile or runtime) |
| 9975 | \sa |
| 9976 | --------------------------------------------------------------------------*/ |
| 9977 | tANI_BOOLEAN sme_getIsFtFeatureEnabled(tHalHandle hHal) |
| 9978 | { |
| 9979 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 9980 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9981 | return pMac->roam.configParam.isFastTransitionEnabled; |
| 9982 | #else |
| 9983 | return eANI_BOOLEAN_FALSE; |
| 9984 | #endif |
| 9985 | } |
| 9986 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9987 | /* --------------------------------------------------------------------------- |
| 9988 | \fn sme_IsFeatureSupportedByFW |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9989 | |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 9990 | \brief Check if a feature is enabled by FW |
| 9991 | |
| 9992 | \param featEnumValue - Enumeration value from placeHolderInCapBitmap |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9993 | |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 9994 | \- return 1/0 (TRUE/FALSE) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9995 | -------------------------------------------------------------------------*/ |
| 9996 | tANI_U8 sme_IsFeatureSupportedByFW(tANI_U8 featEnumValue) |
| 9997 | { |
| 9998 | return IS_FEATURE_SUPPORTED_BY_FW(featEnumValue); |
| 9999 | } |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 10000 | |
| 10001 | /* --------------------------------------------------------------------------- |
| 10002 | \fn sme_IsFeatureSupportedByDriver |
| 10003 | \brief Check if a feature is enabled by Driver |
| 10004 | |
| 10005 | \param featEnumValue - Enumeration value from placeHolderInCapBitmap |
| 10006 | \- return 1/0 (TRUE/FALSE) |
| 10007 | -------------------------------------------------------------------------*/ |
| 10008 | |
| 10009 | tANI_U8 sme_IsFeatureSupportedByDriver(tANI_U8 featEnumValue) |
| 10010 | { |
| 10011 | return IS_FEATURE_SUPPORTED_BY_DRIVER(featEnumValue); |
| 10012 | } |
| 10013 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10014 | #ifdef FEATURE_WLAN_TDLS |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 10015 | |
| 10016 | /* --------------------------------------------------------------------------- |
| 10017 | \fn sme_SendTdlsMgmtFrame |
| 10018 | \brief API to send TDLS management frames. |
| 10019 | |
| 10020 | \param peerMac - peer's Mac Adress. |
| 10021 | \param tdlsLinkEstablishParams - TDLS Peer Link Establishment Parameters |
| 10022 | \- return VOS_STATUS_SUCCES |
| 10023 | -------------------------------------------------------------------------*/ |
| 10024 | VOS_STATUS sme_SendTdlsLinkEstablishParams(tHalHandle hHal, |
| 10025 | tANI_U8 sessionId, |
| 10026 | tSirMacAddr peerMac, |
| 10027 | tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams) |
| 10028 | { |
| 10029 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10030 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10031 | |
| 10032 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10033 | |
| 10034 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10035 | { |
| 10036 | status = csrTdlsSendLinkEstablishParams(hHal, sessionId, peerMac, tdlsLinkEstablishParams) ; |
| 10037 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10038 | } |
| 10039 | return status ; |
| 10040 | } |
| 10041 | |
Atul Mittal | c0f739f | 2014-07-31 13:47:47 +0530 | [diff] [blame] | 10042 | // tdlsoffchan |
| 10043 | |
| 10044 | /* --------------------------------------------------------------------------- |
| 10045 | \fn sme_SendTdlsChanSwitchReq |
| 10046 | \brief API to send TDLS management frames. |
| 10047 | |
| 10048 | \param peerMac - peer's Mac Adress. |
| 10049 | \param tdlsLinkEstablishParams - TDLS Peer Link Establishment Parameters |
| 10050 | \- return VOS_STATUS_SUCCES |
| 10051 | -------------------------------------------------------------------------*/ |
| 10052 | VOS_STATUS sme_SendTdlsChanSwitchReq(tHalHandle hHal, |
| 10053 | tANI_U8 sessionId, |
| 10054 | tSirMacAddr peerMac, |
| 10055 | tANI_S32 tdlsOffCh, |
| 10056 | tANI_S32 tdlsOffChBwOffset, |
| 10057 | tANI_U8 tdlsSwMode) |
| 10058 | { |
| 10059 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10060 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10061 | |
| 10062 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10063 | |
| 10064 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10065 | { |
| 10066 | status = csrTdlsSendChanSwitchReq(hHal, sessionId, peerMac, |
| 10067 | tdlsOffCh, tdlsOffChBwOffset, |
| 10068 | tdlsSwMode); |
| 10069 | } |
| 10070 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10071 | return status ; |
| 10072 | } |
| 10073 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10074 | /* --------------------------------------------------------------------------- |
| 10075 | \fn sme_SendTdlsMgmtFrame |
| 10076 | \brief API to send TDLS management frames. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10077 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10078 | \param peerMac - peer's Mac Adress. |
| 10079 | \param frame_type - Type of TDLS mgmt frame to be sent. |
| 10080 | \param dialog - dialog token used in the frame. |
| 10081 | \param status - status to be incuded in the frame. |
Pradeep Reddy POTTETI | ca171f8 | 2014-03-21 14:17:35 +0530 | [diff] [blame] | 10082 | \param peerCapability - peer cpabilities |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10083 | \param buf - additional IEs to be included |
| 10084 | \param len - lenght of additional Ies |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 10085 | \param responder - Tdls request type |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10086 | \- return VOS_STATUS_SUCCES |
| 10087 | -------------------------------------------------------------------------*/ |
| 10088 | VOS_STATUS sme_SendTdlsMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, |
Pradeep Reddy POTTETI | ca171f8 | 2014-03-21 14:17:35 +0530 | [diff] [blame] | 10089 | tANI_U8 frame_type, tANI_U8 dialog, tANI_U16 statusCode, tANI_U32 peerCapability, tANI_U8 *buf, tANI_U8 len, tANI_U8 responder) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10090 | { |
| 10091 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10092 | tCsrTdlsSendMgmt sendTdlsReq = {{0}} ; |
| 10093 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10094 | |
| 10095 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10096 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10097 | { |
| 10098 | vos_mem_copy(sendTdlsReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 10099 | sendTdlsReq.frameType = frame_type; |
| 10100 | sendTdlsReq.buf = buf; |
| 10101 | sendTdlsReq.len = len; |
| 10102 | sendTdlsReq.dialog = dialog; |
| 10103 | sendTdlsReq.statusCode = statusCode; |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 10104 | sendTdlsReq.responder = responder; |
Pradeep Reddy POTTETI | ca171f8 | 2014-03-21 14:17:35 +0530 | [diff] [blame] | 10105 | sendTdlsReq.peerCapability = peerCapability; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10106 | |
| 10107 | status = csrTdlsSendMgmtReq(hHal, sessionId, &sendTdlsReq) ; |
| 10108 | |
| 10109 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10110 | } |
| 10111 | |
| 10112 | return status ; |
| 10113 | |
| 10114 | } |
| 10115 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 10116 | \fn sme_ChangeTdlsPeerSta |
| 10117 | \brief API to Update TDLS peer sta parameters. |
| 10118 | |
| 10119 | \param peerMac - peer's Mac Adress. |
| 10120 | \param staParams - Peer Station Parameters |
| 10121 | \- return VOS_STATUS_SUCCES |
| 10122 | -------------------------------------------------------------------------*/ |
| 10123 | VOS_STATUS sme_ChangeTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, |
| 10124 | tCsrStaParams *pstaParams) |
| 10125 | { |
| 10126 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10127 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10128 | |
Sushant Kaushik | d62d978 | 2014-02-19 15:39:40 +0530 | [diff] [blame] | 10129 | if (NULL == pstaParams) |
| 10130 | { |
| 10131 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10132 | "%s :pstaParams is NULL",__func__); |
| 10133 | return eHAL_STATUS_FAILURE; |
| 10134 | } |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 10135 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10136 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10137 | { |
| 10138 | status = csrTdlsChangePeerSta(hHal, sessionId, peerMac,pstaParams); |
| 10139 | |
| 10140 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10141 | } |
| 10142 | |
| 10143 | return status ; |
| 10144 | |
| 10145 | } |
| 10146 | |
| 10147 | /* --------------------------------------------------------------------------- |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10148 | \fn sme_AddTdlsPeerSta |
| 10149 | \brief API to Add TDLS peer sta entry. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10150 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10151 | \param peerMac - peer's Mac Adress. |
| 10152 | \- return VOS_STATUS_SUCCES |
| 10153 | -------------------------------------------------------------------------*/ |
| 10154 | VOS_STATUS sme_AddTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 10155 | { |
| 10156 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10157 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10158 | |
| 10159 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10160 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10161 | { |
| 10162 | status = csrTdlsAddPeerSta(hHal, sessionId, peerMac); |
| 10163 | |
| 10164 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10165 | } |
| 10166 | |
| 10167 | return status ; |
| 10168 | |
| 10169 | } |
| 10170 | /* --------------------------------------------------------------------------- |
| 10171 | \fn sme_DeleteTdlsPeerSta |
| 10172 | \brief API to Delete TDLS peer sta entry. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10173 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10174 | \param peerMac - peer's Mac Adress. |
| 10175 | \- return VOS_STATUS_SUCCES |
| 10176 | -------------------------------------------------------------------------*/ |
| 10177 | VOS_STATUS sme_DeleteTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 10178 | { |
| 10179 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10180 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10181 | |
| 10182 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10183 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10184 | { |
| 10185 | status = csrTdlsDelPeerSta(hHal, sessionId, peerMac) ; |
| 10186 | |
| 10187 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10188 | } |
| 10189 | |
| 10190 | return status ; |
| 10191 | |
| 10192 | } |
Gopichand Nakkala | 75e7b28 | 2013-03-15 18:37:13 -0700 | [diff] [blame] | 10193 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | ccd3a38 | 2013-03-19 13:56:10 -0700 | [diff] [blame] | 10194 | \fn sme_SetTdlsPowerSaveProhibited |
| 10195 | \API to set/reset the isTdlsPowerSaveProhibited. |
| 10196 | |
| 10197 | \- return void |
| 10198 | -------------------------------------------------------------------------*/ |
| 10199 | void sme_SetTdlsPowerSaveProhibited(tHalHandle hHal, v_BOOL_t val) |
| 10200 | { |
| 10201 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10202 | |
| 10203 | pMac->isTdlsPowerSaveProhibited = val; |
| 10204 | return; |
| 10205 | } |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10206 | #endif |
Gopichand Nakkala | fe7246d | 2013-06-10 17:43:37 +0530 | [diff] [blame] | 10207 | /* --------------------------------------------------------------------------- |
| 10208 | \fn sme_IsPmcBmps |
| 10209 | \API to Check if PMC state is BMPS. |
| 10210 | |
| 10211 | \- return v_BOOL_t |
| 10212 | -------------------------------------------------------------------------*/ |
| 10213 | v_BOOL_t sme_IsPmcBmps(tHalHandle hHal) |
| 10214 | { |
| 10215 | return (BMPS == pmcGetPmcState(hHal)); |
| 10216 | } |
| 10217 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10218 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 10219 | /* |
| 10220 | * SME API to start TDLS discovery Procedure |
| 10221 | */ |
| 10222 | VOS_STATUS sme_StartTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 10223 | { |
| 10224 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 10225 | tCsrTdlsDisRequest disReq = {{0}} ; |
| 10226 | vos_mem_copy(disReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 10227 | status = csrTdlsDiscoveryReq(hHal, sessionId, &disReq) ; |
| 10228 | |
| 10229 | return status ; |
| 10230 | |
| 10231 | } |
| 10232 | |
| 10233 | /* |
| 10234 | * Process TDLS discovery results |
| 10235 | */ |
| 10236 | v_U8_t sme_GetTdlsDiscoveryResult(tHalHandle hHal, |
| 10237 | tSmeTdlsDisResult *disResult, v_U8_t listType) |
| 10238 | { |
| 10239 | tCsrTdlsPeerLinkinfo *peerLinkInfo = NULL ; |
| 10240 | tSirTdlsPeerInfo *peerInfo = NULL ; |
| 10241 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10242 | tCsrTdlsCtxStruct *disInfo = &pMac->tdlsCtx ; |
| 10243 | tDblLinkList *peerList = &disInfo->tdlsPotentialPeerList ; |
| 10244 | tListElem *pEntry = NULL ; |
| 10245 | v_U8_t peerCnt = 0 ; |
| 10246 | |
| 10247 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 10248 | ("TDLS peer count = %d"),disInfo->tdlsPeerCount ) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10249 | pEntry = csrLLPeekHead( peerList, LL_ACCESS_LOCK ); |
| 10250 | while(pEntry) |
| 10251 | { |
| 10252 | peerLinkInfo = GET_BASE_ADDR( pEntry, tCsrTdlsPeerLinkinfo, |
| 10253 | tdlsPeerStaLink) ; |
| 10254 | peerInfo = &peerLinkInfo->tdlsDisPeerInfo ; |
| 10255 | |
| 10256 | switch(listType) |
| 10257 | { |
| 10258 | case TDLS_SETUP_LIST: |
| 10259 | { |
| 10260 | if(TDLS_LINK_SETUP_STATE == peerInfo->tdlsPeerState) |
| 10261 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 10262 | vos_mem_copy(disResult[peerCnt].tdlsPeerMac, |
| 10263 | peerInfo->peerMac, sizeof(tSirMacAddr)); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10264 | disResult[peerCnt].tdlsPeerRssi = peerInfo->tdlsPeerRssi ; |
| 10265 | peerCnt++ ; |
| 10266 | } |
| 10267 | break ; |
| 10268 | } |
| 10269 | case TDLS_DIS_LIST: |
| 10270 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 10271 | vos_mem_copy(disResult[peerCnt].tdlsPeerMac, |
| 10272 | peerInfo->peerMac, sizeof(tSirMacAddr)); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10273 | disResult[peerCnt].tdlsPeerRssi = peerInfo->tdlsPeerRssi ; |
| 10274 | peerCnt++ ; |
| 10275 | break ; |
| 10276 | } |
| 10277 | default: |
| 10278 | { |
| 10279 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 10280 | ("unknown list type ")) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10281 | break ; |
| 10282 | } |
| 10283 | } |
| 10284 | |
| 10285 | pEntry = csrLLNext( peerList, pEntry, LL_ACCESS_LOCK) ; |
| 10286 | } |
| 10287 | |
| 10288 | return peerCnt ; |
| 10289 | |
| 10290 | } |
| 10291 | |
| 10292 | /* |
| 10293 | * SME API to start TDLS link setup Procedure. |
| 10294 | */ |
| 10295 | VOS_STATUS sme_StartTdlsLinkSetupReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 10296 | { |
| 10297 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 10298 | tCsrTdlsSetupRequest setupReq = {{0}} ; |
| 10299 | vos_mem_copy(setupReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 10300 | status = csrTdlsSetupReq(hHal, sessionId, &setupReq) ; |
| 10301 | return status ; |
| 10302 | |
| 10303 | } |
| 10304 | |
| 10305 | /* |
| 10306 | * SME API to start TDLS link Teardown Procedure. |
| 10307 | */ |
| 10308 | VOS_STATUS sme_StartTdlsLinkTeardownReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 10309 | { |
| 10310 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 10311 | tCsrTdlsTeardownRequest teardownReq = {{0}} ; |
| 10312 | vos_mem_copy(teardownReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 10313 | status = csrTdlsTeardownReq(hHal, sessionId, &teardownReq) ; |
| 10314 | return status ; |
| 10315 | |
| 10316 | } |
| 10317 | |
| 10318 | #endif /* FEATURE_WLAN_TDLS */ |
| 10319 | |
Tushnim Bhattacharyya | 9cdf608 | 2013-04-21 16:33:30 -0700 | [diff] [blame] | 10320 | eHalStatus sme_UpdateDfsSetting(tHalHandle hHal, tANI_U8 fUpdateEnableDFSChnlScan) |
| 10321 | { |
| 10322 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 10323 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10324 | |
| 10325 | smsLog(pMac, LOG2, FL("enter")); |
| 10326 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10327 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10328 | { |
| 10329 | pMac->scan.fEnableDFSChnlScan = fUpdateEnableDFSChnlScan; |
| 10330 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10331 | } |
| 10332 | smsLog(pMac, LOG2, FL("exit status %d"), status); |
| 10333 | |
| 10334 | return (status); |
| 10335 | } |
| 10336 | |
Gopichand Nakkala | e620d5a | 2013-04-26 05:45:57 -0700 | [diff] [blame] | 10337 | /* |
| 10338 | * SME API to enable/disable WLAN driver initiated SSR |
| 10339 | */ |
| 10340 | void sme_UpdateEnableSSR(tHalHandle hHal, tANI_BOOLEAN enableSSR) |
| 10341 | { |
| 10342 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10343 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10344 | |
| 10345 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 10346 | if (HAL_STATUS_SUCCESS(status)) |
| 10347 | { |
| 10348 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 10349 | "SSR level is changed %d", enableSSR); |
| 10350 | /* not serializing this messsage, as this is only going |
| 10351 | * to set a variable in WDA/WDI |
| 10352 | */ |
| 10353 | WDA_SetEnableSSR(enableSSR); |
| 10354 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10355 | } |
| 10356 | return; |
| 10357 | } |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10358 | |
| 10359 | /* |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10360 | * SME API to stringify bonding mode. (hostapd convention) |
| 10361 | */ |
| 10362 | |
| 10363 | static const char* sme_CBMode2String( tANI_U32 mode) |
| 10364 | { |
| 10365 | switch (mode) |
| 10366 | { |
| 10367 | case eCSR_INI_SINGLE_CHANNEL_CENTERED: |
| 10368 | return "HT20"; |
| 10369 | case eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY: |
| 10370 | return "HT40-"; /* lower secondary channel */ |
| 10371 | case eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY: |
| 10372 | return "HT40+"; /* upper secondary channel */ |
| 10373 | #ifdef WLAN_FEATURE_11AC |
| 10374 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 10375 | return "VHT80+40+"; /* upper secondary channels */ |
| 10376 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 10377 | return "VHT80+40-"; /* 1 lower and 2 upper secondary channels */ |
| 10378 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 10379 | return "VHT80-40+"; /* 2 lower and 1 upper secondary channels */ |
| 10380 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 10381 | return "VHT80-40-"; /* lower secondary channels */ |
| 10382 | #endif |
| 10383 | default: |
| 10384 | VOS_ASSERT(0); |
| 10385 | return "Unknown"; |
| 10386 | } |
| 10387 | } |
| 10388 | |
| 10389 | /* |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10390 | * SME API to determine the channel bonding mode |
| 10391 | */ |
| 10392 | VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 channel) |
| 10393 | { |
| 10394 | tSmeConfigParams smeConfig; |
| 10395 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10396 | |
| 10397 | if ( |
| 10398 | #ifdef WLAN_FEATURE_11AC |
| 10399 | eCSR_DOT11_MODE_11ac != eCsrPhyMode && |
| 10400 | eCSR_DOT11_MODE_11ac_ONLY != eCsrPhyMode && |
| 10401 | #endif |
| 10402 | eCSR_DOT11_MODE_11n != eCsrPhyMode && |
krunal soni | 634aba3 | 2014-03-06 17:46:50 -0800 | [diff] [blame] | 10403 | eCSR_DOT11_MODE_11n_ONLY != eCsrPhyMode && |
| 10404 | |
| 10405 | eCSR_DOT11_MODE_11a != eCsrPhyMode && |
| 10406 | eCSR_DOT11_MODE_11a_ONLY != eCsrPhyMode && |
| 10407 | |
| 10408 | eCSR_DOT11_MODE_abg != eCsrPhyMode |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10409 | ) |
| 10410 | { |
| 10411 | return VOS_STATUS_SUCCESS; |
| 10412 | } |
| 10413 | |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10414 | sme_GetConfigParam(pMac, &smeConfig); |
| 10415 | |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10416 | /* If channel bonding mode is not required */ |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10417 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 10418 | if ( !pMac->roam.configParam.channelBondingMode5GHz |
| 10419 | && !smeConfig.csrConfig.apHT40_24GEnabled ) { |
| 10420 | #else |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10421 | if ( !pMac->roam.configParam.channelBondingMode5GHz ) { |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10422 | #endif |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10423 | return VOS_STATUS_SUCCESS; |
| 10424 | } |
| 10425 | |
| 10426 | vos_mem_zero(&smeConfig, sizeof (tSmeConfigParams)); |
| 10427 | sme_GetConfigParam(pMac, &smeConfig); |
| 10428 | |
| 10429 | #ifdef WLAN_FEATURE_11AC |
| 10430 | if ( eCSR_DOT11_MODE_11ac == eCsrPhyMode || |
| 10431 | eCSR_DOT11_MODE_11ac_ONLY == eCsrPhyMode ) |
| 10432 | { |
| 10433 | if ( channel== 36 || channel == 52 || channel == 100 || |
| 10434 | channel == 116 || channel == 149 ) |
| 10435 | { |
| 10436 | smeConfig.csrConfig.channelBondingMode5GHz = |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10437 | eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10438 | } |
| 10439 | else if ( channel == 40 || channel == 56 || channel == 104 || |
| 10440 | channel == 120 || channel == 153 ) |
| 10441 | { |
| 10442 | smeConfig.csrConfig.channelBondingMode5GHz = |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10443 | eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10444 | } |
| 10445 | else if ( channel == 44 || channel == 60 || channel == 108 || |
| 10446 | channel == 124 || channel == 157 ) |
| 10447 | { |
| 10448 | smeConfig.csrConfig.channelBondingMode5GHz = |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10449 | eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10450 | } |
| 10451 | else if ( channel == 48 || channel == 64 || channel == 112 || |
Leo Chang | d0a4984 | 2013-12-30 11:41:04 -0800 | [diff] [blame] | 10452 | channel == 128 || channel == 144 || channel == 161 ) |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10453 | { |
| 10454 | smeConfig.csrConfig.channelBondingMode5GHz = |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10455 | eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10456 | } |
| 10457 | else if ( channel == 165 ) |
| 10458 | { |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10459 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 10460 | eCSR_INI_SINGLE_CHANNEL_CENTERED; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10461 | } |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10462 | |
| 10463 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 10464 | if (smeConfig.csrConfig.apHT40_24GEnabled) |
| 10465 | { |
| 10466 | if (channel >= 1 && channel <= 7) |
| 10467 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 10468 | eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 10469 | else if (channel >= 8 && channel <= 13) |
| 10470 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 10471 | eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 10472 | else if (channel ==14) |
| 10473 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 10474 | eCSR_INI_SINGLE_CHANNEL_CENTERED; |
| 10475 | } |
| 10476 | #endif |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10477 | } |
| 10478 | #endif |
| 10479 | |
| 10480 | if ( eCSR_DOT11_MODE_11n == eCsrPhyMode || |
| 10481 | eCSR_DOT11_MODE_11n_ONLY == eCsrPhyMode ) |
| 10482 | { |
| 10483 | if ( channel== 40 || channel == 48 || channel == 56 || |
| 10484 | channel == 64 || channel == 104 || channel == 112 || |
| 10485 | channel == 120 || channel == 128 || channel == 136 || |
| 10486 | channel == 144 || channel == 153 || channel == 161 ) |
| 10487 | { |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10488 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 10489 | eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10490 | } |
| 10491 | else if ( channel== 36 || channel == 44 || channel == 52 || |
| 10492 | channel == 60 || channel == 100 || channel == 108 || |
| 10493 | channel == 116 || channel == 124 || channel == 132 || |
| 10494 | channel == 140 || channel == 149 || channel == 157 ) |
| 10495 | { |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10496 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 10497 | eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10498 | } |
| 10499 | else if ( channel == 165 ) |
| 10500 | { |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10501 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 10502 | eCSR_INI_SINGLE_CHANNEL_CENTERED; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10503 | } |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10504 | |
| 10505 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 10506 | if (smeConfig.csrConfig.apHT40_24GEnabled) |
| 10507 | { |
| 10508 | if (channel >= 1 && channel <= 7) |
| 10509 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 10510 | eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 10511 | else if (channel >= 8 && channel <= 13) |
| 10512 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 10513 | eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 10514 | else if (channel ==14) |
| 10515 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 10516 | eCSR_INI_SINGLE_CHANNEL_CENTERED; |
| 10517 | } |
| 10518 | #endif |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10519 | } |
krunal soni | 634aba3 | 2014-03-06 17:46:50 -0800 | [diff] [blame] | 10520 | |
| 10521 | /* |
| 10522 | for 802.11a phy mode, channel bonding should be zero. |
| 10523 | From default config, it is set as PHY_DOUBLE_CHANNEL_HIGH_PRIMARY = 3 |
| 10524 | through csrChangeDefaultConfigParam function. We will override this |
| 10525 | value here. |
| 10526 | */ |
| 10527 | if ( eCSR_DOT11_MODE_11a == eCsrPhyMode || |
| 10528 | eCSR_DOT11_MODE_11a_ONLY == eCsrPhyMode || |
| 10529 | eCSR_DOT11_MODE_abg == eCsrPhyMode) |
| 10530 | { |
| 10531 | smeConfig.csrConfig.channelBondingMode5GHz = 0; |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10532 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 10533 | } else if ( eCSR_DOT11_MODE_11g_ONLY == eCsrPhyMode) |
| 10534 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 10535 | eCSR_INI_SINGLE_CHANNEL_CENTERED; |
| 10536 | #else |
krunal soni | 634aba3 | 2014-03-06 17:46:50 -0800 | [diff] [blame] | 10537 | } |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10538 | #endif |
krunal soni | 634aba3 | 2014-03-06 17:46:50 -0800 | [diff] [blame] | 10539 | |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10540 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 10541 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10542 | FL("%s cbmode selected=%d bonding mode:%s"), |
| 10543 | (channel <= 14) ? "2G" : "5G", |
| 10544 | (channel <= 14) ? smeConfig.csrConfig.channelBondingAPMode24GHz : |
| 10545 | smeConfig.csrConfig.channelBondingMode5GHz, |
| 10546 | (channel <= 14) ? |
| 10547 | sme_CBMode2String(smeConfig.csrConfig.channelBondingAPMode24GHz) : |
| 10548 | sme_CBMode2String(smeConfig.csrConfig.channelBondingMode5GHz)); |
| 10549 | #else |
Agarwal Ashish | bf98caf | 2014-03-25 13:29:11 +0530 | [diff] [blame] | 10550 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10551 | "cbmode selected=%d", smeConfig.csrConfig.channelBondingMode5GHz); |
| 10552 | #endif |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10553 | |
| 10554 | sme_UpdateConfig (pMac, &smeConfig); |
| 10555 | return VOS_STATUS_SUCCESS; |
| 10556 | } |
| 10557 | |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 10558 | /*-------------------------------------------------------------------------- |
| 10559 | |
| 10560 | \brief sme_SetCurrDeviceMode() - Sets the current operating device mode. |
| 10561 | \param hHal - The handle returned by macOpen. |
| 10562 | \param currDeviceMode - Current operating device mode. |
| 10563 | --------------------------------------------------------------------------*/ |
| 10564 | |
| 10565 | void sme_SetCurrDeviceMode (tHalHandle hHal, tVOS_CON_MODE currDeviceMode) |
| 10566 | { |
| 10567 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10568 | pMac->sme.currDeviceMode = currDeviceMode; |
| 10569 | return; |
| 10570 | } |
| 10571 | |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 10572 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 10573 | /*-------------------------------------------------------------------------- |
| 10574 | \brief sme_HandoffRequest() - a wrapper function to Request a handoff |
| 10575 | from CSR. |
| 10576 | This is a synchronous call |
| 10577 | \param hHal - The handle returned by macOpen |
| 10578 | \param pHandoffInfo - info provided by HDD with the handoff request (namely: |
| 10579 | BSSID, channel etc.) |
| 10580 | \return eHAL_STATUS_SUCCESS - SME passed the request to CSR successfully. |
| 10581 | Other status means SME is failed to send the request. |
| 10582 | \sa |
| 10583 | --------------------------------------------------------------------------*/ |
| 10584 | |
| 10585 | eHalStatus sme_HandoffRequest(tHalHandle hHal, |
| 10586 | tCsrHandoffRequest *pHandoffInfo) |
| 10587 | { |
| 10588 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10589 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10590 | |
| 10591 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10592 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10593 | { |
| 10594 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10595 | "%s: invoked", __func__); |
| 10596 | status = csrHandoffRequest(pMac, pHandoffInfo); |
| 10597 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10598 | } |
| 10599 | |
| 10600 | return status ; |
| 10601 | } |
| 10602 | #endif |
| 10603 | |
Sudhir Sattayappa Kohalli | b1d8c3a | 2013-06-18 14:47:20 -0700 | [diff] [blame] | 10604 | /* |
| 10605 | * SME API to check if there is any infra station or |
| 10606 | * P2P client is connected |
| 10607 | */ |
| 10608 | VOS_STATUS sme_isSta_p2p_clientConnected(tHalHandle hHal) |
| 10609 | { |
| 10610 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10611 | if(csrIsInfraConnected(pMac)) |
| 10612 | { |
| 10613 | return VOS_STATUS_SUCCESS; |
| 10614 | } |
| 10615 | return VOS_STATUS_E_FAILURE; |
| 10616 | } |
| 10617 | |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10618 | |
| 10619 | #ifdef FEATURE_WLAN_LPHB |
| 10620 | /* --------------------------------------------------------------------------- |
| 10621 | \fn sme_LPHBConfigReq |
| 10622 | \API to make configuration LPHB within FW. |
| 10623 | \param hHal - The handle returned by macOpen |
| 10624 | \param lphdReq - LPHB request argument by client |
| 10625 | \param pCallbackfn - LPHB timeout notification callback function pointer |
| 10626 | \- return Configuration message posting status, SUCCESS or Fail |
| 10627 | -------------------------------------------------------------------------*/ |
| 10628 | eHalStatus sme_LPHBConfigReq |
| 10629 | ( |
| 10630 | tHalHandle hHal, |
| 10631 | tSirLPHBReq *lphdReq, |
| 10632 | void (*pCallbackfn)(void *pAdapter, void *indParam) |
| 10633 | ) |
| 10634 | { |
| 10635 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10636 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 10637 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10638 | vos_msg_t vosMessage; |
| 10639 | |
| 10640 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 10641 | if (eHAL_STATUS_SUCCESS == status) |
| 10642 | { |
| 10643 | if ((LPHB_SET_EN_PARAMS_INDID == lphdReq->cmd) && |
| 10644 | (NULL == pCallbackfn) && |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 10645 | (NULL == pMac->sme.pLphbIndCb)) |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10646 | { |
| 10647 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10648 | "%s: Indication Call back did not registered", __func__); |
| 10649 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10650 | return eHAL_STATUS_FAILURE; |
| 10651 | } |
| 10652 | else if (NULL != pCallbackfn) |
| 10653 | { |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 10654 | pMac->sme.pLphbIndCb = pCallbackfn; |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10655 | } |
| 10656 | |
| 10657 | /* serialize the req through MC thread */ |
| 10658 | vosMessage.bodyptr = lphdReq; |
| 10659 | vosMessage.type = WDA_LPHB_CONF_REQ; |
| 10660 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 10661 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 10662 | { |
| 10663 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10664 | "%s: Post Config LPHB MSG fail", __func__); |
| 10665 | status = eHAL_STATUS_FAILURE; |
| 10666 | } |
| 10667 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10668 | } |
| 10669 | |
| 10670 | return(status); |
| 10671 | } |
| 10672 | #endif /* FEATURE_WLAN_LPHB */ |
Sudhir Sattayappa Kohalli | 3762069 | 2013-08-05 14:02:26 -0700 | [diff] [blame] | 10673 | /*-------------------------------------------------------------------------- |
| 10674 | \brief sme_enable_disable_split_scan() - a wrapper function to set the split |
| 10675 | scan parameter. |
| 10676 | This is a synchronous call |
| 10677 | \param hHal - The handle returned by macOpen |
| 10678 | \return NONE. |
| 10679 | \sa |
| 10680 | --------------------------------------------------------------------------*/ |
| 10681 | void sme_enable_disable_split_scan (tHalHandle hHal, tANI_U8 nNumStaChan, |
| 10682 | tANI_U8 nNumP2PChan) |
| 10683 | { |
| 10684 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10685 | |
| 10686 | pMac->roam.configParam.nNumStaChanCombinedConc = nNumStaChan; |
| 10687 | pMac->roam.configParam.nNumP2PChanCombinedConc = nNumP2PChan; |
| 10688 | |
| 10689 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10690 | "%s: SCAN nNumStaChanCombinedConc : %d," |
| 10691 | "nNumP2PChanCombinedConc : %d ", |
| 10692 | __func__, nNumStaChan, nNumP2PChan); |
| 10693 | |
| 10694 | return; |
| 10695 | |
| 10696 | } |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10697 | |
Yue Ma | b9c86f4 | 2013-08-14 15:59:08 -0700 | [diff] [blame] | 10698 | /* --------------------------------------------------------------------------- |
| 10699 | \fn sme_AddPeriodicTxPtrn |
| 10700 | \brief API to Periodic TX Pattern Offload feature |
| 10701 | \param hHal - The handle returned by macOpen |
| 10702 | \param addPeriodicTxPtrnParams - Pointer to the add pattern structure |
| 10703 | \return eHalStatus |
| 10704 | ---------------------------------------------------------------------------*/ |
| 10705 | eHalStatus sme_AddPeriodicTxPtrn(tHalHandle hHal, tSirAddPeriodicTxPtrn |
| 10706 | *addPeriodicTxPtrnParams) |
| 10707 | { |
| 10708 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10709 | eHalStatus status; |
| 10710 | vos_msg_t msg; |
| 10711 | |
| 10712 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 10713 | { |
| 10714 | msg.type = WDA_ADD_PERIODIC_TX_PTRN_IND; |
| 10715 | msg.bodyptr = addPeriodicTxPtrnParams; |
| 10716 | |
| 10717 | if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 10718 | { |
| 10719 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " |
| 10720 | "to post WDA_ADD_PERIODIC_TX_PTRN_IND to WDA!", |
| 10721 | __func__); |
| 10722 | |
| 10723 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10724 | return eHAL_STATUS_FAILURE; |
| 10725 | } |
| 10726 | |
| 10727 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10728 | return eHAL_STATUS_SUCCESS; |
| 10729 | } |
| 10730 | |
| 10731 | return status; |
| 10732 | } |
| 10733 | |
| 10734 | /* --------------------------------------------------------------------------- |
| 10735 | \fn sme_DelPeriodicTxPtrn |
| 10736 | \brief API to Periodic TX Pattern Offload feature |
| 10737 | \param hHal - The handle returned by macOpen |
| 10738 | \param delPeriodicTxPtrnParams - Pointer to the delete pattern structure |
| 10739 | \return eHalStatus |
| 10740 | ---------------------------------------------------------------------------*/ |
| 10741 | eHalStatus sme_DelPeriodicTxPtrn(tHalHandle hHal, tSirDelPeriodicTxPtrn |
| 10742 | *delPeriodicTxPtrnParams) |
| 10743 | { |
| 10744 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10745 | eHalStatus status; |
| 10746 | vos_msg_t msg; |
| 10747 | |
| 10748 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 10749 | { |
| 10750 | msg.type = WDA_DEL_PERIODIC_TX_PTRN_IND; |
| 10751 | msg.bodyptr = delPeriodicTxPtrnParams; |
| 10752 | |
| 10753 | if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 10754 | { |
| 10755 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " |
| 10756 | "to post WDA_DEL_PERIODIC_TX_PTRN_IND to WDA!", |
| 10757 | __func__); |
| 10758 | |
| 10759 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10760 | return eHAL_STATUS_FAILURE; |
| 10761 | } |
| 10762 | |
| 10763 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10764 | return eHAL_STATUS_SUCCESS; |
| 10765 | } |
| 10766 | |
| 10767 | return status; |
| 10768 | } |
| 10769 | |
Tushnim Bhattacharyya | ad37df1 | 2013-10-02 12:01:33 -0700 | [diff] [blame] | 10770 | void smeGetCommandQStatus( tHalHandle hHal ) |
| 10771 | { |
| 10772 | tSmeCmd *pTempCmd = NULL; |
| 10773 | tListElem *pEntry; |
| 10774 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10775 | |
| 10776 | if (NULL == pMac) |
| 10777 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 10778 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 10779 | "%s: pMac is null", __func__); |
Tushnim Bhattacharyya | ad37df1 | 2013-10-02 12:01:33 -0700 | [diff] [blame] | 10780 | return; |
| 10781 | } |
| 10782 | |
| 10783 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK ); |
| 10784 | if( pEntry ) |
| 10785 | { |
| 10786 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 10787 | } |
| 10788 | smsLog( pMac, LOGE, "Currently smeCmdActiveList has command (0x%X)", |
| 10789 | (pTempCmd) ? pTempCmd->command : eSmeNoCommand ); |
| 10790 | if(pTempCmd) |
| 10791 | { |
| 10792 | if( eSmeCsrCommandMask & pTempCmd->command ) |
| 10793 | { |
| 10794 | //CSR command is stuck. See what the reason code is for that command |
| 10795 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 10796 | } |
| 10797 | } //if(pTempCmd) |
| 10798 | |
| 10799 | smsLog( pMac, LOGE, "Currently smeCmdPendingList has %d commands", |
| 10800 | csrLLCount(&pMac->sme.smeCmdPendingList)); |
| 10801 | |
| 10802 | smsLog( pMac, LOGE, "Currently roamCmdPendingList has %d commands", |
| 10803 | csrLLCount(&pMac->roam.roamCmdPendingList)); |
| 10804 | |
| 10805 | return; |
| 10806 | } |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 10807 | |
| 10808 | #ifdef FEATURE_WLAN_BATCH_SCAN |
| 10809 | /* --------------------------------------------------------------------------- |
| 10810 | \fn sme_SetBatchScanReq |
| 10811 | \brief API to set batch scan request in FW |
| 10812 | \param hHal - The handle returned by macOpen. |
| 10813 | \param pRequest - Pointer to the batch request. |
| 10814 | \param sessionId - session ID |
| 10815 | \param callbackRoutine - HDD callback which needs to be invoked after |
| 10816 | getting set batch scan response from FW |
| 10817 | \param callbackContext - pAdapter context |
| 10818 | \return eHalStatus |
| 10819 | ---------------------------------------------------------------------------*/ |
| 10820 | eHalStatus sme_SetBatchScanReq |
| 10821 | ( |
| 10822 | tHalHandle hHal, tSirSetBatchScanReq *pRequest, tANI_U8 sessionId, |
| 10823 | void (*callbackRoutine) (void *callbackCtx, tSirSetBatchScanRsp *pRsp), |
| 10824 | void *callbackContext |
| 10825 | ) |
| 10826 | { |
| 10827 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10828 | eHalStatus status; |
| 10829 | |
Yue Ma | e36e355 | 2014-03-05 17:06:20 -0800 | [diff] [blame] | 10830 | if (!pMac) |
| 10831 | { |
| 10832 | return eHAL_STATUS_FAILURE; |
| 10833 | } |
| 10834 | |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 10835 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 10836 | { |
| 10837 | status = pmcSetBatchScanReq(hHal, pRequest, sessionId, callbackRoutine, |
| 10838 | callbackContext); |
| 10839 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10840 | } |
| 10841 | |
| 10842 | return status; |
| 10843 | } |
| 10844 | |
| 10845 | /* --------------------------------------------------------------------------- |
Chittajit Mitra | f5413a4 | 2013-10-18 14:20:08 -0700 | [diff] [blame] | 10846 | \fn sme_SendRateUpdateInd |
| 10847 | \brief API to Update rate |
| 10848 | \param hHal - The handle returned by macOpen |
| 10849 | \param rateUpdateParams - Pointer to rate update params |
| 10850 | \return eHalStatus |
| 10851 | ---------------------------------------------------------------------------*/ |
| 10852 | eHalStatus sme_SendRateUpdateInd(tHalHandle hHal, tSirRateUpdateInd *rateUpdateParams) |
| 10853 | { |
| 10854 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10855 | eHalStatus status; |
| 10856 | vos_msg_t msg; |
| 10857 | |
| 10858 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 10859 | { |
| 10860 | msg.type = WDA_RATE_UPDATE_IND; |
| 10861 | msg.bodyptr = rateUpdateParams; |
| 10862 | |
| 10863 | if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 10864 | { |
| 10865 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " |
| 10866 | "to post WDA_SET_RMC_RATE_IND to WDA!", |
| 10867 | __func__); |
| 10868 | |
| 10869 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10870 | return eHAL_STATUS_FAILURE; |
| 10871 | } |
| 10872 | |
| 10873 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10874 | return eHAL_STATUS_SUCCESS; |
| 10875 | } |
| 10876 | |
| 10877 | return status; |
| 10878 | } |
| 10879 | |
| 10880 | /* --------------------------------------------------------------------------- |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 10881 | \fn sme_TriggerBatchScanResultInd |
| 10882 | \brief API to trigger batch scan result indications from FW |
| 10883 | \param hHal - The handle returned by macOpen. |
| 10884 | \param pRequest - Pointer to get batch request. |
| 10885 | \param sessionId - session ID |
| 10886 | \param callbackRoutine - HDD callback which needs to be invoked after |
| 10887 | getting batch scan result indication from FW |
| 10888 | \param callbackContext - pAdapter context |
| 10889 | \return eHalStatus |
| 10890 | ---------------------------------------------------------------------------*/ |
| 10891 | eHalStatus sme_TriggerBatchScanResultInd |
| 10892 | ( |
| 10893 | tHalHandle hHal, tSirTriggerBatchScanResultInd *pRequest, tANI_U8 sessionId, |
| 10894 | void (*callbackRoutine) (void *callbackCtx, void *pRsp), |
| 10895 | void *callbackContext |
| 10896 | ) |
| 10897 | { |
| 10898 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10899 | eHalStatus status; |
| 10900 | |
| 10901 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 10902 | { |
| 10903 | status = pmcTriggerBatchScanResultInd(hHal, pRequest, sessionId, |
| 10904 | callbackRoutine, callbackContext); |
| 10905 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10906 | } |
| 10907 | |
| 10908 | return status; |
| 10909 | } |
| 10910 | |
| 10911 | |
| 10912 | /* --------------------------------------------------------------------------- |
| 10913 | \fn sme_StopBatchScanInd |
| 10914 | \brief API to stop batch scan request in FW |
| 10915 | \param hHal - The handle returned by macOpen. |
| 10916 | \param pRequest - Pointer to the batch request. |
| 10917 | \param sessionId - session ID |
| 10918 | \return eHalStatus |
| 10919 | ---------------------------------------------------------------------------*/ |
| 10920 | eHalStatus sme_StopBatchScanInd |
| 10921 | ( |
| 10922 | tHalHandle hHal, tSirStopBatchScanInd *pRequest, tANI_U8 sessionId |
| 10923 | ) |
| 10924 | { |
| 10925 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10926 | eHalStatus status; |
| 10927 | |
| 10928 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 10929 | { |
| 10930 | status = pmcStopBatchScanInd(hHal, pRequest, sessionId); |
| 10931 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10932 | } |
| 10933 | |
| 10934 | return status; |
| 10935 | } |
| 10936 | |
| 10937 | #endif |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 10938 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10939 | |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 10940 | #ifdef FEATURE_WLAN_CH_AVOID |
| 10941 | /* --------------------------------------------------------------------------- |
| 10942 | \fn sme_AddChAvoidCallback |
| 10943 | \brief Used to plug in callback function |
| 10944 | Which notify channel may not be used with SAP or P2PGO mode. |
| 10945 | Notification come from FW. |
| 10946 | \param hHal |
| 10947 | \param pCallbackfn : callback function pointer should be plugged in |
| 10948 | \- return eHalStatus |
| 10949 | -------------------------------------------------------------------------*/ |
| 10950 | eHalStatus sme_AddChAvoidCallback |
| 10951 | ( |
| 10952 | tHalHandle hHal, |
| 10953 | void (*pCallbackfn)(void *pAdapter, void *indParam) |
| 10954 | ) |
| 10955 | { |
| 10956 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10957 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10958 | |
| 10959 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10960 | "%s: Plug in CH AVOID CB", __func__); |
| 10961 | |
| 10962 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 10963 | if (eHAL_STATUS_SUCCESS == status) |
| 10964 | { |
| 10965 | if (NULL != pCallbackfn) |
| 10966 | { |
| 10967 | pMac->sme.pChAvoidNotificationCb = pCallbackfn; |
| 10968 | } |
| 10969 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10970 | } |
| 10971 | |
| 10972 | return(status); |
| 10973 | } |
| 10974 | #endif /* FEATURE_WLAN_CH_AVOID */ |
| 10975 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10976 | void activeListCmdTimeoutHandle(void *userData) |
| 10977 | { |
| 10978 | if (NULL == userData) |
| 10979 | return; |
| 10980 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10981 | "%s: Active List command timeout Cmd List Count %d", __func__, |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 10982 | csrLLCount(&((tpAniSirGlobal) userData)->sme.smeCmdActiveList) ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10983 | smeGetCommandQStatus((tHalHandle) userData); |
| 10984 | } |
| 10985 | |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 10986 | #ifdef WLAN_FEATURE_LINK_LAYER_STATS |
| 10987 | |
| 10988 | /* --------------------------------------------------------------------------- |
| 10989 | \fn sme_LLStatsSetReq |
| 10990 | \brief API to set link layer stats request to FW |
| 10991 | \param hHal - The handle returned by macOpen. |
| 10992 | |
| 10993 | \Param pStatsReq - a pointer to a caller allocated object of |
| 10994 | typedef struct tSirLLStatsSetReq, signifying the parameters to link layer |
| 10995 | stats set. |
| 10996 | |
| 10997 | \return eHalStatus |
| 10998 | ---------------------------------------------------------------------------*/ |
| 10999 | eHalStatus sme_LLStatsSetReq(tHalHandle hHal, |
| 11000 | tSirLLStatsSetReq *pLinkLayerStatsSetReq) |
| 11001 | { |
| 11002 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11003 | vos_msg_t msg; |
| 11004 | eHalStatus status = eHAL_STATUS_FAILURE; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11005 | tSirLLStatsSetReq *plinkLayerSetReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11006 | |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11007 | plinkLayerSetReq = vos_mem_malloc(sizeof(*plinkLayerSetReq)); |
| 11008 | if ( !plinkLayerSetReq) |
| 11009 | { |
| 11010 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11011 | "%s: Not able to allocate memory for " |
| 11012 | "WDA_LINK_LAYER_STATS_SET_REQ", |
| 11013 | __func__); |
| 11014 | return eHAL_STATUS_FAILURE; |
| 11015 | } |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11016 | |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11017 | *plinkLayerSetReq = *pLinkLayerStatsSetReq; |
| 11018 | |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11019 | |
| 11020 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 11021 | { |
| 11022 | msg.type = WDA_LINK_LAYER_STATS_SET_REQ; |
| 11023 | msg.reserved = 0; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11024 | msg.bodyptr = plinkLayerSetReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11025 | |
| 11026 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 11027 | { |
| 11028 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 11029 | "Not able to post SIR_HAL_LL_STATS_SET message to HAL", __func__); |
| 11030 | status = eHAL_STATUS_FAILURE; |
| 11031 | } |
| 11032 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11033 | } |
| 11034 | else |
| 11035 | { |
| 11036 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 11037 | "sme_AcquireGlobalLock error", __func__); |
| 11038 | } |
| 11039 | return status; |
| 11040 | } |
| 11041 | |
| 11042 | /* --------------------------------------------------------------------------- |
| 11043 | \fn sme_LLStatsGetReq |
| 11044 | \brief API to get link layer stats request to FW |
| 11045 | \param hHal - The handle returned by macOpen. |
| 11046 | |
| 11047 | \Param pStatsReq - a pointer to a caller allocated object of |
| 11048 | typedef struct tSirLLStatsGetReq, signifying the parameters to link layer |
| 11049 | stats get. |
| 11050 | |
| 11051 | \return eHalStatus |
| 11052 | ---------------------------------------------------------------------------*/ |
| 11053 | eHalStatus sme_LLStatsGetReq(tHalHandle hHal, |
| 11054 | tSirLLStatsGetReq *pLinkLayerStatsGetReq) |
| 11055 | { |
| 11056 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11057 | vos_msg_t msg; |
| 11058 | eHalStatus status = eHAL_STATUS_FAILURE; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11059 | tSirLLStatsGetReq *pGetStatsReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11060 | |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11061 | pGetStatsReq = vos_mem_malloc(sizeof(*pGetStatsReq)); |
| 11062 | if ( !pGetStatsReq) |
| 11063 | { |
| 11064 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11065 | "%s: Not able to allocate memory for " |
| 11066 | "WDA_LINK_LAYER_STATS_GET_REQ", |
| 11067 | __func__); |
| 11068 | return eHAL_STATUS_FAILURE; |
| 11069 | } |
| 11070 | *pGetStatsReq = *pLinkLayerStatsGetReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11071 | |
| 11072 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 11073 | { |
| 11074 | msg.type = WDA_LINK_LAYER_STATS_GET_REQ; |
| 11075 | msg.reserved = 0; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11076 | msg.bodyptr = pGetStatsReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11077 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 11078 | { |
| 11079 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 11080 | "Not able to post SIR_HAL_LL_STATS_GET message to HAL", __func__); |
| 11081 | status = eHAL_STATUS_FAILURE; |
| 11082 | } |
| 11083 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11084 | } |
| 11085 | else |
| 11086 | { |
| 11087 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 11088 | "sme_AcquireGlobalLock error", __func__); |
| 11089 | } |
| 11090 | return status; |
| 11091 | } |
| 11092 | |
| 11093 | /* --------------------------------------------------------------------------- |
| 11094 | \fn sme_LLStatsClearReq |
| 11095 | \brief API to clear link layer stats request to FW |
| 11096 | \param hHal - The handle returned by macOpen. |
| 11097 | |
| 11098 | \Param pStatsReq - a pointer to a caller allocated object of |
| 11099 | typedef struct tSirLLStatsClearReq, signifying the parameters to link layer |
| 11100 | stats clear. |
| 11101 | |
| 11102 | \return eHalStatus |
| 11103 | ---------------------------------------------------------------------------*/ |
| 11104 | eHalStatus sme_LLStatsClearReq(tHalHandle hHal, |
| 11105 | tSirLLStatsClearReq *pLinkLayerStatsClear) |
| 11106 | { |
| 11107 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11108 | vos_msg_t msg; |
| 11109 | eHalStatus status = eHAL_STATUS_FAILURE; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11110 | tSirLLStatsClearReq *pClearStatsReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11111 | |
| 11112 | |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11113 | |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11114 | pClearStatsReq = vos_mem_malloc(sizeof(*pClearStatsReq)); |
| 11115 | if ( !pClearStatsReq) |
| 11116 | { |
| 11117 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11118 | "%s: Not able to allocate memory for " |
| 11119 | "WDA_LINK_LAYER_STATS_CLEAR_REQ", |
| 11120 | __func__); |
| 11121 | return eHAL_STATUS_FAILURE; |
| 11122 | } |
| 11123 | |
| 11124 | *pClearStatsReq = *pLinkLayerStatsClear; |
| 11125 | |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11126 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 11127 | { |
| 11128 | msg.type = WDA_LINK_LAYER_STATS_CLEAR_REQ; |
| 11129 | msg.reserved = 0; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11130 | msg.bodyptr = pClearStatsReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11131 | |
| 11132 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 11133 | { |
| 11134 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 11135 | "Not able to post SIR_HAL_LL_STATS_CLEAR message to HAL", __func__); |
| 11136 | status = eHAL_STATUS_FAILURE; |
| 11137 | } |
| 11138 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11139 | } |
| 11140 | else |
| 11141 | { |
| 11142 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 11143 | "sme_AcquireGlobalLock error", __func__); |
| 11144 | } |
| 11145 | |
| 11146 | return status; |
| 11147 | } |
| 11148 | |
| 11149 | /* --------------------------------------------------------------------------- |
| 11150 | \fn sme_SetLinkLayerStatsIndCB |
| 11151 | \brief API to trigger Link Layer Statistic indications from FW |
| 11152 | \param hHal - The handle returned by macOpen. |
| 11153 | \param sessionId - session ID |
| 11154 | \param callbackRoutine - HDD callback which needs to be invoked after |
| 11155 | getting Link Layer Statistics from FW |
| 11156 | \param callbackContext - pAdapter context |
| 11157 | \return eHalStatus |
| 11158 | ---------------------------------------------------------------------------*/ |
| 11159 | eHalStatus sme_SetLinkLayerStatsIndCB |
| 11160 | ( |
Dino Mycle | d3d5002 | 2014-07-07 12:58:25 +0530 | [diff] [blame] | 11161 | tHalHandle hHal, |
| 11162 | void (*callbackRoutine) (void *callbackCtx, int indType, void *pRsp, |
| 11163 | tANI_U8 *macAddr) |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11164 | ) |
| 11165 | { |
| 11166 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11167 | eHalStatus status; |
| 11168 | |
| 11169 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 11170 | { |
| 11171 | if (NULL != callbackRoutine) |
| 11172 | { |
| 11173 | pMac->sme.pLinkLayerStatsIndCallback = callbackRoutine; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11174 | } |
| 11175 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11176 | } |
| 11177 | |
| 11178 | return status; |
| 11179 | } |
| 11180 | #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ |
| 11181 | |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 11182 | eHalStatus sme_UpdateConnectDebug(tHalHandle hHal, tANI_U32 set_value) |
| 11183 | { |
| 11184 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11185 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11186 | pMac->fEnableDebugLog = set_value; |
| 11187 | return (status); |
| 11188 | } |
| 11189 | |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11190 | VOS_STATUS sme_UpdateDSCPtoUPMapping( tHalHandle hHal, |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11191 | sme_QosWmmUpType *dscpmapping, |
| 11192 | v_U8_t sessionId ) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11193 | { |
| 11194 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11195 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11196 | v_U8_t i, j, peSessionId; |
| 11197 | tCsrRoamSession *pCsrSession = NULL; |
| 11198 | tpPESession pSession = NULL; |
| 11199 | |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11200 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 11201 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 11202 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11203 | if (!CSR_IS_SESSION_VALID( pMac, sessionId )) |
| 11204 | { |
| 11205 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11206 | "%s: Invalid session Id %u", __func__, sessionId); |
| 11207 | sme_ReleaseGlobalLock( &pMac->sme); |
| 11208 | return eHAL_STATUS_FAILURE; |
| 11209 | } |
| 11210 | pCsrSession = CSR_GET_SESSION( pMac, sessionId ); |
| 11211 | |
| 11212 | if (pCsrSession == NULL) |
| 11213 | { |
| 11214 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11215 | "%s: CSR Session lookup fails %u", __func__, sessionId); |
| 11216 | sme_ReleaseGlobalLock( &pMac->sme); |
| 11217 | return eHAL_STATUS_FAILURE; |
| 11218 | } |
| 11219 | |
| 11220 | pSession = peFindSessionByBssid( pMac, |
| 11221 | pCsrSession->connectedProfile.bssid, &peSessionId ); |
| 11222 | |
| 11223 | if (pSession == NULL) |
| 11224 | { |
| 11225 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11226 | "%s: Session lookup fails for BSSID", __func__); |
| 11227 | sme_ReleaseGlobalLock( &pMac->sme); |
| 11228 | return eHAL_STATUS_FAILURE; |
| 11229 | } |
| 11230 | |
| 11231 | if ( !pSession->QosMapSet.present ) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11232 | { |
| 11233 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11234 | "%s: QOS Mapping IE not present", __func__); |
| 11235 | sme_ReleaseGlobalLock( &pMac->sme); |
| 11236 | return eHAL_STATUS_FAILURE; |
| 11237 | } |
| 11238 | else |
| 11239 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11240 | for (i = 0; i < SME_QOS_WMM_UP_MAX; i++) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11241 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11242 | for (j = pSession->QosMapSet.dscp_range[i][0]; |
| 11243 | j <= pSession->QosMapSet.dscp_range[i][1]; j++) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11244 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11245 | if ((pSession->QosMapSet.dscp_range[i][0] == 255) && |
| 11246 | (pSession->QosMapSet.dscp_range[i][1] == 255)) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11247 | { |
| 11248 | dscpmapping[j]= 0; |
| 11249 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11250 | "%s: User Priority %d is not used in mapping", |
| 11251 | __func__, i); |
| 11252 | break; |
| 11253 | } |
| 11254 | else |
| 11255 | { |
| 11256 | dscpmapping[j]= i; |
| 11257 | } |
| 11258 | } |
| 11259 | } |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11260 | for (i = 0; i< pSession->QosMapSet.num_dscp_exceptions; i++) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11261 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11262 | if (pSession->QosMapSet.dscp_exceptions[i][0] != 255) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11263 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11264 | dscpmapping[pSession->QosMapSet.dscp_exceptions[i][0] ] = |
| 11265 | pSession->QosMapSet.dscp_exceptions[i][1]; |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11266 | } |
| 11267 | } |
| 11268 | } |
| 11269 | } |
| 11270 | sme_ReleaseGlobalLock( &pMac->sme); |
| 11271 | return status; |
| 11272 | } |
Agarwal Ashish | 5e41479 | 2014-06-08 15:25:23 +0530 | [diff] [blame] | 11273 | |
Agarwal Ashish | 5e41479 | 2014-06-08 15:25:23 +0530 | [diff] [blame] | 11274 | tANI_BOOLEAN sme_Is11dCountrycode(tHalHandle hHal) |
| 11275 | { |
| 11276 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11277 | |
| 11278 | if (VOS_TRUE == vos_mem_compare(pMac->scan.countryCodeCurrent, |
| 11279 | pMac->scan.countryCode11d, 2)) |
| 11280 | { |
| 11281 | return eANI_BOOLEAN_TRUE; |
| 11282 | } |
| 11283 | else |
| 11284 | { |
| 11285 | return eANI_BOOLEAN_FALSE; |
| 11286 | } |
| 11287 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11288 | |
Siddharth Bhal | 7697221 | 2014-10-15 16:22:51 +0530 | [diff] [blame] | 11289 | tANI_BOOLEAN sme_SpoofMacAddrReq(tHalHandle hHal, v_MACADDR_t *macaddr) |
Siddharth Bhal | 6af5d4e | 2014-09-29 21:11:16 +0530 | [diff] [blame] | 11290 | { |
| 11291 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11292 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11293 | tANI_U16 len; |
| 11294 | |
| 11295 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 11296 | { |
| 11297 | tpSirSpoofMacAddrReq pMsg; |
| 11298 | |
| 11299 | /* Create the message and send to lim */ |
| 11300 | len = sizeof(tSirSpoofMacAddrReq); |
| 11301 | pMsg = vos_mem_malloc(len); |
| 11302 | if ( NULL == pMsg ) |
| 11303 | status = eHAL_STATUS_FAILURE; |
| 11304 | else |
| 11305 | { |
| 11306 | vos_mem_set(pMsg, sizeof(tSirSpoofMacAddrReq), 0); |
| 11307 | pMsg->messageType = eWNI_SME_MAC_SPOOF_ADDR_IND; |
| 11308 | pMsg->length = len; |
| 11309 | /* Data starts from here */ |
| 11310 | vos_mem_copy(pMsg->macAddr, macaddr->bytes, VOS_MAC_ADDRESS_LEN); |
| 11311 | |
| 11312 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 11313 | } |
| 11314 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11315 | } |
| 11316 | return status; |
| 11317 | } |
| 11318 | |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11319 | #ifdef WLAN_FEATURE_EXTSCAN |
| 11320 | /* --------------------------------------------------------------------------- |
| 11321 | \fn sme_GetValidChannelsByBand |
| 11322 | \brief SME API to fetch all valid channel filtered by band |
| 11323 | \param hHal |
| 11324 | \param wifiBand: RF band information |
| 11325 | \param aValidChannels: Array to store channel info |
| 11326 | \param len: number of channels |
| 11327 | \- return eHalStatus |
| 11328 | -------------------------------------------------------------------------*/ |
| 11329 | eHalStatus sme_GetValidChannelsByBand (tHalHandle hHal, tANI_U8 wifiBand, |
| 11330 | tANI_U32 *aValidChannels, tANI_U8 *pNumChannels) |
| 11331 | { |
| 11332 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11333 | tANI_U8 chanList[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0}; |
| 11334 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11335 | tANI_U8 numChannels = 0; |
| 11336 | tANI_U8 i = 0; |
| 11337 | tANI_U32 totValidChannels = WNI_CFG_VALID_CHANNEL_LIST_LEN; |
| 11338 | |
| 11339 | if (!aValidChannels || !pNumChannels) { |
| 11340 | smsLog(pMac, VOS_TRACE_LEVEL_ERROR, |
| 11341 | FL("Output channel list/NumChannels is NULL")); |
| 11342 | return eHAL_STATUS_INVALID_PARAMETER; |
| 11343 | } |
| 11344 | |
| 11345 | if ((wifiBand < WIFI_BAND_UNSPECIFIED) || (wifiBand >= WIFI_BAND_MAX)) { |
| 11346 | smsLog(pMac, VOS_TRACE_LEVEL_ERROR, |
| 11347 | FL("Invalid wifiBand (%d)"), wifiBand); |
| 11348 | return eHAL_STATUS_INVALID_PARAMETER; |
| 11349 | } |
| 11350 | |
| 11351 | status = sme_GetCfgValidChannels(hHal, &chanList[0], |
| 11352 | &totValidChannels); |
| 11353 | if (!HAL_STATUS_SUCCESS(status)) { |
| 11354 | smsLog(pMac, VOS_TRACE_LEVEL_ERROR, |
| 11355 | FL("Failed to get valid channel list (err=%d)"), status); |
| 11356 | return status; |
| 11357 | } |
| 11358 | |
| 11359 | switch (wifiBand) { |
| 11360 | case WIFI_BAND_UNSPECIFIED: |
| 11361 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, FL("Unspecified wifiBand, " |
| 11362 | "return all (%d) valid channels"), totValidChannels); |
| 11363 | numChannels = totValidChannels; |
| 11364 | for (i = 0; i < numChannels; i++) |
| 11365 | aValidChannels[i] = vos_chan_to_freq(chanList[i]); |
| 11366 | break; |
| 11367 | |
| 11368 | case WIFI_BAND_BG: |
| 11369 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, FL("WIFI_BAND_BG (2.4 GHz)")); |
| 11370 | for (i = 0; i < totValidChannels; i++) |
| 11371 | if (CSR_IS_CHANNEL_24GHZ(chanList[i])) |
| 11372 | aValidChannels[numChannels++] = |
| 11373 | vos_chan_to_freq(chanList[i]); |
| 11374 | break; |
| 11375 | |
| 11376 | case WIFI_BAND_A: |
| 11377 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, |
| 11378 | FL("WIFI_BAND_A (5 GHz without DFS)")); |
| 11379 | for (i = 0; i < totValidChannels; i++) |
| 11380 | if (CSR_IS_CHANNEL_5GHZ(chanList[i]) && |
| 11381 | !CSR_IS_CHANNEL_DFS(chanList[i])) |
| 11382 | aValidChannels[numChannels++] = |
| 11383 | vos_chan_to_freq(chanList[i]); |
| 11384 | break; |
| 11385 | |
| 11386 | case WIFI_BAND_ABG: |
| 11387 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, |
| 11388 | FL("WIFI_BAND_ABG (2.4 GHz + 5 GHz; no DFS)")); |
| 11389 | for (i = 0; i < totValidChannels; i++) |
| 11390 | if ((CSR_IS_CHANNEL_24GHZ(chanList[i]) || |
| 11391 | CSR_IS_CHANNEL_5GHZ(chanList[i])) && |
| 11392 | !CSR_IS_CHANNEL_DFS(chanList[i])) |
| 11393 | aValidChannels[numChannels++] = |
| 11394 | vos_chan_to_freq(chanList[i]); |
| 11395 | break; |
| 11396 | |
| 11397 | case WIFI_BAND_A_DFS_ONLY: |
| 11398 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, |
| 11399 | FL("WIFI_BAND_A_DFS (5 GHz DFS only)")); |
| 11400 | for (i = 0; i < totValidChannels; i++) |
| 11401 | if (CSR_IS_CHANNEL_5GHZ(chanList[i]) && |
| 11402 | CSR_IS_CHANNEL_DFS(chanList[i])) |
| 11403 | aValidChannels[numChannels++] = |
| 11404 | vos_chan_to_freq(chanList[i]); |
| 11405 | break; |
| 11406 | |
| 11407 | case WIFI_BAND_A_WITH_DFS: |
| 11408 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, |
| 11409 | FL("WIFI_BAND_A_WITH_DFS (5 GHz with DFS)")); |
| 11410 | for (i = 0; i < totValidChannels; i++) |
| 11411 | if (CSR_IS_CHANNEL_5GHZ(chanList[i])) |
| 11412 | aValidChannels[numChannels++] = |
| 11413 | vos_chan_to_freq(chanList[i]); |
| 11414 | break; |
| 11415 | |
| 11416 | case WIFI_BAND_ABG_WITH_DFS: |
| 11417 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, |
| 11418 | FL("WIFI_BAND_ABG_WITH_DFS (2.4 GHz + 5 GHz with DFS)")); |
| 11419 | for (i = 0; i < totValidChannels; i++) |
| 11420 | if (CSR_IS_CHANNEL_24GHZ(chanList[i]) || |
| 11421 | CSR_IS_CHANNEL_5GHZ(chanList[i])) |
| 11422 | aValidChannels[numChannels++] = |
| 11423 | vos_chan_to_freq(chanList[i]); |
| 11424 | break; |
| 11425 | |
| 11426 | default: |
| 11427 | smsLog(pMac, VOS_TRACE_LEVEL_ERROR, |
| 11428 | FL("Unknown wifiBand (%d))"), wifiBand); |
| 11429 | return eHAL_STATUS_INVALID_PARAMETER; |
| 11430 | break; |
| 11431 | } |
| 11432 | *pNumChannels = numChannels; |
| 11433 | |
| 11434 | return status; |
| 11435 | } |
| 11436 | /* --------------------------------------------------------------------------- |
| 11437 | \fn sme_EXTScanGetCapabilities |
| 11438 | \brief SME API to fetch Extended Scan capabilities |
| 11439 | \param hHal |
| 11440 | \param pReq: Extended Scan capabilities structure |
| 11441 | \- return eHalStatus |
| 11442 | -------------------------------------------------------------------------*/ |
| 11443 | eHalStatus sme_EXTScanGetCapabilities (tHalHandle hHal, |
| 11444 | tSirGetEXTScanCapabilitiesReqParams *pReq) |
| 11445 | { |
| 11446 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11447 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 11448 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11449 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11450 | tSirGetEXTScanCapabilitiesReqParams *pGetEXTScanCapabilitiesReq; |
| 11451 | |
| 11452 | pGetEXTScanCapabilitiesReq = |
| 11453 | vos_mem_malloc(sizeof(*pGetEXTScanCapabilitiesReq)); |
| 11454 | if ( !pGetEXTScanCapabilitiesReq) |
| 11455 | { |
| 11456 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11457 | "%s: Not able to allocate memory for " |
| 11458 | "WDA_EXTSCAN_GET_CAPABILITIES_REQ", |
| 11459 | __func__); |
| 11460 | return eHAL_STATUS_FAILURE; |
| 11461 | } |
| 11462 | |
| 11463 | *pGetEXTScanCapabilitiesReq = *pReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11464 | |
| 11465 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11466 | TRACE_CODE_SME_RX_HDD_EXTSCAN_GET_CAPABILITIES, NO_SESSION, 0)); |
| 11467 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 11468 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11469 | vosMessage.bodyptr = pGetEXTScanCapabilitiesReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11470 | vosMessage.type = WDA_EXTSCAN_GET_CAPABILITIES_REQ; |
| 11471 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 11472 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 11473 | status = eHAL_STATUS_FAILURE; |
| 11474 | |
| 11475 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11476 | } |
| 11477 | return(status); |
| 11478 | } |
| 11479 | |
| 11480 | /* --------------------------------------------------------------------------- |
| 11481 | \fn sme_EXTScanStart |
| 11482 | \brief SME API to issue Extended Scan start |
| 11483 | \param hHal |
| 11484 | \param pStartCmd: Extended Scan start structure |
| 11485 | \- return eHalStatus |
| 11486 | -------------------------------------------------------------------------*/ |
| 11487 | eHalStatus sme_EXTScanStart (tHalHandle hHal, |
| 11488 | tSirEXTScanStartReqParams *pStartCmd) |
| 11489 | { |
| 11490 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11491 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 11492 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11493 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11494 | tSirEXTScanStartReqParams *pextScanStartReq; |
| 11495 | |
| 11496 | pextScanStartReq = vos_mem_malloc(sizeof(*pextScanStartReq)); |
| 11497 | if ( !pextScanStartReq) |
| 11498 | { |
| 11499 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11500 | "%s: Not able to allocate memory for " |
| 11501 | "WDA_EXTSCAN_START_REQ", |
| 11502 | __func__); |
| 11503 | return eHAL_STATUS_FAILURE; |
| 11504 | } |
| 11505 | |
| 11506 | *pextScanStartReq = *pStartCmd; |
| 11507 | |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11508 | |
| 11509 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11510 | TRACE_CODE_SME_RX_HDD_EXTSCAN_START, NO_SESSION, 0)); |
| 11511 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 11512 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11513 | vosMessage.bodyptr = pextScanStartReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11514 | vosMessage.type = WDA_EXTSCAN_START_REQ; |
| 11515 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 11516 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 11517 | status = eHAL_STATUS_FAILURE; |
| 11518 | |
| 11519 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11520 | } |
| 11521 | return(status); |
| 11522 | } |
| 11523 | |
| 11524 | /* --------------------------------------------------------------------------- |
| 11525 | \fn sme_EXTScanStop |
| 11526 | \brief SME API to issue Extended Scan stop |
| 11527 | \param hHal |
| 11528 | \param pStopReq: Extended Scan stop structure |
| 11529 | \- return eHalStatus |
| 11530 | -------------------------------------------------------------------------*/ |
| 11531 | eHalStatus sme_EXTScanStop(tHalHandle hHal, tSirEXTScanStopReqParams *pStopReq) |
| 11532 | { |
| 11533 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11534 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 11535 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11536 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11537 | tSirEXTScanStopReqParams *pEXTScanStopReq; |
| 11538 | |
| 11539 | pEXTScanStopReq = vos_mem_malloc(sizeof(*pEXTScanStopReq)); |
| 11540 | if ( !pEXTScanStopReq) |
| 11541 | { |
| 11542 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11543 | "%s: Not able to allocate memory for " |
| 11544 | "WDA_EXTSCAN_STOP_REQ", |
| 11545 | __func__); |
| 11546 | return eHAL_STATUS_FAILURE; |
| 11547 | } |
| 11548 | |
| 11549 | *pEXTScanStopReq = *pStopReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11550 | |
| 11551 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11552 | TRACE_CODE_SME_RX_HDD_EXTSCAN_STOP, NO_SESSION, 0)); |
| 11553 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 11554 | { |
| 11555 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11556 | vosMessage.bodyptr = pEXTScanStopReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11557 | vosMessage.type = WDA_EXTSCAN_STOP_REQ; |
| 11558 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 11559 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 11560 | { |
| 11561 | status = eHAL_STATUS_FAILURE; |
| 11562 | } |
| 11563 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11564 | } |
| 11565 | return(status); |
| 11566 | } |
| 11567 | |
| 11568 | /* --------------------------------------------------------------------------- |
| 11569 | \fn sme_SetBssHotlist |
| 11570 | \brief SME API to set BSSID hotlist |
| 11571 | \param hHal |
| 11572 | \param pSetHotListReq: Extended Scan set hotlist structure |
| 11573 | \- return eHalStatus |
| 11574 | -------------------------------------------------------------------------*/ |
| 11575 | eHalStatus sme_SetBssHotlist (tHalHandle hHal, |
| 11576 | tSirEXTScanSetBssidHotListReqParams *pSetHotListReq) |
| 11577 | { |
| 11578 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11579 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 11580 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11581 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11582 | tSirEXTScanSetBssidHotListReqParams *pEXTScanSetBssidHotlistReq; |
| 11583 | |
| 11584 | pEXTScanSetBssidHotlistReq = |
| 11585 | vos_mem_malloc(sizeof(*pEXTScanSetBssidHotlistReq)); |
| 11586 | if ( !pEXTScanSetBssidHotlistReq) |
| 11587 | { |
| 11588 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11589 | "%s: Not able to allocate memory for " |
| 11590 | "WDA_EXTSCAN_SET_BSSID_HOTLIST_REQ", |
| 11591 | __func__); |
| 11592 | return eHAL_STATUS_FAILURE; |
| 11593 | } |
| 11594 | |
| 11595 | *pEXTScanSetBssidHotlistReq = *pSetHotListReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11596 | |
| 11597 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11598 | TRACE_CODE_SME_RX_HDD_EXTSCAN_SET_BSS_HOTLIST, NO_SESSION, 0)); |
| 11599 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 11600 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11601 | vosMessage.bodyptr = pEXTScanSetBssidHotlistReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11602 | vosMessage.type = WDA_EXTSCAN_SET_BSSID_HOTLIST_REQ; |
| 11603 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 11604 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 11605 | status = eHAL_STATUS_FAILURE; |
| 11606 | |
| 11607 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11608 | } |
| 11609 | |
| 11610 | return(status); |
| 11611 | } |
| 11612 | |
| 11613 | /* --------------------------------------------------------------------------- |
| 11614 | \fn sme_ResetBssHotlist |
| 11615 | \brief SME API to reset BSSID hotlist |
| 11616 | \param hHal |
| 11617 | \param pSetHotListReq: Extended Scan set hotlist structure |
| 11618 | \- return eHalStatus |
| 11619 | -------------------------------------------------------------------------*/ |
| 11620 | eHalStatus sme_ResetBssHotlist (tHalHandle hHal, |
| 11621 | tSirEXTScanResetBssidHotlistReqParams *pResetReq) |
| 11622 | { |
| 11623 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11624 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 11625 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11626 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11627 | tSirEXTScanResetBssidHotlistReqParams *pEXTScanHotlistResetReq; |
| 11628 | |
| 11629 | pEXTScanHotlistResetReq = vos_mem_malloc(sizeof(*pEXTScanHotlistResetReq)); |
| 11630 | if ( !pEXTScanHotlistResetReq) |
| 11631 | { |
| 11632 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11633 | "%s: Not able to allocate memory for " |
| 11634 | "WDA_EXTSCAN_RESET_BSSID_HOTLIST_REQ", |
| 11635 | __func__); |
| 11636 | return eHAL_STATUS_FAILURE; |
| 11637 | } |
| 11638 | |
| 11639 | *pEXTScanHotlistResetReq = *pResetReq; |
| 11640 | |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11641 | |
| 11642 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11643 | TRACE_CODE_SME_RX_HDD_EXTSCAN_RESET_BSS_HOTLIST, NO_SESSION, 0)); |
| 11644 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 11645 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11646 | vosMessage.bodyptr = pEXTScanHotlistResetReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11647 | vosMessage.type = WDA_EXTSCAN_RESET_BSSID_HOTLIST_REQ; |
| 11648 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 11649 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 11650 | status = eHAL_STATUS_FAILURE; |
| 11651 | |
| 11652 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11653 | } |
| 11654 | return(status); |
| 11655 | } |
| 11656 | |
| 11657 | /* --------------------------------------------------------------------------- |
| 11658 | \fn sme_SetSignificantChange |
| 11659 | \brief SME API to set significant change |
| 11660 | \param hHal |
| 11661 | \param pSetSignificantChangeReq: Extended Scan set significant change structure |
| 11662 | \- return eHalStatus |
| 11663 | -------------------------------------------------------------------------*/ |
| 11664 | eHalStatus sme_SetSignificantChange (tHalHandle hHal, |
| 11665 | tSirEXTScanSetSignificantChangeReqParams *pSetSignificantChangeReq) |
| 11666 | { |
| 11667 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11668 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 11669 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11670 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11671 | tSirEXTScanSetSignificantChangeReqParams *pEXTScanSetSignificantReq; |
| 11672 | |
| 11673 | pEXTScanSetSignificantReq = vos_mem_malloc(sizeof(*pEXTScanSetSignificantReq)); |
| 11674 | if ( !pEXTScanSetSignificantReq) |
| 11675 | { |
| 11676 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11677 | "%s: Not able to allocate memory for " |
| 11678 | "WDA_EXTSCAN_SET_SIGNF_RSSI_CHANGE_REQ", |
| 11679 | __func__); |
| 11680 | return eHAL_STATUS_FAILURE; |
| 11681 | } |
| 11682 | |
| 11683 | *pEXTScanSetSignificantReq = *pSetSignificantChangeReq; |
| 11684 | |
| 11685 | |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11686 | |
| 11687 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11688 | TRACE_CODE_SME_RX_HDD_EXTSCAN_SET_SIGNF_CHANGE, NO_SESSION, 0)); |
| 11689 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 11690 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11691 | vosMessage.bodyptr = pEXTScanSetSignificantReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11692 | vosMessage.type = WDA_EXTSCAN_SET_SIGNF_RSSI_CHANGE_REQ; |
| 11693 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 11694 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 11695 | status = eHAL_STATUS_FAILURE; |
| 11696 | |
| 11697 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11698 | } |
| 11699 | return(status); |
| 11700 | } |
| 11701 | |
| 11702 | /* --------------------------------------------------------------------------- |
| 11703 | \fn sme_ResetSignificantChange |
| 11704 | \brief SME API to reset significant change |
| 11705 | \param hHal |
| 11706 | \param pResetReq: Extended Scan reset significant change structure |
| 11707 | \- return eHalStatus |
| 11708 | -------------------------------------------------------------------------*/ |
| 11709 | eHalStatus sme_ResetSignificantChange (tHalHandle hHal, |
| 11710 | tSirEXTScanResetSignificantChangeReqParams *pResetReq) |
| 11711 | { |
| 11712 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11713 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 11714 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11715 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11716 | tSirEXTScanResetSignificantChangeReqParams *pEXTScanResetSignificantReq; |
| 11717 | |
| 11718 | pEXTScanResetSignificantReq = |
| 11719 | vos_mem_malloc(sizeof(*pEXTScanResetSignificantReq)); |
| 11720 | if ( !pEXTScanResetSignificantReq) |
| 11721 | { |
| 11722 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11723 | "%s: Not able to allocate memory for " |
| 11724 | "WDA_EXTSCAN_RESET_SIGNF_RSSI_CHANGE_REQ", |
| 11725 | __func__); |
| 11726 | return eHAL_STATUS_FAILURE; |
| 11727 | } |
| 11728 | |
| 11729 | *pEXTScanResetSignificantReq = *pResetReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11730 | |
| 11731 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11732 | TRACE_CODE_SME_RX_HDD_EXTSCAN_RESET_SIGNF_CHANGE, NO_SESSION, 0)); |
| 11733 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 11734 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11735 | vosMessage.bodyptr = pEXTScanResetSignificantReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11736 | vosMessage.type = WDA_EXTSCAN_RESET_SIGNF_RSSI_CHANGE_REQ; |
| 11737 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 11738 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 11739 | status = eHAL_STATUS_FAILURE; |
| 11740 | |
| 11741 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11742 | } |
| 11743 | return(status); |
| 11744 | } |
| 11745 | |
| 11746 | /* --------------------------------------------------------------------------- |
| 11747 | \fn sme_getCachedResults |
| 11748 | \brief SME API to get cached results |
| 11749 | \param hHal |
| 11750 | \param pCachedResultsReq: Extended Scan get cached results structure |
| 11751 | \- return eHalStatus |
| 11752 | -------------------------------------------------------------------------*/ |
| 11753 | eHalStatus sme_getCachedResults (tHalHandle hHal, |
| 11754 | tSirEXTScanGetCachedResultsReqParams *pCachedResultsReq) |
| 11755 | { |
| 11756 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11757 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 11758 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11759 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11760 | tSirEXTScanGetCachedResultsReqParams *pEXTScanCachedResultsReq; |
| 11761 | |
| 11762 | pEXTScanCachedResultsReq = |
| 11763 | vos_mem_malloc(sizeof(*pEXTScanCachedResultsReq)); |
| 11764 | if ( !pEXTScanCachedResultsReq) |
| 11765 | { |
| 11766 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11767 | "%s: Not able to allocate memory for " |
| 11768 | "WDA_EXTSCAN_GET_CACHED_RESULTS_REQ", |
| 11769 | __func__); |
| 11770 | return eHAL_STATUS_FAILURE; |
| 11771 | } |
| 11772 | |
| 11773 | *pEXTScanCachedResultsReq = *pCachedResultsReq; |
| 11774 | |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11775 | |
| 11776 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11777 | TRACE_CODE_SME_RX_HDD_EXTSCAN_GET_CACHED_RESULTS, NO_SESSION, 0)); |
| 11778 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 11779 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11780 | vosMessage.bodyptr = pEXTScanCachedResultsReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11781 | vosMessage.type = WDA_EXTSCAN_GET_CACHED_RESULTS_REQ; |
| 11782 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 11783 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 11784 | status = eHAL_STATUS_FAILURE; |
| 11785 | |
| 11786 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11787 | } |
| 11788 | return(status); |
| 11789 | } |
| 11790 | |
| 11791 | eHalStatus sme_EXTScanRegisterCallback (tHalHandle hHal, |
| 11792 | void (*pEXTScanIndCb)(void *, const tANI_U16, void *), |
| 11793 | void *callbackContext) |
| 11794 | { |
| 11795 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11796 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11797 | |
| 11798 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 11799 | pMac->sme.pEXTScanIndCb = pEXTScanIndCb; |
| 11800 | pMac->sme.pEXTScanCallbackContext = callbackContext; |
| 11801 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11802 | } |
| 11803 | return(status); |
| 11804 | } |
| 11805 | |
Ganesh Kondabattini | 8f6e3b3 | 2014-08-25 16:07:54 +0530 | [diff] [blame] | 11806 | void sme_SetMiracastMode (tHalHandle hHal,tANI_U8 mode) |
| 11807 | { |
| 11808 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11809 | |
| 11810 | pMac->miracast_mode = mode; |
| 11811 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11812 | #endif /* WLAN_FEATURE_EXTSCAN */ |
c_hpothu | ef45bc3 | 2014-09-11 10:10:18 +0530 | [diff] [blame] | 11813 | |
| 11814 | void sme_resetCoexEevent(tHalHandle hHal) |
| 11815 | { |
| 11816 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11817 | |
| 11818 | if (pMac == NULL) |
| 11819 | { |
| 11820 | printk("btc: %s pMac is NULL \n",__func__); |
| 11821 | return; |
| 11822 | } |
| 11823 | |
| 11824 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 11825 | FL("isCoexScoIndSet: %d"), pMac->isCoexScoIndSet); |
| 11826 | |
| 11827 | if (pMac->isCoexScoIndSet) |
| 11828 | { |
| 11829 | pMac->isCoexScoIndSet = 0; |
| 11830 | ccmCfgSetInt(pMac, WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC, 0, |
| 11831 | NULL, eANI_BOOLEAN_FALSE); |
| 11832 | } |
| 11833 | |
| 11834 | return; |
| 11835 | } |
Agarwal Ashish | 738843c | 2014-09-25 12:27:56 +0530 | [diff] [blame] | 11836 | |
| 11837 | void sme_disable_dfs_channel(tHalHandle hHal, bool disbale_dfs) |
| 11838 | { |
| 11839 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11840 | pMac->scan.fEnableDFSChnlScan = !disbale_dfs; |
| 11841 | csrDisableDfsChannel(pMac); |
| 11842 | |
| 11843 | } |